@markdstage/markdstage 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/README.md +90 -0
  2. package/bin/markdstage.mjs +12 -0
  3. package/package.json +45 -0
  4. package/shared/README.md +1014 -0
  5. package/shared/THIRD-PARTY-NOTICES.md +19 -0
  6. package/shared/deck-state.mjs +105 -0
  7. package/shared/docs/custom-theme-authoring.md +208 -0
  8. package/shared/markdown-deck.mjs +220 -0
  9. package/shared/markdstage-guide.mjs +276 -0
  10. package/shared/presenter-window.mjs +17 -0
  11. package/shared/renderer/architecture-document.mjs +596 -0
  12. package/shared/renderer/architecture-edit.mjs +298 -0
  13. package/shared/renderer/architecture-editor.mjs +449 -0
  14. package/shared/renderer/architecture.mjs +4033 -0
  15. package/shared/renderer/import-path.mjs +11 -0
  16. package/shared/renderer/index.html +106 -0
  17. package/shared/renderer/renderer.js +2082 -0
  18. package/shared/renderer/slides.css +614 -0
  19. package/shared/renderer/speaker-notes.mjs +106 -0
  20. package/shared/renderer/theme.mjs +205 -0
  21. package/shared/runtime/browser.mjs +539 -0
  22. package/shared/runtime/custom-theme.mjs +135 -0
  23. package/shared/runtime/deck-session.mjs +188 -0
  24. package/shared/runtime/errors.mjs +17 -0
  25. package/shared/runtime/output-paths.mjs +159 -0
  26. package/shared/runtime/output.mjs +385 -0
  27. package/shared/runtime/presentation-server.mjs +505 -0
  28. package/shared/runtime/static-files.mjs +70 -0
  29. package/shared/schema/README.md +228 -0
  30. package/shared/schema/architecture-v1.schema.json +664 -0
  31. package/shared/schema/examples/web-app.architecture.json +119 -0
  32. package/shared/schema/theme-metadata-v1.schema.json +75 -0
  33. package/shared/schema/theme-v1.json +84 -0
  34. package/shared/scripts/architecture-assets.mjs +226 -0
  35. package/shared/scripts/asset-paths.mjs +92 -0
  36. package/shared/scripts/atomic-markdown-replace.mjs +46 -0
  37. package/shared/scripts/markdown-blocks.mjs +182 -0
  38. package/shared/scripts/markdown-files.mjs +63 -0
  39. package/shared/scripts/markdown-save-coordinator.mjs +18 -0
  40. package/shared/scripts/markdown-watcher.mjs +80 -0
  41. package/shared/scripts/theme-paths.mjs +108 -0
  42. package/shared/scripts/vendor-assets.mjs +132 -0
  43. package/shared/scripts/workspace-root.mjs +32 -0
  44. package/shared/vendor/highlight.LICENSE +29 -0
  45. package/shared/vendor/highlight.min.js +1244 -0
  46. package/shared/vendor/marked.min.js +6 -0
  47. package/shared/vendor/mermaid.min.js.part-0001 +268 -0
  48. package/shared/vendor/mermaid.min.js.part-0002 +304 -0
  49. package/shared/vendor/mermaid.min.js.part-0003 +324 -0
  50. package/shared/vendor/mermaid.min.js.part-0004 +374 -0
  51. package/shared/vendor/mermaid.min.js.part-0005 +564 -0
  52. package/shared/vendor/mermaid.min.js.part-0006 +1308 -0
  53. package/shared/vendor/mermaid.min.js.part-0007 +269 -0
  54. package/shared/vendor/purify.min.js +3 -0
  55. package/shared/vendor/vendor-assets.lock.json +60 -0
  56. package/src/cli.mjs +347 -0
  57. package/src/commands/capture.mjs +23 -0
  58. package/src/commands/export.mjs +18 -0
  59. package/src/commands/guide.mjs +23 -0
  60. package/src/commands/inspect.mjs +35 -0
  61. package/src/commands/present.mjs +91 -0
  62. package/src/commands/skill.mjs +114 -0
  63. package/src/commands/validate.mjs +79 -0
  64. package/src/deck.mjs +63 -0
  65. package/src/exit.mjs +58 -0
  66. package/src/runtime.mjs +77 -0
  67. package/src/skills.mjs +155 -0
@@ -0,0 +1,324 @@
1
+ bject Object]",VKe="[object RegExp]",WKe="[object Set]",qKe="[object String]",UKe="[object Symbol]",HKe="[object WeakMap]",YKe="[object ArrayBuffer]",jKe="[object DataView]",XKe="[object Float32Array]",KKe="[object Float64Array]",ZKe="[object Int8Array]",QKe="[object Int16Array]",JKe="[object Int32Array]",eZe="[object Uint8Array]",tZe="[object Uint8ClampedArray]",rZe="[object Uint16Array]",iZe="[object Uint32Array]",Ri={};Ri[uce]=Ri[OKe]=Ri[YKe]=Ri[jKe]=Ri[PKe]=Ri[BKe]=Ri[XKe]=Ri[KKe]=Ri[ZKe]=Ri[QKe]=Ri[JKe]=Ri[zKe]=Ri[GKe]=Ri[dce]=Ri[VKe]=Ri[WKe]=Ri[qKe]=Ri[UKe]=Ri[eZe]=Ri[tZe]=Ri[rZe]=Ri[iZe]=!0;Ri[FKe]=Ri[hce]=Ri[HKe]=!1;o(LS,"baseClone");MS=LS});function aZe(e){return MS(e,nZe)}var nZe,mI,fce=z(()=>{"use strict";pI();nZe=4;o(aZe,"clone");mI=aZe});function lZe(e){return MS(e,sZe|oZe)}var sZe,oZe,gI,pce=z(()=>{"use strict";pI();sZe=1,oZe=4;o(lZe,"cloneDeep");gI=lZe});function uZe(e){return this.__data__.set(e,cZe),this}var cZe,mce,gce=z(()=>{"use strict";cZe="__lodash_hash_undefined__";o(uZe,"setCacheAdd");mce=uZe});function hZe(e){return this.__data__.has(e)}var yce,vce=z(()=>{"use strict";o(hZe,"setCacheHas");yce=hZe});function NS(e){var t=-1,r=e==null?0:e.length;for(this.__data__=new Op;++t<r;)this.add(e[t])}var IS,yI=z(()=>{"use strict";mS();gce();vce();o(NS,"SetCache");NS.prototype.add=NS.prototype.push=mce;NS.prototype.has=yce;IS=NS});function dZe(e,t){for(var r=-1,i=e==null?0:e.length;++r<i;)if(t(e[r],r,e))return!0;return!1}var xce,bce=z(()=>{"use strict";o(dZe,"arraySome");xce=dZe});function fZe(e,t){return e.has(t)}var OS,vI=z(()=>{"use strict";o(fZe,"cacheHas");OS=fZe});function gZe(e,t,r,i,n,a){var s=r&pZe,l=e.length,u=t.length;if(l!=u&&!(s&&u>l))return!1;var h=a.get(e),d=a.get(t);if(h&&d)return h==t&&d==e;var f=-1,p=!0,m=r&mZe?new IS:void 0;for(a.set(e,t),a.set(t,e);++f<l;){var g=e[f],y=t[f];if(i)var v=s?i(y,g,f,t,e,a):i(g,y,f,e,t,a);if(v!==void 0){if(v)continue;p=!1;break}if(m){if(!xce(t,function(x,b){if(!OS(m,b)&&(g===x||n(g,x,r,i,a)))return m.push(b)})){p=!1;break}}else if(!(g===y||n(g,y,r,i,a))){p=!1;break}}return a.delete(e),a.delete(t),p}var pZe,mZe,PS,xI=z(()=>{"use strict";yI();bce();vI();pZe=1,mZe=2;o(gZe,"equalArrays");PS=gZe});function yZe(e){var t=-1,r=Array(e.size);return e.forEach(function(i,n){r[++t]=[n,i]}),r}var Tce,Cce=z(()=>{"use strict";o(yZe,"mapToArray");Tce=yZe});function vZe(e){var t=-1,r=Array(e.size);return e.forEach(function(i){r[++t]=i}),r}var Ug,BS=z(()=>{"use strict";o(vZe,"setToArray");Ug=vZe});function MZe(e,t,r,i,n,a,s){switch(r){case LZe:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case RZe:return!(e.byteLength!=t.byteLength||!a(new Wg(e),new Wg(t)));case TZe:case CZe:case SZe:return Vo(+e,+t);case kZe:return e.name==t.name&&e.message==t.message;case EZe:case _Ze:return e==t+"";case wZe:var l=Tce;case AZe:var u=i&xZe;if(l||(l=Ug),e.size!=t.size&&!u)return!1;var h=s.get(e);if(h)return h==t;i|=bZe,s.set(e,t);var d=PS(l(e),l(t),i,n,a,s);return s.delete(e),d;case DZe:if(bI)return bI.call(e)==bI.call(t)}return!1}var xZe,bZe,TZe,CZe,kZe,wZe,SZe,EZe,AZe,_Ze,DZe,RZe,LZe,kce,bI,wce,Sce=z(()=>{"use strict";Mp();hI();Ip();xI();Cce();BS();xZe=1,bZe=2,TZe="[object Boolean]",CZe="[object Date]",kZe="[object Error]",wZe="[object Map]",SZe="[object Number]",EZe="[object RegExp]",AZe="[object Set]",_Ze="[object String]",DZe="[object Symbol]",RZe="[object ArrayBuffer]",LZe="[object DataView]",kce=ra?ra.prototype:void 0,bI=kce?kce.valueOf:void 0;o(MZe,"equalByTag");wce=MZe});function PZe(e,t,r,i,n,a){var s=r&NZe,l=wb(e),u=l.length,h=wb(t),d=h.length;if(u!=d&&!s)return!1;for(var f=u;f--;){var p=l[f];if(!(s?p in t:OZe.call(t,p)))return!1}var m=a.get(e),g=a.get(t);if(m&&g)return m==t&&g==e;var y=!0;a.set(e,t),a.set(t,e);for(var v=s;++f<u;){p=l[f];var x=e[p],b=t[p];if(i)var T=s?i(b,x,p,t,e,a):i(x,b,p,e,t,a);if(!(T===void 0?x===b||n(x,b,r,i,a):T)){y=!1;break}v||(v=p=="constructor")}if(y&&!v){var w=e.constructor,C=t.constructor;w!=C&&"constructor"in e&&"constructor"in t&&!(typeof w=="function"&&w instanceof w&&typeof C=="function"&&C instanceof C)&&(y=!1)}return a.delete(e),a.delete(t),y}var NZe,IZe,OZe,Ece,Ace=z(()=>{"use strict";cI();NZe=1,IZe=Object.prototype,OZe=IZe.hasOwnProperty;o(PZe,"equalObjects");Ece=PZe});function $Ze(e,t,r,i,n,a){var s=Or(e),l=Or(t),u=s?Dce:lo(e),h=l?Dce:lo(t);u=u==_ce?FS:u,h=h==_ce?FS:h;var d=u==FS,f=h==FS,p=u==h;if(p&&Pl(e)){if(!Pl(t))return!1;s=!0,d=!1}if(p&&!d)return a||(a=new Dc),s||Cd(e)?PS(e,t,r,i,n,a):wce(e,t,u,r,i,n,a);if(!(r&BZe)){var m=d&&Rce.call(e,"__wrapped__"),g=f&&Rce.call(t,"__wrapped__");if(m||g){var y=m?e.value():e,v=g?t.value():t;return a||(a=new Dc),n(y,v,r,i,a)}}return p?(a||(a=new Dc),Ece(e,t,r,i,n,a)):!1}var BZe,_ce,Dce,FS,FZe,Rce,Lce,Mce=z(()=>{"use strict";kb();xI();Sce();Ace();Bp();An();Lg();gb();BZe=1,_ce="[object Arguments]",Dce="[object Array]",FS="[object Object]",FZe=Object.prototype,Rce=FZe.hasOwnProperty;o($Ze,"baseIsEqualDeep");Lce=$Ze});function Nce(e,t,r,i,n){return e===t?!0:e==null||t==null||!yn(e)&&!yn(t)?e!==e&&t!==t:Lce(e,t,r,i,Nce,n)}var $S,TI=z(()=>{"use strict";Mce();Il();o(Nce,"baseIsEqual");$S=Nce});function VZe(e,t,r,i){var n=r.length,a=n,s=!i;if(e==null)return!a;for(e=Object(e);n--;){var l=r[n];if(s&&l[2]?l[1]!==e[l[0]]:!(l[0]in e))return!1}for(;++n<a;){l=r[n];var u=l[0],h=e[u],d=l[1];if(s&&l[2]){if(h===void 0&&!(u in e))return!1}else{var f=new Dc;if(i)var p=i(h,d,u,e,t,f);if(!(p===void 0?$S(d,h,zZe|GZe,i,f):p))return!1}}return!0}var zZe,GZe,Ice,Oce=z(()=>{"use strict";kb();TI();zZe=1,GZe=2;o(VZe,"baseIsMatch");Ice=VZe});function WZe(e){return e===e&&!Hi(e)}var zS,CI=z(()=>{"use strict";Go();o(WZe,"isStrictComparable");zS=WZe});function qZe(e){for(var t=cn(e),r=t.length;r--;){var i=t[r],n=e[i];t[r]=[i,n,zS(n)]}return t}var Pce,Bce=z(()=>{"use strict";CI();qu();o(qZe,"getMatchData");Pce=qZe});function UZe(e,t){return function(r){return r==null?!1:r[e]===t&&(t!==void 0||e in Object(r))}}var GS,kI=z(()=>{"use strict";o(UZe,"matchesStrictComparable");GS=UZe});function HZe(e){var t=Pce(e);return t.length==1&&t[0][2]?GS(t[0][0],t[0][1]):function(r){return r===e||Ice(r,e,t)}}var Fce,$ce=z(()=>{"use strict";Oce();Bce();kI();o(HZe,"baseMatches");Fce=HZe});function YZe(e,t){return e!=null&&t in Object(e)}var zce,Gce=z(()=>{"use strict";o(YZe,"baseHasIn");zce=YZe});function jZe(e,t,r){t=_d(t,e);for(var i=-1,n=t.length,a=!1;++i<n;){var s=_c(t[i]);if(!(a=e!=null&&r(e,s)))break;e=e[s]}return a||++i!=n?a:(n=e==null?0:e.length,!!n&&Dg(n)&&gd(s,n)&&(Or(e)||Ol(e)))}var VS,wI=z(()=>{"use strict";Tb();Rg();An();lb();lS();Bg();o(jZe,"hasPath");VS=jZe});function XZe(e,t){return e!=null&&VS(e,t,zce)}var WS,SI=z(()=>{"use strict";Gce();wI();o(XZe,"hasIn");WS=XZe});function QZe(e,t){return Ng(e)&&zS(t)?GS(_c(e),t):function(r){var i=Xoe(r,e);return i===void 0&&i===t?WS(r,e):$S(t,i,KZe|ZZe)}}var KZe,ZZe,Vce,Wce=z(()=>{"use strict";TI();Koe();SI();fS();CI();kI();Bg();KZe=1,ZZe=2;o(QZe,"baseMatchesProperty");Vce=QZe});function JZe(e){return function(t){return t?.[e]}}var qS,EI=z(()=>{"use strict";o(JZe,"baseProperty");qS=JZe});function eQe(e){return function(t){return Dd(t,e)}}var qce,Uce=z(()=>{"use strict";Cb();o(eQe,"basePropertyDeep");qce=eQe});function tQe(e){return Ng(e)?qS(_c(e)):qce(e)}var Hce,Yce=z(()=>{"use strict";EI();Uce();fS();Bg();o(tQe,"property");Hce=tQe});function rQe(e){return typeof e=="function"?e:e==null?Ls:typeof e=="object"?Or(e)?Vce(e[0],e[1]):Fce(e):Hce(e)}var Ia,Hu=z(()=>{"use strict";$ce();Wce();pd();An();Yce();o(rQe,"baseIteratee");Ia=rQe});function iQe(e){return function(t,r,i){for(var n=-1,a=Object(t),s=i(t),l=s.length;l--;){var u=s[e?l:++n];if(r(a[u],u,a)===!1)break}return t}}var jce,Xce=z(()=>{"use strict";o(iQe,"createBaseFor");jce=iQe});var nQe,Hg,US=z(()=>{"use strict";Xce();nQe=jce(),Hg=nQe});function aQe(e,t){return e&&Hg(e,t,cn)}var Yg,HS=z(()=>{"use strict";US();qu();o(aQe,"baseForOwn");Yg=aQe});function sQe(e,t){return function(r,i){if(r==null)return r;if(!ia(r))return e(r,i);for(var n=r.length,a=t?n:-1,s=Object(r);(t?a--:++a<n)&&i(s[a],a,s)!==!1;);return r}}var Kce,Zce=z(()=>{"use strict";Ac();o(sQe,"createBaseEach");Kce=sQe});var oQe,Ld,Sb=z(()=>{"use strict";HS();Zce();oQe=Kce(Yg),Ld=oQe});var lQe,YS,Qce=z(()=>{"use strict";zo();lQe=o(function(){return ln.Date.now()},"now"),YS=lQe});var Jce,cQe,uQe,AI,eue=z(()=>{"use strict";hb();Ip();db();kd();Jce=Object.prototype,cQe=Jce.hasOwnProperty,uQe=xd(function(e,t){e=Object(e);var r=-1,i=t.length,n=i>2?t[2]:void 0;for(n&&Vu(t[0],t[1],n)&&(i=1);++r<i;)for(var a=t[r],s=Is(a),l=-1,u=s.length;++l<u;){var h=s[l],d=e[h];(d===void 0||Vo(d,Jce[h])&&!cQe.call(e,h))&&(e[h]=a[h])}return e}),AI=uQe});function hQe(e,t,r){(r!==void 0&&!Vo(e[t],r)||r===void 0&&!(t in e))&&yd(e,t,r)}var Eb,_I=z(()=>{"use strict";cb();Ip();o(hQe,"assignMergeValue");Eb=hQe});function dQe(e){return yn(e)&&ia(e)}var jS,DI=z(()=>{"use strict";Ac();Il();o(dQe,"isArrayLikeObject");jS=dQe});function fQe(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}var Ab,RI=z(()=>{"use strict";o(fQe,"safeGet");Ab=fQe});function pQe(e){return Ec(e,Is(e))}var tue,rue=z(()=>{"use strict";_g();kd();o(pQe,"toPlainObject");tue=pQe});function mQe(e,t,r,i,n,a,s){var l=Ab(e,r),u=Ab(t,r),h=s.get(u);if(h){Eb(e,r,h);return}var d=a?a(l,u,r+"",e,t,s):void 0,f=d===void 0;if(f){var p=Or(u),m=!p&&Pl(u),g=!p&&!m&&Cd(u);d=u,p||m||g?Or(l)?d=l:jS(l)?d=iS(l):m?(f=!1,d=bS(u,!0)):g?(f=!1,d=DS(u,!0)):d=[]:nle(u)||Ol(u)?(d=l,Ol(l)?d=tue(l):(!Hi(l)||Sc(l))&&(d=RS(u))):f=!1}f&&(s.set(u,d),n(d,u,i,a,s),s.delete(u)),Eb(e,r,d)}var iue,nue=z(()=>{"use strict";_I();nI();dI();WN();fI();Rg();An();DI();Lg();ob();Go();ale();gb();RI();rue();o(mQe,"baseMergeDeep");iue=mQe});function aue(e,t,r,i,n){e!==t&&Hg(t,function(a,s){if(n||(n=new Dc),Hi(a))iue(e,t,s,r,aue,i,n);else{var l=i?i(Ab(e,s),a,s+"",e,t,n):void 0;l===void 0&&(l=a),Eb(e,s,l)}},Is)}var sue,oue=z(()=>{"use strict";kb();_I();US();nue();Go();kd();RI();o(aue,"baseMerge");sue=aue});function gQe(e,t,r){for(var i=-1,n=e==null?0:e.length;++i<n;)if(r(t,e[i]))return!0;return!1}var lue,cue=z(()=>{"use strict";o(gQe,"arrayIncludesWith");lue=gQe});function yQe(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var Md,uue=z(()=>{"use strict";o(yQe,"last");Md=yQe});function vQe(e){return typeof e=="function"?e:Ls}var jg,XS=z(()=>{"use strict";pd();o(vQe,"castFunction");jg=vQe});function xQe(e,t){var r=Or(e)?aS:Ld;return r(e,jg(t))}var tt,LI=z(()=>{"use strict";YN();Sb();XS();An();o(xQe,"forEach");tt=xQe});var hue=z(()=>{"use strict";LI()});function bQe(e,t){var r=[];return Ld(e,function(i,n,a){t(i,n,a)&&r.push(i)}),r}var due,fue=z(()=>{"use strict";Sb();o(bQe,"baseFilter");due=bQe});function TQe(e,t){var r=Or(e)?TS:due;return r(e,Ia(t,3))}var ts,pue=z(()=>{"use strict";aI();fue();Hu();An();o(TQe,"filter");ts=TQe});function CQe(e){return function(t,r,i){var n=Object(t);if(!ia(t)){var a=Ia(r,3);t=cn(t),r=o(function(l){return a(n[l],l,n)},"predicate")}var s=e(t,r,i);return s>-1?n[a?t[s]:s]:void 0}}var mue,gue=z(()=>{"use strict";Hu();Ac();qu();o(CQe,"createFind");mue=CQe});function wQe(e,t,r){var i=e==null?0:e.length;if(!i)return-1;var n=r==null?0:dse(r);return n<0&&(n=kQe(i+n,0)),sS(e,Ia(t,3),n)}var kQe,yue,vue=z(()=>{"use strict";jN();Hu();fse();kQe=Math.max;o(wQe,"findIndex");yue=wQe});var SQe,Xg,xue=z(()=>{"use strict";gue();vue();SQe=mue(yue),Xg=SQe});function EQe(e,t){var r=-1,i=ia(e)?Array(e.length):[];return Ld(e,function(n,a,s){i[++r]=t(n,a,s)}),i}var KS,MI=z(()=>{"use strict";Sb();Ac();o(EQe,"baseMap");KS=EQe});function AQe(e,t){var r=Or(e)?wc:KS;return r(e,Ia(t,3))}var Jr,bue=z(()=>{"use strict";sb();Hu();MI();An();o(AQe,"map");Jr=AQe});function _Qe(e,t){return e==null?e:Hg(e,jg(t),Is)}var NI,Tue=z(()=>{"use strict";US();XS();kd();o(_Qe,"forIn");NI=_Qe});function DQe(e,t){return e&&Yg(e,jg(t))}var II,Cue=z(()=>{"use strict";HS();XS();o(DQe,"forOwn");II=DQe});function RQe(e,t){return e>t}var kue,wue=z(()=>{"use strict";o(RQe,"baseGt");kue=RQe});function NQe(e,t){return e!=null&&MQe.call(e,t)}var LQe,MQe,Sue,Eue=z(()=>{"use strict";LQe=Object.prototype,MQe=LQe.hasOwnProperty;o(NQe,"baseHas");Sue=NQe});function IQe(e,t){return e!=null&&VS(e,t,Sue)}var _b,Aue=z(()=>{"use strict";Eue();wI();o(IQe,"has");_b=IQe});function PQe(e){return typeof e=="string"||!Or(e)&&yn(e)&&es(e)==OQe}var OQe,_ue,Due=z(()=>{"use strict";fd();An();Il();OQe="[object String]";o(PQe,"isString");_ue=PQe});function BQe(e,t){return wc(t,function(r){return e[r]})}var Rue,Lue=z(()=>{"use strict";sb();o(BQe,"baseValues");Rue=BQe});function FQe(e){return e==null?[]:Rue(e,cn(e))}var co,Mue=z(()=>{"use strict";Lue();qu();o(FQe,"values");co=FQe});function WQe(e){if(e==null)return!0;if(ia(e)&&(Or(e)||typeof e=="string"||typeof e.splice=="function"||Pl(e)||Cd(e)||Ol(e)))return!e.length;var t=lo(e);if(t==$Qe||t==zQe)return!e.size;if(bd(e))return!Mg(e).length;for(var r in e)if(VQe.call(e,r))return!1;return!0}var $Qe,zQe,GQe,VQe,ZS,Nue=z(()=>{"use strict";dS();Bp();Rg();An();Ac();Lg();fb();gb();$Qe="[object Map]",zQe="[object Set]",GQe=Object.prototype,VQe=GQe.hasOwnProperty;o(WQe,"isEmpty");ZS=WQe});function qQe(e){return e===void 0}var yi,Iue=z(()=>{"use strict";o(qQe,"isUndefined");yi=qQe});function UQe(e,t){return e<t}var QS,OI=z(()=>{"use strict";o(UQe,"baseLt");QS=UQe});function HQe(e,t){var r={};return t=Ia(t,3),Yg(e,function(i,n,a){yd(r,n,t(i,n,a))}),r}var Fp,Oue=z(()=>{"use strict";cb();HS();Hu();o(HQe,"mapValues");Fp=HQe});function YQe(e,t,r){for(var i=-1,n=e.length;++i<n;){var a=e[i],s=t(a);if(s!=null&&(l===void 0?s===s&&!oo(s):r(s,l)))var l=s,u=a}return u}var Kg,JS=z(()=>{"use strict";Np();o(YQe,"baseExtremum");Kg=YQe});function jQe(e){return e&&e.length?Kg(e,Ls,kue):void 0}var Os,Pue=z(()=>{"use strict";JS();wue();pd();o(jQe,"max");Os=jQe});var XQe,Zg,Bue=z(()=>{"use strict";oue();qse();XQe=Wse(function(e,t,r){sue(e,t,r)}),Zg=XQe});function KQe(e){return e&&e.length?Kg(e,Ls,QS):void 0}var Yu,Fue=z(()=>{"use strict";JS();OI();pd();o(KQe,"min");Yu=KQe});function ZQe(e,t){return e&&e.length?Kg(e,Ia(t,2),QS):void 0}var $p,$ue=z(()=>{"use strict";JS();Hu();OI();o(ZQe,"minBy");$p=ZQe});function QQe(e,t,r,i){if(!Hi(e))return e;t=_d(t,e);for(var n=-1,a=t.length,s=a-1,l=e;l!=null&&++n<a;){var u=_c(t[n]),h=r;if(u==="__proto__"||u==="constructor"||u==="prototype")return e;if(n!=s){var d=l[u];h=i?i(d,u,l):void 0,h===void 0&&(h=Hi(d)?d:gd(t[n+1])?[]:{})}vd(l,u,h),l=l[u]}return e}var zue,Gue=z(()=>{"use strict";ub();Tb();lb();Go();Bg();o(QQe,"baseSet");zue=QQe});function JQe(e,t,r){for(var i=-1,n=t.length,a={};++i<n;){var s=t[i],l=Dd(e,s);r(l,s)&&zue(a,_d(s,e),l)}return a}var Vue,Wue=z(()=>{"use strict";Cb();Gue();Tb();o(JQe,"basePickBy");Vue=JQe});function eJe(e,t){var r=e.length;for(e.sort(t);r--;)e[r]=e[r].value;return e}var que,Uue=z(()=>{"use strict";o(eJe,"baseSortBy");que=eJe});function tJe(e,t){if(e!==t){var r=e!==void 0,i=e===null,n=e===e,a=oo(e),s=t!==void 0,l=t===null,u=t===t,h=oo(t);if(!l&&!h&&!a&&e>t||a&&s&&u&&!l&&!h||i&&s&&u||!r&&u||!n)return 1;if(!i&&!a&&!h&&e<t||h&&r&&n&&!i&&!a||l&&r&&n||!s&&n||!u)return-1}return 0}var Hue,Yue=z(()=>{"use strict";Np();o(tJe,"compareAscending");Hue=tJe});function rJe(e,t,r){for(var i=-1,n=e.criteria,a=t.criteria,s=n.length,l=r.length;++i<s;){var u=Hue(n[i],a[i]);if(u){if(i>=l)return u;var h=r[i];return u*(h=="desc"?-1:1)}}return e.index-t.index}var jue,Xue=z(()=>{"use strict";Yue();o(rJe,"compareMultiple");jue=rJe});function iJe(e,t,r){t.length?t=wc(t,function(a){return Or(a)?function(s){return Dd(s,a.length===1?a[0]:a)}:a}):t=[Ls];var i=-1;t=wc(t,Td(Ia));var n=KS(e,function(a,s,l){var u=wc(t,function(h){return h(a)});return{criteria:u,index:++i,value:a}});return que(n,function(a,s){return jue(a,s,r)})}var Kue,Zue=z(()=>{"use strict";sb();Cb();Hu();MI();Uue();pb();Xue();pd();An();o(iJe,"baseOrderBy");Kue=iJe});var nJe,Que,Jue=z(()=>{"use strict";EI();nJe=qS("length"),Que=nJe});function gJe(e){for(var t=ehe.lastIndex=0;ehe.test(e);)++t;return t}var the,aJe,sJe,oJe,lJe,cJe,uJe,PI,BI,hJe,rhe,ihe,nhe,dJe,ahe,she,fJe,pJe,mJe,ehe,ohe,lhe=z(()=>{"use strict";the="\\ud800-\\udfff",aJe="\\u0300-\\u036f",sJe="\\ufe20-\\ufe2f",oJe="\\u20d0-\\u20ff",lJe=aJe+sJe+oJe,cJe="\\ufe0e\\ufe0f",uJe="["+the+"]",PI="["+lJe+"]",BI="\\ud83c[\\udffb-\\udfff]",hJe="(?:"+PI+"|"+BI+")",rhe="[^"+the+"]",ihe="(?:\\ud83c[\\udde6-\\uddff]){2}",nhe="[\\ud800-\\udbff][\\udc00-\\udfff]",dJe="\\u200d",ahe=hJe+"?",she="["+cJe+"]?",fJe="(?:"+dJe+"(?:"+[rhe,ihe,nhe].join("|")+")"+she+ahe+")*",pJe=she+ahe+fJe,mJe="(?:"+[rhe+PI+"?",PI,ihe,nhe,uJe].join("|")+")",ehe=RegExp(BI+"(?="+BI+")|"+mJe+pJe,"g");o(gJe,"unicodeSize");ohe=gJe});function yJe(e){return sle(e)?ohe(e):Que(e)}var che,uhe=z(()=>{"use strict";Jue();ole();lhe();o(yJe,"stringSize");che=yJe});function vJe(e,t){return Vue(e,t,function(r,i){return WS(e,i)})}var hhe,dhe=z(()=>{"use strict";Wue();SI();o(vJe,"basePick");hhe=vJe});var xJe,zp,fhe=z(()=>{"use strict";dhe();rle();xJe=tle(function(e,t){return e==null?{}:hhe(e,t)}),zp=xJe});function CJe(e,t,r,i){for(var n=-1,a=TJe(bJe((t-e)/(r||1)),0),s=Array(a);a--;)s[i?a:++n]=e,e+=r;return s}var bJe,TJe,phe,mhe=z(()=>{"use strict";bJe=Math.ceil,TJe=Math.max;o(CJe,"baseRange");phe=CJe});function kJe(e){return function(t,r,i){return i&&typeof i!="number"&&Vu(t,r,i)&&(r=i=void 0),t=Eg(t),r===void 0?(r=t,t=0):r=Eg(r),i=i===void 0?t<r?1:-1:Eg(i),phe(t,r,i,e)}}var ghe,yhe=z(()=>{"use strict";mhe();db();GN();o(kJe,"createRange");ghe=kJe});var wJe,qo,vhe=z(()=>{"use strict";yhe();wJe=ghe(),qo=wJe});function SJe(e,t,r,i,n){return n(e,function(a,s,l){r=i?(i=!1,a):t(r,a,s,l)}),r}var xhe,bhe=z(()=>{"use strict";o(SJe,"baseReduce");xhe=SJe});function EJe(e,t,r){var i=Or(e)?lle:xhe,n=arguments.length<3;return i(e,Ia(t,4),r,n,Ld)}var Rc,The=z(()=>{"use strict";cle();Sb();Hu();bhe();An();o(EJe,"reduce");Rc=EJe});function DJe(e){if(e==null)return 0;if(ia(e))return _ue(e)?che(e):e.length;var t=lo(e);return t==AJe||t==_Je?e.size:Mg(e).length}var AJe,_Je,FI,Che=z(()=>{"use strict";dS();Bp();Ac();Due();uhe();AJe="[object Map]",_Je="[object Set]";o(DJe,"size");FI=DJe});var RJe,Lc,khe=z(()=>{"use strict";vS();Zue();hb();db();RJe=xd(function(e,t){if(e==null)return[];var r=t.length;return r>1&&Vu(e,t[0],t[1])?t=[]:r>2&&Vu(t[0],t[1],t[2])&&(t=[t[0]]),Kue(e,$g(t,1),[])}),Lc=RJe});var LJe,MJe,whe,She=z(()=>{"use strict";uI();Dse();BS();LJe=1/0,MJe=Rd&&1/Ug(new Rd([,-0]))[1]==LJe?function(e){return new Rd(e)}:_se,whe=MJe});function IJe(e,t,r){var i=-1,n=zse,a=e.length,s=!0,l=[],u=l;if(r)s=!1,n=lue;else if(a>=NJe){var h=t?null:whe(e);if(h)return Ug(h);s=!1,n=OS,u=new IS}else u=t?[]:l;e:for(;++i<a;){var d=e[i],f=t?t(d):d;if(d=r||d!==0?d:0,s&&f===f){for(var p=u.length;p--;)if(u[p]===f)continue e;t&&u.push(f),l.push(d)}else n(u,f,r)||(u!==l&&u.push(f),l.push(d))}return l}var NJe,Ehe,Ahe=z(()=>{"use strict";yI();Gse();cue();vI();She();BS();NJe=200;o(IJe,"baseUniq");Ehe=IJe});var OJe,$I,_he=z(()=>{"use strict";vS();hb();Ahe();DI();OJe=xd(function(e){return Ehe($g(e,1,jS,!0))}),$I=OJe});function BJe(e){var t=++PJe;return gS(e)+t}var PJe,Gp,Dhe=z(()=>{"use strict";rI();PJe=0;o(BJe,"uniqueId");Gp=BJe});function FJe(e,t,r){for(var i=-1,n=e.length,a=t.length,s={};++i<n;){var l=i<a?t[i]:void 0;r(s,e[i],l)}return s}var Rhe,Lhe=z(()=>{"use strict";o(FJe,"baseZipObject");Rhe=FJe});function $Je(e,t){return Rhe(e||[],t||[],vd)}var e3,Mhe=z(()=>{"use strict";ub();Lhe();o($Je,"zipObject");e3=$Je});var ci=z(()=>{"use strict";fce();pce();qN();eue();hue();pue();xue();iI();LI();Tue();Cue();Aue();An();Nue();ob();Iue();qu();uue();bue();Oue();Pue();Bue();Fue();$ue();Qce();fhe();vhe();The();Che();khe();_he();Dhe();Mue();Mhe();});function Ihe(e,t){e[t]?e[t]++:e[t]=1}function Ohe(e,t){--e[t]||delete e[t]}function Db(e,t,r,i){var n=""+t,a=""+r;if(!e&&n>a){var s=n;n=a,a=s}return n+Nhe+a+Nhe+(yi(i)?zJe:i)}function GJe(e,t,r,i){var n=""+t,a=""+r;if(!e&&n>a){var s=n;n=a,a=s}var l={v:n,w:a};return i&&(l.name=i),l}function zI(e,t){return Db(e,t.v,t.w,t.name)}var zJe,Vp,Nhe,ui,t3=z(()=>{"use strict";ci();zJe="\0",Vp="\0",Nhe="",ui=class{static{o(this,"Graph")}constructor(t={}){this._isDirected=Object.prototype.hasOwnProperty.call(t,"directed")?t.directed:!0,this._isMultigraph=Object.prototype.hasOwnProperty.call(t,"multigraph")?t.multigraph:!1,this._isCompound=Object.prototype.hasOwnProperty.call(t,"compound")?t.compound:!1,this._label=void 0,this._defaultNodeLabelFn=Ns(void 0),this._defaultEdgeLabelFn=Ns(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[Vp]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(t){return this._label=t,this}graph(){return this._label}setDefaultNodeLabel(t){return Sc(t)||(t=Ns(t)),this._defaultNodeLabelFn=t,this}nodeCount(){return this._nodeCount}nodes(){return cn(this._nodes)}sources(){var t=this;return ts(this.nodes(),function(r){return ZS(t._in[r])})}sinks(){var t=this;return ts(this.nodes(),function(r){return ZS(t._out[r])})}setNodes(t,r){var i=arguments,n=this;return tt(t,function(a){i.length>1?n.setNode(a,r):n.setNode(a)}),this}setNode(t,r){return Object.prototype.hasOwnProperty.call(this._nodes,t)?(arguments.length>1&&(this._nodes[t]=r),this):(this._nodes[t]=arguments.length>1?r:this._defaultNodeLabelFn(t),this._isCompound&&(this._parent[t]=Vp,this._children[t]={},this._children[Vp][t]=!0),this._in[t]={},this._preds[t]={},this._out[t]={},this._sucs[t]={},++this._nodeCount,this)}node(t){return this._nodes[t]}hasNode(t){return Object.prototype.hasOwnProperty.call(this._nodes,t)}removeNode(t){if(Object.prototype.hasOwnProperty.call(this._nodes,t)){var r=o(i=>this.removeEdge(this._edgeObjs[i]),"removeEdge");delete this._nodes[t],this._isCompound&&(this._removeFromParentsChildList(t),delete this._parent[t],tt(this.children(t),i=>{this.setParent(i)}),delete this._children[t]),tt(cn(this._in[t]),r),delete this._in[t],delete this._preds[t],tt(cn(this._out[t]),r),delete this._out[t],delete this._sucs[t],--this._nodeCount}return this}setParent(t,r){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(yi(r))r=Vp;else{r+="";for(var i=r;!yi(i);i=this.parent(i))if(i===t)throw new Error("Setting "+r+" as parent of "+t+" would create a cycle");this.setNode(r)}return this.setNode(t),this._removeFromParentsChildList(t),this._parent[t]=r,this._children[r][t]=!0,this}_removeFromParentsChildList(t){delete this._children[this._parent[t]][t]}parent(t){if(this._isCompound){var r=this._parent[t];if(r!==Vp)return r}}children(t){if(yi(t)&&(t=Vp),this._isCompound){var r=this._children[t];if(r)return cn(r)}else{if(t===Vp)return this.nodes();if(this.hasNode(t))return[]}}predecessors(t){var r=this._preds[t];if(r)return cn(r)}successors(t){var r=this._sucs[t];if(r)return cn(r)}neighbors(t){var r=this.predecessors(t);if(r)return $I(r,this.successors(t))}isLeaf(t){var r;return this.isDirected()?r=this.successors(t):r=this.neighbors(t),r.length===0}filterNodes(t){var r=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});r.setGraph(this.graph());var i=this;tt(this._nodes,function(s,l){t(l)&&r.setNode(l,s)}),tt(this._edgeObjs,function(s){r.hasNode(s.v)&&r.hasNode(s.w)&&r.setEdge(s,i.edge(s))});var n={};function a(s){var l=i.parent(s);return l===void 0||r.hasNode(l)?(n[s]=l,l):l in n?n[l]:a(l)}return o(a,"findParent"),this._isCompound&&tt(r.nodes(),function(s){r.setParent(s,a(s))}),r}setDefaultEdgeLabel(t){return Sc(t)||(t=Ns(t)),this._defaultEdgeLabelFn=t,this}edgeCount(){return this._edgeCount}edges(){return co(this._edgeObjs)}setPath(t,r){var i=this,n=arguments;return Rc(t,function(a,s){return n.length>1?i.setEdge(a,s,r):i.setEdge(a,s),s}),this}setEdge(){var t,r,i,n,a=!1,s=arguments[0];typeof s=="object"&&s!==null&&"v"in s?(t=s.v,r=s.w,i=s.name,arguments.length===2&&(n=arguments[1],a=!0)):(t=s,r=arguments[1],i=arguments[3],arguments.length>2&&(n=arguments[2],a=!0)),t=""+t,r=""+r,yi(i)||(i=""+i);var l=Db(this._isDirected,t,r,i);if(Object.prototype.hasOwnProperty.call(this._edgeLabels,l))return a&&(this._edgeLabels[l]=n),this;if(!yi(i)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(t),this.setNode(r),this._edgeLabels[l]=a?n:this._defaultEdgeLabelFn(t,r,i);var u=GJe(this._isDirected,t,r,i);return t=u.v,r=u.w,Object.freeze(u),this._edgeObjs[l]=u,Ihe(this._preds[r],t),Ihe(this._sucs[t],r),this._in[r][l]=u,this._out[t][l]=u,this._edgeCount++,this}edge(t,r,i){var n=arguments.length===1?zI(this._isDirected,arguments[0]):Db(this._isDirected,t,r,i);return this._edgeLabels[n]}hasEdge(t,r,i){var n=arguments.length===1?zI(this._isDirected,arguments[0]):Db(this._isDirected,t,r,i);return Object.prototype.hasOwnProperty.call(this._edgeLabels,n)}removeEdge(t,r,i){var n=arguments.length===1?zI(this._isDirected,arguments[0]):Db(this._isDirected,t,r,i),a=this._edgeObjs[n];return a&&(t=a.v,r=a.w,delete this._edgeLabels[n],delete this._edgeObjs[n],Ohe(this._preds[r],t),Ohe(this._sucs[t],r),delete this._in[r][n],delete this._out[t][n],this._edgeCount--),this}inEdges(t,r){var i=this._in[t];if(i){var n=co(i);return r?ts(n,function(a){return a.v===r}):n}}outEdges(t,r){var i=this._out[t];if(i){var n=co(i);return r?ts(n,function(a){return a.w===r}):n}}nodeEdges(t,r){var i=this.inEdges(t,r);if(i)return i.concat(this.outEdges(t,r))}};ui.prototype._nodeCount=0;ui.prototype._edgeCount=0;o(Ihe,"incrementOrInitEntry");o(Ohe,"decrementOrRemoveEntry");o(Db,"edgeArgsToId");o(GJe,"edgeArgsToObj");o(zI,"edgeObjToId")});var Uo=z(()=>{"use strict";t3()});function Phe(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function VJe(e,t){if(e!=="_next"&&e!=="_prev")return t}var i3,Bhe=z(()=>{"use strict";i3=class{static{o(this,"List")}constructor(){var t={};t._next=t._prev=t,this._sentinel=t}dequeue(){var t=this._sentinel,r=t._prev;if(r!==t)return Phe(r),r}enqueue(t){var r=this._sentinel;t._prev&&t._next&&Phe(t),t._next=r._next,r._next._prev=t,r._next=t,t._prev=r}toString(){for(var t=[],r=this._sentinel,i=r._prev;i!==r;)t.push(JSON.stringify(i,VJe)),i=i._prev;return"["+t.join(", ")+"]"}};o(Phe,"unlink");o(VJe,"filterOutLinks")});function Fhe(e,t){if(e.nodeCount()<=1)return[];var r=UJe(e,t||WJe),i=qJe(r.graph,r.buckets,r.zeroIdx);return Wo(Jr(i,function(n){return e.outEdges(n.v,n.w)}))}function qJe(e,t,r){for(var i=[],n=t[t.length-1],a=t[0],s;e.nodeCount();){for(;s=a.dequeue();)GI(e,t,r,s);for(;s=n.dequeue();)GI(e,t,r,s);if(e.nodeCount()){for(var l=t.length-2;l>0;--l)if(s=t[l].dequeue(),s){i=i.concat(GI(e,t,r,s,!0));break}}}return i}function GI(e,t,r,i,n){var a=n?[]:void 0;return tt(e.inEdges(i.v),function(s){var l=e.edge(s),u=e.node(s.v);n&&a.push({v:s.v,w:s.w}),u.out-=l,VI(t,r,u)}),tt(e.outEdges(i.v),function(s){var l=e.edge(s),u=s.w,h=e.node(u);h.in-=l,VI(t,r,h)}),e.removeNode(i.v),a}function UJe(e,t){var r=new ui,i=0,n=0;tt(e.nodes(),function(l){r.setNode(l,{v:l,in:0,out:0})}),tt(e.edges(),function(l){var u=r.edge(l.v,l.w)||0,h=t(l),d=u+h;r.setEdge(l.v,l.w,d),n=Math.max(n,r.node(l.v).out+=h),i=Math.max(i,r.node(l.w).in+=h)});var a=qo(n+i+3).map(function(){return new i3}),s=i+1;return tt(r.nodes(),function(l){VI(a,s,r.node(l))}),{graph:r,buckets:a,zeroIdx:s}}function VI(e,t,r){r.out?r.in?e[r.out-r.in+t].enqueue(r):e[e.length-1].enqueue(r):e[0].enqueue(r)}var WJe,$he=z(()=>{"use strict";ci();Uo();Bhe();WJe=Ns(1);o(Fhe,"greedyFAS");o(qJe,"doGreedyFAS");o(GI,"removeNode");o(UJe,"buildState");o(VI,"assignBucket")});function zhe(e){var t=e.graph().acyclicer==="greedy"?Fhe(e,r(e)):HJe(e);tt(t,function(i){var n=e.edge(i);e.removeEdge(i),n.forwardName=i.name,n.reversed=!0,e.setEdge(i.w,i.v,n,Gp("rev"))});function r(i){return function(n){return i.edge(n).weight}}o(r,"weightFn")}function HJe(e){var t=[],r={},i={};function n(a){Object.prototype.hasOwnProperty.call(i,a)||(i[a]=!0,r[a]=!0,tt(e.outEdges(a),function(s){Object.prototype.hasOwnProperty.call(r,s.w)?t.push(s):n(s.w)}),delete r[a])}return o(n,"dfs"),tt(e.nodes(),n),t}function Ghe(e){tt(e.edges(),function(t){var r=e.edge(t);if(r.reversed){e.removeEdge(t);var i=r.forwardName;delete r.reversed,delete r.forwardName,e.setEdge(t.w,t.v,r,i)}})}var WI=z(()=>{"use strict";ci();$he();o(zhe,"run");o(HJe,"dfsFAS");o(Ghe,"undo")});function Mc(e,t,r,i){var n;do n=Gp(i);while(e.hasNode(n));return r.dummy=t,e.setNode(n,r),n}function Whe(e){var t=new ui().setGraph(e.graph());return tt(e.nodes(),function(r){t.setNode(r,e.node(r))}),tt(e.edges(),function(r){var i=t.edge(r.v,r.w)||{weight:0,minlen:1},n=e.edge(r);t.setEdge(r.v,r.w,{weight:i.weight+n.weight,minlen:Math.max(i.minlen,n.minlen)})}),t}function n3(e){var t=new ui({multigraph:e.isMultigraph()}).setGraph(e.graph());return tt(e.nodes(),function(r){e.children(r).length||t.setNode(r,e.node(r))}),tt(e.edges(),function(r){t.setEdge(r,e.edge(r))}),t}function qI(e,t){var r=e.x,i=e.y,n=t.x-r,a=t.y-i,s=e.width/2,l=e.height/2;if(!n&&!a)throw new Error("Not possible to find intersection inside of the rectangle");var u,h;return Math.abs(a)*s>Math.abs(n)*l?(a<0&&(l=-l),u=l*n/a,h=l):(n<0&&(s=-s),u=s,h=s*a/n),{x:r+u,y:i+h}}function Nd(e){var t=Jr(qo(HI(e)+1),function(){return[]});return tt(e.nodes(),function(r){var i=e.node(r),n=i.rank;yi(n)||(t[n][i.order]=r)}),t}function qhe(e){var t=Yu(Jr(e.nodes(),function(r){return e.node(r).rank}));tt(e.nodes(),function(r){var i=e.node(r);_b(i,"rank")&&(i.rank-=t)})}function Uhe(e){var t=Yu(Jr(e.nodes(),function(a){return e.node(a).rank})),r=[];tt(e.nodes(),function(a){var s=e.node(a).rank-t;r[s]||(r[s]=[]),r[s].push(a)});var i=0,n=e.graph().nodeRankFactor;tt(r,function(a,s){yi(a)&&s%n!==0?--i:i&&tt(a,function(l){e.node(l).rank+=i})})}function UI(e,t,r,i){var n={width:0,height:0};return arguments.length>=4&&(n.rank=r,n.order=i),Mc(e,"border",n,t)}function HI(e){return Os(Jr(e.nodes(),function(t){var r=e.node(t).rank;if(!yi(r))return r}))}function Hhe(e,t){var r={lhs:[],rhs:[]};return tt(e,function(i){t(i)?r.lhs.push(i):r.rhs.push(i)}),r}function Yhe(e,t){var r=YS();try{return t()}finally{console.log(e+" time: "+(YS()-r)+"ms")}}function jhe(e,t){return t()}var Nc=z(()=>{"use strict";ci();Uo();o(Mc,"addDummyNode");o(Whe,"simplify");o(n3,"asNonCompoundGraph");o(qI,"intersectRect");o(Nd,"buildLayerMatrix");o(qhe,"normalizeRanks");o(Uhe,"removeEmptyRanks");o(UI,"addBorderNode");o(HI,"maxRank");o(Hhe,"partition");o(Yhe,"time");o(jhe,"notime")});function Khe(e){function t(r){var i=e.children(r),n=e.node(r);if(i.length&&tt(i,t),Object.prototype.hasOwnProperty.call(n,"minRank")){n.borderLeft=[],n.borderRight=[];for(var a=n.minRank,s=n.maxRank+1;a<s;++a)Xhe(e,"borderLeft","_bl",r,n,a),Xhe(e,"borderRight","_br",r,n,a)}}o(t,"dfs"),tt(e.children(),t)}function Xhe(e,t,r,i,n,a){var s={width:0,height:0,rank:a,borderType:t},l=n[t][a-1],u=Mc(e,"border",s,r);n[t][a]=u,e.setParent(u,i),l&&e.setEdge(l,u,{weight:1})}var Zhe=z(()=>{"use strict";ci();Nc();o(Khe,"addBorderSegments");o(Xhe,"addBorderNode")});function Jhe(e){var t=e.graph().rankdir.toLowerCase();(t==="lr"||t==="rl")&&tde(e)}function ede(e){var t=e.graph().rankdir.toLowerCase();(t==="bt"||t==="rl")&&YJe(e),(t==="lr"||t==="rl")&&(jJe(e),tde(e))}function tde(e){tt(e.nodes(),function(t){Qhe(e.node(t))}),tt(e.edges(),function(t){Qhe(e.edge(t))})}function Qhe(e){var t=e.width;e.width=e.height,e.height=t}function YJe(e){tt(e.nodes(),function(t){YI(e.node(t))}),tt(e.edges(),function(t){var r=e.edge(t);tt(r.points,YI),Object.prototype.hasOwnProperty.call(r,"y")&&YI(r)})}function YI(e){e.y=-e.y}function jJe(e){tt(e.nodes(),function(t){jI(e.node(t))}),tt(e.edges(),function(t){var r=e.edge(t);tt(r.points,jI),Object.prototype.hasOwnProperty.call(r,"x")&&jI(r)})}function jI(e){var t=e.x;e.x=e.y,e.y=t}var rde=z(()=>{"use strict";ci();o(Jhe,"adjust");o(ede,"undo");o(tde,"swapWidthHeight");o(Qhe,"swapWidthHeightOne");o(YJe,"reverseY");o(YI,"reverseYOne");o(jJe,"swapXY");o(jI,"swapXYOne")});function ide(e){e.graph().dummyChains=[],tt(e.edges(),function(t){KJe(e,t)})}function KJe(e,t){var r=t.v,i=e.node(r).rank,n=t.w,a=e.node(n).rank,s=t.name,l=e.edge(t),u=l.labelRank;if(a!==i+1){e.removeEdge(t);var h=void 0,d,f;for(f=0,++i;i<a;++f,++i)l.points=[],h={width:0,height:0,edgeLabel:l,edgeObj:t,rank:i},d=Mc(e,"edge",h,"_d"),i===u&&(h.width=l.width,h.height=l.height,h.dummy="edge-label",h.labelpos=l.labelpos),e.setEdge(r,d,{weight:l.weight},s),f===0&&e.graph().dummyChains.push(d),r=d;e.setEdge(r,n,{weight:l.weight},s)}}function nde(e){tt(e.graph().dummyChains,function(t){var r=e.node(t),i=r.edgeLabel,n;for(e.setEdge(r.edgeObj,i);r.dummy;)n=e.successors(t)[0],e.removeNode(t),i.points.push({x:r.x,y:r.y}),r.dummy==="edge-label"&&(i.x=r.x,i.y=r.y,i.width=r.width,i.height=r.height),t=n,r=e.node(t)})}var XI=z(()=>{"use strict";ci();Nc();o(ide,"run");o(KJe,"normalizeEdge");o(nde,"undo")});function Rb(e){var t={};function r(i){var n=e.node(i);if(Object.prototype.hasOwnProperty.call(t,i))return n.rank;t[i]=!0;var a=Yu(Jr(e.outEdges(i),function(s){return r(s.w)-e.edge(s).minlen}));return(a===Number.POSITIVE_INFINITY||a===void 0||a===null)&&(a=0),n.rank=a}o(r,"dfs"),tt(e.sources(),r)}function Wp(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}var a3=z(()=>{"use strict";ci();o(Rb,"longestPath");o(Wp,"slack")});function s3(e){var t=new ui({directed:!1}),r=e.nodes()[0],i=e.nodeCount();t.setNode(r,{});for(var n,a;ZJe(t,e)<i;)n=QJe(t,e),a=t.hasNode(n.v)?Wp(e,n):-Wp(e,n),JJe(t,e,a);return t}function ZJe(e,t){function r(i){tt(t.nodeEdges(i),function(n){var a=n.v,s=i===a?n.w:a;!e.hasNode(s)&&!Wp(t,n)&&(e.setNode(s,{}),e.setEdge(i,s,{}),r(s))})}return o(r,"dfs"),tt(e.nodes(),r),e.nodeCount()}function QJe(e,t){return $p(t.edges(),function(r){if(e.hasNode(r.v)!==e.hasNode(r.w))return Wp(t,r)})}function JJe(e,t,r){tt(e.nodes(),function(i){t.node(i).rank+=r})}var KI=z(()=>{"use strict";ci();Uo();a3();o(s3,"feasibleTree");o(ZJe,"tightTree");o(QJe,"findMinSlackEdge");o(JJe,"shiftRanks")});var sde=z(()=>{"use strict"});var ZI=z(()=>{"use strict"});var H2r,QI=z(()=>{"use strict";ci();ZI();H2r=Ns(1)});var ode=z(()=>{"use strict";QI()});var JI=z(()=>{"use strict"});var lde=z(()=>{"use strict";JI()});var iTr,cde=z(()=>{"use strict";ci();iTr=Ns(1)});function e9(e){var t={},r={},i=[];function n(a){if(Object.prototype.hasOwnProperty.call(r,a))throw new Lb;Object.prototype.hasOwnProperty.call(t,a)||(r[a]=!0,t[a]=!0,tt(e.predecessors(a),n),delete r[a],i.push(a))}if(o(n,"visit"),tt(e.sinks(),n),FI(t)!==e.nodeCount())throw new Lb;return i}function Lb(){}var t9=z(()=>{"use strict";ci();e9.CycleException=Lb;o(e9,"topsort");o(Lb,"CycleException");Lb.prototype=new Error});var ude=z(()=>{"use strict";t9()});function o3(e,t,r){Or(t)||(t=[t]);var i=(e.isDirected()?e.successors:e.neighbors).bind(e),n=[],a={};return tt(t,function(s){if(!e.hasNode(s))throw new Error("Graph does not have node: "+s);hde(e,s,r==="post",a,i,n)}),n}function hde(e,t,r,i,n,a){Object.prototype.hasOwnProperty.call(i,t)||(i[t]=!0,r||a.push(t),tt(n(t),function(s){hde(e,s,r,i,n,a)}),r&&a.push(t))}var r9=z(()=>{"use strict";ci();o(o3,"dfs");o(hde,"doDfs")});function i9(e,t){return o3(e,t,"post")}var dde=z(()=>{"use strict";r9();o(i9,"postorder")});function n9(e,t){return o3(e,t,"pre")}var fde=z(()=>{"use strict";r9();o(n9,"preorder")});var pde=z(()=>{"use strict";ZI();t3()});var mde=z(()=>{"use strict";sde();QI();ode();lde();cde();ude();dde();fde();pde();JI();t9()});function Od(e){e=Whe(e),Rb(e);var t=s3(e);s9(t),a9(t,e);for(var r,i;r=xde(t);)i=bde(t,e,r),Tde(t,e,r,i)}function a9(e,t){var r=i9(e,e.nodes());r=r.slice(0,r.length-1),tt(r,function(i){net(e,t,i)})}function net(e,t,r){var i=e.node(r),n=i.parent;e.edge(r,n).cutvalue=yde(e,t,r)}function yde(e,t,r){var i=e.node(r),n=i.parent,a=!0,s=t.edge(r,n),l=0;return s||(a=!1,s=t.edge(n,r)),l=s.weight,tt(t.nodeEdges(r),function(u){var h=u.v===r,d=h?u.w:u.v;if(d!==n){var f=h===a,p=t.edge(u).weight;if(l+=f?p:-p,set(e,r,d)){var m=e.edge(r,d).cutvalue;l+=f?-m:m}}}),l}function s9(e,t){arguments.length<2&&(t=e.nodes()[0]),vde(e,{},1,t)}function vde(e,t,r,i,n){var a=r,s=e.node(i);return t[i]=!0,tt(e.neighbors(i),function(l){Object.prototype.hasOwnProperty.call(t,l)||(r=vde(e,t,r,l,i))}),s.low=a,s.lim=r++,n?s.parent=n:delete s.parent,r}function xde(e){return Xg(e.edges(),function(t){return e.edge(t).cutvalue<0})}function bde(e,t,r){var i=r.v,n=r.w;t.hasEdge(i,n)||(i=r.w,n=r.v);var a=e.node(i),s=e.node(n),l=a,u=!1;a.lim>s.lim&&(l=s,u=!0);var h=ts(t.edges(),function(d){return u===gde(e,e.node(d.v),l)&&u!==gde(e,e.node(d.w),l)});return $p(h,function(d){return Wp(t,d)})}function Tde(e,t,r,i){var n=r.v,a=r.w;e.removeEdge(n,a),e.setEdge(i.v,i.w,{}),s9(e),a9(e,t),aet(e,t)}function aet(e,t){var r=Xg(e.nodes(),function(n){return!t.node(n).parent}),i=n9(e,r);i=i.slice(1),tt(i,function(n){var a=e.node(n).parent,s=t.edge(n,a),l=!1;s||(s=t.edge(a,n),l=!0),t.node(n).rank=t.node(a).rank+(l?s.minlen:-s.minlen)})}function set(e,t,r){return e.hasEdge(t,r)}function gde(e,t,r){return r.low<=t.lim&&t.lim<=r.lim}var Cde=z(()=>{"use strict";ci();mde();Nc();KI();a3();Od.initLowLimValues=s9;Od.initCutValues=a9;Od.calcCutValue=yde;Od.leaveEdge=xde;Od.enterEdge=bde;Od.exchangeEdges=Tde;o(Od,"networkSimplex");o(a9,"initCutValues");o(net,"assignCutValue");o(yde,"calcCutValue");o(s9,"initLowLimValues");o(vde,"dfsAssignLowLim");o(xde,"leaveEdge");o(bde,"enterEdge");o(Tde,"exchangeEdges");o(aet,"updateRanks");o(set,"isTreeEdge");o(gde,"isDescendant")});function o9(e){switch(e.graph().ranker){case"network-simplex":kde(e);break;case"tight-tree":cet(e);break;case"longest-path":oet(e);break;default:kde(e)}}function cet(e){Rb(e),s3(e)}function kde(e){Od(e)}var oet,l9=z(()=>{"use strict";KI();Cde();a3();o(o9,"rank");oet=Rb;o(cet,"tightTreeRanker");o(kde,"networkSimplexRanker")});function wde(e){var t=Mc(e,"root",{},"_root"),r=uet(e),i=Os(co(r))-1,n=2*i+1;e.graph().nestingRoot=t,tt(e.edges(),function(s){e.edge(s).minlen*=n});var a=het(e)+1;tt(e.children(),function(s){Sde(e,t,n,a,i,r,s)}),e.graph().nodeRankFactor=n}function Sde(e,t,r,i,n,a,s){var l=e.children(s);if(!l.length){s!==t&&e.setEdge(t,s,{weight:0,minlen:r});return}var u=UI(e,"_bt"),h=UI(e,"_bb"),d=e.node(s);e.setParent(u,s),d.borderTop=u,e.setParent(h,s),d.borderBottom=h,tt(l,function(f){Sde(e,t,r,i,n,a,f);var p=e.node(f),m=p.borderTop?p.borderTop:f,g=p.borderBottom?p.borderBottom:f,y=p.borderTop?i:2*i,v=m!==g?1:n-a[s]+1;e.setEdge(u,m,{weight:y,minlen:v,nestingEdge:!0}),e.setEdge(g,h,{weight:y,minlen:v,nestingEdge:!0})}),e.parent(s)||e.setEdge(t,u,{weight:0,minlen:n+a[s]})}function uet(e){var t={};function r(i,n){var a=e.children(i);a&&a.length&&tt(a,function(s){r(s,n+1)}),t[i]=n}return o(r,"dfs"),tt(e.children(),function(i){r(i,1)}),t}function het(e){return Rc(e.edges(),function(t,r){return t+e.edge(r).weight},0)}function Ede(e){var t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,tt(e.edges(),function(r){var i=e.edge(r);i.nestingEdge&&e.removeEdge(r)})}var Ade=z(()=>{"use strict";ci();Nc();o(wde,"run");o(Sde,"dfs");o(uet,"treeDepths");o(het,"sumWeights");o(Ede,"cleanup")});function _de(e,t,r){var i={},n;tt(r,function(a){for(var s=e.parent(a),l,u;s;){if(l=e.parent(s),l?(u=i[l],i[l]=s):(u=n,n=s),u&&u!==s){t.setEdge(u,s);return}s=l}})}var Dde=z(()=>{"use strict";ci();o(_de,"addSubgraphConstraints")});function Rde(e,t,r){var i=fet(e),n=new ui({compound:!0}).setGraph({root:i}).setDefaultNodeLabel(function(a){return e.node(a)});return tt(e.nodes(),function(a){var s=e.node(a),l=e.parent(a);(s.rank===t||s.minRank<=t&&t<=s.maxRank)&&(n.setNode(a),n.setParent(a,l||i),tt(e[r](a),function(u){var h=u.v===a?u.w:u.v,d=n.edge(h,a),f=yi(d)?0:d.weight;n.setEdge(h,a,{weight:e.edge(u).weight+f})}),Object.prototype.hasOwnProperty.call(s,"minRank")&&n.setNode(a,{borderLeft:s.borderLeft[t],borderRight:s.borderRight[t]}))}),n}function fet(e){for(var t;e.hasNode(t=Gp("_root")););return t}var Lde=z(()=>{"use strict";ci();Uo();o(Rde,"buildLayerGraph");o(fet,"createRootNode")});function Mde(e,t){for(var r=0,i=1;i<t.length;++i)r+=pet(e,t[i-1],t[i]);return r}function pet(e,t,r){for(var i=e3(r,Jr(r,function(h,d){return d})),n=Wo(Jr(t,function(h){return Lc(Jr(e.outEdges(h),function(d){return{pos:i[d.w],weight:e.edge(d).weight}}),"pos")})),a=1;a<r.length;)a<<=1;var s=2*a-1;a-=1;var l=Jr(new Array(s),function(){return 0}),u=0;return tt(n.forEach(function(h){var d=h.pos+a;l[d]+=h.weight;for(var f=0;d>0;)d%2&&(f+=l[d+1]),d=d-1>>1,l[d]+=h.weight;u+=h.weight*f})),u}var Nde=z(()=>{"use strict";ci();o(Mde,"crossCount");o(pet,"twoLayerCrossCount")});function Ide(e){var t={},r=ts(e.nodes(),function(l){return!e.children(l).length}),i=Os(Jr(r,function(l){return e.node(l).rank})),n=Jr(qo(i+1),function(){return[]});function a(l){if(!_b(t,l)){t[l]=!0;var u=e.node(l);n[u.rank].push(l),tt(e.successors(l),a)}}o(a,"dfs");var s=Lc(r,function(l){return e.node(l).rank});return tt(s,a),n}var Ode=z(()=>{"use strict";ci();o(Ide,"initOrder")});function Pde(e,t){return Jr(t,function(r){var i=e.inEdges(r);if(i.length){var n=Rc(i,function(a,s){var l=e.edge(s),u=e.node(s.v);return{sum:a.sum+l.weight*u.order,weight:a.weight+l.weight}},{sum:0,weight:0});return{v:r,barycenter:n.sum/n.weight,weight:n.weight}}else return{v:r}})}var Bde=z(()=>{"use strict";ci();o(Pde,"barycenter")});function Fde(e,t){var r={};tt(e,function(n,a){var s=r[n.v]={indegree:0,in:[],out:[],vs:[n.v],i:a};yi(n.barycenter)||(s.barycenter=n.barycenter,s.weight=n.weight)}),tt(t.edges(),function(n){var a=r[n.v],s=r[n.w];!yi(a)&&!yi(s)&&(s.indegree++,a.out.push(r[n.w]))});var i=ts(r,function(n){return!n.indegree});return met(i)}function met(e){var t=[];function r(a){return function(s){s.merged||(yi(s.barycenter)||yi(a.barycenter)||s.barycenter>=a.barycenter)&&get(a,s)}}o(r,"handleIn");function i(a){return function(s){s.in.push(a),--s.indegree===0&&e.push(s)}}for(o(i,"handleOut");e.length;){var n=e.pop();t.push(n),tt(n.in.reverse(),r(n)),tt(n.out,i(n))}return Jr(ts(t,function(a){return!a.merged}),function(a){return zp(a,["vs","i","barycenter","weight"])})}function get(e,t){var r=0,i=0;e.weight&&(r+=e.barycenter*e.weight,i+=e.weight),t.weight&&(r+=t.barycenter*t.weight,i+=t.weight),e.vs=t.vs.concat(e.vs),e.barycenter=r/i,e.weight=i,e.i=Math.min(t.i,e.i),t.merged=!0}var $de=z(()=>{"use strict";ci();o(Fde,"resolveConflicts");o(met,"doResolveConflicts");o(get,"mergeEntries")});function Gde(e,t){var r=Hhe(e,function(d){return Object.prototype.hasOwnProperty.call(d,"barycenter")}),i=r.lhs,n=Lc(r.rhs,function(d){return-d.i}),a=[],s=0,l=0,u=0;i.sort(yet(!!t)),u=zde(a,n,u),tt(i,function(d){u+=d.vs.length,a.push(d.vs),s+=d.barycenter*d.weight,l+=d.weight,u=zde(a,n,u)});var h={vs:Wo(a)};return l&&(h.barycenter=s/l,h.weight=l),h}function zde(e,t,r){for(var i;t.length&&(i=Md(t)).i<=r;)t.pop(),e.push(i.vs),r++;return r}function yet(e){return function(t,r){return t.barycenter<r.barycenter?-1:t.barycenter>r.barycenter?1:e?r.i-t.i:t.i-r.i}}var Vde=z(()=>{"use strict";ci();Nc();o(Gde,"sort");o(zde,"consumeUnsortable");o(yet,"compareWithBias")});function c9(e,t,r,i){var n=e.children(t),a=e.node(t),s=a?a.borderLeft:void 0,l=a?a.borderRight:void 0,u={};s&&(n=ts(n,function(g){return g!==s&&g!==l}));var h=Pde(e,n);tt(h,function(g){if(e.children(g.v).length){var y=c9(e,g.v,r,i);u[g.v]=y,Object.prototype.hasOwnProperty.call(y,"barycenter")&&xet(g,y)}});var d=Fde(h,r);vet(d,u);var f=Gde(d,i);if(s&&(f.vs=Wo([s,f.vs,l]),e.predecessors(s).length)){var p=e.node(e.predecessors(s)[0]),m=e.node(e.predecessors(l)[0]);Object.prototype.hasOwnProperty.call(f,"barycenter")||(f.barycenter=0,f.weight=0),f.barycenter=(f.barycenter*f.weight+p.order+m.order)/(f.weight+2),f.weight+=2}return f}function vet(e,t){tt(e,function(r){r.vs=Wo(r.vs.map(function(i){return t[i]?t[i].vs:i}))})}function xet(e,t){yi(e.barycenter)?(e.barycenter=t.barycenter,e.weight=t.weight):(e.barycenter=(e.barycenter*e.weight+t.barycenter*t.weight)/(e.weight+t.weight),e.weight+=t.weight)}var Wde=z(()=>{"use strict";ci();Bde();$de();Vde();o(c9,"sortSubgraph");o(vet,"expandSubgraphs");o(xet,"mergeBarycenters")});function Hde(e){var t=HI(e),r=qde(e,qo(1,t+1),"inEdges"),i=qde(e,qo(t-1,-1,-1),"outEdges"),n=Ide(e);Ude(e,n);for(var a=Number.POSITIVE_INFINITY,s,l=0,u=0;u<4;++l,++u){bet(l%2?r:i,l%4>=2),n=Nd(e);var h=Mde(e,n);h<a&&(u=0,s=gI(n),a=h)}Ude(e,s)}function qde(e,t,r){return Jr(t,function(i){return Rde(e,i,r)})}function bet(e,t){var r=new ui;tt(e,function(i){var n=i.graph().root,a=c9(i,n,r,t);tt(a.vs,function(s,l){i.node(s).order=l}),_de(i,r,a.vs)})}function Ude(e,t){tt(t,function(r){tt(r,function(i,n){e.node(i).order=n})})}var Yde=z(()=>{"use strict";ci();Uo();Nc();Dde();Lde();Nde();Ode();Wde();o(Hde,"order");o(qde,"buildLayerGraphs");o(bet,"sweepLayerGraphs");o(Ude,"assignOrder")});function jde(e){var t=Cet(e);tt(e.graph().dummyChains,function(r){for(var i=e.node(r),n=i.edgeObj,a=Tet(e,t,n.v,n.w),s=a.path,l=a.lca,u=0,h=s[u],d=!0;r!==n.w;){if(i=e.node(r),d){for(;(h=s[u])!==l&&e.node(h).maxRank<i.rank;)u++;h===l&&(d=!1)}if(!d){for(;u<s.length-1&&e.node(h=s[u+1]).minRank<=i.rank;)u++;h=s[u]}e.setParent(r,h),r=e.successors(r)[0]}})}function Tet(e,t,r,i){var n=[],a=[],s=Math.min(t[r].low,t[i].low),l=Math.max(t[r].lim,t[i].lim),u,h;u=r;do u=e.parent(u),n.push(u);while(u&&(t[u].low>s||l>t[u].lim));for(h=u,u=i;(u=e.parent(u))!==h;)a.push(u);return{path:n.concat(a.reverse()),lca:h}}function Cet(e){var t={},r=0;function i(n){var a=r;tt(e.children(n),i),t[n]={low:a,lim:r++}}return o(i,"dfs"),tt(e.children(),i),t}var Xde=z(()=>{"use strict";ci();o(jde,"parentDummyChains");o(Tet,"findPath");o(Cet,"postorder")});function ket(e,t){var r={};function i(n,a){var s=0,l=0,u=n.length,h=Md(a);return tt(a,function(d,f){var p=Eet(e,d),m=p?e.node(p).order:u;(p||d===h)&&(tt(a.slice(l,f+1),function(g){tt(e.predecessors(g),function(y){var v=e.node(y),x=v.order;(x<s||m<x)&&!(v.dummy&&e.node(g).dummy)&&Kde(r,y,g)})}),l=f+1,s=m)}),a}return o(i,"visitLayer"),Rc(t,i),r}function wet(e,t){var r={};function i(a,s,l,u,h){var d;tt(qo(s,l),function(f){d=a[f],e.node(d).dummy&&tt(e.predecessors(d),function(p){var m=e.node(p);m.dummy&&(m.order<u||m.order>h)&&Kde(r,p,d)})})}o(i,"scan");function n(a,s){var l=-1,u,h=0;return tt(s,function(d,f){if(e.node(d).dummy==="border"){var p=e.predecessors(d);p.length&&(u=e.node(p[0]).order,i(s,h,f,l,u),h=f,l=u)}i(s,h,s.length,u,a.length)}),s}return o(n,"visitLayer"),Rc(t,n),r}function Eet(e,t){if(e.node(t).dummy)return Xg(e.predecessors(t),function(r){return e.node(r).dummy})}function Kde(e,t,r){if(t>r){var i=t;t=r,r=i}Object.prototype.hasOwnProperty.call(e,t)||Object.defineProperty(e,t,{enumerable:!0,configurable:!0,value:{},writable:!0});var n=e[t];Object.defineProperty(n,r,{enumerable:!0,configurable:!0,value:!0,writable:!0})}function Aet(e,t,r){if(t>r){var i=t;t=r,r=i}return!!e[t]&&Object.prototype.hasOwnProperty.call(e[t],r)}function _et(e,t,r,i){var n={},a={},s={};return tt(t,function(l){tt(l,function(u,h){n[u]=u,a[u]=u,s[u]=h})}),tt(t,function(l){var u=-1;tt(l,function(h){var d=i(h);if(d.length){d=Lc(d,function(y){return s[y]});for(var f=(d.length-1)/2,p=Math.floor(f),m=Math.ceil(f);p<=m;++p){var g=d[p];a[h]===h&&u<s[g]&&!Aet(r,h,g)&&(a[g]=h,a[h]=n[h]=n[g],u=s[g])}}})}),{root:n,align:a}}function Det(e,t,r,i,n){var a={},s=Ret(e,t,r,n),l=n?"borderLeft":"borderRight";function u(f,p){for(var m=s.nodes(),g=m.pop(),y={};g;)y[g]?f(g):(y[g]=!0,m.push(g),m=m.concat(p(g))),g=m.pop()}o(u,"iterate");function h(f){a[f]=s.inEdges(f).reduce(function(p,m){return Math.max(p,a[m.v]+s.edge(m))},0)}o(h,"pass1");function d(f){var p=s.outEdges(f).reduce(function(g,y){return Math.min(g,a[y.w]-s.edge(y))},Number.POSITIVE_INFINITY),m=e.node(f);p!==Number.POSITIVE_INFINITY&&m.borderType!==l&&(a[f]=Math.max(a[f],p))}return o(d,"pass2"),u(h,s.predecessors.bind(s)),u(d,s.successors.bind(s)),tt(i,function(f){a[f]=a[r[f]]}),a}function Ret(e,t,r,i){var n=new ui,a=e.graph(),s=Iet(a.nodesep,a.edgesep,i);return tt(t,function(l){var u;tt(l,function(h){var d=r[h];if(n.setNode(d),u){var f=r[u],p=n.edge(f,d);n.setEdge(f,d,Math.max(s(e,h,u),p||0))}u=h})}),n}function Let(e,t){return $p(co(t),function(r){var i=Number.NEGATIVE_INFINITY,n=Number.POSITIVE_INFINITY;return NI(r,function(a,s){var l=Oet(e,s)/2;i=Math.max(a+l,i),n=Math.min(a-l,n)}),i-n})}function Met(e,t){var r=co(t),i=Yu(r),n=Os(r);tt(["u","d"],function(a){tt(["l","r"],function(s){var l=a+s,u=e[l],h;if(u!==t){var d=co(u);h=s==="l"?i-Yu(d):n-Os(d),h&&(e[l]=Fp(u,function(f){return f+h}))}})})}function Net(e,t){return Fp(e.ul,function(r,i){if(t)return e[t.toLowerCase()][i];var n=Lc(Jr(e,i));return(n[1]+n[2])/2})}function Zde(e){var t=Nd(e),r=Zg(ket(e,t),wet(e,t)),i={},n;tt(["u","d"],function(s){n=s==="u"?t:co(t).reverse(),tt(["l","r"],function(l){l==="r"&&(n=Jr(n,function(f){return co(f).reverse()}));var u=(s==="u"?e.predecessors:e.successors).bind(e),h=_et(e,n,r,u),d=Det(e,n,h.root,h.align,l==="r");l==="r"&&(d=Fp(d,function(f){return-f})),i[s+l]=d})});var a=Let(e,i);return Met(i,a),Net(i,e.graph().align)}function Iet(e,t,r){return function(i,n,a){var s=i.node(n),l=i.node(a),u=0,h;if(u+=s.width/2,Object.prototype.hasOwnProperty.call(s,"labelpos"))switch(s.labelpos.toLowerCase()){case"l":h=-s.width/2;break;case"r":h=s.width/2;break}if(h&&(u+=r?h:-h),h=0,u+=(s.dummy?t:e)/2,u+=(l.dummy?t:e)/2,u+=l.width/2,Object.prototype.hasOwnProperty.call(l,"labelpos"))switch(l.labelpos.toLowerCase()){case"l":h=l.width/2;break;case"r":h=-l.width/2;break}return h&&(u+=r?h:-h),h=0,u}}function Oet(e,t){return e.node(t).width}var Qde=z(()=>{"use strict";ci();Uo();Nc();o(ket,"findType1Conflicts");o(wet,"findType2Conflicts");o(Eet,"findOtherInnerSegmentNode");o(Kde,"addConflict");o(Aet,"hasConflict");o(_et,"verticalAlignment");o(Det,"horizontalCompaction");o(Ret,"buildBlockGraph");o(Let,"findSmallestWidthAlignment");o(Met,"alignCoordinates");o(Net,"balance");o(Zde,"positionX");o(Iet,"sep");o(Oet,"width")});function Jde(e){e=n3(e),Pet(e),II(Zde(e),function(t,r){e.node(r).x=t})}function Pet(e){var t=Nd(e),r=e.graph().ranksep,i=0;tt(t,function(n){var a=Os(Jr(n,function(s){return e.node(s).height}));tt(n,function(s){e.node(s).y=i+a/2}),i+=a+r})}var efe=z(()=>{"use strict";ci();Nc();Qde();o(Jde,"position");o(Pet,"positionY")});function Mb(e,t){var r=t&&t.debugTiming?Yhe:jhe;r("layout",()=>{var i=r(" buildLayoutGraph",()=>Yet(e));r(" runLayout",()=>Bet(i,r)),r(" updateInputGraph",()=>Fet(e,i))})}function Bet(e,t){t(" makeSpaceForEdgeLabels",()=>jet(e)),t(" removeSelfEdges",()=>itt(e)),t(" acyclic",()=>zhe(e)),t(" nestingGraph.run",()=>wde(e)),t(" rank",()=>o9(n3(e))),t(" injectEdgeLabelProxies",()=>Xet(e)),t(" removeEmptyRanks",()=>Uhe(e)),t(" nestingGraph.cleanup",()=>Ede(e)),t(" normalizeRanks",()=>qhe(e)),t(" assignRankMinMax",()=>Ket(e)),t(" removeEdgeLabelProxies",()=>Zet(e)),t(" normalize.run",()=>ide(e)),t(" parentDummyChains",()=>jde(e)),t(" addBorderSegments",()=>Khe(e)),t(" order",()=>Hde(e)),t(" insertSelfEdges",()=>ntt(e)),t(" adjustCoordinateSystem",()=>Jhe(e)),t(" position",()=>Jde(e)),t(" positionSelfEdges",()=>att(e)),t(" removeBorderNodes",()=>rtt(e)),t(" normalize.undo",()=>nde(e)),t(" fixupEdgeLabelCoords",()=>ett(e)),t(" undoCoordinateSystem",()=>ede(e)),t(" translateGraph",()=>Qet(e)),t(" assignNodeIntersects",()=>Jet(e)),t(" reversePoints",()=>ttt(e)),t(" acyclic.undo",()=>Ghe(e))}function Fet(e,t){tt(e.nodes(),function(r){var i=e.node(r),n=t.node(r);i&&(i.x=n.x,i.y=n.y,t.children(r).length&&(i.width=n.width,i.height=n.height))}),tt(e.edges(),function(r){var i=e.edge(r),n=t.edge(r);i.points=n.points,Object.prototype.hasOwnProperty.call(n,"x")&&(i.x=n.x,i.y=n.y)}),e.graph().width=t.graph().width,e.graph().height=t.graph().height}function Yet(e){var t=new ui({multigraph:!0,compound:!0}),r=h9(e.graph());return t.setGraph(Zg({},zet,u9(r,$et),zp(r,Get))),tt(e.nodes(),function(i){var n=h9(e.node(i));t.setNode(i,AI(u9(n,Vet),Wet)),t.setParent(i,e.parent(i))}),tt(e.edges(),function(i){var n=h9(e.edge(i));t.setEdge(i,Zg({},Uet,u9(n,qet),zp(n,Het)))}),t}function jet(e){var t=e.graph();t.ranksep/=2,tt(e.edges(),function(r){var i=e.edge(r);i.minlen*=2,i.labelpos.toLowerCase()!=="c"&&(t.rankdir==="TB"||t.rankdir==="BT"?i.width+=i.labeloffset:i.height+=i.labeloffset)})}function Xet(e){tt(e.edges(),function(t){var r=e.edge(t);if(r.width&&r.height){var i=e.node(t.v),n=e.node(t.w),a={rank:(n.rank-i.rank)/2+i.rank,e:t};Mc(e,"edge-proxy",a,"_ep")}})}function Ket(e){var t=0;tt(e.nodes(),function(r){var i=e.node(r);i.borderTop&&(i.minRank=e.node(i.borderTop).rank,i.maxRank=e.node(i.borderBottom).rank,t=Os(t,i.maxRank))}),e.graph().maxRank=t}function Zet(e){tt(e.nodes(),function(t){var r=e.node(t);r.dummy==="edge-proxy"&&(e.edge(r.e).labelRank=r.rank,e.removeNode(t))})}function Qet(e){var t=Number.POSITIVE_INFINITY,r=0,i=Number.POSITIVE_INFINITY,n=0,a=e.graph(),s=a.marginx||0,l=a.marginy||0;function u(h){var d=h.x,f=h.y,p=h.width,m=h.height;t=Math.min(t,d-p/2),r=Math.max(r,d+p/2),i=Math.min(i,f-m/2),n=Math.max(n,f+m/2)}o(u,"getExtremes"),tt(e.nodes(),function(h){u(e.node(h))}),tt(e.edges(),function(h){var d=e.edge(h);Object.prototype.hasOwnProperty.call(d,"x")&&u(d)}),t-=s,i-=l,tt(e.nodes(),function(h){var d=e.node(h);d.x-=t,d.y-=i}),tt(e.edges(),function(h){var d=e.edge(h);tt(d.points,function(f){f.x-=t,f.y-=i}),Object.prototype.hasOwnProperty.call(d,"x")&&(d.x-=t),Object.prototype.hasOwnProperty.call(d,"y")&&(d.y-=i)}),a.width=r-t+s,a.height=n-i+l}function Jet(e){tt(e.edges(),function(t){var r=e.edge(t),i=e.node(t.v),n=e.node(t.w),a,s;r.points?(a=r.points[0],s=r.points[r.points.length-1]):(r.points=[],a=n,s=i),r.points.unshift(qI(i,a)),r.points.push(qI(n,s))})}function ett(e){tt(e.edges(),function(t){var r=e.edge(t);if(Object.prototype.hasOwnProperty.call(r,"x"))switch((r.labelpos==="l"||r.labelpos==="r")&&(r.width-=r.labeloffset),r.labelpos){case"l":r.x-=r.width/2+r.labeloffset;break;case"r":r.x+=r.width/2+r.labeloffset;break}})}function ttt(e){tt(e.edges(),function(t){var r=e.edge(t);r.reversed&&r.points.reverse()})}function rtt(e){tt(e.nodes(),function(t){if(e.children(t).length){var r=e.node(t),i=e.node(r.borderTop),n=e.node(r.borderBottom),a=e.node(Md(r.borderLeft)),s=e.node(Md(r.borderRight));r.width=Math.abs(s.x-a.x),r.height=Math.abs(n.y-i.y),r.x=a.x+r.width/2,r.y=i.y+r.height/2}}),tt(e.nodes(),function(t){e.node(t).dummy==="border"&&e.removeNode(t)})}function itt(e){tt(e.edges(),function(t){if(t.v===t.w){var r=e.node(t.v);r.selfEdges||(r.selfEdges=[]),r.selfEdges.push({e:t,label:e.edge(t)}),e.removeEdge(t)}})}function ntt(e){var t=Nd(e);tt(t,function(r){var i=0;tt(r,function(n,a){var s=e.node(n);s.order=a+i,tt(s.selfEdges,function(l){Mc(e,"selfedge",{width:l.label.width,height:l.label.height,rank:s.rank,order:a+ ++i,e:l.e,label:l.label},"_se")}),delete s.selfEdges})})}function att(e){tt(e.nodes(),function(t){var r=e.node(t);if(r.dummy==="selfedge"){var i=e.node(r.e.v),n=i.x+i.width/2,a=i.y,s=r.x-n,l=i.height/2;e.setEdge(r.e,r.label),e.removeNode(t),r.label.points=[{x:n+2*s/3,y:a-l},{x:n+5*s/6,y:a-l},{x:n+s,y:a},{x:n+5*s/6,y:a+l},{x:n+2*s/3,y:a+l}],r.label.x=r.x,r.label.y=r.y}})}function u9(e,t){return Fp(zp(e,t),Number)}function h9(e){var t={};return tt(e,function(r,i){t[i.toLowerCase()]=r}),t}var $et,zet,Get,Vet,Wet,qet,Uet,Het,tfe=z(()=>{"use strict";ci();Uo();Zhe();rde();WI();XI();l9();Ade();Yde();Xde();efe();Nc();o(Mb,"layout");o(Bet,"runLayout");o(Fet,"updateInputGraph");$et=["nodesep","edgesep","ranksep","marginx","marginy"],zet={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},Get=["acyclicer","ranker","rankdir","align"],Vet=["width","height"],Wet={width:0,height:0},qet=["minlen","weight","width","height","labeloffset"],Uet={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},Het=["labelpos"];o(Yet,"buildLayoutGraph");o(jet,"makeSpaceForEdgeLabels");o(Xet,"injectEdgeLabelProxies");o(Ket,"assignRankMinMax");o(Zet,"removeEdgeLabelProxies");o(Qet,"translateGraph");o(Jet,"assignNodeIntersects");o(ett,"fixupEdgeLabelCoords");o(ttt,"reversePointsForReversedEdges");o(rtt,"removeBorderNodes");o(itt,"removeSelfEdges");o(ntt,"insertSelfEdges");o(att,"positionSelfEdges");o(u9,"selectNumberAttrs");o(h9,"canonicalize")});var d9=z(()=>{"use strict";WI();tfe();XI();l9()});function Ho(e){var t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:stt(e),edges:ott(e)};return yi(e.graph())||(t.value=mI(e.graph())),t}function stt(e){return Jr(e.nodes(),function(t){var r=e.node(t),i=e.parent(t),n={v:t};return yi(r)||(n.value=r),yi(i)||(n.parent=i),n})}function ott(e){return Jr(e.edges(),function(t){var r=e.edge(t),i={v:t.v,w:t.w};return yi(t.name)||(i.name=t.name),yi(r)||(i.value=r),i})}var f9=z(()=>{"use strict";ci();t3();o(Ho,"write");o(stt,"writeNodes");o(ott,"writeEdges")});var Pr,qp,nfe,afe,l3,ltt,sfe,ofe,ctt,Qg,ife,lfe,cfe,ufe,hfe,dfe=z(()=>{"use strict";St();Uo();f9();Pr=new Map,qp=new Map,nfe=new Map,afe=o(()=>{qp.clear(),nfe.clear(),Pr.clear()},"clear"),l3=o((e,t)=>{let r=qp.get(t)||[];return Z.trace("In isDescendant",t," ",e," = ",r.includes(e)),r.includes(e)},"isDescendant"),ltt=o((e,t)=>{let r=qp.get(t)||[];return Z.info("Descendants of ",t," is ",r),Z.info("Edge is ",e),e.v===t||e.w===t?!1:r?r.includes(e.v)||l3(e.v,t)||l3(e.w,t)||r.includes(e.w):(Z.debug("Tilt, ",t,",not in descendants"),!1)},"edgeInCluster"),sfe=o((e,t,r,i)=>{Z.warn("Copying children of ",e,"root",i,"data",t.node(e),i);let n=t.children(e)||[];e!==i&&n.push(e),Z.warn("Copying (nodes) clusterId",e,"nodes",n),n.forEach(a=>{if(t.children(a).length>0)sfe(a,t,r,i);else{let s=t.node(a);Z.info("cp ",a," to ",i," with parent ",e),r.setNode(a,s),i!==t.parent(a)&&(Z.warn("Setting parent",a,t.parent(a)),r.setParent(a,t.parent(a))),e!==i&&a!==e?(Z.debug("Setting parent",a,e),r.setParent(a,e)):(Z.info("In copy ",e,"root",i,"data",t.node(e),i),Z.debug("Not Setting parent for node=",a,"cluster!==rootId",e!==i,"node!==clusterId",a!==e));let l=t.edges(a);Z.debug("Copying Edges",l),l.forEach(u=>{Z.info("Edge",u);let h=t.edge(u.v,u.w,u.name);Z.info("Edge data",h,i);try{ltt(u,i)?(Z.info("Copying as ",u.v,u.w,h,u.name),r.setEdge(u.v,u.w,h,u.name),Z.info("newGraph edges ",r.edges(),r.edge(r.edges()[0]))):Z.info("Skipping copy of edge ",u.v,"-->",u.w," rootId: ",i," clusterId:",e)}catch(d){Z.error(d)}})}Z.debug("Removing node",a),t.removeNode(a)})},"copy"),ofe=o((e,t)=>{let r=t.children(e),i=[...r];for(let n of r)nfe.set(n,e),i=[...i,...ofe(n,t)];return i},"extractDescendants"),ctt=o((e,t,r)=>{let i=e.edges().filter(u=>u.v===t||u.w===t),n=e.edges().filter(u=>u.v===r||u.w===r),a=i.map(u=>({v:u.v===t?r:u.v,w:u.w===t?t:u.w})),s=n.map(u=>({v:u.v,w:u.w}));return a.filter(u=>s.some(h=>u.v===h.v&&u.w===h.w))},"findCommonEdges"),Qg=o((e,t,r)=>{let i=t.children(e);if(Z.trace("Searching children of id ",e,i),i.length<1)return e;let n;for(let a of i){let s=Qg(a,t,r),l=ctt(t,r,s);if(s)if(l.length>0)n=s;else return s}return n},"findNonClusterChild"),ife=o(e=>!Pr.has(e)||!Pr.get(e).externalConnections?e:Pr.has(e)?Pr.get(e).id:e,"getAnchorId"),lfe=o((e,t)=>{if(!e||t>10){Z.debug("Opting out, no graph ");return}else Z.debug("Opting in, graph ");e.nodes().forEach(function(r){e.children(r).length>0&&(Z.warn("Cluster identified",r," Replacement id in edges: ",Qg(r,e,r)),qp.set(r,ofe(r,e)),Pr.set(r,{id:Qg(r,e,r),clusterData:e.node(r)}))}),e.nodes().forEach(function(r){let i=e.children(r),n=e.edges();i.length>0?(Z.debug("Cluster identified",r,qp),n.forEach(a=>{let s=l3(a.v,r),l=l3(a.w,r);s^l&&(Z.warn("Edge: ",a," leaves cluster ",r),Z.warn("Descendants of XXX ",r,": ",qp.get(r)),Pr.get(r).externalConnections=!0)})):Z.debug("Not a cluster ",r,qp)});for(let r of Pr.keys()){let i=Pr.get(r).id,n=e.parent(i);n!==r&&Pr.has(n)&&!Pr.get(n).externalConnections&&(Pr.get(r).id=n)}e.edges().forEach(function(r){let i=e.edge(r);Z.warn("Edge "+r.v+" -> "+r.w+": "+JSON.stringify(r)),Z.warn("Edge "+r.v+" -> "+r.w+": "+JSON.stringify(e.edge(r)));let n=r.v,a=r.w;if(Z.warn("Fix XXX",Pr,"ids:",r.v,r.w,"Translating: ",Pr.get(r.v)," --- ",Pr.get(r.w)),Pr.get(r.v)||Pr.get(r.w)){if(Z.warn("Fixing and trying - removing XXX",r.v,r.w,r.name),n=ife(r.v),a=ife(r.w),e.removeEdge(r.v,r.w,r.name),n!==r.v){let s=e.parent(n);Pr.get(s).externalConnections=!0,i.fromCluster=r.v}if(a!==r.w){let s=e.parent(a);Pr.get(s).externalConnections=!0,i.toCluster=r.w}Z.warn("Fix Replacing with XXX",n,a,r.name),e.setEdge(n,a,i,r.name)}}),Z.warn("Adjusted Graph",Ho(e)),cfe(e,0),Z.trace(Pr)},"adjustClustersAndEdges"),cfe=o((e,t)=>{if(Z.warn("extractor - ",t,Ho(e),e.children("D")),t>10){Z.error("Bailing out");return}let r=e.nodes(),i=!1;for(let n of r){let a=e.children(n);i=i||a.length>0}if(!i){Z.debug("Done, no node has children",e.nodes());return}Z.debug("Nodes = ",r,t);for(let n of r)if(Z.debug("Extracting node",n,Pr,Pr.has(n)&&!Pr.get(n).externalConnections,!e.parent(n),e.node(n),e.children("D")," Depth ",t),!Pr.has(n))Z.debug("Not a cluster",n,t);else if(!Pr.get(n).externalConnections&&e.children(n)&&e.children(n).length>0){Z.warn("Cluster without external connections, without a parent and with children",n,t);let s=e.graph().rankdir==="TB"?"LR":"TB";Pr.get(n)?.clusterData?.dir&&(s=Pr.get(n).clusterData.dir,Z.warn("Fixing dir",Pr.get(n).clusterData.dir,s));let l=new ui({multigraph:!0,compound:!0}).setGraph({rankdir:s,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});Z.warn("Old graph before copy",Ho(e)),sfe(n,e,l,n),e.setNode(n,{clusterNode:!0,id:n,clusterData:Pr.get(n).clusterData,label:Pr.get(n).label,graph:l}),Z.warn("New graph after copy node: (",n,")",Ho(l)),Z.debug("Old graph after copy",Ho(e))}else Z.warn("Cluster ** ",n," **not meeting the criteria !externalConnections:",!Pr.get(n).externalConnections," no parent: ",!e.parent(n)," children ",e.children(n)&&e.children(n).length>0,e.children("D"),t),Z.debug(Pr);r=e.nodes(),Z.warn("New list of nodes",r);for(let n of r){let a=e.node(n);Z.warn(" Now next level",n,a),a?.clusterNode&&cfe(a.graph,t+1)}},"extractor"),ufe=o((e,t)=>{if(t.length===0)return[];let r=Object.assign([],t);return t.forEach(i=>{let n=e.children(i),a=ufe(e,n);r=[...r,...a]}),r},"sorter"),hfe=o(e=>ufe(e,e.children()),"sortNodesByHierarchy")});var pfe={};xr(pfe,{render:()=>utt});var ffe,utt,mfe=z(()=>{"use strict";d9();f9();Uo();$N();Wt();dfe();J4();W4();FN();St();rb();Ut();ffe=o(async(e,t,r,i,n,a)=>{Z.warn("Graph in recursive render:XAX",Ho(t),n);let s=t.graph().rankdir;Z.trace("Dir in recursive render - dir:",s);let l=e.insert("g").attr("class","root");t.nodes()?Z.info("Recursive render XXX",t.nodes()):Z.info("No nodes found for",t),t.edges().length>0&&Z.info("Recursive edges",t.edge(t.edges()[0]));let u=l.insert("g").attr("class","clusters"),h=l.insert("g").attr("class","edgePaths"),d=l.insert("g").attr("class","edgeLabels"),f=l.insert("g").attr("class","nodes");await Promise.all(t.nodes().map(async function(y){let v=t.node(y);if(n!==void 0){let x=JSON.parse(JSON.stringify(n.clusterData));Z.trace(`Setting data for parent cluster XXX
2
+ Node.id = `,y,`
3
+ data=`,x.height,`
4
+ Parent cluster`,n.height),t.setNode(n.id,x),t.parent(y)||(Z.trace("Setting parent",y,n.id),t.setParent(y,n.id,x))}if(Z.info("(Insert) Node XXX"+y+": "+JSON.stringify(t.node(y))),v?.clusterNode){Z.info("Cluster identified XBX",y,v.width,t.node(y));let{ranksep:x,nodesep:b}=t.graph();v.graph.setGraph({...v.graph.graph(),ranksep:x+25,nodesep:b});let T=await ffe(f,v.graph,r,i,t.node(y),a),w=T.elem;ft(v,w),v.diff=T.diff||0,Z.info("New compound node after recursive render XAX",y,"width",v.width,"height",v.height),Wae(w,v)}else t.children(y).length>0?(Z.trace("Cluster - the non recursive path XBX",y,v.id,v,v.width,"Graph:",t),Z.trace(Qg(v.id,t)),Pr.set(v.id,{id:Qg(v.id,t),node:v})):(Z.trace("Node - the non recursive path XAX",y,f,t.node(y),s),await Sg(f,t.node(y),{config:a,dir:s}))})),await o(async()=>{let y=t.edges().map(async function(v){let x=t.edge(v.v,v.w,v.name);Z.info("Edge "+v.v+" -> "+v.w+": "+JSON.stringify(v)),Z.info("Edge "+v.v+" -> "+v.w+": ",v," ",JSON.stringify(t.edge(v))),Z.info("Fix",Pr,"ids:",v.v,v.w,"Translating: ",Pr.get(v.v),Pr.get(v.w)),await j4(d,x)});await Promise.all(y)},"processEdges")(),Z.info("Graph before layout:",JSON.stringify(Ho(t))),Z.info("############################################# XXX"),Z.info("### Layout ### XXX"),Z.info("############################################# XXX"),Mb(t),Z.info("Graph after layout:",JSON.stringify(Ho(t)));let m=0,{subGraphTitleTotalMargin:g}=zu(a);return await Promise.all(hfe(t).map(async function(y){let v=t.node(y);if(Z.info("Position XBX => "+y+": ("+v.x,","+v.y,") width: ",v.width," height: ",v.height),v?.clusterNode)v.y+=g,Z.info("A tainted cluster node XBX1",y,v.id,v.width,v.height,v.x,v.y,t.parent(y)),Pr.get(v.id).node=v,nb(v);else if(t.children(y).length>0){Z.info("A pure cluster node XBX1",y,v.id,v.x,v.y,v.width,v.height,t.parent(y)),v.height+=g,t.node(v.parentId);let x=v?.padding/2||0,b=v?.labelBBox?.height||0,T=b-x||0;Z.debug("OffsetY",T,"labelHeight",b,"halfPadding",x),await wg(u,v),Pr.get(v.id).node=v}else{let x=t.node(v.parentId);v.y+=g/2,Z.info("A regular node XBX1 - using the padding",v.id,"parent",v.parentId,v.width,v.height,v.x,v.y,"offsetY",v.offsetY,"parent",x,x?.offsetY,v),nb(v)}})),t.edges().forEach(function(y){let v=t.edge(y);Z.info("Edge "+y.v+" -> "+y.w+": "+JSON.stringify(v),v),v.points.forEach(w=>w.y+=g/2);let x=t.node(y.v);var b=t.node(y.w);let T=K4(h,v,Pr,r,x,b,i);X4(v,T)}),t.nodes().forEach(function(y){let v=t.node(y);Z.info(y,v.type,v.diff),v.isGroup&&(m=v.diff)}),Z.warn("Returning from recursive render XAX",l,m),{elem:l,diff:m}},"recursiveRender"),utt=o(async(e,t)=>{let r=new ui({multigraph:!0,compound:!0}).setGraph({rankdir:e.direction,nodesep:e.config?.nodeSpacing||e.config?.flowchart?.nodeSpacing||e.nodeSpacing,ranksep:e.config?.rankSpacing||e.config?.flowchart?.rankSpacing||e.rankSpacing,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}}),i=t.select("g");Z4(i,e.markers,e.type,e.diagramId),qae(),Vae(),Oae(),afe(),e.nodes.forEach(a=>{r.setNode(a.id,{...a}),a.parentId&&r.setParent(a.id,a.parentId)}),Z.debug("Edges:",e.edges),e.edges.forEach(a=>{if(a.start===a.end){let s=a.start,l=s+"---"+s+"---1",u=s+"---"+s+"---2",h=r.node(s);r.setNode(l,{domId:l,id:l,parentId:h.parentId,labelStyle:"",label:"",padding:0,shape:"labelRect",style:"",width:10,height:10}),r.setParent(l,h.parentId),r.setNode(u,{domId:u,id:u,parentId:h.parentId,labelStyle:"",padding:0,shape:"labelRect",label:"",style:"",width:10,height:10}),r.setParent(u,h.parentId);let d=structuredClone(a),f=structuredClone(a),p=structuredClone(a);d.label="",d.arrowTypeEnd="none",d.endLabelLeft="",d.endLabelRight="",d.startLabelLeft="",d.id=s+"-cyclic-special-1",f.startLabelRight="",f.startLabelLeft="",f.endLabelLeft="",f.endLabelRight="",f.arrowTypeStart="none",f.arrowTypeEnd="none",f.id=s+"-cyclic-special-mid",p.label="",p.startLabelRight="",p.startLabelLeft="",p.arrowTypeStart="none",h.isGroup&&(d.fromCluster=s,p.toCluster=s),p.id=s+"-cyclic-special-2",p.arrowTypeStart="none",r.setEdge(s,l,d,s+"-cyclic-special-0"),r.setEdge(l,u,f,s+"-cyclic-special-1"),r.setEdge(u,s,p,s+"-cyc<lic-special-2")}else r.setEdge(a.start,a.end,{...a},a.id)}),Z.warn("Graph at first:",JSON.stringify(Ho(r))),lfe(r),Z.warn("Graph after XAX:",JSON.stringify(Ho(r)));let n=ge();await ffe(i,r,e.type,e.diagramId,void 0,n)},"render")});function qO(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,i=Array(t);r<t;r++)i[r]=e[r];return i}function htt(e){if(Array.isArray(e))return e}function dtt(e){if(Array.isArray(e))return qO(e)}function Kd(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ftt(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,U0e(i.key),i)}}function Zd(e,t,r){return t&&ftt(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Fs(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=uP(e))||t){r&&(e=r);var i=0,n=o(function(){},"F");return{s:n,n:o(function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},"n"),e:o(function(u){throw u},"e"),f:n}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
5
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a,s=!0,l=!1;return{s:o(function(){r=r.call(e)},"s"),n:o(function(){var u=r.next();return s=u.done,u},"n"),e:o(function(u){l=!0,a=u},"e"),f:o(function(){try{s||r.return==null||r.return()}finally{if(l)throw a}},"f")}}function q0e(e,t,r){return(t=U0e(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ptt(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function mtt(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var i,n,a,s,l=[],u=!0,h=!1;try{if(a=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;u=!1}else for(;!(u=(i=a.call(r)).done)&&(l.push(i.value),l.length!==t);u=!0);}catch(d){h=!0,n=d}finally{try{if(!u&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(h)throw n}}return l}}function gtt(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
6
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ytt(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
7
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Dn(e,t){return htt(e)||mtt(e,t)||uP(e,t)||gtt()}function N3(e){return dtt(e)||ptt(e)||uP(e)||ytt()}function vtt(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,t);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function U0e(e){var t=vtt(e,"string");return typeof t=="symbol"?t:t+""}function Wn(e){"@babel/helpers - typeof";return Wn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Wn(e)}function uP(e,t){if(e){if(typeof e=="string")return qO(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?qO(e,t):void 0}}function n2(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function a2(){if(vfe)return p9;vfe=1;function e(t){var r=typeof t;return t!=null&&(r=="object"||r=="function")}return o(e,"isObject"),p9=e,p9}function Gtt(){if(xfe)return m9;xfe=1;var e=typeof c3=="object"&&c3&&c3.Object===Object&&c3;return m9=e,m9}function j3(){if(bfe)return g9;bfe=1;var e=Gtt(),t=typeof self=="object"&&self&&self.Object===Object&&self,r=e||t||Function("return this")();return g9=r,g9}function Vtt(){if(Tfe)return y9;Tfe=1;var e=j3(),t=o(function(){return e.Date.now()},"now");return y9=t,y9}function Wtt(){if(Cfe)return v9;Cfe=1;var e=/\s/;function t(r){for(var i=r.length;i--&&e.test(r.charAt(i)););return i}return o(t,"trimmedEndIndex"),v9=t,v9}function qtt(){if(kfe)return x9;kfe=1;var e=Wtt(),t=/^\s+/;function r(i){return i&&i.slice(0,e(i)+1).replace(t,"")}return o(r,"baseTrim"),x9=r,x9}function fP(){if(wfe)return b9;wfe=1;var e=j3(),t=e.Symbol;return b9=t,b9}function Utt(){if(Sfe)return T9;Sfe=1;var e=fP(),t=Object.prototype,r=t.hasOwnProperty,i=t.toString,n=e?e.toStringTag:void 0;function a(s){var l=r.call(s,n),u=s[n];try{s[n]=void 0;var h=!0}catch{}var d=i.call(s);return h&&(l?s[n]=u:delete s[n]),d}return o(a,"getRawTag"),T9=a,T9}function Htt(){if(Efe)return C9;Efe=1;var e=Object.prototype,t=e.toString;function r(i){return t.call(i)}return o(r,"objectToString"),C9=r,C9}function eme(){if(Afe)return k9;Afe=1;var e=fP(),t=Utt(),r=Htt(),i="[object Null]",n="[object Undefined]",a=e?e.toStringTag:void 0;function s(l){return l==null?l===void 0?n:i:a&&a in Object(l)?t(l):r(l)}return o(s,"baseGetTag"),k9=s,k9}function Ytt(){if(_fe)return w9;_fe=1;function e(t){return t!=null&&typeof t=="object"}return o(e,"isObjectLike"),w9=e,w9}function s2(){if(Dfe)return S9;Dfe=1;var e=eme(),t=Ytt(),r="[object Symbol]";function i(n){return typeof n=="symbol"||t(n)&&e(n)==r}return o(i,"isSymbol"),S9=i,S9}function jtt(){if(Rfe)return E9;Rfe=1;var e=qtt(),t=a2(),r=s2(),i=NaN,n=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,s=/^0o[0-7]+$/i,l=parseInt;function u(h){if(typeof h=="number")return h;if(r(h))return i;if(t(h)){var d=typeof h.valueOf=="function"?h.valueOf():h;h=t(d)?d+"":d}if(typeof h!="string")return h===0?h:+h;h=e(h);var f=a.test(h);return f||s.test(h)?l(h.slice(2),f?2:8):n.test(h)?i:+h}return o(u,"toNumber"),E9=u,E9}function Xtt(){if(Lfe)return A9;Lfe=1;var e=a2(),t=Vtt(),r=jtt(),i="Expected a function",n=Math.max,a=Math.min;function s(l,u,h){var d,f,p,m,g,y,v=0,x=!1,b=!1,T=!0;if(typeof l!="function")throw new TypeError(i);u=r(u)||0,e(h)&&(x=!!h.leading,b="maxWait"in h,p=b?n(r(h.maxWait)||0,u):p,T="trailing"in h?!!h.trailing:T);function w(_){var R=d,M=f;return d=f=void 0,v=_,m=l.apply(M,R),m}o(w,"invokeFunc");function C(_){return v=_,g=setTimeout(A,u),x?w(_):m}o(C,"leadingEdge");function k(_){var R=_-y,M=_-v,L=u-R;return b?a(L,p-M):L}o(k,"remainingWait");function E(_){var R=_-y,M=_-v;return y===void 0||R>=u||R<0||b&&M>=p}o(E,"shouldInvoke");function A(){var _=t();if(E(_))return N(_);g=setTimeout(A,k(_))}o(A,"timerExpired");function N(_){return g=void 0,T&&d?w(_):(d=f=void 0,m)}o(N,"trailingEdge");function P(){g!==void 0&&clearTimeout(g),v=0,d=y=f=g=void 0}o(P,"cancel");function I(){return g===void 0?m:N(t())}o(I,"flush");function D(){var _=t(),R=E(_);if(d=arguments,f=this,y=_,R){if(g===void 0)return C(y);if(b)return clearTimeout(g),g=setTimeout(A,u),w(y)}return g===void 0&&(g=setTimeout(A,u)),m}return o(D,"debounced"),D.cancel=P,D.flush=I,D}return o(s,"debounce"),A9=s,A9}function ert(e,t,r,i,n){var a=n*Math.PI/180,s=Math.cos(a)*(e-r)-Math.sin(a)*(t-i)+r,l=Math.sin(a)*(e-r)+Math.cos(a)*(t-i)+i;return{x:s,y:l}}function rrt(e,t,r){if(r===0)return e;var i=(t.x1+t.x2)/2,n=(t.y1+t.y2)/2,a=t.w/t.h,s=1/a,l=ert(e.x,e.y,i,n,r),u=trt(l.x,l.y,i,n,a,s);return{x:u.x,y:u.y}}function frt(){return Pfe||(Pfe=1,(function(e,t){(function(){var r,i,n,a,s,l,u,h,d,f,p,m,g,y,v;n=Math.floor,f=Math.min,i=o(function(x,b){return x<b?-1:x>b?1:0},"defaultCmp"),d=o(function(x,b,T,w,C){var k;if(T==null&&(T=0),C==null&&(C=i),T<0)throw new Error("lo must be non-negative");for(w==null&&(w=x.length);T<w;)k=n((T+w)/2),C(b,x[k])<0?w=k:T=k+1;return[].splice.apply(x,[T,T-T].concat(b)),b},"insort"),l=o(function(x,b,T){return T==null&&(T=i),x.push(b),y(x,0,x.length-1,T)},"heappush"),s=o(function(x,b){var T,w;return b==null&&(b=i),T=x.pop(),x.length?(w=x[0],x[0]=T,v(x,0,b)):w=T,w},"heappop"),h=o(function(x,b,T){var w;return T==null&&(T=i),w=x[0],x[0]=b,v(x,0,T),w},"heapreplace"),u=o(function(x,b,T){var w;return T==null&&(T=i),x.length&&T(x[0],b)<0&&(w=[x[0],b],b=w[0],x[0]=w[1],v(x,0,T)),b},"heappushpop"),a=o(function(x,b){var T,w,C,k,E,A;for(b==null&&(b=i),k=(function(){A=[];for(var N=0,P=n(x.length/2);0<=P?N<P:N>P;0<=P?N++:N--)A.push(N);return A}).apply(this).reverse(),E=[],w=0,C=k.length;w<C;w++)T=k[w],E.push(v(x,T,b));return E},"heapify"),g=o(function(x,b,T){var w;if(T==null&&(T=i),w=x.indexOf(b),w!==-1)return y(x,0,w,T),v(x,w,T)},"updateItem"),p=o(function(x,b,T){var w,C,k,E,A;if(T==null&&(T=i),C=x.slice(0,b),!C.length)return C;for(a(C,T),A=x.slice(b),k=0,E=A.length;k<E;k++)w=A[k],u(C,w,T);return C.sort(T).reverse()},"nlargest"),m=o(function(x,b,T){var w,C,k,E,A,N,P,I,D;if(T==null&&(T=i),b*10<=x.length){if(k=x.slice(0,b).sort(T),!k.length)return k;for(C=k[k.length-1],P=x.slice(b),E=0,N=P.length;E<N;E++)w=P[E],T(w,C)<0&&(d(k,w,0,null,T),k.pop(),C=k[k.length-1]);return k}for(a(x,T),D=[],A=0,I=f(b,x.length);0<=I?A<I:A>I;0<=I?++A:--A)D.push(s(x,T));return D},"nsmallest"),y=o(function(x,b,T,w){var C,k,E;for(w==null&&(w=i),C=x[T];T>b;){if(E=T-1>>1,k=x[E],w(C,k)<0){x[T]=k,T=E;continue}break}return x[T]=C},"_siftdown"),v=o(function(x,b,T){var w,C,k,E,A;for(T==null&&(T=i),C=x.length,A=b,k=x[b],w=2*b+1;w<C;)E=w+1,E<C&&!(T(x[w],x[E])<0)&&(w=E),x[b]=x[w],b=w,w=2*b+1;return x[b]=k,y(x,A,b,T)},"_siftup"),r=(function(){x.push=l,x.pop=s,x.replace=h,x.pushpop=u,x.heapify=a,x.updateItem=g,x.nlargest=p,x.nsmallest=m;function x(b){this.cmp=b??i,this.nodes=[]}return o(x,"Heap"),x.prototype.push=function(b){return l(this.nodes,b,this.cmp)},x.prototype.pop=function(){return s(this.nodes,this.cmp)},x.prototype.peek=function(){return this.nodes[0]},x.prototype.contains=function(b){return this.nodes.indexOf(b)!==-1},x.prototype.replace=function(b){return h(this.nodes,b,this.cmp)},x.prototype.pushpop=function(b){return u(this.nodes,b,this.cmp)},x.prototype.heapify=function(){return a(this.nodes,this.cmp)},x.prototype.updateItem=function(b){return g(this.nodes,b,this.cmp)},x.prototype.clear=function(){return this.nodes=[]},x.prototype.empty=function(){return this.nodes.length===0},x.prototype.size=function(){return this.nodes.length},x.prototype.clone=function(){var b;return b=new x,b.nodes=this.nodes.slice(0),b},x.prototype.toArray=function(){return this.nodes.slice(0)},x.prototype.insert=x.prototype.push,x.prototype.top=x.prototype.peek,x.prototype.front=x.prototype.peek,x.prototype.has=x.prototype.contains,x.prototype.copy=x.prototype.clone,x})(),(function(x,b){return e.exports=b()})(this,function(){return r})}).call(drt)})(C3)),C3.exports}function prt(){return Bfe||(Bfe=1,D9=frt()),D9}function zrt(e,t){if(e.length<3)throw new Error("Need at least 3 vertices");var r=o(function(A,N){return{x:A.x+N.x,y:A.y+N.y}},"add"),i=o(function(A,N){return{x:A.x-N.x,y:A.y-N.y}},"sub"),n=o(function(A,N){return{x:A.x*N,y:A.y*N}},"scale"),a=o(function(A,N){return A.x*N.y-A.y*N.x},"cross"),s=o(function(A){var N=$rt(A.x,A.y);return N===0?{x:0,y:0}:{x:A.x/N,y:A.y/N}},"normalize"),l=o(function(A){for(var N=0,P=0;P<A.length;P++){var I=A[P],D=A[(P+1)%A.length];N+=I.x*D.y-D.x*I.y}return N/2},"signedArea"),u=o(function(A,N,P,I){var D=i(N,A),_=i(I,P),R=a(D,_);if(Math.abs(R)<1e-9)return r(A,n(D,.5));var M=a(i(P,A),_)/R;return r(A,n(D,M))},"intersectLines"),h=e.map(function(E){return{x:E.x,y:E.y}});l(h)<0&&h.reverse();for(var d=h.length,f=[],p=0;p<d;p++){var m=h[p],g=h[(p+1)%d],y=i(g,m),v=s({x:y.y,y:-y.x});f.push(v)}for(var x=f.map(function(E,A){var N=r(h[A],n(E,t)),P=r(h[(A+1)%d],n(E,t));return{p1:N,p2:P}}),b=[],T=0;T<d;T++){var w=x[(T-1+d)%d],C=x[T],k=u(w.p1,w.p2,C.p1,C.p2);b.push(k)}return b}function Grt(e,t,r,i,n,a){var s=Krt(e,t,r,i,n),l=zrt(s,a),u=is();return l.forEach(function(h){return ume(u,h.x,h.y)}),u}function N9(e,t){function r(f){for(var p=[],m=0;m<f.length;m++){var g=f[m],y=f[(m+1)%f.length],v={x:y.x-g.x,y:y.y-g.y},x={x:-v.y,y:v.x},b=Math.sqrt(x.x*x.x+x.y*x.y);p.push({x:x.x/b,y:x.y/b})}return p}o(r,"getAxes");function i(f,p){var m=1/0,g=-1/0,y=Fs(f),v;try{for(y.s();!(v=y.n()).done;){var x=v.value,b=x.x*p.x+x.y*p.y;m=Math.min(m,b),g=Math.max(g,b)}}catch(T){y.e(T)}finally{y.f()}return{min:m,max:g}}o(i,"project");function n(f,p){return!(f.max<p.min||p.max<f.min)}o(n,"overlaps");var a=[].concat(N3(r(e)),N3(r(t))),s=Fs(a),l;try{for(s.s();!(l=s.n()).done;){var u=l.value,h=i(e,u),d=i(t,u);if(!n(h,d))return!1}}catch(f){s.e(f)}finally{s.f()}return!0}function Z3(e,t,r,i,n,a){var s;return Ji(e)?s=e:s=m1[e]||m1.euclidean,t===0&&Ji(e)?s(n,a):s(t,r,i,n,a)}function Q3(){if(tpe)return O9;tpe=1;var e=Array.isArray;return O9=e,O9}function Wit(){if(rpe)return P9;rpe=1;var e=Q3(),t=s2(),r=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,i=/^\w*$/;function n(a,s){if(e(a))return!1;var l=typeof a;return l=="number"||l=="symbol"||l=="boolean"||a==null||t(a)?!0:i.test(a)||!r.test(a)||s!=null&&a in Object(s)}return o(n,"isKey"),P9=n,P9}function qit(){if(ipe)return B9;ipe=1;var e=eme(),t=a2(),r="[object AsyncFunction]",i="[object Function]",n="[object GeneratorFunction]",a="[object Proxy]";function s(l){if(!t(l))return!1;var u=e(l);return u==i||u==n||u==r||u==a}return o(s,"isFunction"),B9=s,B9}function Uit(){if(npe)return F9;npe=1;var e=j3(),t=e["__core-js_shared__"];return F9=t,F9}function Hit(){if(ape)return $9;ape=1;var e=Uit(),t=(function(){var i=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||"");return i?"Symbol(src)_1."+i:""})();function r(i){return!!t&&t in i}return o(r,"isMasked"),$9=r,$9}function Yit(){if(spe)return z9;spe=1;var e=Function.prototype,t=e.toString;function r(i){if(i!=null){try{return t.call(i)}catch{}try{return i+""}catch{}}return""}return o(r,"toSource"),z9=r,z9}function jit(){if(ope)return G9;ope=1;var e=qit(),t=Hit(),r=a2(),i=Yit(),n=/[\\^$.*+?()[\]{}|]/g,a=/^\[object .+?Constructor\]$/,s=Function.prototype,l=Object.prototype,u=s.toString,h=l.hasOwnProperty,d=RegExp("^"+u.call(h).replace(n,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function f(p){if(!r(p)||t(p))return!1;var m=e(p)?d:a;return m.test(i(p))}return o(f,"baseIsNative"),G9=f,G9}function Xit(){if(lpe)return V9;lpe=1;function e(t,r){return t?.[r]}return o(e,"getValue"),V9=e,V9}function CP(){if(cpe)return W9;cpe=1;var e=jit(),t=Xit();function r(i,n){var a=t(i,n);return e(a)?a:void 0}return o(r,"getNative"),W9=r,W9}function J3(){if(upe)return q9;upe=1;var e=CP(),t=e(Object,"create");return q9=t,q9}function Kit(){if(hpe)return U9;hpe=1;var e=J3();function t(){this.__data__=e?e(null):{},this.size=0}return o(t,"hashClear"),U9=t,U9}function Zit(){if(dpe)return H9;dpe=1;function e(t){var r=this.has(t)&&delete this.__data__[t];return this.size-=r?1:0,r}return o(e,"hashDelete"),H9=e,H9}function Qit(){if(fpe)return Y9;fpe=1;var e=J3(),t="__lodash_hash_undefined__",r=Object.prototype,i=r.hasOwnProperty;function n(a){var s=this.__data__;if(e){var l=s[a];return l===t?void 0:l}return i.call(s,a)?s[a]:void 0}return o(n,"hashGet"),Y9=n,Y9}function Jit(){if(ppe)return j9;ppe=1;var e=J3(),t=Object.prototype,r=t.hasOwnProperty;function i(n){var a=this.__data__;return e?a[n]!==void 0:r.call(a,n)}return o(i,"hashHas"),j9=i,j9}function ent(){if(mpe)return X9;mpe=1;var e=J3(),t="__lodash_hash_undefined__";function r(i,n){var a=this.__data__;return this.size+=this.has(i)?0:1,a[i]=e&&n===void 0?t:n,this}return o(r,"hashSet"),X9=r,X9}function tnt(){if(gpe)return K9;gpe=1;var e=Kit(),t=Zit(),r=Qit(),i=Jit(),n=ent();function a(s){var l=-1,u=s==null?0:s.length;for(this.clear();++l<u;){var h=s[l];this.set(h[0],h[1])}}return o(a,"Hash"),a.prototype.clear=e,a.prototype.delete=t,a.prototype.get=r,a.prototype.has=i,a.prototype.set=n,K9=a,K9}function rnt(){if(ype)return Z9;ype=1;function e(){this.__data__=[],this.size=0}return o(e,"listCacheClear"),Z9=e,Z9}function Sme(){if(vpe)return Q9;vpe=1;function e(t,r){return t===r||t!==t&&r!==r}return o(e,"eq"),Q9=e,Q9}function eE(){if(xpe)return J9;xpe=1;var e=Sme();function t(r,i){for(var n=r.length;n--;)if(e(r[n][0],i))return n;return-1}return o(t,"assocIndexOf"),J9=t,J9}function int(){if(bpe)return eO;bpe=1;var e=eE(),t=Array.prototype,r=t.splice;function i(n){var a=this.__data__,s=e(a,n);if(s<0)return!1;var l=a.length-1;return s==l?a.pop():r.call(a,s,1),--this.size,!0}return o(i,"listCacheDelete"),eO=i,eO}function nnt(){if(Tpe)return tO;Tpe=1;var e=eE();function t(r){var i=this.__data__,n=e(i,r);return n<0?void 0:i[n][1]}return o(t,"listCacheGet"),tO=t,tO}function ant(){if(Cpe)return rO;Cpe=1;var e=eE();function t(r){return e(this.__data__,r)>-1}return o(t,"listCacheHas"),rO=t,rO}function snt(){if(kpe)return iO;kpe=1;var e=eE();function t(r,i){var n=this.__data__,a=e(n,r);return a<0?(++this.size,n.push([r,i])):n[a][1]=i,this}return o(t,"listCacheSet"),iO=t,iO}function ont(){if(wpe)return nO;wpe=1;var e=rnt(),t=int(),r=nnt(),i=ant(),n=snt();function a(s){var l=-1,u=s==null?0:s.length;for(this.clear();++l<u;){var h=s[l];this.set(h[0],h[1])}}return o(a,"ListCache"),a.prototype.clear=e,a.prototype.delete=t,a.prototype.get=r,a.prototype.has=i,a.prototype.set=n,nO=a,nO}function lnt(){if(Spe)return aO;Spe=1;var e=CP(),t=j3(),r=e(t,"Map");return aO=r,aO}function cnt(){if(Epe)return sO;Epe=1;var e=tnt(),t=ont(),r=lnt();function i(){this.size=0,this.__data__={hash:new e,map:new(r||t),string:new e}}return o(i,"mapCacheClear"),sO=i,sO}function unt(){if(Ape)return oO;Ape=1;function e(t){var r=typeof t;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?t!=="__proto__":t===null}return o(e,"isKeyable"),oO=e,oO}function tE(){if(_pe)return lO;_pe=1;var e=unt();function t(r,i){var n=r.__data__;return e(i)?n[typeof i=="string"?"string":"hash"]:n.map}return o(t,"getMapData"),lO=t,lO}function hnt(){if(Dpe)return cO;Dpe=1;var e=tE();function t(r){var i=e(this,r).delete(r);return this.size-=i?1:0,i}return o(t,"mapCacheDelete"),cO=t,cO}function dnt(){if(Rpe)return uO;Rpe=1;var e=tE();function t(r){return e(this,r).get(r)}return o(t,"mapCacheGet"),uO=t,uO}function fnt(){if(Lpe)return hO;Lpe=1;var e=tE();function t(r){return e(this,r).has(r)}return o(t,"mapCacheHas"),hO=t,hO}function pnt(){if(Mpe)return dO;Mpe=1;var e=tE();function t(r,i){var n=e(this,r),a=n.size;return n.set(r,i),this.size+=n.size==a?0:1,this}return o(t,"mapCacheSet"),dO=t,dO}function mnt(){if(Npe)return fO;Npe=1;var e=cnt(),t=hnt(),r=dnt(),i=fnt(),n=pnt();function a(s){var l=-1,u=s==null?0:s.length;for(this.clear();++l<u;){var h=s[l];this.set(h[0],h[1])}}return o(a,"MapCache"),a.prototype.clear=e,a.prototype.delete=t,a.prototype.get=r,a.prototype.has=i,a.prototype.set=n,fO=a,fO}function gnt(){if(Ipe)return pO;Ipe=1;var e=mnt(),t="Expected a function";function r(i,n){if(typeof i!="function"||n!=null&&typeof n!="function")throw new TypeError(t);var a=o(function(){var s=arguments,l=n?n.apply(this,s):s[0],u=a.cache;if(u.has(l))return u.get(l);var h=i.apply(this,s);return a.cache=u.set(l,h)||u,h},"memoized");return a.cache=new(r.Cache||e),a}return o(r,"memoize"),r.Cache=e,pO=r,pO}function ynt(){if(Ope)return mO;Ope=1;var e=gnt(),t=500;function r(i){var n=e(i,function(s){return a.size===t&&a.clear(),s}),a=n.cache;return n}return o(r,"memoizeCapped"),mO=r,mO}function Eme(){if(Ppe)return gO;Ppe=1;var e=ynt(),t=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,r=/\\(\\)?/g,i=e(function(n){var a=[];return n.charCodeAt(0)===46&&a.push(""),n.replace(t,function(s,l,u,h){a.push(u?h.replace(r,"$1"):l||s)}),a});return gO=i,gO}function Ame(){if(Bpe)return yO;Bpe=1;function e(t,r){for(var i=-1,n=t==null?0:t.length,a=Array(n);++i<n;)a[i]=r(t[i],i,t);return a}return o(e,"arrayMap"),yO=e,yO}function vnt(){if(Fpe)return vO;Fpe=1;var e=fP(),t=Ame(),r=Q3(),i=s2(),n=e?e.prototype:void 0,a=n?n.toString:void 0;function s(l){if(typeof l=="string")return l;if(r(l))return t(l,s)+"";if(i(l))return a?a.call(l):"";var u=l+"";return u=="0"&&1/l==-1/0?"-0":u}return o(s,"baseToString"),vO=s,vO}function _me(){if($pe)return xO;$pe=1;var e=vnt();function t(r){return r==null?"":e(r)}return o(t,"toString"),xO=t,xO}function Dme(){if(zpe)return bO;zpe=1;var e=Q3(),t=Wit(),r=Eme(),i=_me();function n(a,s){return e(a)?a:t(a,s)?[a]:r(i(a))}return o(n,"castPath"),bO=n,bO}function kP(){if(Gpe)return TO;Gpe=1;var e=s2();function t(r){if(typeof r=="string"||e(r))return r;var i=r+"";return i=="0"&&1/r==-1/0?"-0":i}return o(t,"toKey"),TO=t,TO}function xnt(){if(Vpe)return CO;Vpe=1;var e=Dme(),t=kP();function r(i,n){n=e(n,i);for(var a=0,s=n.length;i!=null&&a<s;)i=i[t(n[a++])];return a&&a==s?i:void 0}return o(r,"baseGet"),CO=r,CO}function bnt(){if(Wpe)return kO;Wpe=1;var e=xnt();function t(r,i,n){var a=r==null?void 0:e(r,i);return a===void 0?n:a}return o(t,"get"),kO=t,kO}function knt(){if(qpe)return wO;qpe=1;var e=CP(),t=(function(){try{var r=e(Object,"defineProperty");return r({},"",{}),r}catch{}})();return wO=t,wO}function wnt(){if(Upe)return SO;Upe=1;var e=knt();function t(r,i,n){i=="__proto__"&&e?e(r,i,{configurable:!0,enumerable:!0,value:n,writable:!0}):r[i]=n}return o(t,"baseAssignValue"),SO=t,SO}function Snt(){if(Hpe)return EO;Hpe=1;var e=wnt(),t=Sme(),r=Object.prototype,i=r.hasOwnProperty;function n(a,s,l){var u=a[s];(!(i.call(a,s)&&t(u,l))||l===void 0&&!(s in a))&&e(a,s,l)}return o(n,"assignValue"),EO=n,EO}function Ent(){if(Ype)return AO;Ype=1;var e=9007199254740991,t=/^(?:0|[1-9]\d*)$/;function r(i,n){var a=typeof i;return n=n??e,!!n&&(a=="number"||a!="symbol"&&t.test(i))&&i>-1&&i%1==0&&i<n}return o(r,"isIndex"),AO=r,AO}function Ant(){if(jpe)return _O;jpe=1;var e=Snt(),t=Dme(),r=Ent(),i=a2(),n=kP();function a(s,l,u,h){if(!i(s))return s;l=t(l,s);for(var d=-1,f=l.length,p=f-1,m=s;m!=null&&++d<f;){var g=n(l[d]),y=u;if(g==="__proto__"||g==="constructor"||g==="prototype")return s;if(d!=p){var v=m[g];y=h?h(v,g,m):void 0,y===void 0&&(y=i(v)?v:r(l[d+1])?[]:{})}e(m,g,y),m=m[g]}return s}return o(a,"baseSet"),_O=a,_O}function _nt(){if(Xpe)return DO;Xpe=1;var e=Ant();function t(r,i,n){return r==null?r:e(r,i,n)}return o(t,"set"),DO=t,DO}function Lnt(){if(Kpe)return RO;Kpe=1;function e(t,r){var i=-1,n=t.length;for(r||(r=Array(n));++i<n;)r[i]=t[i];return r}return o(e,"copyArray"),RO=e,RO}function Mnt(){if(Zpe)return LO;Zpe=1;var e=Ame(),t=Lnt(),r=Q3(),i=s2(),n=Eme(),a=kP(),s=_me();function l(u){return r(u)?e(u,a):i(u)?[u]:t(n(s(u)))}return o(l,"toPath"),LO=l,LO}function SP(e,t,r,i){for(var n=[],a=new y1,s=e.cy(),l=s.hasCompoundNodes(),u=0;u<e.length;u++){var h=e[u];r?n.push(h):l&&i(n,a,h)}for(;n.length>0;){var d=n.shift();t(d),a.add(d.id()),l&&i(n,a,d)}return e}function Lme(e,t,r){if(r.isParent())for(var i=r._private.children,n=0;n<i.length;n++){var a=i[n];t.has(a.id())||e.push(a)}}function Mme(e,t,r){if(r.isChild()){var i=r._private.parent;t.has(i.id())||e.push(i)}}function Qnt(e,t,r){Mme(e,t,r),Lme(e,t,r)}function MO(e){return function(t){var r=this;if(t===void 0&&(t=!0),r.length!==0)if(r.isNode()&&!r.removed()){for(var i=0,n=r[0],a=n._private.edges,s=0;s<a.length;s++){var l=a[s];!t&&l.isLoop()||(i+=e(n,l))}return i}else return}}function e1(e,t){return function(r){for(var i,n=this.nodes(),a=0;a<n.length;a++){var s=n[a],l=s[e](r);l!==void 0&&(i===void 0||t(l,i))&&(i=l)}return i}}function Ob(){return!1}function g3(){return!0}function iE(){for(var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:yat,t=arguments.length>1?arguments[1]:void 0,r=0;r<n0e.length;r++){var i=n0e[r];this[i]=e[i]||Vme[i]}this.context=t||this.context,this.listeners=[],this.emitting=0}function Yme(e,t,r){var i=r._private,n=i.styleCache=i.styleCache||[],a;return(a=n[e])!=null||(a=n[e]=t(r)),a}function nE(e,t){return e=Jp(e),o(function(i){return Yme(e,t,i)},"cachedStyleFunction")}function aE(e,t){e=Jp(e);var r=o(function(n){return t.call(n)},"selfFn");return o(function(){var n=this[0];if(n)return Yme(e,r,n)},"cachedPrototypeStyleFunction")}function IO(e,t){var r=e._private,i=r.data.parent?e.parents():null;if(i)for(var n=0;n<i.length;n++){var a=i[n];if(!t(a))return!1}return!0}function EP(e){var t=e.ok,r=e.edgeOkViaNode||e.ok,i=e.parentOk||e.ok;return function(){var n=this.cy();if(!n.styleEnabled())return!0;var a=this[0],s=n.hasCompoundNodes();if(a){var l=a._private;if(!t(a))return!1;if(a.isNode())return!s||IO(a,i);var u=l.source,h=l.target;return r(u)&&(!s||IO(u,r))&&(u===h||r(h)&&(!s||IO(h,r)))}}}function s0e(e){return function(){var t=arguments,r=[];if(t.length===2){var i=t[0],n=t[1];this.on(e.event,i,n)}else if(t.length===1&&Ji(t[0])){var a=t[0];this.on(e.event,a)}else if(t.length===0||t.length===1&&Si(t[0])){for(var s=t.length===1?t[0]:null,l=0;l<this.length;l++){var u=this[l],h=!e.ableField||u._private[e.ableField],d=u._private[e.field]!=e.value;if(e.overrideAble){var f=e.overrideAble(u);if(f!==void 0&&(h=f,!f))return this}h&&(u._private[e.field]=e.value,d&&r.push(u))}var p=this.spawn(r);p.updateStyle(),p.emit(e.event),s&&p.emit(s)}return this}}function b1(e){Wd[e.field]=function(){var t=this[0];if(t){if(e.overrideField){var r=e.overrideField(t);if(r!==void 0)return r}return t._private[e.field]}},Wd[e.on]=s0e({event:e.on,field:e.field,ableField:e.ableField,overrideAble:e.overrideAble,value:!0}),Wd[e.off]=s0e({event:e.off,field:e.field,ableField:e.ableField,overrideAble:e.overrideAble,value:!1})}function u0e(e){return o(function(r){for(var i=[],n=0;n<this.length;n++){var a=this[n],s=a._private[e.attr];s&&i.push(s)}return this.spawn(i,!0).filter(r)},"sourceImpl")}function h0e(e){return o(function(r){var i=[],n=this._private.cy,a=e||{};sr(r)&&(r=n.$(r));for(var s=0;s<r.length;s++)for(var l=r[s]._private.edges,u=0;u<l.length;u++){var h=l[u],d=h._private.data,f=this.hasElementWithId(d.source)&&r.hasElementWithId(d.target),p=r.hasElementWithId(d.source)&&this.hasElementWithId(d.target),m=f||p;m&&((a.thisIsSrc||a.thisIsTgt)&&(a.thisIsSrc&&!f||a.thisIsTgt&&!p)||i.push(h))}return this.spawn(i,!0)},"edgesWithImpl")}function d0e(e){var t={codirected:!1};return e=hr({},t,e),o(function(i){for(var n=[],a=this.edges(),s=e,l=0;l<a.length;l++)for(var u=a[l],h=u._private,d=h.source,f=d._private.data.id,p=h.data.target,m=d._private.edges,g=0;g<m.length;g++){var y=m[g],v=y._private.data,x=v.target,b=v.source,T=x===p&&b===f,w=f===x&&p===b;(s.codirected&&T||!s.codirected&&(T||w))&&n.push(y)}return this.spawn(n,!0).filter(i)},"parallelEdgesImpl")}function _at(e,t,r,i){var n=4,a=.001,s=1e-7,l=10,u=11,h=1/(u-1),d=typeof Float32Array<"u";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;e=Math.min(e,1),r=Math.min(r,1),e=Math.max(e,0),r=Math.max(r,0);var p=d?new Float32Array(u):new Array(u);function m(P,I){return 1-3*I+3*P}o(m,"A");function g(P,I){return 3*I-6*P}o(g,"B");function y(P){return 3*P}o(y,"C");function v(P,I,D){return((m(I,D)*P+g(I,D))*P+y(I))*P}o(v,"calcBezier");function x(P,I,D){return 3*m(I,D)*P*P+2*g(I,D)*P+y(I)}o(x,"getSlope");function b(P,I){for(var D=0;D<n;++D){var _=x(I,e,r);if(_===0)return I;var R=v(I,e,r)-P;I-=R/_}return I}o(b,"newtonRaphsonIterate");function T(){for(var P=0;P<u;++P)p[P]=v(P*h,e,r)}o(T,"calcSampleValues");function w(P,I,D){var _,R,M=0;do R=I+(D-I)/2,_=v(R,e,r)-P,_>0?D=R:I=R;while(Math.abs(_)>s&&++M<l);return R}o(w,"binarySubdivide");function C(P){for(var I=0,D=1,_=u-1;D!==_&&p[D]<=P;++D)I+=h;--D;var R=(P-p[D])/(p[D+1]-p[D]),M=I+R*h,L=x(M,e,r);return L>=a?b(P,M):L===0?M:w(P,I,I+h)}o(C,"getTForX");var k=!1;function E(){k=!0,(e!==t||r!==i)&&T()}o(E,"precompute");var A=o(function(I){return k||E(),e===t&&r===i?I:I===0?0:I===1?1:v(C(I),t,i)},"f");A.getControlPoints=function(){return[{x:e,y:t},{x:r,y:i}]};var N="generateBezier("+[e,t,r,i]+")";return A.toString=function(){return N},A}function f0e(e,t,r,i,n){if(i===1||t===r)return r;var a=n(t,r,i);return e==null||((e.roundValue||e.color)&&(a=Math.round(a)),e.min!==void 0&&(a=Math.max(a,e.min)),e.max!==void 0&&(a=Math.min(a,e.max))),a}function p0e(e,t){return e.pfValue!=null||e.value!=null?e.pfValue!=null&&(t==null||t.type.units!=="%")?e.pfValue:e.value:e}function t1(e,t,r,i,n){var a=n!=null?n.type:null;r<0?r=0:r>1&&(r=1);var s=p0e(e,n),l=p0e(t,n);if(Ot(s)&&Ot(l))return f0e(a,s,l,r,i);if(Si(s)&&Si(l)){for(var u=[],h=0;h<l.length;h++){var d=s[h],f=l[h];if(d!=null&&f!=null){var p=f0e(a,d,f,r,i);u.push(p)}else u.push(f)}return u}}function Rat(e,t,r,i){var n=!i,a=e._private,s=t._private,l=s.easing,u=s.startTime,h=i?e:e.cy(),d=h.style();if(!s.easingImpl)if(l==null)s.easingImpl=A3.linear;else{var f;if(sr(l)){var p=d.parse("transition-timing-function",l);f=p.value}else f=l;var m,g;sr(f)?(m=f,g=[]):(m=f[1],g=f.slice(2).map(function($){return+$})),g.length>0?(m==="spring"&&g.push(s.duration),s.easingImpl=A3[m].apply(null,g)):s.easingImpl=A3[m]}var y=s.easingImpl,v;if(s.duration===0?v=1:v=(r-u)/s.duration,s.applying&&(v=s.progress),v<0?v=0:v>1&&(v=1),s.delay==null){var x=s.startPosition,b=s.position;if(b&&n&&!e.locked()){var T={};Pb(x.x,b.x)&&(T.x=t1(x.x,b.x,v,y)),Pb(x.y,b.y)&&(T.y=t1(x.y,b.y,v,y)),e.position(T)}var w=s.startPan,C=s.pan,k=a.pan,E=C!=null&&i;E&&(Pb(w.x,C.x)&&(k.x=t1(w.x,C.x,v,y)),Pb(w.y,C.y)&&(k.y=t1(w.y,C.y,v,y)),e.emit("pan"));var A=s.startZoom,N=s.zoom,P=N!=null&&i;P&&(Pb(A,N)&&(a.zoom=Xb(a.minZoom,t1(A,N,v,y),a.maxZoom)),e.emit("zoom")),(E||P)&&e.emit("viewport");var I=s.style;if(I&&I.length>0&&n){for(var D=0;D<I.length;D++){var _=I[D],R=_.name,M=_,L=s.startStyle[R],B=d.properties[L.name],O=t1(L,M,v,y,B);d.overrideBypass(e,R,O)}e.emit("style")}}return s.progress=v,v}function Pb(e,t){return e==null||t==null?!1:Ot(e)&&Ot(t)?!0:!!(e&&t)}function Lat(e,t,r,i){var n=t._private;n.started=!0,n.startTime=r-n.progress*n.duration}function m0e(e,t){var r=t._private.aniEles,i=[];function n(d,f){var p=d._private,m=p.animation.current,g=p.animation.queue,y=!1;if(m.length===0){var v=g.shift();v&&m.push(v)}for(var x=o(function(k){for(var E=k.length-1;E>=0;E--){var A=k[E];A()}k.splice(0,k.length)},"callbacks"),b=m.length-1;b>=0;b--){var T=m[b],w=T._private;if(w.stopped){m.splice(b,1),w.hooked=!1,w.playing=!1,w.started=!1,x(w.frames);continue}!w.playing&&!w.applying||(w.playing&&w.applying&&(w.applying=!1),w.started||Lat(d,T,e),Rat(d,T,e,f),w.applying&&(w.applying=!1),x(w.frames),w.step!=null&&w.step(e),T.completed()&&(m.splice(b,1),w.hooked=!1,w.playing=!1,w.started=!1,x(w.completes)),y=!0)}return!f&&m.length===0&&g.length===0&&i.push(d),y}o(n,"stepOne");for(var a=!1,s=0;s<r.length;s++){var l=r[s],u=n(l);a=a||u}var h=n(t,!0);(a||h)&&(r.length>0?t.notify("draw",r):t.notify("draw")),r.unmerge(i),t.emit("step")}function Xme(e){this.options=hr({},$at,zat,e)}function Kme(e){this.options=hr({},Gat,e)}function Zme(e){this.options=hr({},Vat,e)}function lE(e){this.options=hr({},Wat,e),this.options.layout=this;var t=this.options.eles.nodes(),r=this.options.eles.edges(),i=r.filter(function(n){var a=n.source().data("id"),s=n.target().data("id"),l=t.some(function(h){return h.data("id")===a}),u=t.some(function(h){return h.data("id")===s});return!l||!u});this.options.eles=this.options.eles.not(i)}function tge(e){this.options=hr({},nst,e)}function DP(e){this.options=hr({},ast,e)}function rge(e){this.options=hr({},sst,e)}function ige(e){this.options=hr({},ost,e)}function nge(e){this.options=e,this.notifications=0}function oge(e,t){t.radius===0?e.lineTo(t.cx,t.cy):e.arc(t.cx,t.cy,t.radius,t.startAngle,t.endAngle,t.counterClockwise)}function LP(e,t,r,i){var n=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0;return i===0||t.radius===0?{cx:t.x,cy:t.y,radius:0,startX:t.x,startY:t.y,stopX:t.x,stopY:t.y,startAngle:void 0,endAngle:void 0,counterClockwise:void 0}:(ust(e,t,r,i,n),{cx:tP,cy:rP,radius:Xp,startX:age,startY:sge,stopX:iP,stopY:nP,startAngle:Pc.ang+Math.PI/2*Zp,endAngle:Yo.ang-Math.PI/2*Zp,counterClockwise:R3})}function lge(e){var t=[];if(e!=null){for(var r=0;r<e.length;r+=2){var i=e[r],n=e[r+1];t.push({x:i,y:n})}return t}}function dst(e,t,r){for(var i=o(function(h,d,f,p){return na(h,d,f,p)},"qbezierAt$1"),n=t._private,a=n.rstyle.bezierPts,s=0;s<e.bezierProjPcts.length;s++){var l=e.bezierProjPcts[s];a.push({x:i(r[0],r[2],r[4],l),y:i(r[1],r[3],r[5],l)})}}function Vst(e,t){for(var r=0;r<t.length;r++){var i=t[r];e.lineTo(i.x,i.y)}}function Wst(e,t,r){for(var i,n=0;n<t.length;n++){var a=t[n];n===0&&(i=a),e.lineTo(a.x,a.y)}e.quadraticCurveTo(r.x,r.y,i.x,i.y)}function N0e(e,t,r){e.beginPath&&e.beginPath();for(var i=t,n=0;n<i.length;n++){var a=i[n];e.lineTo(a.x,a.y)}var s=r,l=r[0];e.moveTo(l.x,l.y);for(var n=1;n<s.length;n++){var a=s[n];e.lineTo(a.x,a.y)}e.closePath&&e.closePath()}function qst(e,t,r,i,n){e.beginPath&&e.beginPath(),e.arc(r,i,n,0,Math.PI*2,!1);var a=t,s=a[0];e.moveTo(s.x,s.y);for(var l=0;l<a.length;l++){var u=a[l];e.lineTo(u.x,u.y)}e.closePath&&e.closePath()}function Ust(e,t,r,i){e.arc(t,r,i,0,Math.PI*2,!1)}function Zst(e,t,r,i,n){var a=Math.min(i,n),s=a/2,l=t+i/2,u=r+n/2;e.beginPath(),e.arc(l,u,s,0,Math.PI*2),e.closePath()}function I0e(e,t,r,i,n){var a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:5,s=Math.min(a,i/2,n/2);e.beginPath(),e.moveTo(t+s,r),e.lineTo(t+i-s,r),e.quadraticCurveTo(t+i,r,t+i,r+s),e.lineTo(t+i,r+n-s),e.quadraticCurveTo(t+i,r+n,t+i-s,r+n),e.lineTo(t+s,r+n),e.quadraticCurveTo(t,r+n,t,r+n-s),e.lineTo(t,r+s),e.quadraticCurveTo(t,r,t+s,r),e.closePath()}function O0e(e,t,r){var i=e.createShader(t);if(e.shaderSource(i,r),e.compileShader(i),!e.getShaderParameter(i,e.COMPILE_STATUS))throw new Error(e.getShaderInfoLog(i));return i}function Jst(e,t,r){var i=O0e(e,e.VERTEX_SHADER,t),n=O0e(e,e.FRAGMENT_SHADER,r),a=e.createProgram();if(e.attachShader(a,i),e.attachShader(a,n),e.linkProgram(a),!e.getProgramParameter(a,e.LINK_STATUS))throw new Error("Could not initialize shaders");return a}function eot(e,t,r){r===void 0&&(r=t);var i=e.makeOffscreenCanvas(t,r),n=i.context=i.getContext("2d");return i.clear=function(){return n.clearRect(0,0,i.width,i.height)},i.clear(),i}function IP(e){var t=e.pixelRatio,r=e.cy.zoom(),i=e.cy.pan();return{zoom:r*t,pan:{x:i.x*t,y:i.y*t}}}function tot(e){var t=e.pixelRatio,r=e.cy.zoom();return r*t}function rot(e,t,r,i,n){var a=i*r+t.x,s=n*r+t.y;return s=Math.round(e.canvasHeight-s),[a,s]}function iot(e){return e.pstyle("background-fill").value!=="solid"||e.pstyle("background-image").strValue!=="none"?!1:e.pstyle("border-width").value===0||e.pstyle("border-opacity").value===0?!0:e.pstyle("border-style").value==="solid"}function not(e,t){if(e.length!==t.length)return!1;for(var r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}function Hp(e,t,r){var i=e[0]/255,n=e[1]/255,a=e[2]/255,s=t,l=r||new Array(4);return l[0]=i*s,l[1]=n*s,l[2]=a*s,l[3]=s,l}function n1(e,t){var r=t||new Array(4);return r[0]=(e>>0&255)/255,r[1]=(e>>8&255)/255,r[2]=(e>>16&255)/255,r[3]=(e>>24&255)/255,r}function aot(e){return e[0]+(e[1]<<8)+(e[2]<<16)+(e[3]<<24)}function sot(e,t){var r=e.createTexture();return r.buffer=function(i){e.bindTexture(e.TEXTURE_2D,r),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR_MIPMAP_NEAREST),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,i),e.generateMipmap(e.TEXTURE_2D),e.bindTexture(e.TEXTURE_2D,null)},r.deleteTexture=function(){e.deleteTexture(r)},r}function Tge(e,t){switch(t){case"float":return[1,e.FLOAT,4];case"vec2":return[2,e.FLOAT,4];case"vec3":return[3,e.FLOAT,4];case"vec4":return[4,e.FLOAT,4];case"int":return[1,e.INT,4];case"ivec2":return[2,e.INT,4]}}function Cge(e,t,r){switch(t){case e.FLOAT:return new Float32Array(r);case e.INT:return new Int32Array(r)}}function oot(e,t,r,i,n,a){switch(t){case e.FLOAT:return new Float32Array(r.buffer,a*i,n);case e.INT:return new Int32Array(r.buffer,a*i,n)}}function lot(e,t,r,i){var n=Tge(e,t),a=Dn(n,2),s=a[0],l=a[1],u=Cge(e,l,i),h=e.createBuffer();return e.bindBuffer(e.ARRAY_BUFFER,h),e.bufferData(e.ARRAY_BUFFER,u,e.STATIC_DRAW),l===e.FLOAT?e.vertexAttribPointer(r,s,l,!1,0,0):l===e.INT&&e.vertexAttribIPointer(r,s,l,0,0),e.enableVertexAttribArray(r),e.bindBuffer(e.ARRAY_BUFFER,null),h}function Oc(e,t,r,i){var n=Tge(e,r),a=Dn(n,3),s=a[0],l=a[1],u=a[2],h=Cge(e,l,t*s),d=s*u,f=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,f),e.bufferData(e.ARRAY_BUFFER,t*d,e.DYNAMIC_DRAW),e.enableVertexAttribArray(i),l===e.FLOAT?e.vertexAttribPointer(i,s,l,!1,d,0):l===e.INT&&e.vertexAttribIPointer(i,s,l,d,0),e.vertexAttribDivisor(i,1),e.bindBuffer(e.ARRAY_BUFFER,null);for(var p=new Array(t),m=0;m<t;m++)p[m]=oot(e,l,h,d,s,m);return f.dataArray=h,f.stride=d,f.size=s,f.getView=function(g){return p[g]},f.setPoint=function(g,y,v){var x=p[g];x[0]=y,x[1]=v},f.bufferSubData=function(g){e.bindBuffer(e.ARRAY_BUFFER,f),g?e.bufferSubData(e.ARRAY_BUFFER,0,h,0,g*s):e.bufferSubData(e.ARRAY_BUFFER,0,h)},f}function cot(e,t,r){for(var i=9,n=new Float32Array(t*i),a=new Array(t),s=0;s<t;s++){var l=s*i*4;a[s]=new Float32Array(n.buffer,l,i)}var u=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,u),e.bufferData(e.ARRAY_BUFFER,n.byteLength,e.DYNAMIC_DRAW);for(var h=0;h<3;h++){var d=r+h;e.enableVertexAttribArray(d),e.vertexAttribPointer(d,3,e.FLOAT,!1,36,h*12),e.vertexAttribDivisor(d,1)}return e.bindBuffer(e.ARRAY_BUFFER,null),u.getMatrixView=function(f){return a[f]},u.setData=function(f,p){a[p].set(f,0)},u.bufferSubData=function(){e.bindBuffer(e.ARRAY_BUFFER,u),e.bufferSubData(e.ARRAY_BUFFER,0,n)},u}function uot(e){var t=e.createFramebuffer();e.bindFramebuffer(e.FRAMEBUFFER,t);var r=e.createTexture();return e.bindTexture(e.TEXTURE_2D,r),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,r,0),e.bindFramebuffer(e.FRAMEBUFFER,null),t.setFramebufferAttachmentSizes=function(i,n){e.bindTexture(e.TEXTURE_2D,r),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,i,n,0,e.RGBA,e.UNSIGNED_BYTE,null)},t}function FO(){var e=new P0e(9);return P0e!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[5]=0,e[6]=0,e[7]=0),e[0]=1,e[4]=1,e[8]=1,e}function B0e(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}function hot(e,t,r){var i=t[0],n=t[1],a=t[2],s=t[3],l=t[4],u=t[5],h=t[6],d=t[7],f=t[8],p=r[0],m=r[1],g=r[2],y=r[3],v=r[4],x=r[5],b=r[6],T=r[7],w=r[8];return e[0]=p*i+m*s+g*h,e[1]=p*n+m*l+g*d,e[2]=p*a+m*u+g*f,e[3]=y*i+v*s+x*h,e[4]=y*n+v*l+x*d,e[5]=y*a+v*u+x*f,e[6]=b*i+T*s+w*h,e[7]=b*n+T*l+w*d,e[8]=b*a+T*u+w*f,e}function M3(e,t,r){var i=t[0],n=t[1],a=t[2],s=t[3],l=t[4],u=t[5],h=t[6],d=t[7],f=t[8],p=r[0],m=r[1];return e[0]=i,e[1]=n,e[2]=a,e[3]=s,e[4]=l,e[5]=u,e[6]=p*i+m*s+h,e[7]=p*n+m*l+d,e[8]=p*a+m*u+f,e}function F0e(e,t,r){var i=t[0],n=t[1],a=t[2],s=t[3],l=t[4],u=t[5],h=t[6],d=t[7],f=t[8],p=Math.sin(r),m=Math.cos(r);return e[0]=m*i+p*s,e[1]=m*n+p*l,e[2]=m*a+p*u,e[3]=m*s-p*i,e[4]=m*l-p*n,e[5]=m*u-p*a,e[6]=h,e[7]=d,e[8]=f,e}function sP(e,t,r){var i=r[0],n=r[1];return e[0]=i*t[0],e[1]=i*t[1],e[2]=i*t[2],e[3]=n*t[3],e[4]=n*t[4],e[5]=n*t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}function dot(e,t,r){return e[0]=2/t,e[1]=0,e[2]=0,e[3]=0,e[4]=-2/r,e[5]=0,e[6]=-1,e[7]=1,e[8]=1,e}function mot(e,t){return e.intersection?e.intersection(t):new Set(N3(e).filter(function(r){return t.has(r)}))}function kot(e){var t=e.cy.container(),r=t&&t.style&&t.style.backgroundColor||"white";return Z0e(r)}function wge(e,t){var r=e._private.rscratch;return Ps(r,"labelWrapCachedLines",t)||[]}function wot(e){{var t=e.render;e.render=function(a){a=a||{};var s=e.cy;e.webgl&&(s.zoom()>gge?(Sot(e),t.call(e,a)):(Eot(e),Ege(e,a,Ub.SCREEN)))}}{var r=e.matchCanvasSize;e.matchCanvasSize=function(a){r.call(e,a),e.pickingFrameBuffer.setFramebufferAttachmentSizes(e.canvasWidth,e.canvasHeight),e.pickingFrameBuffer.needsDraw=!0}}e.findNearestElements=function(a,s,l,u){return Mot(e,a,s)};{var i=e.invalidateCachedZSortedEles;e.invalidateCachedZSortedEles=function(){i.call(e),e.pickingFrameBuffer.needsDraw=!0}}{var n=e.notify;e.notify=function(a,s){n.call(e,a,s),a==="viewport"||a==="bounds"?e.pickingFrameBuffer.needsDraw=!0:a==="background"&&e.drawing.invalidate(s,{type:"node-body"})}}}function Sot(e){var t=e.data.contexts[e.WEBGL];t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT)}function Eot(e){var t=o(function(i){i.save(),i.setTransform(1,0,0,1,0,0),i.clearRect(0,0,e.canvasWidth,e.canvasHeight),i.restore()},"clear");t(e.data.contexts[e.NODE]),t(e.data.contexts[e.DRAG])}function Aot(e){var t=e.canvasWidth,r=e.canvasHeight,i=IP(e),n=i.pan,a=i.zoom,s=FO();M3(s,s,[n.x,n.y]),sP(s,s,[a,a]);var l=FO();dot(l,t,r);var u=FO();return hot(u,l,s),u}function Sge(e,t){var r=e.canvasWidth,i=e.canvasHeight,n=IP(e),a=n.pan,s=n.zoom;t.setTransform(1,0,0,1,0,0),t.clearRect(0,0,r,i),t.translate(a.x,a.y),t.scale(s,s)}function _ot(e,t){e.drawSelectionRectangle(t,function(r){return Sge(e,r)})}function Dot(e){var t=e.data.contexts[e.NODE];t.save(),Sge(e,t),t.strokeStyle="rgba(0, 0, 0, 0.3)",t.beginPath(),t.moveTo(-1e3,0),t.lineTo(1e3,0),t.stroke(),t.beginPath(),t.moveTo(0,-1e3),t.lineTo(0,1e3),t.stroke(),t.restore()}function Rot(e){var t=o(function(n,a,s){for(var l=n.atlasManager.getAtlasCollection(a),u=e.data.contexts[e.NODE],h=l.atlases,d=0;d<h.length;d++){var f=h[d],p=f.canvas;if(p){var m=p.width,g=p.height,y=m*d,v=p.height*s,x=.4;u.save(),u.scale(x,x),u.drawImage(p,y,v),u.strokeStyle="black",u.rect(y,v,m,g),u.stroke(),u.restore()}}},"draw"),r=0;t(e.drawing,"node",r++),t(e.drawing,"label",r++)}function Lot(e,t,r,i,n){var a,s,l,u,h=IP(e),d=h.pan,f=h.zoom;{var p=rot(e,d,f,t,r),m=Dn(p,2),g=m[0],y=m[1],v=6;a=g-v/2,s=y-v/2,l=v,u=v}if(l===0||u===0)return[];var x=e.data.contexts[e.WEBGL];x.bindFramebuffer(x.FRAMEBUFFER,e.pickingFrameBuffer),e.pickingFrameBuffer.needsDraw&&(x.viewport(0,0,x.canvas.width,x.canvas.height),Ege(e,null,Ub.PICKING),e.pickingFrameBuffer.needsDraw=!1);var b=l*u,T=new Uint8Array(b*4);x.readPixels(a,s,l,u,x.RGBA,x.UNSIGNED_BYTE,T),x.bindFramebuffer(x.FRAMEBUFFER,null);for(var w=new Set,C=0;C<b;C++){var k=T.slice(C*4,C*4+4),E=aot(k)-1;E>=0&&w.add(E)}return w}function Mot(e,t,r){var i=Lot(e,t,r),n=e.getCachedZSortedEles(),a,s,l=Fs(i),u;try{for(l.s();!(u=l.n()).done;){var h=u.value,d=n[h];if(!a&&d.isNode()&&(a=d),!s&&d.isEdge()&&(s=d),a&&s)break}}catch(f){l.e(f)}finally{l.f()}return[a,s].filter(Boolean)}function WO(e,t,r){var i=e.drawing;t+=1,r.isNode()?(i.drawNode(r,t,"node-underlay"),i.drawNode(r,t,"node-body"),i.drawTexture(r,t,"label"),i.drawNode(r,t,"node-overlay")):(i.drawEdgeLine(r,t),i.drawEdgeArrow(r,t,"source"),i.drawEdgeArrow(r,t,"target"),i.drawTexture(r,t,"label"),i.drawTexture(r,t,"edge-source-label"),i.drawTexture(r,t,"edge-target-label"))}function Ege(e,t,r){var i;e.webglDebug&&(i=performance.now());var n=e.drawing,a=0;if(r.screen&&e.data.canvasNeedsRedraw[e.SELECT_BOX]&&_ot(e,t),e.data.canvasNeedsRedraw[e.NODE]||r.picking){var s=e.data.contexts[e.WEBGL];r.screen?(s.clearColor(0,0,0,0),s.enable(s.BLEND),s.blendFunc(s.ONE,s.ONE_MINUS_SRC_ALPHA)):s.disable(s.BLEND),s.clear(s.COLOR_BUFFER_BIT|s.DEPTH_BUFFER_BIT),s.viewport(0,0,s.canvas.width,s.canvas.height);var l=Aot(e),u=e.getCachedZSortedEles();if(a=u.length,n.startFrame(l,r),r.screen){for(var h=0;h<u.nondrag.length;h++)WO(e,h,u.nondrag[h]);for(var d=0;d<u.drag.length;d++)WO(e,d,u.drag[d])}else if(r.picking)for(var f=0;f<u.length;f++)WO(e,f,u[f]);n.endFrame(),r.screen&&e.webglDebugShowAtlases&&(Dot(e),Rot(e)),e.data.canvasNeedsRedraw[e.NODE]=!1,e.data.canvasNeedsRedraw[e.DRAG]=!1}if(e.webglDebug){var p=performance.now(),m=!1,g=Math.ceil(p-i),y=n.getDebugInfo(),v=["".concat(a," elements"),"".concat(y.totalInstances," instances"),"".concat(y.batchCount," batches"),"".concat(y.totalAtlases," atlases"),"".concat(y.wrappedCount," wrapped textures"),"".concat(y.simpleCount," simple shapes")].join(", ");if(m)console.log("WebGL (".concat(r.name,") - time ").concat(g,"ms, ").concat(v));else{console.log("WebGL (".concat(r.name,") - frame time ").concat(g,"ms")),console.log("Totals:"),console.log(" ".concat(v)),console.log("Texture Atlases Used:");var x=y.atlasInfo,b=Fs(x),T;try{for(b.s();!(T=b.n()).done;){var w=T.value;console.log(" ".concat(w.type,": ").concat(w.keyCount," keys, ").concat(w.atlasCount," atlases"))}}catch(C){b.e(C)}finally{b.f()}console.log("")}}e.data.gc&&(console.log("Garbage Collect!"),e.data.gc=!1,n.gc())}function Not(e,t){for(var r=atob(e),i=new ArrayBuffer(r.length),n=new Uint8Array(i),a=0;a<r.length;a++)n[a]=r.charCodeAt(a);return new Blob([i],{type:t})}function W0e(e){var t=e.indexOf(",");return e.substr(t+1)}function _ge(e,t,r){var i=o(function(){return t.toDataURL(r,e.quality)},"getB64Uri");switch(e.output){case"blob-promise":return new v1(function(n,a){try{t.toBlob(function(s){s!=null?n(s):a(new Error("`canvas.toBlob()` sent a null value in its callback"))},r,e.quality)}catch(s){a(s)}});case"blob":return Not(W0e(i()),r);case"base64":return W0e(i());case"base64uri":default:return i()}}function Rge(e){var t=this,r=t.cy.window(),i=r.document;e.webgl&&(Fr.CANVAS_LAYERS=t.CANVAS_LAYERS=4,console.log("webgl rendering enabled")),t.data={canvases:new Array(Fr.CANVAS_LAYERS),contexts:new Array(Fr.CANVAS_LAYERS),canvasNeedsRedraw:new Array(Fr.CANVAS_LAYERS),bufferCanvases:new Array(Fr.BUFFER_COUNT),bufferContexts:new Array(Fr.CANVAS_LAYERS)};var n="-webkit-tap-highlight-color",a="rgba(0,0,0,0)";t.data.canvasContainer=i.createElement("div");var s=t.data.canvasContainer.style;t.data.canvasContainer.style[n]=a,s.position="relative",s.zIndex="0",s.overflow="hidden";var l=e.cy.container();l.appendChild(t.data.canvasContainer),l.style[n]=a;var u={"-webkit-user-select":"none","-moz-user-select":"-moz-none","user-select":"none","-webkit-tap-highlight-color":"rgba(0,0,0,0)","outline-style":"none"};_tt()&&(u["-ms-touch-action"]="none",u["touch-action"]="none");for(var h=0;h<Fr.CANVAS_LAYERS;h++){var d=t.data.canvases[h]=i.createElement("canvas"),f=Fr.CANVAS_TYPES[h];t.data.contexts[h]=d.getContext(f),t.data.contexts[h]||Yi("Could not create canvas of type "+f),Object.keys(u).forEach(function(J){d.style[J]=u[J]}),d.style.position="absolute",d.setAttribute("data-id","layer"+h),d.style.zIndex=String(Fr.CANVAS_LAYERS-h),t.data.canvasContainer.appendChild(d),t.data.canvasNeedsRedraw[h]=!1}t.data.topCanvas=t.data.canvases[0],t.data.canvases[Fr.NODE].setAttribute("data-id","layer"+Fr.NODE+"-node"),t.data.canvases[Fr.SELECT_BOX].setAttribute("data-id","layer"+Fr.SELECT_BOX+"-selectbox"),t.data.canvases[Fr.DRAG].setAttribute("data-id","layer"+Fr.DRAG+"-drag"),t.data.canvases[Fr.WEBGL]&&t.data.canvases[Fr.WEBGL].setAttribute("data-id","layer"+Fr.WEBGL+"-webgl");for(var h=0;h<Fr.BUFFER_COUNT;h++)t.data.bufferCanvases[h]=i.createElement("canvas"),t.data.bufferContexts[h]=t.data.bufferCanvases[h].getContext("2d"),t.data.bufferCanvases[h].style.position="absolute",t.data.bufferCanvases[h].setAttribute("data-id","buffer"+h),t.data.bufferCanvases[h].style.zIndex=String(-h-1),t.data.bufferCanvases[h].style.visibility="hidden";t.pathsEnabled=!0;var p=is(),m=o(function(te){return{x:(te.x1+te.x2)/2,y:(te.y1+te.y2)/2}},"getBoxCenter"),g=o(function(te){return{x:-te.w/2,y:-te.h/2}},"getCenterOffset"),y=o(function(te){var re=te[0]._private,ee=re.oldBackgroundTimestamp===re.backgroundTimestamp;return!ee},"backgroundTimestampHasChanged"),v=o(function(te){return te[0]._private.nodeKey},"getStyleKey"),x=o(function(te){return te[0]._private.labelStyleKey},"getLabelKey"),b=o(function(te){return te[0]._private.sourceLabelStyleKey},"getSourceLabelKey"),T=o(function(te){return te[0]._private.targetLabelStyleKey},"getTargetLabelKey"),w=o(function(te,re,ee,Te,ue){return t.drawElement(te,re,ee,!1,!1,ue)},"drawElement"),C=o(function(te,re,ee,Te,ue){return t.drawElementText(te,re,ee,Te,"main",ue)},"drawLabel"),k=o(function(te,re,ee,Te,ue){return t.drawElementText(te,re,ee,Te,"source",ue)},"drawSourceLabel"),E=o(function(te,re,ee,Te,ue){return t.drawElementText(te,re,ee,Te,"target",ue)},"drawTargetLabel"),A=o(function(te){return te.boundingBox(),te[0]._private.bodyBounds},"getElementBox"),N=o(function(te){return te.boundingBox(),te[0]._private.labelBounds.main||p},"getLabelBox"),P=o(function(te){return te.boundingBox(),te[0]._private.labelBounds.source||p},"getSourceLabelBox"),I=o(function(te){return te.boundingBox(),te[0]._private.labelBounds.target||p},"getTargetLabelBox"),D=o(function(te,re){return re},"isLabelVisibleAtScale"),_=o(function(te){return m(A(te))},"getElementRotationPoint"),R=o(function(te,re,ee){var Te=te?te+"-":"";return{x:re.x+ee.pstyle(Te+"text-margin-x").pfValue,y:re.y+ee.pstyle(Te+"text-margin-y").pfValue}},"addTextMargin"),M=o(function(te,re,ee){var Te=te[0]._private.rscratch;return{x:Te[re],y:Te[ee]}},"getRsPt"),L=o(function(te){return R("",M(te,"labelX","labelY"),te)},"getLabelRotationPoint"),B=o(function(te){return R("source",M(te,"sourceLabelX","sourceLabelY"),te)},"getSourceLabelRotationPoint"),O=o(function(te){return R("target",M(te,"targetLabelX","targetLabelY"),te)},"getTargetLabelRotationPoint"),$=o(function(te){return g(A(te))},"getElementRotationOffset"),G=o(function(te){return g(P(te))},"getSourceLabelRotationOffset"),F=o(function(te){return g(I(te))},"getTargetLabelRotationOffset"),V=o(function(te){var re=N(te),ee=g(N(te));if(te.isNode()){switch(te.pstyle("text-halign").value){case"left":ee.x=-re.w-(re.leftPad||0);break;case"right":ee.x=-(re.rightPad||0);break}switch(te.pstyle("text-valign").value){case"top":ee.y=-re.h-(re.topPad||0);break;case"bottom":ee.y=-(re.botPad||0);break}}return ee},"getLabelRotationOffset"),H=t.data.eleTxrCache=new Vb(t,{getKey:v,doesEleInvalidateKey:y,drawElement:w,getBoundingBox:A,getRotationPoint:_,getRotationOffset:$,allowEdgeTxrCaching:!1,allowParentTxrCaching:!1}),j=t.data.lblTxrCache=new Vb(t,{getKey:x,drawElement:C,getBoundingBox:N,getRotationPoint:L,getRotationOffset:V,isVisible:D}),U=t.data.slbTxrCache=new Vb(t,{getKey:b,drawElement:k,getBoundingBox:P,getRotationPoint:B,getRotationOffset:G,isVisible:D}),Q=t.data.tlbTxrCache=new Vb(t,{getKey:T,drawElement:E,getBoundingBox:I,getRotationPoint:O,getRotationOffset:F,isVisible:D}),Y=t.data.lyrTxrCache=new yge(t);t.onUpdateEleCalcs(o(function(te,re){H.invalidateElements(re),j.invalidateElements(re),U.invalidateElements(re),Q.invalidateElements(re),Y.invalidateElements(re);for(var ee=0;ee<re.length;ee++){var Te=re[ee]._private;Te.oldBackgroundTimestamp=Te.backgroundTimestamp}},"invalidateTextureCaches"));var ae=o(function(te){for(var re=0;re<te.length;re++)Y.enqueueElementRefinement(te[re].ele)},"refineInLayers");H.onDequeue(ae),j.onDequeue(ae),U.onDequeue(ae),Q.onDequeue(ae),e.webgl&&t.initWebgl(e,{getStyleKey:v,getLabelKey:x,getSourceLabelKey:b,getTargetLabelKey:T,drawElement:w,drawLabel:C,drawSourceLabel:k,drawTargetLabel:E,getElementBox:A,getLabelBox:N,getSourceLabelBox:P,getTargetLabelBox:I,getElementRotationPoint:_,getElementRotationOffset:$,getLabelRotationPoint:L,getSourceLabelRotationPoint:B,getTargetLabelRotationPoint:O,getLabelRotationOffset:V,getSourceLabelRotationOffset:G,getTargetLabelRotationOffset:F})}function Nge(e,t,r){var i=r,n=o(function(A){di("Can not register `"+t+"` for `"+e+"` since `"+A+"` already exists in the prototype and can not be overridden")},"overrideErr");if(e==="core"){if(e2.prototype[t])return n(t);e2.prototype[t]=r}else if(e==="collection"){if(ya.prototype[t])return n(t);ya.prototype[t]=r}else if(e==="layout"){for(var a=o(function(A){this.options=A,r.call(this,A),Xr(this._private)||(this._private={}),this._private.cy=A.cy,this._private.listeners=[],this.createEmitter()},"Layout"),s=a.prototype=Object.create(r.prototype),l=[],u=0;u<l.length;u++){var h=l[u];s[h]=s[h]||function(){return this}}s.start&&!s.run?s.run=function(){return this.start(),this}:!s.start&&s.run&&(s.start=function(){return this.run(),this});var d=r.prototype.stop;s.stop=function(){var E=this.options;if(E&&E.animate){var A=this.animations;if(A)for(var N=0;N<A.length;N++)A[N].stop()}return d?d.call(this):this.emit("layoutstop"),this},s.destroy||(s.destroy=function(){return this}),s.cy=function(){return this._private.cy};var f=o(function(A){return A._private.cy},"getCy"),p={addEventFields:o(function(A,N){N.layout=A,N.cy=f(A),N.target=A},"addEventFields"),bubble:o(function(){return!0},"bubble"),parent:o(function(A){return f(A)},"parent")};hr(s,{createEmitter:o(function(){return this._private.emitter=new iE(p,this),this},"createEmitter"),emitter:o(function(){return this._private.emitter},"emitter"),on:o(function(A,N){return this.emitter().on(A,N),this},"on"),one:o(function(A,N){return this.emitter().one(A,N),this},"one"),once:o(function(A,N){return this.emitter().one(A,N),this},"once"),removeListener:o(function(A,N){return this.emitter().removeListener(A,N),this},"removeListener"),removeAllListeners:o(function(){return this.emitter().removeAllListeners(),this},"removeAllListeners"),emit:o(function(A,N){return this.emitter().emit(A,N),this},"emit")}),hi.eventAliasesOn(s),i=a}else if(e==="renderer"&&t!=="null"&&t!=="base"){var m=Ige("renderer","base"),g=m.prototype,y=r,v=r.prototype,x=o(function(){m.apply(this,arguments),y.apply(this,arguments)},"Renderer"),b=x.prototype;for(var T in g){var w=g[T],C=v[T]!=null;if(C)return n(T);b[T]=w}for(var k in v)b[k]=v[k];g.clientFunctions.forEach(function(E){b[E]=b[E]||function(){Yi("Renderer does not implement `renderer."+E+"()` on its prototype")}}),i=x}else if(e==="__proto__"||e==="constructor"||e==="prototype")return Yi(e+" is an illegal type to be registered, possibly lead to prototype pollutions");return Q0e({map:Lge,keys:[e,t],value:i})}function Ige(e,t){return J0e({map:Lge,keys:[e,t]})}function Fot(e,t,r,i,n){return Q0e({map:Mge,keys:[e,t,r,i],value:n})}function $ot(e,t,r,i){return J0e({map:Mge,keys:[e,t,r,i]})}var Gn,gfe,xtt,H0e,btt,Ttt,r2,sr,Ji,Si,Xr,Ctt,Ot,ktt,I3,uo,i2,Y0e,hP,j0e,wtt,qd,Stt,Ett,Att,_tt,p1,dP,Y3,X0e,yfe,$d,Vn,Dtt,Rtt,Ltt,Mtt,Ntt,Itt,K0e,Ott,hr,Ptt,Btt,Ftt,$tt,Z0e,ztt,Q0e,J0e,c3,p9,vfe,m9,xfe,g9,bfe,y9,Tfe,v9,Cfe,x9,kfe,b9,wfe,T9,Sfe,C9,Efe,k9,Afe,w9,_fe,S9,Dfe,E9,Rfe,A9,Lfe,Ktt,o2,_9,tme,Ztt,O3,Zu,Kp,rme,s1,ime,Hb,Yb,Qtt,Pd,u3,Mfe,Jp,nme,Jtt,trt,Nfe,irt,nrt,pP,ame,P3,Ife,mP,Yi,sme,di,art,Bc,srt,ome,ort,lme,va,Ud,gP,lrt,Ps,Xu,crt,Ku,urt,hrt,y1,X3,Ofe,jb,C3,drt,Pfe,D9,Bfe,mrt,l2,grt,yrt,vrt,xrt,brt,Trt,Crt,krt,wrt,Srt,Ert,R9,Art,L9,_rt,K3,cme,o1,Drt,Rrt,Lrt,Mrt,Nrt,h3,yP,vP,e0,jp,Irt,na,u1,Ort,Xb,is,Prt,Brt,Frt,ume,k3,w3,Ffe,xP,zd,$fe,hme,$rt,dme,Vrt,Wrt,qrt,Urt,Hrt,Yrt,Bs,Qu,jrt,B3,F3,Xrt,Qp,zb,M9,Gd,Krt,Kb,Zrt,d3,rs,fme,UO,Hd,pme,bP,Qrt,HO,Jrt,eit,zfe,h1,Gfe,d1,tit,YO,rit,iit,nit,ait,mme,sit,oit,lit,cit,uit,hit,dit,Vfe,fit,pit,gme,Wfe,qfe,mit,git,Nb,m1,yit,TP,$3,I9,yme,vme,vit,xit,bit,Ufe,Hfe,Tit,Cit,kit,wit,Sit,Yfe,Eit,Ait,_it,Dit,jfe,l1,jO,XO,Xfe,Rit,Lit,Mit,Nit,Iit,Oit,Kfe,Pit,Zfe,Bit,Fit,$it,f3,zit,p3,Git,xme,bme,Tme,Cme,$l,Qfe,kme,Jfe,epe,wme,v1,KO,t0,Vit,O9,tpe,P9,rpe,B9,ipe,F9,npe,$9,ape,z9,spe,G9,ope,V9,lpe,W9,cpe,q9,upe,U9,hpe,H9,dpe,Y9,fpe,j9,ppe,X9,mpe,K9,gpe,Z9,ype,Q9,vpe,J9,xpe,eO,bpe,tO,Tpe,rO,Cpe,iO,kpe,nO,wpe,aO,Spe,sO,Epe,oO,Ape,lO,_pe,cO,Dpe,uO,Rpe,hO,Lpe,dO,Mpe,fO,Npe,pO,Ipe,mO,Ope,gO,Ppe,yO,Bpe,vO,Fpe,xO,$pe,bO,zpe,TO,Gpe,CO,Vpe,kO,Wpe,Tnt,Cnt,wO,qpe,SO,Upe,EO,Hpe,AO,Ype,_O,jpe,DO,Xpe,Dnt,Rnt,RO,Kpe,LO,Zpe,Nnt,Int,Ont,Pnt,hi,Bnt,S3,jr,xi,Yt,ZO,Fnt,$nt,znt,Jg,Bd,QO,Gnt,Vnt,Wnt,qnt,Unt,Rme,Hnt,Ynt,wP,jnt,un,zi,Xnt,Knt,Znt,Yd,jd,Vd,Xo,g1,Zb,Nme,Jnt,rE,Fl,Ime,Ome,Qpe,eat,f1,Qd,jo,Bl,Fd,Ib,m3,NO,Jpe,Pme,tat,rat,Bme,Fme,e0e,Qb,t0e,r0e,iat,Gb,c2,$me,nat,aat,sat,oat,lat,cat,uat,hat,dat,i0e,fat,pat,mat,zme,Gme,gat,Vme,n0e,yat,Xd,Wme,a0e,vat,xat,y3,qme,Ume,ei,bat,Hme,z3,Tat,Cat,E3,ga,x1,kat,wat,Sat,Eat,Wd,Oa,o0e,l0e,c0e,ya,Mi,Aat,Dat,Li,A3,Mat,Nat,v3,jme,JO,_3,Iat,Oat,eP,D3,sa,Wb,Pat,u2,AP,Fc,sE,_P,_n,oE,aa,Pa,Bat,Fat,r0,Jb,e2,G3,$at,zat,r1,g0e,Gat,Vat,OO,Wat,qat,Uat,Qme,Hat,Yat,Jme,jat,Xat,Kat,y0e,Zat,Qat,V3,Jat,est,tst,rst,ist,ege,v0e,nst,ast,sst,ost,lst,x0e,b0e,RP,n0,W3,tP,rP,Pc,Yo,T0e,C0e,Zp,R3,ju,Up,Xp,Ic,i1,x3,age,sge,iP,nP,k0e,w0e,cst,ust,t2,hst,Ba,h2,MP,$c,cge,uge,fst,hge,S0e,E0e,cE,uE,dge,fge,T1,Ju,d2,A0e,pst,pge,C1,PO,mge,mst,_0e,b3,L3,aP,gge,gst,yst,vst,xst,bst,Tst,Cst,kst,wst,Sst,Est,Ast,_st,c1,Dst,Vb,qn,Rst,qb,q3,Lst,Mst,Nst,Ist,Ost,Pst,Bst,Fst,D0e,$st,R0e,zst,yge,xa,L0e,Gst,vge,M0e,zc,Hst,Yst,jst,Xst,Kst,BO,eh,xge,NP,a0,Jd,bge,ns,Qst,Bb,P0e,fot,pot,got,yot,vot,xot,bot,Tot,Ub,U3,$O,$0e,z0e,zO,a1,T3,Fb,$b,Cot,kge,GO,VO,ef,G0e,V0e,oP,lP,Age,Yp,f2,Dge,Iot,Fr,Oot,Pot,Bot,Lge,Mge,cP,H3,i0,zot,Ko,OP=z(()=>{"use strict";o(qO,"_arrayLikeToArray");o(htt,"_arrayWithHoles");o(dtt,"_arrayWithoutHoles");o(Kd,"_classCallCheck");o(ftt,"_defineProperties");o(Zd,"_createClass");o(Fs,"_createForOfIteratorHelper");o(q0e,"_defineProperty$1");o(ptt,"_iterableToArray");o(mtt,"_iterableToArrayLimit");o(gtt,"_nonIterableRest");o(ytt,"_nonIterableSpread");o(Dn,"_slicedToArray");o(N3,"_toConsumableArray");o(vtt,"_toPrimitive");o(U0e,"_toPropertyKey");o(Wn,"_typeof");o(uP,"_unsupportedIterableToArray");Gn=typeof window>"u"?null:window,gfe=Gn?Gn.navigator:null;Gn&&Gn.document;xtt=Wn(""),H0e=Wn({}),btt=Wn(function(){}),Ttt=typeof HTMLElement>"u"?"undefined":Wn(HTMLElement),r2=o(function(t){return t&&t.instanceString&&Ji(t.instanceString)?t.instanceString():null},"instanceStr"),sr=o(function(t){return t!=null&&Wn(t)==xtt},"string"),Ji=o(function(t){return t!=null&&Wn(t)===btt},"fn"),Si=o(function(t){return!uo(t)&&(Array.isArray?Array.isArray(t):t!=null&&t instanceof Array)},"array"),Xr=o(function(t){return t!=null&&Wn(t)===H0e&&!Si(t)&&t.constructor===Object},"plainObject"),Ctt=o(function(t){return t!=null&&Wn(t)===H0e},"object"),Ot=o(function(t){return t!=null&&Wn(t)===Wn(1)&&!isNaN(t)},"number"),ktt=o(function(t){return Ot(t)&&Math.floor(t)===t},"integer"),I3=o(function(t){if(Ttt!=="undefined")return t!=null&&t instanceof HTMLElement},"htmlElement"),uo=o(function(t){return i2(t)||Y0e(t)},"elementOrCollection"),i2=o(function(t){return r2(t)==="collection"&&t._private.single},"element"),Y0e=o(function(t){return r2(t)==="collection"&&!t._private.single},"collection"),hP=o(function(t){return r2(t)==="core"},"core"),j0e=o(function(t){return r2(t)==="stylesheet"},"stylesheet"),wtt=o(function(t){return r2(t)==="event"},"event"),qd=o(function(t){return t==null?!0:!!(t===""||t.match(/^\s+$/))},"emptyString"),Stt=o(function(t){return typeof HTMLElement>"u"?!1:t instanceof HTMLElement},"domElement"),Ett=o(function(t){return Xr(t)&&Ot(t.x1)&&Ot(t.x2)&&Ot(t.y1)&&Ot(t.y2)},"boundingBox"),Att=o(function(t){return Ctt(t)&&Ji(t.then)},"promise"),_tt=o(function(){return gfe&&gfe.userAgent.match(/msie|trident|edge/i)},"ms"),p1=o(function(t,r){r||(r=o(function(){if(arguments.length===1)return arguments[0];if(arguments.length===0)return"undefined";for(var a=[],s=0;s<arguments.length;s++)a.push(arguments[s]);return a.join("$")},"keyFn"));var i=o(function(){var a=this,s=arguments,l,u=r.apply(a,s),h=i.cache;return(l=h[u])||(l=h[u]=t.apply(a,s)),l},"memoizedFn");return i.cache={},i},"memoize"),dP=p1(function(e){return e.replace(/([A-Z])/g,function(t){return"-"+t.toLowerCase()})}),Y3=p1(function(e){return e.replace(/(-\w)/g,function(t){return t[1].toUpperCase()})}),X0e=p1(function(e,t){return e+t[0].toUpperCase()+t.substring(1)},function(e,t){return e+"$"+t}),yfe=o(function(t){return qd(t)?t:t.charAt(0).toUpperCase()+t.substring(1)},"capitalize"),$d=o(function(t,r){return t.slice(-1*r.length)===r},"endsWith"),Vn="(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))",Dtt="rgb[a]?\\(("+Vn+"[%]?)\\s*,\\s*("+Vn+"[%]?)\\s*,\\s*("+Vn+"[%]?)(?:\\s*,\\s*("+Vn+"))?\\)",Rtt="rgb[a]?\\((?:"+Vn+"[%]?)\\s*,\\s*(?:"+Vn+"[%]?)\\s*,\\s*(?:"+Vn+"[%]?)(?:\\s*,\\s*(?:"+Vn+"))?\\)",Ltt="hsl[a]?\\(("+Vn+")\\s*,\\s*("+Vn+"[%])\\s*,\\s*("+Vn+"[%])(?:\\s*,\\s*("+Vn+"))?\\)",Mtt="hsl[a]?\\((?:"+Vn+")\\s*,\\s*(?:"+Vn+"[%])\\s*,\\s*(?:"+Vn+"[%])(?:\\s*,\\s*(?:"+Vn+"))?\\)",Ntt="\\#[0-9a-fA-F]{3}",Itt="\\#[0-9a-fA-F]{6}",K0e=o(function(t,r){return t<r?-1:t>r?1:0},"ascending"),Ott=o(function(t,r){return-1*K0e(t,r)},"descending"),hr=Object.assign!=null?Object.assign.bind(Object):function(e){for(var t=arguments,r=1;r<t.length;r++){var i=t[r];if(i!=null)for(var n=Object.keys(i),a=0;a<n.length;a++){var s=n[a];e[s]=i[s]}}return e},Ptt=o(function(t){if(!(!(t.length===4||t.length===7)||t[0]!=="#")){var r=t.length===4,i,n,a,s=16;return r?(i=parseInt(t[1]+t[1],s),n=parseInt(t[2]+t[2],s),a=parseInt(t[3]+t[3],s)):(i=parseInt(t[1]+t[2],s),n=parseInt(t[3]+t[4],s),a=parseInt(t[5]+t[6],s)),[i,n,a]}},"hex2tuple"),Btt=o(function(t){var r,i,n,a,s,l,u,h;function d(g,y,v){return v<0&&(v+=1),v>1&&(v-=1),v<1/6?g+(y-g)*6*v:v<1/2?y:v<2/3?g+(y-g)*(2/3-v)*6:g}o(d,"hue2rgb");var f=new RegExp("^"+Ltt+"$").exec(t);if(f){if(i=parseInt(f[1]),i<0?i=(360- -1*i%360)%360:i>360&&(i=i%360),i/=360,n=parseFloat(f[2]),n<0||n>100||(n=n/100,a=parseFloat(f[3]),a<0||a>100)||(a=a/100,s=f[4],s!==void 0&&(s=parseFloat(s),s<0||s>1)))return;if(n===0)l=u=h=Math.round(a*255);else{var p=a<.5?a*(1+n):a+n-a*n,m=2*a-p;l=Math.round(255*d(m,p,i+1/3)),u=Math.round(255*d(m,p,i)),h=Math.round(255*d(m,p,i-1/3))}r=[l,u,h,s]}return r},"hsl2tuple"),Ftt=o(function(t){var r,i=new RegExp("^"+Dtt+"$").exec(t);if(i){r=[];for(var n=[],a=1;a<=3;a++){var s=i[a];if(s[s.length-1]==="%"&&(n[a]=!0),s=parseFloat(s),n[a]&&(s=s/100*255),s<0||s>255)return;r.push(Math.floor(s))}var l=n[1]||n[2]||n[3],u=n[1]&&n[2]&&n[3];if(l&&!u)return;var h=i[4];if(h!==void 0){if(h=parseFloat(h),h<0||h>1)return;r.push(h)}}return r},"rgb2tuple"),$tt=o(function(t){return ztt[t.toLowerCase()]},"colorname2tuple"),Z0e=o(function(t){return(Si(t)?t:null)||$tt(t)||Ptt(t)||Ftt(t)||Btt(t)},"color2tuple"),ztt={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]},Q0e=o(function(t){for(var r=t.map,i=t.keys,n=i.length,a=0;a<n;a++){var s=i[a];if(Xr(s))throw Error("Tried to set map with object key");a<i.length-1?(r[s]==null&&(r[s]={}),r=r[s]):r[s]=t.value}},"setMap"),J0e=o(function(t){for(var r=t.map,i=t.keys,n=i.length,a=0;a<n;a++){var s=i[a];if(Xr(s))throw Error("Tried to get map with object key");if(r=r[s],r==null)return r}return r},"getMap"),c3=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};o(n2,"getDefaultExportFromCjs");o(a2,"requireIsObject");o(Gtt,"require_freeGlobal");o(j3,"require_root");o(Vtt,"requireNow");o(Wtt,"require_trimmedEndIndex");o(qtt,"require_baseTrim");o(fP,"require_Symbol");o(Utt,"require_getRawTag");o(Htt,"require_objectToString");o(eme,"require_baseGetTag");o(Ytt,"requireIsObjectLike");o(s2,"requireIsSymbol");o(jtt,"requireToNumber");o(Xtt,"requireDebounce");Ktt=Xtt(),o2=n2(Ktt),_9=Gn?Gn.performance:null,tme=_9&&_9.now?function(){return _9.now()}:function(){return Date.now()},Ztt=(function(){if(Gn){if(Gn.requestAnimationFrame)return function(e){Gn.requestAnimationFrame(e)};if(Gn.mozRequestAnimationFrame)return function(e){Gn.mozRequestAnimationFrame(e)};if(Gn.webkitRequestAnimationFrame)return function(e){Gn.webkitRequestAnimationFrame(e)};if(Gn.msRequestAnimationFrame)return function(e){Gn.msRequestAnimationFrame(e)}}return function(e){e&&setTimeout(function(){e(tme())},1e3/60)}})(),O3=o(function(t){return Ztt(t)},"requestAnimationFrame"),Zu=tme,Kp=9261,rme=65599,s1=5381,ime=o(function(t){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Kp,i=r,n;n=t.next(),!n.done;)i=i*rme+n.value|0;return i},"hashIterableInts"),Hb=o(function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Kp;return r*rme+t|0},"hashInt"),Yb=o(function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:s1;return(r<<5)+r+t|0},"hashIntAlt"),Qtt=o(function(t,r){return t*2097152+r},"combineHashes"),Pd=o(function(t){return t[0]*2097152+t[1]},"combineHashesArray"),u3=o(function(t,r){return[Hb(t[0],r[0]),Yb(t[1],r[1])]},"hashArrays"),Mfe=o(function(t,r){var i={value:0,done:!1},n=0,a=t.length,s={next:o(function(){return n<a?i.value=t[n++]:i.done=!0,i},"next")};return ime(s,r)},"hashIntsArray"),Jp=o(function(t,r){var i={value:0,done:!1},n=0,a=t.length,s={next:o(function(){return n<a?i.value=t.charCodeAt(n++):i.done=!0,i},"next")};return ime(s,r)},"hashString"),nme=o(function(){return Jtt(arguments)},"hashStrings"),Jtt=o(function(t){for(var r,i=0;i<t.length;i++){var n=t[i];i===0?r=Jp(n):r=Jp(n,r)}return r},"hashStringsArray");o(ert,"rotatePoint");trt=o(function(t,r,i,n,a,s){return{x:(t-i)*a+i,y:(r-n)*s+n}},"movePointByBoxAspect");o(rrt,"rotatePosAndSkewByBox");Nfe=!0,irt=console.warn!=null,nrt=console.trace!=null,pP=Number.MAX_SAFE_INTEGER||9007199254740991,ame=o(function(){return!0},"trueify"),P3=o(function(){return!1},"falsify"),Ife=o(function(){return 0},"zeroify"),mP=o(function(){},"noop"),Yi=o(function(t){throw new Error(t)},"error"),sme=o(function(t){if(t!==void 0)Nfe=!!t;else return Nfe},"warnings"),di=o(function(t){sme()&&(irt?console.warn(t):(console.log(t),nrt&&console.trace()))},"warn"),art=o(function(t){return hr({},t)},"clone"),Bc=o(function(t){return t==null?t:Si(t)?t.slice():Xr(t)?art(t):t},"copy"),srt=o(function(t){return t.slice()},"copyArray"),ome=o(function(t,r){for(r=t="";t++<36;r+=t*51&52?(t^15?8^Math.random()*(t^20?16:4):4).toString(16):"-");return r},"uuid"),ort={},lme=o(function(){return ort},"staticEmptyObject"),va=o(function(t){var r=Object.keys(t);return function(i){for(var n={},a=0;a<r.length;a++){var s=r[a],l=i?.[s];n[s]=l===void 0?t[s]:l}return n}},"defaults"),Ud=o(function(t,r,i){for(var n=t.length-1;n>=0;n--)t[n]===r&&t.splice(n,1)},"removeFromArray"),gP=o(function(t){t.splice(0,t.length)},"clearArray"),lrt=o(function(t,r){for(var i=0;i<r.length;i++){var n=r[i];t.push(n)}},"push"),Ps=o(function(t,r,i){return i&&(r=X0e(i,r)),t[r]},"getPrefixedProperty"),Xu=o(function(t,r,i,n){i&&(r=X0e(i,r)),t[r]=n},"setPrefixedProperty"),crt=(function(){function e(){Kd(this,e),this._obj={}}return o(e,"ObjectMap"),Zd(e,[{key:"set",value:o(function(r,i){return this._obj[r]=i,this},"set")},{key:"delete",value:o(function(r){return this._obj[r]=void 0,this},"_delete")},{key:"clear",value:o(function(){this._obj={}},"clear")},{key:"has",value:o(function(r){return this._obj[r]!==void 0},"has")},{key:"get",value:o(function(r){return this._obj[r]},"get")}])})(),Ku=typeof Map<"u"?Map:crt,urt="undefined",hrt=(function(){function e(t){if(Kd(this,e),this._obj=Object.create(null),this.size=0,t!=null){var r;t.instanceString!=null&&t.instanceString()===this.instanceString()?r=t.toArray():r=t;for(var i=0;i<r.length;i++)this.add(r[i])}}return o(e,"ObjectSet"),Zd(e,[{key:"instanceString",value:o(function(){return"set"},"instanceString")},{key:"add",value:o(function(r){var i=this._obj;i[r]!==1&&(i[r]=1,this.size++)},"add")},{key:"delete",value:o(function(r){var i=this._obj;i[r]===1&&(i[r]=0,this.size--)},"_delete")},{key:"clear",value:o(function(){this._obj=Object.create(null)},"clear")},{key:"has",value:o(function(r){return this._obj[r]===1},"has")},{key:"toArray",value:o(function(){var r=this;return Object.keys(this._obj).filter(function(i){return r.has(i)})},"toArray")},{key:"forEach",value:o(function(r,i){return this.toArray().forEach(r,i)},"forEach")}])})(),y1=(typeof Set>"u"?"undefined":Wn(Set))!==urt?Set:hrt,X3=o(function(t,r){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(t===void 0||r===void 0||!hP(t)){Yi("An element must have a core reference and parameters set");return}var n=r.group;if(n==null&&(r.data&&r.data.source!=null&&r.data.target!=null?n="edges":n="nodes"),n!=="nodes"&&n!=="edges"){Yi("An element must be of type `nodes` or `edges`; you specified `"+n+"`");return}this.length=1,this[0]=this;var a=this._private={cy:t,single:!0,data:r.data||{},position:r.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:!!r.selected,selectable:r.selectable===void 0?!0:!!r.selectable,locked:!!r.locked,grabbed:!1,grabbable:r.grabbable===void 0?!0:!!r.grabbable,pannable:r.pannable===void 0?n==="edges":!!r.pannable,active:!1,classes:new y1,animation:{current:[],queue:[]},rscratch:{},scratch:r.scratch||{},edges:[],children:[],parent:r.parent&&r.parent.isNode()?r.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(a.position.x==null&&(a.position.x=0),a.position.y==null&&(a.position.y=0),r.renderedPosition){var s=r.renderedPosition,l=t.pan(),u=t.zoom();a.position={x:(s.x-l.x)/u,y:(s.y-l.y)/u}}var h=[];Si(r.classes)?h=r.classes:sr(r.classes)&&(h=r.classes.split(/\s+/));for(var d=0,f=h.length;d<f;d++){var p=h[d];!p||p===""||a.classes.add(p)}this.createEmitter(),(i===void 0||i)&&this.restore();var m=r.style||r.css;m&&(di("Setting a `style` bypass at element creation should be done only when absolutely necessary. Try to use the stylesheet instead."),this.style(m))},"Element"),Ofe=o(function(t){return t={bfs:t.bfs||!t.dfs,dfs:t.dfs||!t.bfs},o(function(i,n,a){var s;Xr(i)&&!uo(i)&&(s=i,i=s.roots||s.root,n=s.visit,a=s.directed),a=arguments.length===2&&!Ji(n)?n:a,n=Ji(n)?n:function(){};for(var l=this._private.cy,u=i=sr(i)?this.filter(i):i,h=[],d=[],f={},p={},m={},g=0,y,v=this.byGroup(),x=v.nodes,b=v.edges,T=0;T<u.length;T++){var w=u[T],C=w.id();w.isNode()&&(h.unshift(w),t.bfs&&(m[C]=!0,d.push(w)),p[C]=0)}for(var k=o(function(){var _=t.bfs?h.shift():h.pop(),R=_.id();if(t.dfs){if(m[R])return 0;m[R]=!0,d.push(_)}var M=p[R],L=f[R],B=L!=null?L.source():null,O=L!=null?L.target():null,$=L==null?void 0:_.same(B)?O[0]:B[0],G;if(G=n(_,L,$,g++,M),G===!0)return y=_,1;if(G===!1)return 1;for(var F=_.connectedEdges().filter(function(Q){return(!a||Q.source().same(_))&&b.has(Q)}),V=0;V<F.length;V++){var H=F[V],j=H.connectedNodes().filter(function(Q){return!Q.same(_)&&x.has(Q)}),U=j.id();j.length!==0&&!m[U]&&(j=j[0],h.push(j),t.bfs&&(m[U]=!0,d.push(j)),f[U]=H,p[U]=p[R]+1)}},"_loop"),E;h.length!==0&&(E=k(),!(E!==0&&E===1)););for(var A=l.collection(),N=0;N<d.length;N++){var P=d[N],I=f[P.id()];I!=null&&A.push(I),A.push(P)}return{path:l.collection(A),found:l.collection(y)}},"searchFn")},"defineSearch"),jb={breadthFirstSearch:Ofe({bfs:!0}),depthFirstSearch:Ofe({dfs:!0})};jb.bfs=jb.breadthFirstSearch;jb.dfs=jb.depthFirstSearch;C3={exports:{}},drt=C3.exports;o(frt,"requireHeap$1");o(prt,"requireHeap");mrt=prt(),l2=n2(mrt),grt=va({root:null,weight:o(function(t){return 1},"weight"),directed:!1}),yrt={dijkstra:o(function(t){if(!Xr(t)){var r=arguments;t={root:r[0],weight:r[1],directed:r[2]}}var i=grt(t),n=i.root,a=i.weight,s=i.directed,l=this,u=a,h=sr(n)?this.filter(n)[0]:n[0],d={},f={},p={},m=this.byGroup(),g=m.nodes,y=m.edges;y.unmergeBy(function(M){return M.isLoop()});for(var v=o(function(L){return d[L.id()]},"getDist"),x=o(function(L,B){d[L.id()]=B,b.updateItem(L)},"setDist"),b=new l2(function(M,L){return v(M)-v(L)}),T=0;T<g.length;T++){var w=g[T];d[w.id()]=w.same(h)?0:1/0,b.push(w)}for(var C=o(function(L,B){for(var O=(s?L.edgesTo(B):L.edgesWith(B)).intersect(y),$=1/0,G,F=0;F<O.length;F++){var V=O[F],H=u(V);(H<$||!G)&&($=H,G=V)}return{edge:G,dist:$}},"distBetween");b.size()>0;){var k=b.pop(),E=v(k),A=k.id();if(p[A]=E,E!==1/0)for(var N=k.neighborhood().intersect(g),P=0;P<N.length;P++){var I=N[P],D=I.id(),_=C(k,I),R=E+_.dist;R<v(I)&&(x(I,R),f[D]={node:k,edge:_.edge})}}return{distanceTo:o(function(L){var B=sr(L)?g.filter(L)[0]:L[0];return p[B.id()]},"distanceTo"),pathTo:o(function(L){var B=sr(L)?g.filter(L)[0]:L[0],O=[],$=B,G=$.id();if(B.length>0)for(O.unshift(B);f[G];){var F=f[G];O.unshift(F.edge),O.unshift(F.node),$=F.node,G=$.id()}return l.spawn(O)},"pathTo")}},"dijkstra")},vrt={kruskal:o(function(t){t=t||function(T){return 1};for(var r=this.byGroup(),i=r.nodes,n=r.edges,a=i.length,s=new Array(a),l=i,u=o(function(w){for(var C=0;C<s.length;C++){var k=s[C];if(k.has(w))return C}},"findSetIndex"),h=0;h<a;h++)s[h]=this.spawn(i[h]);for(var d=n.sort(function(T,w){return t(T)-t(w)}),f=0;f<d.length;f++){var p=d[f],m=p.source()[0],g=p.target()[0],y=u(m),v=u(g),x=s[y],b=s[v];y!==v&&(l.merge(p),x.merge(b),s.splice(v,1))}return l},"kruskal")},xrt=va({root:null,goal:null,weight:o(function(t){return 1},"weight"),heuristic:o(function(t){return 0},"heuristic"),directed:!1}),brt={aStar:o(function(t){var r=this.cy(),i=xrt(t),n=i.root,a=i.goal,s=i.heuristic,l=i.directed,u=i.weight;n=r.collection(n)[0],a=r.collection(a)[0];var h=n.id(),d=a.id(),f={},p={},m={},g=new l2(function(G,F){return p[G.id()]-p[F.id()]}),y=new y1,v={},x={},b=o(function(F,V){g.push(F),y.add(V)},"addToOpenSet"),T,w,C=o(function(){T=g.pop(),w=T.id(),y.delete(w)},"popFromOpenSet"),k=o(function(F){return y.has(F)},"isInOpenSet");b(n,h),f[h]=0,p[h]=s(n);for(var E=0;g.size()>0;){if(C(),E++,w===d){for(var A=[],N=a,P=d,I=x[P];A.unshift(N),I!=null&&A.unshift(I),N=v[P],N!=null;)P=N.id(),I=x[P];return{found:!0,distance:f[w],path:this.spawn(A),steps:E}}m[w]=!0;for(var D=T._private.edges,_=0;_<D.length;_++){var R=D[_];if(this.hasElementWithId(R.id())&&!(l&&R.data("source")!==w)){var M=R.source(),L=R.target(),B=M.id()!==w?M:L,O=B.id();if(this.hasElementWithId(O)&&!m[O]){var $=f[w]+u(R);if(!k(O)){f[O]=$,p[O]=$+s(B),b(B,O),v[O]=T,x[O]=R;continue}$<f[O]&&(f[O]=$,p[O]=$+s(B),v[O]=T,x[O]=R)}}}}return{found:!1,distance:void 0,path:void 0,steps:E}},"aStar")},Trt=va({weight:o(function(t){return 1},"weight"),directed:!1}),Crt={floydWarshall:o(function(t){for(var r=this.cy(),i=Trt(t),n=i.weight,a=i.directed,s=n,l=this.byGroup(),u=l.nodes,h=l.edges,d=u.length,f=d*d,p=o(function(H){return u.indexOf(H)},"indexOf"),m=o(function(H){return u[H]},"atIndex"),g=new Array(f),y=0;y<f;y++){var v=y%d,x=(y-v)/d;x===v?g[y]=0:g[y]=1/0}for(var b=new Array(f),T=new Array(f),w=0;w<h.length;w++){var C=h[w],k=C.source()[0],E=C.target()[0];if(k!==E){var A=p(k),N=p(E),P=A*d+N,I=s(C);if(g[P]>I&&(g[P]=I,b[P]=N,T[P]=C),!a){var D=N*d+A;!a&&g[D]>I&&(g[D]=I,b[D]=A,T[D]=C)}}}for(var _=0;_<d;_++)for(var R=0;R<d;R++)for(var M=R*d+_,L=0;L<d;L++){var B=R*d+L,O=_*d+L;g[M]+g[O]<g[B]&&(g[B]=g[M]+g[O],b[B]=b[M])}var $=o(function(H){return(sr(H)?r.filter(H):H)[0]},"getArgEle"),G=o(function(H){return p($(H))},"indexOfArgEle"),F={distance:o(function(H,j){var U=G(H),Q=G(j);return g[U*d+Q]},"distance"),path:o(function(H,j){var U=G(H),Q=G(j),Y=m(U);if(U===Q)return Y.collection();if(b[U*d+Q]==null)return r.collection();var ae=r.collection(),J=U,te;for(ae.merge(Y);U!==Q;)J=U,U=b[U*d+Q],te=T[J*d+U],ae.merge(te),ae.merge(m(U));return ae},"path")};return F},"floydWarshall")},krt=va({weight:o(function(t){return 1},"weight"),directed:!1,root:null}),wrt={bellmanFord:o(function(t){var r=this,i=krt(t),n=i.weight,a=i.directed,s=i.root,l=n,u=this,h=this.cy(),d=this.byGroup(),f=d.edges,p=d.nodes,m=p.length,g=new Ku,y=!1,v=[];s=h.collection(s)[0],f.unmergeBy(function(Ee){return Ee.isLoop()});for(var x=f.length,b=o(function(we){var Me=g.get(we.id());return Me||(Me={},g.set(we.id(),Me)),Me},"getInfo"),T=o(function(we){return(sr(we)?h.$(we):we)[0]},"getNodeFromTo"),w=o(function(we){return b(T(we)).dist},"distanceTo"),C=o(function(we){for(var Me=arguments.length>1&&arguments[1]!==void 0?arguments[1]:s,$e=T(we),de=[],rt=$e;;){if(rt==null)return r.spawn();var ke=b(rt),Fe=ke.edge,He=ke.pred;if(de.unshift(rt[0]),rt.same(Me)&&de.length>0)break;Fe!=null&&de.unshift(Fe),rt=He}return u.spawn(de)},"pathTo"),k=0;k<m;k++){var E=p[k],A=b(E);E.same(s)?A.dist=0:A.dist=1/0,A.pred=null,A.edge=null}for(var N=!1,P=o(function(we,Me,$e,de,rt,ke){var Fe=de.dist+ke;Fe<rt.dist&&!$e.same(de.edge)&&(rt.dist=Fe,rt.pred=we,rt.edge=$e,N=!0)},"checkForEdgeReplacement"),I=1;I<m;I++){N=!1;for(var D=0;D<x;D++){var _=f[D],R=_.source(),M=_.target(),L=l(_),B=b(R),O=b(M);P(R,M,_,B,O,L),a||P(M,R,_,O,B,L)}if(!N)break}if(N)for(var $=[],G=0;G<x;G++){var F=f[G],V=F.source(),H=F.target(),j=l(F),U=b(V).dist,Q=b(H).dist;if(U+j<Q||!a&&Q+j<U)if(y||(di("Graph contains a negative weight cycle for Bellman-Ford"),y=!0),t.findNegativeWeightCycles!==!1){var Y=[];U+j<Q&&Y.push(V),!a&&Q+j<U&&Y.push(H);for(var ae=Y.length,J=0;J<ae;J++){var te=Y[J],re=[te];re.push(b(te).edge);for(var ee=b(te).pred;re.indexOf(ee)===-1;)re.push(ee),re.push(b(ee).edge),ee=b(ee).pred;re=re.slice(re.indexOf(ee));for(var Te=re[0].id(),ue=0,De=2;De<re.length;De+=2)re[De].id()<Te&&(Te=re[De].id(),ue=De);re=re.slice(ue).concat(re.slice(0,ue)),re.push(re[0]);var Ie=re.map(function(Ee){return Ee.id()}).join(",");$.indexOf(Ie)===-1&&(v.push(u.spawn(re)),$.push(Ie))}}else break}return{distanceTo:w,pathTo:C,hasNegativeWeightCycle:y,negativeWeightCycles:v}},"bellmanFord")},Srt=Math.sqrt(2),Ert=o(function(t,r,i){i.length===0&&Yi("Karger-Stein must be run on a connected (sub)graph");for(var n=i[t],a=n[1],s=n[2],l=r[a],u=r[s],h=i,d=h.length-1;d>=0;d--){var f=h[d],p=f[1],m=f[2];(r[p]===l&&r[m]===u||r[p]===u&&r[m]===l)&&h.splice(d,1)}for(var g=0;g<h.length;g++){var y=h[g];y[1]===u?(h[g]=y.slice(),h[g][1]=l):y[2]===u&&(h[g]=y.slice(),h[g][2]=l)}for(var v=0;v<r.length;v++)r[v]===u&&(r[v]=l);return h},"collapse"),R9=o(function(t,r,i,n){for(;i>n;){var a=Math.floor(Math.random()*r.length);r=Ert(a,t,r),i--}return r},"contractUntil"),Art={kargerStein:o(function(){var t=this,r=this.byGroup(),i=r.nodes,n=r.edges;n.unmergeBy(function(O){return O.isLoop()});var a=i.length,s=n.length,l=Math.ceil(Math.pow(Math.log(a)/Math.LN2,2)),u=Math.floor(a/Srt);if(a<2){Yi("At least 2 nodes are required for Karger-Stein algorithm");return}for(var h=[],d=0;d<s;d++){var f=n[d];h.push([d,i.indexOf(f.source()),i.indexOf(f.target())])}for(var p=1/0,m=[],g=new Array(a),y=new Array(a),v=new Array(a),x=o(function($,G){for(var F=0;F<a;F++)G[F]=$[F]},"copyNodesMap"),b=0;b<=l;b++){for(var T=0;T<a;T++)y[T]=T;var w=R9(y,h.slice(),a,u),C=w.slice();x(y,v);var k=R9(y,w,u,2),E=R9(v,C,u,2);k.length<=E.length&&k.length<p?(p=k.length,m=k,x(y,g)):E.length<=k.length&&E.length<p&&(p=E.length,m=E,x(v,g))}for(var A=this.spawn(m.map(function(O){return n[O[0]]})),N=this.spawn(),P=this.spawn(),I=g[0],D=0;D<g.length;D++){var _=g[D],R=i[D];_===I?N.merge(R):P.merge(R)}var M=o(function($){var G=t.spawn();return $.forEach(function(F){G.merge(F),F.connectedEdges().forEach(function(V){t.contains(V)&&!A.contains(V)&&G.merge(V)})}),G},"constructComponent"),L=[M(N),M(P)],B={cut:A,components:L,partition1:N,partition2:P};return B},"kargerStein")},_rt=o(function(t){return{x:t.x,y:t.y}},"copyPosition"),K3=o(function(t,r,i){return{x:t.x*r+i.x,y:t.y*r+i.y}},"modelToRenderedPosition"),cme=o(function(t,r,i){return{x:(t.x-i.x)/r,y:(t.y-i.y)/r}},"renderedToModelPosition"),o1=o(function(t){return{x:t[0],y:t[1]}},"array2point"),Drt=o(function(t){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:t.length,n=1/0,a=r;a<i;a++){var s=t[a];isFinite(s)&&(n=Math.min(s,n))}return n},"min"),Rrt=o(function(t){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:t.length,n=-1/0,a=r;a<i;a++){var s=t[a];isFinite(s)&&(n=Math.max(s,n))}return n},"max"),Lrt=o(function(t){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:t.length,n=0,a=0,s=r;s<i;s++){var l=t[s];isFinite(l)&&(n+=l,a++)}return n/a},"mean"),Mrt=o(function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:t.length,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0;n?t=t.slice(r,i):(i<t.length&&t.splice(i,t.length-i),r>0&&t.splice(0,r));for(var l=0,u=t.length-1;u>=0;u--){var h=t[u];s?isFinite(h)||(t[u]=-1/0,l++):t.splice(u,1)}a&&t.sort(function(p,m){return p-m});var d=t.length,f=Math.floor(d/2);return d%2!==0?t[f+1+l]:(t[f-1+l]+t[f+l])/2},"median"),Nrt=o(function(t){return Math.PI*t/180},"deg2rad"),h3=o(function(t,r){return Math.atan2(r,t)-Math.PI/2},"getAngleFromDisp"),yP=Math.log2||function(e){return Math.log(e)/Math.log(2)},vP=o(function(t){return t>0?1:t<0?-1:0},"signum"),e0=o(function(t,r){return Math.sqrt(jp(t,r))},"dist"),jp=o(function(t,r){var i=r.x-t.x,n=r.y-t.y;return i*i+n*n},"sqdist"),Irt=o(function(t){for(var r=t.length,i=0,n=0;n<r;n++)i+=t[n];for(var a=0;a<r;a++)t[a]=t[a]/i;return t},"inPlaceSumNormalize"),na=o(function(t,r,i,n){return(1-n)*(1-n)*t+2*(1-n)*n*r+n*n*i},"qbezierAt"),u1=o(function(t,r,i,n){return{x:na(t.x,r.x,i.x,n),y:na(t.y,r.y,i.y,n)}},"qbezierPtAt"),Ort=o(function(t,r,i,n){var a={x:r.x-t.x,y:r.y-t.y},s=e0(t,r),l={x:a.x/s,y:a.y/s};return i=i??0,n=n??i*s,{x:t.x+l.x*n,y:t.y+l.y*n}},"lineAt"),Xb=o(function(t,r,i){return Math.max(t,Math.min(i,r))},"bound"),is=o(function(t){if(t==null)return{x1:1/0,y1:1/0,x2:-1/0,y2:-1/0,w:0,h:0};if(t.x1!=null&&t.y1!=null){if(t.x2!=null&&t.y2!=null&&t.x2>=t.x1&&t.y2>=t.y1)return{x1:t.x1,y1:t.y1,x2:t.x2,y2:t.y2,w:t.x2-t.x1,h:t.y2-t.y1};if(t.w!=null&&t.h!=null&&t.w>=0&&t.h>=0)return{x1:t.x1,y1:t.y1,x2:t.x1+t.w,y2:t.y1+t.h,w:t.w,h:t.h}}},"makeBoundingBox"),Prt=o(function(t){return{x1:t.x1,x2:t.x2,w:t.w,y1:t.y1,y2:t.y2,h:t.h}},"copyBoundingBox"),Brt=o(function(t){t.x1=1/0,t.y1=1/0,t.x2=-1/0,t.y2=-1/0,t.w=0,t.h=0},"clearBoundingBox"),Frt=o(function(t,r){t.x1=Math.min(t.x1,r.x1),t.x2=Math.max(t.x2,r.x2),t.w=t.x2-t.x1,t.y1=Math.min(t.y1,r.y1),t.y2=Math.max(t.y2,r.y2),t.h=t.y2-t.y1},"updateBoundingBox"),ume=o(function(t,r,i){t.x1=Math.min(t.x1,r),t.x2=Math.max(t.x2,r),t.w=t.x2-t.x1,t.y1=Math.min(t.y1,i),t.y2=Math.max(t.y2,i),t.h=t.y2-t.y1},"expandBoundingBoxByPoint"),k3=o(function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return t.x1-=r,t.x2+=r,t.y1-=r,t.y2+=r,t.w=t.x2-t.x1,t.h=t.y2-t.y1,t},"expandBoundingBox"),w3=o(function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0],i,n,a,s;if(r.length===1)i=n=a=s=r[0];else if(r.length===2)i=a=r[0],s=n=r[1];else if(r.length===4){var l=Dn(r,4);i=l[0],n=l[1],a=l[2],s=l[3]}return t.x1-=s,t.x2+=n,t.y1-=i,t.y2+=a,t.w=t.x2-t.x1,t.h=t.y2-t.y1,t},"expandBoundingBoxSides"),Ffe=o(function(t,r){t.x1=r.x1,t.y1=r.y1,t.x2=r.x2,t.y2=r.y2,t.w=t.x2-t.x1,t.h=t.y2-t.y1},"assignBoundingBox"),xP=o(function(t,r){return!(t.x1>r.x2||r.x1>t.x2||t.x2<r.x1||r.x2<t.x1||t.y2<r.y1||r.y2<t.y1||t.y1>r.y2||r.y1>t.y2)},"boundingBoxesIntersect"),zd=o(function(t,r,i){return t.x1<=r&&r<=t.x2&&t.y1<=i&&i<=t.y2},"inBoundingBox"),$fe=o(function(t,r){return zd(t,r.x,r.y)},"pointInBoundingBox"),hme=o(function(t,r){return zd(t,r.x1,r.y1)&&zd(t,r.x2,r.y2)},"boundingBoxInBoundingBox"),$rt=(L9=Math.hypot)!==null&&L9!==void 0?L9:function(e,t){return Math.sqrt(e*e+t*t)};o(zrt,"inflatePolygon");o(Grt,"miterBox");dme=o(function(t,r,i,n,a,s,l){var u=arguments.length>7&&arguments[7]!==void 0?arguments[7]:"auto",h=u==="auto"?Hd(a,s):u,d=a/2,f=s/2;h=Math.min(h,d,f);var p=h!==d,m=h!==f,g;if(p){var y=i-d+h-l,v=n-f-l,x=i+d-h+l,b=v;if(g=Gd(t,r,i,n,y,v,x,b,!1),g.length>0)return g}if(m){var T=i+d+l,w=n-f+h-l,C=T,k=n+f-h+l;if(g=Gd(t,r,i,n,T,w,C,k,!1),g.length>0)return g}if(p){var E=i-d+h-l,A=n+f+l,N=i+d-h+l,P=A;if(g=Gd(t,r,i,n,E,A,N,P,!1),g.length>0)return g}if(m){var I=i-d-l,D=n-f+h-l,_=I,R=n+f-h+l;if(g=Gd(t,r,i,n,I,D,_,R,!1),g.length>0)return g}var M;{var L=i-d+h,B=n-f+h;if(M=zb(t,r,i,n,L,B,h+l),M.length>0&&M[0]<=L&&M[1]<=B)return[M[0],M[1]]}{var O=i+d-h,$=n-f+h;if(M=zb(t,r,i,n,O,$,h+l),M.length>0&&M[0]>=O&&M[1]<=$)return[M[0],M[1]]}{var G=i+d-h,F=n+f-h;if(M=zb(t,r,i,n,G,F,h+l),M.length>0&&M[0]>=G&&M[1]>=F)return[M[0],M[1]]}{var V=i-d+h,H=n+f-h;if(M=zb(t,r,i,n,V,H,h+l),M.length>0&&M[0]<=V&&M[1]>=H)return[M[0],M[1]]}return[]},"roundRectangleIntersectLine"),Vrt=o(function(t,r,i,n,a,s,l){var u=l,h=Math.min(i,a),d=Math.max(i,a),f=Math.min(n,s),p=Math.max(n,s);return h-u<=t&&t<=d+u&&f-u<=r&&r<=p+u},"inLineVicinity"),Wrt=o(function(t,r,i,n,a,s,l,u,h){var d={x1:Math.min(i,l,a)-h,x2:Math.max(i,l,a)+h,y1:Math.min(n,u,s)-h,y2:Math.max(n,u,s)+h};return!(t<d.x1||t>d.x2||r<d.y1||r>d.y2)},"inBezierVicinity"),qrt=o(function(t,r,i,n){i-=n;var a=r*r-4*t*i;if(a<0)return[];var s=Math.sqrt(a),l=2*t,u=(-r+s)/l,h=(-r-s)/l;return[u,h]},"solveQuadratic"),Urt=o(function(t,r,i,n,a){var s=1e-5;t===0&&(t=s),r/=t,i/=t,n/=t;var l,u,h,d,f,p,m,g;if(u=(3*i-r*r)/9,h=-(27*n)+r*(9*i-2*(r*r)),h/=54,l=u*u*u+h*h,a[1]=0,m=r/3,l>0){f=h+Math.sqrt(l),f=f<0?-Math.pow(-f,1/3):Math.pow(f,1/3),p=h-Math.sqrt(l),p=p<0?-Math.pow(-p,1/3):Math.pow(p,1/3),a[0]=-m+f+p,m+=(f+p)/2,a[4]=a[2]=-m,m=Math.sqrt(3)*(-p+f)/2,a[3]=m,a[5]=-m;return}if(a[5]=a[3]=0,l===0){g=h<0?-Math.pow(-h,1/3):Math.pow(h,1/3),a[0]=-m+2*g,a[4]=a[2]=-(g+m);return}u=-u,d=u*u*u,d=Math.acos(h/Math.sqrt(d)),g=2*Math.sqrt(u),a[0]=-m+g*Math.cos(d/3),a[2]=-m+g*Math.cos((d+2*Math.PI)/3),a[4]=-m+g*Math.cos((d+4*Math.PI)/3)},"solveCubic"),Hrt=o(function(t,r,i,n,a,s,l,u){var h=1*i*i-4*i*a+2*i*l+4*a*a-4*a*l+l*l+n*n-4*n*s+2*n*u+4*s*s-4*s*u+u*u,d=9*i*a-3*i*i-3*i*l-6*a*a+3*a*l+9*n*s-3*n*n-3*n*u-6*s*s+3*s*u,f=3*i*i-6*i*a+i*l-i*t+2*a*a+2*a*t-l*t+3*n*n-6*n*s+n*u-n*r+2*s*s+2*s*r-u*r,p=1*i*a-i*i+i*t-a*t+n*s-n*n+n*r-s*r,m=[];Urt(h,d,f,p,m);for(var g=1e-7,y=[],v=0;v<6;v+=2)Math.abs(m[v+1])<g&&m[v]>=0&&m[v]<=1&&y.push(m[v]);y.push(1),y.push(0);for(var x=-1,b,T,w,C=0;C<y.length;C++)b=Math.pow(1-y[C],2)*i+2*(1-y[C])*y[C]*a+y[C]*y[C]*l,T=Math.pow(1-y[C],2)*n+2*(1-y[C])*y[C]*s+y[C]*y[C]*u,w=Math.pow(b-t,2)+Math.pow(T-r,2),x>=0?w<x&&(x=w):x=w;return x},"sqdistToQuadraticBezier"),Yrt=o(function(t,r,i,n,a,s){var l=[t-i,r-n],u=[a-i,s-n],h=u[0]*u[0]+u[1]*u[1],d=l[0]*l[0]+l[1]*l[1],f=l[0]*u[0]+l[1]*u[1],p=f*f/h;return f<0?d:p>h?(t-a)*(t-a)+(r-s)*(r-s):d-p},"sqdistToFiniteLine"),Bs=o(function(t,r,i){for(var n,a,s,l,u,h=0,d=0;d<i.length/2;d++)if(n=i[d*2],a=i[d*2+1],d+1<i.length/2?(s=i[(d+1)*2],l=i[(d+1)*2+1]):(s=i[(d+1-i.length/2)*2],l=i[(d+1-i.length/2)*2+1]),!(n==t&&s==t))if(n>=t&&t>=s||n<=t&&t<=s)u=(t-n)/(s-n)*(l-a)+a,u>r&&h++;else continue;return h%2!==0},"pointInsidePolygonPoints"),Qu=o(function(t,r,i,n,a,s,l,u,h){var d=new Array(i.length),f;u[0]!=null?(f=Math.atan(u[1]/u[0]),u[0]<0?f=f+Math.PI/2:f=-f-Math.PI/2):f=u;for(var p=Math.cos(-f),m=Math.sin(-f),g=0;g<d.length/2;g++)d[g*2]=s/2*(i[g*2]*p-i[g*2+1]*m),d[g*2+1]=l/2*(i[g*2+1]*p+i[g*2]*m),d[g*2]+=n,d[g*2+1]+=a;var y;if(h>0){var v=F3(d,-h);y=B3(v)}else y=d;return Bs(t,r,y)},"pointInsidePolygon"),jrt=o(function(t,r,i,n,a,s,l,u){for(var h=new Array(i.length*2),d=0;d<u.length;d++){var f=u[d];h[d*4+0]=f.startX,h[d*4+1]=f.startY,h[d*4+2]=f.stopX,h[d*4+3]=f.stopY;var p=Math.pow(f.cx-t,2)+Math.pow(f.cy-r,2);if(p<=Math.pow(f.radius,2))return!0}return Bs(t,r,h)},"pointInsideRoundPolygon"),B3=o(function(t){for(var r=new Array(t.length/2),i,n,a,s,l,u,h,d,f=0;f<t.length/4;f++){i=t[f*4],n=t[f*4+1],a=t[f*4+2],s=t[f*4+3],f<t.length/4-1?(l=t[(f+1)*4],u=t[(f+1)*4+1],h=t[(f+1)*4+2],d=t[(f+1)*4+3]):(l=t[0],u=t[1],h=t[2],d=t[3]);var p=Gd(i,n,a,s,l,u,h,d,!0);r[f*2]=p[0],r[f*2+1]=p[1]}return r},"joinLines"),F3=o(function(t,r){for(var i=new Array(t.length*2),n,a,s,l,u=0;u<t.length/2;u++){n=t[u*2],a=t[u*2+1],u<t.length/2-1?(s=t[(u+1)*2],l=t[(u+1)*2+1]):(s=t[0],l=t[1]);var h=l-a,d=-(s-n),f=Math.sqrt(h*h+d*d),p=h/f,m=d/f;i[u*4]=n+p*r,i[u*4+1]=a+m*r,i[u*4+2]=s+p*r,i[u*4+3]=l+m*r}return i},"expandPolygon"),Xrt=o(function(t,r,i,n,a,s){var l=i-t,u=n-r;l/=a,u/=s;var h=Math.sqrt(l*l+u*u),d=h-1;if(d<0)return[];var f=d/h;return[(i-t)*f+t,(n-r)*f+r]},"intersectLineEllipse"),Qp=o(function(t,r,i,n,a,s,l){return t-=a,r-=s,t/=i/2+l,r/=n/2+l,t*t+r*r<=1},"checkInEllipse"),zb=o(function(t,r,i,n,a,s,l){var u=[i-t,n-r],h=[t-a,r-s],d=u[0]*u[0]+u[1]*u[1],f=2*(h[0]*u[0]+h[1]*u[1]),p=h[0]*h[0]+h[1]*h[1]-l*l,m=f*f-4*d*p;if(m<0)return[];var g=(-f+Math.sqrt(m))/(2*d),y=(-f-Math.sqrt(m))/(2*d),v=Math.min(g,y),x=Math.max(g,y),b=[];if(v>=0&&v<=1&&b.push(v),x>=0&&x<=1&&b.push(x),b.length===0)return[];var T=b[0]*u[0]+t,w=b[0]*u[1]+r;if(b.length>1){if(b[0]==b[1])return[T,w];var C=b[1]*u[0]+t,k=b[1]*u[1]+r;return[T,w,C,k]}else return[T,w]},"intersectLineCircle"),M9=o(function(t,r,i){return r<=t&&t<=i||i<=t&&t<=r?t:t<=r&&r<=i||i<=r&&r<=t?r:i},"midOfThree"),Gd=o(function(t,r,i,n,a,s,l,u,h){var d=t-a,f=i-t,p=l-a,m=r-s,g=n-r,y=u-s,v=p*m-y*d,x=f*m-g*d,b=y*f-p*g;if(b!==0){var T=v/b,w=x/b,C=.001,k=0-C,E=1+C;return k<=T&&T<=E&&k<=w&&w<=E?[t+T*f,r+T*g]:h?[t+T*f,r+T*g]:[]}else return v===0||x===0?M9(t,i,l)===l?[l,u]:M9(t,i,a)===a?[a,s]:M9(a,l,i)===i?[i,n]:[]:[]},"finiteLinesIntersect"),Krt=o(function(t,r,i,n,a){var s=[],l=n/2,u=a/2,h=r,d=i;s.push({x:h+l*t[0],y:d+u*t[1]});for(var f=1;f<t.length/2;f++)s.push({x:h+l*t[f*2],y:d+u*t[f*2+1]});return s},"transformPoints"),Kb=o(function(t,r,i,n,a,s,l,u){var h=[],d,f=new Array(i.length),p=!0;s==null&&(p=!1);var m;if(p){for(var g=0;g<f.length/2;g++)f[g*2]=i[g*2]*s+n,f[g*2+1]=i[g*2+1]*l+a;if(u>0){var y=F3(f,-u);m=B3(y)}else m=f}else m=i;for(var v,x,b,T,w=0;w<m.length/2;w++)v=m[w*2],x=m[w*2+1],w<m.length/2-1?(b=m[(w+1)*2],T=m[(w+1)*2+1]):(b=m[0],T=m[1]),d=Gd(t,r,n,a,v,x,b,T),d.length!==0&&h.push(d[0],d[1]);return h},"polygonIntersectLine"),Zrt=o(function(t,r,i,n,a,s,l,u,h){var d=[],f,p=new Array(i.length*2);h.forEach(function(b,T){T===0?(p[p.length-2]=b.startX,p[p.length-1]=b.startY):(p[T*4-2]=b.startX,p[T*4-1]=b.startY),p[T*4]=b.stopX,p[T*4+1]=b.stopY,f=zb(t,r,n,a,b.cx,b.cy,b.radius),f.length!==0&&d.push(f[0],f[1])});for(var m=0;m<p.length/4;m++)f=Gd(t,r,n,a,p[m*4],p[m*4+1],p[m*4+2],p[m*4+3],!1),f.length!==0&&d.push(f[0],f[1]);if(d.length>2){for(var g=[d[0],d[1]],y=Math.pow(g[0]-t,2)+Math.pow(g[1]-r,2),v=1;v<d.length/2;v++){var x=Math.pow(d[v*2]-t,2)+Math.pow(d[v*2+1]-r,2);x<=y&&(g[0]=d[v*2],g[1]=d[v*2+1],y=x)}return g}return d},"roundPolygonIntersectLine"),d3=o(function(t,r,i){var n=[t[0]-r[0],t[1]-r[1]],a=Math.sqrt(n[0]*n[0]+n[1]*n[1]),s=(a-i)/a;return s<0&&(s=1e-5),[r[0]+s*n[0],r[1]+s*n[1]]},"shortenIntersection"),rs=o(function(t,r){var i=UO(t,r);return i=fme(i),i},"generateUnitNgonPointsFitToSquare"),fme=o(function(t){for(var r,i,n=t.length/2,a=1/0,s=1/0,l=-1/0,u=-1/0,h=0;h<n;h++)r=t[2*h],i=t[2*h+1],a=Math.min(a,r),l=Math.max(l,r),s=Math.min(s,i),u=Math.max(u,i);for(var d=2/(l-a),f=2/(u-s),p=0;p<n;p++)r=t[2*p]=t[2*p]*d,i=t[2*p+1]=t[2*p+1]*f,a=Math.min(a,r),l=Math.max(l,r),s=Math.min(s,i),u=Math.max(u,i);if(s<-1)for(var m=0;m<n;m++)i=t[2*m+1]=t[2*m+1]+(-1-s);return t},"fitPolygonToSquare"),UO=o(function(t,r){var i=1/t*2*Math.PI,n=t%2===0?Math.PI/2+i/2:Math.PI/2;n+=r;for(var a=new Array(t*2),s,l=0;l<t;l++)s=l*i+n,a[2*l]=Math.cos(s),a[2*l+1]=Math.sin(-s);return a},"generateUnitNgonPoints"),Hd=o(function(t,r){return Math.min(t/4,r/4,8)},"getRoundRectangleRadius"),pme=o(function(t,r){return Math.min(t/10,r/10,8)},"getRoundPolygonRadius"),bP=o(function(){return 8},"getCutRectangleCornerLength"),Qrt=o(function(t,r,i){return[t-2*r+i,2*(r-t),t]},"bezierPtsToQuadCoeff"),HO=o(function(t,r){return{heightOffset:Math.min(15,.05*r),widthOffset:Math.min(100,.25*t),ctrlPtOffsetPct:.05}},"getBarrelCurveConstants");o(N9,"satPolygonIntersection");Jrt=va({dampingFactor:.8,precision:1e-6,iterations:200,weight:o(function(t){return 1},"weight")}),eit={pageRank:o(function(t){for(var r=Jrt(t),i=r.dampingFactor,n=r.precision,a=r.iterations,s=r.weight,l=this._private.cy,u=this.byGroup(),h=u.nodes,d=u.edges,f=h.length,p=f*f,m=d.length,g=new Array(p),y=new Array(f),v=(1-i)/f,x=0;x<f;x++){for(var b=0;b<f;b++){var T=x*f+b;g[T]=0}y[x]=0}for(var w=0;w<m;w++){var C=d[w],k=C.data("source"),E=C.data("target");if(k!==E){var A=h.indexOfId(k),N=h.indexOfId(E),P=s(C),I=N*f+A;g[I]+=P,y[A]+=P}}for(var D=1/f+v,_=0;_<f;_++)if(y[_]===0)for(var R=0;R<f;R++){var M=R*f+_;g[M]=D}else for(var L=0;L<f;L++){var B=L*f+_;g[B]=g[B]/y[_]+v}for(var O=new Array(f),$=new Array(f),G,F=0;F<f;F++)O[F]=1;for(var V=0;V<a;V++){for(var H=0;H<f;H++)$[H]=0;for(var j=0;j<f;j++)for(var U=0;U<f;U++){var Q=j*f+U;$[j]+=g[Q]*O[U]}Irt($),G=O,O=$,$=G;for(var Y=0,ae=0;ae<f;ae++){var J=G[ae]-O[ae];Y+=J*J}if(Y<n)break}var te={rank:o(function(ee){return ee=l.collection(ee)[0],O[h.indexOf(ee)]},"rank")};return te},"pageRank")},zfe=va({root:null,weight:o(function(t){return 1},"weight"),directed:!1,alpha:0}),h1={degreeCentralityNormalized:o(function(t){t=zfe(t);var r=this.cy(),i=this.nodes(),n=i.length;if(t.directed){for(var d={},f={},p=0,m=0,g=0;g<n;g++){var y=i[g],v=y.id();t.root=y;var x=this.degreeCentrality(t);p<x.indegree&&(p=x.indegree),m<x.outdegree&&(m=x.outdegree),d[v]=x.indegree,f[v]=x.outdegree}return{indegree:o(function(T){return p==0?0:(sr(T)&&(T=r.filter(T)),d[T.id()]/p)},"indegree"),outdegree:o(function(T){return m===0?0:(sr(T)&&(T=r.filter(T)),f[T.id()]/m)},"outdegree")}}else{for(var a={},s=0,l=0;l<n;l++){var u=i[l];t.root=u;var h=this.degreeCentrality(t);s<h.degree&&(s=h.degree),a[u.id()]=h.degree}return{degree:o(function(T){return s===0?0:(sr(T)&&(T=r.filter(T)),a[T.id()]/s)},"degree")}}},"degreeCentralityNormalized"),degreeCentrality:o(function(t){t=zfe(t);var r=this.cy(),i=this,n=t,a=n.root,s=n.weight,l=n.directed,u=n.alpha;if(a=r.collection(a)[0],l){for(var m=a.connectedEdges(),g=m.filter(function(k){return k.target().same(a)&&i.has(k)}),y=m.filter(function(k){return k.source().same(a)&&i.has(k)}),v=g.length,x=y.length,b=0,T=0,w=0;w<g.length;w++)b+=s(g[w]);for(var C=0;C<y.length;C++)T+=s(y[C]);return{indegree:Math.pow(v,1-u)*Math.pow(b,u),outdegree:Math.pow(x,1-u)*Math.pow(T,u)}}else{for(var h=a.connectedEdges().intersection(i),d=h.length,f=0,p=0;p<h.length;p++)f+=s(h[p]);return{degree:Math.pow(d,1-u)*Math.pow(f,u)}}},"degreeCentrality")};h1.dc=h1.degreeCentrality;h1.dcn=h1.degreeCentralityNormalised=h1.degreeCentralityNormalized;Gfe=va({harmonic:!0,weight:o(function(){return 1},"weight"),directed:!1,root:null}),d1={closenessCentralityNormalized:o(function(t){for(var r=Gfe(t),i=r.harmonic,n=r.weight,a=r.directed,s=this.cy(),l={},u=0,h=this.nodes(),d=this.floydWarshall({weight:n,directed:a}),f=0;f<h.length;f++){for(var p=0,m=h[f],g=0;g<h.length;g++)if(f!==g){var y=d.distance(m,h[g]);i?p+=1/y:p+=y}i||(p=1/p),u<p&&(u=p),l[m.id()]=p}return{closeness:o(function(x){return u==0?0:(sr(x)?x=s.filter(x)[0].id():x=x.id(),l[x]/u)},"closeness")}},"closenessCentralityNormalized"),closenessCentrality:o(function(t){var r=Gfe(t),i=r.root,n=r.weight,a=r.directed,s=r.harmonic;i=this.filter(i)[0];for(var l=this.dijkstra({root:i,weight:n,directed:a}),u=0,h=this.nodes(),d=0;d<h.length;d++){var f=h[d];if(!f.same(i)){var p=l.distanceTo(f);s?u+=1/p:u+=p}}return s?u:1/u},"closenessCentrality")};d1.cc=d1.closenessCentrality;d1.ccn=d1.closenessCentralityNormalised=d1.closenessCentralityNormalized;tit=va({weight:null,directed:!1}),YO={betweennessCentrality:o(function(t){for(var r=tit(t),i=r.directed,n=r.weight,a=n!=null,s=this.cy(),l=this.nodes(),u={},h={},d=0,f={set:o(function(T,w){h[T]=w,w>d&&(d=w)},"set"),get:o(function(T){return h[T]},"get")},p=0;p<l.length;p++){var m=l[p],g=m.id();i?u[g]=m.outgoers().nodes():u[g]=m.openNeighborhood().nodes(),f.set(g,0)}for(var y=o(function(){for(var T=l[v].id(),w=[],C={},k={},E={},A=new l2(function(j,U){return E[j]-E[U]}),N=0;N<l.length;N++){var P=l[N].id();C[P]=[],k[P]=0,E[P]=1/0}for(k[T]=1,E[T]=0,A.push(T);!A.empty();){var I=A.pop();if(w.push(I),a)for(var D=0;D<u[I].length;D++){var _=u[I][D],R=s.getElementById(I),M=void 0;R.edgesTo(_).length>0?M=R.edgesTo(_)[0]:M=_.edgesTo(R)[0];var L=n(M);_=_.id(),E[_]>E[I]+L&&(E[_]=E[I]+L,A.nodes.indexOf(_)<0?A.push(_):A.updateItem(_),k[_]=0,C[_]=[]),E[_]==E[I]+L&&(k[_]=k[_]+k[I],C[_].push(I))}else for(var B=0;B<u[I].length;B++){var O=u[I][B].id();E[O]==1/0&&(A.push(O),E[O]=E[I]+1),E[O]==E[I]+1&&(k[O]=k[O]+k[I],C[O].push(I))}}for(var $={},G=0;G<l.length;G++)$[l[G].id()]=0;for(;w.length>0;){for(var F=w.pop(),V=0;V<C[F].length;V++){var H=C[F][V];$[H]=$[H]+k[H]/k[F]*(1+$[F])}F!=l[v].id()&&f.set(F,f.get(F)+$[F])}},"_loop"),v=0;v<l.length;v++)y();var x={betweenness:o(function(T){var w=s.collection(T).id();return f.get(w)},"betweenness"),betweennessNormalized:o(function(T){if(d==0)return 0;var w=s.collection(T).id();return f.get(w)/d},"betweennessNormalized")};return x.betweennessNormalised=x.betweennessNormalized,x},"betweennessCentrality")};YO.bc=YO.betweennessCentrality;rit=va({expandFactor:2,inflateFactor:2,multFactor:1,maxIterations:20,attributes:[function(e){return 1}]}),iit=o(function(t){return rit(t)},"setOptions"),nit=o(function(t,r){for(var i=0,n=0;n<r.length;n++)i+=r[n](t);return i},"getSimilarity"),ait=o(function(t,r,i){for(var n=0;n<r;n++)t[n*r+n]=i},"addLoops"),mme=o(function(t,r){for(var i,n=0;n<r;n++){i=0;for(var a=0;a<r;a++)i+=t[a*r+n];for(var s=0;s<r;s++)t[s*r+n]=t[s*r+n]/i}},"normalize"),sit=o(function(t,r,i){for(var n=new Array(i*i),a=0;a<i;a++){for(var s=0;s<i;s++)n[a*i+s]=0;for(var l=0;l<i;l++)for(var u=0;u<i;u++)n[a*i+u]+=t[a*i+l]*r[l*i+u]}return n},"mmult"),oit=o(function(t,r,i){for(var n=t.slice(0),a=1;a<i;a++)t=sit(t,n,r);return t},"expand"),lit=o(function(t,r,i){for(var n=new Array(r*r),a=0;a<r*r;a++)n[a]=Math.pow(t[a],i);return mme(n,r),n},"inflate"),cit=o(function(t,r,i,n){for(var a=0;a<i;a++){var s=Math.round(t[a]*Math.pow(10,n))/Math.pow(10,n),l=Math.round(r[a]*Math.pow(10,n))/Math.pow(10,n);if(s!==l)return!1}return!0},"hasConverged"),uit=o(function(t,r,i,n){for(var a=[],s=0;s<r;s++){for(var l=[],u=0;u<r;u++)Math.round(t[s*r+u]*1e3)/1e3>0&&l.push(i[u]);l.length!==0&&a.push(n.collection(l))}return a},"assign"),hit=o(function(t,r){for(var i=0;i<t.length;i++)if(!r[i]||t[i].id()!==r[i].id())return!1;return!0},"isDuplicate"),dit=o(function(t){for(var r=0;r<t.length;r++)for(var i=0;i<t.length;i++)r!=i&&hit(t[r],t[i])&&t.splice(i,1);return t},"removeDuplicates"),Vfe=o(function(t){for(var r=this.nodes(),i=this.edges(),n=this.cy(),a=iit(t),s={},l=0;l<r.length;l++)s[r[l].id()]=l;for(var u=r.length,h=u*u,d=new Array(h),f,p=0;p<h;p++)d[p]=0;for(var m=0;m<i.length;m++){var g=i[m],y=s[g.source().id()],v=s[g.target().id()],x=nit(g,a.attributes);d[y*u+v]+=x,d[v*u+y]+=x}ait(d,u,a.multFactor),mme(d,u);for(var b=!0,T=0;b&&T<a.maxIterations;)b=!1,f=oit(d,u,a.expandFactor),d=lit(f,u,a.inflateFactor),cit(d,f,h,4)||(b=!0),T++;var w=uit(d,u,r,n);return w=dit(w),w},"markovClustering"),fit={markovClustering:Vfe,mcl:Vfe},pit=o(function(t){return t},"identity"),gme=o(function(t,r){return Math.abs(r-t)},"absDiff"),Wfe=o(function(t,r,i){return t+gme(r,i)},"addAbsDiff"),qfe=o(function(t,r,i){return t+Math.pow(i-r,2)},"addSquaredDiff"),mit=o(function(t){return Math.sqrt(t)},"sqrt"),git=o(function(t,r,i){return Math.max(t,gme(r,i))},"maxAbsDiff"),Nb=o(function(t,r,i,n,a){for(var s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:pit,l=n,u,h,d=0;d<t;d++)u=r(d),h=i(d),l=a(l,u,h);return s(l)},"getDistance"),m1={euclidean:o(function(t,r,i){return t>=2?Nb(t,r,i,0,qfe,mit):Nb(t,r,i,0,Wfe)},"euclidean"),squaredEuclidean:o(function(t,r,i){return Nb(t,r,i,0,qfe)},"squaredEuclidean"),manhattan:o(function(t,r,i){return Nb(t,r,i,0,Wfe)},"manhattan"),max:o(function(t,r,i){return Nb(t,r,i,-1/0,git)},"max")};m1["squared-euclidean"]=m1.squaredEuclidean;m1.squaredeuclidean=m1.squaredEuclidean;o(Z3,"clusteringDistance");yit=va({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),TP=o(function(t){return yit(t)},"setOptions"),$3=o(function(t,r,i,n,a){var s=a!=="kMedoids",l=s?function(f){return i[f]}:function(f){return n[f](i)},u=o(function(p){return n[p](r)},"getQ"),h=i,d=r;return Z3(t,n.length,l,u,h,d)},"getDist"),I9=o(function(t,r,i){for(var n=i.length,a=new Array(n),s=new Array(n),l=new Array(r),u=null,h=0;h<n;h++)a[h]=t.min(i[h]).value,s[h]=t.max(i[h]).value;for(var d=0;d<r;d++){u=[];for(var f=0;f<n;f++)u[f]=Math.random()*(s[f]-a[f])+a[f];l[d]=u}return l},"randomCentroids"),yme=o(function(t,r,i,n,a){for(var s=1/0,l=0,u=0;u<r.length;u++){var h=$3(i,t,r[u],n,a);h<s&&(s=h,l=u)}return l},"classify"),vme=o(function(t,r,i){for(var n=[],a=null,s=0;s<r.length;s++)a=r[s],i[a.id()]===t&&n.push(a);return n},"buildCluster"),vit=o(function(t,r,i){return Math.abs(r-t)<=i},"haveValuesConverged"),xit=o(function(t,r,i){for(var n=0;n<t.length;n++)for(var a=0;a<t[n].length;a++){var s=Math.abs(t[n][a]-r[n][a]);if(s>i)return!1}return!0},"haveMatricesConverged"),bit=o(function(t,r,i){for(var n=0;n<i;n++)if(t===r[n])return!0;return!1},"seenBefore"),Ufe=o(function(t,r){var i=new Array(r);if(t.length<50)for(var n=0;n<r;n++){for(var a=t[Math.floor(Math.random()*t.length)];bit(a,i,n);)a=t[Math.floor(Math.random()*t.length)];i[n]=a}else for(var s=0;s<r;s++)i[s]=t[Math.floor(Math.random()*t.length)];return i},"randomMedoids"),Hfe=o(function(t,r,i){for(var n=0,a=0;a<r.length;a++)n+=$3("manhattan",r[a],t,i,"kMedoids");return n},"findCost"),Tit=o(function(t){var r=this.cy(),i=this.nodes(),n=null,a=TP(t),s=new Array(a.k),l={},u;a.testMode?typeof a.testCentroids=="number"?(a.testCentroids,u=I9(i,a.k,a.attributes)):Wn(a.testCentroids)==="object"?u=a.testCentroids:u=I9(i,a.k,a.attributes):u=I9(i,a.k,a.attributes);for(var h=!0,d=0;h&&d<a.maxIterations;){for(var f=0;f<i.length;f++)n=i[f],l[n.id()]=yme(n,u,a.distance,a.attributes,"kMeans");h=!1;for(var p=0;p<a.k;p++){var m=vme(p,i,l);if(m.length!==0){for(var g=a.attributes.length,y=u[p],v=new Array(g),x=new Array(g),b=0;b<g;b++){x[b]=0;for(var T=0;T<m.length;T++)n=m[T],x[b]+=a.attributes[b](n);v[b]=x[b]/m.length,vit(v[b],y[b],a.sensitivityThreshold)||(h=!0)}u[p]=v,s[p]=r.collection(m)}}d++}return s},"kMeans"),Cit=o(function(t){var r=this.cy(),i=this.nodes(),n=null,a=TP(t),s=new Array(a.k),l,u={},h,d=new Array(a.k);a.testMode?typeof a.testCentroids=="number"||(Wn(a.testCentroids)==="object"?l=a.testCentroids:l=Ufe(i,a.k)):l=Ufe(i,a.k);for(var f=!0,p=0;f&&p<a.maxIterations;){for(var m=0;m<i.length;m++)n=i[m],u[n.id()]=yme(n,l,a.distance,a.attributes,"kMedoids");f=!1;for(var g=0;g<l.length;g++){var y=vme(g,i,u);if(y.length!==0){d[g]=Hfe(l[g],y,a.attributes);for(var v=0;v<y.length;v++)h=Hfe(y[v],y,a.attributes),h<d[g]&&(d[g]=h,l[g]=y[v],f=!0);s[g]=r.collection(y)}}p++}return s},"kMedoids"),kit=o(function(t,r,i,n,a){for(var s,l,u=0;u<r.length;u++)for(var h=0;h<t.length;h++)n[u][h]=Math.pow(i[u][h],a.m);for(var d=0;d<t.length;d++)for(var f=0;f<a.attributes.length;f++){s=0,l=0;for(var p=0;p<r.length;p++)s+=n[p][d]*a.attributes[f](r[p]),l+=n[p][d];t[d][f]=s/l}},"updateCentroids"),wit=o(function(t,r,i,n,a){for(var s=0;s<t.length;s++)r[s]=t[s].slice();for(var l,u,h,d=2/(a.m-1),f=0;f<i.length;f++)for(var p=0;p<n.length;p++){l=0;for(var m=0;m<i.length;m++)u=$3(a.distance,n[p],i[f],a.attributes,"cmeans"),h=$3(a.distance,n[p],i[m],a.attributes,"cmeans"),l+=Math.pow(u/h,d);t[p][f]=1/l}},"updateMembership"),Sit=o(function(t,r,i,n){for(var a=new Array(i.k),s=0;s<a.length;s++)a[s]=[];for(var l,u,h=0;h<r.length;h++){l=-1/0,u=-1;for(var d=0;d<r[0].length;d++)r[h][d]>l&&(l=r[h][d],u=d);a[u].push(t[h])}for(var f=0;f<a.length;f++)a[f]=n.collection(a[f]);return a},"assign"),Yfe=o(function(t){var r=this.cy(),i=this.nodes(),n=TP(t),a,s,l,u,h;u=new Array(i.length);for(var d=0;d<i.length;d++)u[d]=new Array(n.k);l=new Array(i.length);for(var f=0;f<i.length;f++)l[f]=new Array(n.k);for(var p=0;p<i.length;p++){for(var m=0,g=0;g<n.k;g++)l[p][g]=Math.random(),m+=l[p][g];for(var y=0;y<n.k;y++)l[p][y]=l[p][y]/m}s=new Array(n.k);for(var v=0;v<n.k;v++)s[v]=new Array(n.attributes.length);h=new Array(i.length);for(var x=0;x<i.length;x++)h[x]=new Array(n.k);for(var b=!0,T=0;b&&T<n.maxIterations;)b=!1,kit(s,i,l,h,n),wit(l,u,s,i,n),xit(l,u,n.sensitivityThreshold)||(b=!0),T++;return a=Sit(i,l,n,r),{clusters:a,degreeOfMembership:l}},"fuzzyCMeans"),Eit={kMeans:Tit,kMedoids:Cit,fuzzyCMeans:Yfe,fcm:Yfe},Ait=va({distance:"euclidean",linkage:"min",mode:"threshold",threshold:1/0,addDendrogram:!1,dendrogramDepth:0,attributes:[]}),_it={single:"min",complete:"max"},Dit=o(function(t){var r=Ait(t),i=_it[r.linkage];return i!=null&&(r.linkage=i),r},"setOptions"),jfe=o(function(t,r,i,n,a){for(var s=0,l=1/0,u,h=a.attributes,d=o(function(N,P){return Z3(a.distance,h.length,function(I){return h[I](N)},function(I){return h[I](P)},N,P)},"getDist"),f=0;f<t.length;f++){var p=t[f].key,m=i[p][n[p]];m<l&&(s=p,l=m)}if(a.mode==="threshold"&&l>=a.threshold||a.mode==="dendrogram"&&t.length===1)return!1;var g=r[s],y=r[n[s]],v;a.mode==="dendrogram"?v={left:g,right:y,key:g.key}:v={value:g.value.concat(y.value),key:g.key},t[g.index]=v,t.splice(y.index,1),r[g.key]=v;for(var x=0;x<t.length;x++){var b=t[x];g.key===b.key?u=1/0:a.linkage==="min"?(u=i[g.key][b.key],i[g.key][b.key]>i[y.key][b.key]&&(u=i[y.key][b.key])):a.linkage==="max"?(u=i[g.key][b.key],i[g.key][b.key]<i[y.key][b.key]&&(u=i[y.key][b.key])):a.linkage==="mean"?u=(i[g.key][b.key]*g.size+i[y.key][b.key]*y.size)/(g.size+y.size):a.mode==="dendrogram"?u=d(b.value,g.value):u=d(b.value[0],g.value[0]),i[g.key][b.key]=i[b.key][g.key]=u}for(var T=0;T<t.length;T++){var w=t[T].key;if(n[w]===g.key||n[w]===y.key){for(var C=w,k=0;k<t.length;k++){var E=t[k].key;i[w][E]<i[w][C]&&(C=E)}n[w]=C}t[T].index=T}return g.key=y.key=g.index=y.index=null,!0},"mergeClosest"),l1=o(function(t,r,i){t&&(t.value?r.push(t.value):(t.left&&l1(t.left,r),t.right&&l1(t.right,r)))},"getAllChildren"),jO=o(function(t,r){if(!t)return"";if(t.left&&t.right){var i=jO(t.left,r),n=jO(t.right,r),a=r.add({group:"nodes",data:{id:i+","+n}});return r.add({group:"edges",data:{source:i,target:a.id()}}),r.add({group:"edges",data:{source:n,target:a.id()}}),a.id()}else if(t.value)return t.value.id()},"buildDendrogram"),XO=o(function(t,r,i){if(!t)return[];var n=[],a=[],s=[];return r===0?(t.left&&l1(t.left,n),t.right&&l1(t.right,a),s=n.concat(a),[i.collection(s)]):r===1?t.value?[i.collection(t.value)]:(t.left&&l1(t.left,n),t.right&&l1(t.right,a),[i.collection(n),i.collection(a)]):t.value?[i.collection(t.value)]:(t.left&&(n=XO(t.left,r-1,i)),t.right&&(a=XO(t.right,r-1,i)),n.concat(a))},"buildClustersFromTree"),Xfe=o(function(t){for(var r=this.cy(),i=this.nodes(),n=Dit(t),a=n.attributes,s=o(function(T,w){return Z3(n.distance,a.length,function(C){return a[C](T)},function(C){return a[C](w)},T,w)},"getDist"),l=[],u=[],h=[],d=[],f=0;f<i.length;f++){var p={value:n.mode==="dendrogram"?i[f]:[i[f]],key:f,index:f};l[f]=p,d[f]=p,u[f]=[],h[f]=0}for(var m=0;m<l.length;m++)for(var g=0;g<=m;g++){var y=void 0;n.mode==="dendrogram"?y=m===g?1/0:s(l[m].value,l[g].value):y=m===g?1/0:s(l[m].value[0],l[g].value[0]),u[m][g]=y,u[g][m]=y,y<u[m][h[m]]&&(h[m]=g)}for(var v=jfe(l,d,u,h,n);v;)v=jfe(l,d,u,h,n);var x;return n.mode==="dendrogram"?(x=XO(l[0],n.dendrogramDepth,r),n.addDendrogram&&jO(l[0],r)):(x=new Array(l.length),l.forEach(function(b,T){b.key=b.index=null,x[T]=r.collection(b.value)})),x},"hierarchicalClustering"),Rit={hierarchicalClustering:Xfe,hca:Xfe},Lit=va({distance:"euclidean",preference:"median",damping:.8,maxIterations:1e3,minIterations:100,attributes:[]}),Mit=o(function(t){var r=t.damping,i=t.preference;.5<=r&&r<1||Yi("Damping must range on [0.5, 1). Got: ".concat(r));var n=["median","mean","min","max"];return n.some(function(a){return a===i})||Ot(i)||Yi("Preference must be one of [".concat(n.map(function(a){return"'".concat(a,"'")}).join(", "),"] or a number. Got: ").concat(i)),Lit(t)},"setOptions"),Nit=o(function(t,r,i,n){var a=o(function(l,u){return n[u](l)},"attr");return-Z3(t,n.length,function(s){return a(r,s)},function(s){return a(i,s)},r,i)},"getSimilarity"),Iit=o(function(t,r){var i=null;return r==="median"?i=Mrt(t):r==="mean"?i=Lrt(t):r==="min"?i=Drt(t):r==="max"?i=Rrt(t):i=r,i},"getPreference"),Oit=o(function(t,r,i){for(var n=[],a=0;a<t;a++)r[a*t+a]+i[a*t+a]>0&&n.push(a);return n},"findExemplars"),Kfe=o(function(t,r,i){for(var n=[],a=0;a<t;a++){for(var s=-1,l=-1/0,u=0;u<i.length;u++){var h=i[u];r[a*t+h]>l&&(s=h,l=r[a*t+h])}s>0&&n.push(s)}for(var d=0;d<i.length;d++)n[i[d]]=i[d];return n},"assignClusters"),Pit=o(function(t,r,i){for(var n=Kfe(t,r,i),a=0;a<i.length;a++){for(var s=[],l=0;l<n.length;l++)n[l]===i[a]&&s.push(l);for(var u=-1,h=-1/0,d=0;d<s.length;d++){for(var f=0,p=0;p<s.length;p++)f+=r[s[p]*t+s[d]];f>h&&(u=d,h=f)}i[a]=s[u]}return n=Kfe(t,r,i),n},"assign"),Zfe=o(function(t){for(var r=this.cy(),i=this.nodes(),n=Mit(t),a={},s=0;s<i.length;s++)a[i[s].id()]=s;var l,u,h,d,f,p;l=i.length,u=l*l,h=new Array(u);for(var m=0;m<u;m++)h[m]=-1/0;for(var g=0;g<l;g++)for(var y=0;y<l;y++)g!==y&&(h[g*l+y]=Nit(n.distance,i[g],i[y],n.attributes));d=Iit(h,n.preference);for(var v=0;v<l;v++)h[v*l+v]=d;f=new Array(u);for(var x=0;x<u;x++)f[x]=0;p=new Array(u);for(var b=0;b<u;b++)p[b]=0;for(var T=new Array(l),w=new Array(l),C=new Array(l),k=0;k<l;k++)T[k]=0,w[k]=0,C[k]=0;for(var E=new Array(l*n.minIterations),A=0;A<E.length;A++)E[A]=0;var N;for(N=0;N<n.maxIterations;N++){for(var P=0;P<l;P++){for(var I=-1/0,D=-1/0,_=-1,R=0,M=0;M<l;M++)T[M]=f[P*l+M],R=p[P*l+M]+h[P*l+M],R>=I?(D=I,I=R,_=M):R>D&&(D=R);for(var L=0;L<l;L++)f[P*l+L]=(1-n.damping)*(h[P*l+L]-I)+n.damping*T[L];f[P*l+_]=(1-n.damping)*(h[P*l+_]-D)+n.damping*T[_]}for(var B=0;B<l;B++){for(var O=0,$=0;$<l;$++)T[$]=p[$*l+B],w[$]=Math.max(0,f[$*l+B]),O+=w[$];O-=w[B],w[B]=f[B*l+B],O+=w[B];for(var G=0;G<l;G++)p[G*l+B]=(1-n.damping)*Math.min(0,O-w[G])+n.damping*T[G];p[B*l+B]=(1-n.damping)*(O-w[B])+n.damping*T[B]}for(var F=0,V=0;V<l;V++){var H=p[V*l+V]+f[V*l+V]>0?1:0;E[N%n.minIterations*l+V]=H,F+=H}if(F>0&&(N>=n.minIterations-1||N==n.maxIterations-1)){for(var j=0,U=0;U<l;U++){C[U]=0;for(var Q=0;Q<n.minIterations;Q++)C[U]+=E[Q*l+U];(C[U]===0||C[U]===n.minIterations)&&j++}if(j===l)break}}for(var Y=Oit(l,f,p),ae=Pit(l,h,Y),J={},te=0;te<Y.length;te++)J[Y[te]]=[];for(var re=0;re<i.length;re++){var ee=a[i[re].id()],Te=ae[ee];Te!=null&&J[Te].push(i[re])}for(var ue=new Array(Y.length),De=0;De<Y.length;De++)ue[De]=r.collection(J[Y[De]]);return ue},"affinityPropagation"),Bit={affinityPropagation:Zfe,ap:Zfe},Fit=va({root:void 0,directed:!1}),$it={hierholzer:o(function(t){if(!Xr(t)){var r=arguments;t={root:r[0],directed:r[1]}}var i=Fit(t),n=i.root,a=i.directed,s=this,l=!1,u,h,d;n&&(d=sr(n)?this.filter(n)[0].id():n[0].id());var f={},p={};a?s.forEach(function(b){var T=b.id();if(b.isNode()){var w=b.indegree(!0),C=b.outdegree(!0),k=w-C,E=C-w;k==1?u?l=!0:u=T:E==1?h?l=!0:h=T:(E>1||k>1)&&(l=!0),f[T]=[],b.outgoers().forEach(function(A){A.isEdge()&&f[T].push(A.id())})}else p[T]=[void 0,b.target().id()]}):s.forEach(function(b){var T=b.id();if(b.isNode()){var w=b.degree(!0);w%2&&(u?h?l=!0:h=T:u=T),f[T]=[],b.connectedEdges().forEach(function(C){return f[T].push(C.id())})}else p[T]=[b.source().id(),b.target().id()]});var m={found:!1,trail:void 0};if(l)return m;if(h&&u)if(a){if(d&&h!=d)return m;d=h}else{if(d&&h!=d&&u!=d)return m;d||(d=h)}else d||(d=s[0].id());var g=o(function(T){for(var w=T,C=[T],k,E,A;f[w].length;)k=f[w].shift(),E=p[k][0],A=p[k][1],w!=A?(f[A]=f[A].filter(function(N){return N!=k}),w=A):!a&&w!=E&&(f[E]=f[E].filter(function(N){return N!=k}),w=E),C.unshift(k),C.unshift(w);return C},"walk"),y=[],v=[];for(v=g(d);v.length!=1;)f[v[0]].length==0?(y.unshift(s.getElementById(v.shift())),y.unshift(s.getElementById(v.shift()))):v=g(v.shift()).concat(v);y.unshift(s.getElementById(v.shift()));for(var x in f)if(f[x].length)return m;return m.found=!0,m.trail=this.spawn(y,!0),m},"hierholzer")},f3=o(function(){var t=this,r={},i=0,n=0,a=[],s=[],l={},u=o(function(p,m){for(var g=s.length-1,y=[],v=t.spawn();s[g].x!=p||s[g].y!=m;)y.push(s.pop().edge),g--;y.push(s.pop().edge),y.forEach(function(x){var b=x.connectedNodes().intersection(t);v.merge(x),b.forEach(function(T){var w=T.id(),C=T.connectedEdges().intersection(t);v.merge(T),r[w].cutVertex?v.merge(C.filter(function(k){return k.isLoop()})):v.merge(C)})}),a.push(v)},"buildComponent"),h=o(function(p,m,g){p===g&&(n+=1),r[m]={id:i,low:i++,cutVertex:!1};var y=t.getElementById(m).connectedEdges().intersection(t);if(y.size()===0)a.push(t.spawn(t.getElementById(m)));else{var v,x,b,T;y.forEach(function(w){v=w.source().id(),x=w.target().id(),b=v===m?x:v,b!==g&&(T=w.id(),l[T]||(l[T]=!0,s.push({x:m,y:b,edge:w})),b in r?r[m].low=Math.min(r[m].low,r[b].id):(h(p,b,m),r[m].low=Math.min(r[m].low,r[b].low),r[m].id<=r[b].low&&(r[m].cutVertex=!0,u(m,b))))})}},"biconnectedSearch");t.forEach(function(f){if(f.isNode()){var p=f.id();p in r||(n=0,h(p,p),r[p].cutVertex=n>1)}});var d=Object.keys(r).filter(function(f){return r[f].cutVertex}).map(function(f){return t.getElementById(f)});return{cut:t.spawn(d),components:a}},"hopcroftTarjanBiconnected"),zit={hopcroftTarjanBiconnected:f3,htbc:f3,htb:f3,hopcroftTarjanBiconnectedComponents:f3},p3=o(function(){var t=this,r={},i=0,n=[],a=[],s=t.spawn(t),l=o(function(h){a.push(h),r[h]={index:i,low:i++,explored:!1};var d=t.getElementById(h).connectedEdges().intersection(t);if(d.forEach(function(y){var v=y.target().id();v!==h&&(v in r||l(v),r[v].explored||(r[h].low=Math.min(r[h].low,r[v].low)))}),r[h].index===r[h].low){for(var f=t.spawn();;){var p=a.pop();if(f.merge(t.getElementById(p)),r[p].low=r[h].index,r[p].explored=!0,p===h)break}var m=f.edgesWith(f),g=f.merge(m);n.push(g),s=s.difference(g)}},"stronglyConnectedSearch");return t.forEach(function(u){if(u.isNode()){var h=u.id();h in r||l(h)}}),{cut:s,components:n}},"tarjanStronglyConnected"),Git={tarjanStronglyConnected:p3,tsc:p3,tscc:p3,tarjanStronglyConnectedComponents:p3},xme={};[jb,yrt,vrt,brt,Crt,wrt,Art,eit,h1,d1,YO,fit,Eit,Rit,Bit,$it,zit,Git].forEach(function(e){hr(xme,e)});bme=0,Tme=1,Cme=2,$l=o(function(t){if(!(this instanceof $l))return new $l(t);this.id="Thenable/1.0.7",this.state=bme,this.fulfillValue=void 0,this.rejectReason=void 0,this.onFulfilled=[],this.onRejected=[],this.proxy={then:this.then.bind(this)},typeof t=="function"&&t.call(this,this.fulfill.bind(this),this.reject.bind(this))},"api");$l.prototype={fulfill:o(function(t){return Qfe(this,Tme,"fulfillValue",t)},"fulfill"),reject:o(function(t){return Qfe(this,Cme,"rejectReason",t)},"reject"),then:o(function(t,r){var i=this,n=new $l;return i.onFulfilled.push(epe(t,n,"fulfill")),i.onRejected.push(epe(r,n,"reject")),kme(i),n.proxy},"then")};Qfe=o(function(t,r,i,n){return t.state===bme&&(t.state=r,t[i]=n,kme(t)),t},"deliver"),kme=o(function(t){t.state===Tme?Jfe(t,"onFulfilled",t.fulfillValue):t.state===Cme&&Jfe(t,"onRejected",t.rejectReason)},"execute"),Jfe=o(function(t,r,i){if(t[r].length!==0){var n=t[r];t[r]=[];var a=o(function(){for(var l=0;l<n.length;l++)n[l](i)},"func");typeof setImmediate=="function"?setImmediate(a):setTimeout(a,0)}},"execute_handlers"),epe=o(function(t,r,i){return function(n){if(typeof t!="function")r[i].call(r,n);else{var a;try{a=t(n)}catch(s){r.reject(s);return}wme(r,a)}}},"resolver"),wme=o(function(t,r){if(t===r||t.proxy===r){t.reject(new TypeError("cannot resolve promise with itself"));return}var i;if(Wn(r)==="object"&&r!==null||typeof r=="function")try{i=r.then}catch(a){t.reject(a);return}if(typeof i=="function"){var n=!1;try{i.call(r,function(a){n||(n=!0,a===r?t.reject(new TypeError("circular thenable chain")):wme(t,a))},function(a){n||(n=!0,t.reject(a))})}catch(a){n||t.reject(a)}return}t.fulfill(r)},"resolve");$l.all=function(e){return new $l(function(t,r){for(var i=new Array(e.length),n=0,a=o(function(u,h){i[u]=h,n++,n===e.length&&t(i)},"fulfill"),s=0;s<e.length;s++)(function(l){var u=e[l],h=u!=null&&u.then!=null;if(h)u.then(function(f){a(l,f)},function(f){r(f)});else{var d=u;a(l,d)}})(s)})};$l.resolve=function(e){return new $l(function(t,r){t(e)})};$l.reject=function(e){return new $l(function(t,r){r(e)})};v1=typeof Promise<"u"?Promise:$l,KO=o(function(t,r,i){var n=hP(t),a=!n,s=this._private=hr({duration:1e3},r,i);if(s.target=t,s.style=s.style||s.css,s.started=!1,s.playing=!1,s.hooked=!1,s.applying=!1,s.progress=0,s.completes=[],s.frames=[],s.complete&&Ji(s.complete)&&s.completes.push(s.complete),a){var l=t.position();s.startPosition=s.startPosition||{x:l.x,y:l.y},s.startStyle=s.startStyle||t.cy().style().getAnimationStartStyle(t,s.style)}if(n){var u=t.pan();s.startPan={x:u.x,y:u.y},s.startZoom=t.zoom()}this.length=1,this[0]=this},"Animation"),t0=KO.prototype;hr(t0,{instanceString:o(function(){return"animation"},"instanceString"),hook:o(function(){var t=this._private;if(!t.hooked){var r,i=t.target._private.animation;t.queue?r=i.queue:r=i.current,r.push(this),uo(t.target)&&t.target.cy().addToAnimationPool(t.target),t.hooked=!0}return this},"hook"),play:o(function(){var t=this._private;return t.progress===1&&(t.progress=0),t.playing=!0,t.started=!1,t.stopped=!1,this.hook(),this},"play"),playing:o(function(){return this._private.playing},"playing"),apply:o(function(){var t=this._private;return t.applying=!0,t.started=!1,t.stopped=!1,this.hook(),this},"apply"),applying:o(function(){return this._private.applying},"applying"),pause:o(function(){var t=this._private;return t.playing=!1,t.started=!1,this},"pause"),stop:o(function(){var t=this._private;return t.playing=!1,t.started=!1,t.stopped=!0,this},"stop"),rewind:o(function(){return this.progress(0)},"rewind"),fastforward:o(function(){return this.progress(1)},"fastforward"),time:o(function(t){var r=this._private;return t===void 0?r.progress*r.duration:this.progress(t/r.duration)},"time"),progress:o(function(t){var r=this._private,i=r.playing;return t===void 0?r.progress:(i&&this.pause(),r.progress=t,r.started=!1,i&&this.play(),this)},"progress"),completed:o(function(){return this._private.progress===1},"completed"),reverse:o(function(){var t=this._private,r=t.playing;r&&this.pause(),t.progress=1-t.progress,t.started=!1;var i=o(function(h,d){var f=t[h];f!=null&&(t[h]=t[d],t[d]=f)},"swap");if(i("zoom","startZoom"),i("pan","startPan"),i("position","startPosition"),t.style)for(var n=0;n<t.style.length;n++){var a=t.style[n],s=a.name,l=t.startStyle[s];t.startStyle[s]=a,t.style[n]=l}return r&&this.play(),this},"reverse"),promise:o(function(t){var r=this._private,i;switch(t){case"frame":i=r.frames;break;default:case"complete":case"completed":i=r.completes}return new v1(function(n,a){i.push(function(){n()})})},"promise")});t0.complete=t0.completed;t0.run=t0.play;t0.running=t0.playing;Vit={animated:o(function(){return o(function(){var r=this,i=r.length!==void 0,n=i?r:[r],a=this._private.cy||this;if(!a.styleEnabled())return!1;var s=n[0];if(s)return s._private.animation.current.length>0},"animatedImpl")},"animated"),clearQueue:o(function(){return o(function(){var r=this,i=r.length!==void 0,n=i?r:[r],a=this._private.cy||this;if(!a.styleEnabled())return this;for(var s=0;s<n.length;s++){var l=n[s];l._private.animation.queue=[]}return this},"clearQueueImpl")},"clearQueue"),delay:o(function(){return o(function(r,i){var n=this._private.cy||this;return n.styleEnabled()?this.animate({delay:r,duration:r,complete:i}):this},"delayImpl")},"delay"),delayAnimation:o(function(){return o(function(r,i){var n=this._private.cy||this;return n.styleEnabled()?this.animation({delay:r,duration:r,complete:i}):this},"delayAnimationImpl")},"delayAnimation"),animation:o(function(){return o(function(r,i){var n=this,a=n.length!==void 0,s=a?n:[n],l=this._private.cy||this,u=!a,h=!u;if(!l.styleEnabled())return this;var d=l.style();r=hr({},r,i);var f=Object.keys(r).length===0;if(f)return new KO(s[0],r);switch(r.duration===void 0&&(r.duration=400),r.duration){case"slow":r.duration=600;break;case"fast":r.duration=200;break}if(h&&(r.style=d.getPropsList(r.style||r.css),r.css=void 0),h&&r.renderedPosition!=null){var p=r.renderedPosition,m=l.pan(),g=l.zoom();r.position=cme(p,g,m)}if(u&&r.panBy!=null){var y=r.panBy,v=l.pan();r.pan={x:v.x+y.x,y:v.y+y.y}}var x=r.center||r.centre;if(u&&x!=null){var b=l.getCenterPan(x.eles,r.zoom);b!=null&&(r.pan=b)}if(u&&r.fit!=null){var T=r.fit,w=l.getFitViewport(T.eles||T.boundingBox,T.padding);w!=null&&(r.pan=w.pan,r.zoom=w.zoom)}if(u&&Xr(r.zoom)){var C=l.getZoomedViewport(r.zoom);C!=null?(C.zoomed&&(r.zoom=C.zoom),C.panned&&(r.pan=C.pan)):r.zoom=null}return new KO(s[0],r)},"animationImpl")},"animation"),animate:o(function(){return o(function(r,i){var n=this,a=n.length!==void 0,s=a?n:[n],l=this._private.cy||this;if(!l.styleEnabled())return this;i&&(r=hr({},r,i));for(var u=0;u<s.length;u++){var h=s[u],d=h.animated()&&(r.queue===void 0||r.queue),f=h.animation(r,d?{queue:!0}:void 0);f.play()}return this},"animateImpl")},"animate"),stop:o(function(){return o(function(r,i){var n=this,a=n.length!==void 0,s=a?n:[n],l=this._private.cy||this;if(!l.styleEnabled())return this;for(var u=0;u<s.length;u++){for(var h=s[u],d=h._private,f=d.animation.current,p=0;p<f.length;p++){var m=f[p],g=m._private;i&&(g.duration=0)}r&&(d.animation.queue=[]),i||(d.animation.current=[])}return l.notify("draw"),this},"stopImpl")},"stop")};o(Q3,"requireIsArray");o(Wit,"require_isKey");o(qit,"requireIsFunction");o(Uit,"require_coreJsData");o(Hit,"require_isMasked");o(Yit,"require_toSource");o(jit,"require_baseIsNative");o(Xit,"require_getValue");o(CP,"require_getNative");o(J3,"require_nativeCreate");o(Kit,"require_hashClear");o(Zit,"require_hashDelete");o(Qit,"require_hashGet");o(Jit,"require_hashHas");o(ent,"require_hashSet");o(tnt,"require_Hash");o(rnt,"require_listCacheClear");o(Sme,"requireEq");o(eE,"require_assocIndexOf");o(int,"require_listCacheDelete");o(nnt,"require_listCacheGet");o(ant,"require_listCacheHas");o(snt,"require_listCacheSet");o(ont,"require_ListCache");o(lnt,"require_Map");o(cnt,"require_mapCacheClear");o(unt,"require_isKeyable");o(tE,"require_getMapData");o(hnt,"require_mapCacheDelete");o(dnt,"require_mapCacheGet");o(fnt,"require_mapCacheHas");o(pnt,"require_mapCacheSet");o(mnt,"require_MapCache");o(gnt,"requireMemoize");o(ynt,"require_memoizeCapped");o(Eme,"require_stringToPath");o(Ame,"require_arrayMap");o(vnt,"require_baseToString");o(_me,"requireToString");o(Dme,"require_castPath");o(kP,"require_toKey");o(xnt,"require_baseGet");o(bnt,"requireGet");Tnt=bnt(),Cnt=n2(Tnt);o(knt,"require_defineProperty");o(wnt,"require_baseAssignValue");o(Snt,"require_assignValue");o(Ent,"require_isIndex");o(Ant,"require_baseSet");o(_nt,"requireSet");Dnt=_nt(),Rnt=n2(Dnt);o(Lnt,"require_copyArray");o(Mnt,"requireToPath");Nnt=Mnt(),Int=n2(Nnt),Ont={data:o(function(t){var r={field:"data",bindingEvent:"data",allowBinding:!1,allowSetting:!1,allowGetting:!1,settingEvent:"data",settingTriggersEvent:!1,triggerFnName:"trigger",immutableKeys:{},updateStyle:!1,beforeGet:o(function(n){},"beforeGet"),beforeSet:o(function(n,a){},"beforeSet"),onSet:o(function(n){},"onSet"),canSet:o(function(n){return!0},"canSet")};return t=hr({},r,t),o(function(n,a){var s=t,l=this,u=l.length!==void 0,h=u?l:[l],d=u?l[0]:l;if(sr(n)){var f=n.indexOf(".")!==-1,p=f&&Int(n);if(s.allowGetting&&a===void 0){var m;return d&&(s.beforeGet(d),p&&d._private[s.field][n]===void 0?m=Cnt(d._private[s.field],p):m=d._private[s.field][n]),m}else if(s.allowSetting&&a!==void 0){var g=!s.immutableKeys[n];if(g){var y=q0e({},n,a);s.beforeSet(l,y);for(var v=0,x=h.length;v<x;v++){var b=h[v];s.canSet(b)&&(p&&d._private[s.field][n]===void 0?Rnt(b._private[s.field],p,a):b._private[s.field][n]=a)}s.updateStyle&&l.updateStyle(),s.onSet(l),s.settingTriggersEvent&&l[s.triggerFnName](s.settingEvent)}}}else if(s.allowSetting&&Xr(n)){var T=n,w,C,k=Object.keys(T);s.beforeSet(l,T);for(var E=0;E<k.length;E++){w=k[E],C=T[w];var A=!s.immutableKeys[w];if(A)for(var N=0;N<h.length;N++){var P=h[N];s.canSet(P)&&(P._private[s.field][w]=C)}}s.updateStyle&&l.updateStyle(),s.onSet(l),s.settingTriggersEvent&&l[s.triggerFnName](s.settingEvent)}else if(s.allowBinding&&Ji(n)){var I=n;l.on(s.bindingEvent,I)}else if(s.allowGetting&&n===void 0){var D;return d&&(s.beforeGet(d),D=d._private[s.field]),D}return l},"dataImpl")},"data"),removeData:o(function(t){var r={field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!1,immutableKeys:{}};return t=hr({},r,t),o(function(n){var a=t,s=this,l=s.length!==void 0,u=l?s:[s];if(sr(n)){for(var h=n.split(/\s+/),d=h.length,f=0;f<d;f++){var p=h[f];if(!qd(p)){var m=!a.immutableKeys[p];if(m)for(var g=0,y=u.length;g<y;g++)u[g]._private[a.field][p]=void 0}}a.triggerEvent&&s[a.triggerFnName](a.event)}else if(n===void 0){for(var v=0,x=u.length;v<x;v++)for(var b=u[v]._private[a.field],T=Object.keys(b),w=0;w<T.length;w++){var C=T[w],k=!a.immutableKeys[C];k&&(b[C]=void 0)}a.triggerEvent&&s[a.triggerFnName](a.event)}return s},"removeDataImpl")},"removeData")},Pnt={eventAliasesOn:o(function(t){var r=t;r.addListener=r.listen=r.bind=r.on,r.unlisten=r.unbind=r.off=r.removeListener,r.trigger=r.emit,r.pon=r.promiseOn=function(i,n){var a=this,s=Array.prototype.slice.call(arguments,0);return new v1(function(l,u){var h=o(function(m){a.off.apply(a,f),l(m)},"callback"),d=s.concat([h]),f=d.concat([]);a.on.apply(a,d)})}},"eventAliasesOn")},hi={};[Vit,Ont,Pnt].forEach(function(e){hr(hi,e)});Bnt={animate:hi.animate(),animation:hi.animation(),animated:hi.animated(),clearQueue:hi.clearQueue(),delay:hi.delay(),delayAnimation:hi.delayAnimation(),stop:hi.stop()},S3={classes:o(function(t){var r=this;if(t===void 0){var i=[];return r[0]._private.classes.forEach(function(g){return i.push(g)}),i}else Si(t)||(t=(t||"").match(/\S+/g)||[]);for(var n=[],a=new y1(t),s=0;s<r.length;s++){for(var l=r[s],u=l._private,h=u.classes,d=!1,f=0;f<t.length;f++){var p=t[f],m=h.has(p);if(!m){d=!0;break}}d||(d=h.size!==t.length),d&&(u.classes=a,n.push(l))}return n.length>0&&this.spawn(n).updateStyle().emit("class"),r},"classes"),addClass:o(function(t){return this.toggleClass(t,!0)},"addClass"),hasClass:o(function(t){var r=this[0];return r!=null&&r._private.classes.has(t)},"hasClass"),toggleClass:o(function(t,r){Si(t)||(t=t.match(/\S+/g)||[]);for(var i=this,n=r===void 0,a=[],s=0,l=i.length;s<l;s++)for(var u=i[s],h=u._private.classes,d=!1,f=0;f<t.length;f++){var p=t[f],m=h.has(p),g=!1;r||n&&!m?(h.add(p),g=!0):(!r||n&&m)&&(h.delete(p),g=!0),!d&&g&&(a.push(u),d=!0)}return a.length>0&&this.spawn(a).updateStyle().emit("class"),i},"toggleClass"),removeClass:o(function(t){return this.toggleClass(t,!1)},"removeClass"),flashClass:o(function(t,r){var i=this;if(r==null)r=250;else if(r===0)return i;return i.addClass(t),setTimeout(function(){i.removeClass(t)},r),i},"flashClass")};S3.className=S3.classNames=S3.classes;jr={metaChar:"[\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]",comparatorOp:"=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=",boolOp:"\\?|\\!|\\^",string:`"(?:\\\\"|[^"])*"|'(?:\\\\'|[^'])*'`,number:Vn,meta:"degree|indegree|outdegree",separator:"\\s*,\\s*",descendant:"\\s+",child:"\\s+>\\s+",subject:"\\$",group:"node|edge|\\*",directedEdge:"\\s+->\\s+",undirectedEdge:"\\s+<->\\s+"};jr.variable="(?:[\\w-.]|(?:\\\\"+jr.metaChar+"))+";jr.className="(?:[\\w-]|(?:\\\\"+jr.metaChar+"))+";jr.value=jr.string+"|"+jr.number;jr.id=jr.variable;(function(){var e,t,r;for(e=jr.comparatorOp.split("|"),r=0;r<e.length;r++)t=e[r],jr.comparatorOp+="|@"+t;for(e=jr.comparatorOp.split("|"),r=0;r<e.length;r++)t=e[r],!(t.indexOf("!")>=0)&&t!=="="&&(jr.comparatorOp+="|\\!"+t)})();xi=o(function(){return{checks:[]}},"newQuery"),Yt={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},ZO=[{selector:":selected",matches:o(function(t){return t.selected()},"matches")},{selector:":unselected",matches:o(function(t){return!t.selected()},"matches")},{selector:":selectable",matches:o(function(t){return t.selectable()},"matches")},{selector:":unselectable",matches:o(function(t){return!t.selectable()},"matches")},{selector:":locked",matches:o(function(t){return t.locked()},"matches")},{selector:":unlocked",matches:o(function(t){return!t.locked()},"matches")},{selector:":visible",matches:o(function(t){return t.visible()},"matches")},{selector:":hidden",matches:o(function(t){return!t.visible()},"matches")},{selector:":transparent",matches:o(function(t){return t.transparent()},"matches")},{selector:":grabbed",matches:o(function(t){return t.grabbed()},"matches")},{selector:":free",matches:o(function(t){return!t.grabbed()},"matches")},{selector:":removed",matches:o(function(t){return t.removed()},"matches")},{selector:":inside",matches:o(function(t){return!t.removed()},"matches")},{selector:":grabbable",matches:o(function(t){return t.grabbable()},"matches")},{selector:":ungrabbable",matches:o(function(t){return!t.grabbable()},"matches")},{selector:":animated",matches:o(function(t){return t.animated()},"matches")},{selector:":unanimated",matches:o(function(t){return!t.animated()},"matches")},{selector:":parent",matches:o(function(t){return t.isParent()},"matches")},{selector:":childless",matches:o(function(t){return t.isChildless()},"matches")},{selector:":child",matches:o(function(t){return t.isChild()},"matches")},{selector:":orphan",matches:o(function(t){return t.isOrphan()},"matches")},{selector:":nonorphan",matches:o(function(t){return t.isChild()},"matches")},{selector:":compound",matches:o(function(t){return t.isNode()?t.isParent():t.source().isParent()||t.target().isParent()},"matches")},{selector:":loop",matches:o(function(t){return t.isLoop()},"matches")},{selector:":simple",matches:o(function(t){return t.isSimple()},"matches")},{selector:":active",matches:o(function(t){return t.active()},"matches")},{selector:":inactive",matches:o(function(t){return!t.active()},"matches")},{selector:":backgrounding",matches:o(function(t){return t.backgrounding()},"matches")},{selector:":nonbackgrounding",matches:o(function(t){return!t.backgrounding()},"matches")}].sort(function(e,t){return Ott(e.selector,t.selector)}),Fnt=(function(){for(var e={},t,r=0;r<ZO.length;r++)t=ZO[r],e[t.selector]=t.matches;return e})(),$nt=o(function(t,r){return Fnt[t](r)},"stateSelectorMatches"),znt="("+ZO.map(function(e){return e.selector}).join("|")+")",Jg=o(function(t){return t.replace(new RegExp("\\\\("+jr.metaChar+")","g"),function(r,i){return i})},"cleanMetaChars"),Bd=o(function(t,r,i){t[t.length-1]=i},"replaceLastQuery"),QO=[{name:"group",query:!0,regex:"("+jr.group+")",populate:o(function(t,r,i){var n=Dn(i,1),a=n[0];r.checks.push({type:Yt.GROUP,value:a==="*"?a:a+"s"})},"populate")},{name:"state",query:!0,regex:znt,populate:o(function(t,r,i){var n=Dn(i,1),a=n[0];r.checks.push({type:Yt.STATE,value:a})},"populate")},{name:"id",query:!0,regex:"\\#("+jr.id+")",populate:o(function(t,r,i){var n=Dn(i,1),a=n[0];r.checks.push({type:Yt.ID,value:Jg(a)})},"populate")},{name:"className",query:!0,regex:"\\.("+jr.className+")",populate:o(function(t,r,i){var n=Dn(i,1),a=n[0];r.checks.push({type:Yt.CLASS,value:Jg(a)})},"populate")},{name:"dataExists",query:!0,regex:"\\[\\s*("+jr.variable+")\\s*\\]",populate:o(function(t,r,i){var n=Dn(i,1),a=n[0];r.checks.push({type:Yt.DATA_EXIST,field:Jg(a)})},"populate")},{name:"dataCompare",query:!0,regex:"\\[\\s*("+jr.variable+")\\s*("+jr.comparatorOp+")\\s*("+jr.value+")\\s*\\]",populate:o(function(t,r,i){var n=Dn(i,3),a=n[0],s=n[1],l=n[2],u=new RegExp("^"+jr.string+"$").exec(l)!=null;u?l=l.substring(1,l.length-1):l=parseFloat(l),r.checks.push({type:Yt.DATA_COMPARE,field:Jg(a),operator:s,value:l})},"populate")},{name:"dataBool",query:!0,regex:"\\[\\s*("+jr.boolOp+")\\s*("+jr.variable+")\\s*\\]",populate:o(function(t,r,i){var n=Dn(i,2),a=n[0],s=n[1];r.checks.push({type:Yt.DATA_BOOL,field:Jg(s),operator:a})},"populate")},{name:"metaCompare",query:!0,regex:"\\[\\[\\s*("+jr.meta+")\\s*("+jr.comparatorOp+")\\s*("+jr.number+")\\s*\\]\\]",populate:o(function(t,r,i){var n=Dn(i,3),a=n[0],s=n[1],l=n[2];r.checks.push({type:Yt.META_COMPARE,field:Jg(a),operator:s,value:parseFloat(l)})},"populate")},{name:"nextQuery",separator:!0,regex:jr.separator,populate:o(function(t,r){var i=t.currentSubject,n=t.edgeCount,a=t.compoundCount,s=t[t.length-1];i!=null&&(s.subject=i,t.currentSubject=null),s.edgeCount=n,s.compoundCount=a,t.edgeCount=0,t.compoundCount=0;var l=t[t.length++]=xi();return l},"populate")},{name:"directedEdge",separator:!0,regex:jr.directedEdge,populate:o(function(t,r){if(t.currentSubject==null){var i=xi(),n=r,a=xi();return i.checks.push({type:Yt.DIRECTED_EDGE,source:n,target:a}),Bd(t,r,i),t.edgeCount++,a}else{var s=xi(),l=r,u=xi();return s.checks.push({type:Yt.NODE_SOURCE,source:l,target:u}),Bd(t,r,s),t.edgeCount++,u}},"populate")},{name:"undirectedEdge",separator:!0,regex:jr.undirectedEdge,populate:o(function(t,r){if(t.currentSubject==null){var i=xi(),n=r,a=xi();return i.checks.push({type:Yt.UNDIRECTED_EDGE,nodes:[n,a]}),Bd(t,r,i),t.edgeCount++,a}else{var s=xi(),l=r,u=xi();return s.checks.push({type:Yt.NODE_NEIGHBOR,node:l,neighbor:u}),Bd(t,r,s),u}},"populate")},{name:"child",separator:!0,regex:jr.child,populate:o(function(t,r){if(t.currentSubject==null){var i=xi(),n=xi(),a=t[t.length-1];return i.checks.push({type:Yt.CHILD,parent:a,child:n}),Bd(t,r,i),t.compoundCount++,n}else if(t.currentSubject===r){var s=xi(),l=t[t.length-1],u=xi(),h=xi(),d=xi(),f=xi();return s.checks.push({type:Yt.COMPOUND_SPLIT,left:l,right:u,subject:h}),h.checks=r.checks,r.checks=[{type:Yt.TRUE}],f.checks.push({type:Yt.TRUE}),u.checks.push({type:Yt.PARENT,parent:f,child:d}),Bd(t,l,s),t.currentSubject=h,t.compoundCount++,d}else{var p=xi(),m=xi(),g=[{type:Yt.PARENT,parent:p,child:m}];return p.checks=r.checks,r.checks=g,t.compoundCount++,m}},"populate")},{name:"descendant",separator:!0,regex:jr.descendant,populate:o(function(t,r){if(t.currentSubject==null){var i=xi(),n=xi(),a=t[t.length-1];return i.checks.push({type:Yt.DESCENDANT,ancestor:a,descendant:n}),Bd(t,r,i),t.compoundCount++,n}else if(t.currentSubject===r){var s=xi(),l=t[t.length-1],u=xi(),h=xi(),d=xi(),f=xi();return s.checks.push({type:Yt.COMPOUND_SPLIT,left:l,right:u,subject:h}),h.checks=r.checks,r.checks=[{type:Yt.TRUE}],f.checks.push({type:Yt.TRUE}),u.checks.push({type:Yt.ANCESTOR,ancestor:f,descendant:d}),Bd(t,l,s),t.currentSubject=h,t.compoundCount++,d}else{var p=xi(),m=xi(),g=[{type:Yt.ANCESTOR,ancestor:p,descendant:m}];return p.checks=r.checks,r.checks=g,t.compoundCount++,m}},"populate")},{name:"subject",modifier:!0,regex:jr.subject,populate:o(function(t,r){if(t.currentSubject!=null&&t.currentSubject!==r)return di("Redefinition of subject in selector `"+t.toString()+"`"),!1;t.currentSubject=r;var i=t[t.length-1],n=i.checks[0],a=n==null?null:n.type;a===Yt.DIRECTED_EDGE?n.type=Yt.NODE_TARGET:a===Yt.UNDIRECTED_EDGE&&(n.type=Yt.NODE_NEIGHBOR,n.node=n.nodes[1],n.neighbor=n.nodes[0],n.nodes=null)},"populate")}];QO.forEach(function(e){return e.regexObj=new RegExp("^"+e.regex)});Gnt=o(function(t){for(var r,i,n,a=0;a<QO.length;a++){var s=QO[a],l=s.name,u=t.match(s.regexObj);if(u!=null){i=u,r=s,n=l;var h=u[0];t=t.substring(h.length);break}}return{expr:r,match:i,name:n,remaining:t}},"consumeExpr"),Vnt=o(function(t){var r=t.match(/^\s+/);if(r){var i=r[0];t=t.substring(i.length)}return t},"consumeWhitespace"),Wnt=o(function(t){var r=this,i=r.inputText=t,n=r[0]=xi();for(r.length=1,i=Vnt(i);;){var a=Gnt(i);if(a.expr==null)return di("The selector `"+t+"`is invalid"),!1;var s=a.match.slice(1),l=a.expr.populate(r,n,s);if(l===!1)return!1;if(l!=null&&(n=l),i=a.remaining,i.match(/^\s*$/))break}var u=r[r.length-1];r.currentSubject!=null&&(u.subject=r.currentSubject),u.edgeCount=r.edgeCount,u.compoundCount=r.compoundCount;for(var h=0;h<r.length;h++){var d=r[h];if(d.compoundCount>0&&d.edgeCount>0)return di("The selector `"+t+"` is invalid because it uses both a compound selector and an edge selector"),!1;if(d.edgeCount>1)return di("The selector `"+t+"` is invalid because it uses multiple edge selectors"),!1;d.edgeCount===1&&di("The selector `"+t+"` 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},"parse"),qnt=o(function(){if(this.toStringCache!=null)return this.toStringCache;for(var t=o(function(d){return d??""},"clean"),r=o(function(d){return sr(d)?'"'+d+'"':t(d)},"cleanVal"),i=o(function(d){return" "+d+" "},"space"),n=o(function(d,f){var p=d.type,m=d.value;switch(p){case Yt.GROUP:{var g=t(m);return g.substring(0,g.length-1)}case Yt.DATA_COMPARE:{var y=d.field,v=d.operator;return"["+y+i(t(v))+r(m)+"]"}case Yt.DATA_BOOL:{var x=d.operator,b=d.field;return"["+t(x)+b+"]"}case Yt.DATA_EXIST:{var T=d.field;return"["+T+"]"}case Yt.META_COMPARE:{var w=d.operator,C=d.field;return"[["+C+i(t(w))+r(m)+"]]"}case Yt.STATE:return m;case Yt.ID:return"#"+m;case Yt.CLASS:return"."+m;case Yt.PARENT:case Yt.CHILD:return a(d.parent,f)+i(">")+a(d.child,f);case Yt.ANCESTOR:case Yt.DESCENDANT:return a(d.ancestor,f)+" "+a(d.descendant,f);case Yt.COMPOUND_SPLIT:{var k=a(d.left,f),E=a(d.subject,f),A=a(d.right,f);return k+(k.length>0?" ":"")+E+A}case Yt.TRUE:return""}},"checkToString"),a=o(function(d,f){return d.checks.reduce(function(p,m,g){return p+(f===d&&g===0?"$":"")+n(m,f)},"")},"queryToString"),s="",l=0;l<this.length;l++){var u=this[l];s+=a(u,u.subject),this.length>1&&l<this.length-1&&(s+=", ")}return this.toStringCache=s,s},"toString"),Unt={parse:Wnt,toString:qnt},Rme=o(function(t,r,i){var n,a=sr(t),s=Ot(t),l=sr(i),u,h,d=!1,f=!1,p=!1;switch(r.indexOf("!")>=0&&(r=r.replace("!",""),f=!0),r.indexOf("@")>=0&&(r=r.replace("@",""),d=!0),(a||l||d)&&(u=!a&&!s?"":""+t,h=""+i),d&&(t=u=u.toLowerCase(),i=h=h.toLowerCase()),r){case"*=":n=u.indexOf(h)>=0;break;case"$=":n=u.indexOf(h,u.length-h.length)>=0;break;case"^=":n=u.indexOf(h)===0;break;case"=":n=t===i;break;case">":p=!0,n=t>i;break;case">=":p=!0,n=t>=i;break;case"<":p=!0,n=t<i;break;case"<=":p=!0,n=t<=i;break;default:n=!1;break}return f&&(t!=null||!p)&&(n=!n),n},"valCmp"),Hnt=o(function(t,r){switch(r){case"?":return!!t;case"!":return!t;case"^":return t===void 0}},"boolCmp"),Ynt=o(function(t){return t!==void 0},"existCmp"),wP=o(function(t,r){return t.data(r)},"data"),jnt=o(function(t,r){return t[r]()},"meta"),un=[],zi=o(function(t,r){return t.checks.every(function(i){return un[i.type](i,r)})},"matches");un[Yt.GROUP]=function(e,t){var r=e.value;return r==="*"||r===t.group()};un[Yt.STATE]=function(e,t){var r=e.value;return $nt(r,t)};un[Yt.ID]=function(e,t){var r=e.value;return t.id()===r};un[Yt.CLASS]=function(e,t){var r=e.value;return t.hasClass(r)};un[Yt.META_COMPARE]=function(e,t){var r=e.field,i=e.operator,n=e.value;return Rme(jnt(t,r),i,n)};un[Yt.DATA_COMPARE]=function(e,t){var r=e.field,i=e.operator,n=e.value;return Rme(wP(t,r),i,n)};un[Yt.DATA_BOOL]=function(e,t){var r=e.field,i=e.operator;return Hnt(wP(t,r),i)};un[Yt.DATA_EXIST]=function(e,t){var r=e.field;return e.operator,Ynt(wP(t,r))};un[Yt.UNDIRECTED_EDGE]=function(e,t){var r=e.nodes[0],i=e.nodes[1],n=t.source(),a=t.target();return zi(r,n)&&zi(i,a)||zi(i,n)&&zi(r,a)};un[Yt.NODE_NEIGHBOR]=function(e,t){return zi(e.node,t)&&t.neighborhood().some(function(r){return r.isNode()&&zi(e.neighbor,r)})};un[Yt.DIRECTED_EDGE]=function(e,t){return zi(e.source,t.source())&&zi(e.target,t.target())};un[Yt.NODE_SOURCE]=function(e,t){return zi(e.source,t)&&t.outgoers().some(function(r){return r.isNode()&&zi(e.target,r)})};un[Yt.NODE_TARGET]=function(e,t){return zi(e.target,t)&&t.incomers().some(function(r){return r.isNode()&&zi(e.source,r)})};un[Yt.CHILD]=function(e,t){return zi(e.child,t)&&zi(e.parent,t.parent())};un[Yt.PARENT]=function(e,t){return zi(e.parent,t)&&t.children().some(function(r){return zi(e.child,r)})};un[Yt.DESCENDANT]=function(e,t){return zi(e.descendant,t)&&t.ancestors().some(function(r){return zi(e.ancestor,r)})};un[Yt.ANCESTOR]=function(e,t){return zi(e.ancestor,t)&&t.descendants().some(function(r){return zi(e.descendant,r)})};un[Yt.COMPOUND_SPLIT]=function(e,t){return zi(e.subject,t)&&zi(e.left,t)&&zi(e.right,t)};un[Yt.TRUE]=function(){return!0};un[Yt.COLLECTION]=function(e,t){var r=e.value;return r.has(t)};un[Yt.FILTER]=function(e,t){var r=e.value;return r(t)};Xnt=o(function(t){var r=this;if(r.length===1&&r[0].checks.length===1&&r[0].checks[0].type===Yt.ID)return t.getElementById(r[0].checks[0].value).collection();var i=o(function(a){for(var s=0;s<r.length;s++){var l=r[s];if(zi(l,a))return!0}return!1},"selectorFunction");return r.text()==null&&(i=o(function(){return!0},"selectorFunction")),t.filter(i)},"filter"),Knt=o(function(t){for(var r=this,i=0;i<r.length;i++){var n=r[i];if(zi(n,t))return!0}return!1},"matches"),Znt={matches:Knt,filter:Xnt},Yd=o(function(t){this.inputText=t,this.currentSubject=null,this.compoundCount=0,this.edgeCount=0,this.length=0,t==null||sr(t)&&t.match(/^\s*$/)||(uo(t)?this.addQuery({checks:[{type:Yt.COLLECTION,value:t.collection()}]}):Ji(t)?this.addQuery({checks:[{type:Yt.FILTER,value:t}]}):sr(t)?this.parse(t)||(this.invalid=!0):Yi("A selector must be created from a string; found "))},"Selector"),jd=Yd.prototype;[Unt,Znt].forEach(function(e){return hr(jd,e)});jd.text=function(){return this.inputText};jd.size=function(){return this.length};jd.eq=function(e){return this[e]};jd.sameText=function(e){return!this.invalid&&!e.invalid&&this.text()===e.text()};jd.addQuery=function(e){this[this.length++]=e};jd.selector=jd.toString;Vd={allAre:o(function(t){var r=new Yd(t);return this.every(function(i){return r.matches(i)})},"allAre"),is:o(function(t){var r=new Yd(t);return this.some(function(i){return r.matches(i)})},"is"),some:o(function(t,r){for(var i=0;i<this.length;i++){var n=r?t.apply(r,[this[i],i,this]):t(this[i],i,this);if(n)return!0}return!1},"some"),every:o(function(t,r){for(var i=0;i<this.length;i++){var n=r?t.apply(r,[this[i],i,this]):t(this[i],i,this);if(!n)return!1}return!0},"every"),same:o(function(t){if(this===t)return!0;t=this.cy().collection(t);var r=this.length,i=t.length;return r!==i?!1:r===1?this[0]===t[0]:this.every(function(n){return t.hasElementWithId(n.id())})},"same"),anySame:o(function(t){return t=this.cy().collection(t),this.some(function(r){return t.hasElementWithId(r.id())})},"anySame"),allAreNeighbors:o(function(t){t=this.cy().collection(t);var r=this.neighborhood();return t.every(function(i){return r.hasElementWithId(i.id())})},"allAreNeighbors"),contains:o(function(t){t=this.cy().collection(t);var r=this;return t.every(function(i){return r.hasElementWithId(i.id())})},"contains")};Vd.allAreNeighbours=Vd.allAreNeighbors;Vd.has=Vd.contains;Vd.equal=Vd.equals=Vd.same;Xo=o(function(t,r){return o(function(n,a,s,l){var u=n,h=this,d;if(u==null?d="":uo(u)&&u.length===1&&(d=u.id()),h.length===1&&d){var f=h[0]._private,p=f.traversalCache=f.traversalCache||{},m=p[r]=p[r]||[],g=Jp(d),y=m[g];return y||(m[g]=t.call(h,n,a,s,l))}else return t.call(h,n,a,s,l)},"traversalCache")},"cache"),g1={parent:o(function(t){var r=[];if(this.length===1){var i=this[0]._private.parent;if(i)return i}for(var n=0;n<this.length;n++){var a=this[n],s=a._private.parent;s&&r.push(s)}return this.spawn(r,!0).filter(t)},"parent"),parents:o(function(t){for(var r=[],i=this.parent();i.nonempty();){for(var n=0;n<i.length;n++){var a=i[n];r.push(a)}i=i.parent()}return this.spawn(r,!0).filter(t)},"parents"),commonAncestors:o(function(t){for(var r,i=0;i<this.length;i++){var n=this[i],a=n.parents();r=r||a,r=r.intersect(a)}return r.filter(t)},"commonAncestors"),orphans:o(function(t){return this.stdFilter(function(r){return r.isOrphan()}).filter(t)},"orphans"),nonorphans:o(function(t){return this.stdFilter(function(r){return r.isChild()}).filter(t)},"nonorphans"),children:Xo(function(e){for(var t=[],r=0;r<this.length;r++)for(var i=this[r],n=i._private.children,a=0;a<n.length;a++)t.push(n[a]);return this.spawn(t,!0).filter(e)},"children"),siblings:o(function(t){return this.parent().children().not(this).filter(t)},"siblings"),isParent:o(function(){var t=this[0];if(t)return t.isNode()&&t._private.children.length!==0},"isParent"),isChildless:o(function(){var t=this[0];if(t)return t.isNode()&&t._private.children.length===0},"isChildless"),isChild:o(function(){var t=this[0];if(t)return t.isNode()&&t._private.parent!=null},"isChild"),isOrphan:o(function(){var t=this[0];if(t)return t.isNode()&&t._private.parent==null},"isOrphan"),descendants:o(function(t){var r=[];function i(n){for(var a=0;a<n.length;a++){var s=n[a];r.push(s),s.children().nonempty()&&i(s.children())}}return o(i,"add"),i(this.children()),this.spawn(r,!0).filter(t)},"descendants")};o(SP,"forEachCompound");o(Lme,"addChildren");g1.forEachDown=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return SP(this,e,t,Lme)};o(Mme,"addParent");g1.forEachUp=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return SP(this,e,t,Mme)};o(Qnt,"addParentAndChildren");g1.forEachUpAndDown=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return SP(this,e,t,Qnt)};g1.ancestors=g1.parents;Zb=Nme={data:hi.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:hi.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),scratch:hi.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:hi.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),rscratch:hi.data({field:"rscratch",allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!0}),removeRscratch:hi.removeData({field:"rscratch",triggerEvent:!1}),id:o(function(){var t=this[0];if(t)return t._private.data.id},"id")};Zb.attr=Zb.data;Zb.removeAttr=Zb.removeData;Jnt=Nme,rE={};o(MO,"defineDegreeFunction");hr(rE,{degree:MO(function(e,t){return t.source().same(t.target())?2:1}),indegree:MO(function(e,t){return t.target().same(e)?1:0}),outdegree:MO(function(e,t){return t.source().same(e)?1:0})});o(e1,"defineDegreeBoundsFunction");hr(rE,{minDegree:e1("degree",function(e,t){return e<t}),maxDegree:e1("degree",function(e,t){return e>t}),minIndegree:e1("indegree",function(e,t){return e<t}),maxIndegree:e1("indegree",function(e,t){return e>t}),minOutdegree:e1("outdegree",function(e,t){return e<t}),maxOutdegree:e1("outdegree",function(e,t){return e>t})});hr(rE,{totalDegree:o(function(t){for(var r=0,i=this.nodes(),n=0;n<i.length;n++)r+=i[n].degree(t);return r},"totalDegree")});Ome=o(function(t,r,i){for(var n=0;n<t.length;n++){var a=t[n];if(!a.locked()){var s=a._private.position,l={x:r.x!=null?r.x-s.x:0,y:r.y!=null?r.y-s.y:0};a.isParent()&&!(l.x===0&&l.y===0)&&a.children().shift(l,i),a.dirtyBoundingBoxCache()}}},"beforePositionSet"),Qpe={field:"position",bindingEvent:"position",allowBinding:!0,allowSetting:!0,settingEvent:"position",settingTriggersEvent:!0,triggerFnName:"emitAndNotify",allowGetting:!0,validKeys:["x","y"],beforeGet:o(function(t){t.updateCompoundBounds()},"beforeGet"),beforeSet:o(function(t,r){Ome(t,r,!1)},"beforeSet"),onSet:o(function(t){t.dirtyCompoundBoundsCache()},"onSet"),canSet:o(function(t){return!t.locked()},"canSet")};Fl=Ime={position:hi.data(Qpe),silentPosition:hi.data(hr({},Qpe,{allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!1,beforeSet:o(function(t,r){Ome(t,r,!0)},"beforeSet"),onSet:o(function(t){t.dirtyCompoundBoundsCache()},"onSet")})),positions:o(function(t,r){if(Xr(t))r?this.silentPosition(t):this.position(t);else if(Ji(t)){var i=t,n=this.cy();n.startBatch();for(var a=0;a<this.length;a++){var s=this[a],l=void 0;(l=i(s,a))&&(r?s.silentPosition(l):s.position(l))}n.endBatch()}return this},"positions"),silentPositions:o(function(t){return this.positions(t,!0)},"silentPositions"),shift:o(function(t,r,i){var n;if(Xr(t)?(n={x:Ot(t.x)?t.x:0,y:Ot(t.y)?t.y:0},i=r):sr(t)&&Ot(r)&&(n={x:0,y:0},n[t]=r),n!=null){var a=this.cy();a.startBatch();for(var s=0;s<this.length;s++){var l=this[s];if(!(a.hasCompoundNodes()&&l.isChild()&&l.ancestors().anySame(this))){var u=l.position(),h={x:u.x+n.x,y:u.y+n.y};i?l.silentPosition(h):l.position(h)}}a.endBatch()}return this},"shift"),silentShift:o(function(t,r){return Xr(t)?this.shift(t,!0):sr(t)&&Ot(r)&&this.shift(t,r,!0),this},"silentShift"),renderedPosition:o(function(t,r){var i=this[0],n=this.cy(),a=n.zoom(),s=n.pan(),l=Xr(t)?t:void 0,u=l!==void 0||r!==void 0&&sr(t);if(i&&i.isNode())if(u)for(var h=0;h<this.length;h++){var d=this[h];r!==void 0?d.position(t,(r-s[t])/a):l!==void 0&&d.position(cme(l,a,s))}else{var f=i.position();return l=K3(f,a,s),t===void 0?l:l[t]}else if(!u)return;return this},"renderedPosition"),relativePosition:o(function(t,r){var i=this[0],n=this.cy(),a=Xr(t)?t:void 0,s=a!==void 0||r!==void 0&&sr(t),l=n.hasCompoundNodes();if(i&&i.isNode())if(s)for(var u=0;u<this.length;u++){var h=this[u],d=l?h.parent():null,f=d&&d.length>0,p=f;f&&(d=d[0]);var m=p?d.position():{x:0,y:0};r!==void 0?h.position(t,r+m[t]):a!==void 0&&h.position({x:a.x+m.x,y:a.y+m.y})}else{var g=i.position(),y=l?i.parent():null,v=y&&y.length>0,x=v;v&&(y=y[0]);var b=x?y.position():{x:0,y:0};return a={x:g.x-b.x,y:g.y-b.y},t===void 0?a:a[t]}else if(!s)return;return this},"relativePosition")};Fl.modelPosition=Fl.point=Fl.position;Fl.modelPositions=Fl.points=Fl.positions;Fl.renderedPoint=Fl.renderedPosition;Fl.relativePoint=Fl.relativePosition;eat=Ime;f1=Qd={};Qd.renderedBoundingBox=function(e){var t=this.boundingBox(e),r=this.cy(),i=r.zoom(),n=r.pan(),a=t.x1*i+n.x,s=t.x2*i+n.x,l=t.y1*i+n.y,u=t.y2*i+n.y;return{x1:a,x2:s,y1:l,y2:u,w:s-a,h:u-l}};Qd.dirtyCompoundBoundsCache=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,t=this.cy();return!t.styleEnabled()||!t.hasCompoundNodes()?this:(this.forEachUp(function(r){if(r.isParent()){var i=r._private;i.compoundBoundsClean=!1,i.bbCache=null,e||r.emitAndNotify("bounds")}}),this)};Qd.updateCompoundBounds=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,t=this.cy();if(!t.styleEnabled()||!t.hasCompoundNodes())return this;if(!e&&t.batching())return this;function r(s){if(!s.isParent())return;var l=s._private,u=s.children(),h=s.pstyle("compound-sizing-wrt-labels").value==="include",d={width:{val:s.pstyle("min-width").pfValue,left:s.pstyle("min-width-bias-left"),right:s.pstyle("min-width-bias-right")},height:{val:s.pstyle("min-height").pfValue,top:s.pstyle("min-height-bias-top"),bottom:s.pstyle("min-height-bias-bottom")}},f=u.boundingBox({includeLabels:h,includeOverlays:!1,useCache:!1}),p=l.position;(f.w===0||f.h===0)&&(f={w:s.pstyle("width").pfValue,h:s.pstyle("height").pfValue},f.x1=p.x-f.w/2,f.x2=p.x+f.w/2,f.y1=p.y-f.h/2,f.y2=p.y+f.h/2);function m(N,P,I){var D=0,_=0,R=P+I;return N>0&&R>0&&(D=P/R*N,_=I/R*N),{biasDiff:D,biasComplementDiff:_}}o(m,"computeBiasValues");function g(N,P,I,D){if(I.units==="%")switch(D){case"width":return N>0?I.pfValue*N:0;case"height":return P>0?I.pfValue*P:0;case"average":return N>0&&P>0?I.pfValue*(N+P)/2:0;case"min":return N>0&&P>0?N>P?I.pfValue*P:I.pfValue*N:0;case"max":return N>0&&P>0?N>P?I.pfValue*N:I.pfValue*P:0;default:return 0}else return I.units==="px"?I.pfValue:0}o(g,"computePaddingValues");var y=d.width.left.value;d.width.left.units==="px"&&d.width.val>0&&(y=y*100/d.width.val);var v=d.width.right.value;d.width.right.units==="px"&&d.width.val>0&&(v=v*100/d.width.val);var x=d.height.top.value;d.height.top.units==="px"&&d.height.val>0&&(x=x*100/d.height.val);var b=d.height.bottom.value;d.height.bottom.units==="px"&&d.height.val>0&&(b=b*100/d.height.val);var T=m(d.width.val-f.w,y,v),w=T.biasDiff,C=T.biasComplementDiff,k=m(d.height.val-f.h,x,b),E=k.biasDiff,A=k.biasComplementDiff;l.autoPadding=g(f.w,f.h,s.pstyle("padding"),s.pstyle("padding-relative-to").value),l.autoWidth=Math.max(f.w,d.width.val),p.x=(-w+f.x1+f.x2+C)/2,l.autoHeight=Math.max(f.h,d.height.val),p.y=(-E+f.y1+f.y2+A)/2}o(r,"update");for(var i=0;i<this.length;i++){var n=this[i],a=n._private;(!a.compoundBoundsClean||e)&&(r(n),t.batching()||(a.compoundBoundsClean=!0))}return this};jo=o(function(t){return t===1/0||t===-1/0?0:t},"noninf"),Bl=o(function(t,r,i,n,a){n-r===0||a-i===0||r==null||i==null||n==null||a==null||(t.x1=r<t.x1?r:t.x1,t.x2=n>t.x2?n:t.x2,t.y1=i<t.y1?i:t.y1,t.y2=a>t.y2?a:t.y2,t.w=t.x2-t.x1,t.h=t.y2-t.y1)},"updateBounds"),Fd=o(function(t,r){return r==null?t:Bl(t,r.x1,r.y1,r.x2,r.y2)},"updateBoundsFromBox"),Ib=o(function(t,r,i){return Ps(t,r,i)},"prefixedProperty"),m3=o(function(t,r,i){if(!r.cy().headless()){var n=r._private,a=n.rstyle,s=a.arrowWidth/2,l=r.pstyle(i+"-arrow-shape").value,u,h;if(l!=="none"){i==="source"?(u=a.srcX,h=a.srcY):i==="target"?(u=a.tgtX,h=a.tgtY):(u=a.midX,h=a.midY);var d=n.arrowBounds=n.arrowBounds||{},f=d[i]=d[i]||{};f.x1=u-s,f.y1=h-s,f.x2=u+s,f.y2=h+s,f.w=f.x2-f.x1,f.h=f.y2-f.y1,k3(f,1),Bl(t,f.x1,f.y1,f.x2,f.y2)}}},"updateBoundsFromArrow"),NO=o(function(t,r,i){if(!r.cy().headless()){var n;i?n=i+"-":n="";var a=r._private,s=a.rstyle,l=r.pstyle(n+"label").strValue;if(l){var u=r.pstyle("text-halign"),h=r.pstyle("text-valign"),d=Ib(s,"labelWidth",i),f=Ib(s,"labelHeight",i),p=Ib(s,"labelX",i),m=Ib(s,"labelY",i),g=r.pstyle(n+"text-margin-x").pfValue,y=r.pstyle(n+"text-margin-y").pfValue,v=r.isEdge(),x=r.pstyle(n+"text-rotation"),b=r.pstyle("text-outline-width").pfValue,T=r.pstyle("text-border-width").pfValue,w=T/2,C=r.pstyle("text-background-padding").pfValue,k=2,E=f,A=d,N=A/2,P=E/2,I,D,_,R;if(v)I=p-N,D=p+N,_=m-P,R=m+P;else{switch(u.value){case"left":I=p-A,D=p;break;case"center":I=p-N,D=p+N;break;case"right":I=p,D=p+A;break}switch(h.value){case"top":_=m-E,R=m;break;case"center":_=m-P,R=m+P;break;case"bottom":_=m,R=m+E;break}}var M=g-Math.max(b,w)-C-k,L=g+Math.max(b,w)+C+k,B=y-Math.max(b,w)-C-k,O=y+Math.max(b,w)+C+k;I+=M,D+=L,_+=B,R+=O;var $=i||"main",G=a.labelBounds,F=G[$]=G[$]||{};F.x1=I,F.y1=_,F.x2=D,F.y2=R,F.w=D-I,F.h=R-_,F.leftPad=M,F.rightPad=L,F.topPad=B,F.botPad=O;var V=v&&x.strValue==="autorotate",H=x.pfValue!=null&&x.pfValue!==0;if(V||H){var j=V?Ib(a.rstyle,"labelAngle",i):x.pfValue,U=Math.cos(j),Q=Math.sin(j),Y=(I+D)/2,ae=(_+R)/2;if(!v){switch(u.value){case"left":Y=D;break;case"right":Y=I;break}switch(h.value){case"top":ae=R;break;case"bottom":ae=_;break}}var J=o(function(Ee,we){return Ee=Ee-Y,we=we-ae,{x:Ee*U-we*Q+Y,y:Ee*Q+we*U+ae}},"rotate"),te=J(I,_),re=J(I,R),ee=J(D,_),Te=J(D,R);I=Math.min(te.x,re.x,ee.x,Te.x),D=Math.max(te.x,re.x,ee.x,Te.x),_=Math.min(te.y,re.y,ee.y,Te.y),R=Math.max(te.y,re.y,ee.y,Te.y)}var ue=$+"Rot",De=G[ue]=G[ue]||{};De.x1=I,De.y1=_,De.x2=D,De.y2=R,De.w=D-I,De.h=R-_,Bl(t,I,_,D,R),Bl(a.labelBounds.all,I,_,D,R)}return t}},"updateBoundsFromLabel"),Jpe=o(function(t,r){if(!r.cy().headless()){var i=r.pstyle("outline-opacity").value,n=r.pstyle("outline-width").value,a=r.pstyle("outline-offset").value,s=n+a;Pme(t,r,i,s,"outside",s/2)}},"updateBoundsFromOutline"),Pme=o(function(t,r,i,n,a,s){if(!(i===0||n<=0||a==="inside")){var l=r.cy(),u=r.pstyle("shape").value,h=l.renderer().nodeShapes[u],d=r.position(),f=d.x,p=d.y,m=r.width(),g=r.height();if(h.hasMiterBounds){a==="center"&&(n/=2);var y=h.miterBounds(f,p,m,g,n);Fd(t,y)}else s!=null&&s>0&&w3(t,[s,s,s,s])}},"updateBoundsFromMiter"),tat=o(function(t,r){if(!r.cy().headless()){var i=r.pstyle("border-opacity").value,n=r.pstyle("border-width").pfValue,a=r.pstyle("border-position").value;Pme(t,r,i,n,a)}},"updateBoundsFromMiterBorder"),rat=o(function(t,r){var i=t._private.cy,n=i.styleEnabled(),a=i.headless(),s=is(),l=t._private,u=t.isNode(),h=t.isEdge(),d,f,p,m,g,y,v=l.rstyle,x=u&&n?t.pstyle("bounds-expansion").pfValue:[0],b=o(function(Ie){return Ie.pstyle("display").value!=="none"},"isDisplayed"),T=!n||b(t)&&(!h||b(t.source())&&b(t.target()));if(T){var w=0,C=0;n&&r.includeOverlays&&(w=t.pstyle("overlay-opacity").value,w!==0&&(C=t.pstyle("overlay-padding").value));var k=0,E=0;n&&r.includeUnderlays&&(k=t.pstyle("underlay-opacity").value,k!==0&&(E=t.pstyle("underlay-padding").value));var A=Math.max(C,E),N=0,P=0;if(n&&(N=t.pstyle("width").pfValue,P=N/2),u&&r.includeNodes){var I=t.position();g=I.x,y=I.y;var D=t.outerWidth(),_=D/2,R=t.outerHeight(),M=R/2;d=g-_,f=g+_,p=y-M,m=y+M,Bl(s,d,p,f,m),n&&Jpe(s,t),n&&r.includeOutlines&&!a&&Jpe(s,t),n&&tat(s,t)}else if(h&&r.includeEdges)if(n&&!a){var L=t.pstyle("curve-style").strValue;if(d=Math.min(v.srcX,v.midX,v.tgtX),f=Math.max(v.srcX,v.midX,v.tgtX),p=Math.min(v.srcY,v.midY,v.tgtY),m=Math.max(v.srcY,v.midY,v.tgtY),d-=P,f+=P,p-=P,m+=P,Bl(s,d,p,f,m),L==="haystack"){var B=v.haystackPts;if(B&&B.length===2){if(d=B[0].x,p=B[0].y,f=B[1].x,m=B[1].y,d>f){var O=d;d=f,f=O}if(p>m){var $=p;p=m,m=$}Bl(s,d-P,p-P,f+P,m+P)}}else if(L==="bezier"||L==="unbundled-bezier"||$d(L,"segments")||$d(L,"taxi")){var G;switch(L){case"bezier":case"unbundled-bezier":G=v.bezierPts;break;case"segments":case"taxi":case"round-segments":case"round-taxi":G=v.linePts;break}if(G!=null)for(var F=0;F<G.length;F++){var V=G[F];d=V.x-P,f=V.x+P,p=V.y-P,m=V.y+P,Bl(s,d,p,f,m)}}}else{var H=t.source(),j=H.position(),U=t.target(),Q=U.position();if(d=j.x,f=Q.x,p=j.y,m=Q.y,d>f){var Y=d;d=f,f=Y}if(p>m){var ae=p;p=m,m=ae}d-=P,f+=P,p-=P,m+=P,Bl(s,d,p,f,m)}if(n&&r.includeEdges&&h&&(m3(s,t,"mid-source"),m3(s,t,"mid-target"),m3(s,t,"source"),m3(s,t,"target")),n){var J=t.pstyle("ghost").value==="yes";if(J){var te=t.pstyle("ghost-offset-x").pfValue,re=t.pstyle("ghost-offset-y").pfValue;Bl(s,s.x1+te,s.y1+re,s.x2+te,s.y2+re)}}var ee=l.bodyBounds=l.bodyBounds||{};Ffe(ee,s),w3(ee,x),k3(ee,1),n&&(d=s.x1,f=s.x2,p=s.y1,m=s.y2,Bl(s,d-A,p-A,f+A,m+A));var Te=l.overlayBounds=l.overlayBounds||{};Ffe(Te,s),w3(Te,x),k3(Te,1);var ue=l.labelBounds=l.labelBounds||{};ue.all!=null?Brt(ue.all):ue.all=is(),n&&r.includeLabels&&(r.includeMainLabels&&NO(s,t,null),h&&(r.includeSourceLabels&&NO(s,t,"source"),r.includeTargetLabels&&NO(s,t,"target")))}return s.x1=jo(s.x1),s.y1=jo(s.y1),s.x2=jo(s.x2),s.y2=jo(s.y2),s.w=jo(s.x2-s.x1),s.h=jo(s.y2-s.y1),s.w>0&&s.h>0&&T&&(w3(s,x),k3(s,1)),s},"boundingBoxImpl"),Bme=o(function(t){var r=0,i=o(function(s){return(s?1:0)<<r++},"tf"),n=0;return n+=i(t.incudeNodes),n+=i(t.includeEdges),n+=i(t.includeLabels),n+=i(t.includeMainLabels),n+=i(t.includeSourceLabels),n+=i(t.includeTargetLabels),n+=i(t.includeOverlays),n+=i(t.includeOutlines),n},"getKey"),Fme=o(function(t){var r=o(function(l){return Math.round(l)},"r");if(t.isEdge()){var i=t.source().position(),n=t.target().position();return Mfe([r(i.x),r(i.y),r(n.x),r(n.y)])}else{var a=t.position();return Mfe([r(a.x),r(a.y)])}},"getBoundingBoxPosKey"),e0e=o(function(t,r){var i=t._private,n,a=t.isEdge(),s=r==null?t0e:Bme(r),l=s===t0e;if(i.bbCache==null?(n=rat(t,Qb),i.bbCache=n,i.bbCachePosKey=Fme(t)):n=i.bbCache,!l){var u=t.isNode();n=is(),(r.includeNodes&&u||r.includeEdges&&!u)&&(r.includeOverlays?Fd(n,i.overlayBounds):Fd(n,i.bodyBounds)),r.includeLabels&&(r.includeMainLabels&&(!a||r.includeSourceLabels&&r.includeTargetLabels)?Fd(n,i.labelBounds.all):(r.includeMainLabels&&Fd(n,i.labelBounds.mainRot),r.includeSourceLabels&&Fd(n,i.labelBounds.sourceRot),r.includeTargetLabels&&Fd(n,i.labelBounds.targetRot))),n.w=n.x2-n.x1,n.h=n.y2-n.y1}return n},"cachedBoundingBoxImpl"),Qb={includeNodes:!0,includeEdges:!0,includeLabels:!0,includeMainLabels:!0,includeSourceLabels:!0,includeTargetLabels:!0,includeOverlays:!0,includeUnderlays:!0,includeOutlines:!0,useCache:!0},t0e=Bme(Qb),r0e=va(Qb);Qd.boundingBox=function(e){var t,r=e===void 0||e.useCache===void 0||e.useCache===!0,i=p1(function(d){var f=d._private;return f.bbCache==null||f.styleDirty||f.bbCachePosKey!==Fme(d)},function(d){return d.id()});if(r&&this.length===1&&!i(this[0]))e===void 0?e=Qb:e=r0e(e),t=e0e(this[0],e);else{t=is(),e=e||Qb;var n=r0e(e),a=this,s=a.cy(),l=s.styleEnabled();this.edges().forEach(i),this.nodes().forEach(i),l&&this.recalculateRenderedStyle(r),this.updateCompoundBounds(!r);for(var u=0;u<a.length;u++){var h=a[u];i(h)&&h.dirtyBoundingBoxCache(),Fd(t,e0e(h,n))}}return t.x1=jo(t.x1),t.y1=jo(t.y1),t.x2=jo(t.x2),t.y2=jo(t.y2),t.w=jo(t.x2-t.x1),t.h=jo(t.y2-t.y1),t};Qd.dirtyBoundingBoxCache=function(){for(var e=0;e<this.length;e++){var t=this[e]._private;t.bbCache=null,t.bbCachePosKey=null,t.bodyBounds=null,t.overlayBounds=null,t.labelBounds.all=null,t.labelBounds.source=null,t.labelBounds.target=null,t.labelBounds.main=null,t.labelBounds.sourceRot=null,t.labelBounds.targetRot=null,t.labelBounds.mainRot=null,t.arrowBounds.source=null,t.arrowBounds.target=null,t.arrowBounds["mid-source"]=null,t.arrowBounds["mid-target"]=null}return this.emitAndNotify("bounds"),this};Qd.boundingBoxAt=function(e){var t=this.nodes(),r=this.cy(),i=r.hasCompoundNodes(),n=r.collection();if(i&&(n=t.filter(function(h){return h.isParent()}),t=t.not(n)),Xr(e)){var a=e;e=o(function(){return a},"fn")}var s=o(function(d,f){return d._private.bbAtOldPos=e(d,f)},"storeOldPos"),l=o(function(d){return d._private.bbAtOldPos},"getOldPos");r.startBatch(),t.forEach(s).silentPositions(e),i&&(n.dirtyCompoundBoundsCache(),n.dirtyBoundingBoxCache(),n.updateCompoundBounds(!0));var u=Prt(this.boundingBox({useCache:!1}));return t.silentPositions(l),i&&(n.dirtyCompoundBoundsCache(),n.dirtyBoundingBoxCache(),n.updateCompoundBounds(!0)),r.endBatch(),u};f1.boundingbox=f1.bb=f1.boundingBox;f1.renderedBoundingbox=f1.renderedBoundingBox;iat=Qd;Gb=c2={};$me=o(function(t){t.uppercaseName=yfe(t.name),t.autoName="auto"+t.uppercaseName,t.labelName="label"+t.uppercaseName,t.outerName="outer"+t.uppercaseName,t.uppercaseOuterName=yfe(t.outerName),Gb[t.name]=o(function(){var i=this[0],n=i._private,a=n.cy,s=a._private.styleEnabled;if(i)if(s){if(i.isParent())return i.updateCompoundBounds(),n[t.autoName]||0;var l=i.pstyle(t.name);switch(l.strValue){case"label":return i.recalculateRenderedStyle(),n.rstyle[t.labelName]||0;default:return l.pfValue}}else return 1},"dimImpl"),Gb["outer"+t.uppercaseName]=o(function(){var i=this[0],n=i._private,a=n.cy,s=a._private.styleEnabled;if(i)if(s){var l=i[t.name](),u=i.pstyle("border-position").value,h;u==="center"?h=i.pstyle("border-width").pfValue:u==="outside"?h=2*i.pstyle("border-width").pfValue:h=0;var d=2*i.padding();return l+h+d}else return 1},"outerDimImpl"),Gb["rendered"+t.uppercaseName]=o(function(){var i=this[0];if(i){var n=i[t.name]();return n*this.cy().zoom()}},"renderedDimImpl"),Gb["rendered"+t.uppercaseOuterName]=o(function(){var i=this[0];if(i){var n=i[t.outerName]();return n*this.cy().zoom()}},"renderedOuterDimImpl")},"defineDimFns");$me({name:"width"});$me({name:"height"});c2.padding=function(){var e=this[0],t=e._private;return e.isParent()?(e.updateCompoundBounds(),t.autoPadding!==void 0?t.autoPadding:e.pstyle("padding").pfValue):e.pstyle("padding").pfValue};c2.paddedHeight=function(){var e=this[0];return e.height()+2*e.padding()};c2.paddedWidth=function(){var e=this[0];return e.width()+2*e.padding()};nat=c2,aat=o(function(t,r){if(t.isEdge()&&t.takesUpSpace())return r(t)},"ifEdge"),sat=o(function(t,r){if(t.isEdge()&&t.takesUpSpace()){var i=t.cy();return K3(r(t),i.zoom(),i.pan())}},"ifEdgeRenderedPosition"),oat=o(function(t,r){if(t.isEdge()&&t.takesUpSpace()){var i=t.cy(),n=i.pan(),a=i.zoom();return r(t).map(function(s){return K3(s,a,n)})}},"ifEdgeRenderedPositions"),lat=o(function(t){return t.renderer().getControlPoints(t)},"controlPoints"),cat=o(function(t){return t.renderer().getSegmentPoints(t)},"segmentPoints"),uat=o(function(t){return t.renderer().getSourceEndpoint(t)},"sourceEndpoint"),hat=o(function(t){return t.renderer().getTargetEndpoint(t)},"targetEndpoint"),dat=o(function(t){return t.renderer().getEdgeMidpoint(t)},"midpoint"),i0e={controlPoints:{get:lat,mult:!0},segmentPoints:{get:cat,mult:!0},sourceEndpoint:{get:uat},targetEndpoint:{get:hat},midpoint:{get:dat}},fat=o(function(t){return"rendered"+t[0].toUpperCase()+t.substr(1)},"renderedName"),pat=Object.keys(i0e).reduce(function(e,t){var r=i0e[t],i=fat(t);return e[t]=function(){return aat(this,r.get)},r.mult?e[i]=function(){return oat(this,r.get)}:e[i]=function(){return sat(this,r.get)},e},{}),mat=hr({},eat,iat,nat,pat);zme=o(function(t,r){this.recycle(t,r)},"Event");o(Ob,"returnFalse");o(g3,"returnTrue");zme.prototype={instanceString:o(function(){return"event"},"instanceString"),recycle:o(function(t,r){if(this.isImmediatePropagationStopped=this.isPropagationStopped=this.isDefaultPrevented=Ob,t!=null&&t.preventDefault?(this.type=t.type,this.isDefaultPrevented=t.defaultPrevented?g3:Ob):t!=null&&t.type?r=t:this.type=t,r!=null&&(this.originalEvent=r.originalEvent,this.type=r.type!=null?r.type:this.type,this.cy=r.cy,this.target=r.target,this.position=r.position,this.renderedPosition=r.renderedPosition,this.namespace=r.namespace,this.layout=r.layout),this.cy!=null&&this.position!=null&&this.renderedPosition==null){var i=this.position,n=this.cy.zoom(),a=this.cy.pan();this.renderedPosition={x:i.x*n+a.x,y:i.y*n+a.y}}this.timeStamp=t&&t.timeStamp||Date.now()},"recycle"),preventDefault:o(function(){this.isDefaultPrevented=g3;var t=this.originalEvent;t&&t.preventDefault&&t.preventDefault()},"preventDefault"),stopPropagation:o(function(){this.isPropagationStopped=g3;var t=this.originalEvent;t&&t.stopPropagation&&t.stopPropagation()},"stopPropagation"),stopImmediatePropagation:o(function(){this.isImmediatePropagationStopped=g3,this.stopPropagation()},"stopImmediatePropagation"),isDefaultPrevented:Ob,isPropagationStopped:Ob,isImmediatePropagationStopped:Ob};Gme=/^([^.]+)(\.(?:[^.]+))?$/,gat=".*",Vme={qualifierCompare:o(function(t,r){return t===r},"qualifierCompare"),eventMatches:o(function(){return!0},"eventMatches"),addEventFields:o(function(){},"addEventFields"),callbackContext:o(function(t){return t},"callbackContext"),beforeEmit:o(function(){},"beforeEmit"),afterEmit:o(function(){},"afterEmit"),bubble:o(function(){return!1},"bubble"),parent:o(function(){return null},"parent"),context:null},n0e=Object.keys(Vme),yat={};o(iE,"Emitter");Xd=iE.prototype,Wme=o(function(t,r,i,n,a,s,l){Ji(n)&&(a=n,n=null),l&&(s==null?s=l:s=hr({},s,l));for(var u=Si(i)?i:i.split(/\s+/),h=0;h<u.length;h++){var d=u[h];if(!qd(d)){var f=d.match(Gme);if(f){var p=f[1],m=f[2]?f[2]:null,g=r(t,d,p,m,n,a,s);if(g===!1)break}}}},"forEachEvent"),a0e=o(function(t,r){return t.addEventFields(t.context,r),new zme(r.type,r)},"makeEventObj"),vat=o(function(t,r,i){if(wtt(i)){r(t,i);return}else if(Xr(i)){r(t,a0e(t,i));return}for(var n=Si(i)?i:i.split(/\s+/),a=0;a<n.length;a++){var s=n[a];if(!qd(s)){var l=s.match(Gme);if(l){var u=l[1],h=l[2]?l[2]:null,d=a0e(t,{type:u,namespace:h,target:t.context});r(t,d)}}}},"forEachEventObj");Xd.on=Xd.addListener=function(e,t,r,i,n){return Wme(this,function(a,s,l,u,h,d,f){Ji(d)&&a.listeners.push({event:s,callback:d,type:l,namespace:u,qualifier:h,conf:f})},e,t,r,i,n),this};Xd.one=function(e,t,r,i){return this.on(e,t,r,i,{one:!0})};Xd.removeListener=Xd.off=function(e,t,r,i){var n=this;this.emitting!==0&&(this.listeners=srt(this.listeners));for(var a=this.listeners,s=o(function(h){var d=a[h];Wme(n,function(f,p,m,g,y,v){if((d.type===m||e==="*")&&(!g&&d.namespace!==".*"||d.namespace===g)&&(!y||f.qualifierCompare(d.qualifier,y))&&(!v||d.callback===v))return a.splice(h,1),!1},e,t,r,i)},"_loop"),l=a.length-1;l>=0;l--)s(l);return this};Xd.removeAllListeners=function(){return this.removeListener("*")};Xd.emit=Xd.trigger=function(e,t,r){var i=this.listeners,n=i.length;return this.emitting++,Si(t)||(t=[t]),vat(this,function(a,s){r!=null&&(i=[{event:s.event,type:s.type,namespace:s.namespace,callback:r}],n=i.length);for(var l=o(function(){var d=i[u];if(d.type===s.type&&(!d.namespace||d.namespace===s.namespace||d.namespace===gat)&&a.eventMatches(a.context,d,s)){var f=[s];t!=null&&lrt(f,t),a.beforeEmit(a.context,d,s),d.conf&&d.conf.one&&(a.listeners=a.listeners.filter(function(g){return g!==d}));var p=a.callbackContext(a.context,d,s),m=d.callback.apply(p,f);a.afterEmit(a.context,d,s),m===!1&&(s.stopPropagation(),s.preventDefault())}},"_loop2"),u=0;u<n;u++)l();a.bubble(a.context)&&!s.isPropagationStopped()&&a.parent(a.context).emit(s,t)},e),this.emitting--,this};xat={qualifierCompare:o(function(t,r){return t==null||r==null?t==null&&r==null:t.sameText(r)},"qualifierCompare"),eventMatches:o(function(t,r,i){var n=r.qualifier;return n!=null?t!==i.target&&i2(i.target)&&n.matches(i.target):!0},"eventMatches"),addEventFields:o(function(t,r){r.cy=t.cy(),r.target=t},"addEventFields"),callbackContext:o(function(t,r,i){return r.qualifier!=null?i.target:t},"callbackContext"),beforeEmit:o(function(t,r){r.conf&&r.conf.once&&r.conf.onceCollection.removeListener(r.event,r.qualifier,r.callback)},"beforeEmit"),bubble:o(function(){return!0},"bubble"),parent:o(function(t){return t.isChild()?t.parent():t.cy()},"parent")},y3=o(function(t){return sr(t)?new Yd(t):t},"argSelector"),qme={createEmitter:o(function(){for(var t=0;t<this.length;t++){var r=this[t],i=r._private;i.emitter||(i.emitter=new iE(xat,r))}return this},"createEmitter"),emitter:o(function(){return this._private.emitter},"emitter"),on:o(function(t,r,i){for(var n=y3(r),a=0;a<this.length;a++){var s=this[a];s.emitter().on(t,n,i)}return this},"on"),removeListener:o(function(t,r,i){for(var n=y3(r),a=0;a<this.length;a++){var s=this[a];s.emitter().removeListener(t,n,i)}return this},"removeListener"),removeAllListeners:o(function(){for(var t=0;t<this.length;t++){var r=this[t];r.emitter().removeAllListeners()}return this},"removeAllListeners"),one:o(function(t,r,i){for(var n=y3(r),a=0;a<this.length;a++){var s=this[a];s.emitter().one(t,n,i)}return this},"one"),once:o(function(t,r,i){for(var n=y3(r),a=0;a<this.length;a++){var s=this[a];s.emitter().on(t,n,i,{once:!0,onceCollection:this})}},"once"),emit:o(function(t,r){for(var i=0;i<this.length;i++){var n=this[i];n.emitter().emit(t,r)}return this},"emit"),emitAndNotify:o(function(t,r){if(this.length!==0)return this.cy().notify(t,this),this.emit(t,r),this},"emitAndNotify")};hi.eventAliasesOn(qme);Ume={nodes:o(function(t){return this.filter(function(r){return r.isNode()}).filter(t)},"nodes"),edges:o(function(t){return this.filter(function(r){return r.isEdge()}).filter(t)},"edges"),byGroup:o(function(){for(var t=this.spawn(),r=this.spawn(),i=0;i<this.length;i++){var n=this[i];n.isNode()?t.push(n):r.push(n)}return{nodes:t,edges:r}},"byGroup"),filter:o(function(t,r){if(t===void 0)return this;if(sr(t)||uo(t))return new Yd(t).filter(this);if(Ji(t)){for(var i=this.spawn(),n=this,a=0;a<n.length;a++){var s=n[a],l=r?t.apply(r,[s,a,n]):t(s,a,n);l&&i.push(s)}return i}return this.spawn()},"filter"),not:o(function(t){if(t){sr(t)&&(t=this.filter(t));for(var r=this.spawn(),i=0;i<this.length;i++){var n=this[i],a=t.has(n);a||r.push(n)}return r}else return this},"not"),absoluteComplement:o(function(){var t=this.cy();return t.mutableElements().not(this)},"absoluteComplement"),intersect:o(function(t){if(sr(t)){var r=t;return this.filter(r)}for(var i=this.spawn(),n=this,a=t,s=this.length<t.length,l=s?n:a,u=s?a:n,h=0;h<l.length;h++){var d=l[h];u.has(d)&&i.push(d)}return i},"intersect"),xor:o(function(t){var r=this._private.cy;sr(t)&&(t=r.$(t));var i=this.spawn(),n=this,a=t,s=o(function(u,h){for(var d=0;d<u.length;d++){var f=u[d],p=f._private.data.id,m=h.hasElementWithId(p);m||i.push(f)}},"add");return s(n,a),s(a,n),i},"xor"),diff:o(function(t){var r=this._private.cy;sr(t)&&(t=r.$(t));var i=this.spawn(),n=this.spawn(),a=this.spawn(),s=this,l=t,u=o(function(d,f,p){for(var m=0;m<d.length;m++){var g=d[m],y=g._private.data.id,v=f.hasElementWithId(y);v?a.merge(g):p.push(g)}},"add");return u(s,l,i),u(l,s,n),{left:i,right:n,both:a}},"diff"),add:o(function(t){var r=this._private.cy;if(!t)return this;if(sr(t)){var i=t;t=r.mutableElements().filter(i)}for(var n=this.spawnSelf(),a=0;a<t.length;a++){var s=t[a],l=!this.has(s);l&&n.push(s)}return n},"add"),merge:o(function(t){var r=this._private,i=r.cy;if(!t)return this;if(t&&sr(t)){var n=t;t=i.mutableElements().filter(n)}for(var a=r.map,s=0;s<t.length;s++){var l=t[s],u=l._private.data.id,h=!a.has(u);if(h){var d=this.length++;this[d]=l,a.set(u,{ele:l,index:d})}}return this},"merge"),unmergeAt:o(function(t){var r=this[t],i=r.id(),n=this._private,a=n.map;this[t]=void 0,a.delete(i);var s=t===this.length-1;if(this.length>1&&!s){var l=this.length-1,u=this[l],h=u._private.data.id;this[l]=void 0,this[t]=u,a.set(h,{ele:u,index:t})}return this.length--,this},"unmergeAt"),unmergeOne:o(function(t){t=t[0];var r=this._private,i=t._private.data.id,n=r.map,a=n.get(i);if(!a)return this;var s=a.index;return this.unmergeAt(s),this},"unmergeOne"),unmerge:o(function(t){var r=this._private.cy;if(!t)return this;if(t&&sr(t)){var i=t;t=r.mutableElements().filter(i)}for(var n=0;n<t.length;n++)this.unmergeOne(t[n]);return this},"unmerge"),unmergeBy:o(function(t){for(var r=this.length-1;r>=0;r--){var i=this[r];t(i)&&this.unmergeAt(r)}return this},"unmergeBy"),map:o(function(t,r){for(var i=[],n=this,a=0;a<n.length;a++){var s=n[a],l=r?t.apply(r,[s,a,n]):t(s,a,n);i.push(l)}return i},"map"),reduce:o(function(t,r){for(var i=r,n=this,a=0;a<n.length;a++)i=t(i,n[a],a,n);return i},"reduce"),max:o(function(t,r){for(var i=-1/0,n,a=this,s=0;s<a.length;s++){var l=a[s],u=r?t.apply(r,[l,s,a]):t(l,s,a);u>i&&(i=u,n=l)}return{value:i,ele:n}},"max"),min:o(function(t,r){for(var i=1/0,n,a=this,s=0;s<a.length;s++){var l=a[s],u=r?t.apply(r,[l,s,a]):t(l,s,a);u<i&&(i=u,n=l)}return{value:i,ele:n}},"min")},ei=Ume;ei.u=ei["|"]=ei["+"]=ei.union=ei.or=ei.add;ei["\\"]=ei["!"]=ei["-"]=ei.difference=ei.relativeComplement=ei.subtract=ei.not;ei.n=ei["&"]=ei["."]=ei.and=ei.intersection=ei.intersect;ei["^"]=ei["(+)"]=ei["(-)"]=ei.symmetricDifference=ei.symdiff=ei.xor;ei.fnFilter=ei.filterFn=ei.stdFilter=ei.filter;ei.complement=ei.abscomp=ei.absoluteComplement;bat={isNode:o(function(){return this.group()==="nodes"},"isNode"),isEdge:o(function(){return this.group()==="edges"},"isEdge"),isLoop:o(function(){return this.isEdge()&&this.source()[0]===this.target()[0]},"isLoop"),isSimple:o(function(){return this.isEdge()&&this.source()[0]!==this.target()[0]},"isSimple"),group:o(function(){var t=this[0];if(t)return t._private.group},"group")},Hme=o(function(t,r){var i=t.cy(),n=i.hasCompoundNodes();function a(d){var f=d.pstyle("z-compound-depth");return f.value==="auto"?n?d.zDepth():0:f.value==="bottom"?-1:f.value==="top"?pP:0}o(a,"getDepth");var s=a(t)-a(r);if(s!==0)return s;function l(d){var f=d.pstyle("z-index-compare");return f.value==="auto"&&d.isNode()?1:0}o(l,"getEleDepth");var u=l(t)-l(r);if(u!==0)return u;var h=t.pstyle("z-index").value-r.pstyle("z-index").value;return h!==0?h:t.poolIndex()-r.poolIndex()},"zIndexSort"),z3={forEach:o(function(t,r){if(Ji(t))for(var i=this.length,n=0;n<i;n++){var a=this[n],s=r?t.apply(r,[a,n,this]):t(a,n,this);if(s===!1)break}return this},"forEach"),toArray:o(function(){for(var t=[],r=0;r<this.length;r++)t.push(this[r]);return t},"toArray"),slice:o(function(t,r){var i=[],n=this.length;r==null&&(r=n),t==null&&(t=0),t<0&&(t=n+t),r<0&&(r=n+r);for(var a=t;a>=0&&a<r&&a<n;a++)i.push(this[a]);return this.spawn(i)},"slice"),size:o(function(){return this.length},"size"),eq:o(function(t){return this[t]||this.spawn()},"eq"),first:o(function(){return this[0]||this.spawn()},"first"),last:o(function(){return this[this.length-1]||this.spawn()},"last"),empty:o(function(){return this.length===0},"empty"),nonempty:o(function(){return!this.empty()},"nonempty"),sort:o(function(t){if(!Ji(t))return this;var r=this.toArray().sort(t);return this.spawn(r)},"sort"),sortByZIndex:o(function(){return this.sort(Hme)},"sortByZIndex"),zDepth:o(function(){var t=this[0];if(t){var r=t._private,i=r.group;if(i==="nodes"){var n=r.data.parent?t.parents().size():0;return t.isParent()?n:pP-1}else{var a=r.source,s=r.target,l=a.zDepth(),u=s.zDepth();return Math.max(l,u,0)}}},"zDepth")};z3.each=z3.forEach;Tat=o(function(){var t="undefined",r=(typeof Symbol>"u"?"undefined":Wn(Symbol))!=t&&Wn(Symbol.iterator)!=t;r&&(z3[Symbol.iterator]=function(){var i=this,n={value:void 0,done:!1},a=0,s=this.length;return q0e({next:o(function(){return a<s?n.value=i[a++]:(n.value=void 0,n.done=!0),n},"next")},Symbol.iterator,function(){return this})})},"defineSymbolIterator");Tat();Cat=va({nodeDimensionsIncludeLabels:!1}),E3={layoutDimensions:o(function(t){t=Cat(t);var r;if(!this.takesUpSpace())r={w:0,h:0};else if(t.nodeDimensionsIncludeLabels){var i=this.boundingBox();r={w:i.w,h:i.h}}else r={w:this.outerWidth(),h:this.outerHeight()};return(r.w===0||r.h===0)&&(r.w=r.h=1),r},"layoutDimensions"),layoutPositions:o(function(t,r,i){var n=this.nodes().filter(function(C){return!C.isParent()}),a=this.cy(),s=r.eles,l=o(function(k){return k.id()},"getMemoizeKey"),u=p1(i,l);t.emit({type:"layoutstart",layout:t}),t.animations=[];var h=o(function(k,E,A){var N={x:E.x1+E.w/2,y:E.y1+E.h/2},P={x:(A.x-N.x)*k,y:(A.y-N.y)*k};return{x:N.x+P.x,y:N.y+P.y}},"calculateSpacing"),d=r.spacingFactor&&r.spacingFactor!==1,f=o(function(){if(!d)return null;for(var k=is(),E=0;E<n.length;E++){var A=n[E],N=u(A,E);ume(k,N.x,N.y)}return k},"spacingBb"),p=f(),m=p1(function(C,k){var E=u(C,k);if(d){var A=Math.abs(r.spacingFactor);E=h(A,p,E)}return r.transform!=null&&(E=r.transform(C,E)),E},l);if(r.animate){for(var g=0;g<n.length;g++){var y=n[g],v=m(y,g),x=r.animateFilter==null||r.animateFilter(y,g);if(x){var b=y.animation({position:v,duration:r.animationDuration,easing:r.animationEasing});t.animations.push(b)}else y.position(v)}if(r.fit){var T=a.animation({fit:{boundingBox:s.boundingBoxAt(m),padding:r.padding},duration:r.animationDuration,easing:r.animationEasing});t.animations.push(T)}else if(r.zoom!==void 0&&r.pan!==void 0){var w=a.animation({zoom:r.zoom,pan:r.pan,duration:r.animationDuration,easing:r.animationEasing});t.animations.push(w)}t.animations.forEach(function(C){return C.play()}),t.one("layoutready",r.ready),t.emit({type:"layoutready",layout:t}),v1.all(t.animations.map(function(C){return C.promise()})).then(function(){t.one("layoutstop",r.stop),t.emit({type:"layoutstop",layout:t})})}else n.positions(m),r.fit&&a.fit(r.eles,r.padding),r.zoom!=null&&a.zoom(r.zoom),r.pan&&a.pan(r.pan),t.one("layoutready",r.ready),t.emit({type:"layoutready",layout:t}),t.one("layoutstop",r.stop),t.emit({type:"layoutstop",layout:t});return this},"layoutPositions"),layout:o(function(t){var r=this.cy();return r.makeLayout(hr({},t,{eles:this}))},"layout")};E3.createLayout=E3.makeLayout=E3.layout;o(Yme,"styleCache");o(nE,"cacheStyleFunction");o(aE,"cachePrototypeStyleFunction");ga={recalculateRenderedStyle:o(function(t){var r=this.cy(),i=r.renderer(),n=r.styleEnabled();return i&&n&&i.recalculateRenderedStyle(this,t),this},"recalculateRenderedStyle"),dirtyStyleCache:o(function(){var t=this.cy(),r=o(function(a){return a._private.styleCache=null},"dirty");if(t.hasCompoundNodes()){var i;i=this.spawnSelf().merge(this.descendants()).merge(this.parents()),i.merge(i.connectedEdges()),i.forEach(r)}else this.forEach(function(n){r(n),n.connectedEdges().forEach(r)});return this},"dirtyStyleCache"),updateStyle:o(function(t){var r=this._private.cy;if(!r.styleEnabled())return this;if(r.batching()){var i=r._private.batchStyleEles;return i.merge(this),this}var n=r.hasCompoundNodes(),a=this;t=!!(t||t===void 0),n&&(a=this.spawnSelf().merge(this.descendants()).merge(this.parents()));var s=a;return t?s.emitAndNotify("style"):s.emit("style"),a.forEach(function(l){return l._private.styleDirty=!0}),this},"updateStyle"),cleanStyle:o(function(){var t=this.cy();if(t.styleEnabled())for(var r=0;r<this.length;r++){var i=this[r];i._private.styleDirty&&(i._private.styleDirty=!1,t.style().apply(i))}},"cleanStyle"),parsedStyle:o(function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,i=this[0],n=i.cy();if(n.styleEnabled()&&i){i._private.styleDirty&&(i._private.styleDirty=!1,n.style().apply(i));var a=i._private.style[t];return a??(r?n.style().getDefaultProperty(t):null)}},"parsedStyle"),numericStyle:o(function(t){var r=this[0];if(r.cy().styleEnabled()&&r){var i=r.pstyle(t);return i.pfValue!==void 0?i.pfValue:i.value}},"numericStyle"),numericStyleUnits:o(function(t){var r=this[0];if(r.cy().styleEnabled()&&r)return r.pstyle(t).units},"numericStyleUnits"),renderedStyle:o(function(t){var r=this.cy();if(!r.styleEnabled())return this;var i=this[0];if(i)return r.style().getRenderedStyle(i,t)},"renderedStyle"),style:o(function(t,r){var i=this.cy();if(!i.styleEnabled())return this;var n=!1,a=i.style();if(Xr(t)){var s=t;a.applyBypass(this,s,n),this.emitAndNotify("style")}else if(sr(t))if(r===void 0){var l=this[0];return l?a.getStylePropertyValue(l,t):void 0}else a.applyBypass(this,t,r,n),this.emitAndNotify("style");else if(t===void 0){var u=this[0];return u?a.getRawStyle(u):void 0}return this},"style"),removeStyle:o(function(t){var r=this.cy();if(!r.styleEnabled())return this;var i=!1,n=r.style(),a=this;if(t===void 0)for(var s=0;s<a.length;s++){var l=a[s];n.removeAllBypasses(l,i)}else{t=t.split(/\s+/);for(var u=0;u<a.length;u++){var h=a[u];n.removeBypasses(h,t,i)}}return this.emitAndNotify("style"),this},"removeStyle"),show:o(function(){return this.css("display","element"),this},"show"),hide:o(function(){return this.css("display","none"),this},"hide"),effectiveOpacity:o(function(){var t=this.cy();if(!t.styleEnabled())return 1;var r=t.hasCompoundNodes(),i=this[0];if(i){var n=i._private,a=i.pstyle("opacity").value;if(!r)return a;var s=n.data.parent?i.parents():null;if(s)for(var l=0;l<s.length;l++){var u=s[l],h=u.pstyle("opacity").value;a=h*a}return a}},"effectiveOpacity"),transparent:o(function(){var t=this.cy();if(!t.styleEnabled())return!1;var r=this[0],i=r.cy().hasCompoundNodes();if(r)return i?r.effectiveOpacity()===0:r.pstyle("opacity").value===0},"transparent"),backgrounding:o(function(){var t=this.cy();if(!t.styleEnabled())return!1;var r=this[0];return!!r._private.backgrounding},"backgrounding")};o(IO,"checkCompound");o(EP,"defineDerivedStateFunction");x1=nE("eleTakesUpSpace",function(e){return e.pstyle("display").value==="element"&&e.width()!==0&&(e.isNode()?e.height()!==0:!0)});ga.takesUpSpace=aE("takesUpSpace",EP({ok:x1}));kat=nE("eleInteractive",function(e){return e.pstyle("events").value==="yes"&&e.pstyle("visibility").value==="visible"&&x1(e)}),wat=nE("parentInteractive",function(e){return e.pstyle("visibility").value==="visible"&&x1(e)});ga.interactive=aE("interactive",EP({ok:kat,parentOk:wat,edgeOkViaNode:x1}));ga.noninteractive=function(){var e=this[0];if(e)return!e.interactive()};Sat=nE("eleVisible",function(e){return e.pstyle("visibility").value==="visible"&&e.pstyle("opacity").pfValue!==0&&x1(e)}),Eat=x1;ga.visible=aE("visible",EP({ok:Sat,edgeOkViaNode:Eat}));ga.hidden=function(){var e=this[0];if(e)return!e.visible()};ga.isBundledBezier=aE("isBundledBezier",function(){return this.cy().styleEnabled()?!this.removed()&&this.pstyle("curve-style").value==="bezier"&&this.takesUpSpace():!1});ga.bypass=ga.css=ga.style;ga.renderedCss=ga.renderedStyle;ga.removeBypass=ga.removeCss=ga.removeStyle;ga.pstyle=ga.parsedStyle;Wd={};o(s0e,"defineSwitchFunction");o(b1,"defineSwitchSet");b1({field:"locked",overrideField:o(function(t){return t.cy().autolock()?!0:void 0},"overrideField"),on:"lock",off:"unlock"});b1({field:"grabbable",overrideField:o(function(t){return t.cy().autoungrabify()||t.pannable()?!1:void 0},"overrideField"),on:"grabify",off:"ungrabify"});b1({field:"selected",ableField:"selectable",overrideAble:o(function(t){return t.cy().autounselectify()?!1:void 0},"overrideAble"),on:"select",off:"unselect"});b1({field:"selectable",overrideField:o(function(t){return t.cy().autounselectify()?!1:void 0},"overrideField"),on:"selectify",off:"unselectify"});Wd.deselect=Wd.unselect;Wd.grabbed=function(){var e=this[0];if(e)return e._private.grabbed};b1({field:"active",on:"activate",off:"unactivate"});b1({field:"pannable",on:"panify",off:"unpanify"});Wd.inactive=function(){var e=this[0];if(e)return!e._private.active};Oa={},o0e=o(function(t){return o(function(i){for(var n=this,a=[],s=0;s<n.length;s++){var l=n[s];if(l.isNode()){for(var u=!1,h=l.connectedEdges(),d=0;d<h.length;d++){var f=h[d],p=f.source(),m=f.target();if(t.noIncomingEdges&&m===l&&p!==l||t.noOutgoingEdges&&p===l&&m!==l){u=!0;break}}u||a.push(l)}}return this.spawn(a,!0).filter(i)},"dagExtremityImpl")},"defineDagExtremity"),l0e=o(function(t){return function(r){for(var i=this,n=[],a=0;a<i.length;a++){var s=i[a];if(s.isNode())for(var l=s.connectedEdges(),u=0;u<l.length;u++){var h=l[u],d=h.source(),f=h.target();t.outgoing&&d===s?(n.push(h),n.push(f)):t.incoming&&f===s&&(n.push(h),n.push(d))}}return this.spawn(n,!0).filter(r)}},"defineDagOneHop"),c0e=o(function(t){return function(r){for(var i=this,n=[],a={};;){var s=t.outgoing?i.outgoers():i.incomers();if(s.length===0)break;for(var l=!1,u=0;u<s.length;u++){var h=s[u],d=h.id();a[d]||(a[d]=!0,n.push(h),l=!0)}if(!l)break;i=s}return this.spawn(n,!0).filter(r)}},"defineDagAllHops");Oa.clearTraversalCache=function(){for(var e=0;e<this.length;e++)this[e]._private.traversalCache=null};hr(Oa,{roots:o0e({noIncomingEdges:!0}),leaves:o0e({noOutgoingEdges:!0}),outgoers:Xo(l0e({outgoing:!0}),"outgoers"),successors:c0e({outgoing:!0}),incomers:Xo(l0e({incoming:!0}),"incomers"),predecessors:c0e({})});hr(Oa,{neighborhood:Xo(function(e){for(var t=[],r=this.nodes(),i=0;i<r.length;i++)for(var n=r[i],a=n.connectedEdges(),s=0;s<a.length;s++){var l=a[s],u=l.source(),h=l.target(),d=n===u?h:u;d.length>0&&t.push(d[0]),t.push(l[0])}return this.spawn(t,!0).filter(e)},"neighborhood"),closedNeighborhood:o(function(t){return this.neighborhood().add(this).filter(t)},"closedNeighborhood"),openNeighborhood:o(function(t){return this.neighborhood(t)},"openNeighborhood")});Oa.neighbourhood=Oa.neighborhood;Oa.closedNeighbourhood=Oa.closedNeighborhood;Oa.openNeighbourhood=Oa.openNeighborhood;hr(Oa,{source:Xo(o(function(t){var r=this[0],i;return r&&(i=r._private.source||r.cy().collection()),i&&t?i.filter(t):i},"sourceImpl"),"source"),target:Xo(o(function(t){var r=this[0],i;return r&&(i=r._private.target||r.cy().collection()),i&&t?i.filter(t):i},"targetImpl"),"target"),sources:u0e({attr:"source"}),targets:u0e({attr:"target"})});o(u0e,"defineSourceFunction");hr(Oa,{edgesWith:Xo(h0e(),"edgesWith"),edgesTo:Xo(h0e({thisIsSrc:!0}),"edgesTo")});o(h0e,"defineEdgesWithFunction");hr(Oa,{connectedEdges:Xo(function(e){for(var t=[],r=this,i=0;i<r.length;i++){var n=r[i];if(n.isNode())for(var a=n._private.edges,s=0;s<a.length;s++){var l=a[s];t.push(l)}}return this.spawn(t,!0).filter(e)},"connectedEdges"),connectedNodes:Xo(function(e){for(var t=[],r=this,i=0;i<r.length;i++){var n=r[i];n.isEdge()&&(t.push(n.source()[0]),t.push(n.target()[0]))}return this.spawn(t,!0).filter(e)},"connectedNodes"),parallelEdges:Xo(d0e(),"parallelEdges"),codirectedEdges:Xo(d0e({codirected:!0}),"codirectedEdges")});o(d0e,"defineParallelEdgesFunction");hr(Oa,{components:o(function(t){var r=this,i=r.cy(),n=i.collection(),a=t==null?r.nodes():t.nodes(),s=[];t!=null&&a.empty()&&(a=t.sources());var l=o(function(d,f){n.merge(d),a.unmerge(d),f.merge(d)},"visitInComponent");if(a.empty())return r.spawn();var u=o(function(){var d=i.collection();s.push(d);var f=a[0];l(f,d),r.bfs({directed:!1,roots:f,visit:o(function(m){return l(m,d)},"visit")}),d.forEach(function(p){p.connectedEdges().forEach(function(m){r.has(m)&&d.has(m.source())&&d.has(m.target())&&d.merge(m)})})},"_loop");do u();while(a.length>0);return s},"components"),component:o(function(){var t=this[0];return t.cy().mutableElements().components(t)[0]},"component")});Oa.componentsOf=Oa.components;ya=o(function(t,r){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(t===void 0){Yi("A collection must have a reference to the core");return}var a=new Ku,s=!1;if(!r)r=[];else if(r.length>0&&Xr(r[0])&&!i2(r[0])){s=!0;for(var l=[],u=new y1,h=0,d=r.length;h<d;h++){var f=r[h];f.data==null&&(f.data={});var p=f.data;if(p.id==null)p.id=ome();else if(t.hasElementWithId(p.id)||u.has(p.id))continue;var m=new X3(t,f,!1);l.push(m),u.add(p.id)}r=l}this.length=0;for(var g=0,y=r.length;g<y;g++){var v=r[g][0];if(v!=null){var x=v._private.data.id;(!i||!a.has(x))&&(i&&a.set(x,{index:this.length,ele:v}),this[this.length]=v,this.length++)}}this._private={eles:this,cy:t,get map(){return this.lazyMap==null&&this.rebuildMap(),this.lazyMap},set map(b){this.lazyMap=b},rebuildMap:o(function(){for(var T=this.lazyMap=new Ku,w=this.eles,C=0;C<w.length;C++){var k=w[C];T.set(k.id(),{index:C,ele:k})}},"rebuildMap")},i&&(this._private.map=a),s&&!n&&this.restore()},"Collection"),Mi=X3.prototype=ya.prototype=Object.create(Array.prototype);Mi.instanceString=function(){return"collection"};Mi.spawn=function(e,t){return new ya(this.cy(),e,t)};Mi.spawnSelf=function(){return this.spawn(this)};Mi.cy=function(){return this._private.cy};Mi.renderer=function(){return this._private.cy.renderer()};Mi.element=function(){return this[0]};Mi.collection=function(){return Y0e(this)?this:new ya(this._private.cy,[this])};Mi.unique=function(){return new ya(this._private.cy,this,!0)};Mi.hasElementWithId=function(e){return e=""+e,this._private.map.has(e)};Mi.getElementById=function(e){e=""+e;var t=this._private.cy,r=this._private.map.get(e);return r?r.ele:new ya(t)};Mi.$id=Mi.getElementById;Mi.poolIndex=function(){var e=this._private.cy,t=e._private.elements,r=this[0]._private.data.id;return t._private.map.get(r).index};Mi.indexOf=function(e){var t=e[0]._private.data.id;return this._private.map.get(t).index};Mi.indexOfId=function(e){return e=""+e,this._private.map.get(e).index};Mi.json=function(e){var t=this.element(),r=this.cy();if(t==null&&e)return this;if(t!=null){var i=t._private;if(Xr(e)){if(r.startBatch(),e.data){t.data(e.data);var n=i.data;if(t.isEdge()){var a=!1,s={},l=e.data.source,u=e.data.target;l!=null&&l!=n.source&&(s.source=""+l,a=!0),u!=null&&u!=n.target&&(s.target=""+u,a=!0),a&&(t=t.move(s))}else{var h="parent"in e.data,d=e.data.parent;h&&(d!=null||n.parent!=null)&&d!=n.parent&&(d===void 0&&(d=null),d!=null&&(d=""+d),t=t.move({parent:d}))}}e.position&&t.position(e.position);var f=o(function(y,v,x){var b=e[y];b!=null&&b!==i[y]&&(b?t[v]():t[x]())},"checkSwitch");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"),e.classes!=null&&t.classes(e.classes),r.endBatch(),this}else if(e===void 0){var p={data:Bc(i.data),position:Bc(i.position),group:i.group,removed:i.removed,selected:i.selected,selectable:i.selectable,locked:i.locked,grabbable:i.grabbable,pannable:i.pannable,classes:null};p.classes="";var m=0;return i.classes.forEach(function(g){return p.classes+=m++===0?g:" "+g}),p}}};Mi.jsons=function(){for(var e=[],t=0;t<this.length;t++){var r=this[t],i=r.json();e.push(i)}return e};Mi.clone=function(){for(var e=this.cy(),t=[],r=0;r<this.length;r++){var i=this[r],n=i.json(),a=new X3(e,n,!1);t.push(a)}return new ya(e,t)};Mi.copy=Mi.clone;Mi.restore=function(){for(var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=this,i=r.cy(),n=i._private,a=[],s=[],l,u=0,h=r.length;u<h;u++){var d=r[u];t&&!d.removed()||(d.isNode()?a.push(d):s.push(d))}l=a.concat(s);var f,p=o(function(){l.splice(f,1),f--},"removeFromElements");for(f=0;f<l.length;f++){var m=l[f],g=m._private,y=g.data;if(m.clearTraversalCache(),!(!t&&!g.removed)){if(y.id===void 0)y.id=ome();else if(Ot(y.id))y.id=""+y.id;else if(qd(y.id)||!sr(y.id)){Yi("Can not create element with invalid string ID `"+y.id+"`"),p();continue}else if(i.hasElementWithId(y.id)){Yi("Can not create second element with ID `"+y.id+"`"),p();continue}}var v=y.id;if(m.isNode()){var x=g.position;x.x==null&&(x.x=0),x.y==null&&(x.y=0)}if(m.isEdge()){for(var b=m,T=["source","target"],w=T.length,C=!1,k=0;k<w;k++){var E=T[k],A=y[E];Ot(A)&&(A=y[E]=""+y[E]),A==null||A===""?(Yi("Can not create edge `"+v+"` with unspecified "+E),C=!0):i.hasElementWithId(A)||(Yi("Can not create edge `"+v+"` with nonexistant "+E+" `"+A+"`"),C=!0)}if(C){p();continue}var N=i.getElementById(y.source),P=i.getElementById(y.target);N.same(P)?N._private.edges.push(b):(N._private.edges.push(b),P._private.edges.push(b)),b._private.source=N,b._private.target=P}g.map=new Ku,g.map.set(v,{ele:m,index:0}),g.removed=!1,t&&i.addToPool(m)}for(var I=0;I<a.length;I++){var D=a[I],_=D._private.data;Ot(_.parent)&&(_.parent=""+_.parent);var R=_.parent,M=R!=null;if(M||D._private.parent){var L=D._private.parent?i.collection().merge(D._private.parent):i.getElementById(R);if(L.empty())_.parent=void 0;else if(L[0].removed())di("Node added with missing parent, reference to parent removed"),_.parent=void 0,D._private.parent=null;else{for(var B=!1,O=L;!O.empty();){if(D.same(O)){B=!0,_.parent=void 0;break}O=O.parent()}B||(L[0]._private.children.push(D),D._private.parent=L[0],n.hasCompoundNodes=!0)}}}if(l.length>0){for(var $=l.length===r.length?r:new ya(i,l),G=0;G<$.length;G++){var F=$[G];F.isNode()||(F.parallelEdges().clearTraversalCache(),F.source().clearTraversalCache(),F.target().clearTraversalCache())}var V;n.hasCompoundNodes?V=i.collection().merge($).merge($.connectedNodes()).merge($.parent()):V=$,V.dirtyCompoundBoundsCache().dirtyBoundingBoxCache().updateStyle(e),e?$.emitAndNotify("add"):t&&$.emit("add")}return r};Mi.removed=function(){var e=this[0];return e&&e._private.removed};Mi.inside=function(){var e=this[0];return e&&!e._private.removed};Mi.remove=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=this,i=[],n={},a=r._private.cy;function s(R){for(var M=R._private.edges,L=0;L<M.length;L++)u(M[L])}o(s,"addConnectedEdges");function l(R){for(var M=R._private.children,L=0;L<M.length;L++)u(M[L])}o(l,"addChildren");function u(R){var M=n[R.id()];t&&R.removed()||M||(n[R.id()]=!0,R.isNode()?(i.push(R),s(R),l(R)):i.unshift(R))}o(u,"add");for(var h=0,d=r.length;h<d;h++){var f=r[h];u(f)}function p(R,M){var L=R._private.edges;Ud(L,M),R.clearTraversalCache()}o(p,"removeEdgeRef");function m(R){R.clearTraversalCache()}o(m,"removeParallelRef");var g=[];g.ids={};function y(R,M){M=M[0],R=R[0];var L=R._private.children,B=R.id();Ud(L,M),M._private.parent=null,g.ids[B]||(g.ids[B]=!0,g.push(R))}o(y,"removeChildRef"),r.dirtyCompoundBoundsCache(),t&&a.removeFromPool(i);for(var v=0;v<i.length;v++){var x=i[v];if(x.isEdge()){var b=x.source()[0],T=x.target()[0];p(b,x),p(T,x);for(var w=x.parallelEdges(),C=0;C<w.length;C++){var k=w[C];m(k),k.isBundledBezier()&&k.dirtyBoundingBoxCache()}}else{var E=x.parent();E.length!==0&&y(E,x)}t&&(x._private.removed=!0)}var A=a._private.elements;a._private.hasCompoundNodes=!1;for(var N=0;N<A.length;N++){var P=A[N];if(P.isParent()){a._private.hasCompoundNodes=!0;break}}var I=new ya(this.cy(),i);I.size()>0&&(e?I.emitAndNotify("remove"):t&&I.emit("remove"));for(var D=0;D<g.length;D++){var _=g[D];(!t||!_.removed())&&_.updateStyle()}return I};Mi.move=function(e){var t=this._private.cy,r=this,i=!1,n=!1,a=o(function(g){return g==null?g:""+g},"toString");if(e.source!==void 0||e.target!==void 0){var s=a(e.source),l=a(e.target),u=s!=null&&t.hasElementWithId(s),h=l!=null&&t.hasElementWithId(l);(u||h)&&(t.batch(function(){r.remove(i,n),r.emitAndNotify("moveout");for(var m=0;m<r.length;m++){var g=r[m],y=g._private.data;g.isEdge()&&(u&&(y.source=s),h&&(y.target=l))}r.restore(i,n)}),r.emitAndNotify("move"))}else if(e.parent!==void 0){var d=a(e.parent),f=d===null||t.hasElementWithId(d);if(f){var p=d===null?void 0:d;t.batch(function(){var m=r.remove(i,n);m.emitAndNotify("moveout");for(var g=0;g<r.length;g++){var y=r[g],v=y._private.data;y.isNode()&&(v.parent=p)}m.restore(i,n)}),r.emitAndNotify("move")}}return this};[xme,Bnt,S3,Vd,g1,Jnt,rE,mat,qme,Ume,bat,z3,E3,ga,Wd,Oa].forEach(function(e){hr(Mi,e)});Aat={add:o(function(t){var r,i=this;if(uo(t)){var n=t;if(n._private.cy===i)r=n.restore();else{for(var a=[],s=0;s<n.length;s++){var l=n[s];a.push(l.json())}r=new ya(i,a)}}else if(Si(t)){var u=t;r=new ya(i,u)}else if(Xr(t)&&(Si(t.nodes)||Si(t.edges))){for(var h=t,d=[],f=["nodes","edges"],p=0,m=f.length;p<m;p++){var g=f[p],y=h[g];if(Si(y))for(var v=0,x=y.length;v<x;v++){var b=hr({group:g},y[v]);d.push(b)}}r=new ya(i,d)}else{var T=t;r=new X3(i,T).collection()}return r},"add"),remove:o(function(t){if(!uo(t)){if(sr(t)){var r=t;t=this.$(r)}}return t.remove()},"remove")};o(_at,"generateCubicBezier");Dat=(function(){function e(i){return-i.tension*i.x-i.friction*i.v}o(e,"springAccelerationForState");function t(i,n,a){var s={x:i.x+a.dx*n,v:i.v+a.dv*n,tension:i.tension,friction:i.friction};return{dx:s.v,dv:e(s)}}o(t,"springEvaluateStateWithDerivative");function r(i,n){var a={dx:i.v,dv:e(i)},s=t(i,n*.5,a),l=t(i,n*.5,s),u=t(i,n,l),h=1/6*(a.dx+2*(s.dx+l.dx)+u.dx),d=1/6*(a.dv+2*(s.dv+l.dv)+u.dv);return i.x=i.x+h*n,i.v=i.v+d*n,i}return o(r,"springIntegrateState"),o(function i(n,a,s){var l={x:-1,v:0,tension:null,friction:null},u=[0],h=0,d=1/1e4,f=16/1e3,p,m,g;for(n=parseFloat(n)||500,a=parseFloat(a)||20,s=s||null,l.tension=n,l.friction=a,p=s!==null,p?(h=i(n,a),m=h/s*f):m=f;g=r(g||l,m),u.push(1+g.x),h+=16,Math.abs(g.x)>d&&Math.abs(g.v)>d;);return p?function(y){return u[y*(u.length-1)|0]}:h},"springRK4Factory")})(),Li=o(function(t,r,i,n){var a=_at(t,r,i,n);return function(s,l,u){return s+(l-s)*a(u)}},"cubicBezier"),A3={linear:o(function(t,r,i){return t+(r-t)*i},"linear"),ease:Li(.25,.1,.25,1),"ease-in":Li(.42,0,1,1),"ease-out":Li(0,0,.58,1),"ease-in-out":Li(.42,0,.58,1),"ease-in-sine":Li(.47,0,.745,.715),"ease-out-sine":Li(.39,.575,.565,1),"ease-in-out-sine":Li(.445,.05,.55,.95),"ease-in-quad":Li(.55,.085,.68,.53),"ease-out-quad":Li(.25,.46,.45,.94),"ease-in-out-quad":Li(.455,.03,.515,.955),"ease-in-cubic":Li(.55,.055,.675,.19),"ease-out-cubic":Li(.215,.61,.355,1),"ease-in-out-cubic":Li(.645,.045,.355,1),"ease-in-quart":Li(.895,.03,.685,.22),"ease-out-quart":Li(.165,.84,.44,1),"ease-in-out-quart":Li(.77,0,.175,1),"ease-in-quint":Li(.755,.05,.855,.06),"ease-out-quint":Li(.23,1,.32,1),"ease-in-out-quint":Li(.86,0,.07,1),"ease-in-expo":Li(.95,.05,.795,.035),"ease-out-expo":Li(.19,1,.22,1),"ease-in-out-expo":Li(1,0,0,1),"ease-in-circ":Li(.6,.04,.98,.335),"ease-out-circ":Li(.075,.82,.165,1),"ease-in-out-circ":Li(.785,.135,.15,.86),spring:o(function(t,r,i){if(i===0)return A3.linear;var n=Dat(t,r,i);return function(a,s,l){return a+(s-a)*n(l)}},"spring"),"cubic-bezier":Li};o(f0e,"getEasedValue");o(p0e,"getValue");o(t1,"ease");o(Rat,"step$1");o(Pb,"valid");o(Lat,"startAnimation");o(m0e,"stepAll");Mat={animate:hi.animate(),animation:hi.animation(),animated:hi.animated(),clearQueue:hi.clearQueue(),delay:hi.delay(),delayAnimation:hi.delayAnimation(),stop:hi.stop(),addToAnimationPool:o(function(t){var r=this;r.styleEnabled()&&r._private.aniEles.merge(t)},"addToAnimationPool"),stopAnimationLoop:o(function(){this._private.animationsRunning=!1},"stopAnimationLoop"),startAnimationLoop:o(function(){var t=this;if(t._private.animationsRunning=!0,!t.styleEnabled())return;function r(){t._private.animationsRunning&&O3(o(function(a){m0e(a,t),r()},"animationStep"))}o(r,"headlessStep");var i=t.renderer();i&&i.beforeRender?i.beforeRender(o(function(a,s){m0e(s,t)},"rendererAnimationStep"),i.beforeRenderPriorities.animations):r()},"startAnimationLoop")},Nat={qualifierCompare:o(function(t,r){return t==null||r==null?t==null&&r==null:t.sameText(r)},"qualifierCompare"),eventMatches:o(function(t,r,i){var n=r.qualifier;return n!=null?t!==i.target&&i2(i.target)&&n.matches(i.target):!0},"eventMatches"),addEventFields:o(function(t,r){r.cy=t,r.target=t},"addEventFields"),callbackContext:o(function(t,r,i){return r.qualifier!=null?i.target:t},"callbackContext")},v3=o(function(t){return sr(t)?new Yd(t):t},"argSelector"),jme={createEmitter:o(function(){var t=this._private;return t.emitter||(t.emitter=new iE(Nat,this)),this},"createEmitter"),emitter:o(function(){return this._private.emitter},"emitter"),on:o(function(t,r,i){return this.emitter().on(t,v3(r),i),this},"on"),removeListener:o(function(t,r,i){return this.emitter().removeListener(t,v3(r),i),this},"removeListener"),removeAllListeners:o(function(){return this.emitter().removeAllListeners(),this},"removeAllListeners"),one:o(function(t,r,i){return this.emitter().one(t,v3(r),i),this},"one"),once:o(function(t,r,i){return this.emitter().one(t,v3(r),i),this},"once"),emit:o(function(t,r){return this.emitter().emit(t,r),this},"emit"),emitAndNotify:o(function(t,r){return this.emit(t),this.notify(t,r),this},"emitAndNotify")};hi.eventAliasesOn(jme);JO={png:o(function(t){var r=this._private.renderer;return t=t||{},r.png(t)},"png"),jpg:o(function(t){var r=this._private.renderer;return t=t||{},t.bg=t.bg||"#fff",r.jpg(t)},"jpg")};JO.jpeg=JO.jpg;_3={layout:o(function(t){var r=this;if(t==null){Yi("Layout options must be specified to make a layout");return}if(t.name==null){Yi("A `name` must be specified to make a layout");return}var i=t.name,n=r.extension("layout",i);if(n==null){Yi("No such layout `"+i+"` found. Did you forget to import it and `cytoscape.use()` it?");return}var a;sr(t.eles)?a=r.$(t.eles):a=t.eles!=null?t.eles:r.$();var s=new n(hr({},t,{cy:r,eles:a}));return s},"layout")};_3.createLayout=_3.makeLayout=_3.layout;Iat={notify:o(function(t,r){var i=this._private;if(this.batching()){i.batchNotifications=i.batchNotifications||{};var n=i.batchNotifications[t]=i.batchNotifications[t]||this.collection();r!=null&&n.merge(r);return}if(i.notificationsEnabled){var a=this.renderer();this.destroyed()||!a||a.notify(t,r)}},"notify"),notifications:o(function(t){var r=this._private;return t===void 0?r.notificationsEnabled:(r.notificationsEnabled=!!t,this)},"notifications"),noNotifications:o(function(t){this.notifications(!1),t(),this.notifications(!0)},"noNotifications"),batching:o(function(){return this._private.batchCount>0},"batching"),startBatch:o(function(){var t=this._private;return t.batchCount==null&&(t.batchCount=0),t.batchCount===0&&(t.batchStyleEles=this.collection(),t.batchNotifications={}),t.batchCount++,this},"startBatch"),endBatch:o(function(){var t=this._private;if(t.batchCount===0)return this;if(t.batchCount--,t.batchCount===0){t.batchStyleEles.updateStyle();var r=this.renderer();Object.keys(t.batchNotifications).forEach(function(i){var n=t.batchNotifications[i];n.empty()?r.notify(i):r.notify(i,n)})}return this},"endBatch"),batch:o(function(t){return this.startBatch(),t(),this.endBatch(),this},"batch"),batchData:o(function(t){var r=this;return this.batch(function(){for(var i=Object.keys(t),n=0;n<i.length;n++){var a=i[n],s=t[a],l=r.getElementById(a);l.data(s)}})},"batchData")},Oat=va({hideEdgesOnViewport:!1,textureOnViewport:!1,motionBlur:!1,motionBlurOpacity:.05,pixelRatio:void 0,desktopTapThreshold:4,touchTapThreshold:8,wheelSensitivity:1,debug:!1,showFps:!1,webgl:!1,webglDebug:!1,webglDebugShowAtlases:!1,webglTexSize:2048,webglTexRows:36,webglTexRowsNodes:18,webglBatchSize:2048,webglTexPerBatch:14,webglBgColor:[255,255,255]}),eP={renderTo:o(function(t,r,i,n){var a=this._private.renderer;return a.renderTo(t,r,i,n),this},"renderTo"),renderer:o(function(){return this._private.renderer},"renderer"),forceRender:o(function(){return this.notify("draw"),this},"forceRender"),resize:o(function(){return this.invalidateSize(),this.emitAndNotify("resize"),this},"resize"),initRenderer:o(function(t){var r=this,i=r.extension("renderer",t.name);if(i==null){Yi("Can not initialise: No such renderer `".concat(t.name,"` found. Did you forget to import it and `cytoscape.use()` it?"));return}t.wheelSensitivity!==void 0&&di("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=Oat(t);n.cy=r,r._private.renderer=new i(n),this.notify("init")},"initRenderer"),destroyRenderer:o(function(){var t=this;t.notify("destroy");var r=t.container();if(r)for(r._cyreg=null;r.childNodes.length>0;)r.removeChild(r.childNodes[0]);t._private.renderer=null,t.mutableElements().forEach(function(i){var n=i._private;n.rscratch={},n.rstyle={},n.animation.current=[],n.animation.queue=[]})},"destroyRenderer"),onRender:o(function(t){return this.on("render",t)},"onRender"),offRender:o(function(t){return this.off("render",t)},"offRender")};eP.invalidateDimensions=eP.resize;D3={collection:o(function(t,r){return sr(t)?this.$(t):uo(t)?t.collection():Si(t)?(r||(r={}),new ya(this,t,r.unique,r.removed)):new ya(this)},"collection"),nodes:o(function(t){var r=this.$(function(i){return i.isNode()});return t?r.filter(t):r},"nodes"),edges:o(function(t){var r=this.$(function(i){return i.isEdge()});return t?r.filter(t):r},"edges"),$:o(function(t){var r=this._private.elements;return t?r.filter(t):r.spawnSelf()},"$"),mutableElements:o(function(){return this._private.elements},"mutableElements")};D3.elements=D3.filter=D3.$;sa={},Wb="t",Pat="f";sa.apply=function(e){for(var t=this,r=t._private,i=r.cy,n=i.collection(),a=0;a<e.length;a++){var s=e[a],l=t.getContextMeta(s);if(!l.empty){var u=t.getContextStyle(l),h=t.applyContextStyle(l,u,s);s._private.appliedInitStyle?t.updateTransitions(s,h.diffProps):s._private.appliedInitStyle=!0;var d=t.updateStyleHints(s);d&&n.push(s)}}return n};sa.getPropertiesDiff=function(e,t){var r=this,i=r._private.propDiffs=r._private.propDiffs||{},n=e+"-"+t,a=i[n];if(a)return a;for(var s=[],l={},u=0;u<r.length;u++){var h=r[u],d=e[u]===Wb,f=t[u]===Wb,p=d!==f,m=h.mappedProperties.length>0;if(p||f&&m){var g=void 0;p&&m||p?g=h.properties:m&&(g=h.mappedProperties);for(var y=0;y<g.length;y++){for(var v=g[y],x=v.name,b=!1,T=u+1;T<r.length;T++){var w=r[T],C=t[T]===Wb;if(C&&(b=w.properties[v.name]!=null,b))break}!l[x]&&!b&&(l[x]=!0,s.push(x))}}}return i[n]=s,s};sa.getContextMeta=function(e){for(var t=this,r="",i,n=e._private.styleCxtKey||"",a=0;a<t.length;a++){var s=t[a],l=s.selector&&s.selector.matches(e);l?r+=Wb:r+=Pat}return i=t.getPropertiesDiff(n,r),e._private.styleCxtKey=r,{key:r,diffPropNames:i,empty:i.length===0}};sa.getContextStyle=function(e){var t=e.key,r=this,i=this._private.contextStyles=this._private.contextStyles||{};if(i[t])return i[t];for(var n={_private:{key:t}},a=0;a<r.length;a++){var s=r[a],l=t[a]===Wb;if(l)for(var u=0;u<s.properties.length;u++){var h=s.properties[u];n[h.name]=h}}return i[t]=n,n};sa.applyContextStyle=function(e,t,r){for(var i=this,n=e.diffPropNames,a={},s=i.types,l=0;l<n.length;l++){var u=n[l],h=t[u],d=r.pstyle(u);if(!h)if(d)d.bypass?h={name:u,deleteBypassed:!0}:h={name:u,delete:!0};else continue;if(d!==h){if(h.mapped===s.fn&&d!=null&&d.mapping!=null&&d.mapping.value===h.value){var f=d.mapping,p=f.fnValue=h.value(r);if(p===f.prevFnValue)continue}var m=a[u]={prev:d};i.applyParsedProperty(r,h),m.next=r.pstyle(u),m.next&&m.next.bypass&&(m.next=m.next.bypassed)}}return{diffProps:a}};sa.updateStyleHints=function(e){var t=e._private,r=this,i=r.propertyGroupNames,n=r.propertyGroupKeys,a=o(function(ee,Te,ue){return r.getPropertiesHash(ee,Te,ue)},"propHash"),s=t.styleKey;if(e.removed())return!1;var l=t.group==="nodes",u=e._private.style;i=Object.keys(u);for(var h=0;h<n.length;h++){var d=n[h];t.styleKeys[d]=[Kp,s1]}for(var f=o(function(ee,Te){return t.styleKeys[Te][0]=Hb(ee,t.styleKeys[Te][0])},"updateGrKey1"),p=o(function(ee,Te){return t.styleKeys[Te][1]=Yb(ee,t.styleKeys[Te][1])},"updateGrKey2"),m=o(function(ee,Te){f(ee,Te),p(ee,Te)},"updateGrKey"),g=o(function(ee,Te){for(var ue=0;ue<ee.length;ue++){var De=ee.charCodeAt(ue);f(De,Te),p(De,Te)}},"updateGrKeyWStr"),y=2e9,v=o(function(ee){return-128<ee&&ee<128&&Math.floor(ee)!==ee?y-(ee*1024|0):ee},"cleanNum"),x=0;x<i.length;x++){var b=i[x],T=u[b];if(T!=null){var w=this.properties[b],C=w.type,k=w.groupKey,E=void 0;w.hashOverride!=null?E=w.hashOverride(e,T):T.pfValue!=null&&(E=T.pfValue);var A=w.enums==null?T.value:null,N=E!=null,P=A!=null,I=N||P,D=T.units;if(C.number&&I&&!C.multiple){var _=N?E:A;m(v(_),k),!N&&D!=null&&g(D,k)}else g(T.strValue,k)}}for(var R=[Kp,s1],M=0;M<n.length;M++){var L=n[M],B=t.styleKeys[L];R[0]=Hb(B[0],R[0]),R[1]=Yb(B[1],R[1])}t.styleKey=Qtt(R[0],R[1]);var O=t.styleKeys;t.labelDimsKey=Pd(O.labelDimensions);var $=a(e,["label"],O.labelDimensions);if(t.labelKey=Pd($),t.labelStyleKey=Pd(u3(O.commonLabel,$)),!l){var G=a(e,["source-label"],O.labelDimensions);t.sourceLabelKey=Pd(G),t.sourceLabelStyleKey=Pd(u3(O.commonLabel,G));var F=a(e,["target-label"],O.labelDimensions);t.targetLabelKey=Pd(F),t.targetLabelStyleKey=Pd(u3(O.commonLabel,F))}if(l){var V=t.styleKeys,H=V.nodeBody,j=V.nodeBorder,U=V.nodeOutline,Q=V.backgroundImage,Y=V.compound,ae=V.pie,J=V.stripe,te=[H,j,U,Q,Y,ae,J].filter(function(re){return re!=null}).reduce(u3,[Kp,s1]);t.nodeKey=Pd(te),t.hasPie=ae!=null&&ae[0]!==Kp&&ae[1]!==s1,t.hasStripe=J!=null&&J[0]!==Kp&&J[1]!==s1}return s!==t.styleKey};sa.clearStyleHints=function(e){var t=e._private;t.styleCxtKey="",t.styleKeys={},t.styleKey=null,t.labelKey=null,t.labelStyleKey=null,t.sourceLabelKey=null,t.sourceLabelStyleKey=null,t.targetLabelKey=null,t.targetLabelStyleKey=null,t.nodeKey=null,t.hasPie=null,t.hasStripe=null};sa.applyParsedProperty=function(e,t){var r=this,i=t,n=e._private.style,a,s=r.types,l=r.properties[i.name].type,u=i.bypass,h=n[i.name],d=h&&h.bypass,f=e._private,p="mapping",m=o(function(H){return H==null?null:H.pfValue!=null?H.pfValue:H.value},"getVal"),g=o(function(){var H=m(h),j=m(i);r.checkTriggers(e,i.name,H,j)},"checkTriggers");if(t.name==="curve-style"&&e.isEdge()&&(t.value!=="bezier"&&e.isLoop()||t.value==="haystack"&&(e.source().isParent()||e.target().isParent()))&&(i=t=this.parse(t.name,"bezier",u)),i.delete)return n[i.name]=void 0,g(),!0;if(i.deleteBypassed)return h?h.bypass?(h.bypassed=void 0,g(),!0):!1:(g(),!0);if(i.deleteBypass)return h?h.bypass?(n[i.name]=h.bypassed,g(),!0):!1:(g(),!0);var y=o(function(){di("Do not assign mappings to elements without corresponding data (i.e. ele `"+e.id()+"` has no mapping for property `"+i.name+"` with data field `"+i.field+"`); try a `["+i.field+"]` selector to limit scope to elements with `"+i.field+"` defined")},"printMappingErr");switch(i.mapped){case s.mapData:{for(var v=i.field.split("."),x=f.data,b=0;b<v.length&&x;b++){var T=v[b];x=x[T]}if(x==null)return y(),!1;var w;if(Ot(x)){var C=i.fieldMax-i.fieldMin;C===0?w=0:w=(x-i.fieldMin)/C}else return di("Do not use continuous mappers without specifying numeric data (i.e. `"+i.field+": "+x+"` for `"+e.id()+"` is non-numeric)"),!1;if(w<0?w=0:w>1&&(w=1),l.color){var k=i.valueMin[0],E=i.valueMax[0],A=i.valueMin[1],N=i.valueMax[1],P=i.valueMin[2],I=i.valueMax[2],D=i.valueMin[3]==null?1:i.valueMin[3],_=i.valueMax[3]==null?1:i.valueMax[3],R=[Math.round(k+(E-k)*w),Math.round(A+(N-A)*w),Math.round(P+(I-P)*w),Math.round(D+(_-D)*w)];a={bypass:i.bypass,name:i.name,value:R,strValue:"rgb("+R[0]+", "+R[1]+", "+R[2]+")"}}else if(l.number){var M=i.valueMin+(i.valueMax-i.valueMin)*w;a=this.parse(i.name,M,i.bypass,p)}else return!1;if(!a)return y(),!1;a.mapping=i,i=a;break}case s.data:{for(var L=i.field.split("."),B=f.data,O=0;O<L.length&&B;O++){var $=L[O];B=B[$]}if(B!=null&&(a=this.parse(i.name,B,i.bypass,p)),!a)return y(),!1;a.mapping=i,i=a;break}case s.fn:{var G=i.value,F=i.fnValue!=null?i.fnValue:G(e);if(i.prevFnValue=F,F==null)return di("Custom function mappers may not return null (i.e. `"+i.name+"` for ele `"+e.id()+"` is null)"),!1;if(a=this.parse(i.name,F,i.bypass,p),!a)return di("Custom function mappers may not return invalid values for the property type (i.e. `"+i.name+"` for ele `"+e.id()+"` is invalid)"),!1;a.mapping=Bc(i),i=a;break}case void 0:break;default:return!1}return u?(d?i.bypassed=h.bypassed:i.bypassed=h,n[i.name]=i):d?h.bypassed=i:n[i.name]=i,g(),!0};sa.cleanElements=function(e,t){for(var r=0;r<e.length;r++){var i=e[r];if(this.clearStyleHints(i),i.dirtyCompoundBoundsCache(),i.dirtyBoundingBoxCache(),!t)i._private.style={};else for(var n=i._private.style,a=Object.keys(n),s=0;s<a.length;s++){var l=a[s],u=n[l];u!=null&&(u.bypass?u.bypassed=null:n[l]=null)}}};sa.update=function(){var e=this._private.cy,t=e.mutableElements();t.updateStyle()};sa.updateTransitions=function(e,t){var r=this,i=e._private,n=e.pstyle("transition-property").value,a=e.pstyle("transition-duration").pfValue,s=e.pstyle("transition-delay").pfValue;if(n.length>0&&a>0){for(var l={},u=!1,h=0;h<n.length;h++){var d=n[h],f=e.pstyle(d),p=t[d];if(p){var m=p.prev,g=m,y=p.next!=null?p.next:f,v=!1,x=void 0,b=1e-6;g&&(Ot(g.pfValue)&&Ot(y.pfValue)?(v=y.pfValue-g.pfValue,x=g.pfValue+b*v):Ot(g.value)&&Ot(y.value)?(v=y.value-g.value,x=g.value+b*v):Si(g.value)&&Si(y.value)&&(v=g.value[0]!==y.value[0]||g.value[1]!==y.value[1]||g.value[2]!==y.value[2],x=g.strValue),v&&(l[d]=y.strValue,this.applyBypass(e,d,x),u=!0))}}if(!u)return;i.transitioning=!0,new v1(function(T){s>0?e.delayAnimation(s).play().promise().then(T):T()}).then(function(){return e.animation({style:l,duration:a,easing:e.pstyle("transition-timing-function").value,queue:!1}).play().promise()}).then(function(){r.removeBypasses(e,n),e.emitAndNotify("style"),i.transitioning=!1})}else i.transitioning&&(this.removeBypasses(e,n),e.emitAndNotify("style"),i.transitioning=!1)};sa.checkTrigger=function(e,t,r,i,n,a){var s=this.properties[t],l=n(s);e.removed()||l!=null&&l(r,i,e)&&a(s)};sa.checkZOrderTrigger=function(e,t,r,i){var n=this;this.checkTrigger(e,t,r,i,function(a){return a.triggersZOrder},function(){n._private.cy.notify("zorder",e)})};sa.checkBoundsTrigger=function(e,t,r,i){this.checkTrigger(e,t,r,i,function(n){return n.triggersBounds},function(n){e.dirtyCompoundBoundsCache(),e.dirtyBoundingBoxCache()})};sa.checkConnectedEdgesBoundsTrigger=function(e,t,r,i){this.checkTrigger(e,t,r,i,function(n){return n.triggersBoundsOfConnectedEdges},function(n){e.connectedEdges().forEach(function(a){a.dirtyBoundingBoxCache()})})};sa.checkParallelEdgesBoundsTrigger=function(e,t,r,i){this.checkTrigger(e,t,r,i,function(n){return n.triggersBoundsOfParallelEdges},function(n){e.parallelEdges().forEach(function(a){a.dirtyBoundingBoxCache()})})};sa.checkTriggers=function(e,t,r,i){e.dirtyStyleCache(),this.checkZOrderTrigger(e,t,r,i),this.checkBoundsTrigger(e,t,r,i),this.checkConnectedEdgesBoundsTrigger(e,t,r,i),this.checkParallelEdgesBoundsTrigger(e,t,r,i)};u2={};u2.applyBypass=function(e,t,r,i){var n=this,a=[],s=!0;if(t==="*"||t==="**"){if(r!==void 0)for(var l=0;l<n.properties.length;l++){var u=n.properties[l],h=u.name,d=this.parse(h,r,!0);d&&a.push(d)}}else if(sr(t)){var f=this.parse(t,r,!0);f&&a.push(f)}else if(Xr(t)){var p=t;i=r;for(var m=Object.keys(p),g=0;g<m.length;g++){var y=m[g],v=p[y];if(v===void 0&&(v=p[Y3(y)]),v!==void 0){var x=this.parse(y,v,!0);x&&a.push(x)}}}else return!1;if(a.length===0)return!1;for(var b=!1,T=0;T<e.length;T++){for(var w=e[T],C={},k=void 0,E=0;E<a.length;E++){var A=a[E];if(i){var N=w.pstyle(A.name);k=C[A.name]={prev:N}}b=this.applyParsedProperty(w,Bc(A))||b,i&&(k.next=w.pstyle(A.name))}b&&this.updateStyleHints(w),i&&this.updateTransitions(w,C,s)}return b};u2.overrideBypass=function(e,t,r){t=dP(t);for(var i=0;i<e.length;i++){var n=e[i],a=n._private.style[t],s=this.properties[t].type,l=s.color,u=s.mutiple,h=a?a.pfValue!=null?a.pfValue:a.value:null;!a||!a.bypass?this.applyBypass(n,t,r):(a.value=r,a.pfValue!=null&&(a.pfValue=r),l?a.strValue="rgb("+r.join(",")+")":u?a.strValue=r.join(" "):a.strValue=""+r,this.updateStyleHints(n)),this.checkTriggers(n,t,h,r)}};u2.removeAllBypasses=function(e,t){return this.removeBypasses(e,this.propertyNames,t)};u2.removeBypasses=function(e,t,r){for(var i=!0,n=0;n<e.length;n++){for(var a=e[n],s={},l=0;l<t.length;l++){var u=t[l],h=this.properties[u],d=a.pstyle(h.name);if(!(!d||!d.bypass)){var f="",p=this.parse(u,f,!0),m=s[h.name]={prev:d};this.applyParsedProperty(a,p),m.next=a.pstyle(h.name)}}this.updateStyleHints(a),r&&this.updateTransitions(a,s,i)}};AP={};AP.getEmSizeInPixels=function(){var e=this.containerCss("font-size");return e!=null?parseFloat(e):1};AP.containerCss=function(e){var t=this._private.cy,r=t.container(),i=t.window();if(i&&r&&i.getComputedStyle)return i.getComputedStyle(r).getPropertyValue(e)};Fc={};Fc.getRenderedStyle=function(e,t){return t?this.getStylePropertyValue(e,t,!0):this.getRawStyle(e,!0)};Fc.getRawStyle=function(e,t){var r=this;if(e=e[0],e){for(var i={},n=0;n<r.properties.length;n++){var a=r.properties[n],s=r.getStylePropertyValue(e,a.name,t);s!=null&&(i[a.name]=s,i[Y3(a.name)]=s)}return i}};Fc.getIndexedStyle=function(e,t,r,i){var n=e.pstyle(t)[r][i];return n??e.cy().style().getDefaultProperty(t)[r][0]};Fc.getStylePropertyValue=function(e,t,r){var i=this;if(e=e[0],e){var n=i.properties[t];n.alias&&(n=n.pointsTo);var a=n.type,s=e.pstyle(n.name);if(s){var l=s.value,u=s.units,h=s.strValue;if(r&&a.number&&l!=null&&Ot(l)){var d=e.cy().zoom(),f=o(function(v){return v*d},"getRenderedValue"),p=o(function(v,x){return f(v)+x},"getValueStringWithUnits"),m=Si(l),g=m?u.every(function(y){return y!=null}):u!=null;return g?m?l.map(function(y,v){return p(y,u[v])}).join(" "):p(l,u):m?l.map(function(y){return sr(y)?y:""+f(y)}).join(" "):""+f(l)}else if(h!=null)return h}return null}};Fc.getAnimationStartStyle=function(e,t){for(var r={},i=0;i<t.length;i++){var n=t[i],a=n.name,s=e.pstyle(a);s!==void 0&&(Xr(s)?s=this.parse(a,s.strValue):s=this.parse(a,s)),s&&(r[a]=s)}return r};Fc.getPropsList=function(e){var t=this,r=[],i=e,n=t.properties;if(i)for(var a=Object.keys(i),s=0;s<a.length;s++){var l=a[s],u=i[l],h=n[l]||n[dP(l)],d=this.parse(h.name,u);d&&r.push(d)}return r};Fc.getNonDefaultPropertiesHash=function(e,t,r){var i=r.slice(),n,a,s,l,u,h;for(u=0;u<t.length;u++)if(n=t[u],a=e.pstyle(n,!1),a!=null)if(a.pfValue!=null)i[0]=Hb(l,i[0]),i[1]=Yb(l,i[1]);else for(s=a.strValue,h=0;h<s.length;h++)l=s.charCodeAt(h),i[0]=Hb(l,i[0]),i[1]=Yb(l,i[1]);return i};Fc.getPropertiesHash=Fc.getNonDefaultPropertiesHash;sE={};sE.appendFromJson=function(e){for(var t=this,r=0;r<e.length;r++){var i=e[r],n=i.selector,a=i.style||i.css,s=Object.keys(a);t.selector(n);for(var l=0;l<s.length;l++){var u=s[l],h=a[u];t.css(u,h)}}return t};sE.fromJson=function(e){var t=this;return t.resetToDefault(),t.appendFromJson(e),t};sE.json=function(){for(var e=[],t=this.defaultLength;t<this.length;t++){for(var r=this[t],i=r.selector,n=r.properties,a={},s=0;s<n.length;s++){var l=n[s];a[l.name]=l.strValue}e.push({selector:i?i.toString():"core",style:a})}return e};_P={};_P.appendFromString=function(e){var t=this,r=this,i=""+e,n,a,s;i=i.replace(/[/][*](\s|.)+?[*][/]/g,"");function l(){i.length>n.length?i=i.substr(n.length):i=""}o(l,"removeSelAndBlockFromRemaining");function u(){a.length>s.length?a=a.substr(s.length):a=""}for(o(u,"removePropAndValFromRem");;){var h=i.match(/^\s*$/);if(h)break;var d=i.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/);if(!d){di("Halting stylesheet parsing: String stylesheet contains more to parse but no selector and block found in: "+i);break}n=d[0];var f=d[1];if(f!=="core"){var p=new Yd(f);if(p.invalid){di("Skipping parsing of block: Invalid selector found in string stylesheet: "+f),l();continue}}var m=d[2],g=!1;a=m;for(var y=[];;){var v=a.match(/^\s*$/);if(v)break;var x=a.match(/^\s*(.+?)\s*:\s*(.+?)(?:\s*;|\s*$)/);if(!x){di("Skipping parsing of block: Invalid formatting of style property and value definitions found in:"+m),g=!0;break}s=x[0];var b=x[1],T=x[2],w=t.properties[b];if(!w){di("Skipping property: Invalid property name in: "+s),u();continue}var C=r.parse(b,T);if(!C){di("Skipping property: Invalid property definition in: "+s),u();continue}y.push({name:b,val:T}),u()}if(g){l();break}r.selector(f);for(var k=0;k<y.length;k++){var E=y[k];r.css(E.name,E.val)}l()}return r};_P.fromString=function(e){var t=this;return t.resetToDefault(),t.appendFromString(e),t};_n={};(function(){var e=Vn,t=Rtt,r=Mtt,i=Ntt,n=Itt,a=o(function(re){return"^"+re+"\\s*\\(\\s*([\\w\\.]+)\\s*\\)$"},"data"),s=o(function(re){var ee=e+"|\\w+|"+t+"|"+r+"|"+i+"|"+n;return"^"+re+"\\s*\\(([\\w\\.]+)\\s*\\,\\s*("+e+")\\s*\\,\\s*("+e+")\\s*,\\s*("+ee+")\\s*\\,\\s*("+ee+")\\)$"},"mapData"),l=[`^url\\s*\\(\\s*['"]?(.+?)['"]?\\s*\\)$`,"^(none)$","^(.+)$"];_n.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"]},axisDirectionExplicit:{enums:["leftward","rightward","upward","downward"]},axisDirectionPrimary:{enums:["horizontal","vertical"]},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},boxSelection:{enums:["contain","overlap","none"]},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"]},linePosition:{enums:["center","inside","outside"]},lineJoin:{enums:["round","bevel","miter"]},borderStyle:{enums:["solid","dotted","dashed","double"]},curveStyle:{enums:["bezier","unbundled-bezier","haystack","segments","straight","straight-triangle","taxi","round-segments","round-taxi"]},radiusType:{enums:["arc-radius","influence-radius"],multiple:!0},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","circle"]},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"]},cornerRadius:{number:!0,min:0,units:"px|em",implicitUnits:"px",enums:["auto"]},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:a("data")},layoutData:{mapping:!0,regex:a("layoutData")},scratch:{mapping:!0,regex:a("scratch")},mapData:{mapping:!0,regex:s("mapData")},mapLayoutData:{mapping:!0,regex:s("mapLayoutData")},mapScratch:{mapping:!0,regex:s("mapScratch")},fn:{mapping:!0,fn:!0},url:{regexes:l,singleRegexMatchValue:!0},urls:{regexes:l,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:o(function(re,ee){switch(re.length){case 2:return ee[0]!=="deg"&&ee[0]!=="rad"&&ee[1]!=="deg"&&ee[1]!=="rad";case 1:return sr(re[0])||ee[0]==="deg"||ee[0]==="rad";default:return!1}},"validate")},easing:{regexes:["^(spring)\\s*\\(\\s*("+e+")\\s*,\\s*("+e+")\\s*\\)$","^(cubic-bezier)\\s*\\(\\s*("+e+")\\s*,\\s*("+e+")\\s*,\\s*("+e+")\\s*,\\s*("+e+")\\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:o(function(re){var ee=re.length;return ee===1||ee===2||ee===4},"validate")}};var u={zeroNonZero:o(function(re,ee){return(re==null||ee==null)&&re!==ee||re==0&&ee!=0?!0:re!=0&&ee==0},"zeroNonZero"),any:o(function(re,ee){return re!=ee},"any"),emptyNonEmpty:o(function(re,ee){var Te=qd(re),ue=qd(ee);return Te&&!ue||!Te&&ue},"emptyNonEmpty")},h=_n.types,d=[{name:"label",type:h.text,triggersBounds:u.any,triggersZOrder:u.emptyNonEmpty},{name:"text-rotation",type:h.textRotation,triggersBounds:u.any},{name:"text-margin-x",type:h.bidirectionalSize,triggersBounds:u.any},{name:"text-margin-y",type:h.bidirectionalSize,triggersBounds:u.any}],f=[{name:"source-label",type:h.text,triggersBounds:u.any},{name:"source-text-rotation",type:h.textRotation,triggersBounds:u.any},{name:"source-text-margin-x",type:h.bidirectionalSize,triggersBounds:u.any},{name:"source-text-margin-y",type:h.bidirectionalSize,triggersBounds:u.any},{name:"source-text-offset",type:h.size,triggersBounds:u.any}],p=[{name:"target-label",type:h.text,triggersBounds:u.any},{name:"target-text-rotation",type:h.textRotation,triggersBounds:u.any},{name:"target-text-margin-x",type:h.bidirectionalSize,triggersBounds:u.any},{name:"target-text-margin-y",type:h.bidirectionalSize,triggersBounds:u.any},{name:"target-text-offset",type:h.size,triggersBounds:u.any}],m=[{name:"font-family",type:h.fontFamily,triggersBounds:u.any},{name:"font-style",type:h.fontStyle,triggersBounds:u.any},{name:"font-weight",type:h.fontWeight,triggersBounds:u.any},{name:"font-size",type:h.size,triggersBounds:u.any},{name:"text-transform",type:h.textTransform,triggersBounds:u.any},{name:"text-wrap",type:h.textWrap,triggersBounds:u.any},{name:"text-overflow-wrap",type:h.textOverflowWrap,triggersBounds:u.any},{name:"text-max-width",type:h.size,triggersBounds:u.any},{name:"text-outline-width",type:h.size,triggersBounds:u.any},{name:"line-height",type:h.positiveNumber,triggersBounds:u.any}],g=[{name:"text-valign",type:h.valign,triggersBounds:u.any},{name:"text-halign",type:h.halign,triggersBounds:u.any},{name:"color",type:h.color},{name:"text-outline-color",type:h.color},{name:"text-outline-opacity",type:h.zeroOneNumber},{name:"text-background-color",type:h.color},{name:"text-background-opacity",type:h.zeroOneNumber},{name:"text-background-padding",type:h.size,triggersBounds:u.any},{name:"text-border-opacity",type:h.zeroOneNumber},{name:"text-border-color",type:h.color},{name:"text-border-width",type:h.size,triggersBounds:u.any},{name:"text-border-style",type:h.borderStyle,triggersBounds:u.any},{name:"text-background-shape",type:h.textBackgroundShape,triggersBounds:u.any},{name:"text-justification",type:h.justification},{name:"box-select-labels",type:h.bool,triggersBounds:u.any}],y=[{name:"events",type:h.bool,triggersZOrder:u.any},{name:"text-events",type:h.bool,triggersZOrder:u.any},{name:"box-selection",type:h.boxSelection,triggersZOrder:u.any}],v=[{name:"display",type:h.display,triggersZOrder:u.any,triggersBounds:u.any,triggersBoundsOfConnectedEdges:u.any,triggersBoundsOfParallelEdges:o(function(re,ee,Te){return re===ee?!1:Te.pstyle("curve-style").value==="bezier"},"triggersBoundsOfParallelEdges")},{name:"visibility",type:h.visibility,triggersZOrder:u.any},{name:"opacity",type:h.zeroOneNumber,triggersZOrder:u.zeroNonZero},{name:"text-opacity",type:h.zeroOneNumber},{name:"min-zoomed-font-size",type:h.size},{name:"z-compound-depth",type:h.zCompoundDepth,triggersZOrder:u.any},{name:"z-index-compare",type:h.zIndexCompare,triggersZOrder:u.any},{name:"z-index",type:h.number,triggersZOrder:u.any}],x=[{name:"overlay-padding",type:h.size,triggersBounds:u.any},{name:"overlay-color",type:h.color},{name:"overlay-opacity",type:h.zeroOneNumber,triggersBounds:u.zeroNonZero},{name:"overlay-shape",type:h.overlayShape,triggersBounds:u.any},{name:"overlay-corner-radius",type:h.cornerRadius}],b=[{name:"underlay-padding",type:h.size,triggersBounds:u.any},{name:"underlay-color",type:h.color},{name:"underlay-opacity",type:h.zeroOneNumber,triggersBounds:u.zeroNonZero},{name:"underlay-shape",type:h.overlayShape,triggersBounds:u.any},{name:"underlay-corner-radius",type:h.cornerRadius}],T=[{name:"transition-property",type:h.propList},{name:"transition-duration",type:h.time},{name:"transition-delay",type:h.time},{name:"transition-timing-function",type:h.easing}],w=o(function(re,ee){return ee.value==="label"?-re.poolIndex():ee.pfValue},"nodeSizeHashOverride"),C=[{name:"height",type:h.nodeSize,triggersBounds:u.any,hashOverride:w},{name:"width",type:h.nodeSize,triggersBounds:u.any,hashOverride:w},{name:"shape",type:h.nodeShape,triggersBounds:u.any},{name:"shape-polygon-points",type:h.polygonPointList,triggersBounds:u.any},{name:"corner-radius",type:h.cornerRadius},{name:"background-color",type:h.color},{name:"background-fill",type:h.fill},{name:"background-opacity",type:h.zeroOneNumber},{name:"background-blacken",type:h.nOneOneNumber},{name:"background-gradient-stop-colors",type:h.colors},{name:"background-gradient-stop-positions",type:h.percentages},{name:"background-gradient-direction",type:h.gradientDirection},{name:"padding",type:h.sizeMaybePercent,triggersBounds:u.any},{name:"padding-relative-to",type:h.paddingRelativeTo,triggersBounds:u.any},{name:"bounds-expansion",type:h.boundsExpansion,triggersBounds:u.any}],k=[{name:"border-color",type:h.color},{name:"border-opacity",type:h.zeroOneNumber},{name:"border-width",type:h.size,triggersBounds:u.any},{name:"border-style",type:h.borderStyle},{name:"border-cap",type:h.lineCap},{name:"border-join",type:h.lineJoin},{name:"border-dash-pattern",type:h.numbers},{name:"border-dash-offset",type:h.number},{name:"border-position",type:h.linePosition}],E=[{name:"outline-color",type:h.color},{name:"outline-opacity",type:h.zeroOneNumber},{name:"outline-width",type:h.size,triggersBounds:u.any},{name:"outline-style",type:h.borderStyle},{name:"outline-offset",type:h.size,triggersBounds:u.any}],A=[{name:"background-image",type:h.urls},{name:"background-image-crossorigin",type:h.bgCrossOrigin},{name:"background-image-opacity",type:h.zeroOneNumbers},{name:"background-image-containment",type:h.bgContainment},{name:"background-image-smoothing",type:h.bools},{name:"background-position-x",type:h.bgPos},{name:"background-position-y",type:h.bgPos},{name:"background-width-relative-to",type:h.bgRelativeTo},{name:"background-height-relative-to",type:h.bgRelativeTo},{name:"background-repeat",type:h.bgRepeat},{name:"background-fit",type:h.bgFit},{name:"background-clip",type:h.bgClip},{name:"background-width",type:h.bgWH},{name:"background-height",type:h.bgWH},{name:"background-offset-x",type:h.bgPos},{name:"background-offset-y",type:h.bgPos}],N=[{name:"position",type:h.position,triggersBounds:u.any},{name:"compound-sizing-wrt-labels",type:h.compoundIncludeLabels,triggersBounds:u.any},{name:"min-width",type:h.size,triggersBounds:u.any},{name:"min-width-bias-left",type:h.sizeMaybePercent,triggersBounds:u.any},{name:"min-width-bias-right",type:h.sizeMaybePercent,triggersBounds:u.any},{name:"min-height",type:h.size,triggersBounds:u.any},{name:"min-height-bias-top",type:h.sizeMaybePercent,triggersBounds:u.any},{name:"min-height-bias-bottom",type:h.sizeMaybePercent,triggersBounds:u.any}],P=[{name:"line-style",type:h.lineStyle},{name:"line-color",type:h.color},{name:"line-fill",type:h.fill},{name:"line-cap",type:h.lineCap},{name:"line-opacity",type:h.zeroOneNumber},{name:"line-dash-pattern",type:h.numbers},{name:"line-dash-offset",type:h.number},{name:"line-outline-width",type:h.size},{name:"line-outline-color",type:h.color},{name:"line-gradient-stop-colors",type:h.colors},{name:"line-gradient-stop-positions",type:h.percentages},{name:"curve-style",type:h.curveStyle,triggersBounds:u.any,triggersBoundsOfParallelEdges:o(function(re,ee){return re===ee?!1:re==="bezier"||ee==="bezier"},"triggersBoundsOfParallelEdges")},{name:"haystack-radius",type:h.zeroOneNumber,triggersBounds:u.any},{name:"source-endpoint",type:h.edgeEndpoint,triggersBounds:u.any},{name:"target-endpoint",type:h.edgeEndpoint,triggersBounds:u.any},{name:"control-point-step-size",type:h.size,triggersBounds:u.any},{name:"control-point-distances",type:h.bidirectionalSizes,triggersBounds:u.any},{name:"control-point-weights",type:h.numbers,triggersBounds:u.any},{name:"segment-distances",type:h.bidirectionalSizes,triggersBounds:u.any},{name:"segment-weights",type:h.numbers,triggersBounds:u.any},{name:"segment-radii",type:h.numbers,triggersBounds:u.any},{name:"radius-type",type:h.radiusType,triggersBounds:u.any},{name:"taxi-turn",type:h.bidirectionalSizeMaybePercent,triggersBounds:u.any},{name:"taxi-turn-min-distance",type:h.size,triggersBounds:u.any},{name:"taxi-direction",type:h.axisDirection,triggersBounds:u.any},{name:"taxi-radius",type:h.number,triggersBounds:u.any},{name:"edge-distances",type:h.edgeDistances,triggersBounds:u.any},{name:"arrow-scale",type:h.positiveNumber,triggersBounds:u.any},{name:"loop-direction",type:h.angle,triggersBounds:u.any},{name:"loop-sweep",type:h.angle,triggersBounds:u.any},{name:"source-distance-from-node",type:h.size,triggersBounds:u.any},{name:"target-distance-from-node",type:h.size,triggersBounds:u.any}],I=[{name:"ghost",type:h.bool,triggersBounds:u.any},{name:"ghost-offset-x",type:h.bidirectionalSize,triggersBounds:u.any},{name:"ghost-offset-y",type:h.bidirectionalSize,triggersBounds:u.any},{name:"ghost-opacity",type:h.zeroOneNumber}],D=[{name:"selection-box-color",type:h.color},{name:"selection-box-opacity",type:h.zeroOneNumber},{name:"selection-box-border-color",type:h.color},{name:"selection-box-border-width",type:h.size},{name:"active-bg-color",type:h.color},{name:"active-bg-opacity",type:h.zeroOneNumber},{name:"active-bg-size",type:h.size},{name:"outside-texture-bg-color",type:h.color},{name:"outside-texture-bg-opacity",type:h.zeroOneNumber}],_=[];_n.pieBackgroundN=16,_.push({name:"pie-size",type:h.sizeMaybePercent}),_.push({name:"pie-hole",type:h.sizeMaybePercent}),_.push({name:"pie-start-angle",type:h.angle});for(var R=1;R<=_n.pieBackgroundN;R++)_.push({name:"pie-"+R+"-background-color",type:h.color}),_.push({name:"pie-"+R+"-background-size",type:h.percent}),_.push({name:"pie-"+R+"-background-opacity",type:h.zeroOneNumber});var M=[];_n.stripeBackgroundN=16,M.push({name:"stripe-size",type:h.sizeMaybePercent}),M.push({name:"stripe-direction",type:h.axisDirectionPrimary});for(var L=1;L<=_n.stripeBackgroundN;L++)M.push({name:"stripe-"+L+"-background-color",type:h.color}),M.push({name:"stripe-"+L+"-background-size",type:h.percent}),M.push({name:"stripe-"+L+"-background-opacity",type:h.zeroOneNumber});var B=[],O=_n.arrowPrefixes=["source","mid-source","target","mid-target"];[{name:"arrow-shape",type:h.arrowShape,triggersBounds:u.any},{name:"arrow-color",type:h.color},{name:"arrow-fill",type:h.arrowFill},{name:"arrow-width",type:h.arrowWidth}].forEach(function(te){O.forEach(function(re){var ee=re+"-"+te.name,Te=te.type,ue=te.triggersBounds;B.push({name:ee,type:Te,triggersBounds:ue})})},{});var $=_n.properties=[].concat(y,T,v,x,b,I,g,m,d,f,p,C,k,E,A,_,M,N,P,B,D),G=_n.propertyGroups={behavior:y,transition:T,visibility:v,overlay:x,underlay:b,ghost:I,commonLabel:g,labelDimensions:m,mainLabel:d,sourceLabel:f,targetLabel:p,nodeBody:C,nodeBorder:k,nodeOutline:E,backgroundImage:A,pie:_,stripe:M,compound:N,edgeLine:P,edgeArrow:B,core:D},F=_n.propertyGroupNames={},V=_n.propertyGroupKeys=Object.keys(G);V.forEach(function(te){F[te]=G[te].map(function(re){return re.name}),G[te].forEach(function(re){return re.groupKey=te})});var H=_n.aliases=[{name:"content",pointsTo:"label"},{name:"control-point-distance",pointsTo:"control-point-distances"},{name:"control-point-weight",pointsTo:"control-point-weights"},{name:"segment-distance",pointsTo:"segment-distances"},{name:"segment-weight",pointsTo:"segment-weights"},{name:"segment-radius",pointsTo:"segment-radii"},{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"}];_n.propertyNames=$.map(function(te){return te.name});for(var j=0;j<$.length;j++){var U=$[j];$[U.name]=U}for(var Q=0;Q<H.length;Q++){var Y=H[Q],ae=$[Y.pointsTo],J={name:Y.name,alias:!0,pointsTo:ae};$.push(J),$[Y.name]=J}})();_n.getDefaultProperty=function(e){return this.getDefaultProperties()[e]};_n.getDefaultProperties=function(){var e=this._private;if(e.defaultProperties!=null)return e.defaultProperties;for(var t=hr({"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","box-selection":"contain","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","overlay-corner-radius":"auto","underlay-opacity":0,"underlay-color":"#000","underlay-padding":10,"underlay-shape":"round-rectangle","underlay-corner-radius":"auto","transition-property":"none","transition-duration":0,"transition-delay":0,"transition-timing-function":"linear","box-select-labels":"no","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","border-dash-pattern":[4,2],"border-dash-offset":0,"border-cap":"butt","border-join":"miter","border-position":"center","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","corner-radius":"auto","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%","pie-hole":0,"pie-start-angle":"0deg"},[{name:"pie-{{i}}-background-color",value:"black"},{name:"pie-{{i}}-background-size",value:"0%"},{name:"pie-{{i}}-background-opacity",value:1}].reduce(function(u,h){for(var d=1;d<=_n.pieBackgroundN;d++){var f=h.name.replace("{{i}}",d),p=h.value;u[f]=p}return u},{}),{"stripe-size":"100%","stripe-direction":"horizontal"},[{name:"stripe-{{i}}-background-color",value:"black"},{name:"stripe-{{i}}-background-size",value:"0%"},{name:"stripe-{{i}}-background-opacity",value:1}].reduce(function(u,h){for(var d=1;d<=_n.stripeBackgroundN;d++){var f=h.name.replace("{{i}}",d),p=h.value;u[f]=p}return u},{}),{"line-style":"solid","line-color":"#999","line-fill":"solid","line-cap":"butt","line-opacity":1,"line-outline-width":0,"line-outline-color":"#000","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,"segment-radii":15,"radius-type":"arc-radius","taxi-turn":"50%","taxi-radius":15,"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(u,h){return _n.arrowPrefixes.forEach(function(d){var f=d+"-"+h.name,p=h.value;u[f]=p}),u},{})),r={},i=0;i<this.properties.length;i++){var n=this.properties[i];if(!n.pointsTo){var a=n.name,s=t[a],l=this.parse(a,s);r[a]=l}}return e.defaultProperties=r,e.defaultProperties};_n.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};oE={};oE.parse=function(e,t,r,i){var n=this;if(Ji(t))return n.parseImplWarn(e,t,r,i);var a=i==="mapping"||i===!0||i===!1||i==null?"dontcare":i,s=r?"t":"f",l=""+t,u=nme(e,l,s,a),h=n.propCache=n.propCache||[],d;return(d=h[u])||(d=h[u]=n.parseImplWarn(e,t,r,i)),(r||i==="mapping")&&(d=Bc(d),d&&(d.value=Bc(d.value))),d};oE.parseImplWarn=function(e,t,r,i){var n=this.parseImpl(e,t,r,i);return!n&&t!=null&&di("The style property `".concat(e,": ").concat(t,"` is invalid")),n&&(n.name==="width"||n.name==="height")&&t==="label"&&di("The style value of `label` is deprecated for `"+n.name+"`"),n};oE.parseImpl=function(e,t,r,i){var n=this;e=dP(e);var a=n.properties[e],s=t,l=n.types;if(!a||t===void 0)return null;a.alias&&(a=a.pointsTo,e=a.name);var u=sr(t);u&&(t=t.trim());var h=a.type;if(!h)return null;if(r&&(t===""||t===null))return{name:e,value:t,bypass:!0,deleteBypass:!0};if(Ji(t))return{name:e,value:t,strValue:"fn",mapped:l.fn,bypass:r};var d,f;if(!(!u||i||t.length<7||t[1]!=="a")){if(t.length>=7&&t[0]==="d"&&(d=new RegExp(l.data.regex).exec(t))){if(r)return!1;var p=l.data;return{name:e,value:d,strValue:""+t,mapped:p,field:d[1],bypass:r}}else if(t.length>=10&&t[0]==="m"&&(f=new RegExp(l.mapData.regex).exec(t))){if(r||h.multiple)return!1;var m=l.mapData;if(!(h.color||h.number))return!1;var g=this.parse(e,f[4]);if(!g||g.mapped)return!1;var y=this.parse(e,f[5]);if(!y||y.mapped)return!1;if(g.pfValue===y.pfValue||g.strValue===y.strValue)return di("`"+e+": "+t+"` is not a valid mapper because the output range is zero; converting to `"+e+": "+g.strValue+"`"),this.parse(e,g.strValue);if(h.color){var v=g.value,x=y.value,b=v[0]===x[0]&&v[1]===x[1]&&v[2]===x[2]&&(v[3]===x[3]||(v[3]==null||v[3]===1)&&(x[3]==null||x[3]===1));if(b)return!1}return{name:e,value:f,strValue:""+t,mapped:m,field:f[1],fieldMin:parseFloat(f[2]),fieldMax:parseFloat(f[3]),valueMin:g.value,valueMax:y.value,bypass:r}}}if(h.multiple&&i!=="multiple"){var T;if(u?T=t.split(/\s+/):Si(t)?T=t:T=[t],h.evenMultiple&&T.length%2!==0)return null;for(var w=[],C=[],k=[],E="",A=!1,N=0;N<T.length;N++){var P=n.parse(e,T[N],r,"multiple");A=A||sr(P.value),w.push(P.value),k.push(P.pfValue!=null?P.pfValue:P.value),C.push(P.units),E+=(N>0?" ":"")+P.strValue}return h.validate&&!h.validate(w,C)?null:h.singleEnum&&A?w.length===1&&sr(w[0])?{name:e,value:w[0],strValue:w[0],bypass:r}:null:{name:e,value:w,pfValue:k,strValue:E,bypass:r,units:C}}var I=o(function(){for(var J=0;J<h.enums.length;J++){var te=h.enums[J];if(te===t)return{name:e,value:t,strValue:""+t,bypass:r}}return null},"checkEnums");if(h.number){var D,_="px";if(h.units&&(D=h.units),h.implicitUnits&&(_=h.implicitUnits),!h.unitless)if(u){var R="px|em"+(h.allowPercent?"|\\%":"");D&&(R=D);var M=t.match("^("+Vn+")("+R+")?$");M&&(t=M[1],D=M[2]||_)}else(!D||h.implicitUnits)&&(D=_);if(t=parseFloat(t),isNaN(t)&&h.enums===void 0)return null;if(isNaN(t)&&h.enums!==void 0)return t=s,I();if(h.integer&&!ktt(t)||h.min!==void 0&&(t<h.min||h.strictMin&&t===h.min)||h.max!==void 0&&(t>h.max||h.strictMax&&t===h.max))return null;var L={name:e,value:t,strValue:""+t+(D||""),units:D,bypass:r};return h.unitless||D!=="px"&&D!=="em"?L.pfValue=t:L.pfValue=D==="px"||!D?t:this.getEmSizeInPixels()*t,(D==="ms"||D==="s")&&(L.pfValue=D==="ms"?t:1e3*t),(D==="deg"||D==="rad")&&(L.pfValue=D==="rad"?t:Nrt(t)),D==="%"&&(L.pfValue=t/100),L}else if(h.propList){var B=[],O=""+t;if(O!=="none"){for(var $=O.split(/\s*,\s*|\s+/),G=0;G<$.length;G++){var F=$[G].trim();n.properties[F]?B.push(F):di("`"+F+"` is not a valid property name")}if(B.length===0)return null}return{name:e,value:B,strValue:B.length===0?"none":B.join(" "),bypass:r}}else if(h.color){var V=Z0e(t);return V?{name:e,value:V,pfValue:V,strValue:"rgb("+V[0]+","+V[1]+","+V[2]+")",bypass:r}:null}else if(h.regex||h.regexes){if(h.enums){var H=I();if(H)return H}for(var j=h.regexes?h.regexes:[h.regex],U=0;U<j.length;U++){var Q=new RegExp(j[U]),Y=Q.exec(t);if(Y)return{name:e,value:h.singleRegexMatchValue?Y[1]:Y,strValue:""+t,bypass:r}}return null}else return h.string?{name:e,value:""+t,strValue:""+t,bypass:r}:h.enums?I():null};aa=o(function(t){if(!(this instanceof aa))return new aa(t);if(!hP(t)){Yi("A style must have a core reference");return}this._private={cy:t,coreStyle:{}},this.length=0,this.resetToDefault()},"Style"),Pa=aa.prototype;Pa.instanceString=function(){return"style"};Pa.clear=function(){for(var e=this._private,t=e.cy,r=t.elements(),i=0;i<this.length;i++)this[i]=void 0;return this.length=0,e.contextStyles={},e.propDiffs={},this.cleanElements(r,!0),r.forEach(function(n){var a=n[0]._private;a.styleDirty=!0,a.appliedInitStyle=!1}),this};Pa.resetToDefault=function(){return this.clear(),this.addDefaultStylesheet(),this};Pa.core=function(e){return this._private.coreStyle[e]||this.getDefaultProperty(e)};Pa.selector=function(e){var t=e==="core"?null:new Yd(e),r=this.length++;return this[r]={selector:t,properties:[],mappedProperties:[],index:r},this};Pa.css=function(){var e=this,t=arguments;if(t.length===1)for(var r=t[0],i=0;i<e.properties.length;i++){var n=e.properties[i],a=r[n.name];a===void 0&&(a=r[Y3(n.name)]),a!==void 0&&this.cssRule(n.name,a)}else t.length===2&&this.cssRule(t[0],t[1]);return this};Pa.style=Pa.css;Pa.cssRule=function(e,t){var r=this.parse(e,t);if(r){var i=this.length-1;this[i].properties.push(r),this[i].properties[r.name]=r,r.name.match(/pie-(\d+)-background-size/)&&r.value&&(this._private.hasPie=!0),r.name.match(/stripe-(\d+)-background-size/)&&r.value&&(this._private.hasStripe=!0),r.mapped&&this[i].mappedProperties.push(r);var n=!this[i].selector;n&&(this._private.coreStyle[r.name]=r)}return this};Pa.append=function(e){return j0e(e)?e.appendToStyle(this):Si(e)?this.appendFromJson(e):sr(e)&&this.appendFromString(e),this};aa.fromJson=function(e,t){var r=new aa(e);return r.fromJson(t),r};aa.fromString=function(e,t){return new aa(e).fromString(t)};[sa,u2,AP,Fc,sE,_P,_n,oE].forEach(function(e){hr(Pa,e)});aa.types=Pa.types;aa.properties=Pa.properties;aa.propertyGroups=Pa.propertyGroups;aa.propertyGroupNames=Pa.propertyGroupNames;aa.propertyGroupKeys=Pa.propertyGroupKeys;Bat={style:o(function(t){if(t){var r=this.setStyle(t);r.update()}return this._private.style},"style"),setStyle:o(function(t){var r=this._private;return j0e(t)?r.style=t.generateStyle(this):Si(t)?r.style=aa.fromJson(this,t):sr(t)?r.style=aa.fromString(this,t):r.style=aa(this),r.style},"setStyle"),updateStyle:o(function(){this.mutableElements().updateStyle()},"updateStyle")},Fat="single",r0={autolock:o(function(t){if(t!==void 0)this._private.autolock=!!t;else return this._private.autolock;return this},"autolock"),autoungrabify:o(function(t){if(t!==void 0)this._private.autoungrabify=!!t;else return this._private.autoungrabify;return this},"autoungrabify"),autounselectify:o(function(t){if(t!==void 0)this._private.autounselectify=!!t;else return this._private.autounselectify;return this},"autounselectify"),selectionType:o(function(t){var r=this._private;if(r.selectionType==null&&(r.selectionType=Fat),t!==void 0)(t==="additive"||t==="single")&&(r.selectionType=t);else return r.selectionType;return this},"selectionType"),panningEnabled:o(function(t){if(t!==void 0)this._private.panningEnabled=!!t;else return this._private.panningEnabled;return this},"panningEnabled"),userPanningEnabled:o(function(t){if(t!==void 0)this._private.userPanningEnabled=!!t;else return this._private.userPanningEnabled;return this},"userPanningEnabled"),zoomingEnabled:o(function(t){if(t!==void 0)this._private.zoomingEnabled=!!t;else return this._private.zoomingEnabled;return this},"zoomingEnabled"),userZoomingEnabled:o(function(t){if(t!==void 0)this._private.userZoomingEnabled=!!t;else return this._private.userZoomingEnabled;return this},"userZoomingEnabled"),boxSelectionEnabled:o(function(t){if(t!==void 0)this._private.boxSelectionEnabled=!!t;else return this._private.boxSelectionEnabled;return this},"boxSelectionEnabled"),pan:o(function(){var t=arguments,r=this._private.pan,i,n,a,s,l;switch(t.length){case 0:return r;case 1:if(sr(t[0]))return i=t[0],r[i];if(Xr(t[0])){if(!this._private.panningEnabled)return this;a=t[0],s=a.x,l=a.y,Ot(s)&&(r.x=s),Ot(l)&&(r.y=l),this.emit("pan viewport")}break;case 2:if(!this._private.panningEnabled)return this;i=t[0],n=t[1],(i==="x"||i==="y")&&Ot(n)&&(r[i]=n),this.emit("pan viewport");break}return this.notify("viewport"),this},"pan"),panBy:o(function(t,r){var i=arguments,n=this._private.pan,a,s,l,u,h;if(!this._private.panningEnabled)return this;switch(i.length){case 1:Xr(t)&&(l=i[0],u=l.x,h=l.y,Ot(u)&&(n.x+=u),Ot(h)&&(n.y+=h),this.emit("pan viewport"));break;case 2:a=t,s=r,(a==="x"||a==="y")&&Ot(s)&&(n[a]+=s),this.emit("pan viewport");break}return this.notify("viewport"),this},"panBy"),gc:o(function(){this.notify("gc")},"gc"),fit:o(function(t,r){var i=this.getFitViewport(t,r);if(i){var n=this._private;n.zoom=i.zoom,n.pan=i.pan,this.emit("pan zoom viewport"),this.notify("viewport")}return this},"fit"),getFitViewport:o(function(t,r){if(Ot(t)&&r===void 0&&(r=t,t=void 0),!(!this._private.panningEnabled||!this._private.zoomingEnabled)){var i;if(sr(t)){var n=t;t=this.$(n)}else if(Ett(t)){var a=t;i={x1:a.x1,y1:a.y1,x2:a.x2,y2:a.y2},i.w=i.x2-i.x1,i.h=i.y2-i.y1}else uo(t)||(t=this.mutableElements());if(!(uo(t)&&t.empty())){i=i||t.boundingBox();var s=this.width(),l=this.height(),u;if(r=Ot(r)?r:0,!isNaN(s)&&!isNaN(l)&&s>0&&l>0&&!isNaN(i.w)&&!isNaN(i.h)&&i.w>0&&i.h>0){u=Math.min((s-2*r)/i.w,(l-2*r)/i.h),u=u>this._private.maxZoom?this._private.maxZoom:u,u=u<this._private.minZoom?this._private.minZoom:u;var h={x:(s-u*(i.x1+i.x2))/2,y:(l-u*(i.y1+i.y2))/2};return{zoom:u,pan:h}}}}},"getFitViewport"),zoomRange:o(function(t,r){var i=this._private;if(r==null){var n=t;t=n.min,r=n.max}return Ot(t)&&Ot(r)&&t<=r?(i.minZoom=t,i.maxZoom=r):Ot(t)&&r===void 0&&t<=i.maxZoom?i.minZoom=t:Ot(r)&&t===void 0&&r>=i.minZoom&&(i.maxZoom=r),this},"zoomRange"),minZoom:o(function(t){return t===void 0?this._private.minZoom:this.zoomRange({min:t})},"minZoom"),maxZoom:o(function(t){return t===void 0?this._private.maxZoom:this.zoomRange({max:t})},"maxZoom"),getZoomedViewport:o(function(t){var r=this._private,i=r.pan,n=r.zoom,a,s,l=!1;if(r.zoomingEnabled||(l=!0),Ot(t)?s=t:Xr(t)&&(s=t.level,t.position!=null?a=K3(t.position,n,i):t.renderedPosition!=null&&(a=t.renderedPosition),a!=null&&!r.panningEnabled&&(l=!0)),s=s>r.maxZoom?r.maxZoom:s,s=s<r.minZoom?r.minZoom:s,l||!Ot(s)||s===n||a!=null&&(!Ot(a.x)||!Ot(a.y)))return null;if(a!=null){var u=i,h=n,d=s,f={x:-d/h*(a.x-u.x)+a.x,y:-d/h*(a.y-u.y)+a.y};return{zoomed:!0,panned:!0,zoom:d,pan:f}}else return{zoomed:!0,panned:!1,zoom:s,pan:i}},"getZoomedViewport"),zoom:o(function(t){if(t===void 0)return this._private.zoom;var r=this.getZoomedViewport(t),i=this._private;return r==null||!r.zoomed?this:(i.zoom=r.zoom,r.panned&&(i.pan.x=r.pan.x,i.pan.y=r.pan.y),this.emit("zoom"+(r.panned?" pan":"")+" viewport"),this.notify("viewport"),this)},"zoom"),viewport:o(function(t){var r=this._private,i=!0,n=!0,a=[],s=!1,l=!1;if(!t)return this;if(Ot(t.zoom)||(i=!1),Xr(t.pan)||(n=!1),!i&&!n)return this;if(i){var u=t.zoom;u<r.minZoom||u>r.maxZoom||!r.zoomingEnabled?s=!0:(r.zoom=u,a.push("zoom"))}if(n&&(!s||!t.cancelOnFailedZoom)&&r.panningEnabled){var h=t.pan;Ot(h.x)&&(r.pan.x=h.x,l=!1),Ot(h.y)&&(r.pan.y=h.y,l=!1),l||a.push("pan")}return a.length>0&&(a.push("viewport"),this.emit(a.join(" ")),this.notify("viewport")),this},"viewport"),center:o(function(t){var r=this.getCenterPan(t);return r&&(this._private.pan=r,this.emit("pan viewport"),this.notify("viewport")),this},"center"),getCenterPan:o(function(t,r){if(this._private.panningEnabled){if(sr(t)){var i=t;t=this.mutableElements().filter(i)}else uo(t)||(t=this.mutableElements());if(t.length!==0){var n=t.boundingBox(),a=this.width(),s=this.height();r=r===void 0?this._private.zoom:r;var l={x:(a-r*(n.x1+n.x2))/2,y:(s-r*(n.y1+n.y2))/2};return l}}},"getCenterPan"),reset:o(function(){return!this._private.panningEnabled||!this._private.zoomingEnabled?this:(this.viewport({pan:{x:0,y:0},zoom:1}),this)},"reset"),invalidateSize:o(function(){this._private.sizeCache=null},"invalidateSize"),size:o(function(){var t=this._private,r=t.container,i=this;return t.sizeCache=t.sizeCache||(r?(function(){var n=i.window().getComputedStyle(r),a=o(function(l){return parseFloat(n.getPropertyValue(l))},"val");return{width:r.clientWidth-a("padding-left")-a("padding-right"),height:r.clientHeight-a("padding-top")-a("padding-bottom")}})():{width:1,height:1})},"size"),width:o(function(){return this.size().width},"width"),height:o(function(){return this.size().height},"height"),extent:o(function(){var t=this._private.pan,r=this._private.zoom,i=this.renderedExtent(),n={x1:(i.x1-t.x)/r,x2:(i.x2-t.x)/r,y1:(i.y1-t.y)/r,y2:(i.y2-t.y)/r};return n.w=n.x2-n.x1,n.h=n.y2-n.y1,n},"extent"),renderedExtent:o(function(){var t=this.width(),r=this.height();return{x1:0,y1:0,x2:t,y2:r,w:t,h:r}},"renderedExtent"),multiClickDebounceTime:o(function(t){if(t)this._private.multiClickDebounceTime=t;else return this._private.multiClickDebounceTime;return this},"multiClickDebounceTime")};r0.centre=r0.center;r0.autolockNodes=r0.autolock;r0.autoungrabifyNodes=r0.autoungrabify;Jb={data:hi.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeData:hi.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),scratch:hi.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:hi.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0})};Jb.attr=Jb.data;Jb.removeAttr=Jb.removeData;e2=o(function(t){var r=this;t=hr({},t);var i=t.container;i&&!I3(i)&&I3(i[0])&&(i=i[0]);var n=i?i._cyreg:null;n=n||{},n&&n.cy&&(n.cy.destroy(),n={});var a=n.readies=n.readies||[];i&&(i._cyreg=n),n.cy=r;var s=Gn!==void 0&&i!==void 0&&!t.headless,l=t;l.layout=hr({name:s?"grid":"null"},l.layout),l.renderer=hr({name:s?"canvas":"null"},l.renderer);var u=o(function(g,y,v){return y!==void 0?y:v!==void 0?v:g},"defVal"),h=this._private={container:i,ready:!1,options:l,elements:new ya(this),listeners:[],aniEles:new ya(this),data:l.data||{},scratch:{},layout:null,renderer:null,destroyed:!1,notificationsEnabled:!0,minZoom:1e-50,maxZoom:1e50,zoomingEnabled:u(!0,l.zoomingEnabled),userZoomingEnabled:u(!0,l.userZoomingEnabled),panningEnabled:u(!0,l.panningEnabled),userPanningEnabled:u(!0,l.userPanningEnabled),boxSelectionEnabled:u(!0,l.boxSelectionEnabled),autolock:u(!1,l.autolock,l.autolockNodes),autoungrabify:u(!1,l.autoungrabify,l.autoungrabifyNodes),autounselectify:u(!1,l.autounselectify),styleEnabled:l.styleEnabled===void 0?s:l.styleEnabled,zoom:Ot(l.zoom)?l.zoom:1,pan:{x:Xr(l.pan)&&Ot(l.pan.x)?l.pan.x:0,y:Xr(l.pan)&&Ot(l.pan.y)?l.pan.y:0},animation:{current:[],queue:[]},hasCompoundNodes:!1,multiClickDebounceTime:u(250,l.multiClickDebounceTime)};this.createEmitter(),this.selectionType(l.selectionType),this.zoomRange({min:l.minZoom,max:l.maxZoom});var d=o(function(g,y){var v=g.some(Att);if(v)return v1.all(g).then(y);y(g)},"loadExtData");h.styleEnabled&&r.setStyle([]);var f=hr({},l,l.renderer);r.initRenderer(f);var p=o(function(g,y,v){r.notifications(!1);var x=r.mutableElements();x.length>0&&x.remove(),g!=null&&(Xr(g)||Si(g))&&r.add(g),r.one("layoutready",function(T){r.notifications(!0),r.emit(T),r.one("load",y),r.emitAndNotify("load")}).one("layoutstop",function(){r.one("done",v),r.emit("done")});var b=hr({},r._private.options.layout);b.eles=r.elements(),r.layout(b).run()},"setElesAndLayout");d([l.style,l.elements],function(m){var g=m[0],y=m[1];h.styleEnabled&&r.style().append(g),p(y,function(){r.startAnimationLoop(),h.ready=!0,Ji(l.ready)&&r.on("ready",l.ready);for(var v=0;v<a.length;v++){var x=a[v];r.on("ready",x)}n&&(n.readies=[]),r.emit("ready")},l.done)})},"Core"),G3=e2.prototype;hr(G3,{instanceString:o(function(){return"core"},"instanceString"),isReady:o(function(){return this._private.ready},"isReady"),destroyed:o(function(){return this._private.destroyed},"destroyed"),ready:o(function(t){return this.isReady()?this.emitter().emit("ready",[],t):this.on("ready",t),this},"ready"),destroy:o(function(){var t=this;if(!t.destroyed())return t.stopAnimationLoop(),t.destroyRenderer(),this.emit("destroy"),t._private.destroyed=!0,t},"destroy"),hasElementWithId:o(function(t){return this._private.elements.hasElementWithId(t)},"hasElementWithId"),getElementById:o(function(t){return this._private.elements.getElementById(t)},"getElementById"),hasCompoundNodes:o(function(){return this._private.hasCompoundNodes},"hasCompoundNodes"),headless:o(function(){return this._private.renderer.isHeadless()},"headless"),styleEnabled:o(function(){return this._private.styleEnabled},"styleEnabled"),addToPool:o(function(t){return this._private.elements.merge(t),this},"addToPool"),removeFromPool:o(function(t){return this._private.elements.unmerge(t),this},"removeFromPool"),container:o(function(){return this._private.container||null},"container"),window:o(function(){var t=this._private.container;if(t==null)return Gn;var r=this._private.container.ownerDocument;return r===void 0||r==null?Gn:r.defaultView||Gn},"window"),mount:o(function(t){if(t!=null){var r=this,i=r._private,n=i.options;return!I3(t)&&I3(t[0])&&(t=t[0]),r.stopAnimationLoop(),r.destroyRenderer(),i.container=t,i.styleEnabled=!0,r.invalidateSize(),r.initRenderer(hr({},n,n.renderer,{name:n.renderer.name==="null"?"canvas":n.renderer.name})),r.startAnimationLoop(),r.style(n.style),r.emit("mount"),r}},"mount"),unmount:o(function(){var t=this;return t.stopAnimationLoop(),t.destroyRenderer(),t.initRenderer({name:"null"}),t.emit("unmount"),t},"unmount"),options:o(function(){return Bc(this._private.options)},"options"),json:o(function(t){var r=this,i=r._private,n=r.mutableElements(),a=o(function(w){return r.getElementById(w.id())},"getFreshRef");if(Xr(t)){if(r.startBatch(),t.elements){var s={},l=o(function(w,C){for(var k=[],E=[],A=0;A<w.length;A++){var N=w[A];if(!N.data.id){di("cy.json() cannot handle elements without an ID attribute");continue}var P=""+N.data.id,I=r.getElementById(P);s[P]=!0,I.length!==0?E.push({ele:I,json:N}):(C&&(N.group=C),k.push(N))}r.add(k);for(var D=0;D<E.length;D++){var _=E[D],R=_.ele,M=_.json;R.json(M)}},"updateEles");if(Si(t.elements))l(t.elements);else for(var u=["nodes","edges"],h=0;h<u.length;h++){var d=u[h],f=t.elements[d];Si(f)&&l(f,d)}var p=r.collection();n.filter(function(T){return!s[T.id()]}).forEach(function(T){T.isParent()?p.merge(T):T.remove()}),p.forEach(function(T){return T.children().move({parent:null})}),p.forEach(function(T){return a(T).remove()})}t.style&&r.style(t.style),t.zoom!=null&&t.zoom!==i.zoom&&r.zoom(t.zoom),t.pan&&(t.pan.x!==i.pan.x||t.pan.y!==i.pan.y)&&r.pan(t.pan),t.data&&r.data(t.data);for(var m=["minZoom","maxZoom","zoomingEnabled","userZoomingEnabled","panningEnabled","userPanningEnabled","boxSelectionEnabled","autolock","autoungrabify","autounselectify","multiClickDebounceTime"],g=0;g<m.length;g++){var y=m[g];t[y]!=null&&r[y](t[y])}return r.endBatch(),this}else{var v=!!t,x={};v?x.elements=this.elements().map(function(T){return T.json()}):(x.elements={},n.forEach(function(T){var w=T.group();x.elements[w]||(x.elements[w]=[]),x.elements[w].push(T.json())})),this._private.styleEnabled&&(x.style=r.style().json()),x.data=Bc(r.data());var b=i.options;return x.zoomingEnabled=i.zoomingEnabled,x.userZoomingEnabled=i.userZoomingEnabled,x.zoom=i.zoom,x.minZoom=i.minZoom,x.maxZoom=i.maxZoom,x.panningEnabled=i.panningEnabled,x.userPanningEnabled=i.userPanningEnabled,x.pan=Bc(i.pan),x.boxSelectionEnabled=i.boxSelectionEnabled,x.renderer=Bc(b.renderer),x.hideEdgesOnViewport=b.hideEdgesOnViewport,x.textureOnViewport=b.textureOnViewport,x.wheelSensitivity=b.wheelSensitivity,x.motionBlur=b.motionBlur,x.multiClickDebounceTime=b.multiClickDebounceTime,x}},"json")});G3.$id=G3.getElementById;[Aat,Mat,jme,JO,_3,Iat,eP,D3,Bat,r0,Jb].forEach(function(e){hr(G3,e)});$at={fit:!0,directed:!1,direction:"downward",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:o(function(t,r){return!0},"animateFilter"),ready:void 0,stop:void 0,transform:o(function(t,r){return r},"transform")},zat={maximal:!1,acyclic:!1},r1=o(function(t){return t.scratch("breadthfirst")},"getInfo"),g0e=o(function(t,r){return t.scratch("breadthfirst",r)},"setInfo");o(Xme,"BreadthFirstLayout");Xme.prototype.run=function(){var e=this.options,t=e.cy,r=e.eles,i=r.nodes().filter(function(Me){return Me.isChildless()}),n=r,a=e.directed,s=e.acyclic||e.maximal||e.maximalAdjustments>0,l=!!e.boundingBox,u=is(l?e.boundingBox:structuredClone(t.extent())),h;if(uo(e.roots))h=e.roots;else if(Si(e.roots)){for(var d=[],f=0;f<e.roots.length;f++){var p=e.roots[f],m=t.getElementById(p);d.push(m)}h=t.collection(d)}else if(sr(e.roots))h=t.$(e.roots);else if(a)h=i.roots();else{var g=r.components();h=t.collection();for(var y=o(function(){var $e=g[v],de=$e.maxDegree(!1),rt=$e.filter(function(ke){return ke.degree(!1)===de});h=h.add(rt)},"_loop"),v=0;v<g.length;v++)y()}var x=[],b={},T=o(function($e,de){x[de]==null&&(x[de]=[]);var rt=x[de].length;x[de].push($e),g0e($e,{index:rt,depth:de})},"addToDepth"),w=o(function($e,de){var rt=r1($e),ke=rt.depth,Fe=rt.index;x[ke][Fe]=null,$e.isChildless()&&T($e,de)},"changeDepth");n.bfs({roots:h,directed:e.directed,visit:o(function($e,de,rt,ke,Fe){var He=$e[0],at=He.id();He.isChildless()&&T(He,Fe),b[at]=!0},"visit")});for(var C=[],k=0;k<i.length;k++){var E=i[k];b[E.id()]||C.push(E)}var A=o(function($e){for(var de=x[$e],rt=0;rt<de.length;rt++){var ke=de[rt];if(ke==null){de.splice(rt,1),rt--;continue}g0e(ke,{depth:$e,index:rt})}},"assignDepthsAt"),N=o(function($e,de){for(var rt=r1($e),ke=$e.incomers().filter(function(ve){return ve.isNode()&&r.has(ve)}),Fe=-1,He=$e.id(),at=0;at<ke.length;at++){var qe=ke[at],Ue=r1(qe);Fe=Math.max(Fe,Ue.depth)}if(rt.depth<=Fe){if(!e.acyclic&&de[He])return null;var ye=Fe+1;return w($e,ye),de[He]=ye,!0}return!1},"adjustMaximally");if(a&&s){var P=[],I={},D=o(function($e){return P.push($e)},"enqueue"),_=o(function(){return P.shift()},"dequeue");for(i.forEach(function(Me){return P.push(Me)});P.length>0;){var R=_(),M=N(R,I);if(M)R.outgoers().filter(function(Me){return Me.isNode()&&r.has(Me)}).forEach(D);else if(M===null){di("Detected double maximal shift for node `"+R.id()+"`. Bailing maximal adjustment due to cycle. Use `options.maximal: true` only on DAGs.");break}}}var L=0;if(e.avoidOverlap)for(var B=0;B<i.length;B++){var O=i[B],$=O.layoutDimensions(e),G=$.w,F=$.h;L=Math.max(L,G,F)}var V={},H=o(function($e){if(V[$e.id()])return V[$e.id()];for(var de=r1($e).depth,rt=$e.neighborhood(),ke=0,Fe=0,He=0;He<rt.length;He++){var at=rt[He];if(!(at.isEdge()||at.isParent()||!i.has(at))){var qe=r1(at);if(qe!=null){var Ue=qe.index,ye=qe.depth;if(!(Ue==null||ye==null)){var ve=x[ye].length;ye<de&&(ke+=Ue/ve,Fe++)}}}}return Fe=Math.max(1,Fe),ke=ke/Fe,Fe===0&&(ke=0),V[$e.id()]=ke,ke},"getWeightedPercent"),j=o(function($e,de){var rt=H($e),ke=H(de),Fe=rt-ke;return Fe===0?K0e($e.id(),de.id()):Fe},"sortFn");e.depthSort!==void 0&&(j=e.depthSort);for(var U=x.length,Q=0;Q<U;Q++)x[Q].sort(j),A(Q);for(var Y=[],ae=0;ae<C.length;ae++)Y.push(C[ae]);var J=o(function(){for(var $e=0;$e<U;$e++)A($e)},"assignDepths");Y.length&&(x.unshift(Y),U=x.length,J());for(var te=0,re=0;re<U;re++)te=Math.max(x[re].length,te);var ee={x:u.x1+u.w/2,y:u.y1+u.h/2},Te=i.reduce(function(Me,$e){return(function(de){return{w:Me.w===-1?de.w:(Me.w+de.w)/2,h:Me.h===-1?de.h:(Me.h+de.h)/2}})($e.boundingBox({includeLabels:e.nodeDimensionsIncludeLabels}))},{w:-1,h:-1}),ue=Math.max(U===1?0:l?(u.h-e.padding*2-Te.h)/(U-1):(u.h-e.padding*2-Te.h)/(U+1),L),De=x.reduce(function(Me,$e){return Math.max(Me,$e.length)},0),Ie=o(function($e){var de=r1($e),rt=de.depth,ke=de.index;if(e.circle){var Fe=Math.min(u.w/2/U,u.h/2/U);Fe=Math.max(Fe,L);var He=Fe*rt+Fe-(U>0&&x[0].length<=3?Fe/2:0),at=2*Math.PI/x[rt].length*ke;return rt===0&&x[0].length===1&&(He=1),{x:ee.x+He*Math.cos(at),y:ee.y+He*Math.sin(at)}}else{var qe=x[rt].length,Ue=Math.max(qe===1?0:l?(u.w-e.padding*2-Te.w)/((e.grid?De:qe)-1):(u.w-e.padding*2-Te.w)/((e.grid?De:qe)+1),L),ye={x:ee.x+(ke+1-(qe+1)/2)*Ue,y:ee.y+(rt+1-(U+1)/2)*ue};return ye}},"getPositionTopBottom"),Ee={downward:0,leftward:90,upward:180,rightward:-90};Object.keys(Ee).indexOf(e.direction)===-1&&Yi("Invalid direction '".concat(e.direction,"' specified for breadthfirst layout. Valid values are: ").concat(Object.keys(Ee).join(", ")));var we=o(function($e){return rrt(Ie($e),u,Ee[e.direction])},"getPosition");return r.nodes().layoutPositions(this,e,we),this};Gat={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:o(function(t,r){return!0},"animateFilter"),ready:void 0,stop:void 0,transform:o(function(t,r){return r},"transform")};o(Kme,"CircleLayout");Kme.prototype.run=function(){var e=this.options,t=e,r=e.cy,i=t.eles,n=t.counterclockwise!==void 0?!t.counterclockwise:t.clockwise,a=i.nodes().not(":parent");t.sort&&(a=a.sort(t.sort));for(var s=is(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()}),l={x:s.x1+s.w/2,y:s.y1+s.h/2},u=t.sweep===void 0?2*Math.PI-2*Math.PI/a.length:t.sweep,h=u/Math.max(1,a.length-1),d,f=0,p=0;p<a.length;p++){var m=a[p],g=m.layoutDimensions(t),y=g.w,v=g.h;f=Math.max(f,y,v)}if(Ot(t.radius)?d=t.radius:a.length<=1?d=0:d=Math.min(s.h,s.w)/2-f,a.length>1&&t.avoidOverlap){f*=1.75;var x=Math.cos(h)-Math.cos(0),b=Math.sin(h)-Math.sin(0),T=Math.sqrt(f*f/(x*x+b*b));d=Math.max(T,d)}var w=o(function(k,E){var A=t.startAngle+E*h*(n?1:-1),N=d*Math.cos(A),P=d*Math.sin(A),I={x:l.x+N,y:l.y+P};return I},"getPos");return i.nodes().layoutPositions(this,t,w),this};Vat={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:o(function(t){return t.degree()},"concentric"),levelWidth:o(function(t){return t.maxDegree()/4},"levelWidth"),animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:o(function(t,r){return!0},"animateFilter"),ready:void 0,stop:void 0,transform:o(function(t,r){return r},"transform")};o(Zme,"ConcentricLayout");Zme.prototype.run=function(){for(var e=this.options,t=e,r=t.counterclockwise!==void 0?!t.counterclockwise:t.clockwise,i=e.cy,n=t.eles,a=n.nodes().not(":parent"),s=is(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:i.width(),h:i.height()}),l={x:s.x1+s.w/2,y:s.y1+s.h/2},u=[],h=0,d=0;d<a.length;d++){var f=a[d],p=void 0;p=t.concentric(f),u.push({value:p,node:f}),f._private.scratch.concentric=p}a.updateStyle();for(var m=0;m<a.length;m++){var g=a[m],y=g.layoutDimensions(t);h=Math.max(h,y.w,y.h)}u.sort(function(ue,De){return De.value-ue.value});for(var v=t.levelWidth(a),x=[[]],b=x[0],T=0;T<u.length;T++){var w=u[T];if(b.length>0){var C=Math.abs(b[0].value-w.value);C>=v&&(b=[],x.push(b))}b.push(w)}var k=h+t.minNodeSpacing;if(!t.avoidOverlap){var E=x.length>0&&x[0].length>1,A=Math.min(s.w,s.h)/2-k,N=A/(x.length+E?1:0);k=Math.min(k,N)}for(var P=0,I=0;I<x.length;I++){var D=x[I],_=t.sweep===void 0?2*Math.PI-2*Math.PI/D.length:t.sweep,R=D.dTheta=_/Math.max(1,D.length-1);if(D.length>1&&t.avoidOverlap){var M=Math.cos(R)-Math.cos(0),L=Math.sin(R)-Math.sin(0),B=Math.sqrt(k*k/(M*M+L*L));P=Math.max(B,P)}D.r=P,P+=k}if(t.equidistant){for(var O=0,$=0,G=0;G<x.length;G++){var F=x[G],V=F.r-$;O=Math.max(O,V)}$=0;for(var H=0;H<x.length;H++){var j=x[H];H===0&&($=j.r),j.r=$,$+=O}}for(var U={},Q=0;Q<x.length;Q++)for(var Y=x[Q],ae=Y.dTheta,J=Y.r,te=0;te<Y.length;te++){var re=Y[te],ee=t.startAngle+(r?1:-1)*ae*te,Te={x:l.x+J*Math.cos(ee),y:l.y+J*Math.sin(ee)};U[re.node.id()]=Te}return n.nodes().layoutPositions(this,t,function(ue){var De=ue.id();return U[De]}),this};Wat={ready:o(function(){},"ready"),stop:o(function(){},"stop"),animate:!0,animationEasing:void 0,animationDuration:void 0,animateFilter:o(function(t,r){return!0},"animateFilter"),animationThreshold:250,refresh:20,fit:!0,padding:30,boundingBox:void 0,nodeDimensionsIncludeLabels:!1,randomize:!1,componentSpacing:40,nodeRepulsion:o(function(t){return 2048},"nodeRepulsion"),nodeOverlap:4,idealEdgeLength:o(function(t){return 32},"idealEdgeLength"),edgeElasticity:o(function(t){return 32},"edgeElasticity"),nestingFactor:1.2,gravity:1,numIter:1e3,initialTemp:1e3,coolingFactor:.99,minTemp:1};o(lE,"CoseLayout");lE.prototype.run=function(){var e=this.options,t=e.cy,r=this;r.stopped=!1,(e.animate===!0||e.animate===!1)&&r.emit({type:"layoutstart",layout:r}),e.debug===!0?OO=!0:OO=!1;var i=qat(t,r,e);OO&&Hat(i),e.randomize&&Yat(i);var n=Zu(),a=o(function(){jat(i,t,e),e.fit===!0&&t.fit(e.padding)},"refresh"),s=o(function(p){return!(r.stopped||p>=e.numIter||(Xat(i,e),i.temperature=i.temperature*e.coolingFactor,i.temperature<e.minTemp))},"mainLoop"),l=o(function(){if(e.animate===!0||e.animate===!1)a(),r.one("layoutstop",e.stop),r.emit({type:"layoutstop",layout:r});else{var p=e.eles.nodes(),m=Jme(i,e,p);p.layoutPositions(r,e,m)}},"done"),u=0,h=!0;if(e.animate===!0){var d=o(function(){for(var p=0;h&&p<e.refresh;)h=s(u),u++,p++;if(!h)v0e(i,e),l();else{var m=Zu();m-n>=e.animationThreshold&&a(),O3(d)}},"frame");d()}else{for(;h;)h=s(u),u++;v0e(i,e),l()}return this};lE.prototype.stop=function(){return this.stopped=!0,this.thread&&this.thread.stop(),this.emit("layoutstop"),this};lE.prototype.destroy=function(){return this.thread&&this.thread.stop(),this};qat=o(function(t,r,i){for(var n=i.eles.edges(),a=i.eles.nodes(),s=is(i.boundingBox?i.boundingBox:{x1:0,y1:0,w:t.width(),h:t.height()}),l={isCompound:t.hasCompoundNodes(),layoutNodes:[],idToIndex:{},nodeSize:a.size(),graphSet:[],indexToGraph:[],layoutEdges:[],edgeSize:n.size(),temperature:i.initialTemp,clientWidth:s.w,clientHeight:s.h,boundingBox:s},u=i.eles.components(),h={},d=0;d<u.length;d++)for(var f=u[d],p=0;p<f.length;p++){var m=f[p];h[m.id()]=d}for(var d=0;d<l.nodeSize;d++){var g=a[d],y=g.layoutDimensions(i),v={};v.isLocked=g.locked(),v.id=g.data("id"),v.parentId=g.data("parent"),v.cmptId=h[g.id()],v.children=[],v.positionX=g.position("x"),v.positionY=g.position("y"),v.offsetX=0,v.offsetY=0,v.height=y.w,v.width=y.h,v.maxX=v.positionX+v.width/2,v.minX=v.positionX-v.width/2,v.maxY=v.positionY+v.height/2,v.minY=v.positionY-v.height/2,v.padLeft=parseFloat(g.style("padding")),v.padRight=parseFloat(g.style("padding")),v.padTop=parseFloat(g.style("padding")),v.padBottom=parseFloat(g.style("padding")),v.nodeRepulsion=Ji(i.nodeRepulsion)?i.nodeRepulsion(g):i.nodeRepulsion,l.layoutNodes.push(v),l.idToIndex[v.id]=d}for(var x=[],b=0,T=-1,w=[],d=0;d<l.nodeSize;d++){var g=l.layoutNodes[d],C=g.parentId;C!=null?l.layoutNodes[l.idToIndex[C]].children.push(g.id):(x[++T]=g.id,w.push(g.id))}for(l.graphSet.push(w);b<=T;){var k=x[b++],E=l.idToIndex[k],m=l.layoutNodes[E],A=m.children;if(A.length>0){l.graphSet.push(A);for(var d=0;d<A.length;d++)x[++T]=A[d]}}for(var d=0;d<l.graphSet.length;d++)for(var N=l.graphSet[d],p=0;p<N.length;p++){var P=l.idToIndex[N[p]];l.indexToGraph[P]=d}for(var d=0;d<l.edgeSize;d++){var I=n[d],D={};D.id=I.data("id"),D.sourceId=I.data("source"),D.targetId=I.data("target");var _=Ji(i.idealEdgeLength)?i.idealEdgeLength(I):i.idealEdgeLength,R=Ji(i.edgeElasticity)?i.edgeElasticity(I):i.edgeElasticity,M=l.idToIndex[D.sourceId],L=l.idToIndex[D.targetId],B=l.indexToGraph[M],O=l.indexToGraph[L];if(B!=O){for(var $=Uat(D.sourceId,D.targetId,l),G=l.graphSet[$],F=0,v=l.layoutNodes[M];G.indexOf(v.id)===-1;)v=l.layoutNodes[l.idToIndex[v.parentId]],F++;for(v=l.layoutNodes[L];G.indexOf(v.id)===-1;)v=l.layoutNodes[l.idToIndex[v.parentId]],F++;_*=F*i.nestingFactor}D.idealLength=_,D.elasticity=R,l.layoutEdges.push(D)}return l},"createLayoutInfo"),Uat=o(function(t,r,i){var n=Qme(t,r,0,i);return 2>n.count?0:n.graph},"findLCA"),Qme=o(function(t,r,i,n){var a=n.graphSet[i];if(-1<a.indexOf(t)&&-1<a.indexOf(r))return{count:2,graph:i};for(var s=0,l=0;l<a.length;l++){var u=a[l],h=n.idToIndex[u],d=n.layoutNodes[h].children;if(d.length!==0){var f=n.indexToGraph[n.idToIndex[d[0]]],p=Qme(t,r,f,n);if(p.count!==0)if(p.count===1){if(s++,s===2)break}else return p}}return{count:s,graph:i}},"findLCA_aux"),Yat=o(function(t,r){for(var i=t.clientWidth,n=t.clientHeight,a=0;a<t.nodeSize;a++){var s=t.layoutNodes[a];s.children.length===0&&!s.isLocked&&(s.positionX=Math.random()*i,s.positionY=Math.random()*n)}},"randomizePositions"),Jme=o(function(t,r,i){var n=t.boundingBox,a={x1:1/0,x2:-1/0,y1:1/0,y2:-1/0};return r.boundingBox&&(i.forEach(function(s){var l=t.layoutNodes[t.idToIndex[s.data("id")]];a.x1=Math.min(a.x1,l.positionX),a.x2=Math.max(a.x2,l.positionX),a.y1=Math.min(a.y1,l.positionY),a.y2=Math.max(a.y2,l.positionY)}),a.w=a.x2-a.x1,a.h=a.y2-a.y1),function(s,l){var u=t.layoutNodes[t.idToIndex[s.data("id")]];if(r.boundingBox){var h=a.w===0?.5:(u.positionX-a.x1)/a.w,d=a.h===0?.5:(u.positionY-a.y1)/a.h;return{x:n.x1+h*n.w,y:n.y1+d*n.h}}else return{x:u.positionX,y:u.positionY}}},"getScaleInBoundsFn"),jat=o(function(t,r,i){var n=i.layout,a=i.eles.nodes(),s=Jme(t,i,a);a.positions(s),t.ready!==!0&&(t.ready=!0,n.one("layoutready",i.ready),n.emit({type:"layoutready",layout:this}))},"refreshPositions"),Xat=o(function(t,r,i){Kat(t,r),Jat(t),est(t,r),tst(t),rst(t)},"step"),Kat=o(function(t,r){for(var i=0;i<t.graphSet.length;i++)for(var n=t.graphSet[i],a=n.length,s=0;s<a;s++)for(var l=t.layoutNodes[t.idToIndex[n[s]]],u=s+1;u<a;u++){var h=t.layoutNodes[t.idToIndex[n[u]]];Zat(l,h,t,r)}},"calculateNodeForces"),y0e=o(function(t){return-1+2*t*Math.random()},"randomDistance"),Zat=o(function(t,r,i,n){var a=t.cmptId,s=r.cmptId;if(!(a!==s&&!i.isCompound)){var l=r.positionX-t.positionX,u=r.positionY-t.positionY,h=1;l===0&&u===0&&(l=y0e(h),u=y0e(h));var d=Qat(t,r,l,u);if(d>0)var f=n.nodeOverlap*d,p=Math.sqrt(l*l+u*u),m=f*l/p,g=f*u/p;else var y=V3(t,l,u),v=V3(r,-1*l,-1*u),x=v.x-y.x,b=v.y-y.y,T=x*x+b*b,p=Math.sqrt(T),f=(t.nodeRepulsion+r.nodeRepulsion)/T,m=f*x/p,g=f*b/p;t.isLocked||(t.offsetX-=m,t.offsetY-=g),r.isLocked||(r.offsetX+=m,r.offsetY+=g)}},"nodeRepulsion"),Qat=o(function(t,r,i,n){if(i>0)var a=t.maxX-r.minX;else var a=r.maxX-t.minX;if(n>0)var s=t.maxY-r.minY;else var s=r.maxY-t.minY;return a>=0&&s>=0?Math.sqrt(a*a+s*s):0},"nodesOverlap"),V3=o(function(t,r,i){var n=t.positionX,a=t.positionY,s=t.height||1,l=t.width||1,u=i/r,h=s/l,d={};return r===0&&0<i||r===0&&0>i?(d.x=n,d.y=a+s/2,d):0<r&&-1*h<=u&&u<=h?(d.x=n+l/2,d.y=a+l*i/2/r,d):0>r&&-1*h<=u&&u<=h?(d.x=n-l/2,d.y=a-l*i/2/r,d):0<i&&(u<=-1*h||u>=h)?(d.x=n+s*r/2/i,d.y=a+s/2,d):(0>i&&(u<=-1*h||u>=h)&&(d.x=n-s*r/2/i,d.y=a-s/2),d)},"findClippingPoint"),Jat=o(function(t,r){for(var i=0;i<t.edgeSize;i++){var n=t.layoutEdges[i],a=t.idToIndex[n.sourceId],s=t.layoutNodes[a],l=t.idToIndex[n.targetId],u=t.layoutNodes[l],h=u.positionX-s.positionX,d=u.positionY-s.positionY;if(!(h===0&&d===0)){var f=V3(s,h,d),p=V3(u,-1*h,-1*d),m=p.x-f.x,g=p.y-f.y,y=Math.sqrt(m*m+g*g),v=Math.pow(n.idealLength-y,2)/n.elasticity;if(y!==0)var x=v*m/y,b=v*g/y;else var x=0,b=0;s.isLocked||(s.offsetX+=x,s.offsetY+=b),u.isLocked||(u.offsetX-=x,u.offsetY-=b)}}},"calculateEdgeForces"),est=o(function(t,r){if(r.gravity!==0)for(var i=1,n=0;n<t.graphSet.length;n++){var a=t.graphSet[n],s=a.length;if(n===0)var l=t.clientHeight/2,u=t.clientWidth/2;else var h=t.layoutNodes[t.idToIndex[a[0]]],d=t.layoutNodes[t.idToIndex[h.parentId]],l=d.positionX,u=d.positionY;for(var f=0;f<s;f++){var p=t.layoutNodes[t.idToIndex[a[f]]];if(!p.isLocked){var m=l-p.positionX,g=u-p.positionY,y=Math.sqrt(m*m+g*g);if(y>i){var v=r.gravity*m/y,x=r.gravity*g/y;p.offsetX+=v,p.offsetY+=x}}}}},"calculateGravityForces"),tst=o(function(t,r){var i=[],n=0,a=-1;for(i.push.apply(i,t.graphSet[0]),a+=t.graphSet[0].length;n<=a;){var s=i[n++],l=t.idToIndex[s],u=t.layoutNodes[l],h=u.children;if(0<h.length&&!u.isLocked){for(var d=u.offsetX,f=u.offsetY,p=0;p<h.length;p++){var m=t.layoutNodes[t.idToIndex[h[p]]];m.offsetX+=d,m.offsetY+=f,i[++a]=h[p]}u.offsetX=0,u.offsetY=0}}},"propagateForces"),rst=o(function(t,r){for(var i=0;i<t.nodeSize;i++){var n=t.layoutNodes[i];0<n.children.length&&(n.maxX=void 0,n.minX=void 0,n.maxY=void 0,n.minY=void 0)}for(var i=0;i<t.nodeSize;i++){var n=t.layoutNodes[i];if(!(0<n.children.length||n.isLocked)){var a=ist(n.offsetX,n.offsetY,t.temperature);n.positionX+=a.x,n.positionY+=a.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,ege(n,t)}}for(var i=0;i<t.nodeSize;i++){var n=t.layoutNodes[i];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)}},"updatePositions"),ist=o(function(t,r,i){var n=Math.sqrt(t*t+r*r);if(n>i)var a={x:i*t/n,y:i*r/n};else var a={x:t,y:r};return a},"limitForce"),ege=o(function(t,r){var i=t.parentId;if(i!=null){var n=r.layoutNodes[r.idToIndex[i]],a=!1;if((n.maxX==null||t.maxX+n.padRight>n.maxX)&&(n.maxX=t.maxX+n.padRight,a=!0),(n.minX==null||t.minX-n.padLeft<n.minX)&&(n.minX=t.minX-n.padLeft,a=!0),(n.maxY==null||t.maxY+n.padBottom>n.maxY)&&(n.maxY=t.maxY+n.padBottom,a=!0),(n.minY==null||t.minY-n.padTop<n.minY)&&(n.minY=t.minY-n.padTop,a=!0),a)return ege(n,r)}},"updateAncestryBoundaries"),v0e=o(function(t,r){for(var i=t.layoutNodes,n=[],a=0;a<i.length;a++){var s=i[a],l=s.cmptId,u=n[l]=n[l]||[];u.push(s)}for(var h=0,a=0;a<n.length;a++){var d=n[a];if(d){d.x1=1/0,d.x2=-1/0,d.y1=1/0,d.y2=-1/0;for(var f=0;f<d.length;f++){var p=d[f];d.x1=Math.min(d.x1,p.positionX-p.width/2),d.x2=Math.max(d.x2,p.positionX+p.width/2),d.y1=Math.min(d.y1,p.positionY-p.height/2),d.y2=Math.max(d.y2,p.positionY+p.height/2)}d.w=d.x2-d.x1,d.h=d.y2-d.y1,h+=d.w*d.h}}n.sort(function(b,T){return T.w*T.h-b.w*b.h});for(var m=0,g=0,y=0,v=0,x=Math.sqrt(h)*t.clientWidth/t.clientHeight,a=0;a<n.length;a++){var d=n[a];if(d){for(var f=0;f<d.length;f++){var p=d[f];p.isLocked||(p.positionX+=m-d.x1,p.positionY+=g-d.y1)}m+=d.w+r.componentSpacing,y+=d.w+r.componentSpacing,v=Math.max(v,d.h),y>x&&(g+=v+r.componentSpacing,m=0,y=0,v=0)}}},"separateComponents"),nst={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:o(function(t){},"position"),sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:o(function(t,r){return!0},"animateFilter"),ready:void 0,stop:void 0,transform:o(function(t,r){return r},"transform")};o(tge,"GridLayout");tge.prototype.run=function(){var e=this.options,t=e,r=e.cy,i=t.eles,n=i.nodes().not(":parent");t.sort&&(n=n.sort(t.sort));var a=is(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()});if(a.h===0||a.w===0)i.nodes().layoutPositions(this,t,function(H){return{x:a.x1,y:a.y1}});else{var s=n.size(),l=Math.sqrt(s*a.h/a.w),u=Math.round(l),h=Math.round(a.w/a.h*l),d=o(function(j){if(j==null)return Math.min(u,h);var U=Math.min(u,h);U==u?u=j:h=j},"small"),f=o(function(j){if(j==null)return Math.max(u,h);var U=Math.max(u,h);U==u?u=j:h=j},"large"),p=t.rows,m=t.cols!=null?t.cols:t.columns;if(p!=null&&m!=null)u=p,h=m;else if(p!=null&&m==null)u=p,h=Math.ceil(s/u);else if(p==null&&m!=null)h=m,u=Math.ceil(s/h);else if(h*u>s){var g=d(),y=f();(g-1)*y>=s?d(g-1):(y-1)*g>=s&&f(y-1)}else for(;h*u<s;){var v=d(),x=f();(x+1)*v>=s?f(x+1):d(v+1)}var b=a.w/h,T=a.h/u;if(t.condense&&(b=0,T=0),t.avoidOverlap)for(var w=0;w<n.length;w++){var C=n[w],k=C._private.position;(k.x==null||k.y==null)&&(k.x=0,k.y=0);var E=C.layoutDimensions(t),A=t.avoidOverlapPadding,N=E.w+A,P=E.h+A;b=Math.max(b,N),T=Math.max(T,P)}for(var I={},D=o(function(j,U){return!!I["c-"+j+"-"+U]},"used"),_=o(function(j,U){I["c-"+j+"-"+U]=!0},"use"),R=0,M=0,L=o(function(){M++,M>=h&&(M=0,R++)},"moveToNextCell"),B={},O=0;O<n.length;O++){var $=n[O],G=t.position($);if(G&&(G.row!==void 0||G.col!==void 0)){var F={row:G.row,col:G.col};if(F.col===void 0)for(F.col=0;D(F.row,F.col);)F.col++;else if(F.row===void 0)for(F.row=0;D(F.row,F.col);)F.row++;B[$.id()]=F,_(F.row,F.col)}}var V=o(function(j,U){var Q,Y;if(j.locked()||j.isParent())return!1;var ae=B[j.id()];if(ae)Q=ae.col*b+b/2+a.x1,Y=ae.row*T+T/2+a.y1;else{for(;D(R,M);)L();Q=M*b+b/2+a.x1,Y=R*T+T/2+a.y1,_(R,M),L()}return{x:Q,y:Y}},"getPos");n.layoutPositions(this,t,V)}return this};ast={ready:o(function(){},"ready"),stop:o(function(){},"stop")};o(DP,"NullLayout");DP.prototype.run=function(){var e=this.options,t=e.eles,r=this;return e.cy,r.emit("layoutstart"),t.nodes().positions(function(){return{x:0,y:0}}),r.one("layoutready",e.ready),r.emit("layoutready"),r.one("layoutstop",e.stop),r.emit("layoutstop"),this};DP.prototype.stop=function(){return this};sst={positions:void 0,zoom:void 0,pan:void 0,fit:!0,padding:30,spacingFactor:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:o(function(t,r){return!0},"animateFilter"),ready:void 0,stop:void 0,transform:o(function(t,r){return r},"transform")};o(rge,"PresetLayout");rge.prototype.run=function(){var e=this.options,t=e.eles,r=t.nodes(),i=Ji(e.positions);function n(a){if(e.positions==null)return _rt(a.position());if(i)return e.positions(a);var s=e.positions[a._private.data.id];return s??null}return o(n,"getPosition"),r.layoutPositions(this,e,function(a,s){var l=n(a);return a.locked()||l==null?!1:l}),this};ost={fit:!0,padding:30,boundingBox:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:o(function(t,r){return!0},"animateFilter"),ready:void 0,stop:void 0,transform:o(function(t,r){return r},"transform")};o(ige,"RandomLayout");ige.prototype.run=function(){var e=this.options,t=e.cy,r=e.eles,i=is(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:t.width(),h:t.height()}),n=o(function(s,l){return{x:i.x1+Math.round(Math.random()*i.w),y:i.y1+Math.round(Math.random()*i.h)}},"getPos");return r.nodes().layoutPositions(this,e,n),this};lst=[{name:"breadthfirst",impl:Xme},{name:"circle",impl:Kme},{name:"concentric",impl:Zme},{name:"cose",impl:lE},{name:"grid",impl:tge},{name:"null",impl:DP},{name:"preset",impl:rge},{name:"random",impl:ige}];o(nge,"NullRenderer");x0e=o(function(){},"noop"),b0e=o(function(){throw new Error("A headless instance can not render images")},"throwImgErr");nge.prototype={recalculateRenderedStyle:x0e,notify:o(function(){this.notifications++},"notify"),init:x0e,isHeadless:o(function(){return!0},"isHeadless"),png:b0e,jpg:b0e};RP={};RP.arrowShapeWidth=.3;RP.registerArrowShapes=function(){var e=this.arrowShapes={},t=this,r=o(function(h,d,f,p,m,g,y){var v=m.x-f/2-y,x=m.x+f/2+y,b=m.y-f/2-y,T=m.y+f/2+y,w=v<=h&&h<=x&&b<=d&&d<=T;return w},"bbCollide"),i=o(function(h,d,f,p,m){var g=h*Math.cos(p)-d*Math.sin(p),y=h*Math.sin(p)+d*Math.cos(p),v=g*f,x=y*f,b=v+m.x,T=x+m.y;return{x:b,y:T}},"transform"),n=o(function(h,d,f,p){for(var m=[],g=0;g<h.length;g+=2){var y=h[g],v=h[g+1];m.push(i(y,v,d,f,p))}return m},"transformPoints"),a=o(function(h){for(var d=[],f=0;f<h.length;f++){var p=h[f];d.push(p.x,p.y)}return d},"pointsToArr"),s=o(function(h){return h.pstyle("width").pfValue*h.pstyle("arrow-scale").pfValue*2},"standardGap"),l=o(function(h,d){sr(d)&&(d=e[d]),e[h]=hr({name:h,points:[-.15,-.3,.15,-.3,.15,.3,-.15,.3],collide:o(function(p,m,g,y,v,x){var b=a(n(this.points,g+2*x,y,v)),T=Bs(p,m,b);return T},"collide"),roughCollide:r,draw:o(function(p,m,g,y){var v=n(this.points,m,g,y);t.arrowShapeImpl("polygon")(p,v)},"draw"),spacing:o(function(p){return 0},"spacing"),gap:s},d)},"defineArrowShape");l("none",{collide:P3,roughCollide:P3,draw:mP,spacing:Ife,gap:Ife}),l("triangle",{points:[-.15,-.3,0,0,.15,-.3]}),l("arrow","triangle"),l("triangle-backcurve",{points:e.triangle.points,controlPoint:[0,-.15],roughCollide:r,draw:o(function(h,d,f,p,m){var g=n(this.points,d,f,p),y=this.controlPoint,v=i(y[0],y[1],d,f,p);t.arrowShapeImpl(this.name)(h,g,v)},"draw"),gap:o(function(h){return s(h)*.8},"gap")}),l("triangle-tee",{points:[0,0,.15,-.3,-.15,-.3,0,0],pointsTee:[-.15,-.4,-.15,-.5,.15,-.5,.15,-.4],collide:o(function(h,d,f,p,m,g,y){var v=a(n(this.points,f+2*y,p,m)),x=a(n(this.pointsTee,f+2*y,p,m)),b=Bs(h,d,v)||Bs(h,d,x);return b},"collide"),draw:o(function(h,d,f,p,m){var g=n(this.points,d,f,p),y=n(this.pointsTee,d,f,p);t.arrowShapeImpl(this.name)(h,g,y)},"draw")}),l("circle-triangle",{radius:.15,pointsTr:[0,-.15,.15,-.45,-.15,-.45,0,-.15],collide:o(function(h,d,f,p,m,g,y){var v=m,x=Math.pow(v.x-h,2)+Math.pow(v.y-d,2)<=Math.pow((f+2*y)*this.radius,2),b=a(n(this.points,f+2*y,p,m));return Bs(h,d,b)||x},"collide"),draw:o(function(h,d,f,p,m){var g=n(this.pointsTr,d,f,p);t.arrowShapeImpl(this.name)(h,g,p.x,p.y,this.radius*d)},"draw"),spacing:o(function(h){return t.getArrowWidth(h.pstyle("width").pfValue,h.pstyle("arrow-scale").value)*this.radius},"spacing")}),l("triangle-cross",{points:[0,0,.15,-.3,-.15,-.3,0,0],baseCrossLinePts:[-.15,-.4,-.15,-.4,.15,-.4,.15,-.4],crossLinePts:o(function(h,d){var f=this.baseCrossLinePts.slice(),p=d/h,m=3,g=5;return f[m]=f[m]-p,f[g]=f[g]-p,f},"crossLinePts"),collide:o(function(h,d,f,p,m,g,y){var v=a(n(this.points,f+2*y,p,m)),x=a(n(this.crossLinePts(f,g),f+2*y,p,m)),b=Bs(h,d,v)||Bs(h,d,x);return b},"collide"),draw:o(function(h,d,f,p,m){var g=n(this.points,d,f,p),y=n(this.crossLinePts(d,m),d,f,p);t.arrowShapeImpl(this.name)(h,g,y)},"draw")}),l("vee",{points:[-.15,-.3,0,0,.15,-.3,0,-.15],gap:o(function(h){return s(h)*.525},"gap")}),l("circle",{radius:.15,collide:o(function(h,d,f,p,m,g,y){var v=m,x=Math.pow(v.x-h,2)+Math.pow(v.y-d,2)<=Math.pow((f+2*y)*this.radius,2);return x},"collide"),draw:o(function(h,d,f,p,m){t.arrowShapeImpl(this.name)(h,p.x,p.y,this.radius*d)},"draw"),spacing:o(function(h){return t.getArrowWidth(h.pstyle("width").pfValue,h.pstyle("arrow-scale").value)*this.radius},"spacing")}),l("tee",{points:[-.15,0,-.15,-.1,.15,-.1,.15,0],spacing:o(function(h){return 1},"spacing"),gap:o(function(h){return 1},"gap")}),l("square",{points:[-.15,0,.15,0,.15,-.3,-.15,-.3]}),l("diamond",{points:[-.15,-.15,0,-.3,.15,-.15,0,0],gap:o(function(h){return h.pstyle("width").pfValue*h.pstyle("arrow-scale").value},"gap")}),l("chevron",{points:[0,0,-.15,-.15,-.1,-.2,0,-.1,.1,-.2,.15,-.15],gap:o(function(h){return .95*h.pstyle("width").pfValue*h.pstyle("arrow-scale").value},"gap")})};n0={};n0.projectIntoViewport=function(e,t){var r=this.cy,i=this.findContainerClientCoords(),n=i[0],a=i[1],s=i[4],l=r.pan(),u=r.zoom(),h=((e-n)/s-l.x)/u,d=((t-a)/s-l.y)/u;return[h,d]};n0.findContainerClientCoords=function(){if(this.containerBB)return this.containerBB;var e=this.container,t=e.getBoundingClientRect(),r=this.cy.window().getComputedStyle(e),i=o(function(x){return parseFloat(r.getPropertyValue(x))},"styleValue"),n={left:i("padding-left"),right:i("padding-right"),top:i("padding-top"),bottom:i("padding-bottom")},a={left:i("border-left-width"),right:i("border-right-width"),top:i("border-top-width"),bottom:i("border-bottom-width")},s=e.clientWidth,l=e.clientHeight,u=n.left+n.right,h=n.top+n.bottom,d=a.left+a.right,f=t.width/(s+d),p=s-u,m=l-h,g=t.left+n.left+a.left,y=t.top+n.top+a.top;return this.containerBB=[g,y,p,m,f]};n0.invalidateContainerClientCoordsCache=function(){this.containerBB=null};n0.findNearestElement=function(e,t,r,i){return this.findNearestElements(e,t,r,i)[0]};n0.findNearestElements=function(e,t,r,i){var n=this,a=this,s=a.getCachedZSortedEles(),l=[],u=a.cy.zoom(),h=a.cy.hasCompoundNodes(),d=(i?24:8)/u,f=(i?8:2)/u,p=(i?8:2)/u,m=1/0,g,y;r&&(s=s.interactive);function v(E,A){if(E.isNode()){if(y)return;y=E,l.push(E)}if(E.isEdge()&&(A==null||A<m))if(g){if(g.pstyle("z-compound-depth").value===E.pstyle("z-compound-depth").value&&g.pstyle("z-compound-depth").value===E.pstyle("z-compound-depth").value){for(var N=0;N<l.length;N++)if(l[N].isEdge()){l[N]=E,g=E,m=A??m;break}}}else l.push(E),g=E,m=A??m}o(v,"addEle");function x(E){var A=E.outerWidth()+2*f,N=E.outerHeight()+2*f,P=A/2,I=N/2,D=E.position(),_=E.pstyle("corner-radius").value==="auto"?"auto":E.pstyle("corner-radius").pfValue,R=E._private.rscratch;if(D.x-P<=e&&e<=D.x+P&&D.y-I<=t&&t<=D.y+I){var M=a.nodeShapes[n.getNodeShape(E)];if(M.checkPoint(e,t,0,A,N,D.x,D.y,_,R))return v(E,0),!0}}o(x,"checkNode");function b(E){var A=E._private,N=A.rscratch,P=E.pstyle("width").pfValue,I=E.pstyle("arrow-scale").value,D=P/2+d,_=D*D,R=D*2,O=A.source,$=A.target,M;if(N.edgeType==="segments"||N.edgeType==="straight"||N.edgeType==="haystack"){for(var L=N.allpts,B=0;B+3<L.length;B+=2)if(Vrt(e,t,L[B],L[B+1],L[B+2],L[B+3],R)&&_>(M=Yrt(e,t,L[B],L[B+1],L[B+2],L[B+3])))return v(E,M),!0}else if(N.edgeType==="bezier"||N.edgeType==="multibezier"||N.edgeType==="self"||N.edgeType==="compound"){for(var L=N.allpts,B=0;B+5<N.allpts.length;B+=4)if(Wrt(e,t,L[B],L[B+1],L[B+2],L[B+3],L[B+4],L[B+5],R)&&_>(M=Hrt(e,t,L[B],L[B+1],L[B+2],L[B+3],L[B+4],L[B+5])))return v(E,M),!0}for(var O=O||A.source,$=$||A.target,G=n.getArrowWidth(P,I),F=[{name:"source",x:N.arrowStartX,y:N.arrowStartY,angle:N.srcArrowAngle},{name:"target",x:N.arrowEndX,y:N.arrowEndY,angle:N.tgtArrowAngle},{name:"mid-source",x:N.midX,y:N.midY,angle:N.midsrcArrowAngle},{name:"mid-target",x:N.midX,y:N.midY,angle:N.midtgtArrowAngle}],B=0;B<F.length;B++){var V=F[B],H=a.arrowShapes[E.pstyle(V.name+"-arrow-shape").value],j=E.pstyle("width").pfValue;if(H.roughCollide(e,t,G,V.angle,{x:V.x,y:V.y},j,d)&&H.collide(e,t,G,V.angle,{x:V.x,y:V.y},j,d))return v(E),!0}h&&l.length>0&&(x(O),x($))}o(b,"checkEdge");function T(E,A,N){return Ps(E,A,N)}o(T,"preprop");function w(E,A){var N=E._private,P=p,I;A?I=A+"-":I="",E.boundingBox();var D=N.labelBounds[A||"main"],_=E.pstyle(I+"label").value,R=E.pstyle("text-events").strValue==="yes";if(!(!R||!_)){var M=T(N.rscratch,"labelX",A),L=T(N.rscratch,"labelY",A),B=T(N.rscratch,"labelAngle",A),O=E.pstyle(I+"text-margin-x").pfValue,$=E.pstyle(I+"text-margin-y").pfValue,G=D.x1-P-O,F=D.x2+P-O,V=D.y1-P-$,H=D.y2+P-$;if(B){var j=Math.cos(B),U=Math.sin(B),Q=o(function(Te,ue){return Te=Te-M,ue=ue-L,{x:Te*j-ue*U+M,y:Te*U+ue*j+L}},"rotate"),Y=Q(G,V),ae=Q(G,H),J=Q(F,V),te=Q(F,H),re=[Y.x+O,Y.y+$,J.x+O,J.y+$,te.x+O,te.y+$,ae.x+O,ae.y+$];if(Bs(e,t,re))return v(E),!0}else if(zd(D,e,t))return v(E),!0}}o(w,"checkLabel");for(var C=s.length-1;C>=0;C--){var k=s[C];k.isNode()?x(k)||w(k):b(k)||w(k)||w(k,"source")||w(k,"target")}return l};n0.getAllInBox=function(e,t,r,i){var n=this.getCachedZSortedEles().interactive,a=this.cy.zoom(),s=2/a,l=[],u=Math.min(e,r),h=Math.max(e,r),d=Math.min(t,i),f=Math.max(t,i);e=u,r=h,t=d,i=f;var p=is({x1:e,y1:t,x2:r,y2:i}),m=[{x:p.x1,y:p.y1},{x:p.x2,y:p.y1},{x:p.x2,y:p.y2},{x:p.x1,y:p.y2}],g=[[m[0],m[1]],[m[1],m[2]],[m[2],m[3]],[m[3],m[0]]];function y(Te,ue,De){return Ps(Te,ue,De)}o(y,"preprop");function v(Te,ue){var De=Te._private,Ie=s,Ee="";Te.boundingBox();var we=De.labelBounds.main;if(!we)return null;var Me=y(De.rscratch,"labelX",ue),$e=y(De.rscratch,"labelY",ue),de=y(De.rscratch,"labelAngle",ue),rt=Te.pstyle(Ee+"text-margin-x").pfValue,ke=Te.pstyle(Ee+"text-margin-y").pfValue,Fe=we.x1-Ie-rt,He=we.x2+Ie-rt,at=we.y1-Ie-ke,qe=we.y2+Ie-ke;if(de){var Ue=Math.cos(de),ye=Math.sin(de),ve=o(function(fe,W){return fe=fe-Me,W=W-$e,{x:fe*Ue-W*ye+Me,y:fe*ye+W*Ue+$e}},"rotate");return[ve(Fe,at),ve(He,at),ve(He,qe),ve(Fe,qe)]}else return[{x:Fe,y:at},{x:He,y:at},{x:He,y:qe},{x:Fe,y:qe}]}o(v,"getRotatedLabelBox");function x(Te,ue,De,Ie){function Ee(we,Me,$e){return($e.y-we.y)*(Me.x-we.x)>(Me.y-we.y)*($e.x-we.x)}return o(Ee,"ccw"),Ee(Te,De,Ie)!==Ee(ue,De,Ie)&&Ee(Te,ue,De)!==Ee(Te,ue,Ie)}o(x,"doLinesIntersect");for(var b=0;b<n.length;b++){var T=n[b];if(T.isNode()){var w=T,C=w.pstyle("text-events").strValue==="yes",k=w.pstyle("box-selection").strValue,E=w.pstyle("box-select-labels").strValue==="yes";if(k==="none")continue;var A=(k==="overlap"||E)&&C,N=w.boundingBox({includeNodes:!0,includeEdges:!1,includeLabels:A});if(k==="contain"){var P=!1;if(E&&C){var I=v(w);I&&N9(I,m)&&(l.push(w),P=!0)}!P&&hme(p,N)&&l.push(w)}else if(k==="overlap"&&xP(p,N)){var D=w.boundingBox({includeNodes:!0,includeEdges:!0,includeLabels:!1,includeMainLabels:!1,includeSourceLabels:!1,includeTargetLabels:!1}),_=[{x:D.x1,y:D.y1},{x:D.x2,y:D.y1},{x:D.x2,y:D.y2},{x:D.x1,y:D.y2}];if(N9(_,m))l.push(w);else{var R=v(w);R&&N9(R,m)&&l.push(w)}}}else{var M=T,L=M._private,B=L.rscratch,O=M.pstyle("box-selection").strValue;if(O==="none")continue;if(O==="contain"){if(B.startX!=null&&B.startY!=null&&!zd(p,B.startX,B.startY)||B.endX!=null&&B.endY!=null&&!zd(p,B.endX,B.endY))continue;if(B.edgeType==="bezier"||B.edgeType==="multibezier"||B.edgeType==="self"||B.edgeType==="compound"||B.edgeType==="segments"||B.edgeType==="haystack"){for(var $=L.rstyle.bezierPts||L.rstyle.linePts||L.rstyle.haystackPts,G=!0,F=0;F<$.length;F++)if(!$fe(p,$[F])){G=!1;break}G&&l.push(M)}else B.edgeType==="straight"&&l.push(M)}else if(O==="overlap"){var V=!1;if(B.startX!=null&&B.startY!=null&&B.endX!=null&&B.endY!=null&&(zd(p,B.startX,B.startY)||zd(p,B.endX,B.endY)))l.push(M),V=!0;else if(!V&&B.edgeType==="haystack"){for(var H=L.rstyle.haystackPts,j=0;j<H.length;j++)if($fe(p,H[j])){l.push(M),V=!0;break}}if(!V){var U=L.rstyle.bezierPts||L.rstyle.linePts||L.rstyle.haystackPts;if((!U||U.length<2)&&B.edgeType==="straight"&&B.startX!=null&&B.startY!=null&&B.endX!=null&&B.endY!=null&&(U=[{x:B.startX,y:B.startY},{x:B.endX,y:B.endY}]),!U||U.length<2)continue;for(var Q=0;Q<U.length-1;Q++){for(var Y=U[Q],ae=U[Q+1],J=0;J<g.length;J++){var te=Dn(g[J],2),re=te[0],ee=te[1];if(x(Y,ae,re,ee)){l.push(M),V=!0;break}}if(V)break}}}}}return l};W3={};W3.calculateArrowAngles=function(e){var t=e._private.rscratch,r=t.edgeType==="haystack",i=t.edgeType==="bezier",n=t.edgeType==="multibezier",a=t.edgeType==="segments",s=t.edgeType==="compound",l=t.edgeType==="self",u,h,d,f,p,m,x,b;if(r?(d=t.haystackPts[0],f=t.haystackPts[1],p=t.haystackPts[2],m=t.haystackPts[3]):(d=t.arrowStartX,f=t.arrowStartY,p=t.arrowEndX,m=t.arrowEndY),x=t.midX,b=t.midY,a)u=d-t.segpts[0],h=f-t.segpts[1];else if(n||s||l||i){var g=t.allpts,y=na(g[0],g[2],g[4],.1),v=na(g[1],g[3],g[5],.1);u=d-y,h=f-v}else u=d-x,h=f-b;t.srcArrowAngle=h3(u,h);var x=t.midX,b=t.midY;if(r&&(x=(d+p)/2,b=(f+m)/2),u=p-d,h=m-f,a){var g=t.allpts;if(g.length/2%2===0){var T=g.length/2,w=T-2;u=g[T]-g[w],h=g[T+1]-g[w+1]}else if(t.isRound)u=t.midVector[1],h=-t.midVector[0];else{var T=g.length/2-1,w=T-2;u=g[T]-g[w],h=g[T+1]-g[w+1]}}else if(n||s||l){var g=t.allpts,C=t.ctrlpts,k,E,A,N;if(C.length/2%2===0){var P=g.length/2-1,I=P+2,D=I+2;k=na(g[P],g[I],g[D],0),E=na(g[P+1],g[I+1],g[D+1],0),A=na(g[P],g[I],g[D],1e-4),N=na(g[P+1],g[I+1],g[D+1],1e-4)}else{var I=g.length/2-1,P=I-2,D=I+2;k=na(g[P],g[I],g[D],.4999),E=na(g[P+1],g[I+1],g[D+1],.4999),A=na(g[P],g[I],g[D],.5),N=na(g[P+1],g[I+1],g[D+1],.5)}u=A-k,h=N-E}if(t.midtgtArrowAngle=h3(u,h),t.midDispX=u,t.midDispY=h,u*=-1,h*=-1,a){var g=t.allpts;if(g.length/2%2!==0){if(!t.isRound){var T=g.length/2-1,_=T+2;u=-(g[_]-g[T]),h=-(g[_+1]-g[T+1])}}}if(t.midsrcArrowAngle=h3(u,h),a)u=p-t.segpts[t.segpts.length-2],h=m-t.segpts[t.segpts.length-1];else if(n||s||l||i){var g=t.allpts,R=g.length,y=na(g[R-6],g[R-4],g[R-2],.9),v=na(g[R-5],g[R-3],g[R-1],.9);u=p-y,h=m-v}else u=p-x,h=m-b;t.tgtArrowAngle=h3(u,h)};W3.getArrowWidth=W3.getArrowHeight=function(e,t){var r=this.arrowWidthCache=this.arrowWidthCache||{},i=r[e+", "+t];return i||(i=Math.max(Math.pow(e*13.37,.9),29)*t,r[e+", "+t]=i,i)};Pc={},Yo={},w0e=o(function(t,r,i){i.x=r.x-t.x,i.y=r.y-t.y,i.len=Math.sqrt(i.x*i.x+i.y*i.y),i.nx=i.x/i.len,i.ny=i.y/i.len,i.ang=Math.atan2(i.ny,i.nx)},"asVec"),cst=o(function(t,r){r.x=t.x*-1,r.y=t.y*-1,r.nx=t.nx*-1,r.ny=t.ny*-1,r.ang=t.ang>0?-(Math.PI-t.ang):Math.PI+t.ang},"invertVec"),ust=o(function(t,r,i,n,a){if(t!==k0e?w0e(r,t,Pc):cst(Yo,Pc),w0e(r,i,Yo),T0e=Pc.nx*Yo.ny-Pc.ny*Yo.nx,C0e=Pc.nx*Yo.nx-Pc.ny*-Yo.ny,ju=Math.asin(Math.max(-1,Math.min(1,T0e))),Math.abs(ju)<1e-6){tP=r.x,rP=r.y,Xp=i1=0;return}Zp=1,R3=!1,C0e<0?ju<0?ju=Math.PI+ju:(ju=Math.PI-ju,Zp=-1,R3=!0):ju>0&&(Zp=-1,R3=!0),r.radius!==void 0?i1=r.radius:i1=n,Up=ju/2,x3=Math.min(Pc.len/2,Yo.len/2),a?(Ic=Math.abs(Math.cos(Up)*i1/Math.sin(Up)),Ic>x3?(Ic=x3,Xp=Math.abs(Ic*Math.sin(Up)/Math.cos(Up))):Xp=i1):(Ic=Math.min(x3,i1),Xp=Math.abs(Ic*Math.sin(Up)/Math.cos(Up))),iP=r.x+Yo.nx*Ic,nP=r.y+Yo.ny*Ic,tP=iP-Yo.ny*Xp*Zp,rP=nP+Yo.nx*Xp*Zp,age=r.x+Pc.nx*Ic,sge=r.y+Pc.ny*Ic,k0e=r},"calcCornerArc");o(oge,"drawPreparedRoundCorner");o(LP,"getRoundCorner");t2=.01,hst=Math.sqrt(2*t2),Ba={};Ba.findMidptPtsEtc=function(e,t){var r=t.posPts,i=t.intersectionPts,n=t.vectorNormInverse,a,s=e.pstyle("source-endpoint"),l=e.pstyle("target-endpoint"),u=s.units!=null&&l.units!=null,h=o(function(C,k,E,A){var N=A-k,P=E-C,I=Math.sqrt(P*P+N*N);return{x:-N/I,y:P/I}},"recalcVectorNormInverse"),d=e.pstyle("edge-distances").value;switch(d){case"node-position":a=r;break;case"intersection":a=i;break;case"endpoints":{if(u){var f=this.manualEndptToPx(e.source()[0],s),p=Dn(f,2),m=p[0],g=p[1],y=this.manualEndptToPx(e.target()[0],l),v=Dn(y,2),x=v[0],b=v[1],T={x1:m,y1:g,x2:x,y2:b};n=h(m,g,x,b),a=T}else di("Edge ".concat(e.id()," has edge-distances:endpoints specified without manual endpoints specified via source-endpoint and target-endpoint. Falling back on edge-distances:intersection (default).")),a=i;break}}return{midptPts:a,vectorNormInverse:n}};Ba.findHaystackPoints=function(e){for(var t=0;t<e.length;t++){var r=e[t],i=r._private,n=i.rscratch;if(!n.haystack){var a=Math.random()*2*Math.PI;n.source={x:Math.cos(a),y:Math.sin(a)},a=Math.random()*2*Math.PI,n.target={x:Math.cos(a),y:Math.sin(a)}}var s=i.source,l=i.target,u=s.position(),h=l.position(),d=s.width(),f=l.width(),p=s.height(),m=l.height(),g=r.pstyle("haystack-radius").value,y=g/2;n.haystackPts=n.allpts=[n.source.x*d*y+u.x,n.source.y*p*y+u.y,n.target.x*f*y+h.x,n.target.y*m*y+h.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(r),this.calculateArrowAngles(r),this.recalculateEdgeLabelProjections(r),this.calculateLabelAngles(r)}};Ba.findSegmentsPoints=function(e,t){var r=e._private.rscratch,i=e.pstyle("segment-weights"),n=e.pstyle("segment-distances"),a=e.pstyle("segment-radii"),s=e.pstyle("radius-type"),l=Math.min(i.pfValue.length,n.pfValue.length),u=a.pfValue[a.pfValue.length-1],h=s.pfValue[s.pfValue.length-1];r.edgeType="segments",r.segpts=[],r.radii=[],r.isArcRadius=[];for(var d=0;d<l;d++){var f=i.pfValue[d],p=n.pfValue[d],m=1-f,g=f,y=this.findMidptPtsEtc(e,t),v=y.midptPts,x=y.vectorNormInverse,b={x:v.x1*m+v.x2*g,y:v.y1*m+v.y2*g};r.segpts.push(b.x+x.x*p,b.y+x.y*p),r.radii.push(a.pfValue[d]!==void 0?a.pfValue[d]:u),r.isArcRadius.push((s.pfValue[d]!==void 0?s.pfValue[d]:h)==="arc-radius")}};Ba.findLoopPoints=function(e,t,r,i){var n=e._private.rscratch,a=t.dirCounts,s=t.srcPos,l=e.pstyle("control-point-distances"),u=l?l.pfValue[0]:void 0,h=e.pstyle("loop-direction").pfValue,d=e.pstyle("loop-sweep").pfValue,f=e.pstyle("control-point-step-size").pfValue;n.edgeType="self";var p=r,m=f;i&&(p=0,m=u);var g=h-Math.PI/2,y=g-d/2,v=g+d/2,x=h+"_"+d;p=a[x]===void 0?a[x]=0:++a[x],n.ctrlpts=[s.x+Math.cos(y)*1.4*m*(p/3+1),s.y+Math.sin(y)*1.4*m*(p/3+1),s.x+Math.cos(v)*1.4*m*(p/3+1),s.y+Math.sin(v)*1.4*m*(p/3+1)]};Ba.findCompoundLoopPoints=function(e,t,r,i){var n=e._private.rscratch;n.edgeType="compound";var a=t.srcPos,s=t.tgtPos,l=t.srcW,u=t.srcH,h=t.tgtW,d=t.tgtH,f=e.pstyle("control-point-step-size").pfValue,p=e.pstyle("control-point-distances"),m=p?p.pfValue[0]:void 0,g=r,y=f;i&&(g=0,y=m);var v=50,x={x:a.x-l/2,y:a.y-u/2},b={x:s.x-h/2,y:s.y-d/2},T={x:Math.min(x.x,b.x),y:Math.min(x.y,b.y)},w=.5,C=Math.max(w,Math.log(l*t2)),k=Math.max(w,Math.log(h*t2));n.ctrlpts=[T.x,T.y-(1+Math.pow(v,1.12)/100)*y*(g/3+1)*C,T.x-(1+Math.pow(v,1.12)/100)*y*(g/3+1)*k,T.y]};Ba.findStraightEdgePoints=function(e){e._private.rscratch.edgeType="straight"};Ba.findBezierPoints=function(e,t,r,i,n){var a=e._private.rscratch,s=e.pstyle("control-point-step-size").pfValue,l=e.pstyle("control-point-distances"),u=e.pstyle("control-point-weights"),h=l&&u?Math.min(l.value.length,u.value.length):1,d=l?l.pfValue[0]:void 0,f=u.value[0],p=i;a.edgeType=p?"multibezier":"bezier",a.ctrlpts=[];for(var m=0;m<h;m++){var g=(.5-t.eles.length/2+r)*s*(n?-1:1),y=void 0,v=vP(g);p&&(d=l?l.pfValue[m]:s,f=u.value[m]),i?y=d:y=d!==void 0?v*d:void 0;var x=y!==void 0?y:g,b=1-f,T=f,w=this.findMidptPtsEtc(e,t),C=w.midptPts,k=w.vectorNormInverse,E={x:C.x1*b+C.x2*T,y:C.y1*b+C.y2*T};a.ctrlpts.push(E.x+k.x*x,E.y+k.y*x)}};Ba.findTaxiPoints=function(e,t){var r=e._private.rscratch;r.edgeType="segments";var i="vertical",n="horizontal",a="leftward",s="rightward",l="downward",u="upward",h="auto",d=t.posPts,f=t.srcW,p=t.srcH,m=t.tgtW,g=t.tgtH,y=e.pstyle("edge-distances").value,v=y!=="node-position",x=e.pstyle("taxi-direction").value,b=x,T=e.pstyle("taxi-turn"),w=T.units==="%",C=T.pfValue,k=C<0,E=e.pstyle("taxi-turn-min-distance").pfValue,A=v?(f+m)/2:0,N=v?(p+g)/2:0,P=d.x2-d.x1,I=d.y2-d.y1,D=o(function(W,ce){return W>0?Math.max(W-ce,0):Math.min(W+ce,0)},"subDWH"),_=D(P,A),R=D(I,N),M=!1;b===h?x=Math.abs(_)>Math.abs(R)?n:i:b===u||b===l?(x=i,M=!0):(b===a||b===s)&&(x=n,M=!0);var L=x===i,B=L?R:_,O=L?I:P,$=vP(O),G=!1;!(M&&(w||k))&&(b===l&&O<0||b===u&&O>0||b===a&&O>0||b===s&&O<0)&&($*=-1,B=$*Math.abs(B),G=!0);var F;if(w){var V=C<0?1+C:C;F=V*B}else{var H=C<0?B:0;F=H+C*$}var j=o(function(W){return Math.abs(W)<E||Math.abs(W)>=Math.abs(B)},"getIsTooClose"),U=j(F),Q=j(Math.abs(B)-Math.abs(F)),Y=U||Q;if(Y&&!G)if(L){var ae=Math.abs(O)<=p/2,J=Math.abs(P)<=m/2;if(ae){var te=(d.x1+d.x2)/2,re=d.y1,ee=d.y2;r.segpts=[te,re,te,ee]}else if(J){var Te=(d.y1+d.y2)/2,ue=d.x1,De=d.x2;r.segpts=[ue,Te,De,Te]}else r.segpts=[d.x1,d.y2]}else{var Ie=Math.abs(O)<=f/2,Ee=Math.abs(I)<=g/2;if(Ie){var we=(d.y1+d.y2)/2,Me=d.x1,$e=d.x2;r.segpts=[Me,we,$e,we]}else if(Ee){var de=(d.x1+d.x2)/2,rt=d.y1,ke=d.y2;r.segpts=[de,rt,de,ke]}else r.segpts=[d.x2,d.y1]}else if(L){var Fe=d.y1+F+(v?p/2*$:0),He=d.x1,at=d.x2;r.segpts=[He,Fe,at,Fe]}else{var qe=d.x1+F+(v?f/2*$:0),Ue=d.y1,ye=d.y2;r.segpts=[qe,Ue,qe,ye]}if(r.isRound){var ve=e.pstyle("taxi-radius").value,ie=e.pstyle("radius-type").value[0]==="arc-radius";r.radii=new Array(r.segpts.length/2).fill(ve),r.isArcRadius=new Array(r.segpts.length/2).fill(ie)}};Ba.tryToCorrectInvalidPoints=function(e,t){var r=e._private.rscratch;if(r.edgeType==="bezier"){var i=t.srcPos,n=t.tgtPos,a=t.srcW,s=t.srcH,l=t.tgtW,u=t.tgtH,h=t.srcShape,d=t.tgtShape,f=t.srcCornerRadius,p=t.tgtCornerRadius,m=t.srcRs,g=t.tgtRs,y=!Ot(r.startX)||!Ot(r.startY),v=!Ot(r.arrowStartX)||!Ot(r.arrowStartY),x=!Ot(r.endX)||!Ot(r.endY),b=!Ot(r.arrowEndX)||!Ot(r.arrowEndY),T=3,w=this.getArrowWidth(e.pstyle("width").pfValue,e.pstyle("arrow-scale").value)*this.arrowShapeWidth,C=T*w,k=e0({x:r.ctrlpts[0],y:r.ctrlpts[1]},{x:r.startX,y:r.startY}),E=k<C,A=e0({x:r.ctrlpts[0],y:r.ctrlpts[1]},{x:r.endX,y:r.endY}),N=A<C,P=!1;if(y||v||E){P=!0;var I={x:r.ctrlpts[0]-i.x,y:r.ctrlpts[1]-i.y},D=Math.sqrt(I.x*I.x+I.y*I.y),_={x:I.x/D,y:I.y/D},R=Math.max(a,s),M={x:r.ctrlpts[0]+_.x*2*R,y:r.ctrlpts[1]+_.y*2*R},L=h.intersectLine(i.x,i.y,a,s,M.x,M.y,0,f,m);E?(r.ctrlpts[0]=r.ctrlpts[0]+_.x*(C-k),r.ctrlpts[1]=r.ctrlpts[1]+_.y*(C-k)):(r.ctrlpts[0]=L[0]+_.x*C,r.ctrlpts[1]=L[1]+_.y*C)}if(x||b||N){P=!0;var B={x:r.ctrlpts[0]-n.x,y:r.ctrlpts[1]-n.y},O=Math.sqrt(B.x*B.x+B.y*B.y),$={x:B.x/O,y:B.y/O},G=Math.max(a,s),F={x:r.ctrlpts[0]+$.x*2*G,y:r.ctrlpts[1]+$.y*2*G},V=d.intersectLine(n.x,n.y,l,u,F.x,F.y,0,p,g);N?(r.ctrlpts[0]=r.ctrlpts[0]+$.x*(C-A),r.ctrlpts[1]=r.ctrlpts[1]+$.y*(C-A)):(r.ctrlpts[0]=V[0]+$.x*C,r.ctrlpts[1]=V[1]+$.y*C)}P&&this.findEndpoints(e)}};Ba.storeAllpts=function(e){var t=e._private.rscratch;if(t.edgeType==="multibezier"||t.edgeType==="bezier"||t.edgeType==="self"||t.edgeType==="compound"){t.allpts=[],t.allpts.push(t.startX,t.startY);for(var r=0;r+1<t.ctrlpts.length;r+=2)t.allpts.push(t.ctrlpts[r],t.ctrlpts[r+1]),r+3<t.ctrlpts.length&&t.allpts.push((t.ctrlpts[r]+t.ctrlpts[r+2])/2,(t.ctrlpts[r+1]+t.ctrlpts[r+3])/2);t.allpts.push(t.endX,t.endY);var i,n;t.ctrlpts.length/2%2===0?(i=t.allpts.length/2-1,t.midX=t.allpts[i],t.midY=t.allpts[i+1]):(i=t.allpts.length/2-3,n=.5,t.midX=na(t.allpts[i],t.allpts[i+2],t.allpts[i+4],n),t.midY=na(t.allpts[i+1],t.allpts[i+3],t.allpts[i+5],n))}else if(t.edgeType==="straight")t.allpts=[t.startX,t.startY,t.endX,t.endY],t.midX=(t.startX+t.endX+t.arrowStartX+t.arrowEndX)/4,t.midY=(t.startY+t.endY+t.arrowStartY+t.arrowEndY)/4;else if(t.edgeType==="segments"){if(t.allpts=[],t.allpts.push(t.startX,t.startY),t.allpts.push.apply(t.allpts,t.segpts),t.allpts.push(t.endX,t.endY),t.isRound){t.roundCorners=[];for(var a=2;a+3<t.allpts.length;a+=2){var s=t.radii[a/2-1],l=t.isArcRadius[a/2-1];t.roundCorners.push(LP({x:t.allpts[a-2],y:t.allpts[a-1]},{x:t.allpts[a],y:t.allpts[a+1],radius:s},{x:t.allpts[a+2],y:t.allpts[a+3]},s,l))}}if(t.segpts.length%4===0){var u=t.segpts.length/2,h=u-2;t.midX=(t.segpts[h]+t.segpts[u])/2,t.midY=(t.segpts[h+1]+t.segpts[u+1])/2}else{var d=t.segpts.length/2-1;if(!t.isRound)t.midX=t.segpts[d],t.midY=t.segpts[d+1];else{var f={x:t.segpts[d],y:t.segpts[d+1]},p=t.roundCorners[d/2];if(p.radius===0){var m={x:t.segpts[d+2],y:t.segpts[d+3]};t.midX=f.x,t.midY=f.y,t.midVector=[f.y-m.y,m.x-f.x]}else{var g=[f.x-p.cx,f.y-p.cy],y=p.radius/Math.sqrt(Math.pow(g[0],2)+Math.pow(g[1],2));g=g.map(function(v){return v*y}),t.midX=p.cx+g[0],t.midY=p.cy+g[1],t.midVector=g}}}}};Ba.checkForInvalidEdgeWarning=function(e){var t=e[0]._private.rscratch;t.nodesOverlap||Ot(t.startX)&&Ot(t.startY)&&Ot(t.endX)&&Ot(t.endY)?t.loggedErr=!1:t.loggedErr||(t.loggedErr=!0,di("Edge `"+e.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."))};Ba.findEdgeControlPoints=function(e){var t=this;if(!(!e||e.length===0)){for(var r=this,i=r.cy,n=i.hasCompoundNodes(),a=new Ku,s=o(function(N,P){return[].concat(N3(N),[P?1:0]).join("-")},"getKey"),l=[],u=[],h=0;h<e.length;h++){var d=e[h],f=d._private,p=d.pstyle("curve-style").value;if(!(d.removed()||!d.takesUpSpace())){if(p==="haystack"){u.push(d);continue}var m=p==="unbundled-bezier"||$d(p,"segments")||p==="straight"||p==="straight-triangle"||$d(p,"taxi"),g=p==="unbundled-bezier"||p==="bezier",y=f.source,v=f.target,x=y.poolIndex(),b=v.poolIndex(),T=[x,b].sort(),w=s(T,m),C=a.get(w);C==null&&(C={eles:[]},l.push({pairId:T,edgeIsUnbundled:m}),a.set(w,C)),C.eles.push(d),m&&(C.hasUnbundled=!0),g&&(C.hasBezier=!0)}}for(var k=o(function(){var N=l[E],P=N.pairId,I=N.edgeIsUnbundled,D=s(P,I),_=a.get(D),R;if(!_.hasUnbundled){var M=_.eles[0].parallelEdges().filter(function(ie){return ie.isBundledBezier()});gP(_.eles),M.forEach(function(ie){return _.eles.push(ie)}),_.eles.sort(function(ie,fe){return ie.poolIndex()-fe.poolIndex()})}var L=_.eles[0],B=L.source(),O=L.target();if(B.poolIndex()>O.poolIndex()){var $=B;B=O,O=$}var G=_.srcPos=B.position(),F=_.tgtPos=O.position(),V=_.srcW=B.outerWidth(),H=_.srcH=B.outerHeight(),j=_.tgtW=O.outerWidth(),U=_.tgtH=O.outerHeight(),Q=_.srcShape=r.nodeShapes[t.getNodeShape(B)],Y=_.tgtShape=r.nodeShapes[t.getNodeShape(O)],ae=_.srcCornerRadius=B.pstyle("corner-radius").value==="auto"?"auto":B.pstyle("corner-radius").pfValue,J=_.tgtCornerRadius=O.pstyle("corner-radius").value==="auto"?"auto":O.pstyle("corner-radius").pfValue,te=_.tgtRs=O._private.rscratch,re=_.srcRs=B._private.rscratch;_.dirCounts={north:0,west:0,south:0,east:0,northwest:0,southwest:0,northeast:0,southeast:0};for(var ee=0;ee<_.eles.length;ee++){var Te=_.eles[ee],ue=Te[0]._private.rscratch,De=Te.pstyle("curve-style").value,Ie=De==="unbundled-bezier"||$d(De,"segments")||$d(De,"taxi"),Ee=!B.same(Te.source());if(!_.calculatedIntersection&&B!==O&&(_.hasBezier||_.hasUnbundled)){_.calculatedIntersection=!0;var we=Q.intersectLine(G.x,G.y,V,H,F.x,F.y,0,ae,re),Me=_.srcIntn=we,$e=Y.intersectLine(F.x,F.y,j,U,G.x,G.y,0,J,te),de=_.tgtIntn=$e,rt=_.intersectionPts={x1:we[0],x2:$e[0],y1:we[1],y2:$e[1]},ke=_.posPts={x1:G.x,x2:F.x,y1:G.y,y2:F.y},Fe=$e[1]-we[1],He=$e[0]-we[0],at=Math.sqrt(He*He+Fe*Fe);Ot(at)&&at>=hst||(at=Math.sqrt(Math.max(He*He,t2)+Math.max(Fe*Fe,t2)));var qe=_.vector={x:He,y:Fe},Ue=_.vectorNorm={x:qe.x/at,y:qe.y/at},ye={x:-Ue.y,y:Ue.x};_.nodesOverlap=!Ot(at)||Y.checkPoint(we[0],we[1],0,j,U,F.x,F.y,J,te)||Q.checkPoint($e[0],$e[1],0,V,H,G.x,G.y,ae,re),_.vectorNormInverse=ye,R={nodesOverlap:_.nodesOverlap,dirCounts:_.dirCounts,calculatedIntersection:!0,hasBezier:_.hasBezier,hasUnbundled:_.hasUnbundled,eles:_.eles,srcPos:F,srcRs:te,tgtPos:G,tgtRs:re,srcW:j,srcH:U,tgtW:V,tgtH:H,srcIntn:de,tgtIntn:Me,srcShape:Y,tgtShape:Q,posPts:{x1:ke.x2,y1:ke.y2,x2:ke.x1,y2:ke.y1},intersectionPts:{x1:rt.x2,y1:rt.y2,x2:rt.x1,y2:rt.y1},vector:{x:-qe.x,y:-qe.y},vectorNorm:{x:-Ue.x,y:-Ue.y},vectorNormInverse:{x:-ye.x,y:-ye.y}}}var ve=Ee?R:_;ue.nodesOverlap=ve.nodesOverlap,ue.srcIntn=ve.srcIntn,ue.tgtIntn=ve.tgtIntn,ue.isRound=De.startsWith("round"),n&&(B.isParent()||B.isChild()||O.isParent()||O.isChild())&&(B.parents().anySame(O)||O.parents().anySame(B)||B.same(O)&&B.isParent())?t.findCompoundLoopPoints(Te,ve,ee,Ie):B===O?t.findLoopPoints(Te,ve,ee,Ie):De.endsWith("segments")?t.findSegmentsPoints(Te,ve):De.endsWith("taxi")?t.findTaxiPoints(Te,ve):De==="straight"||!Ie&&_.eles.length%2===1&&ee===Math.floor(_.eles.length/2)?t.findStraightEdgePoints(Te):t.findBezierPoints(Te,ve,ee,Ie,Ee),t.findEndpoints(Te),t.tryToCorrectInvalidPoints(Te,ve),t.checkForInvalidEdgeWarning(Te),t.storeAllpts(Te),t.storeEdgeProjections(Te),t.calculateArrowAngles(Te),t.recalculateEdgeLabelProjections(Te),t.calculateLabelAngles(Te)}},"_loop"),E=0;E<l.length;E++)k();this.findHaystackPoints(u)}};o(lge,"getPts");Ba.getSegmentPoints=function(e){var t=e[0]._private.rscratch;this.recalculateRenderedStyle(e);var r=t.edgeType;if(r==="segments")return lge(t.segpts)};Ba.getControlPoints=function(e){var t=e[0]._private.rscratch;this.recalculateRenderedStyle(e);var r=t.edgeType;if(r==="bezier"||r==="multibezier"||r==="self"||r==="compound")return lge(t.ctrlpts)};Ba.getEdgeMidpoint=function(e){var t=e[0]._private.rscratch;return this.recalculateRenderedStyle(e),{x:t.midX,y:t.midY}};h2={};h2.manualEndptToPx=function(e,t){var r=this,i=e.position(),n=e.outerWidth(),a=e.outerHeight(),s=e._private.rscratch;if(t.value.length===2){var l=[t.pfValue[0],t.pfValue[1]];return t.units[0]==="%"&&(l[0]=l[0]*n),t.units[1]==="%"&&(l[1]=l[1]*a),l[0]+=i.x,l[1]+=i.y,l}else{var u=t.pfValue[0];u=-Math.PI/2+u;var h=2*Math.max(n,a),d=[i.x+Math.cos(u)*h,i.y+Math.sin(u)*h];return r.nodeShapes[this.getNodeShape(e)].intersectLine(i.x,i.y,n,a,d[0],d[1],0,e.pstyle("corner-radius").value==="auto"?"auto":e.pstyle("corner-radius").pfValue,s)}};h2.findEndpoints=function(e){var t,r,i,n,a=this,s,l=e.source()[0],u=e.target()[0],h=l.position(),d=u.position(),f=e.pstyle("target-arrow-shape").value,p=e.pstyle("source-arrow-shape").value,m=e.pstyle("target-distance-from-node").pfValue,g=e.pstyle("source-distance-from-node").pfValue,y=l._private.rscratch,v=u._private.rscratch,x=e.pstyle("curve-style").value,b=e._private.rscratch,T=b.edgeType,w=$d(x,"taxi"),C=T==="self"||T==="compound",k=T==="bezier"||T==="multibezier"||C,E=T!=="bezier",A=T==="straight"||T==="segments",N=T==="segments",P=k||E||A,I=C||w,D=e.pstyle("source-endpoint"),_=I?"outside-to-node":D.value,R=l.pstyle("corner-radius").value==="auto"?"auto":l.pstyle("corner-radius").pfValue,M=e.pstyle("target-endpoint"),L=I?"outside-to-node":M.value,B=u.pstyle("corner-radius").value==="auto"?"auto":u.pstyle("corner-radius").pfValue;b.srcManEndpt=D,b.tgtManEndpt=M;var O,$,G,F,V=(t=(M==null||(r=M.pfValue)===null||r===void 0?void 0:r.length)===2?M.pfValue:null)!==null&&t!==void 0?t:[0,0],H=(i=(D==null||(n=D.pfValue)===null||n===void 0?void 0:n.length)===2?D.pfValue:null)!==null&&i!==void 0?i:[0,0];if(k){var j=[b.ctrlpts[0],b.ctrlpts[1]],U=E?[b.ctrlpts[b.ctrlpts.length-2],b.ctrlpts[b.ctrlpts.length-1]]:j;O=U,$=j}else if(A){var Q=N?b.segpts.slice(0,2):[d.x+V[0],d.y+V[1]],Y=N?b.segpts.slice(b.segpts.length-2):[h.x+H[0],h.y+H[1]];O=Y,$=Q}if(L==="inside-to-node")s=[d.x,d.y];else if(M.units)s=this.manualEndptToPx(u,M);else if(L==="outside-to-line")s=b.tgtIntn;else if(L==="outside-to-node"||L==="outside-to-node-or-label"?G=O:(L==="outside-to-line"||L==="outside-to-line-or-label")&&(G=[h.x,h.y]),s=a.nodeShapes[this.getNodeShape(u)].intersectLine(d.x,d.y,u.outerWidth(),u.outerHeight(),G[0],G[1],0,B,v),L==="outside-to-node-or-label"||L==="outside-to-line-or-label"){var ae=u._private.rscratch,J=ae.labelWidth,te=ae.labelHeight,re=ae.labelX,ee=ae.labelY,Te=J/2,ue=te/2,De=u.pstyle("text-valign").value;De==="top"?ee-=ue:De==="bottom"&&(ee+=ue);var Ie=u.pstyle("text-halign").value;Ie==="left"?re-=Te:Ie==="right"&&(re+=Te);var Ee=Kb(G[0],G[1],[re-Te,ee-ue,re+Te,ee-ue,re+Te,ee+ue,re-Te,ee+ue],d.x,d.y);if(Ee.length>0){var we=h,Me=jp(we,o1(s)),$e=jp(we,o1(Ee)),de=Me;if($e<Me&&(s=Ee,de=$e),Ee.length>2){var rt=jp(we,{x:Ee[2],y:Ee[3]});rt<de&&(s=[Ee[2],Ee[3]])}}}var ke=d3(s,O,a.arrowShapes[f].spacing(e)+m),Fe=d3(s,O,a.arrowShapes[f].gap(e)+m);if(b.endX=Fe[0],b.endY=Fe[1],b.arrowEndX=ke[0],b.arrowEndY=ke[1],_==="inside-to-node")s=[h.x,h.y];else if(D.units)s=this.manualEndptToPx(l,D);else if(_==="outside-to-line")s=b.srcIntn;else if(_==="outside-to-node"||_==="outside-to-node-or-label"?F=$:(_==="outside-to-line"||_==="outside-to-line-or-label")&&(F=[d.x,d.y]),s=a.nodeShapes[this.getNodeShape(l)].intersectLine(h.x,h.y,l.outerWidth(),l.outerHeight(),F[0],F[1],0,R,y),_==="outside-to-node-or-label"||_==="outside-to-line-or-label"){var He=l._private.rscratch,at=He.labelWidth,qe=He.labelHeight,Ue=He.labelX,ye=He.labelY,ve=at/2,ie=qe/2,fe=l.pstyle("text-valign").value;fe==="top"?ye-=ie:fe==="bottom"&&(ye+=ie);var W=l.pstyle("text-halign").value;W==="left"?Ue-=ve:W==="right"&&(Ue+=ve);var ce=Kb(F[0],F[1],[Ue-ve,ye-ie,Ue+ve,ye-ie,Ue+ve,ye+ie,Ue-ve,ye+ie],h.x,h.y);if(ce.length>0){var K=d,Re=jp(K,o1(s)),xe=jp(K,o1(ce)),Oe=Re;if(xe<Re&&(s=[ce[0],ce[1]],Oe=xe),ce.length>2){var be=jp(K,{x:ce[2],y:ce[3]});be<Oe&&(s=[ce[2],ce[3]])}}}var Be=d3(s,$,a.arrowShapes[p].spacing(e)+g),Ae=d3(s,$,a.arrowShapes[p].gap(e)+g);b.startX=Ae[0],b.startY=Ae[1],b.arrowStartX=Be[0],b.arrowStartY=Be[1],P&&(!Ot(b.startX)||!Ot(b.startY)||!Ot(b.endX)||!Ot(b.endY)?b.badLine=!0:b.badLine=!1)};h2.getSourceEndpoint=function(e){var t=e[0]._private.rscratch;switch(this.recalculateRenderedStyle(e),t.edgeType){case"haystack":return{x:t.haystackPts[0],y:t.haystackPts[1]};default:return{x:t.arrowStartX,y:t.arrowStartY}}};h2.getTargetEndpoint=function(e){var t=e[0]._private.rscratch;switch(this.recalculateRenderedStyle(e),t.edgeType){case"haystack":return{x:t.haystackPts[2],y:t.haystackPts[3]};default:return{x:t.arrowEndX,y:t.arrowEndY}}};MP={};o(dst,"pushBezierPts");MP.storeEdgeProjections=function(e){var t=e._private,r=t.rscratch,i=r.edgeType;if(t.rstyle.bezierPts=null,t.rstyle.linePts=null,t.rstyle.haystackPts=null,i==="multibezier"||i==="bezier"||i==="self"||i==="compound"){t.rstyle.bezierPts=[];for(var n=0;n+5<r.allpts.length;n+=4)dst(this,e,r.allpts.slice(n,n+6))}else if(i==="segments")for(var a=t.rstyle.linePts=[],n=0;n+1<r.allpts.length;n+=2)a.push({x:r.allpts[n],y:r.allpts[n+1]});else if(i==="haystack"){var s=r.haystackPts;t.rstyle.haystackPts=[{x:s[0],y:s[1]},{x:s[2],y:s[3]}]}t.rstyle.arrowWidth=this.getArrowWidth(e.pstyle("width").pfValue,e.pstyle("arrow-scale").value)*this.arrowShapeWidth};MP.recalculateEdgeProjections=function(e){this.findEdgeControlPoints(e)};$c={};$c.recalculateNodeLabelProjection=function(e){var t=e.pstyle("label").strValue;if(!qd(t)){var r,i,n=e._private,a=e.width(),s=e.height(),l=e.padding(),u=e.position(),h=e.pstyle("text-halign").strValue,d=e.pstyle("text-valign").strValue,f=n.rscratch,p=n.rstyle;switch(h){case"left":r=u.x-a/2-l;break;case"right":r=u.x+a/2+l;break;default:r=u.x}switch(d){case"top":i=u.y-s/2-l;break;case"bottom":i=u.y+s/2+l;break;default:i=u.y}f.labelX=r,f.labelY=i,p.labelX=r,p.labelY=i,this.calculateLabelAngles(e),this.applyLabelDimensions(e)}};cge=o(function(t,r){var i=Math.atan(r/t);return t===0&&i<0&&(i=i*-1),i},"lineAngleFromDelta"),uge=o(function(t,r){var i=r.x-t.x,n=r.y-t.y;return cge(i,n)},"lineAngle"),fst=o(function(t,r,i,n){var a=Xb(0,n-.001,1),s=Xb(0,n+.001,1),l=u1(t,r,i,a),u=u1(t,r,i,s);return uge(l,u)},"bezierAngle");$c.recalculateEdgeLabelProjections=function(e){var t,r=e._private,i=r.rscratch,n=this,a={mid:e.pstyle("label").strValue,source:e.pstyle("source-label").strValue,target:e.pstyle("target-label").strValue};if(a.mid||a.source||a.target){t={x:i.midX,y:i.midY};var s=o(function(f,p,m){Xu(r.rscratch,f,p,m),Xu(r.rstyle,f,p,m)},"setRs");s("labelX",null,t.x),s("labelY",null,t.y);var l=cge(i.midDispX,i.midDispY);s("labelAutoAngle",null,l);var u=o(function(){if(u.cache)return u.cache;for(var f=[],p=0;p+5<i.allpts.length;p+=4){var m={x:i.allpts[p],y:i.allpts[p+1]},g={x:i.allpts[p+2],y:i.allpts[p+3]},y={x:i.allpts[p+4],y:i.allpts[p+5]};f.push({p0:m,p1:g,p2:y,startDist:0,length:0,segments:[]})}var v=r.rstyle.bezierPts,x=n.bezierProjPcts.length;function b(E,A,N,P,I){var D=e0(A,N),_=E.segments[E.segments.length-1],R={p0:A,p1:N,t0:P,t1:I,startDist:_?_.startDist+_.length:0,length:D};E.segments.push(R),E.length+=D}o(b,"addSegment");for(var T=0;T<f.length;T++){var w=f[T],C=f[T-1];C&&(w.startDist=C.startDist+C.length),b(w,w.p0,v[T*x],0,n.bezierProjPcts[0]);for(var k=0;k<x-1;k++)b(w,v[T*x+k],v[T*x+k+1],n.bezierProjPcts[k],n.bezierProjPcts[k+1]);b(w,v[T*x+x-1],w.p2,n.bezierProjPcts[x-1],1)}return u.cache=f},"createControlPointInfo"),h=o(function(f){var p,m=f==="source";if(a[f]){var g=e.pstyle(f+"-text-offset").pfValue;switch(i.edgeType){case"self":case"compound":case"bezier":case"multibezier":{for(var y=u(),v,x=0,b=0,T=0;T<y.length;T++){for(var w=y[m?T:y.length-1-T],C=0;C<w.segments.length;C++){var k=w.segments[m?C:w.segments.length-1-C],E=T===y.length-1&&C===w.segments.length-1;if(x=b,b+=k.length,b>=g||E){v={cp:w,segment:k};break}}if(v)break}var A=v.cp,N=v.segment,P=(g-x)/N.length,I=N.t1-N.t0,D=m?N.t0+I*P:N.t1-I*P;D=Xb(0,D,1),t=u1(A.p0,A.p1,A.p2,D),p=fst(A.p0,A.p1,A.p2,D);break}case"straight":case"segments":case"haystack":{for(var _=0,R,M,L,B,O=i.allpts.length,$=0;$+3<O&&(m?(L={x:i.allpts[$],y:i.allpts[$+1]},B={x:i.allpts[$+2],y:i.allpts[$+3]}):(L={x:i.allpts[O-2-$],y:i.allpts[O-1-$]},B={x:i.allpts[O-4-$],y:i.allpts[O-3-$]}),R=e0(L,B),M=_,_+=R,!(_>=g));$+=2);var G=g-M,F=G/R;F=Xb(0,F,1),t=Ort(L,B,F),p=uge(L,B);break}}s("labelX",f,t.x),s("labelY",f,t.y),s("labelAutoAngle",f,p)}},"calculateEndProjection");h("source"),h("target"),this.applyLabelDimensions(e)}};$c.applyLabelDimensions=function(e){this.applyPrefixedLabelDimensions(e),e.isEdge()&&(this.applyPrefixedLabelDimensions(e,"source"),this.applyPrefixedLabelDimensions(e,"target"))};$c.applyPrefixedLabelDimensions=function(e,t){var r=e._private,i=this.getLabelText(e,t),n=Jp(i,e._private.labelDimsKey);if(Ps(r.rscratch,"prefixedLabelDimsKey",t)!==n){Xu(r.rscratch,"prefixedLabelDimsKey",t,n);var a=this.calculateLabelDimensions(e,i),s=e.pstyle("line-height").pfValue,l=e.pstyle("text-wrap").strValue,u=Ps(r.rscratch,"labelWrapCachedLines",t)||[],h=l!=="wrap"?1:Math.max(u.length,1),d=a.height/h,f=d*s,p=a.width,m=a.height+(h-1)*(s-1)*d;Xu(r.rstyle,"labelWidth",t,p),Xu(r.rscratch,"labelWidth",t,p),Xu(r.rstyle,"labelHeight",t,m),Xu(r.rscratch,"labelHeight",t,m),Xu(r.rscratch,"labelLineHeight",t,f)}};$c.getLabelText=function(e,t){var r=e._private,i=t?t+"-":"",n=e.pstyle(i+"label").strValue,a=e.pstyle("text-transform").value,s=o(function(H,j){return j?(Xu(r.rscratch,H,t,j),j):Ps(r.rscratch,H,t)},"rscratch");if(!n)return"";a=="none"||(a=="uppercase"?n=n.toUpperCase():a=="lowercase"&&(n=n.toLowerCase()));var l=e.pstyle("text-wrap").value;if(l==="wrap"){var u=s("labelKey");if(u!=null&&s("labelWrapKey")===u)return s("labelWrapCachedText");for(var h="\u200B",d=n.split(`
8
+ `),f=e.pstyle("text-max-width").pfValue,p=e.pstyle("text-overflow-wrap").value,m=p==="anywhere",g=[],y=/[\s\u200b]+|$/g,v=0;v<d.length;v++){var x=d[v],b=this.calculateLabelDimensions(e,x),T=b.width;if(m){var w=x.split("").join(h);x=w}if(T>f){var C=x.matchAll(y),k="",E=0,A=Fs(C),N;try{for(A.s();!(N=A.n()).done;){var P=N.value,I=P[0],D=x.substring(E,P.index);E=P.index+I.length;var _=k.length===0?D:k+D+I,R=this.calculateLabelDimensions(e,_),M=R.width;M<=f?k+=D+I:(k&&g.push(k),k=D+I)}}catch(V){A.e(V)}finally{A.f()}k.match(/^[\s\u200b]+$/)||g.push(k)}else g.push(x)}s("labelWrapCachedLines",g),n=s("labelWrapCachedText",g.join(`
9
+ `)),s("labelWrapKey",u)}else if(l==="ellipsis"){var L=e.pstyle("text-max-width").pfValue,B="",O="\u2026",$=!1;if(this.calculateLabelDimensions(e,n).width<L)return n;for(var G=0;G<n.length;G++){var F=this.calculateLabelDimensions(e,B+n[G]+O).width;if(F>L)break;B+=n[G],G===n.length-1&&($=!0)}return $||(B+=O),B}return n};$c.getLabelJustification=function(e){var t=e.pstyle("text-justification").strValue,r=e.pstyle("text-halign").strValue;if(t==="auto")if(e.isNode())switch(r){case"left":return"right";case"right":return"left";default:return"center"}else return"center";else return t};$c.calculateLabelDimensions=function(e,t){var r=this,i=r.cy.window(),n=i.document,a=0,s=e.pstyle("font-style").strValue,l=e.pstyle("font-size").pfValue,u=e.pstyle("font-family").strValue,h=e.pstyle("font-weight").strValue,d=this.labelCalcCanvas,f=this.labelCalcCanvasContext;if(!d){d=this.labelCalcCanvas=n.createElement("canvas"),f=this.labelCalcCanvasContext=d.getContext("2d");var p=d.style;p.position="absolute",p.left="-9999px",p.top="-9999px",p.zIndex="-1",p.visibility="hidden",p.pointerEvents="none"}f.font="".concat(s," ").concat(h," ").concat(l,"px ").concat(u);for(var m=0,g=0,y=t.split(`
10
+ `),v=0;v<y.length;v++){var x=y[v],b=f.measureText(x),T=Math.ceil(b.width),w=l;m=Math.max(T,m),g+=w}return m+=a,g+=a,{width:m,height:g}};$c.calculateLabelAngle=function(e,t){var r=e._private,i=r.rscratch,n=e.isEdge(),a=t?t+"-":"",s=e.pstyle(a+"text-rotation"),l=s.strValue;return l==="none"?0:n&&l==="autorotate"?i.labelAutoAngle:l==="autorotate"?0:s.pfValue};$c.calculateLabelAngles=function(e){var t=this,r=e.isEdge(),i=e._private,n=i.rscratch;n.labelAngle=t.calculateLabelAngle(e),r&&(n.sourceLabelAngle=t.calculateLabelAngle(e,"source"),n.targetLabelAngle=t.calculateLabelAngle(e,"target"))};hge={},S0e=28,E0e=!1;hge.getNodeShape=function(e){var t=this,r=e.pstyle("shape").value;if(r==="cutrectangle"&&(e.width()<S0e||e.height()<S0e))return E0e||(di("The `cutrectangle` node shape can not be used at small sizes so `rectangle` is used instead"),E0e=!0),"rectangle";if(e.isParent())return r==="rectangle"||r==="roundrectangle"||r==="round-rectangle"||r==="cutrectangle"||r==="cut-rectangle"||r==="barrel"?r:"rectangle";if(r==="polygon"){var i=e.pstyle("shape-polygon-points").value;return t.nodeShapes.makePolygon(i).name}return r};cE={};cE.registerCalculationListeners=function(){var e=this.cy,t=e.collection(),r=this,i=o(function(s){var l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(t.merge(s),l)for(var u=0;u<s.length;u++){var h=s[u],d=h._private,f=d.rstyle;f.clean=!1,f.cleanConnected=!1}},"enqueue");r.binder(e).on("bounds.* dirty.*",o(function(s){var l=s.target;i(l)},"onDirtyBounds")).on("style.* background.*",o(function(s){var l=s.target;i(l,!1)},"onDirtyStyle"));var n=o(function(s){if(s){var l=r.onUpdateEleCalcsFns;t.cleanStyle();for(var u=0;u<t.length;u++){var h=t[u],d=h._private.rstyle;h.isNode()&&!d.cleanConnected&&(i(h.connectedEdges()),d.cleanConnected=!0)}if(l)for(var f=0;f<l.length;f++){var p=l[f];p(s,t)}r.recalculateRenderedStyle(t),t=e.collection()}},"updateEleCalcs");r.flushRenderedStyleQueue=function(){n(!0)},r.beforeRender(n,r.beforeRenderPriorities.eleCalcs)};cE.onUpdateEleCalcs=function(e){var t=this.onUpdateEleCalcsFns=this.onUpdateEleCalcsFns||[];t.push(e)};cE.recalculateRenderedStyle=function(e,t){var r=o(function(w){return w._private.rstyle.cleanConnected},"isCleanConnected");if(e.length!==0){var i=[],n=[];if(!this.destroyed){t===void 0&&(t=!0);for(var a=0;a<e.length;a++){var s=e[a],l=s._private,u=l.rstyle;s.isEdge()&&(!r(s.source())||!r(s.target()))&&(u.clean=!1),s.isEdge()&&s.isBundledBezier()&&s.parallelEdges().some(function(T){return!T._private.rstyle.clean&&T.isBundledBezier()})&&(u.clean=!1),!(t&&u.clean||s.removed())&&s.pstyle("display").value!=="none"&&(l.group==="nodes"?n.push(s):i.push(s),u.clean=!0)}for(var h=0;h<n.length;h++){var d=n[h],f=d._private,p=f.rstyle,m=d.position();this.recalculateNodeLabelProjection(d),p.nodeX=m.x,p.nodeY=m.y,p.nodeW=d.pstyle("width").pfValue,p.nodeH=d.pstyle("height").pfValue}this.recalculateEdgeProjections(i);for(var g=0;g<i.length;g++){var y=i[g],v=y._private,x=v.rstyle,b=v.rscratch;x.srcX=b.arrowStartX,x.srcY=b.arrowStartY,x.tgtX=b.arrowEndX,x.tgtY=b.arrowEndY,x.midX=b.midX,x.midY=b.midY,x.labelAngle=b.labelAngle,x.sourceLabelAngle=b.sourceLabelAngle,x.targetLabelAngle=b.targetLabelAngle}}}};uE={};uE.updateCachedGrabbedEles=function(){var e=this.cachedZSortedEles;if(e){e.drag=[],e.nondrag=[];for(var t=[],r=0;r<e.length;r++){var i=e[r],n=i._private.rscratch;i.grabbed()&&!i.isParent()?t.push(i):n.inDragLayer?e.drag.push(i):e.nondrag.push(i)}for(var r=0;r<t.length;r++){var i=t[r];e.drag.push(i)}}};uE.invalidateCachedZSortedEles=function(){this.cachedZSortedEles=null};uE.getCachedZSortedEles=function(e){if(e||!this.cachedZSortedEles){var t=this.cy.mutableElements().toArray();t.sort(Hme),t.interactive=t.filter(function(r){return r.interactive()}),this.cachedZSortedEles=t,this.updateCachedGrabbedEles()}else t=this.cachedZSortedEles;return t};dge={};[n0,W3,Ba,h2,MP,$c,hge,cE,uE].forEach(function(e){hr(dge,e)});fge={};fge.getCachedImage=function(e,t,r){var i=this,n=i.imageCache=i.imageCache||{},a=n[e];if(a)return a.image.complete||a.image.addEventListener("load",r),a.image;a=n[e]=n[e]||{};var s=a.image=new Image;s.addEventListener("load",r),s.addEventListener("error",function(){s.error=!0});var l="data:",u=e.substring(0,l.length).toLowerCase()===l;return u||(t=t==="null"?null:t,s.crossOrigin=t),s.src=e,s};T1={};T1.registerBinding=function(e,t,r,i){var n=Array.prototype.slice.apply(arguments,[1]);if(Array.isArray(e)){for(var a=[],s=0;s<e.length;s++){var l=e[s];if(l!==void 0){var u=this.binder(l);a.push(u.on.apply(u,n))}}return a}var u=this.binder(e);return u.on.apply(u,n)};T1.binder=function(e){var t=this,r=t.cy.window(),i=e===r||e===r.document||e===r.document.body||Stt(e);if(t.supportsPassiveEvents==null){var n=!1;try{var a=Object.defineProperty({},"passive",{get:o(function(){return n=!0,!0},"get")});r.addEventListener("test",null,a)}catch{}t.supportsPassiveEvents=n}var s=o(function(u,h,d){var f=Array.prototype.slice.call(arguments);return i&&t.supportsPassiveEvents&&(f[2]={capture:d??!1,passive:!1,once:!1}),t.bindings.push({target:e,args:f}),(e.addEventListener||e.on).apply(e,f),this},"on");return{on:s,addEventListener:s,addListener:s,bind:s}};T1.nodeIsDraggable=function(e){return e&&e.isNode()&&!e.locked()&&e.grabbable()};T1.nodeIsGrabbable=function(e){return this.nodeIsDraggable(e)&&e.interactive()};T1.load=function(){var e=this,t=e.cy.window(),r=o(function(W){return W.selected()},"isSelected"),i=o(function(W){var ce=W.getRootNode();if(ce&&ce.nodeType===11&&ce.host!==void 0)return ce},"getShadowRoot"),n=o(function(W,ce,K,Re){W==null&&(W=e.cy);for(var xe=0;xe<ce.length;xe++){var Oe=ce[xe];W.emit({originalEvent:K,type:Oe,position:Re})}},"triggerEvents"),a=o(function(W){return W.shiftKey||W.metaKey||W.ctrlKey},"isMultSelKeyDown"),s=o(function(W,ce){var K=!0;if(e.cy.hasCompoundNodes()&&W&&W.pannable())for(var Re=0;ce&&Re<ce.length;Re++){var W=ce[Re];if(W.isNode()&&W.isParent()&&!W.pannable()){K=!1;break}}else K=!0;return K},"allowPanningPassthrough"),l=o(function(W){W[0]._private.grabbed=!0},"setGrabbed"),u=o(function(W){W[0]._private.grabbed=!1},"setFreed"),h=o(function(W){W[0]._private.rscratch.inDragLayer=!0},"setInDragLayer"),d=o(function(W){W[0]._private.rscratch.inDragLayer=!1},"setOutDragLayer"),f=o(function(W){W[0]._private.rscratch.isGrabTarget=!0},"setGrabTarget"),p=o(function(W){W[0]._private.rscratch.isGrabTarget=!1},"removeGrabTarget"),m=o(function(W,ce){var K=ce.addToList,Re=K.has(W);!Re&&W.grabbable()&&!W.locked()&&(K.merge(W),l(W))},"addToDragList"),g=o(function(W,ce){if(W.cy().hasCompoundNodes()&&!(ce.inDragLayer==null&&ce.addToList==null)){var K=W.descendants();ce.inDragLayer&&(K.forEach(h),K.connectedEdges().forEach(h)),ce.addToList&&m(K,ce)}},"addDescendantsToDrag"),y=o(function(W,ce){ce=ce||{};var K=W.cy().hasCompoundNodes();ce.inDragLayer&&(W.forEach(h),W.neighborhood().stdFilter(function(Re){return!K||Re.isEdge()}).forEach(h)),ce.addToList&&W.forEach(function(Re){m(Re,ce)}),g(W,ce),b(W,{inDragLayer:ce.inDragLayer}),e.updateCachedGrabbedEles()},"addNodesToDrag"),v=y,x=o(function(W){W&&(e.getCachedZSortedEles().forEach(function(ce){u(ce),d(ce),p(ce)}),e.updateCachedGrabbedEles())},"freeDraggedElements"),b=o(function(W,ce){if(!(ce.inDragLayer==null&&ce.addToList==null)&&W.cy().hasCompoundNodes()){var K=W.ancestors().orphans();if(!K.same(W)){var Re=K.descendants().spawnSelf().merge(K).unmerge(W).unmerge(W.descendants()),xe=Re.connectedEdges();ce.inDragLayer&&(xe.forEach(h),Re.forEach(h)),ce.addToList&&Re.forEach(function(Oe){m(Oe,ce)})}}},"updateAncestorsInDragLayer"),T=o(function(){document.activeElement!=null&&document.activeElement.blur!=null&&document.activeElement.blur()},"blurActiveDomElement"),w=typeof MutationObserver<"u",C=typeof ResizeObserver<"u";w?(e.removeObserver=new MutationObserver(function(fe){for(var W=0;W<fe.length;W++){var ce=fe[W],K=ce.removedNodes;if(K)for(var Re=0;Re<K.length;Re++){var xe=K[Re];if(xe===e.container){e.destroy();break}}}}),e.container.parentNode&&e.removeObserver.observe(e.container.parentNode,{childList:!0})):e.registerBinding(e.container,"DOMNodeRemoved",function(fe){e.destroy()});var k=o2(function(){e.cy.resize()},100);w&&(e.styleObserver=new MutationObserver(k),e.styleObserver.observe(e.container,{attributes:!0})),e.registerBinding(t,"resize",k),C&&(e.resizeObserver=new ResizeObserver(k),e.resizeObserver.observe(e.container));var E=o(function(W,ce){for(;W!=null;)ce(W),W=W.parentNode},"forEachUp"),A=o(function(){e.invalidateContainerClientCoordsCache()},"invalidateCoords");E(e.container,function(fe){e.registerBinding(fe,"transitionend",A),e.registerBinding(fe,"animationend",A),e.registerBinding(fe,"scroll",A)}),e.registerBinding(e.container,"contextmenu",function(fe){fe.preventDefault()});var N=o(function(){return e.selection[4]!==0},"inBoxSelection"),P=o(function(W){for(var ce=e.findContainerClientCoords(),K=ce[0],Re=ce[1],xe=ce[2],Oe=ce[3],be=W.touches?W.touches:[W],Be=!1,Ae=0;Ae<be.length;Ae++){var Ve=be[Ae];if(K<=Ve.clientX&&Ve.clientX<=K+xe&&Re<=Ve.clientY&&Ve.clientY<=Re+Oe){Be=!0;break}}if(!Be)return!1;for(var Pe=e.container,Ye=W.target,le=Ye.parentNode,st=!1;le;){if(le===Pe){st=!0;break}le=le.parentNode}return!!st},"eventInContainer");e.registerBinding(e.container,"mousedown",o(function(W){if(P(W)&&!(e.hoverData.which===1&&W.which!==1)){W.preventDefault(),T(),e.hoverData.capture=!0,e.hoverData.which=W.which;var ce=e.cy,K=[W.clientX,W.clientY],Re=e.projectIntoViewport(K[0],K[1]),xe=e.selection,Oe=e.findNearestElements(Re[0],Re[1],!0,!1),be=Oe[0],Be=e.dragData.possibleDragElements;e.hoverData.mdownPos=Re,e.hoverData.mdownGPos=K;var Ae=o(function(me){return{originalEvent:W,type:me,position:{x:Re[0],y:Re[1]}}},"makeEvent"),Ve=o(function(){e.hoverData.tapholdCancelled=!1,clearTimeout(e.hoverData.tapholdTimeout),e.hoverData.tapholdTimeout=setTimeout(function(){if(!e.hoverData.tapholdCancelled){var me=e.hoverData.down;me?me.emit(Ae("taphold")):ce.emit(Ae("taphold"))}},e.tapholdDuration)},"checkForTaphold");if(W.which==3){e.hoverData.cxtStarted=!0;var Pe={originalEvent:W,type:"cxttapstart",position:{x:Re[0],y:Re[1]}};be?(be.activate(),be.emit(Pe),e.hoverData.down=be):ce.emit(Pe),e.hoverData.downTime=new Date().getTime(),e.hoverData.cxtDragged=!1}else if(W.which==1){be&&be.activate();{if(be!=null&&e.nodeIsGrabbable(be)){var Ye=o(function(me){me.emit(Ae("grab"))},"triggerGrab");if(f(be),!be.selected())Be=e.dragData.possibleDragElements=ce.collection(),v(be,{addToList:Be}),be.emit(Ae("grabon")).emit(Ae("grab"));else{Be=e.dragData.possibleDragElements=ce.collection();var le=ce.$(function(st){return st.isNode()&&st.selected()&&e.nodeIsGrabbable(st)});y(le,{addToList:Be}),be.emit(Ae("grabon")),le.forEach(Ye)}e.redrawHint("eles",!0),e.redrawHint("drag",!0)}e.hoverData.down=be,e.hoverData.downs=Oe,e.hoverData.downTime=new Date().getTime()}n(be,["mousedown","tapstart","vmousedown"],W,{x:Re[0],y:Re[1]}),be==null?(xe[4]=1,e.data.bgActivePosistion={x:Re[0],y:Re[1]},e.redrawHint("select",!0),e.redraw()):be.pannable()&&(xe[4]=1),Ve()}xe[0]=xe[2]=Re[0],xe[1]=xe[3]=Re[1]}},"mousedownHandler"),!1);var I=i(e.container);e.registerBinding([t,I],"mousemove",o(function(W){var ce=e.hoverData.capture;if(!(!ce&&!P(W))){var K=!1,Re=e.cy,xe=Re.zoom(),Oe=[W.clientX,W.clientY],be=e.projectIntoViewport(Oe[0],Oe[1]),Be=e.hoverData.mdownPos,Ae=e.hoverData.mdownGPos,Ve=e.selection,Pe=null;!e.hoverData.draggingEles&&!e.hoverData.dragging&&!e.hoverData.selecting&&(Pe=e.findNearestElement(be[0],be[1],!0,!1));var Ye=e.hoverData.last,le=e.hoverData.down,st=[be[0]-Ve[2],be[1]-Ve[3]],me=e.dragData.possibleDragElements,ot;if(Ae){var kt=Oe[0]-Ae[0],Gt=kt*kt,Tt=Oe[1]-Ae[1],Et=Tt*Tt,yt=Gt+Et;e.hoverData.isOverThresholdDrag=ot=yt>=e.desktopTapThreshold2}var oe=a(W);ot&&(e.hoverData.tapholdCancelled=!0);var ht=o(function(){var pt=e.hoverData.dragDelta=e.hoverData.dragDelta||[];pt.length===0?(pt.push(st[0]),pt.push(st[1])):(pt[0]+=st[0],pt[1]+=st[1])},"updateDragDelta");K=!0,n(Pe,["mousemove","vmousemove","tapdrag"],W,{x:be[0],y:be[1]});var gt=o(function(pt){return{originalEvent:W,type:pt,position:{x:be[0],y:be[1]}}},"makeEvent"),et=o(function(){e.data.bgActivePosistion=void 0,e.hoverData.selecting||Re.emit(gt("boxstart")),Ve[4]=1,e.hoverData.selecting=!0,e.redrawHint("select",!0),e.redraw()},"goIntoBoxMode");if(e.hoverData.which===3){if(ot){var pe=gt("cxtdrag");le?le.emit(pe):Re.emit(pe),e.hoverData.cxtDragged=!0,(!e.hoverData.cxtOver||Pe!==e.hoverData.cxtOver)&&(e.hoverData.cxtOver&&e.hoverData.cxtOver.emit(gt("cxtdragout")),e.hoverData.cxtOver=Pe,Pe&&Pe.emit(gt("cxtdragover")))}}else if(e.hoverData.dragging){if(K=!0,Re.panningEnabled()&&Re.userPanningEnabled()){var Qe;if(e.hoverData.justStartedPan){var nt=e.hoverData.mdownPos;Qe={x:(be[0]-nt[0])*xe,y:(be[1]-nt[1])*xe},e.hoverData.justStartedPan=!1}else Qe={x:st[0]*xe,y:st[1]*xe};Re.panBy(Qe),Re.emit(gt("dragpan")),e.hoverData.dragged=!0}be=e.projectIntoViewport(W.clientX,W.clientY)}else if(Ve[4]==1&&(le==null||le.pannable())){if(ot){if(!e.hoverData.dragging&&Re.boxSelectionEnabled()&&(oe||!Re.panningEnabled()||!Re.userPanningEnabled()))et();else if(!e.hoverData.selecting&&Re.panningEnabled()&&Re.userPanningEnabled()){var dt=s(le,e.hoverData.downs);dt&&(e.hoverData.dragging=!0,e.hoverData.justStartedPan=!0,Ve[4]=0,e.data.bgActivePosistion=o1(Be),e.redrawHint("select",!0),e.redraw())}le&&le.pannable()&&le.active()&&le.unactivate()}}else{if(le&&le.pannable()&&le.active()&&le.unactivate(),(!le||!le.grabbed())&&Pe!=Ye&&(Ye&&n(Ye,["mouseout","tapdragout"],W,{x:be[0],y:be[1]}),Pe&&n(Pe,["mouseover","tapdragover"],W,{x:be[0],y:be[1]}),e.hoverData.last=Pe),le)if(ot){if(Re.boxSelectionEnabled()&&oe)le&&le.grabbed()&&(x(me),le.emit(gt("freeon")),me.emit(gt("free")),e.dragData.didDrag&&(le.emit(gt("dragfreeon")),me.emit(gt("dragfree")))),et();else if(le&&le.grabbed()&&e.nodeIsDraggable(le)){var Ft=!e.dragData.didDrag;Ft&&e.redrawHint("eles",!0),e.dragData.didDrag=!0,e.hoverData.draggingEles||y(me,{inDragLayer:!0});var Rt={x:0,y:0};if(Ot(st[0])&&Ot(st[1])&&(Rt.x+=st[0],Rt.y+=st[1],Ft)){var $t=e.hoverData.dragDelta;$t&&Ot($t[0])&&Ot($t[1])&&(Rt.x+=$t[0],Rt.y+=$t[1])}e.hoverData.draggingEles=!0,me.silentShift(Rt).emit(gt("position")).emit(gt("drag")),e.redrawHint("drag",!0),e.redraw()}}else ht();K=!0}if(Ve[2]=be[0],Ve[3]=be[1],K)return W.stopPropagation&&W.stopPropagation(),W.preventDefault&&W.preventDefault(),!1}},"mousemoveHandler"),!1);var D,_,R;e.registerBinding(t,"mouseup",o(function(W){if(!(e.hoverData.which===1&&W.which!==1&&e.hoverData.capture)){var ce=e.hoverData.capture;if(ce){e.hoverData.capture=!1;var K=e.cy,Re=e.projectIntoViewport(W.clientX,W.clientY),xe=e.selection,Oe=e.findNearestElement(Re[0],Re[1],!0,!1),be=e.dragData.possibleDragElements,Be=e.hoverData.down,Ae=a(W);e.data.bgActivePosistion&&(e.redrawHint("select",!0),e.redraw()),e.hoverData.tapholdCancelled=!0,e.data.bgActivePosistion=void 0,Be&&Be.unactivate();var Ve=o(function(kt){return{originalEvent:W,type:kt,position:{x:Re[0],y:Re[1]}}},"makeEvent");if(e.hoverData.which===3){var Pe=Ve("cxttapend");if(Be?Be.emit(Pe):K.emit(Pe),!e.hoverData.cxtDragged){var Ye=Ve("cxttap");Be?Be.emit(Ye):K.emit(Ye)}e.hoverData.cxtDragged=!1,e.hoverData.which=null}else if(e.hoverData.which===1){if(n(Oe,["mouseup","tapend","vmouseup"],W,{x:Re[0],y:Re[1]}),!e.dragData.didDrag&&!e.hoverData.dragged&&!e.hoverData.selecting&&!e.hoverData.isOverThresholdDrag&&(n(Be,["click","tap","vclick"],W,{x:Re[0],y:Re[1]}),_=!1,W.timeStamp-R<=K.multiClickDebounceTime()?(D&&clearTimeout(D),_=!0,R=null,n(Be,["dblclick","dbltap","vdblclick"],W,{x:Re[0],y:Re[1]})):(D=setTimeout(function(){_||n(Be,["oneclick","onetap","voneclick"],W,{x:Re[0],y:Re[1]})},K.multiClickDebounceTime()),R=W.timeStamp)),Be==null&&!e.dragData.didDrag&&!e.hoverData.selecting&&!e.hoverData.dragged&&!a(W)&&(K.$(r).unselect(["tapunselect"]),be.length>0&&e.redrawHint("eles",!0),e.dragData.possibleDragElements=be=K.collection()),Oe==Be&&!e.dragData.didDrag&&!e.hoverData.selecting&&Oe!=null&&Oe._private.selectable&&(e.hoverData.dragging||(K.selectionType()==="additive"||Ae?Oe.selected()?Oe.unselect(["tapunselect"]):Oe.select(["tapselect"]):Ae||(K.$(r).unmerge(Oe).unselect(["tapunselect"]),Oe.select(["tapselect"]))),e.redrawHint("eles",!0)),e.hoverData.selecting){var le=K.collection(e.getAllInBox(xe[0],xe[1],xe[2],xe[3]));e.redrawHint("select",!0),le.length>0&&e.redrawHint("eles",!0),K.emit(Ve("boxend"));var st=o(function(kt){return kt.selectable()&&!kt.selected()},"eleWouldBeSelected");K.selectionType()==="additive"||Ae||K.$(r).unmerge(le).unselect(),le.emit(Ve("box")).stdFilter(st).select().emit(Ve("boxselect")),e.redraw()}if(e.hoverData.dragging&&(e.hoverData.dragging=!1,e.redrawHint("select",!0),e.redrawHint("eles",!0),e.redraw()),!xe[4]){e.redrawHint("drag",!0),e.redrawHint("eles",!0);var me=Be&&Be.grabbed();x(be),me&&(Be.emit(Ve("freeon")),be.emit(Ve("free")),e.dragData.didDrag&&(Be.emit(Ve("dragfreeon")),be.emit(Ve("dragfree"))))}}xe[4]=0,e.hoverData.down=null,e.hoverData.cxtStarted=!1,e.hoverData.draggingEles=!1,e.hoverData.selecting=!1,e.hoverData.isOverThresholdDrag=!1,e.dragData.didDrag=!1,e.hoverData.dragged=!1,e.hoverData.dragDelta=[],e.hoverData.mdownPos=null,e.hoverData.mdownGPos=null,e.hoverData.which=null}}},"mouseupHandler"),!1);var M=[],L=4,B,O=1e5,$=o(function(W,ce){for(var K=0;K<W.length;K++)if(W[K]%ce!==0)return!1;return!0},"allAreDivisibleBy"),G=o(function(W){for(var ce=Math.abs(W[0]),K=1;K<W.length;K++)if(Math.abs(W[K])!==ce)return!1;return!0},"allAreSameMagnitude"),F=o(function(W){var ce=!1,K=W.deltaY;if(K==null&&(W.wheelDeltaY!=null?K=W.wheelDeltaY/4:W.wheelDelta!=null&&(K=W.wheelDelta/4)),K!==0){if(B==null)if(M.length>=L){var Re=M;if(B=$(Re,5),!B){var xe=Math.abs(Re[0]);B=G(Re)&&xe>5}if(B)for(var Oe=0;Oe<Re.length;Oe++)O=Math.min(Math.abs(Re[Oe]),O)}else M.push(K),ce=!0;else B&&(O=Math.min(Math.abs(K),O));if(!e.scrollingPage){var be=e.cy,Be=be.zoom(),Ae=be.pan(),Ve=e.projectIntoViewport(W.clientX,W.clientY),Pe=[Ve[0]*Be+Ae.x,Ve[1]*Be+Ae.y];if(e.hoverData.draggingEles||e.hoverData.dragging||e.hoverData.cxtStarted||N()){W.preventDefault();return}if(be.panningEnabled()&&be.userPanningEnabled()&&be.zoomingEnabled()&&be.userZoomingEnabled()){W.preventDefault(),e.data.wheelZooming=!0,clearTimeout(e.data.wheelTimeout),e.data.wheelTimeout=setTimeout(function(){e.data.wheelZooming=!1,e.redrawHint("eles",!0),e.redraw()},150);var Ye;ce&&Math.abs(K)>5&&(K=vP(K)*5),Ye=K/-250,B&&(Ye/=O,Ye*=3),Ye=Ye*e.wheelSensitivity;var le=W.deltaMode===1;le&&(Ye*=33);var st=be.zoom()*Math.pow(10,Ye);W.type==="gesturechange"&&(st=e.gestureStartZoom*W.scale),be.zoom({level:st,renderedPosition:{x:Pe[0],y:Pe[1]}}),be.emit({type:W.type==="gesturechange"?"pinchzoom":"scrollzoom",originalEvent:W,position:{x:Ve[0],y:Ve[1]}})}}}},"wheelHandler");e.registerBinding(e.container,"wheel",F,!0),e.registerBinding(t,"scroll",o(function(W){e.scrollingPage=!0,clearTimeout(e.scrollingPageTimeout),e.scrollingPageTimeout=setTimeout(function(){e.scrollingPage=!1},250)},"scrollHandler"),!0),e.registerBinding(e.container,"gesturestart",o(function(W){e.gestureStartZoom=e.cy.zoom(),e.hasTouchStarted||W.preventDefault()},"gestureStartHandler"),!0),e.registerBinding(e.container,"gesturechange",function(fe){e.hasTouchStarted||F(fe)},!0),e.registerBinding(e.container,"mouseout",o(function(W){var ce=e.projectIntoViewport(W.clientX,W.clientY);e.cy.emit({originalEvent:W,type:"mouseout",position:{x:ce[0],y:ce[1]}})},"mouseOutHandler"),!1),e.registerBinding(e.container,"mouseover",o(function(W){var ce=e.projectIntoViewport(W.clientX,W.clientY);e.cy.emit({originalEvent:W,type:"mouseover",position:{x:ce[0],y:ce[1]}})},"mouseOverHandler"),!1);var V,H,j,U,Q,Y,ae,J,te,re,ee,Te,ue,De=o(function(W,ce,K,Re){return Math.sqrt((K-W)*(K-W)+(Re-ce)*(Re-ce))},"distance"),Ie=o(function(W,ce,K,Re){return(K-W)*(K-W)+(Re-ce)*(Re-ce)},"distanceSq"),Ee;e.registerBinding(e.container,"touchstart",Ee=o(function(W){if(e.hasTouchStarted=!0,!!P(W)){T(),e.touchData.capture=!0,e.data.bgActivePosistion=void 0;var ce=e.cy,K=e.touchData.now,Re=e.touchData.earlier;if(W.touches[0]){var xe=e.projectIntoViewport(W.touches[0].clientX,W.touches[0].clientY);K[0]=xe[0],K[1]=xe[1]}if(W.touches[1]){var xe=e.projectIntoViewport(W.touches[1].clientX,W.touches[1].clientY);K[2]=xe[0],K[3]=xe[1]}if(W.touches[2]){var xe=e.projectIntoViewport(W.touches[2].clientX,W.touches[2].clientY);K[4]=xe[0],K[5]=xe[1]}var Oe=o(function(oe){return{originalEvent:W,type:oe,position:{x:K[0],y:K[1]}}},"makeEvent");if(W.touches[1]){e.touchData.singleTouchMoved=!0,x(e.dragData.touchDragEles);var be=e.findContainerClientCoords();te=be[0],re=be[1],ee=be[2],Te=be[3],V=W.touches[0].clientX-te,H=W.touches[0].clientY-re,j=W.touches[1].clientX-te,U=W.touches[1].clientY-re,ue=0<=V&&V<=ee&&0<=j&&j<=ee&&0<=H&&H<=Te&&0<=U&&U<=Te;var Be=ce.pan(),Ae=ce.zoom();Q=De(V,H,j,U),Y=Ie(V,H,j,U),ae=[(V+j)/2,(H+U)/2],J=[(ae[0]-Be.x)/Ae,(ae[1]-Be.y)/Ae];var Ve=200,Pe=Ve*Ve;if(Y<Pe&&!W.touches[2]){var Ye=e.findNearestElement(K[0],K[1],!0,!0),le=e.findNearestElement(K[2],K[3],!0,!0);Ye&&Ye.isNode()?(Ye.activate().emit(Oe("cxttapstart")),e.touchData.start=Ye):le&&le.isNode()?(le.activate().emit(Oe("cxttapstart")),e.touchData.start=le):ce.emit(Oe("cxttapstart")),e.touchData.start&&(e.touchData.start._private.grabbed=!1),e.touchData.cxt=!0,e.touchData.cxtDragged=!1,e.data.bgActivePosistion=void 0,e.redraw();return}}if(W.touches[2])ce.boxSelectionEnabled()&&W.preventDefault();else if(!W.touches[1]){if(W.touches[0]){var st=e.findNearestElements(K[0],K[1],!0,!0),me=st[0];if(me!=null&&(me.activate(),e.touchData.start=me,e.touchData.starts=st,e.nodeIsGrabbable(me))){var ot=e.dragData.touchDragEles=ce.collection(),kt=null;e.redrawHint("eles",!0),e.redrawHint("drag",!0),me.selected()?(kt=ce.$(function(yt){return yt.selected()&&e.nodeIsGrabbable(yt)}),y(kt,{addToList:ot})):v(me,{addToList:ot}),f(me),me.emit(Oe("grabon")),kt?kt.forEach(function(yt){yt.emit(Oe("grab"))}):me.emit(Oe("grab"))}n(me,["touchstart","tapstart","vmousedown"],W,{x:K[0],y:K[1]}),me==null&&(e.data.bgActivePosistion={x:xe[0],y:xe[1]},e.redrawHint("select",!0),e.redraw()),e.touchData.singleTouchMoved=!1,e.touchData.singleTouchStartTime=+new Date,clearTimeout(e.touchData.tapholdTimeout),e.touchData.tapholdTimeout=setTimeout(function(){e.touchData.singleTouchMoved===!1&&!e.pinching&&!e.touchData.selecting&&n(e.touchData.start,["taphold"],W,{x:K[0],y:K[1]})},e.tapholdDuration)}}if(W.touches.length>=1){for(var Gt=e.touchData.startPosition=[null,null,null,null,null,null],Tt=0;Tt<K.length;Tt++)Gt[Tt]=Re[Tt]=K[Tt];var Et=W.touches[0];e.touchData.startGPosition=[Et.clientX,Et.clientY]}}},"touchstartHandler"),!1);var we;e.registerBinding(t,"touchmove",we=o(function(W){var ce=e.touchData.capture;if(!(!ce&&!P(W))){var K=e.selection,Re=e.cy,xe=e.touchData.now,Oe=e.touchData.earlier,be=Re.zoom();if(W.touches[0]){var Be=e.projectIntoViewport(W.touches[0].clientX,W.touches[0].clientY);xe[0]=Be[0],xe[1]=Be[1]}if(W.touches[1]){var Be=e.projectIntoViewport(W.touches[1].clientX,W.touches[1].clientY);xe[2]=Be[0],xe[3]=Be[1]}if(W.touches[2]){var Be=e.projectIntoViewport(W.touches[2].clientX,W.touches[2].clientY);xe[4]=Be[0],xe[5]=Be[1]}var Ae=o(function(xC){return{originalEvent:W,type:xC,position:{x:xe[0],y:xe[1]}}},"makeEvent"),Ve=e.touchData.startGPosition,Pe;if(ce&&W.touches[0]&&Ve){for(var Ye=[],le=0;le<xe.length;le++)Ye[le]=xe[le]-Oe[le];var st=W.touches[0].clientX-Ve[0],me=st*st,ot=W.touches[0].clientY-Ve[1],kt=ot*ot,Gt=me+kt;Pe=Gt>=e.touchTapThreshold2}if(ce&&e.touchData.cxt){W.preventDefault();var Tt=W.touches[0].clientX-te,Et=W.touches[0].clientY-re,yt=W.touches[1].clientX-te,oe=W.touches[1].clientY-re,ht=Ie(Tt,Et,yt,oe),gt=ht/Y,et=150,pe=et*et,Qe=1.5,nt=Qe*Qe;if(gt>=nt||ht>=pe){e.touchData.cxt=!1,e.data.bgActivePosistion=void 0,e.redrawHint("select",!0);var dt=Ae("cxttapend");e.touchData.start?(e.touchData.start.unactivate().emit(dt),e.touchData.start=null):Re.emit(dt)}}if(ce&&e.touchData.cxt){var dt=Ae("cxtdrag");e.data.bgActivePosistion=void 0,e.redrawHint("select",!0),e.touchData.start?e.touchData.start.emit(dt):Re.emit(dt),e.touchData.start&&(e.touchData.start._private.grabbed=!1),e.touchData.cxtDragged=!0;var Ft=e.findNearestElement(xe[0],xe[1],!0,!0);(!e.touchData.cxtOver||Ft!==e.touchData.cxtOver)&&(e.touchData.cxtOver&&e.touchData.cxtOver.emit(Ae("cxtdragout")),e.touchData.cxtOver=Ft,Ft&&Ft.emit(Ae("cxtdragover")))}else if(ce&&W.touches[2]&&Re.boxSelectionEnabled())W.preventDefault(),e.data.bgActivePosistion=void 0,this.lastThreeTouch=+new Date,e.touchData.selecting||Re.emit(Ae("boxstart")),e.touchData.selecting=!0,e.touchData.didSelect=!0,K[4]=1,!K||K.length===0||K[0]===void 0?(K[0]=(xe[0]+xe[2]+xe[4])/3,K[1]=(xe[1]+xe[3]+xe[5])/3,K[2]=(xe[0]+xe[2]+xe[4])/3+1,K[3]=(xe[1]+xe[3]+xe[5])/3+1):(K[2]=(xe[0]+xe[2]+xe[4])/3,K[3]=(xe[1]+xe[3]+xe[5])/3),e.redrawHint("select",!0),e.redraw();else if(ce&&W.touches[1]&&!e.touchData.didSelect&&Re.zoomingEnabled()&&Re.panningEnabled()&&Re.userZoomingEnabled()&&Re.userPanningEnabled()){W.preventDefault(),e.data.bgActivePosistion=void 0,e.redrawHint("select",!0);var Rt=e.dragData.touchDragEles;if(Rt){e.redrawHint("drag",!0);for(var $t=0;$t<Rt.length;$t++){var lr=Rt[$t]._private;lr.grabbed=!1,lr.rscratch.inDragLayer=!1}}var pt=e.touchData.start,Tt=W.touches[0].clientX-te,Et=W.touches[0].clientY-re,yt=W.touches[1].clientX-te,oe=W.touches[1].clientY-re,Se=De(Tt,Et,yt,oe),it=Se/Q;if(ue){var xt=Tt-V,rr=Et-H,_r=yt-j,Ur=oe-U,Dr=(xt+_r)/2,Xi=(rr+Ur)/2,In=Re.zoom(),pi=In*it,zt=Re.pan(),Mt=J[0]*In+zt.x,qt=J[1]*In+zt.y,Qt={x:-pi/In*(Mt-zt.x-Dr)+Mt,y:-pi/In*(qt-zt.y-Xi)+qt};if(pt&&pt.active()){var Rt=e.dragData.touchDragEles;x(Rt),e.redrawHint("drag",!0),e.redrawHint("eles",!0),pt.unactivate().emit(Ae("freeon")),Rt.emit(Ae("free")),e.dragData.didDrag&&(pt.emit(Ae("dragfreeon")),Rt.emit(Ae("dragfree")))}Re.viewport({zoom:pi,pan:Qt,cancelOnFailedZoom:!0}),Re.emit(Ae("pinchzoom")),Q=Se,V=Tt,H=Et,j=yt,U=oe,e.pinching=!0}if(W.touches[0]){var Be=e.projectIntoViewport(W.touches[0].clientX,W.touches[0].clientY);xe[0]=Be[0],xe[1]=Be[1]}if(W.touches[1]){var Be=e.projectIntoViewport(W.touches[1].clientX,W.touches[1].clientY);xe[2]=Be[0],xe[3]=Be[1]}if(W.touches[2]){var Be=e.projectIntoViewport(W.touches[2].clientX,W.touches[2].clientY);xe[4]=Be[0],xe[5]=Be[1]}}else if(W.touches[0]&&!e.touchData.didSelect){var _t=e.touchData.start,oi=e.touchData.last,Ft;if(!e.hoverData.draggingEles&&!e.swipePanning&&(Ft=e.findNearestElement(xe[0],xe[1],!0,!0)),ce&&_t!=null&&W.preventDefault(),ce&&_t!=null&&e.nodeIsDraggable(_t))if(Pe){var Rt=e.dragData.touchDragEles,Ce=!e.dragData.didDrag;Ce&&y(Rt,{inDragLayer:!0}),e.dragData.didDrag=!0;var Zs={x:0,y:0};if(Ot(Ye[0])&&Ot(Ye[1])&&(Zs.x+=Ye[0],Zs.y+=Ye[1],Ce)){e.redrawHint("eles",!0);var _e=e.touchData.dragDelta;_e&&Ot(_e[0])&&Ot(_e[1])&&(Zs.x+=_e[0],Zs.y+=_e[1])}e.hoverData.draggingEles=!0,Rt.silentShift(Zs).emit(Ae("position")).emit(Ae("drag")),e.redrawHint("drag",!0),e.touchData.startPosition[0]==Oe[0]&&e.touchData.startPosition[1]==Oe[1]&&e.redrawHint("eles",!0),e.redraw()}else{var _e=e.touchData.dragDelta=e.touchData.dragDelta||[];_e.length===0?(_e.push(Ye[0]),_e.push(Ye[1])):(_e[0]+=Ye[0],_e[1]+=Ye[1])}if(n(_t||Ft,["touchmove","tapdrag","vmousemove"],W,{x:xe[0],y:xe[1]}),(!_t||!_t.grabbed())&&Ft!=oi&&(oi&&oi.emit(Ae("tapdragout")),Ft&&Ft.emit(Ae("tapdragover"))),e.touchData.last=Ft,ce)for(var $t=0;$t<xe.length;$t++)xe[$t]&&e.touchData.startPosition[$t]&&Pe&&(e.touchData.singleTouchMoved=!0);if(ce&&(_t==null||_t.pannable())&&Re.panningEnabled()&&Re.userPanningEnabled()){var an=s(_t,e.touchData.starts);an&&(W.preventDefault(),e.data.bgActivePosistion||(e.data.bgActivePosistion=o1(e.touchData.startPosition)),e.swipePanning?(Re.panBy({x:Ye[0]*be,y:Ye[1]*be}),Re.emit(Ae("dragpan"))):Pe&&(e.swipePanning=!0,Re.panBy({x:st*be,y:ot*be}),Re.emit(Ae("dragpan")),_t&&(_t.unactivate(),e.redrawHint("select",!0),e.touchData.start=null)));var Be=e.projectIntoViewport(W.touches[0].clientX,W.touches[0].clientY);xe[0]=Be[0],xe[1]=Be[1]}}for(var le=0;le<xe.length;le++)Oe[le]=xe[le];ce&&W.touches.length>0&&!e.hoverData.draggingEles&&!e.swipePanning&&e.data.bgActivePosistion!=null&&(e.data.bgActivePosistion=void 0,e.redrawHint("select",!0),e.redraw())}},"touchmoveHandler"),!1);var Me;e.registerBinding(t,"touchcancel",Me=o(function(W){var ce=e.touchData.start;e.touchData.capture=!1,ce&&ce.unactivate()},"touchcancelHandler"));var $e,de,rt,ke;if(e.registerBinding(t,"touchend",$e=o(function(W){var ce=e.touchData.start,K=e.touchData.capture;if(K)W.touches.length===0&&(e.touchData.capture=!1),W.preventDefault();else return;var Re=e.selection;e.swipePanning=!1,e.hoverData.draggingEles=!1;var xe=e.cy,Oe=xe.zoom(),be=e.touchData.now,Be=e.touchData.earlier;if(W.touches[0]){var Ae=e.projectIntoViewport(W.touches[0].clientX,W.touches[0].clientY);be[0]=Ae[0],be[1]=Ae[1]}if(W.touches[1]){var Ae=e.projectIntoViewport(W.touches[1].clientX,W.touches[1].clientY);be[2]=Ae[0],be[3]=Ae[1]}if(W.touches[2]){var Ae=e.projectIntoViewport(W.touches[2].clientX,W.touches[2].clientY);be[4]=Ae[0],be[5]=Ae[1]}var Ve=o(function(pe){return{originalEvent:W,type:pe,position:{x:be[0],y:be[1]}}},"makeEvent");ce&&ce.unactivate();var Pe;if(e.touchData.cxt){if(Pe=Ve("cxttapend"),ce?ce.emit(Pe):xe.emit(Pe),!e.touchData.cxtDragged){var Ye=Ve("cxttap");ce?ce.emit(Ye):xe.emit(Ye)}e.touchData.start&&(e.touchData.start._private.grabbed=!1),e.touchData.cxt=!1,e.touchData.start=null,e.redraw();return}if(!W.touches[2]&&xe.boxSelectionEnabled()&&e.touchData.selecting){e.touchData.selecting=!1;var le=xe.collection(e.getAllInBox(Re[0],Re[1],Re[2],Re[3]));Re[0]=void 0,Re[1]=void 0,Re[2]=void 0,Re[3]=void 0,Re[4]=0,e.redrawHint("select",!0),xe.emit(Ve("boxend"));var st=o(function(pe){return pe.selectable()&&!pe.selected()},"eleWouldBeSelected");le.emit(Ve("box")).stdFilter(st).select().emit(Ve("boxselect")),le.nonempty()&&e.redrawHint("eles",!0),e.redraw()}if(ce?.unactivate(),W.touches[2])e.data.bgActivePosistion=void 0,e.redrawHint("select",!0);else if(!W.touches[1]){if(!W.touches[0]){if(!W.touches[0]){e.data.bgActivePosistion=void 0,e.redrawHint("select",!0);var me=e.dragData.touchDragEles;if(ce!=null){var ot=ce._private.grabbed;x(me),e.redrawHint("drag",!0),e.redrawHint("eles",!0),ot&&(ce.emit(Ve("freeon")),me.emit(Ve("free")),e.dragData.didDrag&&(ce.emit(Ve("dragfreeon")),me.emit(Ve("dragfree")))),n(ce,["touchend","tapend","vmouseup","tapdragout"],W,{x:be[0],y:be[1]}),ce.unactivate(),e.touchData.start=null}else{var kt=e.findNearestElement(be[0],be[1],!0,!0);n(kt,["touchend","tapend","vmouseup","tapdragout"],W,{x:be[0],y:be[1]})}var Gt=e.touchData.startPosition[0]-be[0],Tt=Gt*Gt,Et=e.touchData.startPosition[1]-be[1],yt=Et*Et,oe=Tt+yt,ht=oe*Oe*Oe;e.touchData.singleTouchMoved||(ce||xe.$(":selected").unselect(["tapunselect"]),n(ce,["tap","vclick"],W,{x:be[0],y:be[1]}),de=!1,W.timeStamp-ke<=xe.multiClickDebounceTime()?(rt&&clearTimeout(rt),de=!0,ke=null,n(ce,["dbltap","vdblclick"],W,{x:be[0],y:be[1]})):(rt=setTimeout(function(){de||n(ce,["onetap","voneclick"],W,{x:be[0],y:be[1]})},xe.multiClickDebounceTime()),ke=W.timeStamp)),ce!=null&&!e.dragData.didDrag&&ce._private.selectable&&ht<e.touchTapThreshold2&&!e.pinching&&(xe.selectionType()==="single"?(xe.$(r).unmerge(ce).unselect(["tapunselect"]),ce.select(["tapselect"])):ce.selected()?ce.unselect(["tapunselect"]):ce.select(["tapselect"]),e.redrawHint("eles",!0)),e.touchData.singleTouchMoved=!0}}}for(var gt=0;gt<be.length;gt++)Be[gt]=be[gt];e.dragData.didDrag=!1,W.touches.length===0&&(e.touchData.dragDelta=[],e.touchData.startPosition=[null,null,null,null,null,null],e.touchData.startGPosition=null,e.touchData.didSelect=!1),W.touches.length<2&&(W.touches.length===1&&(e.touchData.startGPosition=[W.touches[0].clientX,W.touches[0].clientY]),e.pinching=!1,e.redrawHint("eles",!0),e.redraw())},"touchendHandler"),!1),typeof TouchEvent>"u"){var Fe=[],He=o(function(W){return{clientX:W.clientX,clientY:W.clientY,force:1,identifier:W.pointerId,pageX:W.pageX,pageY:W.pageY,radiusX:W.width/2,radiusY:W.height/2,screenX:W.screenX,screenY:W.screenY,target:W.target}},"makeTouch"),at=o(function(W){return{event:W,touch:He(W)}},"makePointer"),qe=o(function(W){Fe.push(at(W))},"addPointer"),Ue=o(function(W){for(var ce=0;ce<Fe.length;ce++){var K=Fe[ce];if(K.event.pointerId===W.pointerId){Fe.splice(ce,1);return}}},"removePointer"),ye=o(function(W){var ce=Fe.filter(function(K){return K.event.pointerId===W.pointerId})[0];ce.event=W,ce.touch=He(W)},"updatePointer"),ve=o(function(W){W.touches=Fe.map(function(ce){return ce.touch})},"addTouchesToEvent"),ie=o(function(W){return W.pointerType==="mouse"||W.pointerType===4},"pointerIsMouse");e.registerBinding(e.container,"pointerdown",function(fe){ie(fe)||(fe.preventDefault(),qe(fe),ve(fe),Ee(fe))}),e.registerBinding(e.container,"pointerup",function(fe){ie(fe)||(Ue(fe),ve(fe),$e(fe))}),e.registerBinding(e.container,"pointercancel",function(fe){ie(fe)||(Ue(fe),ve(fe),Me(fe))}),e.registerBinding(e.container,"pointermove",function(fe){ie(fe)||(fe.preventDefault(),ye(fe),ve(fe),we(fe))})}};Ju={};Ju.generatePolygon=function(e,t){return this.nodeShapes[e]={renderer:this,name:e,points:t,draw:o(function(i,n,a,s,l,u){this.renderer.nodeShapeImpl("polygon",i,n,a,s,l,this.points)},"draw"),intersectLine:o(function(i,n,a,s,l,u,h,d){return Kb(l,u,this.points,i,n,a/2,s/2,h)},"intersectLine"),checkPoint:o(function(i,n,a,s,l,u,h,d){return Qu(i,n,this.points,u,h,s,l,[0,-1],a)},"checkPoint"),hasMiterBounds:e!=="rectangle",miterBounds:o(function(i,n,a,s,l,u){return Grt(this.points,i,n,a,s,l)},"miterBounds")}};Ju.generateEllipse=function(){return this.nodeShapes.ellipse={renderer:this,name:"ellipse",draw:o(function(t,r,i,n,a,s){this.renderer.nodeShapeImpl(this.name,t,r,i,n,a)},"draw"),intersectLine:o(function(t,r,i,n,a,s,l,u){return Xrt(a,s,t,r,i/2+l,n/2+l)},"intersectLine"),checkPoint:o(function(t,r,i,n,a,s,l,u){return Qp(t,r,n,a,s,l,i)},"checkPoint")}};Ju.generateRoundPolygon=function(e,t){return this.nodeShapes[e]={renderer:this,name:e,points:t,getOrCreateCorners:o(function(i,n,a,s,l,u,h){if(u[h]!==void 0&&u[h+"-cx"]===i&&u[h+"-cy"]===n)return u[h];u[h]=new Array(t.length/2),u[h+"-cx"]=i,u[h+"-cy"]=n;var d=a/2,f=s/2;l=l==="auto"?pme(a,s):l;for(var p=new Array(t.length/2),m=0;m<t.length/2;m++)p[m]={x:i+d*t[m*2],y:n+f*t[m*2+1]};var g,y,v,x,b=p.length;for(y=p[b-1],g=0;g<b;g++)v=p[g%b],x=p[(g+1)%b],u[h][g]=LP(y,v,x,l),y=v,v=x;return u[h]},"getOrCreateCorners"),draw:o(function(i,n,a,s,l,u,h){this.renderer.nodeShapeImpl("round-polygon",i,n,a,s,l,this.points,this.getOrCreateCorners(n,a,s,l,u,h,"drawCorners"))},"draw"),intersectLine:o(function(i,n,a,s,l,u,h,d,f){return Zrt(l,u,this.points,i,n,a,s,h,this.getOrCreateCorners(i,n,a,s,d,f,"corners"))},"intersectLine"),checkPoint:o(function(i,n,a,s,l,u,h,d,f){return jrt(i,n,this.points,u,h,s,l,this.getOrCreateCorners(u,h,s,l,d,f,"corners"))},"checkPoint")}};Ju.generateRoundRectangle=function(){return this.nodeShapes["round-rectangle"]=this.nodeShapes.roundrectangle={renderer:this,name:"round-rectangle",points:rs(4,0),draw:o(function(t,r,i,n,a,s){this.renderer.nodeShapeImpl(this.name,t,r,i,n,a,this.points,s)},"draw"),intersectLine:o(function(t,r,i,n,a,s,l,u){return dme(a,s,t,r,i,n,l,u)},"intersectLine"),checkPoint:o(function(t,r,i,n,a,s,l,u){var h=n/2,d=a/2;u=u==="auto"?Hd(n,a):u,u=Math.min(h,d,u);var f=u*2;return!!(Qu(t,r,this.points,s,l,n,a-f,[0,-1],i)||Qu(t,r,this.points,s,l,n-f,a,[0,-1],i)||Qp(t,r,f,f,s-h+u,l-d+u,i)||Qp(t,r,f,f,s+h-u,l-d+u,i)||Qp(t,r,f,f,s+h-u,l+d-u,i)||Qp(t,r,f,f,s-h+u,l+d-u,i))},"checkPoint")}};Ju.generateCutRectangle=function(){return this.nodeShapes["cut-rectangle"]=this.nodeShapes.cutrectangle={renderer:this,name:"cut-rectangle",cornerLength:bP(),points:rs(4,0),draw:o(function(t,r,i,n,a,s){this.renderer.nodeShapeImpl(this.name,t,r,i,n,a,null,s)},"draw"),generateCutTrianglePts:o(function(t,r,i,n,a){var s=a==="auto"?this.cornerLength:a,l=r/2,u=t/2,h=i-u,d=i+u,f=n-l,p=n+l;return{topLeft:[h,f+s,h+s,f,h+s,f+s],topRight:[d-s,f,d,f+s,d-s,f+s],bottomRight:[d,p-s,d-s,p,d-s,p-s],bottomLeft:[h+s,p,h,p-s,h+s,p-s]}},"generateCutTrianglePts"),intersectLine:o(function(t,r,i,n,a,s,l,u){var h=this.generateCutTrianglePts(i+2*l,n+2*l,t,r,u),d=[].concat.apply([],[h.topLeft.splice(0,4),h.topRight.splice(0,4),h.bottomRight.splice(0,4),h.bottomLeft.splice(0,4)]);return Kb(a,s,d,t,r)},"intersectLine"),checkPoint:o(function(t,r,i,n,a,s,l,u){var h=u==="auto"?this.cornerLength:u;if(Qu(t,r,this.points,s,l,n,a-2*h,[0,-1],i)||Qu(t,r,this.points,s,l,n-2*h,a,[0,-1],i))return!0;var d=this.generateCutTrianglePts(n,a,s,l);return Bs(t,r,d.topLeft)||Bs(t,r,d.topRight)||Bs(t,r,d.bottomRight)||Bs(t,r,d.bottomLeft)},"checkPoint")}};Ju.generateBarrel=function(){return this.nodeShapes.barrel={renderer:this,name:"barrel",points:rs(4,0),draw:o(function(t,r,i,n,a,s){this.renderer.nodeShapeImpl(this.name,t,r,i,n,a)},"draw"),intersectLine:o(function(t,r,i,n,a,s,l,u){var h=.15,d=.5,f=.85,p=this.generateBarrelBezierPts(i+2*l,n+2*l,t,r),m=o(function(v){var x=u1({x:v[0],y:v[1]},{x:v[2],y:v[3]},{x:v[4],y:v[5]},h),b=u1({x:v[0],y:v[1]},{x:v[2],y:v[3]},{x:v[4],y:v[5]},d),T=u1({x:v[0],y:v[1]},{x:v[2],y:v[3]},{x:v[4],y:v[5]},f);return[v[0],v[1],x.x,x.y,b.x,b.y,T.x,T.y,v[4],v[5]]},"approximateBarrelCurvePts"),g=[].concat(m(p.topLeft),m(p.topRight),m(p.bottomRight),m(p.bottomLeft));return Kb(a,s,g,t,r)},"intersectLine"),generateBarrelBezierPts:o(function(t,r,i,n){var a=r/2,s=t/2,l=i-s,u=i+s,h=n-a,d=n+a,f=HO(t,r),p=f.heightOffset,m=f.widthOffset,g=f.ctrlPtOffsetPct*t,y={topLeft:[l,h+p,l+g,h,l+m,h],topRight:[u-m,h,u-g,h,u,h+p],bottomRight:[u,d-p,u-g,d,u-m,d],bottomLeft:[l+m,d,l+g,d,l,d-p]};return y.topLeft.isTop=!0,y.topRight.isTop=!0,y.bottomLeft.isBottom=!0,y.bottomRight.isBottom=!0,y},"generateBarrelBezierPts"),checkPoint:o(function(t,r,i,n,a,s,l,u){var h=HO(n,a),d=h.heightOffset,f=h.widthOffset;if(Qu(t,r,this.points,s,l,n,a-2*d,[0,-1],i)||Qu(t,r,this.points,s,l,n-2*f,a,[0,-1],i))return!0;for(var p=this.generateBarrelBezierPts(n,a,s,l),m=o(function(A,N,P){var I=P[4],D=P[2],_=P[0],R=P[5],M=P[1],L=Math.min(I,_),B=Math.max(I,_),O=Math.min(R,M),$=Math.max(R,M);if(L<=A&&A<=B&&O<=N&&N<=$){var G=Qrt(I,D,_),F=qrt(G[0],G[1],G[2],A),V=F.filter(function(H){return 0<=H&&H<=1});if(V.length>0)return V[0]}return null},"getCurveT"),g=Object.keys(p),y=0;y<g.length;y++){var v=g[y],x=p[v],b=m(t,r,x);if(b!=null){var T=x[5],w=x[3],C=x[1],k=na(T,w,C,b);if(x.isTop&&k<=r||x.isBottom&&r<=k)return!0}}return!1},"checkPoint")}};Ju.generateBottomRoundrectangle=function(){return this.nodeShapes["bottom-round-rectangle"]=this.nodeShapes.bottomroundrectangle={renderer:this,name:"bottom-round-rectangle",points:rs(4,0),draw:o(function(t,r,i,n,a,s){this.renderer.nodeShapeImpl(this.name,t,r,i,n,a,this.points,s)},"draw"),intersectLine:o(function(t,r,i,n,a,s,l,u){var h=t-(i/2+l),d=r-(n/2+l),f=d,p=t+(i/2+l),m=Gd(a,s,t,r,h,d,p,f,!1);return m.length>0?m:dme(a,s,t,r,i,n,l,u)},"intersectLine"),checkPoint:o(function(t,r,i,n,a,s,l,u){u=u==="auto"?Hd(n,a):u;var h=2*u;if(Qu(t,r,this.points,s,l,n,a-h,[0,-1],i)||Qu(t,r,this.points,s,l,n-h,a,[0,-1],i))return!0;var d=n/2+2*i,f=a/2+2*i,p=[s-d,l-f,s-d,l,s+d,l,s+d,l-f];return!!(Bs(t,r,p)||Qp(t,r,h,h,s+n/2-u,l+a/2-u,i)||Qp(t,r,h,h,s-n/2+u,l+a/2-u,i))},"checkPoint")}};Ju.registerNodeShapes=function(){var e=this.nodeShapes={},t=this;this.generateEllipse(),this.generatePolygon("triangle",rs(3,0)),this.generateRoundPolygon("round-triangle",rs(3,0)),this.generatePolygon("rectangle",rs(4,0)),e.square=e.rectangle,this.generateRoundRectangle(),this.generateCutRectangle(),this.generateBarrel(),this.generateBottomRoundrectangle();{var r=[0,1,1,0,0,-1,-1,0];this.generatePolygon("diamond",r),this.generateRoundPolygon("round-diamond",r)}this.generatePolygon("pentagon",rs(5,0)),this.generateRoundPolygon("round-pentagon",rs(5,0)),this.generatePolygon("hexagon",rs(6,0)),this.generateRoundPolygon("round-hexagon",rs(6,0)),this.generatePolygon("heptagon",rs(7,0)),this.generateRoundPolygon("round-heptagon",rs(7,0)),this.generatePolygon("octagon",rs(8,0)),this.generateRoundPolygon("round-octagon",rs(8,0));var i=new Array(20);{var n=UO(5,0),a=UO(5,Math.PI/5),s=.5*(3-Math.sqrt(5));s*=1.57;for(var l=0;l<a.length/2;l++)a[l*2]*=s,a[l*2+1]*=s;for(var l=0;l<20/4;l++)i[l*4]=n[l*2],i[l*4+1]=n[l*2+1],i[l*4+2]=a[l*2],i[l*4+3]=a[l*2+1]}i=fme(i),this.generatePolygon("star",i),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 u=[-1,-1,.25,-1,1,0,.25,1,-1,1];this.generatePolygon("tag",u),this.generateRoundPolygon("round-tag",u)}e.makePolygon=function(h){var d=h.join("$"),f="polygon-"+d,p;return(p=this[f])?p:t.generatePolygon(f,h)}};d2={};d2.timeToRender=function(){return this.redrawTotalTime/this.redrawCount};d2.redraw=function(e){e=e||lme();var t=this;t.averageRedrawTime===void 0&&(t.averageRedrawTime=0),t.lastRedrawTime===void 0&&(t.lastRedrawTime=0),t.lastDrawTime===void 0&&(t.lastDrawTime=0),t.requestedFrame=!0,t.renderOptions=e};d2.beforeRender=function(e,t){if(!this.destroyed){t==null&&Yi("Priority is not optional for beforeRender");var r=this.beforeRenderCallbacks;r.push({fn:e,priority:t}),r.sort(function(i,n){return n.priority-i.priority})}};A0e=o(function(t,r,i){for(var n=t.beforeRenderCallbacks,a=0;a<n.length;a++)n[a].fn(r,i)},"beforeRenderCallbacks");d2.startRenderLoop=function(){var e=this,t=e.cy;if(!e.renderLoopStarted){e.renderLoopStarted=!0;var r=o(function(n){if(!e.destroyed){if(!t.batching())if(e.requestedFrame&&!e.skipFrame){A0e(e,!0,n);var a=Zu();e.render(e.renderOptions);var s=e.lastDrawTime=Zu();e.averageRedrawTime===void 0&&(e.averageRedrawTime=s-a),e.redrawCount===void 0&&(e.redrawCount=0),e.redrawCount++,e.redrawTotalTime===void 0&&(e.redrawTotalTime=0);var l=s-a;e.redrawTotalTime+=l,e.lastRedrawTime=l,e.averageRedrawTime=e.averageRedrawTime/2+l/2,e.requestedFrame=!1}else A0e(e,!1,n);e.skipFrame=!1,O3(r)}},"renderFn");O3(r)}};pst=o(function(t){this.init(t)},"BaseRenderer"),pge=pst,C1=pge.prototype;C1.clientFunctions=["redrawHint","render","renderTo","matchCanvasSize","nodeShapeImpl","arrowShapeImpl"];C1.init=function(e){var t=this;t.options=e,t.cy=e.cy;var r=t.container=e.cy.container(),i=t.cy.window();if(i){var n=i.document,a=n.head,s="__________cytoscape_stylesheet",l="__________cytoscape_container",u=n.getElementById(s)!=null;if(r.className.indexOf(l)<0&&(r.className=(r.className||"")+" "+l),!u){var h=n.createElement("style");h.id=s,h.textContent="."+l+" { position: relative; }",a.insertBefore(h,a.children[0])}var d=i.getComputedStyle(r),f=d.getPropertyValue("position");f==="static"&&di("A Cytoscape container has style position:static and so can not use UI extensions properly")}t.selection=[void 0,void 0,void 0,void 0,0],t.bezierProjPcts=[.05,.225,.4,.5,.6,.775,.95],t.hoverData={down:null,last:null,downTime:null,triggerMode:null,dragging:!1,initialPan:[null,null],capture:!1},t.dragData={possibleDragElements:[]},t.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]},t.redraws=0,t.showFps=e.showFps,t.debug=e.debug,t.webgl=e.webgl,t.hideEdgesOnViewport=e.hideEdgesOnViewport,t.textureOnViewport=e.textureOnViewport,t.wheelSensitivity=e.wheelSensitivity,t.motionBlurEnabled=e.motionBlur,t.forcedPixelRatio=Ot(e.pixelRatio)?e.pixelRatio:null,t.motionBlur=e.motionBlur,t.motionBlurOpacity=e.motionBlurOpacity,t.motionBlurTransparency=1-t.motionBlurOpacity,t.motionBlurPxRatio=1,t.mbPxRBlurry=1,t.minMbLowQualFrames=4,t.fullQualityMb=!1,t.clearedForMotionBlur=[],t.desktopTapThreshold=e.desktopTapThreshold,t.desktopTapThreshold2=e.desktopTapThreshold*e.desktopTapThreshold,t.touchTapThreshold=e.touchTapThreshold,t.touchTapThreshold2=e.touchTapThreshold*e.touchTapThreshold,t.tapholdDuration=500,t.bindings=[],t.beforeRenderCallbacks=[],t.beforeRenderPriorities={animations:400,eleCalcs:300,eleTxrDeq:200,lyrTxrDeq:150,lyrTxrSkip:100},t.registerNodeShapes(),t.registerArrowShapes(),t.registerCalculationListeners()};C1.notify=function(e,t){var r=this,i=r.cy;if(!this.destroyed){if(e==="init"){r.load();return}if(e==="destroy"){r.destroy();return}(e==="add"||e==="remove"||e==="move"&&i.hasCompoundNodes()||e==="load"||e==="zorder"||e==="mount")&&r.invalidateCachedZSortedEles(),e==="viewport"&&r.redrawHint("select",!0),e==="gc"&&r.redrawHint("gc",!0),(e==="load"||e==="resize"||e==="mount")&&(r.invalidateContainerClientCoordsCache(),r.matchCanvasSize(r.container)),r.redrawHint("eles",!0),r.redrawHint("drag",!0),this.startRenderLoop(),this.redraw()}};C1.destroy=function(){var e=this;e.destroyed=!0,e.cy.stopAnimationLoop();for(var t=0;t<e.bindings.length;t++){var r=e.bindings[t],i=r,n=i.target;(n.off||n.removeEventListener).apply(n,i.args)}if(e.bindings=[],e.beforeRenderCallbacks=[],e.onUpdateEleCalcsFns=[],e.removeObserver&&e.removeObserver.disconnect(),e.styleObserver&&e.styleObserver.disconnect(),e.resizeObserver&&e.resizeObserver.disconnect(),e.labelCalcDiv)try{document.body.removeChild(e.labelCalcDiv)}catch{}};C1.isHeadless=function(){return!1};[RP,dge,fge,T1,Ju,d2].forEach(function(e){hr(C1,e)});PO=1e3/60,mge={setupDequeueing:o(function(t){return o(function(){var i=this,n=this.renderer;if(!i.dequeueingSetup){i.dequeueingSetup=!0;var a=o2(function(){n.redrawHint("eles",!0),n.redrawHint("drag",!0),n.redraw()},t.deqRedrawThreshold),s=o(function(h,d){var f=Zu(),p=n.averageRedrawTime,m=n.lastRedrawTime,g=[],y=n.cy.extent(),v=n.getPixelRatio();for(h||n.flushRenderedStyleQueue();;){var x=Zu(),b=x-f,T=x-d;if(m<PO){var w=PO-(h?p:0);if(T>=t.deqFastCost*w)break}else if(h){if(b>=t.deqCost*m||b>=t.deqAvgCost*p)break}else if(T>=t.deqNoDrawCost*PO)break;var C=t.deq(i,v,y);if(C.length>0)for(var k=0;k<C.length;k++)g.push(C[k]);else break}g.length>0&&(t.onDeqd(i,g),!h&&t.shouldRedraw(i,g,v,y)&&a())},"dequeue"),l=t.priority||mP;n.beforeRender(s,l(i))}},"setupDequeueingImpl")},"setupDequeueing")},mst=(function(){function e(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:P3;Kd(this,e),this.idsByKey=new Ku,this.keyForId=new Ku,this.cachesByLvl=new Ku,this.lvls=[],this.getKey=t,this.doesEleInvalidateKey=r}return o(e,"ElementTextureCacheLookup"),Zd(e,[{key:"getIdsFor",value:o(function(r){r==null&&Yi("Can not get id list for null key");var i=this.idsByKey,n=this.idsByKey.get(r);return n||(n=new y1,i.set(r,n)),n},"getIdsFor")},{key:"addIdForKey",value:o(function(r,i){r!=null&&this.getIdsFor(r).add(i)},"addIdForKey")},{key:"deleteIdForKey",value:o(function(r,i){r!=null&&this.getIdsFor(r).delete(i)},"deleteIdForKey")},{key:"getNumberOfIdsForKey",value:o(function(r){return r==null?0:this.getIdsFor(r).size},"getNumberOfIdsForKey")},{key:"updateKeyMappingFor",value:o(function(r){var i=r.id(),n=this.keyForId.get(i),a=this.getKey(r);this.deleteIdForKey(n,i),this.addIdForKey(a,i),this.keyForId.set(i,a)},"updateKeyMappingFor")},{key:"deleteKeyMappingFor",value:o(function(r){var i=r.id(),n=this.keyForId.get(i);this.deleteIdForKey(n,i),this.keyForId.delete(i)},"deleteKeyMappingFor")},{key:"keyHasChangedFor",value:o(function(r){var i=r.id(),n=this.keyForId.get(i),a=this.getKey(r);return n!==a},"keyHasChangedFor")},{key:"isInvalid",value:o(function(r){return this.keyHasChangedFor(r)||this.doesEleInvalidateKey(r)},"isInvalid")},{key:"getCachesAt",value:o(function(r){var i=this.cachesByLvl,n=this.lvls,a=i.get(r);return a||(a=new Ku,i.set(r,a),n.push(r)),a},"getCachesAt")},{key:"getCache",value:o(function(r,i){return this.getCachesAt(i).get(r)},"getCache")},{key:"get",value:o(function(r,i){var n=this.getKey(r),a=this.getCache(n,i);return a!=null&&this.updateKeyMappingFor(r),a},"get")},{key:"getForCachedKey",value:o(function(r,i){var n=this.keyForId.get(r.id()),a=this.getCache(n,i);return a},"getForCachedKey")},{key:"hasCache",value:o(function(r,i){return this.getCachesAt(i).has(r)},"hasCache")},{key:"has",value:o(function(r,i){var n=this.getKey(r);return this.hasCache(n,i)},"has")},{key:"setCache",value:o(function(r,i,n){n.key=r,this.getCachesAt(i).set(r,n)},"setCache")},{key:"set",value:o(function(r,i,n){var a=this.getKey(r);this.setCache(a,i,n),this.updateKeyMappingFor(r)},"set")},{key:"deleteCache",value:o(function(r,i){this.getCachesAt(i).delete(r)},"deleteCache")},{key:"delete",value:o(function(r,i){var n=this.getKey(r);this.deleteCache(n,i)},"_delete")},{key:"invalidateKey",value:o(function(r){var i=this;this.lvls.forEach(function(n){return i.deleteCache(r,n)})},"invalidateKey")},{key:"invalidate",value:o(function(r){var i=r.id(),n=this.keyForId.get(i);this.deleteKeyMappingFor(r);var a=this.doesEleInvalidateKey(r);return a&&this.invalidateKey(n),a||this.getNumberOfIdsForKey(n)===0},"invalidate")}])})(),_0e=25,b3=50,L3=-4,aP=3,gge=7.99,gst=8,yst=1024,vst=1024,xst=1024,bst=.2,Tst=.8,Cst=10,kst=.15,wst=.1,Sst=.9,Est=.9,Ast=100,_st=1,c1={dequeue:"dequeue",downscale:"downscale",highQuality:"highQuality"},Dst=va({getKey:null,doesEleInvalidateKey:P3,drawElement:null,getBoundingBox:null,getRotationPoint:null,getRotationOffset:null,isVisible:ame,allowEdgeTxrCaching:!0,allowParentTxrCaching:!0}),Vb=o(function(t,r){var i=this;i.renderer=t,i.onDequeues=[];var n=Dst(r);hr(i,n),i.lookup=new mst(n.getKey,n.doesEleInvalidateKey),i.setupDequeueing()},"ElementTextureCache"),qn=Vb.prototype;qn.reasons=c1;qn.getTextureQueue=function(e){var t=this;return t.eleImgCaches=t.eleImgCaches||{},t.eleImgCaches[e]=t.eleImgCaches[e]||[]};qn.getRetiredTextureQueue=function(e){var t=this,r=t.eleImgCaches.retired=t.eleImgCaches.retired||{},i=r[e]=r[e]||[];return i};qn.getElementQueue=function(){var e=this,t=e.eleCacheQueue=e.eleCacheQueue||new l2(function(r,i){return i.reqs-r.reqs});return t};qn.getElementKeyToQueue=function(){var e=this,t=e.eleKeyToCacheQueue=e.eleKeyToCacheQueue||{};return t};qn.getElement=function(e,t,r,i,n){var a=this,s=this.renderer,l=s.cy.zoom(),u=this.lookup;if(!t||t.w===0||t.h===0||isNaN(t.w)||isNaN(t.h)||!e.visible()||e.removed()||!a.allowEdgeTxrCaching&&e.isEdge()||!a.allowParentTxrCaching&&e.isParent())return null;if(i==null&&(i=Math.ceil(yP(l*r))),i<L3)i=L3;else if(l>=gge||i>aP)return null;var h=Math.pow(2,i),d=t.h*h,f=t.w*h,p=s.eleTextBiggerThanMin(e,h);if(!this.isVisible(e,p))return null;var m=u.get(e,i);if(m&&m.invalidated&&(m.invalidated=!1,m.texture.invalidatedWidth-=m.width),m)return m;var g;if(d<=_0e?g=_0e:d<=b3?g=b3:g=Math.ceil(d/b3)*b3,d>xst||f>vst)return null;var y=a.getTextureQueue(g),v=y[y.length-2],x=o(function(){return a.recycleTexture(g,f)||a.addTexture(g,f)},"addNewTxr");v||(v=y[y.length-1]),v||(v=x()),v.width-v.usedWidth<f&&(v=x());for(var b=o(function(L){return L&&L.scaledLabelShown===p},"scalableFrom"),T=n&&n===c1.dequeue,w=n&&n===c1.highQuality,C=n&&n===c1.downscale,k,E=i+1;E<=aP;E++){var A=u.get(e,E);if(A){k=A;break}}var N=k&&k.level===i+1?k:null,P=o(function(){v.context.drawImage(N.texture.canvas,N.x,0,N.width,N.height,v.usedWidth,0,f,d)},"downscale");if(v.context.setTransform(1,0,0,1,0,0),v.context.clearRect(v.usedWidth,0,f,g),b(N))P();else if(b(k))if(w){for(var I=k.level;I>i;I--)N=a.getElement(e,t,r,I,c1.downscale);P()}else return a.queueElement(e,k.level-1),k;else{var D;if(!T&&!w&&!C)for(var _=i-1;_>=L3;_--){var R=u.get(e,_);if(R){D=R;break}}if(b(D))return a.queueElement(e,i),D;v.context.translate(v.usedWidth,0),v.context.scale(h,h),this.drawElement(v.context,e,t,p,!1),v.context.scale(1/h,1/h),v.context.translate(-v.usedWidth,0)}return m={x:v.usedWidth,texture:v,level:i,scale:h,width:f,height:d,scaledLabelShown:p},v.usedWidth+=Math.ceil(f+gst),v.eleCaches.push(m),u.set(e,i,m),a.checkTextureFullness(v),m};qn.invalidateElements=function(e){for(var t=0;t<e.length;t++)this.invalidateElement(e[t])};qn.invalidateElement=function(e){var t=this,r=t.lookup,i=[],n=r.isInvalid(e);if(n){for(var a=L3;a<=aP;a++){var s=r.getForCachedKey(e,a);s&&i.push(s)}var l=r.invalidate(e);if(l)for(var u=0;u<i.length;u++){var h=i[u],d=h.texture;d.invalidatedWidth+=h.width,h.invalidated=!0,t.checkTextureUtility(d)}t.removeFromQueue(e)}};qn.checkTextureUtility=function(e){e.invalidatedWidth>=bst*e.width&&this.retireTexture(e)};qn.checkTextureFullness=function(e){var t=this,r=t.getTextureQueue(e.height);e.usedWidth/e.width>Tst&&e.fullnessChecks>=Cst?Ud(r,e):e.fullnessChecks++};qn.retireTexture=function(e){var t=this,r=e.height,i=t.getTextureQueue(r),n=this.lookup;Ud(i,e),e.retired=!0;for(var a=e.eleCaches,s=0;s<a.length;s++){var l=a[s];n.deleteCache(l.key,l.level)}gP(a);var u=t.getRetiredTextureQueue(r);u.push(e)};qn.addTexture=function(e,t){var r=this,i=r.getTextureQueue(e),n={};return i.push(n),n.eleCaches=[],n.height=e,n.width=Math.max(yst,t),n.usedWidth=0,n.invalidatedWidth=0,n.fullnessChecks=0,n.canvas=r.renderer.makeOffscreenCanvas(n.width,n.height),n.context=n.canvas.getContext("2d"),n};qn.recycleTexture=function(e,t){for(var r=this,i=r.getTextureQueue(e),n=r.getRetiredTextureQueue(e),a=0;a<n.length;a++){var s=n[a];if(s.width>=t)return s.retired=!1,s.usedWidth=0,s.invalidatedWidth=0,s.fullnessChecks=0,gP(s.eleCaches),s.context.setTransform(1,0,0,1,0,0),s.context.clearRect(0,0,s.width,s.height),Ud(n,s),i.push(s),s}};qn.queueElement=function(e,t){var r=this,i=r.getElementQueue(),n=r.getElementKeyToQueue(),a=this.getKey(e),s=n[a];if(s)s.level=Math.max(s.level,t),s.eles.merge(e),s.reqs++,i.updateItem(s);else{var l={eles:e.spawn().merge(e),level:t,reqs:1,key:a};i.push(l),n[a]=l}};qn.dequeue=function(e){for(var t=this,r=t.getElementQueue(),i=t.getElementKeyToQueue(),n=[],a=t.lookup,s=0;s<_st&&r.size()>0;s++){var l=r.pop(),u=l.key,h=l.eles[0],d=a.hasCache(h,l.level);if(i[u]=null,d)continue;n.push(l);var f=t.getBoundingBox(h);t.getElement(h,f,e,l.level,c1.dequeue)}return n};qn.removeFromQueue=function(e){var t=this,r=t.getElementQueue(),i=t.getElementKeyToQueue(),n=this.getKey(e),a=i[n];a!=null&&(a.eles.length===1?(a.reqs=pP,r.updateItem(a),r.pop(),i[n]=null):a.eles.unmerge(e))};qn.onDequeue=function(e){this.onDequeues.push(e)};qn.offDequeue=function(e){Ud(this.onDequeues,e)};qn.setupDequeueing=mge.setupDequeueing({deqRedrawThreshold:Ast,deqCost:kst,deqAvgCost:wst,deqNoDrawCost:Sst,deqFastCost:Est,deq:o(function(t,r,i){return t.dequeue(r,i)},"deq"),onDeqd:o(function(t,r){for(var i=0;i<t.onDequeues.length;i++){var n=t.onDequeues[i];n(r)}},"onDeqd"),shouldRedraw:o(function(t,r,i,n){for(var a=0;a<r.length;a++)for(var s=r[a].eles,l=0;l<s.length;l++){var u=s[l].boundingBox();if(xP(u,n))return!0}return!1},"shouldRedraw"),priority:o(function(t){return t.renderer.beforeRenderPriorities.eleTxrDeq},"priority")});Rst=1,qb=-4,q3=2,Lst=3.99,Mst=50,Nst=50,Ist=.15,Ost=.1,Pst=.9,Bst=.9,Fst=1,D0e=250,$st=4e3*4e3,R0e=32767,zst=!0,yge=o(function(t){var r=this,i=r.renderer=t,n=i.cy;r.layersByLevel={},r.firstGet=!0,r.lastInvalidationTime=Zu()-2*D0e,r.skipping=!1,r.eleTxrDeqs=n.collection(),r.scheduleElementRefinement=o2(function(){r.refineElementTextures(r.eleTxrDeqs),r.eleTxrDeqs.unmerge(r.eleTxrDeqs)},Nst),i.beforeRender(function(s,l){l-r.lastInvalidationTime<=D0e?r.skipping=!0:r.skipping=!1},i.beforeRenderPriorities.lyrTxrSkip);var a=o(function(l,u){return u.reqs-l.reqs},"qSort");r.layersQueue=new l2(a),r.setupDequeueing()},"LayeredTextureCache"),xa=yge.prototype,L0e=0,Gst=Math.pow(2,53)-1;xa.makeLayer=function(e,t){var r=Math.pow(2,t),i=Math.ceil(e.w*r),n=Math.ceil(e.h*r),a=this.renderer.makeOffscreenCanvas(i,n),s={id:L0e=++L0e%Gst,bb:e,level:t,width:i,height:n,canvas:a,context:a.getContext("2d"),eles:[],elesQueue:[],reqs:0},l=s.context,u=-s.bb.x1,h=-s.bb.y1;return l.scale(r,r),l.translate(u,h),s};xa.getLayers=function(e,t,r){var i=this,n=i.renderer,a=n.cy,s=a.zoom(),l=i.firstGet;if(i.firstGet=!1,r==null){if(r=Math.ceil(yP(s*t)),r<qb)r=qb;else if(s>=Lst||r>q3)return null}i.validateLayersElesOrdering(r,e);var u=i.layersByLevel,h=Math.pow(2,r),d=u[r]=u[r]||[],f,p=i.levelIsComplete(r,e),m,g=o(function(){var P=o(function(M){if(i.validateLayersElesOrdering(M,e),i.levelIsComplete(M,e))return m=u[M],!0},"canUseAsTmpLvl"),I=o(function(M){if(!m)for(var L=r+M;qb<=L&&L<=q3&&!P(L);L+=M);},"checkLvls");I(1),I(-1);for(var D=d.length-1;D>=0;D--){var _=d[D];_.invalid&&Ud(d,_)}},"checkTempLevels");if(!p)g();else return d;var y=o(function(){if(!f){f=is();for(var P=0;P<e.length;P++)Frt(f,e[P].boundingBox())}return f},"getBb"),v=o(function(P){P=P||{};var I=P.after;y();var D=Math.ceil(f.w*h),_=Math.ceil(f.h*h);if(D>R0e||_>R0e)return null;var R=D*_;if(R>$st)return null;var M=i.makeLayer(f,r);if(I!=null){var L=d.indexOf(I)+1;d.splice(L,0,M)}else(P.insert===void 0||P.insert)&&d.unshift(M);return M},"makeLayer");if(i.skipping&&!l)return null;for(var x=null,b=e.length/Rst,T=!l,w=0;w<e.length;w++){var C=e[w],k=C._private.rscratch,E=k.imgLayerCaches=k.imgLayerCaches||{},A=E[r];if(A){x=A;continue}if((!x||x.eles.length>=b||!hme(x.bb,C.boundingBox()))&&(x=v({insert:!0,after:x}),!x))return null;m||T?i.queueLayer(x,C):i.drawEleInLayer(x,C,r,t),x.eles.push(C),E[r]=x}return m||(T?null:d)};xa.getEleLevelForLayerLevel=function(e,t){return e};xa.drawEleInLayer=function(e,t,r,i){var n=this,a=this.renderer,s=e.context,l=t.boundingBox();l.w===0||l.h===0||!t.visible()||(r=n.getEleLevelForLayerLevel(r,i),a.setImgSmoothing(s,!1),a.drawCachedElement(s,t,null,null,r,zst),a.setImgSmoothing(s,!0))};xa.levelIsComplete=function(e,t){var r=this,i=r.layersByLevel[e];if(!i||i.length===0)return!1;for(var n=0,a=0;a<i.length;a++){var s=i[a];if(s.reqs>0||s.invalid)return!1;n+=s.eles.length}return n===t.length};xa.validateLayersElesOrdering=function(e,t){var r=this.layersByLevel[e];if(r)for(var i=0;i<r.length;i++){for(var n=r[i],a=-1,s=0;s<t.length;s++)if(n.eles[0]===t[s]){a=s;break}if(a<0){this.invalidateLayer(n);continue}for(var l=a,s=0;s<n.eles.length;s++)if(n.eles[s]!==t[l+s]){this.invalidateLayer(n);break}}};xa.updateElementsInLayers=function(e,t){for(var r=this,i=i2(e[0]),n=0;n<e.length;n++)for(var a=i?null:e[n],s=i?e[n]:e[n].ele,l=s._private.rscratch,u=l.imgLayerCaches=l.imgLayerCaches||{},h=qb;h<=q3;h++){var d=u[h];d&&(a&&r.getEleLevelForLayerLevel(d.level)!==a.level||t(d,s,a))}};xa.haveLayers=function(){for(var e=this,t=!1,r=qb;r<=q3;r++){var i=e.layersByLevel[r];if(i&&i.length>0){t=!0;break}}return t};xa.invalidateElements=function(e){var t=this;e.length!==0&&(t.lastInvalidationTime=Zu(),!(e.length===0||!t.haveLayers())&&t.updateElementsInLayers(e,o(function(i,n,a){t.invalidateLayer(i)},"invalAssocLayers")))};xa.invalidateLayer=function(e){if(this.lastInvalidationTime=Zu(),!e.invalid){var t=e.level,r=e.eles,i=this.layersByLevel[t];Ud(i,e),e.elesQueue=[],e.invalid=!0,e.replacement&&(e.replacement.invalid=!0);for(var n=0;n<r.length;n++){var a=r[n]._private.rscratch.imgLayerCaches;a&&(a[t]=null)}}};xa.refineElementTextures=function(e){var t=this;t.updateElementsInLayers(e,o(function(i,n,a){var s=i.replacement;if(s||(s=i.replacement=t.makeLayer(i.bb,i.level),s.replaces=i,s.eles=i.eles),!s.reqs)for(var l=0;l<s.eles.length;l++)t.queueLayer(s,s.eles[l])},"refineEachEle"))};xa.enqueueElementRefinement=function(e){this.eleTxrDeqs.merge(e),this.scheduleElementRefinement()};xa.queueLayer=function(e,t){var r=this,i=r.layersQueue,n=e.elesQueue,a=n.hasId=n.hasId||{};if(!e.replacement){if(t){if(a[t.id()])return;n.push(t),a[t.id()]=!0}e.reqs?(e.reqs++,i.updateItem(e)):(e.reqs=1,i.push(e))}};xa.dequeue=function(e){for(var t=this,r=t.layersQueue,i=[],n=0;n<Fst&&r.size()!==0;){var a=r.peek();if(a.replacement){r.pop();continue}if(a.replaces&&a!==a.replaces.replacement){r.pop();continue}if(a.invalid){r.pop();continue}var s=a.elesQueue.shift();s&&(t.drawEleInLayer(a,s,a.level,e),n++),i.length===0&&i.push(!0),a.elesQueue.length===0&&(r.pop(),a.reqs=0,a.replaces&&t.applyLayerReplacement(a),t.requestRedraw())}return i};xa.applyLayerReplacement=function(e){var t=this,r=t.layersByLevel[e.level],i=e.replaces,n=r.indexOf(i);if(!(n<0||i.invalid)){r[n]=e;for(var a=0;a<e.eles.length;a++){var s=e.eles[a]._private,l=s.imgLayerCaches=s.imgLayerCaches||{};l&&(l[e.level]=e)}t.requestRedraw()}};xa.requestRedraw=o2(function(){var e=this.renderer;e.redrawHint("eles",!0),e.redrawHint("drag",!0),e.redraw()},100);xa.setupDequeueing=mge.setupDequeueing({deqRedrawThreshold:Mst,deqCost:Ist,deqAvgCost:Ost,deqNoDrawCost:Pst,deqFastCost:Bst,deq:o(function(t,r){return t.dequeue(r)},"deq"),onDeqd:mP,shouldRedraw:ame,priority:o(function(t){return t.renderer.beforeRenderPriorities.lyrTxrDeq},"priority")});vge={};o(Vst,"polygon");o(Wst,"triangleBackcurve");o(N0e,"triangleTee");o(qst,"circleTriangle");o(Ust,"circle$1");vge.arrowShapeImpl=function(e){return(M0e||(M0e={polygon:Vst,"triangle-backcurve":Wst,"triangle-tee":N0e,"circle-triangle":qst,"triangle-cross":N0e,circle:Ust}))[e]};zc={};zc.drawElement=function(e,t,r,i,n,a){var s=this;t.isNode()?s.drawNode(e,t,r,i,n,a):s.drawEdge(e,t,r,i,n,a)};zc.drawElementOverlay=function(e,t){var r=this;t.isNode()?r.drawNodeOverlay(e,t):r.drawEdgeOverlay(e,t)};zc.drawElementUnderlay=function(e,t){var r=this;t.isNode()?r.drawNodeUnderlay(e,t):r.drawEdgeUnderlay(e,t)};zc.drawCachedElementPortion=function(e,t,r,i,n,a,s,l){var u=this,h=r.getBoundingBox(t);if(!(h.w===0||h.h===0)){var d=r.getElement(t,h,i,n,a);if(d!=null){var f=l(u,t);if(f===0)return;var p=s(u,t),m=h.x1,g=h.y1,y=h.w,v=h.h,x,b,T,w,C;if(p!==0){var k=r.getRotationPoint(t);T=k.x,w=k.y,e.translate(T,w),e.rotate(p),C=u.getImgSmoothing(e),C||u.setImgSmoothing(e,!0);var E=r.getRotationOffset(t);x=E.x,b=E.y}else x=m,b=g;var A;f!==1&&(A=e.globalAlpha,e.globalAlpha=A*f),e.drawImage(d.texture.canvas,d.x,0,d.width,d.height,x,b,y,v),f!==1&&(e.globalAlpha=A),p!==0&&(e.rotate(-p),e.translate(-T,-w),C||u.setImgSmoothing(e,!1))}else r.drawElement(e,t)}};Hst=o(function(){return 0},"getZeroRotation"),Yst=o(function(t,r){return t.getTextAngle(r,null)},"getLabelRotation"),jst=o(function(t,r){return t.getTextAngle(r,"source")},"getSourceLabelRotation"),Xst=o(function(t,r){return t.getTextAngle(r,"target")},"getTargetLabelRotation"),Kst=o(function(t,r){return r.effectiveOpacity()},"getOpacity"),BO=o(function(t,r){return r.pstyle("text-opacity").pfValue*r.effectiveOpacity()},"getTextOpacity");zc.drawCachedElement=function(e,t,r,i,n,a){var s=this,l=s.data,u=l.eleTxrCache,h=l.lblTxrCache,d=l.slbTxrCache,f=l.tlbTxrCache,p=t.boundingBox(),m=a===!0?u.reasons.highQuality:null;if(!(p.w===0||p.h===0||!t.visible())&&(!i||xP(p,i))){var g=t.isEdge(),y=t.element()._private.rscratch.badLine;s.drawElementUnderlay(e,t),s.drawCachedElementPortion(e,t,u,r,n,m,Hst,Kst),(!g||!y)&&s.drawCachedElementPortion(e,t,h,r,n,m,Yst,BO),g&&!y&&(s.drawCachedElementPortion(e,t,d,r,n,m,jst,BO),s.drawCachedElementPortion(e,t,f,r,n,m,Xst,BO)),s.drawElementOverlay(e,t)}};zc.drawElements=function(e,t){for(var r=this,i=0;i<t.length;i++){var n=t[i];r.drawElement(e,n)}};zc.drawCachedElements=function(e,t,r,i){for(var n=this,a=0;a<t.length;a++){var s=t[a];n.drawCachedElement(e,s,r,i)}};zc.drawCachedNodes=function(e,t,r,i){for(var n=this,a=0;a<t.length;a++){var s=t[a];s.isNode()&&n.drawCachedElement(e,s,r,i)}};zc.drawLayeredElements=function(e,t,r,i){var n=this,a=n.data.lyrTxrCache.getLayers(t,r);if(a)for(var s=0;s<a.length;s++){var l=a[s],u=l.bb;u.w===0||u.h===0||e.drawImage(l.canvas,u.x1,u.y1,u.w,u.h)}else n.drawCachedElements(e,t,r,i)};eh={};eh.drawEdge=function(e,t,r){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,n=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,s=this,l=t._private.rscratch;if(!(a&&!t.visible())&&!(l.badLine||l.allpts==null||isNaN(l.allpts[0]))){var u;r&&(u=r,e.translate(-u.x1,-u.y1));var h=a?t.pstyle("opacity").value:1,d=a?t.pstyle("line-opacity").value:1,f=t.pstyle("curve-style").value,p=t.pstyle("line-style").value,m=t.pstyle("width").pfValue,g=t.pstyle("line-cap").value,y=t.pstyle("line-outline-width").value,v=t.pstyle("line-outline-color").value,x=h*d,b=h*d,T=o(function(){var M=arguments.length>0&&arguments[0]!==void 0?arguments[0]:x;f==="straight-triangle"?(s.eleStrokeStyle(e,t,M),s.drawEdgeTrianglePath(t,e,l.allpts)):(e.lineWidth=m,e.lineCap=g,s.eleStrokeStyle(e,t,M),s.drawEdgePath(t,e,l.allpts,p),e.lineCap="butt")},"drawLine"),w=o(function(){var M=arguments.length>0&&arguments[0]!==void 0?arguments[0]:x;if(e.lineWidth=m+y,e.lineCap=g,y>0)s.colorStrokeStyle(e,v[0],v[1],v[2],M);else{e.lineCap="butt";return}f==="straight-triangle"?s.drawEdgeTrianglePath(t,e,l.allpts):(s.drawEdgePath(t,e,l.allpts,p),e.lineCap="butt")},"drawLineOutline"),C=o(function(){n&&s.drawEdgeOverlay(e,t)},"drawOverlay"),k=o(function(){n&&s.drawEdgeUnderlay(e,t)},"drawUnderlay"),E=o(function(){var M=arguments.length>0&&arguments[0]!==void 0?arguments[0]:b;s.drawArrowheads(e,t,M)},"drawArrows"),A=o(function(){s.drawElementText(e,t,null,i)},"drawText");e.lineJoin="round";var N=t.pstyle("ghost").value==="yes";if(N){var P=t.pstyle("ghost-offset-x").pfValue,I=t.pstyle("ghost-offset-y").pfValue,D=t.pstyle("ghost-opacity").value,_=x*D;e.translate(P,I),T(_),E(_),e.translate(-P,-I)}else w();k(),T(),E(),C(),A(),r&&e.translate(u.x1,u.y1)}};xge=o(function(t){if(!["overlay","underlay"].includes(t))throw new Error("Invalid state");return function(r,i){if(i.visible()){var n=i.pstyle("".concat(t,"-opacity")).value;if(n!==0){var a=this,s=a.usePaths(),l=i._private.rscratch,u=i.pstyle("".concat(t,"-padding")).pfValue,h=2*u,d=i.pstyle("".concat(t,"-color")).value;r.lineWidth=h,l.edgeType==="self"&&!s?r.lineCap="butt":r.lineCap="round",a.colorStrokeStyle(r,d[0],d[1],d[2],n),a.drawEdgePath(i,r,l.allpts,"solid")}}}},"drawEdgeOverlayUnderlay");eh.drawEdgeOverlay=xge("overlay");eh.drawEdgeUnderlay=xge("underlay");eh.drawEdgePath=function(e,t,r,i){var n=e._private.rscratch,a=t,s,l=!1,u=this.usePaths(),h=e.pstyle("line-dash-pattern").pfValue,d=e.pstyle("line-dash-offset").pfValue;if(u){var f=r.join("$"),p=n.pathCacheKey&&n.pathCacheKey===f;p?(s=t=n.pathCache,l=!0):(s=t=new Path2D,n.pathCacheKey=f,n.pathCache=s)}if(a.setLineDash)switch(i){case"dotted":a.setLineDash([1,1]);break;case"dashed":a.setLineDash(h),a.lineDashOffset=d;break;case"solid":a.setLineDash([]);break}if(!l&&!n.badLine)switch(t.beginPath&&t.beginPath(),t.moveTo(r[0],r[1]),n.edgeType){case"bezier":case"self":case"compound":case"multibezier":for(var m=2;m+3<r.length;m+=4)t.quadraticCurveTo(r[m],r[m+1],r[m+2],r[m+3]);break;case"straight":case"haystack":for(var g=2;g+1<r.length;g+=2)t.lineTo(r[g],r[g+1]);break;case"segments":if(n.isRound){var y=Fs(n.roundCorners),v;try{for(y.s();!(v=y.n()).done;){var x=v.value;oge(t,x)}}catch(T){y.e(T)}finally{y.f()}t.lineTo(r[r.length-2],r[r.length-1])}else for(var b=2;b+1<r.length;b+=2)t.lineTo(r[b],r[b+1]);break}t=a,u?t.stroke(s):t.stroke(),t.setLineDash&&t.setLineDash([])};eh.drawEdgeTrianglePath=function(e,t,r){t.fillStyle=t.strokeStyle;for(var i=e.pstyle("width").pfValue,n=0;n+1<r.length;n+=2){var a=[r[n+2]-r[n],r[n+3]-r[n+1]],s=Math.sqrt(a[0]*a[0]+a[1]*a[1]),l=[a[1]/s,-a[0]/s],u=[l[0]*i/2,l[1]*i/2];t.beginPath(),t.moveTo(r[n]-u[0],r[n+1]-u[1]),t.lineTo(r[n]+u[0],r[n+1]+u[1]),t.lineTo(r[n+2],r[n+3]),t.closePath(),t.fill()}};eh.drawArrowheads=function(e,t,r){var i=t._private.rscratch,n=i.edgeType==="haystack";n||this.drawArrowhead(e,t,"source",i.arrowStartX,i.arrowStartY,i.srcArrowAngle,r),this.drawArrowhead(e,t,"mid-target",i.midX,i.midY,i.midtgtArrowAngle,r),this.drawArrowhead(e,t,"mid-source",i.midX,i.midY,i.midsrcArrowAngle,r),n||this.drawArrowhead(e,t,"target",i.arrowEndX,i.arrowEndY,i.tgtArrowAngle,r)};eh.drawArrowhead=function(e,t,r,i,n,a,s){if(!(isNaN(i)||i==null||isNaN(n)||n==null||isNaN(a)||a==null)){var l=this,u=t.pstyle(r+"-arrow-shape").value;if(u!=="none"){var h=t.pstyle(r+"-arrow-fill").value==="hollow"?"both":"filled",d=t.pstyle(r+"-arrow-fill").value,f=t.pstyle("width").pfValue,p=t.pstyle(r+"-arrow-width"),m=p.value==="match-line"?f:p.pfValue;p.units==="%"&&(m*=f);var g=t.pstyle("opacity").value;s===void 0&&(s=g);var y=e.globalCompositeOperation;(s!==1||d==="hollow")&&(e.globalCompositeOperation="destination-out",l.colorFillStyle(e,255,255,255,1),l.colorStrokeStyle(e,255,255,255,1),l.drawArrowShape(t,e,h,f,u,m,i,n,a),e.globalCompositeOperation=y);var v=t.pstyle(r+"-arrow-color").value;l.colorFillStyle(e,v[0],v[1],v[2],s),l.colorStrokeStyle(e,v[0],v[1],v[2],s),l.drawArrowShape(t,e,d,f,u,m,i,n,a)}}};eh.drawArrowShape=function(e,t,r,i,n,a,s,l,u){var h=this,d=this.usePaths()&&n!=="triangle-cross",f=!1,p,m=t,g={x:s,y:l},y=e.pstyle("arrow-scale").value,v=this.getArrowWidth(i,y),x=h.arrowShapes[n];if(d){var b=h.arrowPathCache=h.arrowPathCache||[],T=Jp(n),w=b[T];w!=null?(p=t=w,f=!0):(p=t=new Path2D,b[T]=p)}f||(t.beginPath&&t.beginPath(),d?x.draw(t,1,0,{x:0,y:0},1):x.draw(t,v,u,g,i),t.closePath&&t.closePath()),t=m,d&&(t.translate(s,l),t.rotate(u),t.scale(v,v)),(r==="filled"||r==="both")&&(d?t.fill(p):t.fill()),(r==="hollow"||r==="both")&&(t.lineWidth=a/(d?v:1),t.lineJoin="miter",d?t.stroke(p):t.stroke()),d&&(t.scale(1/v,1/v),t.rotate(-u),t.translate(-s,-l))};NP={};NP.safeDrawImage=function(e,t,r,i,n,a,s,l,u,h){if(!(n<=0||a<=0||u<=0||h<=0))try{e.drawImage(t,r,i,n,a,s,l,u,h)}catch(d){di(d)}};NP.drawInscribedImage=function(e,t,r,i,n){var a=this,s=r.position(),l=s.x,u=s.y,h=r.cy().style(),d=h.getIndexedStyle.bind(h),f=d(r,"background-fit","value",i),p=d(r,"background-repeat","value",i),m=r.width(),g=r.height(),y=r.padding()*2,v=m+(d(r,"background-width-relative-to","value",i)==="inner"?0:y),x=g+(d(r,"background-height-relative-to","value",i)==="inner"?0:y),b=r._private.rscratch,T=d(r,"background-clip","value",i),w=T==="node",C=d(r,"background-image-opacity","value",i)*n,k=d(r,"background-image-smoothing","value",i),E=r.pstyle("corner-radius").value;E!=="auto"&&(E=r.pstyle("corner-radius").pfValue);var A=t.width||t.cachedW,N=t.height||t.cachedH;(A==null||N==null)&&(document.body.appendChild(t),A=t.cachedW=t.width||t.offsetWidth,N=t.cachedH=t.height||t.offsetHeight,document.body.removeChild(t));var P=A,I=N;if(d(r,"background-width","value",i)!=="auto"&&(d(r,"background-width","units",i)==="%"?P=d(r,"background-width","pfValue",i)*v:P=d(r,"background-width","pfValue",i)),d(r,"background-height","value",i)!=="auto"&&(d(r,"background-height","units",i)==="%"?I=d(r,"background-height","pfValue",i)*x:I=d(r,"background-height","pfValue",i)),!(P===0||I===0)){if(f==="contain"){var D=Math.min(v/P,x/I);P*=D,I*=D}else if(f==="cover"){var D=Math.max(v/P,x/I);P*=D,I*=D}var _=l-v/2,R=d(r,"background-position-x","units",i),M=d(r,"background-position-x","pfValue",i);R==="%"?_+=(v-P)*M:_+=M;var L=d(r,"background-offset-x","units",i),B=d(r,"background-offset-x","pfValue",i);L==="%"?_+=(v-P)*B:_+=B;var O=u-x/2,$=d(r,"background-position-y","units",i),G=d(r,"background-position-y","pfValue",i);$==="%"?O+=(x-I)*G:O+=G;var F=d(r,"background-offset-y","units",i),V=d(r,"background-offset-y","pfValue",i);F==="%"?O+=(x-I)*V:O+=V,b.pathCache&&(_-=l,O-=u,l=0,u=0);var H=e.globalAlpha;e.globalAlpha=C;var j=a.getImgSmoothing(e),U=!1;if(k==="no"&&j?(a.setImgSmoothing(e,!1),U=!0):k==="yes"&&!j&&(a.setImgSmoothing(e,!0),U=!0),p==="no-repeat")w&&(e.save(),b.pathCache?e.clip(b.pathCache):(a.nodeShapes[a.getNodeShape(r)].draw(e,l,u,v,x,E,b),e.clip())),a.safeDrawImage(e,t,0,0,A,N,_,O,P,I),w&&e.restore();else{var Q=e.createPattern(t,p);e.fillStyle=Q,a.nodeShapes[a.getNodeShape(r)].draw(e,l,u,v,x,E,b),e.translate(_,O),e.fill(),e.translate(-_,-O)}e.globalAlpha=H,U&&a.setImgSmoothing(e,j)}};a0={};a0.eleTextBiggerThanMin=function(e,t){if(!t){var r=e.cy().zoom(),i=this.getPixelRatio(),n=Math.ceil(yP(r*i));t=Math.pow(2,n)}var a=e.pstyle("font-size").pfValue*t,s=e.pstyle("min-zoomed-font-size").pfValue;return!(a<s)};a0.drawElementText=function(e,t,r,i,n){var a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,s=this;if(i==null){if(a&&!s.eleTextBiggerThanMin(t))return}else if(i===!1)return;if(t.isNode()){var l=t.pstyle("label");if(!l||!l.value)return;var u=s.getLabelJustification(t);e.textAlign=u,e.textBaseline="bottom"}else{var h=t.element()._private.rscratch.badLine,d=t.pstyle("label"),f=t.pstyle("source-label"),p=t.pstyle("target-label");if(h||(!d||!d.value)&&(!f||!f.value)&&(!p||!p.value))return;e.textAlign="center",e.textBaseline="bottom"}var m=!r,g;r&&(g=r,e.translate(-g.x1,-g.y1)),n==null?(s.drawText(e,t,null,m,a),t.isEdge()&&(s.drawText(e,t,"source",m,a),s.drawText(e,t,"target",m,a))):s.drawText(e,t,n,m,a),r&&e.translate(g.x1,g.y1)};a0.getFontCache=function(e){var t;this.fontCaches=this.fontCaches||[];for(var r=0;r<this.fontCaches.length;r++)if(t=this.fontCaches[r],t.context===e)return t;return t={context:e},this.fontCaches.push(t),t};a0.setupTextStyle=function(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,i=t.pstyle("font-style").strValue,n=t.pstyle("font-size").pfValue+"px",a=t.pstyle("font-family").strValue,s=t.pstyle("font-weight").strValue,l=r?t.effectiveOpacity()*t.pstyle("text-opacity").value:1,u=t.pstyle("text-outline-opacity").value*l,h=t.pstyle("color").value,d=t.pstyle("text-outline-color").value;e.font=i+" "+s+" "+n+" "+a,e.lineJoin="round",this.colorFillStyle(e,h[0],h[1],h[2],l),this.colorStrokeStyle(e,d[0],d[1],d[2],u)};o(Zst,"circle");o(I0e,"roundRect");a0.getTextAngle=function(e,t){var r,i=e._private,n=i.rscratch,a=t?t+"-":"",s=e.pstyle(a+"text-rotation");if(s.strValue==="autorotate"){var l=Ps(n,"labelAngle",t);r=e.isEdge()?l:0}else s.strValue==="none"?r=0:r=s.pfValue;return r};a0.drawText=function(e,t,r){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,n=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,a=t._private,s=a.rscratch,l=n?t.effectiveOpacity():1;if(!(n&&(l===0||t.pstyle("text-opacity").value===0))){r==="main"&&(r=null);var u=Ps(s,"labelX",r),h=Ps(s,"labelY",r),d,f,p=this.getLabelText(t,r);if(p!=null&&p!==""&&!isNaN(u)&&!isNaN(h)){this.setupTextStyle(e,t,n);var m=r?r+"-":"",g=Ps(s,"labelWidth",r),y=Ps(s,"labelHeight",r),v=t.pstyle(m+"text-margin-x").pfValue,x=t.pstyle(m+"text-margin-y").pfValue,b=t.isEdge(),T=t.pstyle("text-halign").value,w=t.pstyle("text-valign").value;b&&(T="center",w="center"),u+=v,h+=x;var C;switch(i?C=this.getTextAngle(t,r):C=0,C!==0&&(d=u,f=h,e.translate(d,f),e.rotate(C),u=0,h=0),w){case"top":break;case"center":h+=y/2;break;case"bottom":h+=y;break}var k=t.pstyle("text-background-opacity").value,E=t.pstyle("text-border-opacity").value,A=t.pstyle("text-border-width").pfValue,N=t.pstyle("text-background-padding").pfValue,P=t.pstyle("text-background-shape").strValue,I=P==="round-rectangle"||P==="roundrectangle",D=P==="circle",_=2;if(k>0||A>0&&E>0){var R=e.fillStyle,M=e.strokeStyle,L=e.lineWidth,B=t.pstyle("text-background-color").value,O=t.pstyle("text-border-color").value,$=t.pstyle("text-border-style").value,G=k>0,F=A>0&&E>0,V=u-N;switch(T){case"left":V-=g;break;case"center":V-=g/2;break}var H=h-y-N,j=g+2*N,U=y+2*N;if(G&&(e.fillStyle="rgba(".concat(B[0],",").concat(B[1],",").concat(B[2],",").concat(k*l,")")),F&&(e.strokeStyle="rgba(".concat(O[0],",").concat(O[1],",").concat(O[2],",").concat(E*l,")"),e.lineWidth=A,e.setLineDash))switch($){case"dotted":e.setLineDash([1,1]);break;case"dashed":e.setLineDash([4,2]);break;case"double":e.lineWidth=A/4,e.setLineDash([]);break;case"solid":default:e.setLineDash([]);break}if(I?(e.beginPath(),I0e(e,V,H,j,U,_)):D?(e.beginPath(),Zst(e,V,H,j,U)):(e.beginPath(),e.rect(V,H,j,U)),G&&e.fill(),F&&e.stroke(),F&&$==="double"){var Q=A/2;e.beginPath(),I?I0e(e,V+Q,H+Q,j-2*Q,U-2*Q,_):e.rect(V+Q,H+Q,j-2*Q,U-2*Q),e.stroke()}e.fillStyle=R,e.strokeStyle=M,e.lineWidth=L,e.setLineDash&&e.setLineDash([])}var Y=2*t.pstyle("text-outline-width").pfValue;if(Y>0&&(e.lineWidth=Y),t.pstyle("text-wrap").value==="wrap"){var ae=Ps(s,"labelWrapCachedLines",r),J=Ps(s,"labelLineHeight",r),te=g/2,re=this.getLabelJustification(t);switch(re==="auto"||(T==="left"?re==="left"?u+=-g:re==="center"&&(u+=-te):T==="center"?re==="left"?u+=-te:re==="right"&&(u+=te):T==="right"&&(re==="center"?u+=te:re==="right"&&(u+=g))),w){case"top":h-=(ae.length-1)*J;break;case"center":case"bottom":h-=(ae.length-1)*J;break}for(var ee=0;ee<ae.length;ee++)Y>0&&e.strokeText(ae[ee],u,h),e.fillText(ae[ee],u,h),h+=J}else Y>0&&e.strokeText(p,u,h),e.fillText(p,u,h);C!==0&&(e.rotate(-C),e.translate(-d,-f))}}};Jd={};Jd.drawNode=function(e,t,r){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,n=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,s=this,l,u,h=t._private,d=h.rscratch,f=t.position();if(!(!Ot(f.x)||!Ot(f.y))&&!(a&&!t.visible())){var p=a?t.effectiveOpacity():1,m=s.usePaths(),g,y=!1,v=t.padding();l=t.width()+2*v,u=t.height()+2*v;var x;r&&(x=r,e.translate(-x.x1,-x.y1));for(var b=t.pstyle("background-image"),T=b.value,w=new Array(T.length),C=new Array(T.length),k=0,E=0;E<T.length;E++){var A=T[E],N=w[E]=A!=null&&A!=="none";if(N){var P=t.cy().style().getIndexedStyle(t,"background-image-crossorigin","value",E);k++,C[E]=s.getCachedImage(A,P,function(){h.backgroundTimestamp=Date.now(),t.emitAndNotify("background")})}}var I=t.pstyle("background-blacken").value,D=t.pstyle("border-width").pfValue,_=t.pstyle("background-opacity").value*p,R=t.pstyle("border-color").value,M=t.pstyle("border-style").value,L=t.pstyle("border-join").value,B=t.pstyle("border-cap").value,O=t.pstyle("border-position").value,$=t.pstyle("border-dash-pattern").pfValue,G=t.pstyle("border-dash-offset").pfValue,F=t.pstyle("border-opacity").value*p,V=t.pstyle("outline-width").pfValue,H=t.pstyle("outline-color").value,j=t.pstyle("outline-style").value,U=t.pstyle("outline-opacity").value*p,Q=t.pstyle("outline-offset").value,Y=t.pstyle("corner-radius").value;Y!=="auto"&&(Y=t.pstyle("corner-radius").pfValue);var ae=o(function(){var ie=arguments.length>0&&arguments[0]!==void 0?arguments[0]:_;s.eleFillStyle(e,t,ie)},"setupShapeColor"),J=o(function(){var ie=arguments.length>0&&arguments[0]!==void 0?arguments[0]:F;s.colorStrokeStyle(e,R[0],R[1],R[2],ie)},"setupBorderColor"),te=o(function(){var ie=arguments.length>0&&arguments[0]!==void 0?arguments[0]:U;s.colorStrokeStyle(e,H[0],H[1],H[2],ie)},"setupOutlineColor"),re=o(function(ie,fe,W,ce){var K=s.nodePathCache=s.nodePathCache||[],Re=nme(W==="polygon"?W+","+ce.join(","):W,""+fe,""+ie,""+Y),xe=K[Re],Oe,be=!1;return xe!=null?(Oe=xe,be=!0,d.pathCache=Oe):(Oe=new Path2D,K[Re]=d.pathCache=Oe),{path:Oe,cacheHit:be}},"getPath"),ee=t.pstyle("shape").strValue,Te=t.pstyle("shape-polygon-points").pfValue;if(m){e.translate(f.x,f.y);var ue=re(l,u,ee,Te);g=ue.path,y=ue.cacheHit}var De=o(function(){if(!y){var ie=f;m&&(ie={x:0,y:0}),s.nodeShapes[s.getNodeShape(t)].draw(g||e,ie.x,ie.y,l,u,Y,d)}m?e.fill(g):e.fill()},"drawShape"),Ie=o(function(){for(var ie=arguments.length>0&&arguments[0]!==void 0?arguments[0]:p,fe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,W=h.backgrounding,ce=0,K=0;K<C.length;K++){var Re=t.cy().style().getIndexedStyle(t,"background-image-containment","value",K);if(fe&&Re==="over"||!fe&&Re==="inside"){ce++;continue}w[K]&&C[K].complete&&!C[K].error&&(ce++,s.drawInscribedImage(e,C[K],t,K,ie))}h.backgrounding=ce!==k,W!==h.backgrounding&&t.updateStyle(!1)},"drawImages"),Ee=o(function(){var ie=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,fe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:p;s.hasPie(t)&&(s.drawPie(e,t,fe),ie&&(m||s.nodeShapes[s.getNodeShape(t)].draw(e,f.x,f.y,l,u,Y,d)))},"drawPie"),we=o(function(){var ie=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,fe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:p;s.hasStripe(t)&&(e.save(),m?e.clip(d.pathCache):(s.nodeShapes[s.getNodeShape(t)].draw(e,f.x,f.y,l,u,Y,d),e.clip()),s.drawStripe(e,t,fe),e.restore(),ie&&(m||s.nodeShapes[s.getNodeShape(t)].draw(e,f.x,f.y,l,u,Y,d)))},"drawStripe"),Me=o(function(){var ie=arguments.length>0&&arguments[0]!==void 0?arguments[0]:p,fe=(I>0?I:-I)*ie,W=I>0?0:255;I!==0&&(s.colorFillStyle(e,W,W,W,fe),m?e.fill(g):e.fill())},"darken"),$e=o(function(){if(D>0){if(e.lineWidth=D,e.lineCap=B,e.lineJoin=L,e.setLineDash)switch(M){case"dotted":e.setLineDash([1,1]);break;case"dashed":e.setLineDash($),e.lineDashOffset=G;break;case"solid":case"double":e.setLineDash([]);break}if(O!=="center"){if(e.save(),e.lineWidth*=2,O==="inside")m?e.clip(g):e.clip();else{var ie=new Path2D;ie.rect(-l/2-D,-u/2-D,l+2*D,u+2*D),ie.addPath(g),e.clip(ie,"evenodd")}m?e.stroke(g):e.stroke(),e.restore()}else m?e.stroke(g):e.stroke();if(M==="double"){e.lineWidth=D/3;var fe=e.globalCompositeOperation;e.globalCompositeOperation="destination-out",m?e.stroke(g):e.stroke(),e.globalCompositeOperation=fe}e.setLineDash&&e.setLineDash([])}},"drawBorder"),de=o(function(){if(V>0){if(e.lineWidth=V,e.lineCap="butt",e.setLineDash)switch(j){case"dotted":e.setLineDash([1,1]);break;case"dashed":e.setLineDash([4,2]);break;case"solid":case"double":e.setLineDash([]);break}var ie=f;m&&(ie={x:0,y:0});var fe=s.getNodeShape(t),W=D;O==="inside"&&(W=0),O==="outside"&&(W*=2);var ce=(l+W+(V+Q))/l,K=(u+W+(V+Q))/u,Re=l*ce,xe=u*K,Oe=s.nodeShapes[fe].points,be;if(m){var Be=re(Re,xe,fe,Oe);be=Be.path}if(fe==="ellipse")s.drawEllipsePath(be||e,ie.x,ie.y,Re,xe);else if(["round-diamond","round-heptagon","round-hexagon","round-octagon","round-pentagon","round-polygon","round-triangle","round-tag"].includes(fe)){var Ae=0,Ve=0,Pe=0;fe==="round-diamond"?Ae=(W+Q+V)*1.4:fe==="round-heptagon"?(Ae=(W+Q+V)*1.075,Pe=-(W/2+Q+V)/35):fe==="round-hexagon"?Ae=(W+Q+V)*1.12:fe==="round-pentagon"?(Ae=(W+Q+V)*1.13,Pe=-(W/2+Q+V)/15):fe==="round-tag"?(Ae=(W+Q+V)*1.12,Ve=(W/2+V+Q)*.07):fe==="round-triangle"&&(Ae=(W+Q+V)*(Math.PI/2),Pe=-(W+Q/2+V)/Math.PI),Ae!==0&&(ce=(l+Ae)/l,Re=l*ce,["round-hexagon","round-tag"].includes(fe)||(K=(u+Ae)/u,xe=u*K)),Y=Y==="auto"?pme(Re,xe):Y;for(var Ye=Re/2,le=xe/2,st=Y+(W+V+Q)/2,me=new Array(Oe.length/2),ot=new Array(Oe.length/2),kt=0;kt<Oe.length/2;kt++)me[kt]={x:ie.x+Ve+Ye*Oe[kt*2],y:ie.y+Pe+le*Oe[kt*2+1]};var Gt,Tt,Et,yt,oe=me.length;for(Tt=me[oe-1],Gt=0;Gt<oe;Gt++)Et=me[Gt%oe],yt=me[(Gt+1)%oe],ot[Gt]=LP(Tt,Et,yt,st),Tt=Et,Et=yt;s.drawRoundPolygonPath(be||e,ie.x+Ve,ie.y+Pe,l*ce,u*K,Oe,ot)}else if(["roundrectangle","round-rectangle"].includes(fe))Y=Y==="auto"?Hd(Re,xe):Y,s.drawRoundRectanglePath(be||e,ie.x,ie.y,Re,xe,Y+(W+V+Q)/2);else if(["cutrectangle","cut-rectangle"].includes(fe))Y=Y==="auto"?bP():Y,s.drawCutRectanglePath(be||e,ie.x,ie.y,Re,xe,null,Y+(W+V+Q)/4);else if(["bottomroundrectangle","bottom-round-rectangle"].includes(fe))Y=Y==="auto"?Hd(Re,xe):Y,s.drawBottomRoundRectanglePath(be||e,ie.x,ie.y,Re,xe,Y+(W+V+Q)/2);else if(fe==="barrel")s.drawBarrelPath(be||e,ie.x,ie.y,Re,xe);else if(fe.startsWith("polygon")||["rhomboid","right-rhomboid","round-tag","tag","vee"].includes(fe)){var ht=(W+V+Q)/l;Oe=B3(F3(Oe,ht)),s.drawPolygonPath(be||e,ie.x,ie.y,l,u,Oe)}else{var gt=(W+V+Q)/l;Oe=B3(F3(Oe,-gt)),s.drawPolygonPath(be||e,ie.x,ie.y,l,u,Oe)}if(m?e.stroke(be):e.stroke(),j==="double"){e.lineWidth=W/3;var et=e.globalCompositeOperation;e.globalCompositeOperation="destination-out",m?e.stroke(be):e.stroke(),e.globalCompositeOperation=et}e.setLineDash&&e.setLineDash([])}},"drawOutline"),rt=o(function(){n&&s.drawNodeOverlay(e,t,f,l,u)},"drawOverlay"),ke=o(function(){n&&s.drawNodeUnderlay(e,t,f,l,u)},"drawUnderlay"),Fe=o(function(){s.drawElementText(e,t,null,i)},"drawText"),He=t.pstyle("ghost").value==="yes";if(He){var at=t.pstyle("ghost-offset-x").pfValue,qe=t.pstyle("ghost-offset-y").pfValue,Ue=t.pstyle("ghost-opacity").value,ye=Ue*p;e.translate(at,qe),te(),de(),ae(Ue*_),De(),Ie(ye,!0),J(Ue*F),$e(),Ee(I!==0||D!==0),we(I!==0||D!==0),Ie(ye,!1),Me(ye),e.translate(-at,-qe)}m&&e.translate(-f.x,-f.y),ke(),m&&e.translate(f.x,f.y),te(),de(),ae(),De(),Ie(p,!0),J(),$e(),Ee(I!==0||D!==0),we(I!==0||D!==0),Ie(p,!1),Me(),m&&e.translate(-f.x,-f.y),Fe(),rt(),r&&e.translate(x.x1,x.y1)}};bge=o(function(t){if(!["overlay","underlay"].includes(t))throw new Error("Invalid state");return function(r,i,n,a,s){var l=this;if(i.visible()){var u=i.pstyle("".concat(t,"-padding")).pfValue,h=i.pstyle("".concat(t,"-opacity")).value,d=i.pstyle("".concat(t,"-color")).value,f=i.pstyle("".concat(t,"-shape")).value,p=i.pstyle("".concat(t,"-corner-radius")).value;if(h>0){if(n=n||i.position(),a==null||s==null){var m=i.padding();a=i.width()+2*m,s=i.height()+2*m}l.colorFillStyle(r,d[0],d[1],d[2],h),l.nodeShapes[f].draw(r,n.x,n.y,a+u*2,s+u*2,p),r.fill()}}}},"drawNodeOverlayUnderlay");Jd.drawNodeOverlay=bge("overlay");Jd.drawNodeUnderlay=bge("underlay");Jd.hasPie=function(e){return e=e[0],e._private.hasPie};Jd.hasStripe=function(e){return e=e[0],e._private.hasStripe};Jd.drawPie=function(e,t,r,i){t=t[0],i=i||t.position();var n=t.cy().style(),a=t.pstyle("pie-size"),s=t.pstyle("pie-hole"),l=t.pstyle("pie-start-angle").pfValue,u=i.x,h=i.y,d=t.width(),f=t.height(),p=Math.min(d,f)/2,m,g=0,y=this.usePaths();if(y&&(u=0,h=0),a.units==="%"?p=p*a.pfValue:a.pfValue!==void 0&&(p=a.pfValue/2),s.units==="%"?m=p*s.pfValue:s.pfValue!==void 0&&(m=s.pfValue/2),!(m>=p))for(var v=1;v<=n.pieBackgroundN;v++){var x=t.pstyle("pie-"+v+"-background-size").value,b=t.pstyle("pie-"+v+"-background-color").value,T=t.pstyle("pie-"+v+"-background-opacity").value*r,w=x/100;w+g>1&&(w=1-g);var C=1.5*Math.PI+2*Math.PI*g;C+=l;var k=2*Math.PI*w,E=C+k;x===0||g>=1||g+w>1||(m===0?(e.beginPath(),e.moveTo(u,h),e.arc(u,h,p,C,E),e.closePath()):(e.beginPath(),e.arc(u,h,p,C,E),e.arc(u,h,m,E,C,!0),e.closePath()),this.colorFillStyle(e,b[0],b[1],b[2],T),e.fill(),g+=w)}};Jd.drawStripe=function(e,t,r,i){t=t[0],i=i||t.position();var n=t.cy().style(),a=i.x,s=i.y,l=t.width(),u=t.height(),h=0,d=this.usePaths();e.save();var f=t.pstyle("stripe-direction").value,p=t.pstyle("stripe-size");switch(f){case"vertical":break;case"righward":e.rotate(-Math.PI/2);break}var m=l,g=u;p.units==="%"?(m=m*p.pfValue,g=g*p.pfValue):p.pfValue!==void 0&&(m=p.pfValue,g=p.pfValue),d&&(a=0,s=0),s-=m/2,a-=g/2;for(var y=1;y<=n.stripeBackgroundN;y++){var v=t.pstyle("stripe-"+y+"-background-size").value,x=t.pstyle("stripe-"+y+"-background-color").value,b=t.pstyle("stripe-"+y+"-background-opacity").value*r,T=v/100;T+h>1&&(T=1-h),!(v===0||h>=1||h+T>1)&&(e.beginPath(),e.rect(a,s+g*h,m,g*T),e.closePath(),this.colorFillStyle(e,x[0],x[1],x[2],b),e.fill(),h+=T)}e.restore()};ns={},Qst=100;ns.getPixelRatio=function(){var e=this.data.contexts[0];if(this.forcedPixelRatio!=null)return this.forcedPixelRatio;var t=this.cy.window(),r=e.backingStorePixelRatio||e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1;return(t.devicePixelRatio||1)/r};ns.paintCache=function(e){for(var t=this.paintCaches=this.paintCaches||[],r=!0,i,n=0;n<t.length;n++)if(i=t[n],i.context===e){r=!1;break}return r&&(i={context:e},t.push(i)),i};ns.createGradientStyleFor=function(e,t,r,i,n){var a,s=this.usePaths(),l=r.pstyle(t+"-gradient-stop-colors").value,u=r.pstyle(t+"-gradient-stop-positions").pfValue;if(i==="radial-gradient")if(r.isEdge()){var h=r.sourceEndpoint(),d=r.targetEndpoint(),f=r.midpoint(),p=e0(h,f),m=e0(d,f);a=e.createRadialGradient(f.x,f.y,0,f.x,f.y,Math.max(p,m))}else{var g=s?{x:0,y:0}:r.position(),y=r.paddedWidth(),v=r.paddedHeight();a=e.createRadialGradient(g.x,g.y,0,g.x,g.y,Math.max(y,v))}else if(r.isEdge()){var x=r.sourceEndpoint(),b=r.targetEndpoint();a=e.createLinearGradient(x.x,x.y,b.x,b.y)}else{var T=s?{x:0,y:0}:r.position(),w=r.paddedWidth(),C=r.paddedHeight(),k=w/2,E=C/2,A=r.pstyle("background-gradient-direction").value;switch(A){case"to-bottom":a=e.createLinearGradient(T.x,T.y-E,T.x,T.y+E);break;case"to-top":a=e.createLinearGradient(T.x,T.y+E,T.x,T.y-E);break;case"to-left":a=e.createLinearGradient(T.x+k,T.y,T.x-k,T.y);break;case"to-right":a=e.createLinearGradient(T.x-k,T.y,T.x+k,T.y);break;case"to-bottom-right":case"to-right-bottom":a=e.createLinearGradient(T.x-k,T.y-E,T.x+k,T.y+E);break;case"to-top-right":case"to-right-top":a=e.createLinearGradient(T.x-k,T.y+E,T.x+k,T.y-E);break;case"to-bottom-left":case"to-left-bottom":a=e.createLinearGradient(T.x+k,T.y-E,T.x-k,T.y+E);break;case"to-top-left":case"to-left-top":a=e.createLinearGradient(T.x+k,T.y+E,T.x-k,T.y-E);break}}if(!a)return null;for(var N=u.length===l.length,P=l.length,I=0;I<P;I++)a.addColorStop(N?u[I]:I/(P-1),"rgba("+l[I][0]+","+l[I][1]+","+l[I][2]+","+n+")");return a};ns.gradientFillStyle=function(e,t,r,i){var n=this.createGradientStyleFor(e,"background",t,r,i);if(!n)return null;e.fillStyle=n};ns.colorFillStyle=function(e,t,r,i,n){e.fillStyle="rgba("+t+","+r+","+i+","+n+")"};ns.eleFillStyle=function(e,t,r){var i=t.pstyle("background-fill").value;if(i==="linear-gradient"||i==="radial-gradient")this.gradientFillStyle(e,t,i,r);else{var n=t.pstyle("background-color").value;this.colorFillStyle(e,n[0],n[1],n[2],r)}};ns.gradientStrokeStyle=function(e,t,r,i){var n=this.createGradientStyleFor(e,"line",t,r,i);if(!n)return null;e.strokeStyle=n};ns.colorStrokeStyle=function(e,t,r,i,n){e.strokeStyle="rgba("+t+","+r+","+i+","+n+")"};ns.eleStrokeStyle=function(e,t,r){var i=t.pstyle("line-fill").value;if(i==="linear-gradient"||i==="radial-gradient")this.gradientStrokeStyle(e,t,i,r);else{var n=t.pstyle("line-color").value;this.colorStrokeStyle(e,n[0],n[1],n[2],r)}};ns.matchCanvasSize=function(e){var t=this,r=t.data,i=t.findContainerClientCoords(),n=i[2],a=i[3],s=t.getPixelRatio(),l=t.motionBlurPxRatio;(e===t.data.bufferCanvases[t.MOTIONBLUR_BUFFER_NODE]||e===t.data.bufferCanvases[t.MOTIONBLUR_BUFFER_DRAG])&&(s=l);var u=n*s,h=a*s,d;if(!(u===t.canvasWidth&&h===t.canvasHeight)){t.fontCaches=null;var f=r.canvasContainer;f.style.width=n+"px",f.style.height=a+"px";for(var p=0;p<t.CANVAS_LAYERS;p++)d=r.canvases[p],d.width=u,d.height=h,d.style.width=n+"px",d.style.height=a+"px";for(var p=0;p<t.BUFFER_COUNT;p++)d=r.bufferCanvases[p],d.width=u,d.height=h,d.style.width=n+"px",d.style.height=a+"px";t.textureMult=1,s<=1&&(d=r.bufferCanvases[t.TEXTURE_BUFFER],t.textureMult=2,d.width=u*t.textureMult,d.height=h*t.textureMult),t.canvasWidth=u,t.canvasHeight=h,t.pixelRatio=s}};ns.renderTo=function(e,t,r,i){this.render({forcedContext:e,forcedZoom:t,forcedPan:r,drawAllLayers:!0,forcedPxRatio:i})};ns.clearCanvas=function(){var e=this,t=e.data;function r(i){i.clearRect(0,0,e.canvasWidth,e.canvasHeight)}o(r,"clear"),r(t.contexts[e.NODE]),r(t.contexts[e.DRAG])};ns.render=function(e){var t=this;e=e||lme();var r=t.cy,i=e.forcedContext,n=e.drawAllLayers,a=e.drawOnlyNodeLayer,s=e.forcedZoom,l=e.forcedPan,u=e.forcedPxRatio===void 0?this.getPixelRatio():e.forcedPxRatio,h=t.data,d=h.canvasNeedsRedraw,f=t.textureOnViewport&&!i&&(t.pinching||t.hoverData.dragging||t.swipePanning||t.data.wheelZooming),p=e.motionBlur!==void 0?e.motionBlur:t.motionBlur,m=t.motionBlurPxRatio,g=r.hasCompoundNodes(),y=t.hoverData.draggingEles,v=!!(t.hoverData.selecting||t.touchData.selecting);p=p&&!i&&t.motionBlurEnabled&&!v;var x=p;i||(t.prevPxRatio!==u&&(t.invalidateContainerClientCoordsCache(),t.matchCanvasSize(t.container),t.redrawHint("eles",!0),t.redrawHint("drag",!0)),t.prevPxRatio=u),!i&&t.motionBlurTimeout&&clearTimeout(t.motionBlurTimeout),p&&(t.mbFrames==null&&(t.mbFrames=0),t.mbFrames++,t.mbFrames<3&&(x=!1),t.mbFrames>t.minMbLowQualFrames&&(t.motionBlurPxRatio=t.mbPxRBlurry)),t.clearingMotionBlur&&(t.motionBlurPxRatio=1),t.textureDrawLastFrame&&!f&&(d[t.NODE]=!0,d[t.SELECT_BOX]=!0);var b=r.style(),T=r.zoom(),w=s!==void 0?s:T,C=r.pan(),k={x:C.x,y:C.y},E={zoom:T,pan:{x:C.x,y:C.y}},A=t.prevViewport,N=A===void 0||E.zoom!==A.zoom||E.pan.x!==A.pan.x||E.pan.y!==A.pan.y;!N&&!(y&&!g)&&(t.motionBlurPxRatio=1),l&&(k=l),w*=u,k.x*=u,k.y*=u;var P=t.getCachedZSortedEles();function I(J,te,re,ee,Te){var ue=J.globalCompositeOperation;J.globalCompositeOperation="destination-out",t.colorFillStyle(J,255,255,255,t.motionBlurTransparency),J.fillRect(te,re,ee,Te),J.globalCompositeOperation=ue}o(I,"mbclear");function D(J,te){var re,ee,Te,ue;!t.clearingMotionBlur&&(J===h.bufferContexts[t.MOTIONBLUR_BUFFER_NODE]||J===h.bufferContexts[t.MOTIONBLUR_BUFFER_DRAG])?(re={x:C.x*m,y:C.y*m},ee=T*m,Te=t.canvasWidth*m,ue=t.canvasHeight*m):(re=k,ee=w,Te=t.canvasWidth,ue=t.canvasHeight),J.setTransform(1,0,0,1,0,0),te==="motionBlur"?I(J,0,0,Te,ue):!i&&(te===void 0||te)&&J.clearRect(0,0,Te,ue),n||(J.translate(re.x,re.y),J.scale(ee,ee)),l&&J.translate(l.x,l.y),s&&J.scale(s,s)}if(o(D,"setContextTransform"),f||(t.textureDrawLastFrame=!1),f){if(t.textureDrawLastFrame=!0,!t.textureCache){t.textureCache={},t.textureCache.bb=r.mutableElements().boundingBox(),t.textureCache.texture=t.data.bufferCanvases[t.TEXTURE_BUFFER];var _=t.data.bufferContexts[t.TEXTURE_BUFFER];_.setTransform(1,0,0,1,0,0),_.clearRect(0,0,t.canvasWidth*t.textureMult,t.canvasHeight*t.textureMult),t.render({forcedContext:_,drawOnlyNodeLayer:!0,forcedPxRatio:u*t.textureMult});var E=t.textureCache.viewport={zoom:r.zoom(),pan:r.pan(),width:t.canvasWidth,height:t.canvasHeight};E.mpan={x:(0-E.pan.x)/E.zoom,y:(0-E.pan.y)/E.zoom}}d[t.DRAG]=!1,d[t.NODE]=!1;var R=h.contexts[t.NODE],M=t.textureCache.texture,E=t.textureCache.viewport;R.setTransform(1,0,0,1,0,0),p?I(R,0,0,E.width,E.height):R.clearRect(0,0,E.width,E.height);var L=b.core("outside-texture-bg-color").value,B=b.core("outside-texture-bg-opacity").value;t.colorFillStyle(R,L[0],L[1],L[2],B),R.fillRect(0,0,E.width,E.height);var T=r.zoom();D(R,!1),R.clearRect(E.mpan.x,E.mpan.y,E.width/E.zoom/u,E.height/E.zoom/u),R.drawImage(M,E.mpan.x,E.mpan.y,E.width/E.zoom/u,E.height/E.zoom/u)}else t.textureOnViewport&&!i&&(t.textureCache=null);var O=r.extent(),$=t.pinching||t.hoverData.dragging||t.swipePanning||t.data.wheelZooming||t.hoverData.draggingEles||t.cy.animated(),G=t.hideEdgesOnViewport&&$,F=[];if(F[t.NODE]=!d[t.NODE]&&p&&!t.clearedForMotionBlur[t.NODE]||t.clearingMotionBlur,F[t.NODE]&&(t.clearedForMotionBlur[t.NODE]=!0),F[t.DRAG]=!d[t.DRAG]&&p&&!t.clearedForMotionBlur[t.DRAG]||t.clearingMotionBlur,F[t.DRAG]&&(t.clearedForMotionBlur[t.DRAG]=!0),d[t.NODE]||n||a||F[t.NODE]){var V=p&&!F[t.NODE]&&m!==1,R=i||(V?t.data.bufferContexts[t.MOTIONBLUR_BUFFER_NODE]:h.contexts[t.NODE]),H=p&&!V?"motionBlur":void 0;D(R,H),G?t.drawCachedNodes(R,P.nondrag,u,O):t.drawLayeredElements(R,P.nondrag,u,O),t.debug&&t.drawDebugPoints(R,P.nondrag),!n&&!p&&(d[t.NODE]=!1)}if(!a&&(d[t.DRAG]||n||F[t.DRAG])){var V=p&&!F[t.DRAG]&&m!==1,R=i||(V?t.data.bufferContexts[t.MOTIONBLUR_BUFFER_DRAG]:h.contexts[t.DRAG]);D(R,p&&!V?"motionBlur":void 0),G?t.drawCachedNodes(R,P.drag,u,O):t.drawCachedElements(R,P.drag,u,O),t.debug&&t.drawDebugPoints(R,P.drag),!n&&!p&&(d[t.DRAG]=!1)}if(this.drawSelectionRectangle(e,D),p&&m!==1){var j=h.contexts[t.NODE],U=t.data.bufferCanvases[t.MOTIONBLUR_BUFFER_NODE],Q=h.contexts[t.DRAG],Y=t.data.bufferCanvases[t.MOTIONBLUR_BUFFER_DRAG],ae=o(function(te,re,ee){te.setTransform(1,0,0,1,0,0),ee||!x?te.clearRect(0,0,t.canvasWidth,t.canvasHeight):I(te,0,0,t.canvasWidth,t.canvasHeight);var Te=m;te.drawImage(re,0,0,t.canvasWidth*Te,t.canvasHeight*Te,0,0,t.canvasWidth,t.canvasHeight)},"drawMotionBlur");(d[t.NODE]||F[t.NODE])&&(ae(j,U,F[t.NODE]),d[t.NODE]=!1),(d[t.DRAG]||F[t.DRAG])&&(ae(Q,Y,F[t.DRAG]),d[t.DRAG]=!1)}t.prevViewport=E,t.clearingMotionBlur&&(t.clearingMotionBlur=!1,t.motionBlurCleared=!0,t.motionBlur=!0),p&&(t.motionBlurTimeout=setTimeout(function(){t.motionBlurTimeout=null,t.clearedForMotionBlur[t.NODE]=!1,t.clearedForMotionBlur[t.DRAG]=!1,t.motionBlur=!1,t.clearingMotionBlur=!f,t.mbFrames=0,d[t.NODE]=!0,d[t.DRAG]=!0,t.redraw()},Qst)),i||r.emit("render")};ns.drawSelectionRectangle=function(e,t){var r=this,i=r.cy,n=r.data,a=i.style(),s=e.drawOnlyNodeLayer,l=e.drawAllLayers,u=n.canvasNeedsRedraw,h=e.forcedContext;if(r.showFps||!s&&u[r.SELECT_BOX]&&!l){var d=h||n.contexts[r.SELECT_BOX];if(t(d),r.selection[4]==1&&(r.hoverData.selecting||r.touchData.selecting)){var f=r.cy.zoom(),p=a.core("selection-box-border-width").value/f;d.lineWidth=p,d.fillStyle="rgba("+a.core("selection-box-color").value[0]+","+a.core("selection-box-color").value[1]+","+a.core("selection-box-color").value[2]+","+a.core("selection-box-opacity").value+")",d.fillRect(r.selection[0],r.selection[1],r.selection[2]-r.selection[0],r.selection[3]-r.selection[1]),p>0&&(d.strokeStyle="rgba("+a.core("selection-box-border-color").value[0]+","+a.core("selection-box-border-color").value[1]+","+a.core("selection-box-border-color").value[2]+","+a.core("selection-box-opacity").value+")",d.strokeRect(r.selection[0],r.selection[1],r.selection[2]-r.selection[0],r.selection[3]-r.selection[1]))}if(n.bgActivePosistion&&!r.hoverData.selecting){var f=r.cy.zoom(),m=n.bgActivePosistion;d.fillStyle="rgba("+a.core("active-bg-color").value[0]+","+a.core("active-bg-color").value[1]+","+a.core("active-bg-color").value[2]+","+a.core("active-bg-opacity").value+")",d.beginPath(),d.arc(m.x,m.y,a.core("active-bg-size").pfValue/f,0,2*Math.PI),d.fill()}var g=r.lastRedrawTime;if(r.showFps&&g){g=Math.round(g);var y=Math.round(1e3/g),v="1 frame = "+g+" ms = "+y+" fps";if(d.setTransform(1,0,0,1,0,0),d.fillStyle="rgba(255, 0, 0, 0.75)",d.strokeStyle="rgba(255, 0, 0, 0.75)",d.font="30px Arial",!Bb){var x=d.measureText(v);Bb=x.actualBoundingBoxAscent}d.fillText(v,0,Bb);var b=60;d.strokeRect(0,Bb+10,250,20),d.fillRect(0,Bb+10,250*Math.min(y/b,1),20)}l||(u[r.SELECT_BOX]=!1)}};o(O0e,"compileShader");o(Jst,"createProgram");o(eot,"createTextureCanvas");o(IP,"getEffectivePanZoom");o(tot,"getEffectiveZoom");o(rot,"modelToRenderedPosition");o(iot,"isSimpleShape");o(not,"arrayEqual");o(Hp,"toWebGLColor");o(n1,"indexToVec4");o(aot,"vec4ToIndex");o(sot,"createTexture");o(Tge,"getTypeInfo");o(Cge,"createTypedArray");o(oot,"createTypedArrayView");o(lot,"createBufferStaticDraw");o(Oc,"createBufferDynamicDraw");o(cot,"create3x3MatrixBufferDynamicDraw");o(uot,"createPickingFrameBuffer");P0e=typeof Float32Array<"u"?Float32Array:Array;Math.hypot||(Math.hypot=function(){for(var e=0,t=arguments.length;t--;)e+=arguments[t]*arguments[t];return Math.sqrt(e)});o(FO,"create");o(B0e,"identity");o(hot,"multiply");o(M3,"translate");o(F0e,"rotate");o(sP,"scale");o(dot,"projection");fot=(function(){function e(t,r,i,n){Kd(this,e),this.debugID=Math.floor(Math.random()*1e4),this.r=t,this.texSize=r,this.texRows=i,this.texHeight=Math.floor(r/i),this.enableWrapping=!0,this.locked=!1,this.texture=null,this.needsBuffer=!0,this.freePointer={x:0,row:0},this.keyToLocation=new Map,this.canvas=n(t,r,r),this.scratch=n(t,r,this.texHeight,"scratch")}return o(e,"Atlas"),Zd(e,[{key:"lock",value:o(function(){this.locked=!0},"lock")},{key:"getKeys",value:o(function(){return new Set(this.keyToLocation.keys())},"getKeys")},{key:"getScale",value:o(function(r){var i=r.w,n=r.h,a=this.texHeight,s=this.texSize,l=a/n,u=i*l,h=n*l;return u>s&&(l=s/i,u=i*l,h=n*l),{scale:l,texW:u,texH:h}},"getScale")},{key:"draw",value:o(function(r,i,n){var a=this;if(this.locked)throw new Error("can't draw, atlas is locked");var s=this.texSize,l=this.texRows,u=this.texHeight,h=this.getScale(i),d=h.scale,f=h.texW,p=h.texH,m=o(function(T,w){if(n&&w){var C=w.context,k=T.x,E=T.row,A=k,N=u*E;C.save(),C.translate(A,N),C.scale(d,d),n(C,i),C.restore()}},"drawAt"),g=[null,null],y=o(function(){m(a.freePointer,a.canvas),g[0]={x:a.freePointer.x,y:a.freePointer.row*u,w:f,h:p},g[1]={x:a.freePointer.x+f,y:a.freePointer.row*u,w:0,h:p},a.freePointer.x+=f,a.freePointer.x==s&&(a.freePointer.x=0,a.freePointer.row++)},"drawNormal"),v=o(function(){var T=a.scratch,w=a.canvas;T.clear(),m({x:0,row:0},T);var C=s-a.freePointer.x,k=f-C,E=u;{var A=a.freePointer.x,N=a.freePointer.row*u,P=C;w.context.drawImage(T,0,0,P,E,A,N,P,E),g[0]={x:A,y:N,w:P,h:p}}{var I=C,D=(a.freePointer.row+1)*u,_=k;w&&w.context.drawImage(T,I,0,_,E,0,D,_,E),g[1]={x:0,y:D,w:_,h:p}}a.freePointer.x=k,a.freePointer.row++},"drawWrapped"),x=o(function(){a.freePointer.x=0,a.freePointer.row++},"moveToStartOfNextRow");if(this.freePointer.x+f<=s)y();else{if(this.freePointer.row>=l-1)return!1;this.freePointer.x===s?(x(),y()):this.enableWrapping?v():(x(),y())}return this.keyToLocation.set(r,g),this.needsBuffer=!0,g},"draw")},{key:"getOffsets",value:o(function(r){return this.keyToLocation.get(r)},"getOffsets")},{key:"isEmpty",value:o(function(){return this.freePointer.x===0&&this.freePointer.row===0},"isEmpty")},{key:"canFit",value:o(function(r){if(this.locked)return!1;var i=this.texSize,n=this.texRows,a=this.getScale(r),s=a.texW;return this.freePointer.x+s>i?this.freePointer.row<n-1:!0},"canFit")},{key:"bufferIfNeeded",value:o(function(r){this.texture||(this.texture=sot(r,this.debugID)),this.needsBuffer&&(this.texture.buffer(this.canvas),this.needsBuffer=!1,this.locked&&(this.canvas=null,this.scratch=null))},"bufferIfNeeded")},{key:"dispose",value:o(function(){this.texture&&(this.texture.deleteTexture(),this.texture=null),this.canvas=null,this.scratch=null,this.locked=!0},"dispose")}])})(),pot=(function(){function e(t,r,i,n){Kd(this,e),this.r=t,this.texSize=r,this.texRows=i,this.createTextureCanvas=n,this.atlases=[],this.styleKeyToAtlas=new Map,this.markedKeys=new Set}return o(e,"AtlasCollection"),Zd(e,[{key:"getKeys",value:o(function(){return new Set(this.styleKeyToAtlas.keys())},"getKeys")},{key:"_createAtlas",value:o(function(){var r=this.r,i=this.texSize,n=this.texRows,a=this.createTextureCanvas;return new fot(r,i,n,a)},"_createAtlas")},{key:"_getScratchCanvas",value:o(function(){if(!this.scratch){var r=this.r,i=this.texSize,n=this.texRows,a=this.createTextureCanvas,s=Math.floor(i/n);this.scratch=a(r,i,s,"scratch")}return this.scratch},"_getScratchCanvas")},{key:"draw",value:o(function(r,i,n){var a=this.styleKeyToAtlas.get(r);return a||(a=this.atlases[this.atlases.length-1],(!a||!a.canFit(i))&&(a&&a.lock(),a=this._createAtlas(),this.atlases.push(a)),a.draw(r,i,n),this.styleKeyToAtlas.set(r,a)),a},"draw")},{key:"getAtlas",value:o(function(r){return this.styleKeyToAtlas.get(r)},"getAtlas")},{key:"hasAtlas",value:o(function(r){return this.styleKeyToAtlas.has(r)},"hasAtlas")},{key:"markKeyForGC",value:o(function(r){this.markedKeys.add(r)},"markKeyForGC")},{key:"gc",value:o(function(){var r=this,i=this.markedKeys;if(i.size===0){console.log("nothing to garbage collect");return}var n=[],a=new Map,s=null,l=Fs(this.atlases),u;try{var h=o(function(){var f=u.value,p=f.getKeys(),m=mot(i,p);if(m.size===0)return n.push(f),p.forEach(function(C){return a.set(C,f)}),1;s||(s=r._createAtlas(),n.push(s));var g=Fs(p),y;try{for(g.s();!(y=g.n()).done;){var v=y.value;if(!m.has(v)){var x=f.getOffsets(v),b=Dn(x,2),T=b[0],w=b[1];s.canFit({w:T.w+w.w,h:T.h})||(s.lock(),s=r._createAtlas(),n.push(s)),f.canvas&&(r._copyTextureToNewAtlas(v,f,s),a.set(v,s))}}}catch(C){g.e(C)}finally{g.f()}f.dispose()},"_loop");for(l.s();!(u=l.n()).done;)h()}catch(d){l.e(d)}finally{l.f()}this.atlases=n,this.styleKeyToAtlas=a,this.markedKeys=new Set},"gc")},{key:"_copyTextureToNewAtlas",value:o(function(r,i,n){var a=i.getOffsets(r),s=Dn(a,2),l=s[0],u=s[1];if(u.w===0)n.draw(r,l,function(p){p.drawImage(i.canvas,l.x,l.y,l.w,l.h,0,0,l.w,l.h)});else{var h=this._getScratchCanvas();h.clear(),h.context.drawImage(i.canvas,l.x,l.y,l.w,l.h,0,0,l.w,l.h),h.context.drawImage(i.canvas,u.x,u.y,u.w,u.h,l.w,0,u.w,u.h);var d=l.w+u.w,f=l.h;n.draw(r,{w:d,h:f},function(p){p.drawImage(h,0,0,d,f,0,0,d,f)})}},"_copyTextureToNewAtlas")},{key:"getCounts",value:o(function(){return{keyCount:this.styleKeyToAtlas.size,atlasCount:new Set(this.styleKeyToAtlas.values()).size}},"getCounts")}])})();o(mot,"intersection");got=(function(){function e(t,r){Kd(this,e),this.r=t,this.globalOptions=r,this.atlasSize=r.webglTexSize,this.maxAtlasesPerBatch=r.webglTexPerBatch,this.renderTypes=new Map,this.collections=new Map,this.typeAndIdToKey=new Map}return o(e,"AtlasManager"),Zd(e,[{key:"getAtlasSize",value:o(function(){return this.atlasSize},"getAtlasSize")},{key:"addAtlasCollection",value:o(function(r,i){var n=this.globalOptions,a=n.webglTexSize,s=n.createTextureCanvas,l=i.texRows,u=this._cacheScratchCanvas(s),h=new pot(this.r,a,l,u);this.collections.set(r,h)},"addAtlasCollection")},{key:"addRenderType",value:o(function(r,i){var n=i.collection;if(!this.collections.has(n))throw new Error("invalid atlas collection name '".concat(n,"'"));var a=this.collections.get(n),s=hr({type:r,atlasCollection:a},i);this.renderTypes.set(r,s)},"addRenderType")},{key:"getRenderTypeOpts",value:o(function(r){return this.renderTypes.get(r)},"getRenderTypeOpts")},{key:"getAtlasCollection",value:o(function(r){return this.collections.get(r)},"getAtlasCollection")},{key:"_cacheScratchCanvas",value:o(function(r){var i=-1,n=-1,a=null;return function(s,l,u,h){return h?((!a||l!=i||u!=n)&&(i=l,n=u,a=r(s,l,u)),a):r(s,l,u)}},"_cacheScratchCanvas")},{key:"_key",value:o(function(r,i){return"".concat(r,"-").concat(i)},"_key")},{key:"invalidate",value:o(function(r){var i=this,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=n.forceRedraw,s=a===void 0?!1:a,l=n.filterEle,u=l===void 0?function(){return!0}:l,h=n.filterType,d=h===void 0?function(){return!0}:h,f=!1,p=!1,m=Fs(r),g;try{for(m.s();!(g=m.n()).done;){var y=g.value;if(u(y)){var v=Fs(this.renderTypes.values()),x;try{var b=o(function(){var w=x.value,C=w.type;if(d(C)){var k=i.collections.get(w.collection),E=w.getKey(y),A=Array.isArray(E)?E:[E];if(s)A.forEach(function(D){return k.markKeyForGC(D)}),p=!0;else{var N=w.getID?w.getID(y):y.id(),P=i._key(C,N),I=i.typeAndIdToKey.get(P);I!==void 0&&!not(A,I)&&(f=!0,i.typeAndIdToKey.delete(P),I.forEach(function(D){return k.markKeyForGC(D)}))}}},"_loop2");for(v.s();!(x=v.n()).done;)b()}catch(T){v.e(T)}finally{v.f()}}}}catch(T){m.e(T)}finally{m.f()}return p&&(this.gc(),f=!1),f},"invalidate")},{key:"gc",value:o(function(){var r=Fs(this.collections.values()),i;try{for(r.s();!(i=r.n()).done;){var n=i.value;n.gc()}}catch(a){r.e(a)}finally{r.f()}},"gc")},{key:"getOrCreateAtlas",value:o(function(r,i,n,a){var s=this.renderTypes.get(i),l=this.collections.get(s.collection),u=!1,h=l.draw(a,n,function(p){s.drawClipped?(p.save(),p.beginPath(),p.rect(0,0,n.w,n.h),p.clip(),s.drawElement(p,r,n,!0,!0),p.restore()):s.drawElement(p,r,n,!0,!0),u=!0});if(u){var d=s.getID?s.getID(r):r.id(),f=this._key(i,d);this.typeAndIdToKey.has(f)?this.typeAndIdToKey.get(f).push(a):this.typeAndIdToKey.set(f,[a])}return h},"getOrCreateAtlas")},{key:"getAtlasInfo",value:o(function(r,i){var n=this,a=this.renderTypes.get(i),s=a.getKey(r),l=Array.isArray(s)?s:[s];return l.map(function(u){var h=a.getBoundingBox(r,u),d=n.getOrCreateAtlas(r,i,h,u),f=d.getOffsets(u),p=Dn(f,2),m=p[0],g=p[1];return{atlas:d,tex:m,tex1:m,tex2:g,bb:h}})},"getAtlasInfo")},{key:"getDebugInfo",value:o(function(){var r=[],i=Fs(this.collections),n;try{for(i.s();!(n=i.n()).done;){var a=Dn(n.value,2),s=a[0],l=a[1],u=l.getCounts(),h=u.keyCount,d=u.atlasCount;r.push({type:s,keyCount:h,atlasCount:d})}}catch(f){i.e(f)}finally{i.f()}return r},"getDebugInfo")}])})(),yot=(function(){function e(t){Kd(this,e),this.globalOptions=t,this.atlasSize=t.webglTexSize,this.maxAtlasesPerBatch=t.webglTexPerBatch,this.batchAtlases=[]}return o(e,"AtlasBatchManager"),Zd(e,[{key:"getMaxAtlasesPerBatch",value:o(function(){return this.maxAtlasesPerBatch},"getMaxAtlasesPerBatch")},{key:"getAtlasSize",value:o(function(){return this.atlasSize},"getAtlasSize")},{key:"getIndexArray",value:o(function(){return Array.from({length:this.maxAtlasesPerBatch},function(r,i){return i})},"getIndexArray")},{key:"startBatch",value:o(function(){this.batchAtlases=[]},"startBatch")},{key:"getAtlasCount",value:o(function(){return this.batchAtlases.length},"getAtlasCount")},{key:"getAtlases",value:o(function(){return this.batchAtlases},"getAtlases")},{key:"canAddToCurrentBatch",value:o(function(r){return this.batchAtlases.length===this.maxAtlasesPerBatch?this.batchAtlases.includes(r):!0},"canAddToCurrentBatch")},{key:"getAtlasIndexForBatch",value:o(function(r){var i=this.batchAtlases.indexOf(r);if(i<0){if(this.batchAtlases.length===this.maxAtlasesPerBatch)throw new Error("cannot add more atlases to batch");this.batchAtlases.push(r),i=this.batchAtlases.length-1}return i},"getAtlasIndexForBatch")}])})(),vot=`
11
+ float circleSD(vec2 p, float r) {
12
+ return distance(vec2(0), p) - r; // signed distance
13
+ }
14
+ `,xot=`
15
+ float rectangleSD(vec2 p, vec2 b) {
16
+ vec2 d = abs(p)-b;
17
+ return distance(vec2(0),max(d,0.0)) + min(max(d.x,d.y),0.0);
18
+ }
19
+ `,bot=`
20
+ float roundRectangleSD(vec2 p, vec2 b, vec4 cr) {
21
+ cr.xy = (p.x > 0.0) ? cr.xy : cr.zw;
22
+ cr.x = (p.y > 0.0) ? cr.x : cr.y;
23
+ vec2 q = abs(p) - b + cr.x;
24
+ return min(max(q.x, q.y), 0.0) + distance(vec2(0), max(q, 0.0)) - cr.x;
25
+ }
26
+ `,Tot=`
27
+ float ellipseSD(vec2 p, vec2 ab) {
28
+ p = abs( p ); // symmetry
29
+
30
+ // find root with Newton solver
31
+ vec2 q = ab*(p-ab);
32
+ float w = (q.x<q.y)? 1.570796327 : 0.0;
33
+ for( int i=0; i<5; i++ ) {
34
+ vec2 cs = vec2(cos(w),sin(w));
35
+ vec2 u = ab*vec2( cs.x,cs.y);
36
+ vec2 v = ab*vec2(-cs.y,cs.x);
37
+ w = w + dot(p-u,v)/(dot(p-u,u)+dot(v,v));
38
+ }
39
+
40
+ // compute final point and distance
41
+ float d = length(p-ab*vec2(cos(w),sin(w)));
42
+
43
+ // return signed distance
44
+ return (dot(p/ab,p/ab)>1.0) ? d : -d;
45
+ }
46
+ `,Ub={SCREEN:{name:"screen",screen:!0},PICKING:{name:"picking",picking:!0}},U3={IGNORE:1,USE_BB:2},$O=0,$0e=1,z0e=2,zO=3,a1=4,T3=5,Fb=6,$b=7,Cot=(function(){function e(t,r,i){Kd(this,e),this.r=t,this.gl=r,this.maxInstances=i.webglBatchSize,this.atlasSize=i.webglTexSize,this.bgColor=i.bgColor,this.debug=i.webglDebug,this.batchDebugInfo=[],i.enableWrapping=!0,i.createTextureCanvas=eot,this.atlasManager=new got(t,i),this.batchManager=new yot(i),this.simpleShapeOptions=new Map,this.program=this._createShaderProgram(Ub.SCREEN),this.pickingProgram=this._createShaderProgram(Ub.PICKING),this.vao=this._createVAO()}return o(e,"ElementDrawingWebGL"),Zd(e,[{key:"addAtlasCollection",value:o(function(r,i){this.atlasManager.addAtlasCollection(r,i)},"addAtlasCollection")},{key:"addTextureAtlasRenderType",value:o(function(r,i){this.atlasManager.addRenderType(r,i)},"addTextureAtlasRenderType")},{key:"addSimpleShapeRenderType",value:o(function(r,i){this.simpleShapeOptions.set(r,i)},"addSimpleShapeRenderType")},{key:"invalidate",value:o(function(r){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=i.type,a=this.atlasManager;return n?a.invalidate(r,{filterType:o(function(l){return l===n},"filterType"),forceRedraw:!0}):a.invalidate(r)},"invalidate")},{key:"gc",value:o(function(){this.atlasManager.gc()},"gc")},{key:"_createShaderProgram",value:o(function(r){var i=this.gl,n=`#version 300 es
47
+ precision highp float;
48
+
49
+ uniform mat3 uPanZoomMatrix;
50
+ uniform int uAtlasSize;
51
+
52
+ // instanced
53
+ in vec2 aPosition; // a vertex from the unit square
54
+
55
+ in mat3 aTransform; // used to transform verticies, eg into a bounding box
56
+ in int aVertType; // the type of thing we are rendering
57
+
58
+ // the z-index that is output when using picking mode
59
+ in vec4 aIndex;
60
+
61
+ // For textures
62
+ in int aAtlasId; // which shader unit/atlas to use
63
+ in vec4 aTex; // x/y/w/h of texture in atlas
64
+
65
+ // for edges
66
+ in vec4 aPointAPointB;
67
+ in vec4 aPointCPointD;
68
+ in vec2 aLineWidth; // also used for node border width
69
+
70
+ // simple shapes
71
+ in vec4 aCornerRadius; // for round-rectangle [top-right, bottom-right, top-left, bottom-left]
72
+ in vec4 aColor; // also used for edges
73
+ in vec4 aBorderColor; // aLineWidth is used for border width
74
+
75
+ // output values passed to the fragment shader
76
+ out vec2 vTexCoord;
77
+ out vec4 vColor;
78
+ out vec2 vPosition;
79
+ // flat values are not interpolated
80
+ flat out int vAtlasId;
81
+ flat out int vVertType;
82
+ flat out vec2 vTopRight;
83
+ flat out vec2 vBotLeft;
84
+ flat out vec4 vCornerRadius;
85
+ flat out vec4 vBorderColor;
86
+ flat out vec2 vBorderWidth;
87
+ flat out vec4 vIndex;
88
+
89
+ void main(void) {
90
+ int vid = gl_VertexID;
91
+ vec2 position = aPosition; // TODO make this a vec3, simplifies some code below
92
+
93
+ if(aVertType == `.concat($O,`) {
94
+ float texX = aTex.x; // texture coordinates
95
+ float texY = aTex.y;
96
+ float texW = aTex.z;
97
+ float texH = aTex.w;
98
+
99
+ if(vid == 1 || vid == 2 || vid == 4) {
100
+ texX += texW;
101
+ }
102
+ if(vid == 2 || vid == 4 || vid == 5) {
103
+ texY += texH;
104
+ }
105
+
106
+ float d = float(uAtlasSize);
107
+ vTexCoord = vec2(texX / d, texY / d); // tex coords must be between 0 and 1
108
+
109
+ gl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0);
110
+ }
111
+ else if(aVertType == `).concat(a1," || aVertType == ").concat($b,`
112
+ || aVertType == `).concat(T3," || aVertType == ").concat(Fb,`) { // simple shapes
113
+
114
+ // the bounding box is needed by the fragment shader
115
+ vBotLeft = (aTransform * vec3(0, 0, 1)).xy; // flat
116
+ vTopRight = (aTransform * vec3(1, 1, 1)).xy; // flat
117
+ vPosition = (aTransform * vec3(position, 1)).xy; // will be interpolated
118
+
119
+ // calculations are done in the fragment shader, just pass these along
120
+ vColor = aColor;
121
+ vCornerRadius = aCornerRadius;
122
+ vBorderColor = aBorderColor;
123
+ vBorderWidth = aLineWidth;
124
+
125
+ gl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0);
126
+ }
127
+ else if(aVertType == `).concat($0e,`) {
128
+ vec2 source = aPointAPointB.xy;
129
+ vec2 target = aPointAPointB.zw;
130
+
131
+ // adjust the geometry so that the line is centered on the edge
132
+ position.y = position.y - 0.5;
133
+
134
+ // stretch the unit square into a long skinny rectangle
135
+ vec2 xBasis = target - source;
136
+ vec2 yBasis = normalize(vec2(-xBasis.y, xBasis.x));
137
+ vec2 point = source + xBasis * position.x + yBasis * aLineWidth[0] * position.y;
138
+
139
+ gl_Position = vec4(uPanZoomMatrix * vec3(point, 1.0), 1.0);
140
+ vColor = aColor;
141
+ }
142
+ else if(aVertType == `).concat(z0e,`) {
143
+ vec2 pointA = aPointAPointB.xy;
144
+ vec2 pointB = aPointAPointB.zw;
145
+ vec2 pointC = aPointCPointD.xy;
146
+ vec2 pointD = aPointCPointD.zw;
147
+
148
+ // adjust the geometry so that the line is centered on the edge
149
+ position.y = position.y - 0.5;
150
+
151
+ vec2 p0, p1, p2, pos;
152
+ if(position.x == 0.0) { // The left side of the unit square
153
+ p0 = pointA;
154
+ p1 = pointB;
155
+ p2 = pointC;
156
+ pos = position;
157
+ } else { // The right side of the unit square, use same approach but flip the geometry upside down
158
+ p0 = pointD;
159
+ p1 = pointC;
160
+ p2 = pointB;
161
+ pos = vec2(0.0, -position.y);
162
+ }
163
+
164
+ vec2 p01 = p1 - p0;
165
+ vec2 p12 = p2 - p1;
166
+ vec2 p21 = p1 - p2;
167
+
168
+ // Find the normal vector.
169
+ vec2 tangent = normalize(normalize(p12) + normalize(p01));
170
+ vec2 normal = vec2(-tangent.y, tangent.x);
171
+
172
+ // Find the vector perpendicular to p0 -> p1.
173
+ vec2 p01Norm = normalize(vec2(-p01.y, p01.x));
174
+
175
+ // Determine the bend direction.
176
+ float sigma = sign(dot(p01 + p21, normal));
177
+ float width = aLineWidth[0];
178
+
179
+ if(sign(pos.y) == -sigma) {
180
+ // This is an intersecting vertex. Adjust the position so that there's no overlap.
181
+ vec2 point = 0.5 * width * normal * -sigma / dot(normal, p01Norm);
182
+ gl_Position = vec4(uPanZoomMatrix * vec3(p1 + point, 1.0), 1.0);
183
+ } else {
184
+ // This is a non-intersecting vertex. Treat it like a mitre join.
185
+ vec2 point = 0.5 * width * normal * sigma * dot(normal, p01Norm);
186
+ gl_Position = vec4(uPanZoomMatrix * vec3(p1 + point, 1.0), 1.0);
187
+ }
188
+
189
+ vColor = aColor;
190
+ }
191
+ else if(aVertType == `).concat(zO,` && vid < 3) {
192
+ // massage the first triangle into an edge arrow
193
+ if(vid == 0)
194
+ position = vec2(-0.15, -0.3);
195
+ if(vid == 1)
196
+ position = vec2( 0.0, 0.0);
197
+ if(vid == 2)
198
+ position = vec2( 0.15, -0.3);
199
+
200
+ gl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0);
201
+ vColor = aColor;
202
+ }
203
+ else {
204
+ gl_Position = vec4(2.0, 0.0, 0.0, 1.0); // discard vertex by putting it outside webgl clip space
205
+ }
206
+
207
+ vAtlasId = aAtlasId;
208
+ vVertType = aVertType;
209
+ vIndex = aIndex;
210
+ }
211
+ `),a=this.batchManager.getIndexArray(),s=`#version 300 es
212
+ precision highp float;
213
+
214
+ // declare texture unit for each texture atlas in the batch
215
+ `.concat(a.map(function(h){return"uniform sampler2D uTexture".concat(h,";")}).join(`
216
+ `),`
217
+
218
+ uniform vec4 uBGColor;
219
+ uniform float uZoom;
220
+
221
+ in vec2 vTexCoord;
222
+ in vec4 vColor;
223
+ in vec2 vPosition; // model coordinates
224
+
225
+ flat in int vAtlasId;
226
+ flat in vec4 vIndex;
227
+ flat in int vVertType;
228
+ flat in vec2 vTopRight;
229
+ flat in vec2 vBotLeft;
230
+ flat in vec4 vCornerRadius;
231
+ flat in vec4 vBorderColor;
232
+ flat in vec2 vBorderWidth;
233
+
234
+ out vec4 outColor;
235
+
236
+ `).concat(vot,`
237
+ `).concat(xot,`
238
+ `).concat(bot,`
239
+ `).concat(Tot,`
240
+
241
+ vec4 blend(vec4 top, vec4 bot) { // blend colors with premultiplied alpha
242
+ return vec4(
243
+ top.rgb + (bot.rgb * (1.0 - top.a)),
244
+ top.a + (bot.a * (1.0 - top.a))
245
+ );
246
+ }
247
+
248
+ vec4 distInterp(vec4 cA, vec4 cB, float d) { // interpolate color using Signed Distance
249
+ // scale to the zoom level so that borders don't look blurry when zoomed in
250
+ // note 1.5 is an aribitrary value chosen because it looks good
251
+ return mix(cA, cB, 1.0 - smoothstep(0.0, 1.5 / uZoom, abs(d)));
252
+ }
253
+
254
+ void main(void) {
255
+ if(vVertType == `).concat($O,`) {
256
+ // look up the texel from the texture unit
257
+ `).concat(a.map(function(h){return"if(vAtlasId == ".concat(h,") outColor = texture(uTexture").concat(h,", vTexCoord);")}).join(`
258
+ else `),`
259
+ }
260
+ else if(vVertType == `).concat(zO,`) {
261
+ // mimics how canvas renderer uses context.globalCompositeOperation = 'destination-out';
262
+ outColor = blend(vColor, uBGColor);
263
+ outColor.a = 1.0; // make opaque, masks out line under arrow
264
+ }
265
+ else if(vVertType == `).concat(a1,` && vBorderWidth == vec2(0.0)) { // simple rectangle with no border
266
+ outColor = vColor; // unit square is already transformed to the rectangle, nothing else needs to be done
267
+ }
268
+ else if(vVertType == `).concat(a1," || vVertType == ").concat($b,`
269
+ || vVertType == `).concat(T3," || vVertType == ").concat(Fb,`) { // use SDF
270
+
271
+ float outerBorder = vBorderWidth[0];
272
+ float innerBorder = vBorderWidth[1];
273
+ float borderPadding = outerBorder * 2.0;
274
+ float w = vTopRight.x - vBotLeft.x - borderPadding;
275
+ float h = vTopRight.y - vBotLeft.y - borderPadding;
276
+ vec2 b = vec2(w/2.0, h/2.0); // half width, half height
277
+ vec2 p = vPosition - vec2(vTopRight.x - b[0] - outerBorder, vTopRight.y - b[1] - outerBorder); // translate to center
278
+
279
+ float d; // signed distance
280
+ if(vVertType == `).concat(a1,`) {
281
+ d = rectangleSD(p, b);
282
+ } else if(vVertType == `).concat($b,` && w == h) {
283
+ d = circleSD(p, b.x); // faster than ellipse
284
+ } else if(vVertType == `).concat($b,`) {
285
+ d = ellipseSD(p, b);
286
+ } else {
287
+ d = roundRectangleSD(p, b, vCornerRadius.wzyx);
288
+ }
289
+
290
+ // use the distance to interpolate a color to smooth the edges of the shape, doesn't need multisampling
291
+ // we must smooth colors inwards, because we can't change pixels outside the shape's bounding box
292
+ if(d > 0.0) {
293
+ if(d > outerBorder) {
294
+ discard;
295
+ } else {
296
+ outColor = distInterp(vBorderColor, vec4(0), d - outerBorder);
297
+ }
298
+ } else {
299
+ if(d > innerBorder) {
300
+ vec4 outerColor = outerBorder == 0.0 ? vec4(0) : vBorderColor;
301
+ vec4 innerBorderColor = blend(vBorderColor, vColor);
302
+ outColor = distInterp(innerBorderColor, outerColor, d);
303
+ }
304
+ else {
305
+ vec4 outerColor;
306
+ if(innerBorder == 0.0 && outerBorder == 0.0) {
307
+ outerColor = vec4(0);
308
+ } else if(innerBorder == 0.0) {
309
+ outerColor = vBorderColor;
310
+ } else {
311
+ outerColor = blend(vBorderColor, vColor);
312
+ }
313
+ outColor = distInterp(vColor, outerColor, d - innerBorder);
314
+ }
315
+ }
316
+ }
317
+ else {
318
+ outColor = vColor;
319
+ }
320
+
321
+ `).concat(r.picking?`if(outColor.a == 0.0) discard;
322
+ else outColor = vIndex;`:"",`
323
+ }
324
+ `),l=Jst(i,n,s);l.aPosition=i.getAttribLocation(l,"aPosition"),l.aIndex=i.getAttribLocation(l,"aIndex"),l.aVertType=i.getAttribLocation(l,"aVertType"),l.aTransform=i.getAttribLocation(l,"aTransform"),l.aAtlasId=i.getAttribLocation(l,"aAtlasId"),l.aTex=i.getAttribLocation(l,"aTex"),l.aPointAPointB=i.getAttribLocation(l,"aPointAPointB"),l.aPointCPointD=i.getAttribLocation(l,"aPointCPointD"),l.aLineWidth=i.getAttribLocation(l,"aLineWidth"),l.aColor=i.getAttribLocation(l,"aColor"),l.aCornerRadius=i.getAttribLocation(l,"aCornerRadius"),l.aBorderColor=i.getAttribLocation(l,"aBorderColor"),l.uPanZoomMatrix=i.getUniformLocation(l,"uPanZoomMatrix"),l.uAtlasSize=i.getUniformLocation(l,"uAtlasSize"),l.uBGColor=i.getUniformLocation(l,"uBGColor"),l.uZoom=i.getUniformLocation(l,"uZoom"),l.uTextures=[];for(var u=0;u<this.batchManager.getMaxAtlasesPerBatch();u++)l.uTextures.push(i.getUniformLocation(l,"uTexture".concat(u)));return l},"_createShaderProgram")},{key:"_createVAO",value:o(function(){var r=[0,0,1,0,1,1,0,0,1,1,0,1];this.vertexCount=r.length/2;var i=this.maxInstances,n=this.gl,a=this.program,s=n.createVertexArray();return n.bindVertexArray(s),lot(n,"vec2",a.aPosition,r),this.transformBuffer=cot(n,i,a.aTransform),this.indexBuffer=Oc(n,i,"vec4",a.aIndex),this.vertTypeBuffer=Oc(n,i,"int",a.aVertType),this.atlasIdBuffer=Oc(n,i,"int",a.aAtlasId),this.texBuffer=Oc(n,i,"vec4",a.aTex),this.pointAPointBBuffer=Oc(n,i,"vec4",a.aPointAPointB),this.pointCPointDBuffer=Oc(n,i,"vec4",a.aPointCPointD),this.lineWidthBuffer=Oc(n,i,"vec2",a.aLineWidth),this.colorBuffer=Oc(n,i,"vec4",a.aColor),this.cornerRadiusBuffer=Oc(n,i,"vec4",a.aCornerRadius),this.borderColorBuffer=Oc(n,i,"vec4",a.aBorderColor),n.bindVertexArray(null),s},"_createVAO")},{key:"buffers",get:o(function(){var r=this;return this._buffers||(this._buffers=Object.keys(this).filter(function(i){return $d(i,"Buffer")}).map(function(i){return r[i]})),this._buffers},"get")},{key:"startFrame",value:o(function(r){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ub.SCREEN;this.panZoomMatrix=r,this.renderTarget=i,this.batchDebugInfo=[],this.wrappedCount=0,this.simpleCount=0,this.startBatch()},"startFrame")},{key:"startBatch",value:o(function(){this.instanceCount=0,this.batchManager.startBatch()},"startBatch")},{key:"endFrame",value:o(function(){this.endBatch()},"endFrame")},{key:"_isVisible",value:o(function(r,i){return r.visible()?i&&i.isVisible?i.isVisible(r):!0:!1},"_isVisible")},{key:"drawTexture",value:o(function(r,i,n){var a=this.atlasManager,s=this.batchManager,l=a.getRenderTypeOpts(n);if(this._isVisible(r,l)&&!(r.isEdge()&&!this._isValidEdge(r))){if(this.renderTarget.picking&&l.getTexPickingMode){var u=l.getTexPickingMode(r);if(u===U3.IGNORE)return;if(u==U3.USE_BB){this.drawPickingRectangle(r,i,n);return}}var h=a.getAtlasInfo(r,n),d=Fs(h),f;try{for(d.s();!(f=d.n()).done;){var p=f.value,m=p.atlas,g=p.tex1,y=p.tex2;s.canAddToCurrentBatch(m)||this.endBatch();for(var v=s.getAtlasIndexForBatch(m),x=0,b=[[g,!0],[y,!1]];x<b.length;x++){var T=Dn(b[x],2),w=T[0],C=T[1];if(w.w!=0){var k=this.instanceCount;this.vertTypeBuffer.getView(k)[0]=$O;var E=this.indexBuffer.getView(k);n1(i,E);var A=this.atlasIdBuffer.getView(k);A[0]=v;var N=this.texBuffer.getView(k);N[0]=w.x,N[1]=w.y,N[2]=w.w,N[3]=w.h;var P=this.transformBuffer.getMatrixView(k);this.setTransformMatrix(r,P,l,p,C),this.instanceCount++,C||this.wrappedCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}}}catch(I){d.e(I)}finally{d.f()}}},"drawTexture")},{key:"setTransformMatrix",value:o(function(r,i,n,a){var s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,l=0;if(n.shapeProps&&n.shapeProps.padding&&(l=r.pstyle(n.shapeProps.padding).pfValue),a){var u=a.bb,h=a.tex1,d=a.tex2,f=h.w/(h.w+d.w);s||(f=1-f);var p=this._getAdjustedBB(u,l,s,f);this._applyTransformMatrix(i,p,n,r)}else{var m=n.getBoundingBox(r),g=this._getAdjustedBB(m,l,!0,1);this._applyTransformMatrix(i,g,n,r)}},"setTransformMatrix")},{key:"_applyTransformMatrix",value:o(function(r,i,n,a){var s,l;B0e(r);var u=n.getRotation?n.getRotation(a):0;if(u!==0){var h=n.getRotationPoint(a),d=h.x,f=h.y;M3(r,r,[d,f]),F0e(r,r,u);var p=n.getRotationOffset(a);s=p.x+(i.xOffset||0),l=p.y+(i.yOffset||0)}else s=i.x1,l=i.y1;M3(r,r,[s,l]),sP(r,r,[i.w,i.h])},"_applyTransformMatrix")},{key:"_getAdjustedBB",value:o(function(r,i,n,a){var s=r.x1,l=r.y1,u=r.w,h=r.h,d=r.yOffset;i&&(s-=i,l-=i,u+=2*i,h+=2*i);var f=0,p=u*a;return n&&a<1?u=p:!n&&a<1&&(f=u-p,s+=f,u=p),{x1:s,y1:l,w:u,h,xOffset:f,yOffset:d}},"_getAdjustedBB")},{key:"drawPickingRectangle",value:o(function(r,i,n){var a=this.atlasManager.getRenderTypeOpts(n),s=this.instanceCount;this.vertTypeBuffer.getView(s)[0]=a1;var l=this.indexBuffer.getView(s);n1(i,l);var u=this.colorBuffer.getView(s);Hp([0,0,0],1,u);var h=this.transformBuffer.getMatrixView(s);this.setTransformMatrix(r,h,a),this.simpleCount++,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()},"drawPickingRectangle")},{key:"drawNode",value:o(function(r,i,n){var a=this.simpleShapeOptions.get(n);if(this._isVisible(r,a)){var s=a.shapeProps,l=this._getVertTypeForShape(r,s.shape);if(l===void 0||a.isSimple&&!a.isSimple(r)){this.drawTexture(r,i,n);return}var u=this.instanceCount;if(this.vertTypeBuffer.getView(u)[0]=l,l===T3||l===Fb){var h=a.getBoundingBox(r),d=this._getCornerRadius(r,s.radius,h),f=this.cornerRadiusBuffer.getView(u);f[0]=d,f[1]=d,f[2]=d,f[3]=d,l===Fb&&(f[0]=0,f[2]=0)}var p=this.indexBuffer.getView(u);n1(i,p);var m=r.pstyle(s.color).value,g=r.pstyle(s.opacity).value,y=this.colorBuffer.getView(u);Hp(m,g,y);var v=this.lineWidthBuffer.getView(u);if(v[0]=0,v[1]=0,s.border){var x=r.pstyle("border-width").value;if(x>0){var b=r.pstyle("border-color").value,T=r.pstyle("border-opacity").value,w=this.borderColorBuffer.getView(u);Hp(b,T,w);var C=r.pstyle("border-position").value;if(C==="inside")v[0]=0,v[1]=-x;else if(C==="outside")v[0]=x,v[1]=0;else{var k=x/2;v[0]=k,v[1]=-k}}}var E=this.transformBuffer.getMatrixView(u);this.setTransformMatrix(r,E,a),this.simpleCount++,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}},"drawNode")},{key:"_getVertTypeForShape",value:o(function(r,i){var n=r.pstyle(i).value;switch(n){case"rectangle":return a1;case"ellipse":return $b;case"roundrectangle":case"round-rectangle":return T3;case"bottom-round-rectangle":return Fb;default:return}},"_getVertTypeForShape")},{key:"_getCornerRadius",value:o(function(r,i,n){var a=n.w,s=n.h;if(r.pstyle(i).value==="auto")return Hd(a,s);var l=r.pstyle(i).pfValue,u=a/2,h=s/2;return Math.min(l,h,u)},"_getCornerRadius")},{key:"drawEdgeArrow",value:o(function(r,i,n){if(r.visible()){var a=r._private.rscratch,s,l,u;if(n==="source"?(s=a.arrowStartX,l=a.arrowStartY,u=a.srcArrowAngle):(s=a.arrowEndX,l=a.arrowEndY,u=a.tgtArrowAngle),!(isNaN(s)||s==null||isNaN(l)||l==null||isNaN(u)||u==null)){var h=r.pstyle(n+"-arrow-shape").value;if(h!=="none"){var d=r.pstyle(n+"-arrow-color").value,f=r.pstyle("opacity").value,p=r.pstyle("line-opacity").value,m=f*p,g=r.pstyle("width").pfValue,y=r.pstyle("arrow-scale").value,v=this.r.getArrowWidth(g,y),x=this.instanceCount,b=this.transformBuffer.getMatrixView(x);B0e(b),M3(b,b,[s,l]),sP(b,b,[v,v]),F0e(b,b,u),this.vertTypeBuffer.getView(x)[0]=zO;var T=this.indexBuffer.getView(x);n1(i,T);var w=this.colorBuffer.getView