@abi-software/map-side-bar 2.4.2-beta.14 → 2.4.2-beta.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/map-side-bar.js
CHANGED
|
@@ -45346,7 +45346,9 @@ const sde = [
|
|
|
45346
45346
|
selector: "node[axon]",
|
|
45347
45347
|
style: {
|
|
45348
45348
|
// 'background-color': 'green',
|
|
45349
|
-
shape: "round-diamond"
|
|
45349
|
+
shape: "round-diamond",
|
|
45350
|
+
width: "100px",
|
|
45351
|
+
height: "100px"
|
|
45350
45352
|
}
|
|
45351
45353
|
},
|
|
45352
45354
|
{
|
|
@@ -45431,7 +45433,7 @@ class cde extends EventTarget {
|
|
|
45431
45433
|
this.addEventListener(t, n);
|
|
45432
45434
|
}
|
|
45433
45435
|
}
|
|
45434
|
-
const dde = 1.3, pde = 24 * 60 * 60 * 1e3, fde = "Reset position", hk = "Lock zoom
|
|
45436
|
+
const dde = 1.3, pde = 24 * 60 * 60 * 1e3, fde = "Reset position", hk = "Lock zoom", hde = "Unlock zoom", vde = "Zoom in", gde = "Zoom out", vk = 0.25, mde = "#8300bf", yde = {
|
|
45435
45437
|
name: "ConnectivityGraph",
|
|
45436
45438
|
props: {
|
|
45437
45439
|
/**
|
|
@@ -45633,7 +45635,7 @@ const dde = 1.3, pde = 24 * 60 * 60 * 1e3, fde = "Reset position", hk = "Lock zo
|
|
|
45633
45635
|
}, bde = { class: "connectivity-graph" }, wde = {
|
|
45634
45636
|
ref: "graphCanvas",
|
|
45635
45637
|
class: "graph-canvas"
|
|
45636
|
-
}, xde = { class: "control-panel control-panel-tools" }, kde = { class: "visually-hidden" }, Cde = { class: "visually-hidden" }, Sde = { class: "visually-hidden" }, Ede = { class: "visually-hidden" }, _de = /* @__PURE__ */ iO('<div class="control-panel control-panel-nodes" data-v-
|
|
45638
|
+
}, xde = { class: "control-panel control-panel-tools" }, kde = { class: "visually-hidden" }, Cde = { class: "visually-hidden" }, Sde = { class: "visually-hidden" }, Ede = { class: "visually-hidden" }, _de = /* @__PURE__ */ iO('<div class="control-panel control-panel-nodes" data-v-aead960f><div class="node-key" data-v-aead960f><div class="key-box-container" data-v-aead960f><div class="key-box key-box-dendrite" data-v-aead960f> Origin </div><div class="key-box key-box-node" data-v-aead960f> Components </div><div class="key-box key-box-axon" data-v-aead960f> Destination </div></div></div></div>', 1), Ode = {
|
|
45637
45639
|
key: 0,
|
|
45638
45640
|
class: "connectivity-graph-error"
|
|
45639
45641
|
};
|
|
@@ -45753,7 +45755,7 @@ function Tde(e, t, n, r, o, a) {
|
|
|
45753
45755
|
[p, e.loading]
|
|
45754
45756
|
]);
|
|
45755
45757
|
}
|
|
45756
|
-
const $de = /* @__PURE__ */ IE(yde, [["render", Tde], ["__scopeId", "data-v-
|
|
45758
|
+
const $de = /* @__PURE__ */ IE(yde, [["render", Tde], ["__scopeId", "data-v-aead960f"]]), Ade = {
|
|
45757
45759
|
data() {
|
|
45758
45760
|
return {
|
|
45759
45761
|
ElIconView: sC
|
|
@@ -49018,7 +49020,7 @@ const H8 = /* @__PURE__ */ oa(Ope, [["render", $pe], ["__scopeId", "data-v-e726c
|
|
|
49018
49020
|
t && t.showErrorMessage(e);
|
|
49019
49021
|
});
|
|
49020
49022
|
}
|
|
49021
|
-
}, As = (e) => (Fl("data-v-
|
|
49023
|
+
}, As = (e) => (Fl("data-v-35f7078a"), e = e(), Pl(), e), Ppe = {
|
|
49022
49024
|
key: 0,
|
|
49023
49025
|
class: "main"
|
|
49024
49026
|
}, Ipe = { class: "connectivity-info-title" }, Npe = {
|
|
@@ -49295,7 +49297,7 @@ function pfe(e, t, n, r, o, a) {
|
|
|
49295
49297
|
[v, e.loading]
|
|
49296
49298
|
]) : oe("", !0);
|
|
49297
49299
|
}
|
|
49298
|
-
const U8 = /* @__PURE__ */ oa(Fpe, [["render", pfe], ["__scopeId", "data-v-
|
|
49300
|
+
const U8 = /* @__PURE__ */ oa(Fpe, [["render", pfe], ["__scopeId", "data-v-35f7078a"]]), ffe = {
|
|
49299
49301
|
name: "Tabs",
|
|
49300
49302
|
props: {
|
|
49301
49303
|
tabTitles: {
|
|
@@ -491,16 +491,16 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
|
|
|
491
491
|
`),f=e.pstyle("text-max-width").pfValue,h=e.pstyle("text-overflow-wrap").value,m=h==="anywhere",p=[],g=/[\s\u200b]+|$/g,v=0;v<d.length;v++){var y=d[v],b=this.calculateLabelDimensions(e,y),x=b.width;if(m){var w=y.split("").join(c);y=w}if(x>f){var C=y.matchAll(g),k="",E=0,S=zS(C),_;try{for(S.s();!(_=S.n()).done;){var O=_.value,T=O[0],N=y.substring(E,O.index);E=O.index+T.length;var A=k.length===0?N:k+N+T,F=this.calculateLabelDimensions(e,A),D=F.width;D<=f?k+=N+T:(k&&p.push(k),k=N+T)}}catch(Y){S.e(Y)}finally{S.f()}k.match(/^[\s\u200b]+$/)||p.push(k)}else p.push(y)}s("labelWrapCachedLines",p),a=s("labelWrapCachedText",p.join(`
|
|
492
492
|
`)),s("labelWrapKey",u)}else if(l==="ellipsis"){var $=e.pstyle("text-max-width").pfValue,L="",I="…",z=!1;if(this.calculateLabelDimensions(e,a).width<$)return a;for(var G=0;G<a.length;G++){var q=this.calculateLabelDimensions(e,L+a[G]+I).width;if(q>$)break;L+=a[G],G===a.length-1&&(z=!0)}return z||(L+=I),L}return a},wo.getLabelJustification=function(e){var t=e.pstyle("text-justification").strValue,n=e.pstyle("text-halign").strValue;if(t==="auto")if(e.isNode())switch(n){case"left":return"right";case"right":return"left";default:return"center"}else return"center";else return t},wo.calculateLabelDimensions=function(e,t){var n=this,r=n.cy.window(),a=r.document,i=_i(t,e._private.labelDimsKey),s=n.labelDimCache||(n.labelDimCache=[]),l=s[i];if(l!=null)return l;var u=0,c=e.pstyle("font-style").strValue,d=e.pstyle("font-size").pfValue,f=e.pstyle("font-family").strValue,h=e.pstyle("font-weight").strValue,m=this.labelCalcCanvas,p=this.labelCalcCanvasContext;if(!m){m=this.labelCalcCanvas=a.createElement("canvas"),p=this.labelCalcCanvasContext=m.getContext("2d");var g=m.style;g.position="absolute",g.left="-9999px",g.top="-9999px",g.zIndex="-1",g.visibility="hidden",g.pointerEvents="none"}p.font="".concat(c," ").concat(h," ").concat(d,"px ").concat(f);for(var v=0,y=0,b=t.split(`
|
|
493
493
|
`),x=0;x<b.length;x++){var w=b[x],C=p.measureText(w),k=Math.ceil(C.width),E=d;v=Math.max(k,v),y+=E}return v+=u,y+=u,s[i]={width:v,height:y}},wo.calculateLabelAngle=function(e,t){var n=e._private,r=n.rscratch,a=e.isEdge(),i=t?t+"-":"",s=e.pstyle(i+"text-rotation"),l=s.strValue;return l==="none"?0:a&&l==="autorotate"?r.labelAutoAngle:l==="autorotate"?0:s.pfValue},wo.calculateLabelAngles=function(e){var t=this,n=e.isEdge(),r=e._private,a=r.rscratch;a.labelAngle=t.calculateLabelAngle(e),n&&(a.sourceLabelAngle=t.calculateLabelAngle(e,"source"),a.targetLabelAngle=t.calculateLabelAngle(e,"target"))};var s_={},l_=28,c_=!1;s_.getNodeShape=function(e){var t=this,n=e.pstyle("shape").value;if(n==="cutrectangle"&&(e.width()<l_||e.height()<l_))return c_||(ut("The `cutrectangle` node shape can not be used at small sizes so `rectangle` is used instead"),c_=!0),"rectangle";if(e.isParent())return n==="rectangle"||n==="roundrectangle"||n==="round-rectangle"||n==="cutrectangle"||n==="cut-rectangle"||n==="barrel"?n:"rectangle";if(n==="polygon"){var r=e.pstyle("shape-polygon-points").value;return t.nodeShapes.makePolygon(r).name}return n};var vp={};vp.registerCalculationListeners=function(){var e=this.cy,t=e.collection(),n=this,r=function(i){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(t.merge(i),s)for(var l=0;l<i.length;l++){var u=i[l],c=u._private,d=c.rstyle;d.clean=!1,d.cleanConnected=!1}};n.binder(e).on("bounds.* dirty.*",function(i){var s=i.target;r(s)}).on("style.* background.*",function(i){var s=i.target;r(s,!1)});var a=function(i){if(i){var s=n.onUpdateEleCalcsFns;t.cleanStyle();for(var l=0;l<t.length;l++){var u=t[l],c=u._private.rstyle;u.isNode()&&!c.cleanConnected&&(r(u.connectedEdges()),c.cleanConnected=!0)}if(s)for(var d=0;d<s.length;d++){var f=s[d];f(i,t)}n.recalculateRenderedStyle(t),t=e.collection()}};n.flushRenderedStyleQueue=function(){a(!0)},n.beforeRender(a,n.beforeRenderPriorities.eleCalcs)},vp.onUpdateEleCalcs=function(e){var t=this.onUpdateEleCalcsFns=this.onUpdateEleCalcsFns||[];t.push(e)},vp.recalculateRenderedStyle=function(e,t){var n=function(x){return x._private.rstyle.cleanConnected},r=[],a=[];if(!this.destroyed){t===void 0&&(t=!0);for(var i=0;i<e.length;i++){var s=e[i],l=s._private,u=l.rstyle;s.isEdge()&&(!n(s.source())||!n(s.target()))&&(u.clean=!1),!(t&&u.clean||s.removed())&&s.pstyle("display").value!=="none"&&(l.group==="nodes"?a.push(s):r.push(s),u.clean=!0)}for(var c=0;c<a.length;c++){var d=a[c],f=d._private,h=f.rstyle,m=d.position();this.recalculateNodeLabelProjection(d),h.nodeX=m.x,h.nodeY=m.y,h.nodeW=d.pstyle("width").pfValue,h.nodeH=d.pstyle("height").pfValue}this.recalculateEdgeProjections(r);for(var p=0;p<r.length;p++){var g=r[p],v=g._private,y=v.rstyle,b=v.rscratch;y.srcX=b.arrowStartX,y.srcY=b.arrowStartY,y.tgtX=b.arrowEndX,y.tgtY=b.arrowEndY,y.midX=b.midX,y.midY=b.midY,y.labelAngle=b.labelAngle,y.sourceLabelAngle=b.sourceLabelAngle,y.targetLabelAngle=b.targetLabelAngle}}};var bp={};bp.updateCachedGrabbedEles=function(){var e=this.cachedZSortedEles;if(e){e.drag=[],e.nondrag=[];for(var t=[],n=0;n<e.length;n++){var r=e[n],a=r._private.rscratch;r.grabbed()&&!r.isParent()?t.push(r):a.inDragLayer?e.drag.push(r):e.nondrag.push(r)}for(var n=0;n<t.length;n++){var r=t[n];e.drag.push(r)}}},bp.invalidateCachedZSortedEles=function(){this.cachedZSortedEles=null},bp.getCachedZSortedEles=function(e){if(e||!this.cachedZSortedEles){var t=this.cy.mutableElements().toArray();t.sort(S3),t.interactive=t.filter(function(n){return n.interactive()}),this.cachedZSortedEles=t,this.updateCachedGrabbedEles()}else t=this.cachedZSortedEles;return t};var u_={};[Pi,mp,On,au,sy,wo,s_,vp,bp].forEach(function(e){He(u_,e)});var d_={};d_.getCachedImage=function(e,t,n){var r=this,a=r.imageCache=r.imageCache||{},i=a[e];if(i)return i.image.complete||i.image.addEventListener("load",n),i.image;i=a[e]=a[e]||{};var s=i.image=new Image;s.addEventListener("load",n),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};var ol={};ol.registerBinding=function(e,t,n,r){var a=Array.prototype.slice.apply(arguments,[1]),i=this.binder(e);return i.on.apply(i,a)},ol.binder=function(e){var t=this,n=t.cy.window(),r=e===n||e===n.document||e===n.document.body||Ute(e);if(t.supportsPassiveEvents==null){var a=!1;try{var i=Object.defineProperty({},"passive",{get:function(){return a=!0,!0}});n.addEventListener("test",null,i)}catch{}t.supportsPassiveEvents=a}var s=function(l,u,c){var d=Array.prototype.slice.call(arguments);return r&&t.supportsPassiveEvents&&(d[2]={capture:c??!1,passive:!1,once:!1}),t.bindings.push({target:e,args:d}),(e.addEventListener||e.on).apply(e,d),this};return{on:s,addEventListener:s,addListener:s,bind:s}},ol.nodeIsDraggable=function(e){return e&&e.isNode()&&!e.locked()&&e.grabbable()},ol.nodeIsGrabbable=function(e){return this.nodeIsDraggable(e)&&e.interactive()},ol.load=function(){var e=this,t=e.cy.window(),n=function(B){return B.selected()},r=function(B,V,X,Q){B==null&&(B=e.cy);for(var ee=0;ee<V.length;ee++){var he=V[ee];B.emit({originalEvent:X,type:he,position:Q})}},a=function(B){return B.shiftKey||B.metaKey||B.ctrlKey},i=function(B,V){var X=!0;if(e.cy.hasCompoundNodes()&&B&&B.pannable())for(var Q=0;V&&Q<V.length;Q++){var B=V[Q];if(B.isNode()&&B.isParent()&&!B.pannable()){X=!1;break}}else X=!0;return X},s=function(B){B[0]._private.grabbed=!0},l=function(B){B[0]._private.grabbed=!1},u=function(B){B[0]._private.rscratch.inDragLayer=!0},c=function(B){B[0]._private.rscratch.inDragLayer=!1},d=function(B){B[0]._private.rscratch.isGrabTarget=!0},f=function(B){B[0]._private.rscratch.isGrabTarget=!1},h=function(B,V){var X=V.addToList,Q=X.has(B);!Q&&B.grabbable()&&!B.locked()&&(X.merge(B),s(B))},m=function(B,V){if(B.cy().hasCompoundNodes()&&!(V.inDragLayer==null&&V.addToList==null)){var X=B.descendants();V.inDragLayer&&(X.forEach(u),X.connectedEdges().forEach(u)),V.addToList&&h(X,V)}},p=function(B,V){V=V||{};var X=B.cy().hasCompoundNodes();V.inDragLayer&&(B.forEach(u),B.neighborhood().stdFilter(function(Q){return!X||Q.isEdge()}).forEach(u)),V.addToList&&B.forEach(function(Q){h(Q,V)}),m(B,V),y(B,{inDragLayer:V.inDragLayer}),e.updateCachedGrabbedEles()},g=p,v=function(B){B&&(e.getCachedZSortedEles().forEach(function(V){l(V),c(V),f(V)}),e.updateCachedGrabbedEles())},y=function(B,V){if(!(V.inDragLayer==null&&V.addToList==null)&&B.cy().hasCompoundNodes()){var X=B.ancestors().orphans();if(!X.same(B)){var Q=X.descendants().spawnSelf().merge(X).unmerge(B).unmerge(B.descendants()),ee=Q.connectedEdges();V.inDragLayer&&(ee.forEach(u),Q.forEach(u)),V.addToList&&Q.forEach(function(he){h(he,V)})}}},b=function(){document.activeElement!=null&&document.activeElement.blur!=null&&document.activeElement.blur()},x=typeof MutationObserver<"u",w=typeof ResizeObserver<"u";x?(e.removeObserver=new MutationObserver(function(B){for(var V=0;V<B.length;V++){var X=B[V],Q=X.removedNodes;if(Q)for(var ee=0;ee<Q.length;ee++){var he=Q[ee];if(he===e.container){e.destroy();break}}}}),e.container.parentNode&&e.removeObserver.observe(e.container.parentNode,{childList:!0})):e.registerBinding(e.container,"DOMNodeRemoved",function(B){e.destroy()});var C=Of(function(){e.cy.resize()},100);x&&(e.styleObserver=new MutationObserver(C),e.styleObserver.observe(e.container,{attributes:!0})),e.registerBinding(t,"resize",C),w&&(e.resizeObserver=new ResizeObserver(C),e.resizeObserver.observe(e.container));var k=function(B,V){for(;B!=null;)V(B),B=B.parentNode},E=function(){e.invalidateContainerClientCoordsCache()};k(e.container,function(B){e.registerBinding(B,"transitionend",E),e.registerBinding(B,"animationend",E),e.registerBinding(B,"scroll",E)}),e.registerBinding(e.container,"contextmenu",function(B){B.preventDefault()});var S=function(){return e.selection[4]!==0},_=function(B){for(var V=e.findContainerClientCoords(),X=V[0],Q=V[1],ee=V[2],he=V[3],ae=B.touches?B.touches:[B],ye=!1,Ae=0;Ae<ae.length;Ae++){var Ie=ae[Ae];if(X<=Ie.clientX&&Ie.clientX<=X+ee&&Q<=Ie.clientY&&Ie.clientY<=Q+he){ye=!0;break}}if(!ye)return!1;for(var W=e.container,fe=B.target,ie=fe.parentNode,we=!1;ie;){if(ie===W){we=!0;break}ie=ie.parentNode}return!!we};e.registerBinding(e.container,"mousedown",function(B){if(_(B)&&!(e.hoverData.which===1&&B.which!==1)){B.preventDefault(),b(),e.hoverData.capture=!0,e.hoverData.which=B.which;var V=e.cy,X=[B.clientX,B.clientY],Q=e.projectIntoViewport(X[0],X[1]),ee=e.selection,he=e.findNearestElements(Q[0],Q[1],!0,!1),ae=he[0],ye=e.dragData.possibleDragElements;e.hoverData.mdownPos=Q,e.hoverData.mdownGPos=X;var Ae=function(){e.hoverData.tapholdCancelled=!1,clearTimeout(e.hoverData.tapholdTimeout),e.hoverData.tapholdTimeout=setTimeout(function(){if(!e.hoverData.tapholdCancelled){var we=e.hoverData.down;we?we.emit({originalEvent:B,type:"taphold",position:{x:Q[0],y:Q[1]}}):V.emit({originalEvent:B,type:"taphold",position:{x:Q[0],y:Q[1]}})}},e.tapholdDuration)};if(B.which==3){e.hoverData.cxtStarted=!0;var Ie={originalEvent:B,type:"cxttapstart",position:{x:Q[0],y:Q[1]}};ae?(ae.activate(),ae.emit(Ie),e.hoverData.down=ae):V.emit(Ie),e.hoverData.downTime=new Date().getTime(),e.hoverData.cxtDragged=!1}else if(B.which==1){ae&&ae.activate();{if(ae!=null&&e.nodeIsGrabbable(ae)){var W=function(we){return{originalEvent:B,type:we,position:{x:Q[0],y:Q[1]}}},fe=function(we){we.emit(W("grab"))};if(d(ae),!ae.selected())ye=e.dragData.possibleDragElements=V.collection(),g(ae,{addToList:ye}),ae.emit(W("grabon")).emit(W("grab"));else{ye=e.dragData.possibleDragElements=V.collection();var ie=V.$(function(we){return we.isNode()&&we.selected()&&e.nodeIsGrabbable(we)});p(ie,{addToList:ye}),ae.emit(W("grabon")),ie.forEach(fe)}e.redrawHint("eles",!0),e.redrawHint("drag",!0)}e.hoverData.down=ae,e.hoverData.downs=he,e.hoverData.downTime=new Date().getTime()}r(ae,["mousedown","tapstart","vmousedown"],B,{x:Q[0],y:Q[1]}),ae==null?(ee[4]=1,e.data.bgActivePosistion={x:Q[0],y:Q[1]},e.redrawHint("select",!0),e.redraw()):ae.pannable()&&(ee[4]=1),Ae()}ee[0]=ee[2]=Q[0],ee[1]=ee[3]=Q[1]}},!1),e.registerBinding(t,"mousemove",function(B){var V=e.hoverData.capture;if(!(!V&&!_(B))){var X=!1,Q=e.cy,ee=Q.zoom(),he=[B.clientX,B.clientY],ae=e.projectIntoViewport(he[0],he[1]),ye=e.hoverData.mdownPos,Ae=e.hoverData.mdownGPos,Ie=e.selection,W=null;!e.hoverData.draggingEles&&!e.hoverData.dragging&&!e.hoverData.selecting&&(W=e.findNearestElement(ae[0],ae[1],!0,!1));var fe=e.hoverData.last,ie=e.hoverData.down,we=[ae[0]-Ie[2],ae[1]-Ie[3]],nt=e.dragData.possibleDragElements,Qe;if(Ae){var lt=he[0]-Ae[0],ft=lt*lt,gt=he[1]-Ae[1],Kt=gt*gt,Tt=ft+Kt;e.hoverData.isOverThresholdDrag=Qe=Tt>=e.desktopTapThreshold2}var Nt=a(B);Qe&&(e.hoverData.tapholdCancelled=!0);var Wt=function(){var Fn=e.hoverData.dragDelta=e.hoverData.dragDelta||[];Fn.length===0?(Fn.push(we[0]),Fn.push(we[1])):(Fn[0]+=we[0],Fn[1]+=we[1])};X=!0,r(W,["mousemove","vmousemove","tapdrag"],B,{x:ae[0],y:ae[1]});var Gt=function(){e.data.bgActivePosistion=void 0,e.hoverData.selecting||Q.emit({originalEvent:B,type:"boxstart",position:{x:ae[0],y:ae[1]}}),Ie[4]=1,e.hoverData.selecting=!0,e.redrawHint("select",!0),e.redraw()};if(e.hoverData.which===3){if(Qe){var Rt={originalEvent:B,type:"cxtdrag",position:{x:ae[0],y:ae[1]}};ie?ie.emit(Rt):Q.emit(Rt),e.hoverData.cxtDragged=!0,(!e.hoverData.cxtOver||W!==e.hoverData.cxtOver)&&(e.hoverData.cxtOver&&e.hoverData.cxtOver.emit({originalEvent:B,type:"cxtdragout",position:{x:ae[0],y:ae[1]}}),e.hoverData.cxtOver=W,W&&W.emit({originalEvent:B,type:"cxtdragover",position:{x:ae[0],y:ae[1]}}))}}else if(e.hoverData.dragging){if(X=!0,Q.panningEnabled()&&Q.userPanningEnabled()){var $n;if(e.hoverData.justStartedPan){var xn=e.hoverData.mdownPos;$n={x:(ae[0]-xn[0])*ee,y:(ae[1]-xn[1])*ee},e.hoverData.justStartedPan=!1}else $n={x:we[0]*ee,y:we[1]*ee};Q.panBy($n),Q.emit("dragpan"),e.hoverData.dragged=!0}ae=e.projectIntoViewport(B.clientX,B.clientY)}else if(Ie[4]==1&&(ie==null||ie.pannable())){if(Qe){if(!e.hoverData.dragging&&Q.boxSelectionEnabled()&&(Nt||!Q.panningEnabled()||!Q.userPanningEnabled()))Gt();else if(!e.hoverData.selecting&&Q.panningEnabled()&&Q.userPanningEnabled()){var kn=i(ie,e.hoverData.downs);kn&&(e.hoverData.dragging=!0,e.hoverData.justStartedPan=!0,Ie[4]=0,e.data.bgActivePosistion=Vs(ye),e.redrawHint("select",!0),e.redraw())}ie&&ie.pannable()&&ie.active()&&ie.unactivate()}}else{if(ie&&ie.pannable()&&ie.active()&&ie.unactivate(),(!ie||!ie.grabbed())&&W!=fe&&(fe&&r(fe,["mouseout","tapdragout"],B,{x:ae[0],y:ae[1]}),W&&r(W,["mouseover","tapdragover"],B,{x:ae[0],y:ae[1]}),e.hoverData.last=W),ie)if(Qe){if(Q.boxSelectionEnabled()&&Nt)ie&&ie.grabbed()&&(v(nt),ie.emit("freeon"),nt.emit("free"),e.dragData.didDrag&&(ie.emit("dragfreeon"),nt.emit("dragfree"))),Gt();else if(ie&&ie.grabbed()&&e.nodeIsDraggable(ie)){var yt=!e.dragData.didDrag;yt&&e.redrawHint("eles",!0),e.dragData.didDrag=!0,e.hoverData.draggingEles||p(nt,{inDragLayer:!0});var Ot={x:0,y:0};if(Ee(we[0])&&Ee(we[1])&&(Ot.x+=we[0],Ot.y+=we[1],yt)){var Lt=e.hoverData.dragDelta;Lt&&Ee(Lt[0])&&Ee(Lt[1])&&(Ot.x+=Lt[0],Ot.y+=Lt[1])}e.hoverData.draggingEles=!0,nt.silentShift(Ot).emit("position drag"),e.redrawHint("drag",!0),e.redraw()}}else Wt();X=!0}if(Ie[2]=ae[0],Ie[3]=ae[1],X)return B.stopPropagation&&B.stopPropagation(),B.preventDefault&&B.preventDefault(),!1}},!1);var O,T,N;e.registerBinding(t,"mouseup",function(B){if(!(e.hoverData.which===1&&B.which!==1&&e.hoverData.capture)){var V=e.hoverData.capture;if(V){e.hoverData.capture=!1;var X=e.cy,Q=e.projectIntoViewport(B.clientX,B.clientY),ee=e.selection,he=e.findNearestElement(Q[0],Q[1],!0,!1),ae=e.dragData.possibleDragElements,ye=e.hoverData.down,Ae=a(B);if(e.data.bgActivePosistion&&(e.redrawHint("select",!0),e.redraw()),e.hoverData.tapholdCancelled=!0,e.data.bgActivePosistion=void 0,ye&&ye.unactivate(),e.hoverData.which===3){var Ie={originalEvent:B,type:"cxttapend",position:{x:Q[0],y:Q[1]}};if(ye?ye.emit(Ie):X.emit(Ie),!e.hoverData.cxtDragged){var W={originalEvent:B,type:"cxttap",position:{x:Q[0],y:Q[1]}};ye?ye.emit(W):X.emit(W)}e.hoverData.cxtDragged=!1,e.hoverData.which=null}else if(e.hoverData.which===1){if(r(he,["mouseup","tapend","vmouseup"],B,{x:Q[0],y:Q[1]}),!e.dragData.didDrag&&!e.hoverData.dragged&&!e.hoverData.selecting&&!e.hoverData.isOverThresholdDrag&&(r(ye,["click","tap","vclick"],B,{x:Q[0],y:Q[1]}),T=!1,B.timeStamp-N<=X.multiClickDebounceTime()?(O&&clearTimeout(O),T=!0,N=null,r(ye,["dblclick","dbltap","vdblclick"],B,{x:Q[0],y:Q[1]})):(O=setTimeout(function(){T||r(ye,["oneclick","onetap","voneclick"],B,{x:Q[0],y:Q[1]})},X.multiClickDebounceTime()),N=B.timeStamp)),ye==null&&!e.dragData.didDrag&&!e.hoverData.selecting&&!e.hoverData.dragged&&!a(B)&&(X.$(n).unselect(["tapunselect"]),ae.length>0&&e.redrawHint("eles",!0),e.dragData.possibleDragElements=ae=X.collection()),he==ye&&!e.dragData.didDrag&&!e.hoverData.selecting&&he!=null&&he._private.selectable&&(e.hoverData.dragging||(X.selectionType()==="additive"||Ae?he.selected()?he.unselect(["tapunselect"]):he.select(["tapselect"]):Ae||(X.$(n).unmerge(he).unselect(["tapunselect"]),he.select(["tapselect"]))),e.redrawHint("eles",!0)),e.hoverData.selecting){var fe=X.collection(e.getAllInBox(ee[0],ee[1],ee[2],ee[3]));e.redrawHint("select",!0),fe.length>0&&e.redrawHint("eles",!0),X.emit({type:"boxend",originalEvent:B,position:{x:Q[0],y:Q[1]}});var ie=function(nt){return nt.selectable()&&!nt.selected()};X.selectionType()==="additive"||Ae||X.$(n).unmerge(fe).unselect(),fe.emit("box").stdFilter(ie).select().emit("boxselect"),e.redraw()}if(e.hoverData.dragging&&(e.hoverData.dragging=!1,e.redrawHint("select",!0),e.redrawHint("eles",!0),e.redraw()),!ee[4]){e.redrawHint("drag",!0),e.redrawHint("eles",!0);var we=ye&&ye.grabbed();v(ae),we&&(ye.emit("freeon"),ae.emit("free"),e.dragData.didDrag&&(ye.emit("dragfreeon"),ae.emit("dragfree")))}}ee[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}}},!1);var A=function(B){if(!e.scrollingPage){var V=e.cy,X=V.zoom(),Q=V.pan(),ee=e.projectIntoViewport(B.clientX,B.clientY),he=[ee[0]*X+Q.x,ee[1]*X+Q.y];if(e.hoverData.draggingEles||e.hoverData.dragging||e.hoverData.cxtStarted||S()){B.preventDefault();return}if(V.panningEnabled()&&V.userPanningEnabled()&&V.zoomingEnabled()&&V.userZoomingEnabled()){B.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 ae;B.deltaY!=null?ae=B.deltaY/-250:B.wheelDeltaY!=null?ae=B.wheelDeltaY/1e3:ae=B.wheelDelta/1e3,ae=ae*e.wheelSensitivity;var ye=B.deltaMode===1;ye&&(ae*=33);var Ae=V.zoom()*Math.pow(10,ae);B.type==="gesturechange"&&(Ae=e.gestureStartZoom*B.scale),V.zoom({level:Ae,renderedPosition:{x:he[0],y:he[1]}}),V.emit(B.type==="gesturechange"?"pinchzoom":"scrollzoom")}}};e.registerBinding(e.container,"wheel",A,!0),e.registerBinding(t,"scroll",function(B){e.scrollingPage=!0,clearTimeout(e.scrollingPageTimeout),e.scrollingPageTimeout=setTimeout(function(){e.scrollingPage=!1},250)},!0),e.registerBinding(e.container,"gesturestart",function(B){e.gestureStartZoom=e.cy.zoom(),e.hasTouchStarted||B.preventDefault()},!0),e.registerBinding(e.container,"gesturechange",function(B){e.hasTouchStarted||A(B)},!0),e.registerBinding(e.container,"mouseout",function(B){var V=e.projectIntoViewport(B.clientX,B.clientY);e.cy.emit({originalEvent:B,type:"mouseout",position:{x:V[0],y:V[1]}})},!1),e.registerBinding(e.container,"mouseover",function(B){var V=e.projectIntoViewport(B.clientX,B.clientY);e.cy.emit({originalEvent:B,type:"mouseover",position:{x:V[0],y:V[1]}})},!1);var F,D,$,L,I,z,G,q,Y,te,le,ue,ne,oe=function(B,V,X,Q){return Math.sqrt((X-B)*(X-B)+(Q-V)*(Q-V))},U=function(B,V,X,Q){return(X-B)*(X-B)+(Q-V)*(Q-V)},K;e.registerBinding(e.container,"touchstart",K=function(B){if(e.hasTouchStarted=!0,!!_(B)){b(),e.touchData.capture=!0,e.data.bgActivePosistion=void 0;var V=e.cy,X=e.touchData.now,Q=e.touchData.earlier;if(B.touches[0]){var ee=e.projectIntoViewport(B.touches[0].clientX,B.touches[0].clientY);X[0]=ee[0],X[1]=ee[1]}if(B.touches[1]){var ee=e.projectIntoViewport(B.touches[1].clientX,B.touches[1].clientY);X[2]=ee[0],X[3]=ee[1]}if(B.touches[2]){var ee=e.projectIntoViewport(B.touches[2].clientX,B.touches[2].clientY);X[4]=ee[0],X[5]=ee[1]}if(B.touches[1]){e.touchData.singleTouchMoved=!0,v(e.dragData.touchDragEles);var he=e.findContainerClientCoords();Y=he[0],te=he[1],le=he[2],ue=he[3],F=B.touches[0].clientX-Y,D=B.touches[0].clientY-te,$=B.touches[1].clientX-Y,L=B.touches[1].clientY-te,ne=0<=F&&F<=le&&0<=$&&$<=le&&0<=D&&D<=ue&&0<=L&&L<=ue;var ae=V.pan(),ye=V.zoom();I=oe(F,D,$,L),z=U(F,D,$,L),G=[(F+$)/2,(D+L)/2],q=[(G[0]-ae.x)/ye,(G[1]-ae.y)/ye];var Ae=200,Ie=Ae*Ae;if(z<Ie&&!B.touches[2]){var W=e.findNearestElement(X[0],X[1],!0,!0),fe=e.findNearestElement(X[2],X[3],!0,!0);W&&W.isNode()?(W.activate().emit({originalEvent:B,type:"cxttapstart",position:{x:X[0],y:X[1]}}),e.touchData.start=W):fe&&fe.isNode()?(fe.activate().emit({originalEvent:B,type:"cxttapstart",position:{x:X[0],y:X[1]}}),e.touchData.start=fe):V.emit({originalEvent:B,type:"cxttapstart",position:{x:X[0],y:X[1]}}),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(B.touches[2])V.boxSelectionEnabled()&&B.preventDefault();else if(!B.touches[1]&&B.touches[0]){var ie=e.findNearestElements(X[0],X[1],!0,!0),we=ie[0];if(we!=null&&(we.activate(),e.touchData.start=we,e.touchData.starts=ie,e.nodeIsGrabbable(we))){var nt=e.dragData.touchDragEles=V.collection(),Qe=null;e.redrawHint("eles",!0),e.redrawHint("drag",!0),we.selected()?(Qe=V.$(function(Tt){return Tt.selected()&&e.nodeIsGrabbable(Tt)}),p(Qe,{addToList:nt})):g(we,{addToList:nt}),d(we);var lt=function(Tt){return{originalEvent:B,type:Tt,position:{x:X[0],y:X[1]}}};we.emit(lt("grabon")),Qe?Qe.forEach(function(Tt){Tt.emit(lt("grab"))}):we.emit(lt("grab"))}r(we,["touchstart","tapstart","vmousedown"],B,{x:X[0],y:X[1]}),we==null&&(e.data.bgActivePosistion={x:ee[0],y:ee[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&&r(e.touchData.start,["taphold"],B,{x:X[0],y:X[1]})},e.tapholdDuration)}if(B.touches.length>=1){for(var ft=e.touchData.startPosition=[null,null,null,null,null,null],gt=0;gt<X.length;gt++)ft[gt]=Q[gt]=X[gt];var Kt=B.touches[0];e.touchData.startGPosition=[Kt.clientX,Kt.clientY]}}},!1);var J;e.registerBinding(t,"touchmove",J=function(B){var V=e.touchData.capture;if(!(!V&&!_(B))){var X=e.selection,Q=e.cy,ee=e.touchData.now,he=e.touchData.earlier,ae=Q.zoom();if(B.touches[0]){var ye=e.projectIntoViewport(B.touches[0].clientX,B.touches[0].clientY);ee[0]=ye[0],ee[1]=ye[1]}if(B.touches[1]){var ye=e.projectIntoViewport(B.touches[1].clientX,B.touches[1].clientY);ee[2]=ye[0],ee[3]=ye[1]}if(B.touches[2]){var ye=e.projectIntoViewport(B.touches[2].clientX,B.touches[2].clientY);ee[4]=ye[0],ee[5]=ye[1]}var Ae=e.touchData.startGPosition,Ie;if(V&&B.touches[0]&&Ae){for(var W=[],fe=0;fe<ee.length;fe++)W[fe]=ee[fe]-he[fe];var ie=B.touches[0].clientX-Ae[0],we=ie*ie,nt=B.touches[0].clientY-Ae[1],Qe=nt*nt,lt=we+Qe;Ie=lt>=e.touchTapThreshold2}if(V&&e.touchData.cxt){B.preventDefault();var ft=B.touches[0].clientX-Y,gt=B.touches[0].clientY-te,Kt=B.touches[1].clientX-Y,Tt=B.touches[1].clientY-te,Nt=U(ft,gt,Kt,Tt),Wt=Nt/z,Gt=150,Rt=Gt*Gt,$n=1.5,xn=$n*$n;if(Wt>=xn||Nt>=Rt){e.touchData.cxt=!1,e.data.bgActivePosistion=void 0,e.redrawHint("select",!0);var kn={originalEvent:B,type:"cxttapend",position:{x:ee[0],y:ee[1]}};e.touchData.start?(e.touchData.start.unactivate().emit(kn),e.touchData.start=null):Q.emit(kn)}}if(V&&e.touchData.cxt){var kn={originalEvent:B,type:"cxtdrag",position:{x:ee[0],y:ee[1]}};e.data.bgActivePosistion=void 0,e.redrawHint("select",!0),e.touchData.start?e.touchData.start.emit(kn):Q.emit(kn),e.touchData.start&&(e.touchData.start._private.grabbed=!1),e.touchData.cxtDragged=!0;var yt=e.findNearestElement(ee[0],ee[1],!0,!0);(!e.touchData.cxtOver||yt!==e.touchData.cxtOver)&&(e.touchData.cxtOver&&e.touchData.cxtOver.emit({originalEvent:B,type:"cxtdragout",position:{x:ee[0],y:ee[1]}}),e.touchData.cxtOver=yt,yt&&yt.emit({originalEvent:B,type:"cxtdragover",position:{x:ee[0],y:ee[1]}}))}else if(V&&B.touches[2]&&Q.boxSelectionEnabled())B.preventDefault(),e.data.bgActivePosistion=void 0,this.lastThreeTouch=+new Date,e.touchData.selecting||Q.emit({originalEvent:B,type:"boxstart",position:{x:ee[0],y:ee[1]}}),e.touchData.selecting=!0,e.touchData.didSelect=!0,X[4]=1,!X||X.length===0||X[0]===void 0?(X[0]=(ee[0]+ee[2]+ee[4])/3,X[1]=(ee[1]+ee[3]+ee[5])/3,X[2]=(ee[0]+ee[2]+ee[4])/3+1,X[3]=(ee[1]+ee[3]+ee[5])/3+1):(X[2]=(ee[0]+ee[2]+ee[4])/3,X[3]=(ee[1]+ee[3]+ee[5])/3),e.redrawHint("select",!0),e.redraw();else if(V&&B.touches[1]&&!e.touchData.didSelect&&Q.zoomingEnabled()&&Q.panningEnabled()&&Q.userZoomingEnabled()&&Q.userPanningEnabled()){B.preventDefault(),e.data.bgActivePosistion=void 0,e.redrawHint("select",!0);var Ot=e.dragData.touchDragEles;if(Ot){e.redrawHint("drag",!0);for(var Lt=0;Lt<Ot.length;Lt++){var Fn=Ot[Lt]._private;Fn.grabbed=!1,Fn.rscratch.inDragLayer=!1}}var ko=e.touchData.start,ft=B.touches[0].clientX-Y,gt=B.touches[0].clientY-te,Kt=B.touches[1].clientX-Y,Tt=B.touches[1].clientY-te,j=oe(ft,gt,Kt,Tt),re=j/I;if(ne){var _e=ft-F,Ve=gt-D,Vt=Kt-$,Cn=Tt-L,An=(_e+Vt)/2,Yt=(Ve+Cn)/2,$t=Q.zoom(),Co=$t*re,ji=Q.pan(),Sp=q[0]*$t+ji.x,_p=q[1]*$t+ji.y,Bp={x:-Co/$t*(Sp-ji.x-An)+Sp,y:-Co/$t*(_p-ji.y-Yt)+_p};if(ko&&ko.active()){var Ot=e.dragData.touchDragEles;v(Ot),e.redrawHint("drag",!0),e.redrawHint("eles",!0),ko.unactivate().emit("freeon"),Ot.emit("free"),e.dragData.didDrag&&(ko.emit("dragfreeon"),Ot.emit("dragfree"))}Q.viewport({zoom:Co,pan:Bp,cancelOnFailedZoom:!0}),Q.emit("pinchzoom"),I=j,F=ft,D=gt,$=Kt,L=Tt,e.pinching=!0}if(B.touches[0]){var ye=e.projectIntoViewport(B.touches[0].clientX,B.touches[0].clientY);ee[0]=ye[0],ee[1]=ye[1]}if(B.touches[1]){var ye=e.projectIntoViewport(B.touches[1].clientX,B.touches[1].clientY);ee[2]=ye[0],ee[3]=ye[1]}if(B.touches[2]){var ye=e.projectIntoViewport(B.touches[2].clientX,B.touches[2].clientY);ee[4]=ye[0],ee[5]=ye[1]}}else if(B.touches[0]&&!e.touchData.didSelect){var fr=e.touchData.start,uu=e.touchData.last,yt;if(!e.hoverData.draggingEles&&!e.swipePanning&&(yt=e.findNearestElement(ee[0],ee[1],!0,!0)),V&&fr!=null&&B.preventDefault(),V&&fr!=null&&e.nodeIsDraggable(fr))if(Ie){var Ot=e.dragData.touchDragEles,Tp=!e.dragData.didDrag;Tp&&p(Ot,{inDragLayer:!0}),e.dragData.didDrag=!0;var Hi={x:0,y:0};if(Ee(W[0])&&Ee(W[1])&&(Hi.x+=W[0],Hi.y+=W[1],Tp)){e.redrawHint("eles",!0);var Mn=e.touchData.dragDelta;Mn&&Ee(Mn[0])&&Ee(Mn[1])&&(Hi.x+=Mn[0],Hi.y+=Mn[1])}e.hoverData.draggingEles=!0,Ot.silentShift(Hi).emit("position drag"),e.redrawHint("drag",!0),e.touchData.startPosition[0]==he[0]&&e.touchData.startPosition[1]==he[1]&&e.redrawHint("eles",!0),e.redraw()}else{var Mn=e.touchData.dragDelta=e.touchData.dragDelta||[];Mn.length===0?(Mn.push(W[0]),Mn.push(W[1])):(Mn[0]+=W[0],Mn[1]+=W[1])}if(r(fr||yt,["touchmove","tapdrag","vmousemove"],B,{x:ee[0],y:ee[1]}),(!fr||!fr.grabbed())&&yt!=uu&&(uu&&uu.emit({originalEvent:B,type:"tapdragout",position:{x:ee[0],y:ee[1]}}),yt&&yt.emit({originalEvent:B,type:"tapdragover",position:{x:ee[0],y:ee[1]}})),e.touchData.last=yt,V)for(var Lt=0;Lt<ee.length;Lt++)ee[Lt]&&e.touchData.startPosition[Lt]&&Ie&&(e.touchData.singleTouchMoved=!0);if(V&&(fr==null||fr.pannable())&&Q.panningEnabled()&&Q.userPanningEnabled()){var wy=i(fr,e.touchData.starts);wy&&(B.preventDefault(),e.data.bgActivePosistion||(e.data.bgActivePosistion=Vs(e.touchData.startPosition)),e.swipePanning?(Q.panBy({x:W[0]*ae,y:W[1]*ae}),Q.emit("dragpan")):Ie&&(e.swipePanning=!0,Q.panBy({x:ie*ae,y:nt*ae}),Q.emit("dragpan"),fr&&(fr.unactivate(),e.redrawHint("select",!0),e.touchData.start=null)));var ye=e.projectIntoViewport(B.touches[0].clientX,B.touches[0].clientY);ee[0]=ye[0],ee[1]=ye[1]}}for(var fe=0;fe<ee.length;fe++)he[fe]=ee[fe];V&&B.touches.length>0&&!e.hoverData.draggingEles&&!e.swipePanning&&e.data.bgActivePosistion!=null&&(e.data.bgActivePosistion=void 0,e.redrawHint("select",!0),e.redraw())}},!1);var de;e.registerBinding(t,"touchcancel",de=function(B){var V=e.touchData.start;e.touchData.capture=!1,V&&V.unactivate()});var be,Be,pe,xe;if(e.registerBinding(t,"touchend",be=function(B){var V=e.touchData.start,X=e.touchData.capture;if(X)B.touches.length===0&&(e.touchData.capture=!1),B.preventDefault();else return;var Q=e.selection;e.swipePanning=!1,e.hoverData.draggingEles=!1;var ee=e.cy,he=ee.zoom(),ae=e.touchData.now,ye=e.touchData.earlier;if(B.touches[0]){var Ae=e.projectIntoViewport(B.touches[0].clientX,B.touches[0].clientY);ae[0]=Ae[0],ae[1]=Ae[1]}if(B.touches[1]){var Ae=e.projectIntoViewport(B.touches[1].clientX,B.touches[1].clientY);ae[2]=Ae[0],ae[3]=Ae[1]}if(B.touches[2]){var Ae=e.projectIntoViewport(B.touches[2].clientX,B.touches[2].clientY);ae[4]=Ae[0],ae[5]=Ae[1]}V&&V.unactivate();var Ie;if(e.touchData.cxt){if(Ie={originalEvent:B,type:"cxttapend",position:{x:ae[0],y:ae[1]}},V?V.emit(Ie):ee.emit(Ie),!e.touchData.cxtDragged){var W={originalEvent:B,type:"cxttap",position:{x:ae[0],y:ae[1]}};V?V.emit(W):ee.emit(W)}e.touchData.start&&(e.touchData.start._private.grabbed=!1),e.touchData.cxt=!1,e.touchData.start=null,e.redraw();return}if(!B.touches[2]&&ee.boxSelectionEnabled()&&e.touchData.selecting){e.touchData.selecting=!1;var fe=ee.collection(e.getAllInBox(Q[0],Q[1],Q[2],Q[3]));Q[0]=void 0,Q[1]=void 0,Q[2]=void 0,Q[3]=void 0,Q[4]=0,e.redrawHint("select",!0),ee.emit({type:"boxend",originalEvent:B,position:{x:ae[0],y:ae[1]}});var ie=function(Gt){return Gt.selectable()&&!Gt.selected()};fe.emit("box").stdFilter(ie).select().emit("boxselect"),fe.nonempty()&&e.redrawHint("eles",!0),e.redraw()}if(V!=null&&V.unactivate(),B.touches[2])e.data.bgActivePosistion=void 0,e.redrawHint("select",!0);else if(!B.touches[1]&&!B.touches[0]&&!B.touches[0]){e.data.bgActivePosistion=void 0,e.redrawHint("select",!0);var we=e.dragData.touchDragEles;if(V!=null){var nt=V._private.grabbed;v(we),e.redrawHint("drag",!0),e.redrawHint("eles",!0),nt&&(V.emit("freeon"),we.emit("free"),e.dragData.didDrag&&(V.emit("dragfreeon"),we.emit("dragfree"))),r(V,["touchend","tapend","vmouseup","tapdragout"],B,{x:ae[0],y:ae[1]}),V.unactivate(),e.touchData.start=null}else{var Qe=e.findNearestElement(ae[0],ae[1],!0,!0);r(Qe,["touchend","tapend","vmouseup","tapdragout"],B,{x:ae[0],y:ae[1]})}var lt=e.touchData.startPosition[0]-ae[0],ft=lt*lt,gt=e.touchData.startPosition[1]-ae[1],Kt=gt*gt,Tt=ft+Kt,Nt=Tt*he*he;e.touchData.singleTouchMoved||(V||ee.$(":selected").unselect(["tapunselect"]),r(V,["tap","vclick"],B,{x:ae[0],y:ae[1]}),Be=!1,B.timeStamp-xe<=ee.multiClickDebounceTime()?(pe&&clearTimeout(pe),Be=!0,xe=null,r(V,["dbltap","vdblclick"],B,{x:ae[0],y:ae[1]})):(pe=setTimeout(function(){Be||r(V,["onetap","voneclick"],B,{x:ae[0],y:ae[1]})},ee.multiClickDebounceTime()),xe=B.timeStamp)),V!=null&&!e.dragData.didDrag&&V._private.selectable&&Nt<e.touchTapThreshold2&&!e.pinching&&(ee.selectionType()==="single"?(ee.$(n).unmerge(V).unselect(["tapunselect"]),V.select(["tapselect"])):V.selected()?V.unselect(["tapunselect"]):V.select(["tapselect"]),e.redrawHint("eles",!0)),e.touchData.singleTouchMoved=!0}for(var Wt=0;Wt<ae.length;Wt++)ye[Wt]=ae[Wt];e.dragData.didDrag=!1,B.touches.length===0&&(e.touchData.dragDelta=[],e.touchData.startPosition=[null,null,null,null,null,null],e.touchData.startGPosition=null,e.touchData.didSelect=!1),B.touches.length<2&&(B.touches.length===1&&(e.touchData.startGPosition=[B.touches[0].clientX,B.touches[0].clientY]),e.pinching=!1,e.redrawHint("eles",!0),e.redraw())},!1),typeof TouchEvent>"u"){var ge=[],Ce=function(B){return{clientX:B.clientX,clientY:B.clientY,force:1,identifier:B.pointerId,pageX:B.pageX,pageY:B.pageY,radiusX:B.width/2,radiusY:B.height/2,screenX:B.screenX,screenY:B.screenY,target:B.target}},Ne=function(B){return{event:B,touch:Ce(B)}},Pe=function(B){ge.push(Ne(B))},Se=function(B){for(var V=0;V<ge.length;V++){var X=ge[V];if(X.event.pointerId===B.pointerId){ge.splice(V,1);return}}},Le=function(B){var V=ge.filter(function(X){return X.event.pointerId===B.pointerId})[0];V.event=B,V.touch=Ce(B)},De=function(B){B.touches=ge.map(function(V){return V.touch})},ze=function(B){return B.pointerType==="mouse"||B.pointerType===4};e.registerBinding(e.container,"pointerdown",function(B){ze(B)||(B.preventDefault(),Pe(B),De(B),K(B))}),e.registerBinding(e.container,"pointerup",function(B){ze(B)||(Se(B),De(B),be(B))}),e.registerBinding(e.container,"pointercancel",function(B){ze(B)||(Se(B),De(B),de(B))}),e.registerBinding(e.container,"pointermove",function(B){ze(B)||(B.preventDefault(),Le(B),De(B),J(B))})}};var Jo={};Jo.generatePolygon=function(e,t){return this.nodeShapes[e]={renderer:this,name:e,points:t,draw:function(n,r,a,i,s,l){this.renderer.nodeShapeImpl("polygon",n,r,a,i,s,this.points)},intersectLine:function(n,r,a,i,s,l,u,c){return qc(s,l,this.points,n,r,a/2,i/2,u)},checkPoint:function(n,r,a,i,s,l,u,c){return Go(n,r,this.points,l,u,i,s,[0,-1],a)}}},Jo.generateEllipse=function(){return this.nodeShapes.ellipse={renderer:this,name:"ellipse",draw:function(e,t,n,r,a,i){this.renderer.nodeShapeImpl(this.name,e,t,n,r,a)},intersectLine:function(e,t,n,r,a,i,s,l){return Lre(a,i,e,t,n/2+s,r/2+s)},checkPoint:function(e,t,n,r,a,i,s,l){return Ni(e,t,r,a,i,s,n)}}},Jo.generateRoundPolygon=function(e,t){return this.nodeShapes[e]={renderer:this,name:e,points:t,getOrCreateCorners:function(n,r,a,i,s,l,u){if(l[u]!==void 0&&l[u+"-cx"]===n&&l[u+"-cy"]===r)return l[u];l[u]=new Array(t.length/2),l[u+"-cx"]=n,l[u+"-cy"]=r;var c=a/2,d=i/2;s=s==="auto"?w5(a,i):s;for(var f=new Array(t.length/2),h=0;h<t.length/2;h++)f[h]={x:n+c*t[h*2],y:r+d*t[h*2+1]};var m,p,g,v,y=f.length;for(p=f[y-1],m=0;m<y;m++)g=f[m%y],v=f[(m+1)%y],l[u][m]=iy(p,g,v,s),p=g,g=v;return l[u]},draw:function(n,r,a,i,s,l,u){this.renderer.nodeShapeImpl("round-polygon",n,r,a,i,s,this.points,this.getOrCreateCorners(r,a,i,s,l,u,"drawCorners"))},intersectLine:function(n,r,a,i,s,l,u,c,d){return Rre(s,l,this.points,n,r,a,i,u,this.getOrCreateCorners(n,r,a,i,c,d,"corners"))},checkPoint:function(n,r,a,i,s,l,u,c,d){return Dre(n,r,this.points,l,u,i,s,this.getOrCreateCorners(l,u,i,s,c,d,"corners"))}}},Jo.generateRoundRectangle=function(){return this.nodeShapes["round-rectangle"]=this.nodeShapes.roundrectangle={renderer:this,name:"round-rectangle",points:Vn(4,0),draw:function(e,t,n,r,a,i){this.renderer.nodeShapeImpl(this.name,e,t,n,r,a,this.points,i)},intersectLine:function(e,t,n,r,a,i,s,l){return v5(a,i,e,t,n,r,s,l)},checkPoint:function(e,t,n,r,a,i,s,l){var u=r/2,c=a/2;l=l==="auto"?Oi(r,a):l,l=Math.min(u,c,l);var d=l*2;return!!(Go(e,t,this.points,i,s,r,a-d,[0,-1],n)||Go(e,t,this.points,i,s,r-d,a,[0,-1],n)||Ni(e,t,d,d,i-u+l,s-c+l,n)||Ni(e,t,d,d,i+u-l,s-c+l,n)||Ni(e,t,d,d,i+u-l,s+c-l,n)||Ni(e,t,d,d,i-u+l,s+c-l,n))}}},Jo.generateCutRectangle=function(){return this.nodeShapes["cut-rectangle"]=this.nodeShapes.cutrectangle={renderer:this,name:"cut-rectangle",cornerLength:$0(),points:Vn(4,0),draw:function(e,t,n,r,a,i){this.renderer.nodeShapeImpl(this.name,e,t,n,r,a,null,i)},generateCutTrianglePts:function(e,t,n,r,a){var i=a==="auto"?this.cornerLength:a,s=t/2,l=e/2,u=n-l,c=n+l,d=r-s,f=r+s;return{topLeft:[u,d+i,u+i,d,u+i,d+i],topRight:[c-i,d,c,d+i,c-i,d+i],bottomRight:[c,f-i,c-i,f,c-i,f-i],bottomLeft:[u+i,f,u,f-i,u+i,f-i]}},intersectLine:function(e,t,n,r,a,i,s,l){var u=this.generateCutTrianglePts(n+2*s,r+2*s,e,t,l),c=[].concat.apply([],[u.topLeft.splice(0,4),u.topRight.splice(0,4),u.bottomRight.splice(0,4),u.bottomLeft.splice(0,4)]);return qc(a,i,c,e,t)},checkPoint:function(e,t,n,r,a,i,s,l){var u=l==="auto"?this.cornerLength:l;if(Go(e,t,this.points,i,s,r,a-2*u,[0,-1],n)||Go(e,t,this.points,i,s,r-2*u,a,[0,-1],n))return!0;var c=this.generateCutTrianglePts(r,a,i,s);return tr(e,t,c.topLeft)||tr(e,t,c.topRight)||tr(e,t,c.bottomRight)||tr(e,t,c.bottomLeft)}}},Jo.generateBarrel=function(){return this.nodeShapes.barrel={renderer:this,name:"barrel",points:Vn(4,0),draw:function(e,t,n,r,a,i){this.renderer.nodeShapeImpl(this.name,e,t,n,r,a)},intersectLine:function(e,t,n,r,a,i,s,l){var u=.15,c=.5,d=.85,f=this.generateBarrelBezierPts(n+2*s,r+2*s,e,t),h=function(p){var g=Ms({x:p[0],y:p[1]},{x:p[2],y:p[3]},{x:p[4],y:p[5]},u),v=Ms({x:p[0],y:p[1]},{x:p[2],y:p[3]},{x:p[4],y:p[5]},c),y=Ms({x:p[0],y:p[1]},{x:p[2],y:p[3]},{x:p[4],y:p[5]},d);return[p[0],p[1],g.x,g.y,v.x,v.y,y.x,y.y,p[4],p[5]]},m=[].concat(h(f.topLeft),h(f.topRight),h(f.bottomRight),h(f.bottomLeft));return qc(a,i,m,e,t)},generateBarrelBezierPts:function(e,t,n,r){var a=t/2,i=e/2,s=n-i,l=n+i,u=r-a,c=r+a,d=F0(e,t),f=d.heightOffset,h=d.widthOffset,m=d.ctrlPtOffsetPct*e,p={topLeft:[s,u+f,s+m,u,s+h,u],topRight:[l-h,u,l-m,u,l,u+f],bottomRight:[l,c-f,l-m,c,l-h,c],bottomLeft:[s+h,c,s+m,c,s,c-f]};return p.topLeft.isTop=!0,p.topRight.isTop=!0,p.bottomLeft.isBottom=!0,p.bottomRight.isBottom=!0,p},checkPoint:function(e,t,n,r,a,i,s,l){var u=F0(r,a),c=u.heightOffset,d=u.widthOffset;if(Go(e,t,this.points,i,s,r,a-2*c,[0,-1],n)||Go(e,t,this.points,i,s,r-2*d,a,[0,-1],n))return!0;for(var f=this.generateBarrelBezierPts(r,a,i,s),h=function(k,E,S){var _=S[4],O=S[2],T=S[0],N=S[5],A=S[1],F=Math.min(_,T),D=Math.max(_,T),$=Math.min(N,A),L=Math.max(N,A);if(F<=k&&k<=D&&$<=E&&E<=L){var I=Vre(_,O,T),z=Fre(I[0],I[1],I[2],k),G=z.filter(function(q){return 0<=q&&q<=1});if(G.length>0)return G[0]}return null},m=Object.keys(f),p=0;p<m.length;p++){var g=m[p],v=f[g],y=h(e,t,v);if(y!=null){var b=v[5],x=v[3],w=v[1],C=ln(b,x,w,y);if(v.isTop&&C<=t||v.isBottom&&t<=C)return!0}}return!1}}},Jo.generateBottomRoundrectangle=function(){return this.nodeShapes["bottom-round-rectangle"]=this.nodeShapes.bottomroundrectangle={renderer:this,name:"bottom-round-rectangle",points:Vn(4,0),draw:function(e,t,n,r,a,i){this.renderer.nodeShapeImpl(this.name,e,t,n,r,a,this.points,i)},intersectLine:function(e,t,n,r,a,i,s,l){var u=e-(n/2+s),c=t-(r/2+s),d=c,f=e+(n/2+s),h=Aa(a,i,e,t,u,c,f,d,!1);return h.length>0?h:v5(a,i,e,t,n,r,s,l)},checkPoint:function(e,t,n,r,a,i,s,l){l=l==="auto"?Oi(r,a):l;var u=2*l;if(Go(e,t,this.points,i,s,r,a-u,[0,-1],n)||Go(e,t,this.points,i,s,r-u,a,[0,-1],n))return!0;var c=r/2+2*n,d=a/2+2*n,f=[i-c,s-d,i-c,s,i+c,s,i+c,s-d];return!!(tr(e,t,f)||Ni(e,t,u,u,i+r/2-l,s+a/2-l,n)||Ni(e,t,u,u,i-r/2+l,s+a/2-l,n))}}},Jo.registerNodeShapes=function(){var e=this.nodeShapes={},t=this;this.generateEllipse(),this.generatePolygon("triangle",Vn(3,0)),this.generateRoundPolygon("round-triangle",Vn(3,0)),this.generatePolygon("rectangle",Vn(4,0)),e.square=e.rectangle,this.generateRoundRectangle(),this.generateCutRectangle(),this.generateBarrel(),this.generateBottomRoundrectangle();{var n=[0,1,1,0,0,-1,-1,0];this.generatePolygon("diamond",n),this.generateRoundPolygon("round-diamond",n)}this.generatePolygon("pentagon",Vn(5,0)),this.generateRoundPolygon("round-pentagon",Vn(5,0)),this.generatePolygon("hexagon",Vn(6,0)),this.generateRoundPolygon("round-hexagon",Vn(6,0)),this.generatePolygon("heptagon",Vn(7,0)),this.generateRoundPolygon("round-heptagon",Vn(7,0)),this.generatePolygon("octagon",Vn(8,0)),this.generateRoundPolygon("round-octagon",Vn(8,0));var r=new Array(20);{var a=O0(5,0),i=O0(5,Math.PI/5),s=.5*(3-Math.sqrt(5));s*=1.57;for(var l=0;l<i.length/2;l++)i[l*2]*=s,i[l*2+1]*=s;for(var l=0;l<20/4;l++)r[l*4]=a[l*2],r[l*4+1]=a[l*2+1],r[l*4+2]=i[l*2],r[l*4+3]=i[l*2+1]}r=b5(r),this.generatePolygon("star",r),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(c){var d=c.join("$"),f="polygon-"+d,h;return(h=this[f])?h:t.generatePolygon(f,c)}};var iu={};iu.timeToRender=function(){return this.redrawTotalTime/this.redrawCount},iu.redraw=function(e){e=e||d5();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},iu.beforeRender=function(e,t){if(!this.destroyed){t==null&&It("Priority is not optional for beforeRender");var n=this.beforeRenderCallbacks;n.push({fn:e,priority:t}),n.sort(function(r,a){return a.priority-r.priority})}};var f_=function(e,t,n){for(var r=e.beforeRenderCallbacks,a=0;a<r.length;a++)r[a].fn(t,n)};iu.startRenderLoop=function(){var e=this,t=e.cy;if(!e.renderLoopStarted){e.renderLoopStarted=!0;var n=function r(a){if(!e.destroyed){if(!t.batching())if(e.requestedFrame&&!e.skipFrame){f_(e,!0,a);var i=Wo();e.render(e.renderOptions);var s=e.lastDrawTime=Wo();e.averageRedrawTime===void 0&&(e.averageRedrawTime=s-i),e.redrawCount===void 0&&(e.redrawCount=0),e.redrawCount++,e.redrawTotalTime===void 0&&(e.redrawTotalTime=0);var l=s-i;e.redrawTotalTime+=l,e.lastRedrawTime=l,e.averageRedrawTime=e.averageRedrawTime/2+l/2,e.requestedFrame=!1}else f_(e,!1,a);e.skipFrame=!1,$f(r)}};$f(n)}};var wle=function(e){this.init(e)},p_=wle,al=p_.prototype;al.clientFunctions=["redrawHint","render","renderTo","matchCanvasSize","nodeShapeImpl","arrowShapeImpl"],al.init=function(e){var t=this;t.options=e,t.cy=e.cy;var n=t.container=e.cy.container(),r=t.cy.window();if(r){var a=r.document,i=a.head,s="__________cytoscape_stylesheet",l="__________cytoscape_container",u=a.getElementById(s)!=null;if(n.className.indexOf(l)<0&&(n.className=(n.className||"")+" "+l),!u){var c=a.createElement("style");c.id=s,c.textContent="."+l+" { position: relative; }",i.insertBefore(c,i.children[0])}var d=r.getComputedStyle(n),f=d.getPropertyValue("position");f==="static"&&ut("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.hideEdgesOnViewport=e.hideEdgesOnViewport,t.textureOnViewport=e.textureOnViewport,t.wheelSensitivity=e.wheelSensitivity,t.motionBlurEnabled=e.motionBlur,t.forcedPixelRatio=Ee(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()},al.notify=function(e,t){var n=this,r=n.cy;if(!this.destroyed){if(e==="init"){n.load();return}if(e==="destroy"){n.destroy();return}(e==="add"||e==="remove"||e==="move"&&r.hasCompoundNodes()||e==="load"||e==="zorder"||e==="mount")&&n.invalidateCachedZSortedEles(),e==="viewport"&&n.redrawHint("select",!0),(e==="load"||e==="resize"||e==="mount")&&(n.invalidateContainerClientCoordsCache(),n.matchCanvasSize(n.container)),n.redrawHint("eles",!0),n.redrawHint("drag",!0),this.startRenderLoop(),this.redraw()}},al.destroy=function(){var e=this;e.destroyed=!0,e.cy.stopAnimationLoop();for(var t=0;t<e.bindings.length;t++){var n=e.bindings[t],r=n,a=r.target;(a.off||a.removeEventListener).apply(a,r.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{}},al.isHeadless=function(){return!1},[ty,u_,d_,ol,Jo,iu].forEach(function(e){He(al,e)});var ly=1e3/60,h_={setupDequeueing:function(e){return function(){var t=this,n=this.renderer;if(!t.dequeueingSetup){t.dequeueingSetup=!0;var r=Of(function(){n.redrawHint("eles",!0),n.redrawHint("drag",!0),n.redraw()},e.deqRedrawThreshold),a=function(s,l){var u=Wo(),c=n.averageRedrawTime,d=n.lastRedrawTime,f=[],h=n.cy.extent(),m=n.getPixelRatio();for(s||n.flushRenderedStyleQueue();;){var p=Wo(),g=p-u,v=p-l;if(d<ly){var y=ly-(s?c:0);if(v>=e.deqFastCost*y)break}else if(s){if(g>=e.deqCost*d||g>=e.deqAvgCost*c)break}else if(v>=e.deqNoDrawCost*ly)break;var b=e.deq(t,m,h);if(b.length>0)for(var x=0;x<b.length;x++)f.push(b[x]);else break}f.length>0&&(e.onDeqd(t,f),!s&&e.shouldRedraw(t,f,m,h)&&r())},i=e.priority||E0;n.beforeRender(a,i(t))}}}},xle=function(){function e(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Af;y0(this,e),this.idsByKey=new go,this.keyForId=new go,this.cachesByLvl=new go,this.lvls=[],this.getKey=t,this.doesEleInvalidateKey=n}return v0(e,[{key:"getIdsFor",value:function(t){t==null&&It("Can not get id list for null key");var n=this.idsByKey,r=this.idsByKey.get(t);return r||(r=new Rs,n.set(t,r)),r}},{key:"addIdForKey",value:function(t,n){t!=null&&this.getIdsFor(t).add(n)}},{key:"deleteIdForKey",value:function(t,n){t!=null&&this.getIdsFor(t).delete(n)}},{key:"getNumberOfIdsForKey",value:function(t){return t==null?0:this.getIdsFor(t).size}},{key:"updateKeyMappingFor",value:function(t){var n=t.id(),r=this.keyForId.get(n),a=this.getKey(t);this.deleteIdForKey(r,n),this.addIdForKey(a,n),this.keyForId.set(n,a)}},{key:"deleteKeyMappingFor",value:function(t){var n=t.id(),r=this.keyForId.get(n);this.deleteIdForKey(r,n),this.keyForId.delete(n)}},{key:"keyHasChangedFor",value:function(t){var n=t.id(),r=this.keyForId.get(n),a=this.getKey(t);return r!==a}},{key:"isInvalid",value:function(t){return this.keyHasChangedFor(t)||this.doesEleInvalidateKey(t)}},{key:"getCachesAt",value:function(t){var n=this.cachesByLvl,r=this.lvls,a=n.get(t);return a||(a=new go,n.set(t,a),r.push(t)),a}},{key:"getCache",value:function(t,n){return this.getCachesAt(n).get(t)}},{key:"get",value:function(t,n){var r=this.getKey(t),a=this.getCache(r,n);return a!=null&&this.updateKeyMappingFor(t),a}},{key:"getForCachedKey",value:function(t,n){var r=this.keyForId.get(t.id()),a=this.getCache(r,n);return a}},{key:"hasCache",value:function(t,n){return this.getCachesAt(n).has(t)}},{key:"has",value:function(t,n){var r=this.getKey(t);return this.hasCache(r,n)}},{key:"setCache",value:function(t,n,r){r.key=t,this.getCachesAt(n).set(t,r)}},{key:"set",value:function(t,n,r){var a=this.getKey(t);this.setCache(a,n,r),this.updateKeyMappingFor(t)}},{key:"deleteCache",value:function(t,n){this.getCachesAt(n).delete(t)}},{key:"delete",value:function(t,n){var r=this.getKey(t);this.deleteCache(r,n)}},{key:"invalidateKey",value:function(t){var n=this;this.lvls.forEach(function(r){return n.deleteCache(t,r)})}},{key:"invalidate",value:function(t){var n=t.id(),r=this.keyForId.get(n);this.deleteKeyMappingFor(t);var a=this.doesEleInvalidateKey(t);return a&&this.invalidateKey(r),a||this.getNumberOfIdsForKey(r)===0}}]),e}(),m_=25,wp=50,xp=-4,cy=3,kle=7.99,Cle=8,Ele=1024,Sle=1024,_le=1024,Ble=.2,Tle=.8,Nle=10,Ole=.15,$le=.1,Fle=.9,Ale=.9,Ple=100,Ile=1,il={dequeue:"dequeue",downscale:"downscale",highQuality:"highQuality"},Dle=gn({getKey:null,doesEleInvalidateKey:Af,drawElement:null,getBoundingBox:null,getRotationPoint:null,getRotationOffset:null,isVisible:s5,allowEdgeTxrCaching:!0,allowParentTxrCaching:!0}),su=function(e,t){var n=this;n.renderer=e,n.onDequeues=[];var r=Dle(t);He(n,r),n.lookup=new xle(r.getKey,r.doesEleInvalidateKey),n.setupDequeueing()},on=su.prototype;on.reasons=il,on.getTextureQueue=function(e){var t=this;return t.eleImgCaches=t.eleImgCaches||{},t.eleImgCaches[e]=t.eleImgCaches[e]||[]},on.getRetiredTextureQueue=function(e){var t=this,n=t.eleImgCaches.retired=t.eleImgCaches.retired||{},r=n[e]=n[e]||[];return r},on.getElementQueue=function(){var e=this,t=e.eleCacheQueue=e.eleCacheQueue||new jc(function(n,r){return r.reqs-n.reqs});return t},on.getElementKeyToQueue=function(){var e=this,t=e.eleKeyToCacheQueue=e.eleKeyToCacheQueue||{};return t},on.getElement=function(e,t,n,r,a){var i=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()||!i.allowEdgeTxrCaching&&e.isEdge()||!i.allowParentTxrCaching&&e.isParent())return null;if(r==null&&(r=Math.ceil(B0(l*n))),r<xp)r=xp;else if(l>=kle||r>cy)return null;var c=Math.pow(2,r),d=t.h*c,f=t.w*c,h=s.eleTextBiggerThanMin(e,c);if(!this.isVisible(e,h))return null;var m=u.get(e,r);if(m&&m.invalidated&&(m.invalidated=!1,m.texture.invalidatedWidth-=m.width),m)return m;var p;if(d<=m_?p=m_:d<=wp?p=wp:p=Math.ceil(d/wp)*wp,d>_le||f>Sle)return null;var g=i.getTextureQueue(p),v=g[g.length-2],y=function(){return i.recycleTexture(p,f)||i.addTexture(p,f)};v||(v=g[g.length-1]),v||(v=y()),v.width-v.usedWidth<f&&(v=y());for(var b=function(D){return D&&D.scaledLabelShown===h},x=a&&a===il.dequeue,w=a&&a===il.highQuality,C=a&&a===il.downscale,k,E=r+1;E<=cy;E++){var S=u.get(e,E);if(S){k=S;break}}var _=k&&k.level===r+1?k:null,O=function(){v.context.drawImage(_.texture.canvas,_.x,0,_.width,_.height,v.usedWidth,0,f,d)};if(v.context.setTransform(1,0,0,1,0,0),v.context.clearRect(v.usedWidth,0,f,p),b(_))O();else if(b(k))if(w){for(var T=k.level;T>r;T--)_=i.getElement(e,t,n,T,il.downscale);O()}else return i.queueElement(e,k.level-1),k;else{var N;if(!x&&!w&&!C)for(var A=r-1;A>=xp;A--){var F=u.get(e,A);if(F){N=F;break}}if(b(N))return i.queueElement(e,r),N;v.context.translate(v.usedWidth,0),v.context.scale(c,c),this.drawElement(v.context,e,t,h,!1),v.context.scale(1/c,1/c),v.context.translate(-v.usedWidth,0)}return m={x:v.usedWidth,texture:v,level:r,scale:c,width:f,height:d,scaledLabelShown:h},v.usedWidth+=Math.ceil(f+Cle),v.eleCaches.push(m),u.set(e,r,m),i.checkTextureFullness(v),m},on.invalidateElements=function(e){for(var t=0;t<e.length;t++)this.invalidateElement(e[t])},on.invalidateElement=function(e){var t=this,n=t.lookup,r=[],a=n.isInvalid(e);if(a){for(var i=xp;i<=cy;i++){var s=n.getForCachedKey(e,i);s&&r.push(s)}var l=n.invalidate(e);if(l)for(var u=0;u<r.length;u++){var c=r[u],d=c.texture;d.invalidatedWidth+=c.width,c.invalidated=!0,t.checkTextureUtility(d)}t.removeFromQueue(e)}},on.checkTextureUtility=function(e){e.invalidatedWidth>=Ble*e.width&&this.retireTexture(e)},on.checkTextureFullness=function(e){var t=this,n=t.getTextureQueue(e.height);e.usedWidth/e.width>Tle&&e.fullnessChecks>=Nle?$a(n,e):e.fullnessChecks++},on.retireTexture=function(e){var t=this,n=e.height,r=t.getTextureQueue(n),a=this.lookup;$a(r,e),e.retired=!0;for(var i=e.eleCaches,s=0;s<i.length;s++){var l=i[s];a.deleteCache(l.key,l.level)}S0(i);var u=t.getRetiredTextureQueue(n);u.push(e)},on.addTexture=function(e,t){var n=this,r=n.getTextureQueue(e),a={};return r.push(a),a.eleCaches=[],a.height=e,a.width=Math.max(Ele,t),a.usedWidth=0,a.invalidatedWidth=0,a.fullnessChecks=0,a.canvas=n.renderer.makeOffscreenCanvas(a.width,a.height),a.context=a.canvas.getContext("2d"),a},on.recycleTexture=function(e,t){for(var n=this,r=n.getTextureQueue(e),a=n.getRetiredTextureQueue(e),i=0;i<a.length;i++){var s=a[i];if(s.width>=t)return s.retired=!1,s.usedWidth=0,s.invalidatedWidth=0,s.fullnessChecks=0,S0(s.eleCaches),s.context.setTransform(1,0,0,1,0,0),s.context.clearRect(0,0,s.width,s.height),$a(a,s),r.push(s),s}},on.queueElement=function(e,t){var n=this,r=n.getElementQueue(),a=n.getElementKeyToQueue(),i=this.getKey(e),s=a[i];if(s)s.level=Math.max(s.level,t),s.eles.merge(e),s.reqs++,r.updateItem(s);else{var l={eles:e.spawn().merge(e),level:t,reqs:1,key:i};r.push(l),a[i]=l}},on.dequeue=function(e){for(var t=this,n=t.getElementQueue(),r=t.getElementKeyToQueue(),a=[],i=t.lookup,s=0;s<Ile&&n.size()>0;s++){var l=n.pop(),u=l.key,c=l.eles[0],d=i.hasCache(c,l.level);if(r[u]=null,!d){a.push(l);var f=t.getBoundingBox(c);t.getElement(c,f,e,l.level,il.dequeue)}}return a},on.removeFromQueue=function(e){var t=this,n=t.getElementQueue(),r=t.getElementKeyToQueue(),a=this.getKey(e),i=r[a];i!=null&&(i.eles.length===1?(i.reqs=C0,n.updateItem(i),n.pop(),r[a]=null):i.eles.unmerge(e))},on.onDequeue=function(e){this.onDequeues.push(e)},on.offDequeue=function(e){$a(this.onDequeues,e)},on.setupDequeueing=h_.setupDequeueing({deqRedrawThreshold:Ple,deqCost:Ole,deqAvgCost:$le,deqNoDrawCost:Fle,deqFastCost:Ale,deq:function(e,t,n){return e.dequeue(t,n)},onDeqd:function(e,t){for(var n=0;n<e.onDequeues.length;n++){var r=e.onDequeues[n];r(t)}},shouldRedraw:function(e,t,n,r){for(var a=0;a<t.length;a++)for(var i=t[a].eles,s=0;s<i.length;s++){var l=i[s].boundingBox();if(T0(l,r))return!0}return!1},priority:function(e){return e.renderer.beforeRenderPriorities.eleTxrDeq}});var Lle=1,lu=-4,kp=2,Rle=3.99,Vle=50,Mle=50,zle=.15,jle=.1,Hle=.9,Ule=.9,qle=1,g_=250,Kle=4e3*4e3,Wle=!0,y_=function(e){var t=this,n=t.renderer=e,r=n.cy;t.layersByLevel={},t.firstGet=!0,t.lastInvalidationTime=Wo()-2*g_,t.skipping=!1,t.eleTxrDeqs=r.collection(),t.scheduleElementRefinement=Of(function(){t.refineElementTextures(t.eleTxrDeqs),t.eleTxrDeqs.unmerge(t.eleTxrDeqs)},Mle),n.beforeRender(function(i,s){s-t.lastInvalidationTime<=g_?t.skipping=!0:t.skipping=!1},n.beforeRenderPriorities.lyrTxrSkip);var a=function(i,s){return s.reqs-i.reqs};t.layersQueue=new jc(a),t.setupDequeueing()},wn=y_.prototype,v_=0,Gle=Math.pow(2,53)-1;wn.makeLayer=function(e,t){var n=Math.pow(2,t),r=Math.ceil(e.w*n),a=Math.ceil(e.h*n),i=this.renderer.makeOffscreenCanvas(r,a),s={id:v_=++v_%Gle,bb:e,level:t,width:r,height:a,canvas:i,context:i.getContext("2d"),eles:[],elesQueue:[],reqs:0},l=s.context,u=-s.bb.x1,c=-s.bb.y1;return l.scale(n,n),l.translate(u,c),s},wn.getLayers=function(e,t,n){var r=this,a=r.renderer,i=a.cy,s=i.zoom(),l=r.firstGet;if(r.firstGet=!1,n==null){if(n=Math.ceil(B0(s*t)),n<lu)n=lu;else if(s>=Rle||n>kp)return null}r.validateLayersElesOrdering(n,e);var u=r.layersByLevel,c=Math.pow(2,n),d=u[n]=u[n]||[],f,h=r.levelIsComplete(n,e),m,p=function(){var _=function(A){if(r.validateLayersElesOrdering(A,e),r.levelIsComplete(A,e))return m=u[A],!0},O=function(A){if(!m)for(var F=n+A;lu<=F&&F<=kp&&!_(F);F+=A);};O(1),O(-1);for(var T=d.length-1;T>=0;T--){var N=d[T];N.invalid&&$a(d,N)}};if(!h)p();else return d;var g=function(){if(!f){f=er();for(var _=0;_<e.length;_++)m5(f,e[_].boundingBox())}return f},v=function(_){_=_||{};var O=_.after;g();var T=f.w*c*(f.h*c);if(T>Kle)return null;var N=r.makeLayer(f,n);if(O!=null){var A=d.indexOf(O)+1;d.splice(A,0,N)}else(_.insert===void 0||_.insert)&&d.unshift(N);return N};if(r.skipping&&!l)return null;for(var y=null,b=e.length/Lle,x=!l,w=0;w<e.length;w++){var C=e[w],k=C._private.rscratch,E=k.imgLayerCaches=k.imgLayerCaches||{},S=E[n];if(S){y=S;continue}if((!y||y.eles.length>=b||!y5(y.bb,C.boundingBox()))&&(y=v({insert:!0,after:y}),!y))return null;m||x?r.queueLayer(y,C):r.drawEleInLayer(y,C,n,t),y.eles.push(C),E[n]=y}return m||(x?null:d)},wn.getEleLevelForLayerLevel=function(e,t){return e},wn.drawEleInLayer=function(e,t,n,r){var a=this,i=this.renderer,s=e.context,l=t.boundingBox();l.w===0||l.h===0||!t.visible()||(n=a.getEleLevelForLayerLevel(n,r),i.setImgSmoothing(s,!1),i.drawCachedElement(s,t,null,null,n,Wle),i.setImgSmoothing(s,!0))},wn.levelIsComplete=function(e,t){var n=this,r=n.layersByLevel[e];if(!r||r.length===0)return!1;for(var a=0,i=0;i<r.length;i++){var s=r[i];if(s.reqs>0||s.invalid)return!1;a+=s.eles.length}return a===t.length},wn.validateLayersElesOrdering=function(e,t){var n=this.layersByLevel[e];if(n)for(var r=0;r<n.length;r++){for(var a=n[r],i=-1,s=0;s<t.length;s++)if(a.eles[0]===t[s]){i=s;break}if(i<0){this.invalidateLayer(a);continue}for(var l=i,s=0;s<a.eles.length;s++)if(a.eles[s]!==t[l+s]){this.invalidateLayer(a);break}}},wn.updateElementsInLayers=function(e,t){for(var n=this,r=Ac(e[0]),a=0;a<e.length;a++)for(var i=r?null:e[a],s=r?e[a]:e[a].ele,l=s._private.rscratch,u=l.imgLayerCaches=l.imgLayerCaches||{},c=lu;c<=kp;c++){var d=u[c];d&&(i&&n.getEleLevelForLayerLevel(d.level)!==i.level||t(d,s,i))}},wn.haveLayers=function(){for(var e=this,t=!1,n=lu;n<=kp;n++){var r=e.layersByLevel[n];if(r&&r.length>0){t=!0;break}}return t},wn.invalidateElements=function(e){var t=this;e.length!==0&&(t.lastInvalidationTime=Wo(),!(e.length===0||!t.haveLayers())&&t.updateElementsInLayers(e,function(n,r,a){t.invalidateLayer(n)}))},wn.invalidateLayer=function(e){if(this.lastInvalidationTime=Wo(),!e.invalid){var t=e.level,n=e.eles,r=this.layersByLevel[t];$a(r,e),e.elesQueue=[],e.invalid=!0,e.replacement&&(e.replacement.invalid=!0);for(var a=0;a<n.length;a++){var i=n[a]._private.rscratch.imgLayerCaches;i&&(i[t]=null)}}},wn.refineElementTextures=function(e){var t=this;t.updateElementsInLayers(e,function(n,r,a){var i=n.replacement;if(i||(i=n.replacement=t.makeLayer(n.bb,n.level),i.replaces=n,i.eles=n.eles),!i.reqs)for(var s=0;s<i.eles.length;s++)t.queueLayer(i,i.eles[s])})},wn.enqueueElementRefinement=function(e){this.eleTxrDeqs.merge(e),this.scheduleElementRefinement()},wn.queueLayer=function(e,t){var n=this,r=n.layersQueue,a=e.elesQueue,i=a.hasId=a.hasId||{};if(!e.replacement){if(t){if(i[t.id()])return;a.push(t),i[t.id()]=!0}e.reqs?(e.reqs++,r.updateItem(e)):(e.reqs=1,r.push(e))}},wn.dequeue=function(e){for(var t=this,n=t.layersQueue,r=[],a=0;a<qle&&n.size()!==0;){var i=n.peek();if(i.replacement){n.pop();continue}if(i.replaces&&i!==i.replaces.replacement){n.pop();continue}if(i.invalid){n.pop();continue}var s=i.elesQueue.shift();s&&(t.drawEleInLayer(i,s,i.level,e),a++),r.length===0&&r.push(!0),i.elesQueue.length===0&&(n.pop(),i.reqs=0,i.replaces&&t.applyLayerReplacement(i),t.requestRedraw())}return r},wn.applyLayerReplacement=function(e){var t=this,n=t.layersByLevel[e.level],r=e.replaces,a=n.indexOf(r);if(!(a<0||r.invalid)){n[a]=e;for(var i=0;i<e.eles.length;i++){var s=e.eles[i]._private,l=s.imgLayerCaches=s.imgLayerCaches||{};l&&(l[e.level]=e)}t.requestRedraw()}},wn.requestRedraw=Of(function(){var e=this.renderer;e.redrawHint("eles",!0),e.redrawHint("drag",!0),e.redraw()},100),wn.setupDequeueing=h_.setupDequeueing({deqRedrawThreshold:Vle,deqCost:zle,deqAvgCost:jle,deqNoDrawCost:Hle,deqFastCost:Ule,deq:function(e,t){return e.dequeue(t)},onDeqd:E0,shouldRedraw:s5,priority:function(e){return e.renderer.beforeRenderPriorities.lyrTxrDeq}});var b_={},w_;function Yle(e,t){for(var n=0;n<t.length;n++){var r=t[n];e.lineTo(r.x,r.y)}}function Xle(e,t,n){for(var r,a=0;a<t.length;a++){var i=t[a];a===0&&(r=i),e.lineTo(i.x,i.y)}e.quadraticCurveTo(n.x,n.y,r.x,r.y)}function x_(e,t,n){e.beginPath&&e.beginPath();for(var r=t,a=0;a<r.length;a++){var i=r[a];e.lineTo(i.x,i.y)}var s=n,l=n[0];e.moveTo(l.x,l.y);for(var a=1;a<s.length;a++){var i=s[a];e.lineTo(i.x,i.y)}e.closePath&&e.closePath()}function Jle(e,t,n,r,a){e.beginPath&&e.beginPath(),e.arc(n,r,a,0,Math.PI*2,!1);var i=t,s=i[0];e.moveTo(s.x,s.y);for(var l=0;l<i.length;l++){var u=i[l];e.lineTo(u.x,u.y)}e.closePath&&e.closePath()}function Zle(e,t,n,r){e.arc(t,n,r,0,Math.PI*2,!1)}b_.arrowShapeImpl=function(e){return(w_||(w_={polygon:Yle,"triangle-backcurve":Xle,"triangle-tee":x_,"circle-triangle":Jle,"triangle-cross":x_,circle:Zle}))[e]};var xo={};xo.drawElement=function(e,t,n,r,a,i){var s=this;t.isNode()?s.drawNode(e,t,n,r,a,i):s.drawEdge(e,t,n,r,a,i)},xo.drawElementOverlay=function(e,t){var n=this;t.isNode()?n.drawNodeOverlay(e,t):n.drawEdgeOverlay(e,t)},xo.drawElementUnderlay=function(e,t){var n=this;t.isNode()?n.drawNodeUnderlay(e,t):n.drawEdgeUnderlay(e,t)},xo.drawCachedElementPortion=function(e,t,n,r,a,i,s,l){var u=this,c=n.getBoundingBox(t);if(!(c.w===0||c.h===0)){var d=n.getElement(t,c,r,a,i);if(d!=null){var f=l(u,t);if(f===0)return;var h=s(u,t),m=c.x1,p=c.y1,g=c.w,v=c.h,y,b,x,w,C;if(h!==0){var k=n.getRotationPoint(t);x=k.x,w=k.y,e.translate(x,w),e.rotate(h),C=u.getImgSmoothing(e),C||u.setImgSmoothing(e,!0);var E=n.getRotationOffset(t);y=E.x,b=E.y}else y=m,b=p;var S;f!==1&&(S=e.globalAlpha,e.globalAlpha=S*f),e.drawImage(d.texture.canvas,d.x,0,d.width,d.height,y,b,g,v),f!==1&&(e.globalAlpha=S),h!==0&&(e.rotate(-h),e.translate(-x,-w),C||u.setImgSmoothing(e,!1))}else n.drawElement(e,t)}};var Qle=function(){return 0},ece=function(e,t){return e.getTextAngle(t,null)},tce=function(e,t){return e.getTextAngle(t,"source")},nce=function(e,t){return e.getTextAngle(t,"target")},rce=function(e,t){return t.effectiveOpacity()},uy=function(e,t){return t.pstyle("text-opacity").pfValue*t.effectiveOpacity()};xo.drawCachedElement=function(e,t,n,r,a,i){var s=this,l=s.data,u=l.eleTxrCache,c=l.lblTxrCache,d=l.slbTxrCache,f=l.tlbTxrCache,h=t.boundingBox(),m=i===!0?u.reasons.highQuality:null;if(!(h.w===0||h.h===0||!t.visible())&&(!r||T0(h,r))){var p=t.isEdge(),g=t.element()._private.rscratch.badLine;s.drawElementUnderlay(e,t),s.drawCachedElementPortion(e,t,u,n,a,m,Qle,rce),(!p||!g)&&s.drawCachedElementPortion(e,t,c,n,a,m,ece,uy),p&&!g&&(s.drawCachedElementPortion(e,t,d,n,a,m,tce,uy),s.drawCachedElementPortion(e,t,f,n,a,m,nce,uy)),s.drawElementOverlay(e,t)}},xo.drawElements=function(e,t){for(var n=this,r=0;r<t.length;r++){var a=t[r];n.drawElement(e,a)}},xo.drawCachedElements=function(e,t,n,r){for(var a=this,i=0;i<t.length;i++){var s=t[i];a.drawCachedElement(e,s,n,r)}},xo.drawCachedNodes=function(e,t,n,r){for(var a=this,i=0;i<t.length;i++){var s=t[i];s.isNode()&&a.drawCachedElement(e,s,n,r)}},xo.drawLayeredElements=function(e,t,n,r){var a=this,i=a.data.lyrTxrCache.getLayers(t,n);if(i)for(var s=0;s<i.length;s++){var l=i[s],u=l.bb;u.w===0||u.h===0||e.drawImage(l.canvas,u.x1,u.y1,u.w,u.h)}else a.drawCachedElements(e,t,n,r)};var Zo={};Zo.drawEdge=function(e,t,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,s=this,l=t._private.rscratch;if(!(i&&!t.visible())&&!(l.badLine||l.allpts==null||isNaN(l.allpts[0]))){var u;n&&(u=n,e.translate(-u.x1,-u.y1));var c=i?t.pstyle("opacity").value:1,d=i?t.pstyle("line-opacity").value:1,f=t.pstyle("curve-style").value,h=t.pstyle("line-style").value,m=t.pstyle("width").pfValue,p=t.pstyle("line-cap").value,g=t.pstyle("line-outline-width").value,v=t.pstyle("line-outline-color").value,y=c*d,b=c*d,x=function(){var F=arguments.length>0&&arguments[0]!==void 0?arguments[0]:y;f==="straight-triangle"?(s.eleStrokeStyle(e,t,F),s.drawEdgeTrianglePath(t,e,l.allpts)):(e.lineWidth=m,e.lineCap=p,s.eleStrokeStyle(e,t,F),s.drawEdgePath(t,e,l.allpts,h),e.lineCap="butt")},w=function(){var F=arguments.length>0&&arguments[0]!==void 0?arguments[0]:y;if(e.lineWidth=m+g,e.lineCap=p,g>0)s.colorStrokeStyle(e,v[0],v[1],v[2],F);else{e.lineCap="butt";return}f==="straight-triangle"?s.drawEdgeTrianglePath(t,e,l.allpts):(s.drawEdgePath(t,e,l.allpts,h),e.lineCap="butt")},C=function(){a&&s.drawEdgeOverlay(e,t)},k=function(){a&&s.drawEdgeUnderlay(e,t)},E=function(){var F=arguments.length>0&&arguments[0]!==void 0?arguments[0]:b;s.drawArrowheads(e,t,F)},S=function(){s.drawElementText(e,t,null,r)};e.lineJoin="round";var _=t.pstyle("ghost").value==="yes";if(_){var O=t.pstyle("ghost-offset-x").pfValue,T=t.pstyle("ghost-offset-y").pfValue,N=t.pstyle("ghost-opacity").value,A=y*N;e.translate(O,T),x(A),E(A),e.translate(-O,-T)}else w();k(),x(),E(),C(),S(),n&&e.translate(u.x1,u.y1)}};var k_=function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(t,n){if(n.visible()){var r=n.pstyle("".concat(e,"-opacity")).value;if(r!==0){var a=this,i=a.usePaths(),s=n._private.rscratch,l=n.pstyle("".concat(e,"-padding")).pfValue,u=2*l,c=n.pstyle("".concat(e,"-color")).value;t.lineWidth=u,s.edgeType==="self"&&!i?t.lineCap="butt":t.lineCap="round",a.colorStrokeStyle(t,c[0],c[1],c[2],r),a.drawEdgePath(n,t,s.allpts,"solid")}}}};Zo.drawEdgeOverlay=k_("overlay"),Zo.drawEdgeUnderlay=k_("underlay"),Zo.drawEdgePath=function(e,t,n,r){var a=e._private.rscratch,i=t,s,l=!1,u=this.usePaths(),c=e.pstyle("line-dash-pattern").pfValue,d=e.pstyle("line-dash-offset").pfValue;if(u){var f=n.join("$"),h=a.pathCacheKey&&a.pathCacheKey===f;h?(s=t=a.pathCache,l=!0):(s=t=new Path2D,a.pathCacheKey=f,a.pathCache=s)}if(i.setLineDash)switch(r){case"dotted":i.setLineDash([1,1]);break;case"dashed":i.setLineDash(c),i.lineDashOffset=d;break;case"solid":i.setLineDash([]);break}if(!l&&!a.badLine)switch(t.beginPath&&t.beginPath(),t.moveTo(n[0],n[1]),a.edgeType){case"bezier":case"self":case"compound":case"multibezier":for(var m=2;m+3<n.length;m+=4)t.quadraticCurveTo(n[m],n[m+1],n[m+2],n[m+3]);break;case"straight":case"haystack":for(var p=2;p+1<n.length;p+=2)t.lineTo(n[p],n[p+1]);break;case"segments":if(a.isRound){var g=zS(a.roundCorners),v;try{for(g.s();!(v=g.n()).done;){var y=v.value;r_(t,y)}}catch(x){g.e(x)}finally{g.f()}t.lineTo(n[n.length-2],n[n.length-1])}else for(var b=2;b+1<n.length;b+=2)t.lineTo(n[b],n[b+1]);break}t=i,u?t.stroke(s):t.stroke(),t.setLineDash&&t.setLineDash([])},Zo.drawEdgeTrianglePath=function(e,t,n){t.fillStyle=t.strokeStyle;for(var r=e.pstyle("width").pfValue,a=0;a+1<n.length;a+=2){var i=[n[a+2]-n[a],n[a+3]-n[a+1]],s=Math.sqrt(i[0]*i[0]+i[1]*i[1]),l=[i[1]/s,-i[0]/s],u=[l[0]*r/2,l[1]*r/2];t.beginPath(),t.moveTo(n[a]-u[0],n[a+1]-u[1]),t.lineTo(n[a]+u[0],n[a+1]+u[1]),t.lineTo(n[a+2],n[a+3]),t.closePath(),t.fill()}},Zo.drawArrowheads=function(e,t,n){var r=t._private.rscratch,a=r.edgeType==="haystack";a||this.drawArrowhead(e,t,"source",r.arrowStartX,r.arrowStartY,r.srcArrowAngle,n),this.drawArrowhead(e,t,"mid-target",r.midX,r.midY,r.midtgtArrowAngle,n),this.drawArrowhead(e,t,"mid-source",r.midX,r.midY,r.midsrcArrowAngle,n),a||this.drawArrowhead(e,t,"target",r.arrowEndX,r.arrowEndY,r.tgtArrowAngle,n)},Zo.drawArrowhead=function(e,t,n,r,a,i,s){if(!(isNaN(r)||r==null||isNaN(a)||a==null||isNaN(i)||i==null)){var l=this,u=t.pstyle(n+"-arrow-shape").value;if(u!=="none"){var c=t.pstyle(n+"-arrow-fill").value==="hollow"?"both":"filled",d=t.pstyle(n+"-arrow-fill").value,f=t.pstyle("width").pfValue,h=t.pstyle(n+"-arrow-width"),m=h.value==="match-line"?f:h.pfValue;h.units==="%"&&(m*=f);var p=t.pstyle("opacity").value;s===void 0&&(s=p);var g=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,c,f,u,m,r,a,i),e.globalCompositeOperation=g);var v=t.pstyle(n+"-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,r,a,i)}}},Zo.drawArrowShape=function(e,t,n,r,a,i,s,l,u){var c=this,d=this.usePaths()&&a!=="triangle-cross",f=!1,h,m=t,p={x:s,y:l},g=e.pstyle("arrow-scale").value,v=this.getArrowWidth(r,g),y=c.arrowShapes[a];if(d){var b=c.arrowPathCache=c.arrowPathCache||[],x=_i(a),w=b[x];w!=null?(h=t=w,f=!0):(h=t=new Path2D,b[x]=h)}f||(t.beginPath&&t.beginPath(),d?y.draw(t,1,0,{x:0,y:0},1):y.draw(t,v,u,p,r),t.closePath&&t.closePath()),t=m,d&&(t.translate(s,l),t.rotate(u),t.scale(v,v)),(n==="filled"||n==="both")&&(d?t.fill(h):t.fill()),(n==="hollow"||n==="both")&&(t.lineWidth=i/(d?v:1),t.lineJoin="miter",d?t.stroke(h):t.stroke()),d&&(t.scale(1/v,1/v),t.rotate(-u),t.translate(-s,-l))};var dy={};dy.safeDrawImage=function(e,t,n,r,a,i,s,l,u,c){if(!(a<=0||i<=0||u<=0||c<=0))try{e.drawImage(t,n,r,a,i,s,l,u,c)}catch(d){ut(d)}},dy.drawInscribedImage=function(e,t,n,r,a){var i=this,s=n.position(),l=s.x,u=s.y,c=n.cy().style(),d=c.getIndexedStyle.bind(c),f=d(n,"background-fit","value",r),h=d(n,"background-repeat","value",r),m=n.width(),p=n.height(),g=n.padding()*2,v=m+(d(n,"background-width-relative-to","value",r)==="inner"?0:g),y=p+(d(n,"background-height-relative-to","value",r)==="inner"?0:g),b=n._private.rscratch,x=d(n,"background-clip","value",r),w=x==="node",C=d(n,"background-image-opacity","value",r)*a,k=d(n,"background-image-smoothing","value",r),E=n.pstyle("corner-radius").value;E!=="auto"&&(E=n.pstyle("corner-radius").pfValue);var S=t.width||t.cachedW,_=t.height||t.cachedH;(S==null||_==null)&&(document.body.appendChild(t),S=t.cachedW=t.width||t.offsetWidth,_=t.cachedH=t.height||t.offsetHeight,document.body.removeChild(t));var O=S,T=_;if(d(n,"background-width","value",r)!=="auto"&&(d(n,"background-width","units",r)==="%"?O=d(n,"background-width","pfValue",r)*v:O=d(n,"background-width","pfValue",r)),d(n,"background-height","value",r)!=="auto"&&(d(n,"background-height","units",r)==="%"?T=d(n,"background-height","pfValue",r)*y:T=d(n,"background-height","pfValue",r)),!(O===0||T===0)){if(f==="contain"){var N=Math.min(v/O,y/T);O*=N,T*=N}else if(f==="cover"){var N=Math.max(v/O,y/T);O*=N,T*=N}var A=l-v/2,F=d(n,"background-position-x","units",r),D=d(n,"background-position-x","pfValue",r);F==="%"?A+=(v-O)*D:A+=D;var $=d(n,"background-offset-x","units",r),L=d(n,"background-offset-x","pfValue",r);$==="%"?A+=(v-O)*L:A+=L;var I=u-y/2,z=d(n,"background-position-y","units",r),G=d(n,"background-position-y","pfValue",r);z==="%"?I+=(y-T)*G:I+=G;var q=d(n,"background-offset-y","units",r),Y=d(n,"background-offset-y","pfValue",r);q==="%"?I+=(y-T)*Y:I+=Y,b.pathCache&&(A-=l,I-=u,l=0,u=0);var te=e.globalAlpha;e.globalAlpha=C;var le=i.getImgSmoothing(e),ue=!1;if(k==="no"&&le?(i.setImgSmoothing(e,!1),ue=!0):k==="yes"&&!le&&(i.setImgSmoothing(e,!0),ue=!0),h==="no-repeat")w&&(e.save(),b.pathCache?e.clip(b.pathCache):(i.nodeShapes[i.getNodeShape(n)].draw(e,l,u,v,y,E,b),e.clip())),i.safeDrawImage(e,t,0,0,S,_,A,I,O,T),w&&e.restore();else{var ne=e.createPattern(t,h);e.fillStyle=ne,i.nodeShapes[i.getNodeShape(n)].draw(e,l,u,v,y,E,b),e.translate(A,I),e.fill(),e.translate(-A,-I)}e.globalAlpha=te,ue&&i.setImgSmoothing(e,le)}};var Ri={};Ri.eleTextBiggerThanMin=function(e,t){if(!t){var n=e.cy().zoom(),r=this.getPixelRatio(),a=Math.ceil(B0(n*r));t=Math.pow(2,a)}var i=e.pstyle("font-size").pfValue*t,s=e.pstyle("min-zoomed-font-size").pfValue;return!(i<s)},Ri.drawElementText=function(e,t,n,r,a){var i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,s=this;if(r==null){if(i&&!s.eleTextBiggerThanMin(t))return}else if(r===!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 c=t.element()._private.rscratch.badLine,d=t.pstyle("label"),f=t.pstyle("source-label"),h=t.pstyle("target-label");if(c||(!d||!d.value)&&(!f||!f.value)&&(!h||!h.value))return;e.textAlign="center",e.textBaseline="bottom"}var m=!n,p;n&&(p=n,e.translate(-p.x1,-p.y1)),a==null?(s.drawText(e,t,null,m,i),t.isEdge()&&(s.drawText(e,t,"source",m,i),s.drawText(e,t,"target",m,i))):s.drawText(e,t,a,m,i),n&&e.translate(p.x1,p.y1)},Ri.getFontCache=function(e){var t;this.fontCaches=this.fontCaches||[];for(var n=0;n<this.fontCaches.length;n++)if(t=this.fontCaches[n],t.context===e)return t;return t={context:e},this.fontCaches.push(t),t},Ri.setupTextStyle=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,r=t.pstyle("font-style").strValue,a=t.pstyle("font-size").pfValue+"px",i=t.pstyle("font-family").strValue,s=t.pstyle("font-weight").strValue,l=n?t.effectiveOpacity()*t.pstyle("text-opacity").value:1,u=t.pstyle("text-outline-opacity").value*l,c=t.pstyle("color").value,d=t.pstyle("text-outline-color").value;e.font=r+" "+s+" "+a+" "+i,e.lineJoin="round",this.colorFillStyle(e,c[0],c[1],c[2],l),this.colorStrokeStyle(e,d[0],d[1],d[2],u)};function fy(e,t,n,r,a){var i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:5,s=arguments.length>6?arguments[6]:void 0;e.beginPath(),e.moveTo(t+i,n),e.lineTo(t+r-i,n),e.quadraticCurveTo(t+r,n,t+r,n+i),e.lineTo(t+r,n+a-i),e.quadraticCurveTo(t+r,n+a,t+r-i,n+a),e.lineTo(t+i,n+a),e.quadraticCurveTo(t,n+a,t,n+a-i),e.lineTo(t,n+i),e.quadraticCurveTo(t,n,t+i,n),e.closePath(),s?e.stroke():e.fill()}Ri.getTextAngle=function(e,t){var n,r=e._private,a=r.rscratch,i=t?t+"-":"",s=e.pstyle(i+"text-rotation"),l=Jr(a,"labelAngle",t);return s.strValue==="autorotate"?n=e.isEdge()?l:0:s.strValue==="none"?n=0:n=s.pfValue,n},Ri.drawText=function(e,t,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,i=t._private,s=i.rscratch,l=a?t.effectiveOpacity():1;if(!(a&&(l===0||t.pstyle("text-opacity").value===0))){n==="main"&&(n=null);var u=Jr(s,"labelX",n),c=Jr(s,"labelY",n),d,f,h=this.getLabelText(t,n);if(h!=null&&h!==""&&!isNaN(u)&&!isNaN(c)){this.setupTextStyle(e,t,a);var m=n?n+"-":"",p=Jr(s,"labelWidth",n),g=Jr(s,"labelHeight",n),v=t.pstyle(m+"text-margin-x").pfValue,y=t.pstyle(m+"text-margin-y").pfValue,b=t.isEdge(),x=t.pstyle("text-halign").value,w=t.pstyle("text-valign").value;b&&(x="center",w="center"),u+=v,c+=y;var C;switch(r?C=this.getTextAngle(t,n):C=0,C!==0&&(d=u,f=c,e.translate(d,f),e.rotate(C),u=0,c=0),w){case"top":break;case"center":c+=g/2;break;case"bottom":c+=g;break}var k=t.pstyle("text-background-opacity").value,E=t.pstyle("text-border-opacity").value,S=t.pstyle("text-border-width").pfValue,_=t.pstyle("text-background-padding").pfValue,O=t.pstyle("text-background-shape").strValue,T=O.indexOf("round")===0,N=2;if(k>0||S>0&&E>0){var A=u-_;switch(x){case"left":A-=p;break;case"center":A-=p/2;break}var F=c-g-_,D=p+2*_,$=g+2*_;if(k>0){var L=e.fillStyle,I=t.pstyle("text-background-color").value;e.fillStyle="rgba("+I[0]+","+I[1]+","+I[2]+","+k*l+")",T?fy(e,A,F,D,$,N):e.fillRect(A,F,D,$),e.fillStyle=L}if(S>0&&E>0){var z=e.strokeStyle,G=e.lineWidth,q=t.pstyle("text-border-color").value,Y=t.pstyle("text-border-style").value;if(e.strokeStyle="rgba("+q[0]+","+q[1]+","+q[2]+","+E*l+")",e.lineWidth=S,e.setLineDash)switch(Y){case"dotted":e.setLineDash([1,1]);break;case"dashed":e.setLineDash([4,2]);break;case"double":e.lineWidth=S/4,e.setLineDash([]);break;case"solid":e.setLineDash([]);break}if(T?fy(e,A,F,D,$,N,"stroke"):e.strokeRect(A,F,D,$),Y==="double"){var te=S/2;T?fy(e,A+te,F+te,D-te*2,$-te*2,N,"stroke"):e.strokeRect(A+te,F+te,D-te*2,$-te*2)}e.setLineDash&&e.setLineDash([]),e.lineWidth=G,e.strokeStyle=z}}var le=2*t.pstyle("text-outline-width").pfValue;if(le>0&&(e.lineWidth=le),t.pstyle("text-wrap").value==="wrap"){var ue=Jr(s,"labelWrapCachedLines",n),ne=Jr(s,"labelLineHeight",n),oe=p/2,U=this.getLabelJustification(t);switch(U==="auto"||(x==="left"?U==="left"?u+=-p:U==="center"&&(u+=-oe):x==="center"?U==="left"?u+=-oe:U==="right"&&(u+=oe):x==="right"&&(U==="center"?u+=oe:U==="right"&&(u+=p))),w){case"top":c-=(ue.length-1)*ne;break;case"center":case"bottom":c-=(ue.length-1)*ne;break}for(var K=0;K<ue.length;K++)le>0&&e.strokeText(ue[K],u,c),e.fillText(ue[K],u,c),c+=ne}else le>0&&e.strokeText(h,u,c),e.fillText(h,u,c);C!==0&&(e.rotate(-C),e.translate(-d,-f))}}};var sl={};sl.drawNode=function(e,t,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,s=this,l,u,c=t._private,d=c.rscratch,f=t.position();if(!(!Ee(f.x)||!Ee(f.y))&&!(i&&!t.visible())){var h=i?t.effectiveOpacity():1,m=s.usePaths(),p,g=!1,v=t.padding();l=t.width()+2*v,u=t.height()+2*v;var y;n&&(y=n,e.translate(-y.x1,-y.y1));for(var b=t.pstyle("background-image"),x=b.value,w=new Array(x.length),C=new Array(x.length),k=0,E=0;E<x.length;E++){var S=x[E],_=w[E]=S!=null&&S!=="none";if(_){var O=t.cy().style().getIndexedStyle(t,"background-image-crossorigin","value",E);k++,C[E]=s.getCachedImage(S,O,function(){c.backgroundTimestamp=Date.now(),t.emitAndNotify("background")})}}var T=t.pstyle("background-blacken").value,N=t.pstyle("border-width").pfValue,A=t.pstyle("background-opacity").value*h,F=t.pstyle("border-color").value,D=t.pstyle("border-style").value,$=t.pstyle("border-join").value,L=t.pstyle("border-cap").value,I=t.pstyle("border-position").value,z=t.pstyle("border-dash-pattern").pfValue,G=t.pstyle("border-dash-offset").pfValue,q=t.pstyle("border-opacity").value*h,Y=t.pstyle("outline-width").pfValue,te=t.pstyle("outline-color").value,le=t.pstyle("outline-style").value,ue=t.pstyle("outline-opacity").value*h,ne=t.pstyle("outline-offset").value,oe=t.pstyle("corner-radius").value;oe!=="auto"&&(oe=t.pstyle("corner-radius").pfValue);var U=function(){var he=arguments.length>0&&arguments[0]!==void 0?arguments[0]:A;s.eleFillStyle(e,t,he)},K=function(){var he=arguments.length>0&&arguments[0]!==void 0?arguments[0]:q;s.colorStrokeStyle(e,F[0],F[1],F[2],he)},J=function(){var he=arguments.length>0&&arguments[0]!==void 0?arguments[0]:ue;s.colorStrokeStyle(e,te[0],te[1],te[2],he)},de=function(he,ae,ye,Ae){var Ie=s.nodePathCache=s.nodePathCache||[],W=a5(ye==="polygon"?ye+","+Ae.join(","):ye,""+ae,""+he,""+oe),fe=Ie[W],ie,we=!1;return fe!=null?(ie=fe,we=!0,d.pathCache=ie):(ie=new Path2D,Ie[W]=d.pathCache=ie),{path:ie,cacheHit:we}},be=t.pstyle("shape").strValue,Be=t.pstyle("shape-polygon-points").pfValue;if(m){e.translate(f.x,f.y);var pe=de(l,u,be,Be);p=pe.path,g=pe.cacheHit}var xe=function(){if(!g){var he=f;m&&(he={x:0,y:0}),s.nodeShapes[s.getNodeShape(t)].draw(p||e,he.x,he.y,l,u,oe,d)}m?e.fill(p):e.fill()},ge=function(){for(var he=arguments.length>0&&arguments[0]!==void 0?arguments[0]:h,ae=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,ye=c.backgrounding,Ae=0,Ie=0;Ie<C.length;Ie++){var W=t.cy().style().getIndexedStyle(t,"background-image-containment","value",Ie);if(ae&&W==="over"||!ae&&W==="inside"){Ae++;continue}w[Ie]&&C[Ie].complete&&!C[Ie].error&&(Ae++,s.drawInscribedImage(e,C[Ie],t,Ie,he))}c.backgrounding=Ae!==k,ye!==c.backgrounding&&t.updateStyle(!1)},Ce=function(){var he=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,ae=arguments.length>1&&arguments[1]!==void 0?arguments[1]:h;s.hasPie(t)&&(s.drawPie(e,t,ae),he&&(m||s.nodeShapes[s.getNodeShape(t)].draw(e,f.x,f.y,l,u,oe,d)))},Ne=function(){var he=arguments.length>0&&arguments[0]!==void 0?arguments[0]:h,ae=(T>0?T:-T)*he,ye=T>0?0:255;T!==0&&(s.colorFillStyle(e,ye,ye,ye,ae),m?e.fill(p):e.fill())},Pe=function(){if(N>0){if(e.lineWidth=N,e.lineCap=L,e.lineJoin=$,e.setLineDash)switch(D){case"dotted":e.setLineDash([1,1]);break;case"dashed":e.setLineDash(z),e.lineDashOffset=G;break;case"solid":case"double":e.setLineDash([]);break}if(I!=="center"){if(e.save(),e.lineWidth*=2,I==="inside")m?e.clip(p):e.clip();else{var he=new Path2D;he.rect(-l/2-N,-u/2-N,l+2*N,u+2*N),he.addPath(p),e.clip(he,"evenodd")}m?e.stroke(p):e.stroke(),e.restore()}else m?e.stroke(p):e.stroke();if(D==="double"){e.lineWidth=N/3;var ae=e.globalCompositeOperation;e.globalCompositeOperation="destination-out",m?e.stroke(p):e.stroke(),e.globalCompositeOperation=ae}e.setLineDash&&e.setLineDash([])}},Se=function(){if(Y>0){if(e.lineWidth=Y,e.lineCap="butt",e.setLineDash)switch(le){case"dotted":e.setLineDash([1,1]);break;case"dashed":e.setLineDash([4,2]);break;case"solid":case"double":e.setLineDash([]);break}var he=f;m&&(he={x:0,y:0});var ae=s.getNodeShape(t),ye=N;I==="inside"&&(ye=0),I==="outside"&&(ye*=2);var Ae=(l+ye+(Y+ne))/l,Ie=(u+ye+(Y+ne))/u,W=l*Ae,fe=u*Ie,ie=s.nodeShapes[ae].points,we;if(m){var nt=de(W,fe,ae,ie);we=nt.path}if(ae==="ellipse")s.drawEllipsePath(we||e,he.x,he.y,W,fe);else if(["round-diamond","round-heptagon","round-hexagon","round-octagon","round-pentagon","round-polygon","round-triangle","round-tag"].includes(ae)){var Qe=0,lt=0,ft=0;ae==="round-diamond"?Qe=(ye+ne+Y)*1.4:ae==="round-heptagon"?(Qe=(ye+ne+Y)*1.075,ft=-(ye/2+ne+Y)/35):ae==="round-hexagon"?Qe=(ye+ne+Y)*1.12:ae==="round-pentagon"?(Qe=(ye+ne+Y)*1.13,ft=-(ye/2+ne+Y)/15):ae==="round-tag"?(Qe=(ye+ne+Y)*1.12,lt=(ye/2+Y+ne)*.07):ae==="round-triangle"&&(Qe=(ye+ne+Y)*(Math.PI/2),ft=-(ye+ne/2+Y)/Math.PI),Qe!==0&&(Ae=(l+Qe)/l,W=l*Ae,["round-hexagon","round-tag"].includes(ae)||(Ie=(u+Qe)/u,fe=u*Ie)),oe=oe==="auto"?w5(W,fe):oe;for(var gt=W/2,Kt=fe/2,Tt=oe+(ye+Y+ne)/2,Nt=new Array(ie.length/2),Wt=new Array(ie.length/2),Gt=0;Gt<ie.length/2;Gt++)Nt[Gt]={x:he.x+lt+gt*ie[Gt*2],y:he.y+ft+Kt*ie[Gt*2+1]};var Rt,$n,xn,kn,yt=Nt.length;for($n=Nt[yt-1],Rt=0;Rt<yt;Rt++)xn=Nt[Rt%yt],kn=Nt[(Rt+1)%yt],Wt[Rt]=iy($n,xn,kn,Tt),$n=xn,xn=kn;s.drawRoundPolygonPath(we||e,he.x+lt,he.y+ft,l*Ae,u*Ie,ie,Wt)}else if(["roundrectangle","round-rectangle"].includes(ae))oe=oe==="auto"?Oi(W,fe):oe,s.drawRoundRectanglePath(we||e,he.x,he.y,W,fe,oe+(ye+Y+ne)/2);else if(["cutrectangle","cut-rectangle"].includes(ae))oe=oe==="auto"?$0():oe,s.drawCutRectanglePath(we||e,he.x,he.y,W,fe,null,oe+(ye+Y+ne)/4);else if(["bottomroundrectangle","bottom-round-rectangle"].includes(ae))oe=oe==="auto"?Oi(W,fe):oe,s.drawBottomRoundRectanglePath(we||e,he.x,he.y,W,fe,oe+(ye+Y+ne)/2);else if(ae==="barrel")s.drawBarrelPath(we||e,he.x,he.y,W,fe);else if(ae.startsWith("polygon")||["rhomboid","right-rhomboid","round-tag","tag","vee"].includes(ae)){var Ot=(ye+Y+ne)/l;ie=Vf(Mf(ie,Ot)),s.drawPolygonPath(we||e,he.x,he.y,l,u,ie)}else{var Lt=(ye+Y+ne)/l;ie=Vf(Mf(ie,-Lt)),s.drawPolygonPath(we||e,he.x,he.y,l,u,ie)}if(m?e.stroke(we):e.stroke(),le==="double"){e.lineWidth=ye/3;var Fn=e.globalCompositeOperation;e.globalCompositeOperation="destination-out",m?e.stroke(we):e.stroke(),e.globalCompositeOperation=Fn}e.setLineDash&&e.setLineDash([])}},Le=function(){a&&s.drawNodeOverlay(e,t,f,l,u)},De=function(){a&&s.drawNodeUnderlay(e,t,f,l,u)},ze=function(){s.drawElementText(e,t,null,r)},B=t.pstyle("ghost").value==="yes";if(B){var V=t.pstyle("ghost-offset-x").pfValue,X=t.pstyle("ghost-offset-y").pfValue,Q=t.pstyle("ghost-opacity").value,ee=Q*h;e.translate(V,X),J(),Se(),U(Q*A),xe(),ge(ee,!0),K(Q*q),Pe(),Ce(T!==0||N!==0),ge(ee,!1),Ne(ee),e.translate(-V,-X)}m&&e.translate(-f.x,-f.y),De(),m&&e.translate(f.x,f.y),J(),Se(),U(),xe(),ge(h,!0),K(),Pe(),Ce(T!==0||N!==0),ge(h,!1),Ne(),m&&e.translate(-f.x,-f.y),ze(),Le(),n&&e.translate(y.x1,y.y1)}};var C_=function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(t,n,r,a,i){var s=this;if(n.visible()){var l=n.pstyle("".concat(e,"-padding")).pfValue,u=n.pstyle("".concat(e,"-opacity")).value,c=n.pstyle("".concat(e,"-color")).value,d=n.pstyle("".concat(e,"-shape")).value,f=n.pstyle("".concat(e,"-corner-radius")).value;if(u>0){if(r=r||n.position(),a==null||i==null){var h=n.padding();a=n.width()+2*h,i=n.height()+2*h}s.colorFillStyle(t,c[0],c[1],c[2],u),s.nodeShapes[d].draw(t,r.x,r.y,a+l*2,i+l*2,f),t.fill()}}}};sl.drawNodeOverlay=C_("overlay"),sl.drawNodeUnderlay=C_("underlay"),sl.hasPie=function(e){return e=e[0],e._private.hasPie},sl.drawPie=function(e,t,n,r){t=t[0],r=r||t.position();var a=t.cy().style(),i=t.pstyle("pie-size"),s=r.x,l=r.y,u=t.width(),c=t.height(),d=Math.min(u,c)/2,f=0,h=this.usePaths();h&&(s=0,l=0),i.units==="%"?d=d*i.pfValue:i.pfValue!==void 0&&(d=i.pfValue/2);for(var m=1;m<=a.pieBackgroundN;m++){var p=t.pstyle("pie-"+m+"-background-size").value,g=t.pstyle("pie-"+m+"-background-color").value,v=t.pstyle("pie-"+m+"-background-opacity").value*n,y=p/100;y+f>1&&(y=1-f);var b=1.5*Math.PI+2*Math.PI*f,x=2*Math.PI*y,w=b+x;p===0||f>=1||f+y>1||(e.beginPath(),e.moveTo(s,l),e.arc(s,l,d,b,w),e.closePath(),this.colorFillStyle(e,g[0],g[1],g[2],v),e.fill(),f+=y)}};var dr={},oce=100;dr.getPixelRatio=function(){var e=this.data.contexts[0];if(this.forcedPixelRatio!=null)return this.forcedPixelRatio;var t=this.cy.window(),n=e.backingStorePixelRatio||e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1;return(t.devicePixelRatio||1)/n},dr.paintCache=function(e){for(var t=this.paintCaches=this.paintCaches||[],n=!0,r,a=0;a<t.length;a++)if(r=t[a],r.context===e){n=!1;break}return n&&(r={context:e},t.push(r)),r},dr.createGradientStyleFor=function(e,t,n,r,a){var i,s=this.usePaths(),l=n.pstyle(t+"-gradient-stop-colors").value,u=n.pstyle(t+"-gradient-stop-positions").pfValue;if(r==="radial-gradient")if(n.isEdge()){var c=n.sourceEndpoint(),d=n.targetEndpoint(),f=n.midpoint(),h=Bi(c,f),m=Bi(d,f);i=e.createRadialGradient(f.x,f.y,0,f.x,f.y,Math.max(h,m))}else{var p=s?{x:0,y:0}:n.position(),g=n.paddedWidth(),v=n.paddedHeight();i=e.createRadialGradient(p.x,p.y,0,p.x,p.y,Math.max(g,v))}else if(n.isEdge()){var y=n.sourceEndpoint(),b=n.targetEndpoint();i=e.createLinearGradient(y.x,y.y,b.x,b.y)}else{var x=s?{x:0,y:0}:n.position(),w=n.paddedWidth(),C=n.paddedHeight(),k=w/2,E=C/2,S=n.pstyle("background-gradient-direction").value;switch(S){case"to-bottom":i=e.createLinearGradient(x.x,x.y-E,x.x,x.y+E);break;case"to-top":i=e.createLinearGradient(x.x,x.y+E,x.x,x.y-E);break;case"to-left":i=e.createLinearGradient(x.x+k,x.y,x.x-k,x.y);break;case"to-right":i=e.createLinearGradient(x.x-k,x.y,x.x+k,x.y);break;case"to-bottom-right":case"to-right-bottom":i=e.createLinearGradient(x.x-k,x.y-E,x.x+k,x.y+E);break;case"to-top-right":case"to-right-top":i=e.createLinearGradient(x.x-k,x.y+E,x.x+k,x.y-E);break;case"to-bottom-left":case"to-left-bottom":i=e.createLinearGradient(x.x+k,x.y-E,x.x-k,x.y+E);break;case"to-top-left":case"to-left-top":i=e.createLinearGradient(x.x+k,x.y+E,x.x-k,x.y-E);break}}if(!i)return null;for(var _=u.length===l.length,O=l.length,T=0;T<O;T++)i.addColorStop(_?u[T]:T/(O-1),"rgba("+l[T][0]+","+l[T][1]+","+l[T][2]+","+a+")");return i},dr.gradientFillStyle=function(e,t,n,r){var a=this.createGradientStyleFor(e,"background",t,n,r);if(!a)return null;e.fillStyle=a},dr.colorFillStyle=function(e,t,n,r,a){e.fillStyle="rgba("+t+","+n+","+r+","+a+")"},dr.eleFillStyle=function(e,t,n){var r=t.pstyle("background-fill").value;if(r==="linear-gradient"||r==="radial-gradient")this.gradientFillStyle(e,t,r,n);else{var a=t.pstyle("background-color").value;this.colorFillStyle(e,a[0],a[1],a[2],n)}},dr.gradientStrokeStyle=function(e,t,n,r){var a=this.createGradientStyleFor(e,"line",t,n,r);if(!a)return null;e.strokeStyle=a},dr.colorStrokeStyle=function(e,t,n,r,a){e.strokeStyle="rgba("+t+","+n+","+r+","+a+")"},dr.eleStrokeStyle=function(e,t,n){var r=t.pstyle("line-fill").value;if(r==="linear-gradient"||r==="radial-gradient")this.gradientStrokeStyle(e,t,r,n);else{var a=t.pstyle("line-color").value;this.colorStrokeStyle(e,a[0],a[1],a[2],n)}},dr.matchCanvasSize=function(e){var t=this,n=t.data,r=t.findContainerClientCoords(),a=r[2],i=r[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=a*s,c=i*s,d;if(!(u===t.canvasWidth&&c===t.canvasHeight)){t.fontCaches=null;var f=n.canvasContainer;f.style.width=a+"px",f.style.height=i+"px";for(var h=0;h<t.CANVAS_LAYERS;h++)d=n.canvases[h],d.width=u,d.height=c,d.style.width=a+"px",d.style.height=i+"px";for(var h=0;h<t.BUFFER_COUNT;h++)d=n.bufferCanvases[h],d.width=u,d.height=c,d.style.width=a+"px",d.style.height=i+"px";t.textureMult=1,s<=1&&(d=n.bufferCanvases[t.TEXTURE_BUFFER],t.textureMult=2,d.width=u*t.textureMult,d.height=c*t.textureMult),t.canvasWidth=u,t.canvasHeight=c}},dr.renderTo=function(e,t,n,r){this.render({forcedContext:e,forcedZoom:t,forcedPan:n,drawAllLayers:!0,forcedPxRatio:r})},dr.render=function(e){e=e||d5();var t=e.forcedContext,n=e.drawAllLayers,r=e.drawOnlyNodeLayer,a=e.forcedZoom,i=e.forcedPan,s=this,l=e.forcedPxRatio===void 0?this.getPixelRatio():e.forcedPxRatio,u=s.cy,c=s.data,d=c.canvasNeedsRedraw,f=s.textureOnViewport&&!t&&(s.pinching||s.hoverData.dragging||s.swipePanning||s.data.wheelZooming),h=e.motionBlur!==void 0?e.motionBlur:s.motionBlur,m=s.motionBlurPxRatio,p=u.hasCompoundNodes(),g=s.hoverData.draggingEles,v=!!(s.hoverData.selecting||s.touchData.selecting);h=h&&!t&&s.motionBlurEnabled&&!v;var y=h;t||(s.prevPxRatio!==l&&(s.invalidateContainerClientCoordsCache(),s.matchCanvasSize(s.container),s.redrawHint("eles",!0),s.redrawHint("drag",!0)),s.prevPxRatio=l),!t&&s.motionBlurTimeout&&clearTimeout(s.motionBlurTimeout),h&&(s.mbFrames==null&&(s.mbFrames=0),s.mbFrames++,s.mbFrames<3&&(y=!1),s.mbFrames>s.minMbLowQualFrames&&(s.motionBlurPxRatio=s.mbPxRBlurry)),s.clearingMotionBlur&&(s.motionBlurPxRatio=1),s.textureDrawLastFrame&&!f&&(d[s.NODE]=!0,d[s.SELECT_BOX]=!0);var b=u.style(),x=u.zoom(),w=a!==void 0?a:x,C=u.pan(),k={x:C.x,y:C.y},E={zoom:x,pan:{x:C.x,y:C.y}},S=s.prevViewport,_=S===void 0||E.zoom!==S.zoom||E.pan.x!==S.pan.x||E.pan.y!==S.pan.y;!_&&!(g&&!p)&&(s.motionBlurPxRatio=1),i&&(k=i),w*=l,k.x*=l,k.y*=l;var O=s.getCachedZSortedEles();function T(pe,xe,ge,Ce,Ne){var Pe=pe.globalCompositeOperation;pe.globalCompositeOperation="destination-out",s.colorFillStyle(pe,255,255,255,s.motionBlurTransparency),pe.fillRect(xe,ge,Ce,Ne),pe.globalCompositeOperation=Pe}function N(pe,xe){var ge,Ce,Ne,Pe;!s.clearingMotionBlur&&(pe===c.bufferContexts[s.MOTIONBLUR_BUFFER_NODE]||pe===c.bufferContexts[s.MOTIONBLUR_BUFFER_DRAG])?(ge={x:C.x*m,y:C.y*m},Ce=x*m,Ne=s.canvasWidth*m,Pe=s.canvasHeight*m):(ge=k,Ce=w,Ne=s.canvasWidth,Pe=s.canvasHeight),pe.setTransform(1,0,0,1,0,0),xe==="motionBlur"?T(pe,0,0,Ne,Pe):!t&&(xe===void 0||xe)&&pe.clearRect(0,0,Ne,Pe),n||(pe.translate(ge.x,ge.y),pe.scale(Ce,Ce)),i&&pe.translate(i.x,i.y),a&&pe.scale(a,a)}if(f||(s.textureDrawLastFrame=!1),f){if(s.textureDrawLastFrame=!0,!s.textureCache){s.textureCache={},s.textureCache.bb=u.mutableElements().boundingBox(),s.textureCache.texture=s.data.bufferCanvases[s.TEXTURE_BUFFER];var A=s.data.bufferContexts[s.TEXTURE_BUFFER];A.setTransform(1,0,0,1,0,0),A.clearRect(0,0,s.canvasWidth*s.textureMult,s.canvasHeight*s.textureMult),s.render({forcedContext:A,drawOnlyNodeLayer:!0,forcedPxRatio:l*s.textureMult});var E=s.textureCache.viewport={zoom:u.zoom(),pan:u.pan(),width:s.canvasWidth,height:s.canvasHeight};E.mpan={x:(0-E.pan.x)/E.zoom,y:(0-E.pan.y)/E.zoom}}d[s.DRAG]=!1,d[s.NODE]=!1;var F=c.contexts[s.NODE],D=s.textureCache.texture,E=s.textureCache.viewport;F.setTransform(1,0,0,1,0,0),h?T(F,0,0,E.width,E.height):F.clearRect(0,0,E.width,E.height);var $=b.core("outside-texture-bg-color").value,L=b.core("outside-texture-bg-opacity").value;s.colorFillStyle(F,$[0],$[1],$[2],L),F.fillRect(0,0,E.width,E.height);var x=u.zoom();N(F,!1),F.clearRect(E.mpan.x,E.mpan.y,E.width/E.zoom/l,E.height/E.zoom/l),F.drawImage(D,E.mpan.x,E.mpan.y,E.width/E.zoom/l,E.height/E.zoom/l)}else s.textureOnViewport&&!t&&(s.textureCache=null);var I=u.extent(),z=s.pinching||s.hoverData.dragging||s.swipePanning||s.data.wheelZooming||s.hoverData.draggingEles||s.cy.animated(),G=s.hideEdgesOnViewport&&z,q=[];if(q[s.NODE]=!d[s.NODE]&&h&&!s.clearedForMotionBlur[s.NODE]||s.clearingMotionBlur,q[s.NODE]&&(s.clearedForMotionBlur[s.NODE]=!0),q[s.DRAG]=!d[s.DRAG]&&h&&!s.clearedForMotionBlur[s.DRAG]||s.clearingMotionBlur,q[s.DRAG]&&(s.clearedForMotionBlur[s.DRAG]=!0),d[s.NODE]||n||r||q[s.NODE]){var Y=h&&!q[s.NODE]&&m!==1,F=t||(Y?s.data.bufferContexts[s.MOTIONBLUR_BUFFER_NODE]:c.contexts[s.NODE]),te=h&&!Y?"motionBlur":void 0;N(F,te),G?s.drawCachedNodes(F,O.nondrag,l,I):s.drawLayeredElements(F,O.nondrag,l,I),s.debug&&s.drawDebugPoints(F,O.nondrag),!n&&!h&&(d[s.NODE]=!1)}if(!r&&(d[s.DRAG]||n||q[s.DRAG])){var Y=h&&!q[s.DRAG]&&m!==1,F=t||(Y?s.data.bufferContexts[s.MOTIONBLUR_BUFFER_DRAG]:c.contexts[s.DRAG]);N(F,h&&!Y?"motionBlur":void 0),G?s.drawCachedNodes(F,O.drag,l,I):s.drawCachedElements(F,O.drag,l,I),s.debug&&s.drawDebugPoints(F,O.drag),!n&&!h&&(d[s.DRAG]=!1)}if(s.showFps||!r&&d[s.SELECT_BOX]&&!n){var F=t||c.contexts[s.SELECT_BOX];if(N(F),s.selection[4]==1&&(s.hoverData.selecting||s.touchData.selecting)){var x=s.cy.zoom(),le=b.core("selection-box-border-width").value/x;F.lineWidth=le,F.fillStyle="rgba("+b.core("selection-box-color").value[0]+","+b.core("selection-box-color").value[1]+","+b.core("selection-box-color").value[2]+","+b.core("selection-box-opacity").value+")",F.fillRect(s.selection[0],s.selection[1],s.selection[2]-s.selection[0],s.selection[3]-s.selection[1]),le>0&&(F.strokeStyle="rgba("+b.core("selection-box-border-color").value[0]+","+b.core("selection-box-border-color").value[1]+","+b.core("selection-box-border-color").value[2]+","+b.core("selection-box-opacity").value+")",F.strokeRect(s.selection[0],s.selection[1],s.selection[2]-s.selection[0],s.selection[3]-s.selection[1]))}if(c.bgActivePosistion&&!s.hoverData.selecting){var x=s.cy.zoom(),ue=c.bgActivePosistion;F.fillStyle="rgba("+b.core("active-bg-color").value[0]+","+b.core("active-bg-color").value[1]+","+b.core("active-bg-color").value[2]+","+b.core("active-bg-opacity").value+")",F.beginPath(),F.arc(ue.x,ue.y,b.core("active-bg-size").pfValue/x,0,2*Math.PI),F.fill()}var ne=s.lastRedrawTime;if(s.showFps&&ne){ne=Math.round(ne);var oe=Math.round(1e3/ne);F.setTransform(1,0,0,1,0,0),F.fillStyle="rgba(255, 0, 0, 0.75)",F.strokeStyle="rgba(255, 0, 0, 0.75)",F.lineWidth=1,F.fillText("1 frame = "+ne+" ms = "+oe+" fps",0,20);var U=60;F.strokeRect(0,30,250,20),F.fillRect(0,30,250*Math.min(oe/U,1),20)}n||(d[s.SELECT_BOX]=!1)}if(h&&m!==1){var K=c.contexts[s.NODE],J=s.data.bufferCanvases[s.MOTIONBLUR_BUFFER_NODE],de=c.contexts[s.DRAG],be=s.data.bufferCanvases[s.MOTIONBLUR_BUFFER_DRAG],Be=function(pe,xe,ge){pe.setTransform(1,0,0,1,0,0),ge||!y?pe.clearRect(0,0,s.canvasWidth,s.canvasHeight):T(pe,0,0,s.canvasWidth,s.canvasHeight);var Ce=m;pe.drawImage(xe,0,0,s.canvasWidth*Ce,s.canvasHeight*Ce,0,0,s.canvasWidth,s.canvasHeight)};(d[s.NODE]||q[s.NODE])&&(Be(K,J,q[s.NODE]),d[s.NODE]=!1),(d[s.DRAG]||q[s.DRAG])&&(Be(de,be,q[s.DRAG]),d[s.DRAG]=!1)}s.prevViewport=E,s.clearingMotionBlur&&(s.clearingMotionBlur=!1,s.motionBlurCleared=!0,s.motionBlur=!0),h&&(s.motionBlurTimeout=setTimeout(function(){s.motionBlurTimeout=null,s.clearedForMotionBlur[s.NODE]=!1,s.clearedForMotionBlur[s.DRAG]=!1,s.motionBlur=!1,s.clearingMotionBlur=!f,s.mbFrames=0,d[s.NODE]=!0,d[s.DRAG]=!0,s.redraw()},oce)),t||u.emit("render")};var za={};za.drawPolygonPath=function(e,t,n,r,a,i){var s=r/2,l=a/2;e.beginPath&&e.beginPath(),e.moveTo(t+s*i[0],n+l*i[1]);for(var u=1;u<i.length/2;u++)e.lineTo(t+s*i[u*2],n+l*i[u*2+1]);e.closePath()},za.drawRoundPolygonPath=function(e,t,n,r,a,i,s){s.forEach(function(l){return r_(e,l)}),e.closePath()},za.drawRoundRectanglePath=function(e,t,n,r,a,i){var s=r/2,l=a/2,u=i==="auto"?Oi(r,a):Math.min(i,l,s);e.beginPath&&e.beginPath(),e.moveTo(t,n-l),e.arcTo(t+s,n-l,t+s,n,u),e.arcTo(t+s,n+l,t,n+l,u),e.arcTo(t-s,n+l,t-s,n,u),e.arcTo(t-s,n-l,t,n-l,u),e.lineTo(t,n-l),e.closePath()},za.drawBottomRoundRectanglePath=function(e,t,n,r,a,i){var s=r/2,l=a/2,u=i==="auto"?Oi(r,a):i;e.beginPath&&e.beginPath(),e.moveTo(t,n-l),e.lineTo(t+s,n-l),e.lineTo(t+s,n),e.arcTo(t+s,n+l,t,n+l,u),e.arcTo(t-s,n+l,t-s,n,u),e.lineTo(t-s,n-l),e.lineTo(t,n-l),e.closePath()},za.drawCutRectanglePath=function(e,t,n,r,a,i,s){var l=r/2,u=a/2,c=s==="auto"?$0():s;e.beginPath&&e.beginPath(),e.moveTo(t-l+c,n-u),e.lineTo(t+l-c,n-u),e.lineTo(t+l,n-u+c),e.lineTo(t+l,n+u-c),e.lineTo(t+l-c,n+u),e.lineTo(t-l+c,n+u),e.lineTo(t-l,n+u-c),e.lineTo(t-l,n-u+c),e.closePath()},za.drawBarrelPath=function(e,t,n,r,a){var i=r/2,s=a/2,l=t-i,u=t+i,c=n-s,d=n+s,f=F0(r,a),h=f.widthOffset,m=f.heightOffset,p=f.ctrlPtOffsetPct*h;e.beginPath&&e.beginPath(),e.moveTo(l,c+m),e.lineTo(l,d-m),e.quadraticCurveTo(l+p,d,l+h,d),e.lineTo(u-h,d),e.quadraticCurveTo(u-p,d,u,d-m),e.lineTo(u,c+m),e.quadraticCurveTo(u-p,c,u-h,c),e.lineTo(l+h,c),e.quadraticCurveTo(l+p,c,l,c+m),e.closePath()};for(var E_=Math.sin(0),S_=Math.cos(0),py={},hy={},__=Math.PI/40,ll=0*Math.PI;ll<2*Math.PI;ll+=__)py[ll]=Math.sin(ll),hy[ll]=Math.cos(ll);za.drawEllipsePath=function(e,t,n,r,a){if(e.beginPath&&e.beginPath(),e.ellipse)e.ellipse(t,n,r/2,a/2,0,0,2*Math.PI);else for(var i,s,l=r/2,u=a/2,c=0*Math.PI;c<2*Math.PI;c+=__)i=t-l*py[c]*E_+l*hy[c]*S_,s=n+u*hy[c]*E_+u*py[c]*S_,c===0?e.moveTo(i,s):e.lineTo(i,s);e.closePath()};var cu={};cu.createBuffer=function(e,t){var n=document.createElement("canvas");return n.width=e,n.height=t,[n,n.getContext("2d")]},cu.bufferCanvasImage=function(e){var t=this.cy,n=t.mutableElements(),r=n.boundingBox(),a=this.findContainerClientCoords(),i=e.full?Math.ceil(r.w):a[2],s=e.full?Math.ceil(r.h):a[3],l=Ee(e.maxWidth)||Ee(e.maxHeight),u=this.getPixelRatio(),c=1;if(e.scale!==void 0)i*=e.scale,s*=e.scale,c=e.scale;else if(l){var d=1/0,f=1/0;Ee(e.maxWidth)&&(d=c*e.maxWidth/i),Ee(e.maxHeight)&&(f=c*e.maxHeight/s),c=Math.min(d,f),i*=c,s*=c}l||(i*=u,s*=u,c*=u);var h=document.createElement("canvas");h.width=i,h.height=s,h.style.width=i+"px",h.style.height=s+"px";var m=h.getContext("2d");if(i>0&&s>0){m.clearRect(0,0,i,s),m.globalCompositeOperation="source-over";var p=this.getCachedZSortedEles();if(e.full)m.translate(-r.x1*c,-r.y1*c),m.scale(c,c),this.drawElements(m,p),m.scale(1/c,1/c),m.translate(r.x1*c,r.y1*c);else{var g=t.pan(),v={x:g.x*c,y:g.y*c};c*=t.zoom(),m.translate(v.x,v.y),m.scale(c,c),this.drawElements(m,p),m.scale(1/c,1/c),m.translate(-v.x,-v.y)}e.bg&&(m.globalCompositeOperation="destination-over",m.fillStyle=e.bg,m.rect(0,0,i,s),m.fill())}return h};function ace(e,t){for(var n=atob(e),r=new ArrayBuffer(n.length),a=new Uint8Array(r),i=0;i<n.length;i++)a[i]=n.charCodeAt(i);return new Blob([r],{type:t})}function B_(e){var t=e.indexOf(",");return e.substr(t+1)}function T_(e,t,n){var r=function(){return t.toDataURL(n,e.quality)};switch(e.output){case"blob-promise":return new qs(function(a,i){try{t.toBlob(function(s){s!=null?a(s):i(new Error("`canvas.toBlob()` sent a null value in its callback"))},n,e.quality)}catch(s){i(s)}});case"blob":return ace(B_(r()),n);case"base64":return B_(r());case"base64uri":default:return r()}}cu.png=function(e){return T_(e,this.bufferCanvasImage(e),"image/png")},cu.jpg=function(e){return T_(e,this.bufferCanvasImage(e),"image/jpeg")};var N_={};N_.nodeShapeImpl=function(e,t,n,r,a,i,s,l){switch(e){case"ellipse":return this.drawEllipsePath(t,n,r,a,i);case"polygon":return this.drawPolygonPath(t,n,r,a,i,s);case"round-polygon":return this.drawRoundPolygonPath(t,n,r,a,i,s,l);case"roundrectangle":case"round-rectangle":return this.drawRoundRectanglePath(t,n,r,a,i,l);case"cutrectangle":case"cut-rectangle":return this.drawCutRectanglePath(t,n,r,a,i,s,l);case"bottomroundrectangle":case"bottom-round-rectangle":return this.drawBottomRoundRectanglePath(t,n,r,a,i,l);case"barrel":return this.drawBarrelPath(t,n,r,a,i)}};var ice=O_,st=O_.prototype;st.CANVAS_LAYERS=3,st.SELECT_BOX=0,st.DRAG=1,st.NODE=2,st.BUFFER_COUNT=3,st.TEXTURE_BUFFER=0,st.MOTIONBLUR_BUFFER_NODE=1,st.MOTIONBLUR_BUFFER_DRAG=2;function O_(e){var t=this,n=t.cy.window(),r=n.document;t.data={canvases:new Array(st.CANVAS_LAYERS),contexts:new Array(st.CANVAS_LAYERS),canvasNeedsRedraw:new Array(st.CANVAS_LAYERS),bufferCanvases:new Array(st.BUFFER_COUNT),bufferContexts:new Array(st.CANVAS_LAYERS)};var a="-webkit-tap-highlight-color",i="rgba(0,0,0,0)";t.data.canvasContainer=r.createElement("div");var s=t.data.canvasContainer.style;t.data.canvasContainer.style[a]=i,s.position="relative",s.zIndex="0",s.overflow="hidden";var l=e.cy.container();l.appendChild(t.data.canvasContainer),l.style[a]=i;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"};Wte()&&(u["-ms-touch-action"]="none",u["touch-action"]="none");for(var c=0;c<st.CANVAS_LAYERS;c++){var d=t.data.canvases[c]=r.createElement("canvas");t.data.contexts[c]=d.getContext("2d"),Object.keys(u).forEach(function(U){d.style[U]=u[U]}),d.style.position="absolute",d.setAttribute("data-id","layer"+c),d.style.zIndex=String(st.CANVAS_LAYERS-c),t.data.canvasContainer.appendChild(d),t.data.canvasNeedsRedraw[c]=!1}t.data.topCanvas=t.data.canvases[0],t.data.canvases[st.NODE].setAttribute("data-id","layer"+st.NODE+"-node"),t.data.canvases[st.SELECT_BOX].setAttribute("data-id","layer"+st.SELECT_BOX+"-selectbox"),t.data.canvases[st.DRAG].setAttribute("data-id","layer"+st.DRAG+"-drag");for(var c=0;c<st.BUFFER_COUNT;c++)t.data.bufferCanvases[c]=r.createElement("canvas"),t.data.bufferContexts[c]=t.data.bufferCanvases[c].getContext("2d"),t.data.bufferCanvases[c].style.position="absolute",t.data.bufferCanvases[c].setAttribute("data-id","buffer"+c),t.data.bufferCanvases[c].style.zIndex=String(-c-1),t.data.bufferCanvases[c].style.visibility="hidden";t.pathsEnabled=!0;var f=er(),h=function(U){return{x:(U.x1+U.x2)/2,y:(U.y1+U.y2)/2}},m=function(U){return{x:-U.w/2,y:-U.h/2}},p=function(U){var K=U[0]._private,J=K.oldBackgroundTimestamp===K.backgroundTimestamp;return!J},g=function(U){return U[0]._private.nodeKey},v=function(U){return U[0]._private.labelStyleKey},y=function(U){return U[0]._private.sourceLabelStyleKey},b=function(U){return U[0]._private.targetLabelStyleKey},x=function(U,K,J,de,be){return t.drawElement(U,K,J,!1,!1,be)},w=function(U,K,J,de,be){return t.drawElementText(U,K,J,de,"main",be)},C=function(U,K,J,de,be){return t.drawElementText(U,K,J,de,"source",be)},k=function(U,K,J,de,be){return t.drawElementText(U,K,J,de,"target",be)},E=function(U){return U.boundingBox(),U[0]._private.bodyBounds},S=function(U){return U.boundingBox(),U[0]._private.labelBounds.main||f},_=function(U){return U.boundingBox(),U[0]._private.labelBounds.source||f},O=function(U){return U.boundingBox(),U[0]._private.labelBounds.target||f},T=function(U,K){return K},N=function(U){return h(E(U))},A=function(U,K,J){var de=U?U+"-":"";return{x:K.x+J.pstyle(de+"text-margin-x").pfValue,y:K.y+J.pstyle(de+"text-margin-y").pfValue}},F=function(U,K,J){var de=U[0]._private.rscratch;return{x:de[K],y:de[J]}},D=function(U){return A("",F(U,"labelX","labelY"),U)},$=function(U){return A("source",F(U,"sourceLabelX","sourceLabelY"),U)},L=function(U){return A("target",F(U,"targetLabelX","targetLabelY"),U)},I=function(U){return m(E(U))},z=function(U){return m(_(U))},G=function(U){return m(O(U))},q=function(U){var K=S(U),J=m(S(U));if(U.isNode()){switch(U.pstyle("text-halign").value){case"left":J.x=-K.w;break;case"right":J.x=0;break}switch(U.pstyle("text-valign").value){case"top":J.y=-K.h;break;case"bottom":J.y=0;break}}return J},Y=t.data.eleTxrCache=new su(t,{getKey:g,doesEleInvalidateKey:p,drawElement:x,getBoundingBox:E,getRotationPoint:N,getRotationOffset:I,allowEdgeTxrCaching:!1,allowParentTxrCaching:!1}),te=t.data.lblTxrCache=new su(t,{getKey:v,drawElement:w,getBoundingBox:S,getRotationPoint:D,getRotationOffset:q,isVisible:T}),le=t.data.slbTxrCache=new su(t,{getKey:y,drawElement:C,getBoundingBox:_,getRotationPoint:$,getRotationOffset:z,isVisible:T}),ue=t.data.tlbTxrCache=new su(t,{getKey:b,drawElement:k,getBoundingBox:O,getRotationPoint:L,getRotationOffset:G,isVisible:T}),ne=t.data.lyrTxrCache=new y_(t);t.onUpdateEleCalcs(function(U,K){Y.invalidateElements(K),te.invalidateElements(K),le.invalidateElements(K),ue.invalidateElements(K),ne.invalidateElements(K);for(var J=0;J<K.length;J++){var de=K[J]._private;de.oldBackgroundTimestamp=de.backgroundTimestamp}});var oe=function(U){for(var K=0;K<U.length;K++)ne.enqueueElementRefinement(U[K].ele)};Y.onDequeue(oe),te.onDequeue(oe),le.onDequeue(oe),ue.onDequeue(oe)}st.redrawHint=function(e,t){var n=this;switch(e){case"eles":n.data.canvasNeedsRedraw[st.NODE]=t;break;case"drag":n.data.canvasNeedsRedraw[st.DRAG]=t;break;case"select":n.data.canvasNeedsRedraw[st.SELECT_BOX]=t;break}};var sce=typeof Path2D<"u";st.path2dEnabled=function(e){if(e===void 0)return this.pathsEnabled;this.pathsEnabled=!!e},st.usePaths=function(){return sce&&this.pathsEnabled},st.setImgSmoothing=function(e,t){e.imageSmoothingEnabled!=null?e.imageSmoothingEnabled=t:(e.webkitImageSmoothingEnabled=t,e.mozImageSmoothingEnabled=t,e.msImageSmoothingEnabled=t)},st.getImgSmoothing=function(e){return e.imageSmoothingEnabled!=null?e.imageSmoothingEnabled:e.webkitImageSmoothingEnabled||e.mozImageSmoothingEnabled||e.msImageSmoothingEnabled},st.makeOffscreenCanvas=function(e,t){var n;if((typeof OffscreenCanvas>"u"?"undefined":tn(OffscreenCanvas))!=="undefined")n=new OffscreenCanvas(e,t);else{var r=this.cy.window(),a=r.document;n=a.createElement("canvas"),n.width=e,n.height=t}return n},[b_,xo,Zo,dy,Ri,sl,dr,za,cu,N_].forEach(function(e){He(st,e)});var lce=[{name:"null",impl:G3},{name:"base",impl:p_},{name:"canvas",impl:ice}],cce=[{type:"layout",extensions:mle},{type:"renderer",extensions:lce}],$_={},F_={};function A_(e,t,n){var r=n,a=function(E){ut("Can not register `"+t+"` for `"+e+"` since `"+E+"` already exists in the prototype and can not be overridden")};if(e==="core"){if(ou.prototype[t])return a(t);ou.prototype[t]=n}else if(e==="collection"){if(vn.prototype[t])return a(t);vn.prototype[t]=n}else if(e==="layout"){for(var i=function(E){this.options=E,n.call(this,E),ot(this._private)||(this._private={}),this._private.cy=E.cy,this._private.listeners=[],this.createEmitter()},s=i.prototype=Object.create(n.prototype),l=[],u=0;u<l.length;u++){var c=l[u];s[c]=s[c]||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=n.prototype.stop;s.stop=function(){var E=this.options;if(E&&E.animate){var S=this.animations;if(S)for(var _=0;_<S.length;_++)S[_].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=function(E){return E._private.cy},h={addEventFields:function(E,S){S.layout=E,S.cy=f(E),S.target=E},bubble:function(){return!0},parent:function(E){return f(E)}};He(s,{createEmitter:function(){return this._private.emitter=new ep(h,this),this},emitter:function(){return this._private.emitter},on:function(E,S){return this.emitter().on(E,S),this},one:function(E,S){return this.emitter().one(E,S),this},once:function(E,S){return this.emitter().one(E,S),this},removeListener:function(E,S){return this.emitter().removeListener(E,S),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},emit:function(E,S){return this.emitter().emit(E,S),this}}),dt.eventAliasesOn(s),r=i}else if(e==="renderer"&&t!=="null"&&t!=="base"){var m=P_("renderer","base"),p=m.prototype,g=n,v=n.prototype,y=function(){m.apply(this,arguments),g.apply(this,arguments)},b=y.prototype;for(var x in p){var w=p[x],C=v[x]!=null;if(C)return a(x);b[x]=w}for(var k in v)b[k]=v[k];p.clientFunctions.forEach(function(E){b[E]=b[E]||function(){It("Renderer does not implement `renderer."+E+"()` on its prototype")}}),r=y}else if(e==="__proto__"||e==="constructor"||e==="prototype")return It(e+" is an illegal type to be registered, possibly lead to prototype pollutions");return YS({map:$_,keys:[e,t],value:r})}function P_(e,t){return XS({map:$_,keys:[e,t]})}function uce(e,t,n,r,a){return YS({map:F_,keys:[e,t,n,r],value:a})}function dce(e,t,n,r){return XS({map:F_,keys:[e,t,n,r]})}var my=function(){if(arguments.length===2)return P_.apply(null,arguments);if(arguments.length===3)return A_.apply(null,arguments);if(arguments.length===4)return dce.apply(null,arguments);if(arguments.length===5)return uce.apply(null,arguments);It("Invalid extension access syntax")};ou.prototype.extension=my,cce.forEach(function(e){e.extensions.forEach(function(t){A_(e.type,t.name,t.impl)})});var I_=function e(){if(!(this instanceof e))return new e;this.length=0},Vi=I_.prototype;Vi.instanceString=function(){return"stylesheet"},Vi.selector=function(e){var t=this.length++;return this[t]={selector:e,properties:[]},this},Vi.css=function(e,t){var n=this.length-1;if(Me(e))this[n].properties.push({name:e,value:t});else if(ot(e))for(var r=e,a=Object.keys(r),i=0;i<a.length;i++){var s=a[i],l=r[s];if(l!=null){var u=Tn.properties[s]||Tn.properties[Tf(s)];if(u!=null){var c=u.name,d=l;this[n].properties.push({name:c,value:d})}}}return this},Vi.style=Vi.css,Vi.generateStyle=function(e){var t=new Tn(e);return this.appendToStyle(t)},Vi.appendToStyle=function(e){for(var t=0;t<this.length;t++){var n=this[t],r=n.selector,a=n.properties;e.selector(r);for(var i=0;i<a.length;i++){var s=a[i];e.css(s.name,s.value)}}return e};var fce="3.30.2",Mi=function(e){if(e===void 0&&(e={}),ot(e))return new ou(e);if(Me(e))return my.apply(my,arguments)};Mi.use=function(e){var t=Array.prototype.slice.call(arguments,1);return t.unshift(Mi),e.apply(null,t),this},Mi.warnings=function(e){return c5(e)},Mi.version=fce,Mi.stylesheet=Mi.Stylesheet=I_;let pce=class extends EventTarget{constructor(e,t){super(),Do(this,"cyg",null),Do(this,"nodes",[]),Do(this,"edges",[]),Do(this,"axons",[]),Do(this,"dendrites",[]),Do(this,"labelCache",new Map),Do(this,"graphCanvas",null),this.labelCache=e,this.graphCanvas=t}async addConnectivity(e){if(this.axons=e.axons.map(t=>JSON.stringify(t)),this.dendrites=e.dendrites.map(t=>JSON.stringify(t)),e.connectivity.length)for(const t of e.connectivity){const n=await this.graphNode(t[0]),r=await this.graphNode(t[1]);this.nodes.push(n),this.nodes.push(r),this.edges.push({id:`${n.id}_${r.id}`,source:n.id,target:r.id})}else this.nodes.push({id:"MISSING",label:"NO PATHS"})}showConnectivity(e){this.cyg=new yce(this,e),this.cyg.on("tap-node",t=>{const n=new CustomEvent("tap-node",{detail:t.detail});this.dispatchEvent(n)})}clearConnectivity(){var e;(e=this.cyg)!=null&&e.cy&&(this.cyg.cy.remove(),this.cyg.cy=null)}reset(){var e;(e=this.cyg)!=null&&e.cy&&this.cyg.cy.reset()}zoom(e){var t;if((t=this.cyg)!=null&&t.cy){const n=this.cyg.cy.zoom(),r=this.cyg.cy.width(),a=this.cyg.cy.height(),i={x:r/2,y:a/2};this.cyg.cy.zoom({level:n+e,renderedPosition:i})}}enableZoom(e){var t;(t=this.cyg)!=null&&t.cy&&this.cyg.cy.userZoomingEnabled(e)}get elements(){return[...this.nodes.map(e=>({data:e})),...this.edges.map(e=>({data:e}))]}get roots(){return this.dendrites}async graphNode(e){const t=JSON.stringify(e),n=[e[0],...e[1]],r=[];for(const i of n){const s=this.labelCache.has(i)?this.labelCache.get(i):"";r.push(s)}n.push(...r);const a={id:t,label:n.join(`
|
|
494
|
-
`)};return this.axons.includes(t)?this.dendrites.includes(t)?a["both-a-d"]=!0:a.axon=!0:this.dendrites.includes(t)&&(a.dendrite=!0),a}on(e,t){this.addEventListener(e,t)}};const hce=[{selector:"node",style:{label:function(e){return mce(e.data("label"))},"background-color":"transparent","background-opacity":"0","text-valign":"center","text-wrap":"wrap",width:"80px",height:"80px","text-max-width":"80px","font-size":"6px",shape:"round-rectangle","border-width":1,"border-style":"solid","border-color":"gray"}},{selector:"node[axon]",style:{shape:"round-diamond"}},{selector:"node[dendrite]",style:{shape:"ellipse"}},{selector:"node[both-a-d]",style:{shape:"round-rectangle"}},{selector:"edge",style:{width:1,"line-color":"dimgray","target-arrow-color":"dimgray","target-arrow-shape":"triangle","curve-style":"bezier"}}];function mce(e){const t=e.split(`
|
|
494
|
+
`)};return this.axons.includes(t)?this.dendrites.includes(t)?a["both-a-d"]=!0:a.axon=!0:this.dendrites.includes(t)&&(a.dendrite=!0),a}on(e,t){this.addEventListener(e,t)}};const hce=[{selector:"node",style:{label:function(e){return mce(e.data("label"))},"background-color":"transparent","background-opacity":"0","text-valign":"center","text-wrap":"wrap",width:"80px",height:"80px","text-max-width":"80px","font-size":"6px",shape:"round-rectangle","border-width":1,"border-style":"solid","border-color":"gray"}},{selector:"node[axon]",style:{shape:"round-diamond",width:"100px",height:"100px"}},{selector:"node[dendrite]",style:{shape:"ellipse"}},{selector:"node[both-a-d]",style:{shape:"round-rectangle"}},{selector:"edge",style:{width:1,"line-color":"dimgray","target-arrow-color":"dimgray","target-arrow-shape":"triangle","curve-style":"bezier"}}];function mce(e){const t=e.split(`
|
|
495
495
|
`),n=t.length/2;return t.slice(n).join(`
|
|
496
496
|
`)}function gce(e){return e.split(`
|
|
497
497
|
`).map(t=>t&&t[0]>="a"&&t[0]<="z"?t.charAt(0).toUpperCase()+t.slice(1):t).join(`
|
|
498
|
-
`)}class yce extends EventTarget{constructor(t,n){var r;super(),Do(this,"cy"),Do(this,"tooltip"),this.cy=Mi({container:n,elements:t.elements,layout:{name:"breadthfirst",circle:!1,roots:t.roots},directed:!0,style:hce,minZoom:.5,maxZoom:10,wheelSensitivity:.4}).on("mouseover","node",this.overNode.bind(this)).on("mouseout","node",this.exitNode.bind(this)).on("position","node",this.moveNode.bind(this)).on("tap",this.tapNode.bind(this)),this.tooltip=document.createElement("div"),this.tooltip.className="cy-graph-tooltip",this.tooltip.hidden=!0,(r=n==null?void 0:n.lastChild)==null||r.appendChild(this.tooltip)}remove(){this.cy&&this.cy.destroy()}checkRightBoundary(t){var n;t+this.tooltip.offsetWidth>=((n=this.tooltip.parentElement)==null?void 0:n.offsetWidth)&&(this.tooltip.style.left=`${t-this.tooltip.offsetWidth}px`)}overNode(t){const n=t.target,r=gce(n.data().label);this.tooltip.innerText=r,this.tooltip.style.left=`${t.renderedPosition.x}px`,this.tooltip.style.top=`${t.renderedPosition.y}px`,this.tooltip.style.maxWidth="240px",this.tooltip.hidden=!1,this.checkRightBoundary(t.renderedPosition.x)}moveNode(t){const n=t.target;this.tooltip.style.left=`${n.renderedPosition().x}px`,this.tooltip.style.top=`${n.renderedPosition().y}px`,this.checkRightBoundary(n.renderedPosition().x)}exitNode(t){this.tooltip.hidden=!0}tapNode(t){const n=t.target.data(),r=new CustomEvent("tap-node",{detail:n});this.dispatchEvent(r)}on(t,n){this.addEventListener(t,n)}}const vce=1.3,bce=24*60*60*1e3,wce="Reset position",D_="Lock zoom
|
|
498
|
+
`)}class yce extends EventTarget{constructor(t,n){var r;super(),Do(this,"cy"),Do(this,"tooltip"),this.cy=Mi({container:n,elements:t.elements,layout:{name:"breadthfirst",circle:!1,roots:t.roots},directed:!0,style:hce,minZoom:.5,maxZoom:10,wheelSensitivity:.4}).on("mouseover","node",this.overNode.bind(this)).on("mouseout","node",this.exitNode.bind(this)).on("position","node",this.moveNode.bind(this)).on("tap",this.tapNode.bind(this)),this.tooltip=document.createElement("div"),this.tooltip.className="cy-graph-tooltip",this.tooltip.hidden=!0,(r=n==null?void 0:n.lastChild)==null||r.appendChild(this.tooltip)}remove(){this.cy&&this.cy.destroy()}checkRightBoundary(t){var n;t+this.tooltip.offsetWidth>=((n=this.tooltip.parentElement)==null?void 0:n.offsetWidth)&&(this.tooltip.style.left=`${t-this.tooltip.offsetWidth}px`)}overNode(t){const n=t.target,r=gce(n.data().label);this.tooltip.innerText=r,this.tooltip.style.left=`${t.renderedPosition.x}px`,this.tooltip.style.top=`${t.renderedPosition.y}px`,this.tooltip.style.maxWidth="240px",this.tooltip.hidden=!1,this.checkRightBoundary(t.renderedPosition.x)}moveNode(t){const n=t.target;this.tooltip.style.left=`${n.renderedPosition().x}px`,this.tooltip.style.top=`${n.renderedPosition().y}px`,this.checkRightBoundary(n.renderedPosition().x)}exitNode(t){this.tooltip.hidden=!0}tapNode(t){const n=t.target.data(),r=new CustomEvent("tap-node",{detail:n});this.dispatchEvent(r)}on(t,n){this.addEventListener(t,n)}}const vce=1.3,bce=24*60*60*1e3,wce="Reset position",D_="Lock zoom",xce="Unlock zoom",kce="Zoom in",Cce="Zoom out",L_=.25,Ece="#8300bf",Sce={name:"ConnectivityGraph",props:{entry:{type:String,default:""},mapServer:{type:String,default:""}},data:function(){return{loading:!0,connectivityGraph:null,selectedSource:"",pathList:[],schemaVersion:"",knowledgeByPath:new Map,labelledTerms:new Set,labelCache:new Map,resetLabel:wce,zoomLockLabel:D_,zoomInLabel:kce,zoomOutLabel:Cce,iconColor:Ece,zoomEnabled:!1,errorMessage:""}},mounted(){this.refreshCache(),this.loadCacheData(),this.run().then(e=>{this.showGraph(this.entry)})},methods:{loadCacheData:function(){const e=sessionStorage.getItem("connectivity-graph-source"),t=sessionStorage.getItem("connectivity-graph-labels"),n=sessionStorage.getItem("connectivity-graph-pathlist"),r=sessionStorage.getItem("connectivity-graph-schema-version");if(e&&(this.selectedSource=e),n&&(this.pathList=JSON.parse(n)),t){const a=JSON.parse(t);this.labelCache=new Map(Object.entries(a))}r&&(this.schemaVersion=r)},removeAllCacheData:function(){["connectivity-graph-expiry","connectivity-graph-source","connectivity-graph-labels","connectivity-graph-pathlist","connectivity-graph-schema-version"].forEach(e=>{sessionStorage.removeItem(e)})},refreshCache:function(){const e=sessionStorage.getItem("connectivity-graph-expiry");new Date().getTime()>e&&this.removeAllCacheData()},updateCacheExpiry:function(){const e=new Date().getTime()+bce;sessionStorage.setItem("connectivity-graph-expiry",e)},run:async function(){if(this.schemaVersion||(this.schemaVersion=await this.getSchemaVersion(),sessionStorage.setItem("connectivity-graph-schema-version",this.schemaVersion),this.updateCacheExpiry()),this.schemaVersion<vce){console.warn("No Server!");return}this.showSpinner(),this.selectedSource||(this.selectedSource=await this.setSourceList(),sessionStorage.setItem("connectivity-graph-source",this.selectedSource),this.updateCacheExpiry()),await this.setPathList(this.selectedSource),this.hideSpinner()},showGraph:async function(e){const t=this.$refs.graphCanvas;this.showSpinner(),this.connectivityGraph=new pce(this.labelCache,t),await this.connectivityGraph.addConnectivity(this.knowledgeByPath.get(e)),this.hideSpinner(),this.connectivityGraph.showConnectivity(t),this.connectivityGraph.on("tap-node",n=>{const{label:r}=n.detail,a=r?r.split(`
|
|
499
499
|
`):[];this.$emit("tap-node",a)})},query:async function(e,t){const n=`${this.mapServer}knowledge/query/`,r={sql:e,params:t};try{const a=await fetch(n,{method:"POST",headers:{Accept:"application/json; charset=utf-8","Cache-Control":"no-store","Content-Type":"application/json"},body:JSON.stringify(r)});if(!a.ok)throw new Error(`Cannot access ${n}`);return await a.json()}catch{return{values:[]}}},setSourceList:async function(){const e=await this.getJsonData(`${this.mapServer}knowledge/sources`),t=e?e.sources||[]:[];let n="";for(const r of t)r&&n===""&&(n=r);return n},loadPathData:async function(e){const t=await this.query(`select entity, knowledge from knowledge
|
|
500
500
|
where entity like 'ilxtr:%' and source=?
|
|
501
501
|
order by entity`,[e]);return t?t.values:[]},setPathList:async function(e){this.pathList.length||(this.pathList=await this.loadPathData(e),sessionStorage.setItem("connectivity-graph-pathlist",JSON.stringify(this.pathList)),this.updateCacheExpiry()),this.knowledgeByPath.clear(),this.labelledTerms=new Set;for(const[t,n]of this.pathList){const r=JSON.parse(n);"connectivity"in r&&(this.knowledgeByPath.set(t,r),this.cacheLabels(r))}return this.labelCache.size||await this.getCachedTermLabels(),""},getSchemaVersion:async function(){const e=await this.getJsonData(`${this.mapServer}knowledge/schema-version`);return e&&+e.version||0},getJsonData:async function(e){try{const t=await fetch(e,{method:"GET",headers:{Accept:"application/json; charset=utf-8","Cache-Control":"no-store","Content-Type":"application/json"}});return t.ok||console.error(`Cannot access ${e}`),await t.json()}catch{return null}},getCachedTermLabels:async function(){if(this.labelledTerms.size){const e=await this.query(`select entity, knowledge from knowledge
|
|
502
502
|
where entity in (?${", ?".repeat(this.labelledTerms.size-1)})
|
|
503
|
-
order by source desc`,[...this.labelledTerms.values()]);let t=null;for(const[r,a]of e.values)if(r!==t){const i=JSON.parse(a);this.labelCache.set(r,i.label||r),t=r}const n=Object.fromEntries(this.labelCache);sessionStorage.setItem("connectivity-graph-labels",JSON.stringify(n)),this.updateCacheExpiry()}},cacheNodeLabels:function(e){for(const t of[e[0],...e[1]])this.labelledTerms.add(t)},cacheLabels:async function(e){for(const t of e.connectivity)this.cacheNodeLabels(t[0]),this.cacheNodeLabels(t[1])},showSpinner:function(){this.loading=!0},hideSpinner:function(){this.loading=!1},reset:function(){this.connectivityGraph.reset()},zoomIn:function(){this.connectivityGraph.zoom(L_)},zoomOut:function(){this.connectivityGraph.zoom(-L_)},toggleZoom:function(){this.zoomEnabled=!this.zoomEnabled,this.zoomLockLabel=this.zoomEnabled?xce:D_,this.connectivityGraph.enableZoom(!this.zoomEnabled)},showErrorMessage:function(e){this.errorMessage=e,setTimeout(()=>{this.errorMessage=""},3e3)}}},_ce={class:"connectivity-graph"},Bce={ref:"graphCanvas",class:"graph-canvas"},Tce={class:"control-panel control-panel-tools"},Nce={class:"visually-hidden"},Oce={class:"visually-hidden"},$ce={class:"visually-hidden"},Fce={class:"visually-hidden"},Ace=o.createStaticVNode('<div class="control-panel control-panel-nodes" data-v-
|
|
503
|
+
order by source desc`,[...this.labelledTerms.values()]);let t=null;for(const[r,a]of e.values)if(r!==t){const i=JSON.parse(a);this.labelCache.set(r,i.label||r),t=r}const n=Object.fromEntries(this.labelCache);sessionStorage.setItem("connectivity-graph-labels",JSON.stringify(n)),this.updateCacheExpiry()}},cacheNodeLabels:function(e){for(const t of[e[0],...e[1]])this.labelledTerms.add(t)},cacheLabels:async function(e){for(const t of e.connectivity)this.cacheNodeLabels(t[0]),this.cacheNodeLabels(t[1])},showSpinner:function(){this.loading=!0},hideSpinner:function(){this.loading=!1},reset:function(){this.connectivityGraph.reset()},zoomIn:function(){this.connectivityGraph.zoom(L_)},zoomOut:function(){this.connectivityGraph.zoom(-L_)},toggleZoom:function(){this.zoomEnabled=!this.zoomEnabled,this.zoomLockLabel=this.zoomEnabled?xce:D_,this.connectivityGraph.enableZoom(!this.zoomEnabled)},showErrorMessage:function(e){this.errorMessage=e,setTimeout(()=>{this.errorMessage=""},3e3)}}},_ce={class:"connectivity-graph"},Bce={ref:"graphCanvas",class:"graph-canvas"},Tce={class:"control-panel control-panel-tools"},Nce={class:"visually-hidden"},Oce={class:"visually-hidden"},$ce={class:"visually-hidden"},Fce={class:"visually-hidden"},Ace=o.createStaticVNode('<div class="control-panel control-panel-nodes" data-v-aead960f><div class="node-key" data-v-aead960f><div class="key-box-container" data-v-aead960f><div class="key-box key-box-dendrite" data-v-aead960f> Origin </div><div class="key-box key-box-node" data-v-aead960f> Components </div><div class="key-box key-box-axon" data-v-aead960f> Destination </div></div></div></div>',1),Pce={key:0,class:"connectivity-graph-error"};function Ice(e,t,n,r,a,i){const s=lY,l=Rn,u=kf,c=_c,d=kY,f=EY,h=TY,m=OY,p=Ste;return o.withDirectives((o.openBlock(),o.createElementBlock("div",_ce,[o.createElementVNode("div",Bce,null,512),o.createElementVNode("div",Tce,[o.createElementVNode("div",{class:o.normalizeClass(["tools",{"zoom-locked":e.zoomEnabled}])},[o.createVNode(c,{content:e.resetLabel,placement:"top",effect:"control-tooltip"},{default:o.withCtx(()=>[o.createVNode(u,{class:o.normalizeClass(["control-button",e.theme]),size:"small",onClick:i.reset},{default:o.withCtx(()=>[o.createVNode(l,{color:"white"},{default:o.withCtx(()=>[o.createVNode(s)]),_:1}),o.createElementVNode("span",Nce,o.toDisplayString(e.resetLabel),1)]),_:1},8,["class","onClick"])]),_:1},8,["content"]),o.createVNode(c,{content:e.zoomLockLabel,placement:"top",effect:"control-tooltip"},{default:o.withCtx(()=>[o.createVNode(u,{class:o.normalizeClass(["control-button",e.theme]),size:"small",onClick:i.toggleZoom},{default:o.withCtx(()=>[o.createVNode(l,{color:"white"},{default:o.withCtx(()=>[e.zoomEnabled?(o.openBlock(),o.createBlock(d,{key:0})):(o.openBlock(),o.createBlock(f,{key:1}))]),_:1}),o.createElementVNode("span",Oce,o.toDisplayString(e.zoomLockLabel),1)]),_:1},8,["class","onClick"])]),_:1},8,["content"]),o.createVNode(c,{content:e.zoomInLabel,placement:"left",effect:"control-tooltip"},{default:o.withCtx(()=>[o.createVNode(u,{class:o.normalizeClass(["control-button",e.theme]),size:"small",onClick:i.zoomIn},{default:o.withCtx(()=>[o.createVNode(l,{color:"white"},{default:o.withCtx(()=>[o.createVNode(h)]),_:1}),o.createElementVNode("span",$ce,o.toDisplayString(e.zoomInLabel),1)]),_:1},8,["class","onClick"])]),_:1},8,["content"]),o.createVNode(c,{content:e.zoomOutLabel,placement:"left",effect:"control-tooltip"},{default:o.withCtx(()=>[o.createVNode(u,{class:o.normalizeClass(["control-button",e.theme]),size:"small",onClick:i.zoomOut},{default:o.withCtx(()=>[o.createVNode(l,{color:"white"},{default:o.withCtx(()=>[o.createVNode(m)]),_:1}),o.createElementVNode("span",Fce,o.toDisplayString(e.zoomOutLabel),1)]),_:1},8,["class","onClick"])]),_:1},8,["content"])],2)]),Ace,e.errorMessage?(o.openBlock(),o.createElementBlock("div",Pce,o.toDisplayString(e.errorMessage),1)):o.createCommentVNode("",!0)])),[[p,e.loading]])}const Dce=QE(Sce,[["render",Ice],["__scopeId","data-v-aead960f"]]),Lce={data(){return{ElIconView:ev}},name:"DatasetCard",components:{BadgesGroup:Xb,ImageGallery:lk,Button:Mr,Icon:Bt,CopyToClipboard:LS},props:{entry:{type:Object,default:()=>{}},envVars:{type:Object,default:()=>{}}},data:function(){return{thumbnail:ck,dataLocation:this.entry.doi,discoverId:void 0,loading:!0,version:1,lastDoi:void 0,biolucidaData:void 0,currentCategory:"All",copyContent:""}},computed:{contributors:function(){let e="";return this.entry.contributors&&(this.entry.contributors.length===1?e=this.lastName(this.entry.contributors[0].name):this.entry.contributors.length===2?e=this.lastName(this.entry.contributors[0].name)+" & "+this.lastName(this.entry.contributors[1].name):this.entry.contributors.length>2&&(e=this.lastName(this.entry.contributors[0].name)+" et al.")),e},samples:function(){let e="";return this.entry.species&&(qd[this.entry.species[0].toLowerCase()]?e=`${qd[this.entry.species[0].toLowerCase()]}`:e=`${this.entry.species}`),this.entry.numberSamples>0&&(e+=" (",this.entry.numberSamples===1?e+=`${this.entry.numberSamples} sample`:this.entry.numberSamples>1&&(e+=`${this.entry.numberSamples} samples`),this.entry.numberSubjects===1?e+=` from ${this.entry.numberSubjects} subject`:this.entry.numberSamples>1&&(e+=` from ${this.entry.numberSubjects} subjects`),e+=")"),e},label:function(){return this.entry.organs?this.entry.organs[0]:this.entry.name},publishYear:function(){return this.entry.publishDate.split("-")[0]}},mounted:function(){this.updateCopyContent()},methods:{cardClicked:function(){this.openDataset()},categoryChanged:function(e){this.currentCategory=e},galleryClicked:function(e){this.propogateCardAction(e)},galleryDatalinkClicked:function(e){Ht.emit("datalink-clicked",e)},openDataset:function(){window.open(this.dataLocation,"_blank")},openRepository:function(){let e=this.envVars.API_LOCATION;this.entry.additionalLinks.forEach(function(t){if(t.description=="Repository"){let n=new XMLHttpRequest;n.open("POST",e+"/pmr_latest_exposure",!0),n.setRequestHeader("Content-type","application/json"),n.onreadystatechange=()=>{if(n.readyState===4){let r="";n.status===200&&(r=JSON.parse(n.responseText).url),r===""&&(r=t.uri),window.open(r,"_blank")}},n.send(JSON.stringify({workspace_url:t.uri}))}})},propogateCardAction:function(e){Ht.emit("PopoverActionClick",e),Ht.emit("contextUpdate",e)},splitDOI:function(e){return[e.split("/")[e.split("/").length-2],e.split("/")[e.split("/").length-1]]},getBanner:function(){if(this.lastDoi!==this.entry.doi){this.lastDoi=this.entry.doi,this.loading=!0;let e=this.splitDOI(this.entry.doi);fetch(`${this.envVars.PENNSIEVE_API_LOCATION}/discover/datasets/doi/${e[0]}/${e[1]}`).then(t=>{if(t.ok)return t.json();throw Error(t.statusText)}).then(t=>{this.thumbnail=t.banner,this.discoverId=t.id,this.version=t.version,this.dataLocation=`https://sparc.science/datasets/${t.id}?type=dataset`,this.getBiolucidaInfo(this.discoverId),this.loading=!1,this.updateCopyContent()}).catch(()=>{this.thumbnail=ck,this.discoverId=Number(this.entry.datasetId),this.loading=!1})}},lastName:function(e){return e.split(",")[0]},getBiolucidaInfo:function(e){let n=this.envVars.API_LOCATION+"image_search/"+e;fetch(n).then(r=>r.json()).then(r=>{r.status=="success"&&(this.biolucidaData=r)})},updateCopyContent:function(){const e=[];if(this.entry.name&&e.push(`<div><strong>${this.entry.name}</strong></div>`),this.contributors){let t=this.contributors;this.entry.publishDate&&(t+=` (${this.publishYear})`),e.push(`<div>${t}</div>`)}if(this.samples&&e.push(`<div>${this.samples}</div>`),this.entry.doi){let t="<div><strong>DOI:</strong></div>";t+=`
|
|
504
504
|
`,t+=`<a href="${this.entry.doi}">${this.entry.doi}</a>`,e.push(`<div>${t}</div>`)}if(this.entry.datasetId){let t="<div><strong>Dataset ID:</strong></div>";t+=`
|
|
505
505
|
`,t+=`${this.entry.datasetId}`,e.push(`<div>${t}</div>`)}if(this.dataLocation){let t="<div><strong>Dataset URL:</strong></div>";t+=`
|
|
506
506
|
`,t+=`<a href="${this.dataLocation}">${this.dataLocation}</a>`,e.push(`<div>${t}</div>`)}if(this.version){let t="<div><strong>Dataset version:</strong></div>";t+=`
|
|
@@ -924,4 +924,4 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
|
|
|
924
924
|
`);return d+=`
|
|
925
925
|
`,d+=`<ul>${h}</ul>`,d}if((a=this.entry.origins)!=null&&a.length){const l="Origin",u=this.entry.origins,c=this.entry.originsWithDatasets,d=t(l,u,c);e.push(d)}if((i=this.entry.components)!=null&&i.length){const l="Components",u=this.entry.components,c=this.entry.componentsWithDatasets,d=t(l,u,c);e.push(d)}if((s=this.entry.destinations)!=null&&s.length){const l="Destination",u=this.entry.destinations,c=this.entry.destinationsWithDatasets,d=t(l,u,c);e.push(d)}return e.join(`
|
|
926
926
|
|
|
927
|
-
<br>`)}},mounted:function(){Ht.on("connectivity-graph-error",e=>{const t=this.$refs.connectivityGraphRef;t&&t.showErrorMessage(e)})}},zi=e=>(o.pushScopeId("data-v-9070baa8"),e=e(),o.popScopeId(),e),Rue={key:0,class:"main"},Vue={class:"connectivity-info-title"},Mue={key:0,class:"block"},zue={class:"title"},jue={style:{"word-break":"keep-all"}},Hue={key:0,class:"subtitle"},Uue={key:1,class:"block"},que={class:"title"},Kue={key:2,class:"block"},Wue={class:"title-buttons"},Gue=zi(()=>o.createElementVNode("span",null," Show connectivity on map ",-1)),Yue={class:"content-container population-display"},Xue=zi(()=>o.createElementVNode("div",{class:"block attribute-title-container"},[o.createElementVNode("span",{class:"attribute-title"},"Population Display")],-1)),Jue={class:"block buttons-row"},Zue={key:0,class:"content-container"},Que={key:0,class:"block"},ede={class:"attribute-title-container"},tde=zi(()=>o.createElementVNode("span",{class:"attribute-title"},"Origin",-1)),nde={style:{"word-break":"keep-all"}},rde=zi(()=>o.createElementVNode("i",null,"Origin",-1)),ode=["origin-item-label"],ade={key:0,class:"seperator"},ide={key:1,class:"block"},sde=zi(()=>o.createElementVNode("div",{class:"attribute-title-container"},[o.createElementVNode("div",{class:"attribute-title"},"Components")],-1)),lde=["component-item-label"],cde={key:0,class:"seperator"},ude={key:2,class:"block"},dde={class:"attribute-title-container"},fde=zi(()=>o.createElementVNode("span",{class:"attribute-title"},"Destination",-1)),pde=zi(()=>o.createElementVNode("span",{style:{"word-break":"keep-all"}},[o.createElementVNode("i",null,"Destination"),o.createTextVNode(" is where the axons terminate ")],-1)),hde=["destination-item-label"],mde={key:0,class:"seperator"},gde={class:"block"},yde={key:1,class:"content-container"};function vde(e,t,n,r,a,i){const s=z6,l=Bt,u=qh,c=T4,d=I6,f=Mr,h=o.resolveComponent("CopyToClipboard"),m=tv,p=o.resolveComponent("connectivity-graph"),g=ed;return n.entry?o.withDirectives((o.openBlock(),o.createElementBlock("div",Rue,[o.createElementVNode("div",Vue,[o.createElementVNode("div",null,[n.entry.title?(o.openBlock(),o.createElementBlock("div",Mue,[o.createElementVNode("div",zue,[o.createTextVNode(o.toDisplayString(i.capitalise(n.entry.title))+" ",1),n.entry.featuresAlert?(o.openBlock(),o.createBlock(u,{key:0,width:"250",trigger:"hover",teleported:!1,"popper-class":"popover-origin-help"},{reference:o.withCtx(()=>[o.createVNode(l,{class:"alert"},{default:o.withCtx(()=>[o.createVNode(s)]),_:1})]),default:o.withCtx(()=>[o.createElementVNode("span",jue,o.toDisplayString(n.entry.featuresAlert),1)]),_:1})):o.createCommentVNode("",!0)]),n.entry.provenanceTaxonomyLabel&&n.entry.provenanceTaxonomyLabel.length>0?(o.openBlock(),o.createElementBlock("div",Hue,o.toDisplayString(i.provSpeciesDescription),1)):o.createCommentVNode("",!0)])):(o.openBlock(),o.createElementBlock("div",Uue,[o.createElementVNode("div",que,o.toDisplayString(n.entry.featureId),1)])),i.resources.length?(o.openBlock(),o.createElementBlock("div",Kue,[o.createVNode(c,{resources:i.resources},null,8,["resources"])])):o.createCommentVNode("",!0)]),o.createElementVNode("div",Wue,[o.createVNode(u,{width:"auto",trigger:"hover",teleported:!1,"popper-class":"popover-map-pin"},{reference:o.withCtx(()=>[o.createVNode(f,{class:"button-circle",circle:"",onClick:t[0]||(t[0]=v=>i.showConnectivity(n.entry))},{default:o.withCtx(()=>[o.createVNode(l,{color:"white"},{default:o.withCtx(()=>[o.createVNode(d)]),_:1})]),_:1})]),default:o.withCtx(()=>[Gue]),_:1}),o.createVNode(h,{content:i.updatedCopyContent},null,8,["content"])])]),o.createElementVNode("div",Yue,[Xue,o.createElementVNode("div",Jue,[o.createVNode(f,{class:o.normalizeClass(e.activeView==="listView"?"button":"el-button-secondary"),onClick:t[1]||(t[1]=v=>i.switchConnectivityView("listView"))},{default:o.withCtx(()=>[o.createTextVNode(" List view ")]),_:1},8,["class"]),o.createVNode(f,{class:o.normalizeClass(e.activeView==="graphView"?"button":"el-button-secondary"),onClick:t[2]||(t[2]=v=>i.switchConnectivityView("graphView"))},{default:o.withCtx(()=>[o.createTextVNode(" Graph view ")]),_:1},8,["class"])])]),e.activeView==="listView"?(o.openBlock(),o.createElementBlock("div",Zue,[o.createTextVNode(o.toDisplayString(n.entry.paths)+" ",1),n.entry.origins&&n.entry.origins.length>0?(o.openBlock(),o.createElementBlock("div",Que,[o.createElementVNode("div",ede,[tde,o.createVNode(u,{width:"250",trigger:"hover",teleported:!1,"popper-class":"popover-origin-help"},{reference:o.withCtx(()=>[o.createVNode(l,{class:"info"},{default:o.withCtx(()=>[o.createVNode(m)]),_:1})]),default:o.withCtx(()=>[o.createElementVNode("span",nde,[rde,o.createTextVNode(" "+o.toDisplayString(i.originDescription),1)])]),_:1})]),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(n.entry.origins,(v,y)=>(o.openBlock(),o.createElementBlock("div",{class:"attribute-content","origin-item-label":v,key:v},[o.createTextVNode(o.toDisplayString(i.capitalise(v))+" ",1),y!=n.entry.origins.length-1?(o.openBlock(),o.createElementBlock("div",ade)):o.createCommentVNode("",!0)],8,ode))),128)),o.withDirectives(o.createVNode(f,{class:"button",id:"open-dendrites-button",onClick:i.openDendrites},{default:o.withCtx(()=>[o.createTextVNode(" Explore origin data ")]),_:1},8,["onClick"]),[[o.vShow,n.entry.originsWithDatasets&&n.entry.originsWithDatasets.length>0&&i.shouldShowExploreButton(n.entry.originsWithDatasets)]])])):o.createCommentVNode("",!0),n.entry.components&&n.entry.components.length>0?(o.openBlock(),o.createElementBlock("div",ide,[sde,(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(n.entry.components,(v,y)=>(o.openBlock(),o.createElementBlock("div",{class:"attribute-content","component-item-label":v,key:v},[o.createTextVNode(o.toDisplayString(i.capitalise(v))+" ",1),y!=n.entry.components.length-1?(o.openBlock(),o.createElementBlock("div",cde)):o.createCommentVNode("",!0)],8,lde))),128))])):o.createCommentVNode("",!0),n.entry.destinations&&n.entry.destinations.length>0?(o.openBlock(),o.createElementBlock("div",ude,[o.createElementVNode("div",dde,[fde,o.createVNode(u,{width:"250",trigger:"hover",teleported:!1,"popper-class":"popover-origin-help"},{reference:o.withCtx(()=>[o.createVNode(l,{class:"info"},{default:o.withCtx(()=>[o.createVNode(m)]),_:1})]),default:o.withCtx(()=>[pde]),_:1})]),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(n.entry.destinations,(v,y)=>(o.openBlock(),o.createElementBlock("div",{class:"attribute-content","destination-item-label":v,key:v},[o.createTextVNode(o.toDisplayString(i.capitalise(v))+" ",1),y!=n.entry.destinations.length-1?(o.openBlock(),o.createElementBlock("div",mde)):o.createCommentVNode("",!0)],8,hde))),128)),o.withDirectives(o.createVNode(f,{class:"button",onClick:i.openAxons},{default:o.withCtx(()=>[o.createTextVNode(" Explore destination data ")]),_:1},8,["onClick"]),[[o.vShow,n.entry.destinationsWithDatasets&&n.entry.destinationsWithDatasets.length>0&&i.shouldShowExploreButton(n.entry.destinationsWithDatasets)]])])):o.createCommentVNode("",!0),o.withDirectives(o.createElementVNode("div",gde,[o.createVNode(f,{class:"button",onClick:i.openAll},{default:o.withCtx(()=>[o.createTextVNode(" Search for data on components ")]),_:1},8,["onClick"])],512),[[o.vShow,n.entry.componentsWithDatasets&&n.entry.componentsWithDatasets.length>0&&i.shouldShowExploreButton(n.entry.componentsWithDatasets)]])])):o.createCommentVNode("",!0),e.activeView==="graphView"?(o.openBlock(),o.createElementBlock("div",yde,[o.createVNode(p,{entry:n.entry.featureId[0],mapServer:n.envVars.FLATMAPAPI_LOCATION,onTapNode:i.onTapNode,ref:"connectivityGraphRef"},null,8,["entry","mapServer","onTapNode"])])):o.createCommentVNode("",!0)])),[[g,e.loading]]):o.createCommentVNode("",!0)}const N4=so(Lue,[["render",vde],["__scopeId","data-v-9070baa8"]]),bde={name:"Tabs",props:{tabTitles:{type:Array,default:()=>[]},activeId:{type:Number,default:1}},methods:{titleClicked:function(e,t){this.$emit("titleClicked",{id:e,type:t})},tabClose:function(e){this.$emit("tab-close",e)}}},wde=e=>(o.pushScopeId("data-v-ed1ce6dc"),e=e(),o.popScopeId(),e),xde={class:"tab-container"},kde=["onClick"],Cde={class:"title-text"},Ede=wde(()=>o.createElementVNode("span",{class:"visually-hidden"},"Close",-1));function Sde(e,t,n,r,a,i){const s=Mr;return o.openBlock(),o.createElementBlock("div",xde,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(n.tabTitles,l=>(o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(["title",{"active-tab":l.id==n.activeId}]),key:l.id},[o.createElementVNode("div",{class:o.normalizeClass(["title-text-table",{highlightText:l.id==n.activeId}]),onClick:u=>i.titleClicked(l.id,l.type)},[o.createElementVNode("div",Cde,o.toDisplayString(l.title),1)],10,kde),l.id>1?(o.openBlock(),o.createBlock(s,{key:0,onClick:u=>i.tabClose(l.id),class:"button-tab-close","aria-label":"Close"},{default:o.withCtx(()=>[o.createTextVNode(" × "),Ede]),_:2},1032,["onClick"])):o.createCommentVNode("",!0)],2))),128))])}const O4=so(bde,[["render",Sde],["__scopeId","data-v-ed1ce6dc"]]),_de={components:{SidebarContent:B4,Tabs:O4,ElIconArrowLeft:sh,ElIconArrowRight:Nu,Drawer:zh,Icon:Bt,ConnectivityInfo:N4},name:"SideBar",props:{visible:{type:Boolean,default:!1},envVars:{type:Object,default:()=>{}},tabs:{type:Array,default:()=>[{id:1,title:"Search",type:"search"},{id:2,title:"Connectivity",type:"connectivity"}]},activeTabId:{type:Number,default:1},openAtStart:{type:Boolean,default:!1},connectivityInfo:{type:Object,default:null}},data:function(){return{drawerOpen:!1,availableAnatomyFacets:[]}},methods:{hoverChanged:function(e){this.$emit("hover-changed",e)},showConnectivity:function(e){this.$emit("show-connectivity",e)},onConnectivityComponentClick:function(e){this.$emit("connectivity-component-click",e)},searchChanged:function(e,t){this.$emit("search-changed",{...t,id:e})},close:function(){this.drawerOpen=!1},toggleDrawer:function(){this.drawerOpen=!this.drawerOpen},openSearch:function(e,t){this.drawerOpen=!0,this.$nextTick(()=>{this.getSearchTabRefById(1).openSearch(e,t)})},getTabByIdAndType:function(e,t){const n=e||this.activeTabId,r=t||"search",a=this.tabs.find(s=>s.id===n&&s.type===r),i=this.tabs[0];return a||i},getTabRefId:function(e,t){let n="searchTab_";t==="connectivity"&&(n="connectivityTab_");const r=this.getTabByIdAndType(e,t);return n+r.id},getSearchTabRefById:function(e){const t=e||1,n=this.getTabRefId(t,"search");return this.$refs[n][0]},addFilter:function(e){this.drawerOpen=!0,e.AND=!0,this.$nextTick(()=>{this.getSearchTabRefById(1).addFilter(e)})},openNeuronSearch:function(e){this.drawerOpen=!0,this.$nextTick(()=>{this.getSearchTabRefById(1).openSearch("",void 0,"scicrunch-query-string/",{field:"*organ.curie",curie:e})})},getAlgoliaFacets:async function(){return await this.getSearchTabRefById(1).getAlgoliaFacets()},setDrawerOpen:function(e=!0){this.drawerOpen=e},tabClicked:function({id:e,type:t}){this.$emit("tabClicked",{id:e,type:t})},tabClose:function(e){this.$emit("connectivity-info-close")},updateConnectivityGraphError:function(e){Ht.emit("connectivity-graph-error",e)}},created:function(){this.drawerOpen=this.openAtStart},mounted:function(){Ht.on("PopoverActionClick",e=>{this.$emit("actionClick",e)}),Ht.on("number-of-datasets-for-anatomies",e=>{this.$emit("number-of-datasets-for-anatomies",e)}),Ht.on("anatomy-in-datasets",e=>{this.$emit("anatomy-in-datasets",e)}),Ht.on("contextUpdate",e=>{this.$emit("contextUpdate",e)}),Ht.on("datalink-clicked",e=>{this.$emit("datalink-clicked",e)}),Ht.on("onConnectivityActionClick",e=>{this.tabClicked({id:1,type:"search"}),this.$emit("actionClick",e)}),Ht.on("available-facets",e=>{this.availableAnatomyFacets=e.find(t=>t.label==="Anatomical Structure").children})}},Bde={ref:"container"},Tde={class:"box-card"},Nde={class:"sidebar-container"};function Ode(e,t,n,r,a,i){const s=sh,l=Bt,u=Nu,c=O4,d=N4,f=B4,h=zh;return o.openBlock(),o.createElementBlock("div",Bde,[e.drawerOpen?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("div",{key:0,onClick:t[0]||(t[0]=(...m)=>i.toggleDrawer&&i.toggleDrawer(...m)),class:"open-tab"},[o.createVNode(l,null,{default:o.withCtx(()=>[o.createVNode(s)]),_:1})])),o.createVNode(h,{class:"side-bar my-drawer",modelValue:e.drawerOpen,"onUpdate:modelValue":t[3]||(t[3]=m=>e.drawerOpen=m),teleported:!1,"modal-append-to-body":!1,size:"584","with-header":!1,wrapperClosable:!1,modal:!1,"modal-class":"sidebar-body","z-index":10,"lock-scroll":!1},{default:o.withCtx(()=>[o.createElementVNode("div",Tde,[e.drawerOpen?(o.openBlock(),o.createElementBlock("div",{key:0,onClick:t[1]||(t[1]=(...m)=>i.close&&i.close(...m)),class:"close-tab"},[o.createVNode(l,null,{default:o.withCtx(()=>[o.createVNode(u)]),_:1})])):o.createCommentVNode("",!0),o.createElementVNode("div",Nde,[n.tabs.length>1&&n.connectivityInfo?(o.openBlock(),o.createBlock(c,{key:0,tabTitles:n.tabs,activeId:n.activeTabId,onTitleClicked:i.tabClicked,onTabClose:i.tabClose},null,8,["tabTitles","activeId","onTitleClicked","onTabClose"])):o.createCommentVNode("",!0),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(n.tabs,m=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:"tab.id"},[m.type==="connectivity"&&n.connectivityInfo?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[m.id===n.activeTabId?(o.openBlock(),o.createBlock(d,{key:0,entry:n.connectivityInfo,availableAnatomyFacets:e.availableAnatomyFacets,envVars:n.envVars,ref_for:!0,ref:"connectivityTab_"+m.id,onShowConnectivity:i.showConnectivity,onConnectivityComponentClick:i.onConnectivityComponentClick},null,8,["entry","availableAnatomyFacets","envVars","onShowConnectivity","onConnectivityComponentClick"])):o.createCommentVNode("",!0)],64)):o.withDirectives((o.openBlock(),o.createBlock(f,{key:1,class:"sidebar-content-container",contextCardEntry:m.contextCard,envVars:n.envVars,ref_for:!0,ref:"searchTab_"+m.id,onSearchChanged:p=>i.searchChanged(m.id,p),onHoverChanged:t[2]||(t[2]=p=>i.hoverChanged(p))},null,8,["contextCardEntry","envVars","onSearchChanged"])),[[o.vShow,m.id===n.activeTabId]])],64))),128))])])]),_:1},8,["modelValue"])],512)}const $de=so(_de,[["render",Ode],["__scopeId","data-v-d9b833f7"]]);ht.SideBar=$de,Object.defineProperty(ht,Symbol.toStringTag,{value:"Module"})});
|
|
927
|
+
<br>`)}},mounted:function(){Ht.on("connectivity-graph-error",e=>{const t=this.$refs.connectivityGraphRef;t&&t.showErrorMessage(e)})}},zi=e=>(o.pushScopeId("data-v-35f7078a"),e=e(),o.popScopeId(),e),Rue={key:0,class:"main"},Vue={class:"connectivity-info-title"},Mue={key:0,class:"block"},zue={class:"title"},jue={style:{"word-break":"keep-all"}},Hue={key:0,class:"subtitle"},Uue={key:1,class:"block"},que={class:"title"},Kue={key:2,class:"block"},Wue={class:"title-buttons"},Gue=zi(()=>o.createElementVNode("span",null," Show connectivity on map ",-1)),Yue={class:"content-container population-display"},Xue=zi(()=>o.createElementVNode("div",{class:"block attribute-title-container"},[o.createElementVNode("span",{class:"attribute-title"},"Population Display")],-1)),Jue={class:"block buttons-row"},Zue={key:0,class:"content-container"},Que={key:0,class:"block"},ede={class:"attribute-title-container"},tde=zi(()=>o.createElementVNode("span",{class:"attribute-title"},"Origin",-1)),nde={style:{"word-break":"keep-all"}},rde=zi(()=>o.createElementVNode("i",null,"Origin",-1)),ode=["origin-item-label"],ade={key:0,class:"seperator"},ide={key:1,class:"block"},sde=zi(()=>o.createElementVNode("div",{class:"attribute-title-container"},[o.createElementVNode("div",{class:"attribute-title"},"Components")],-1)),lde=["component-item-label"],cde={key:0,class:"seperator"},ude={key:2,class:"block"},dde={class:"attribute-title-container"},fde=zi(()=>o.createElementVNode("span",{class:"attribute-title"},"Destination",-1)),pde=zi(()=>o.createElementVNode("span",{style:{"word-break":"keep-all"}},[o.createElementVNode("i",null,"Destination"),o.createTextVNode(" is where the axons terminate ")],-1)),hde=["destination-item-label"],mde={key:0,class:"seperator"},gde={class:"block"},yde={key:1,class:"content-container"};function vde(e,t,n,r,a,i){const s=z6,l=Bt,u=qh,c=T4,d=I6,f=Mr,h=o.resolveComponent("CopyToClipboard"),m=tv,p=o.resolveComponent("connectivity-graph"),g=ed;return n.entry?o.withDirectives((o.openBlock(),o.createElementBlock("div",Rue,[o.createElementVNode("div",Vue,[o.createElementVNode("div",null,[n.entry.title?(o.openBlock(),o.createElementBlock("div",Mue,[o.createElementVNode("div",zue,[o.createTextVNode(o.toDisplayString(i.capitalise(n.entry.title))+" ",1),n.entry.featuresAlert?(o.openBlock(),o.createBlock(u,{key:0,width:"250",trigger:"hover",teleported:!1,"popper-class":"popover-origin-help"},{reference:o.withCtx(()=>[o.createVNode(l,{class:"alert"},{default:o.withCtx(()=>[o.createVNode(s)]),_:1})]),default:o.withCtx(()=>[o.createElementVNode("span",jue,o.toDisplayString(n.entry.featuresAlert),1)]),_:1})):o.createCommentVNode("",!0)]),n.entry.provenanceTaxonomyLabel&&n.entry.provenanceTaxonomyLabel.length>0?(o.openBlock(),o.createElementBlock("div",Hue,o.toDisplayString(i.provSpeciesDescription),1)):o.createCommentVNode("",!0)])):(o.openBlock(),o.createElementBlock("div",Uue,[o.createElementVNode("div",que,o.toDisplayString(n.entry.featureId),1)])),i.resources.length?(o.openBlock(),o.createElementBlock("div",Kue,[o.createVNode(c,{resources:i.resources},null,8,["resources"])])):o.createCommentVNode("",!0)]),o.createElementVNode("div",Wue,[o.createVNode(u,{width:"auto",trigger:"hover",teleported:!1,"popper-class":"popover-map-pin"},{reference:o.withCtx(()=>[o.createVNode(f,{class:"button-circle",circle:"",onClick:t[0]||(t[0]=v=>i.showConnectivity(n.entry))},{default:o.withCtx(()=>[o.createVNode(l,{color:"white"},{default:o.withCtx(()=>[o.createVNode(d)]),_:1})]),_:1})]),default:o.withCtx(()=>[Gue]),_:1}),o.createVNode(h,{content:i.updatedCopyContent},null,8,["content"])])]),o.createElementVNode("div",Yue,[Xue,o.createElementVNode("div",Jue,[o.createVNode(f,{class:o.normalizeClass(e.activeView==="listView"?"button":"el-button-secondary"),onClick:t[1]||(t[1]=v=>i.switchConnectivityView("listView"))},{default:o.withCtx(()=>[o.createTextVNode(" List view ")]),_:1},8,["class"]),o.createVNode(f,{class:o.normalizeClass(e.activeView==="graphView"?"button":"el-button-secondary"),onClick:t[2]||(t[2]=v=>i.switchConnectivityView("graphView"))},{default:o.withCtx(()=>[o.createTextVNode(" Graph view ")]),_:1},8,["class"])])]),e.activeView==="listView"?(o.openBlock(),o.createElementBlock("div",Zue,[o.createTextVNode(o.toDisplayString(n.entry.paths)+" ",1),n.entry.origins&&n.entry.origins.length>0?(o.openBlock(),o.createElementBlock("div",Que,[o.createElementVNode("div",ede,[tde,o.createVNode(u,{width:"250",trigger:"hover",teleported:!1,"popper-class":"popover-origin-help"},{reference:o.withCtx(()=>[o.createVNode(l,{class:"info"},{default:o.withCtx(()=>[o.createVNode(m)]),_:1})]),default:o.withCtx(()=>[o.createElementVNode("span",nde,[rde,o.createTextVNode(" "+o.toDisplayString(i.originDescription),1)])]),_:1})]),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(n.entry.origins,(v,y)=>(o.openBlock(),o.createElementBlock("div",{class:"attribute-content","origin-item-label":v,key:v},[o.createTextVNode(o.toDisplayString(i.capitalise(v))+" ",1),y!=n.entry.origins.length-1?(o.openBlock(),o.createElementBlock("div",ade)):o.createCommentVNode("",!0)],8,ode))),128)),o.withDirectives(o.createVNode(f,{class:"button",id:"open-dendrites-button",onClick:i.openDendrites},{default:o.withCtx(()=>[o.createTextVNode(" Explore origin data ")]),_:1},8,["onClick"]),[[o.vShow,n.entry.originsWithDatasets&&n.entry.originsWithDatasets.length>0&&i.shouldShowExploreButton(n.entry.originsWithDatasets)]])])):o.createCommentVNode("",!0),n.entry.components&&n.entry.components.length>0?(o.openBlock(),o.createElementBlock("div",ide,[sde,(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(n.entry.components,(v,y)=>(o.openBlock(),o.createElementBlock("div",{class:"attribute-content","component-item-label":v,key:v},[o.createTextVNode(o.toDisplayString(i.capitalise(v))+" ",1),y!=n.entry.components.length-1?(o.openBlock(),o.createElementBlock("div",cde)):o.createCommentVNode("",!0)],8,lde))),128))])):o.createCommentVNode("",!0),n.entry.destinations&&n.entry.destinations.length>0?(o.openBlock(),o.createElementBlock("div",ude,[o.createElementVNode("div",dde,[fde,o.createVNode(u,{width:"250",trigger:"hover",teleported:!1,"popper-class":"popover-origin-help"},{reference:o.withCtx(()=>[o.createVNode(l,{class:"info"},{default:o.withCtx(()=>[o.createVNode(m)]),_:1})]),default:o.withCtx(()=>[pde]),_:1})]),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(n.entry.destinations,(v,y)=>(o.openBlock(),o.createElementBlock("div",{class:"attribute-content","destination-item-label":v,key:v},[o.createTextVNode(o.toDisplayString(i.capitalise(v))+" ",1),y!=n.entry.destinations.length-1?(o.openBlock(),o.createElementBlock("div",mde)):o.createCommentVNode("",!0)],8,hde))),128)),o.withDirectives(o.createVNode(f,{class:"button",onClick:i.openAxons},{default:o.withCtx(()=>[o.createTextVNode(" Explore destination data ")]),_:1},8,["onClick"]),[[o.vShow,n.entry.destinationsWithDatasets&&n.entry.destinationsWithDatasets.length>0&&i.shouldShowExploreButton(n.entry.destinationsWithDatasets)]])])):o.createCommentVNode("",!0),o.withDirectives(o.createElementVNode("div",gde,[o.createVNode(f,{class:"button",onClick:i.openAll},{default:o.withCtx(()=>[o.createTextVNode(" Search for data on components ")]),_:1},8,["onClick"])],512),[[o.vShow,n.entry.componentsWithDatasets&&n.entry.componentsWithDatasets.length>0&&i.shouldShowExploreButton(n.entry.componentsWithDatasets)]])])):o.createCommentVNode("",!0),e.activeView==="graphView"?(o.openBlock(),o.createElementBlock("div",yde,[o.createVNode(p,{entry:n.entry.featureId[0],mapServer:n.envVars.FLATMAPAPI_LOCATION,onTapNode:i.onTapNode,ref:"connectivityGraphRef"},null,8,["entry","mapServer","onTapNode"])])):o.createCommentVNode("",!0)])),[[g,e.loading]]):o.createCommentVNode("",!0)}const N4=so(Lue,[["render",vde],["__scopeId","data-v-35f7078a"]]),bde={name:"Tabs",props:{tabTitles:{type:Array,default:()=>[]},activeId:{type:Number,default:1}},methods:{titleClicked:function(e,t){this.$emit("titleClicked",{id:e,type:t})},tabClose:function(e){this.$emit("tab-close",e)}}},wde=e=>(o.pushScopeId("data-v-ed1ce6dc"),e=e(),o.popScopeId(),e),xde={class:"tab-container"},kde=["onClick"],Cde={class:"title-text"},Ede=wde(()=>o.createElementVNode("span",{class:"visually-hidden"},"Close",-1));function Sde(e,t,n,r,a,i){const s=Mr;return o.openBlock(),o.createElementBlock("div",xde,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(n.tabTitles,l=>(o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(["title",{"active-tab":l.id==n.activeId}]),key:l.id},[o.createElementVNode("div",{class:o.normalizeClass(["title-text-table",{highlightText:l.id==n.activeId}]),onClick:u=>i.titleClicked(l.id,l.type)},[o.createElementVNode("div",Cde,o.toDisplayString(l.title),1)],10,kde),l.id>1?(o.openBlock(),o.createBlock(s,{key:0,onClick:u=>i.tabClose(l.id),class:"button-tab-close","aria-label":"Close"},{default:o.withCtx(()=>[o.createTextVNode(" × "),Ede]),_:2},1032,["onClick"])):o.createCommentVNode("",!0)],2))),128))])}const O4=so(bde,[["render",Sde],["__scopeId","data-v-ed1ce6dc"]]),_de={components:{SidebarContent:B4,Tabs:O4,ElIconArrowLeft:sh,ElIconArrowRight:Nu,Drawer:zh,Icon:Bt,ConnectivityInfo:N4},name:"SideBar",props:{visible:{type:Boolean,default:!1},envVars:{type:Object,default:()=>{}},tabs:{type:Array,default:()=>[{id:1,title:"Search",type:"search"},{id:2,title:"Connectivity",type:"connectivity"}]},activeTabId:{type:Number,default:1},openAtStart:{type:Boolean,default:!1},connectivityInfo:{type:Object,default:null}},data:function(){return{drawerOpen:!1,availableAnatomyFacets:[]}},methods:{hoverChanged:function(e){this.$emit("hover-changed",e)},showConnectivity:function(e){this.$emit("show-connectivity",e)},onConnectivityComponentClick:function(e){this.$emit("connectivity-component-click",e)},searchChanged:function(e,t){this.$emit("search-changed",{...t,id:e})},close:function(){this.drawerOpen=!1},toggleDrawer:function(){this.drawerOpen=!this.drawerOpen},openSearch:function(e,t){this.drawerOpen=!0,this.$nextTick(()=>{this.getSearchTabRefById(1).openSearch(e,t)})},getTabByIdAndType:function(e,t){const n=e||this.activeTabId,r=t||"search",a=this.tabs.find(s=>s.id===n&&s.type===r),i=this.tabs[0];return a||i},getTabRefId:function(e,t){let n="searchTab_";t==="connectivity"&&(n="connectivityTab_");const r=this.getTabByIdAndType(e,t);return n+r.id},getSearchTabRefById:function(e){const t=e||1,n=this.getTabRefId(t,"search");return this.$refs[n][0]},addFilter:function(e){this.drawerOpen=!0,e.AND=!0,this.$nextTick(()=>{this.getSearchTabRefById(1).addFilter(e)})},openNeuronSearch:function(e){this.drawerOpen=!0,this.$nextTick(()=>{this.getSearchTabRefById(1).openSearch("",void 0,"scicrunch-query-string/",{field:"*organ.curie",curie:e})})},getAlgoliaFacets:async function(){return await this.getSearchTabRefById(1).getAlgoliaFacets()},setDrawerOpen:function(e=!0){this.drawerOpen=e},tabClicked:function({id:e,type:t}){this.$emit("tabClicked",{id:e,type:t})},tabClose:function(e){this.$emit("connectivity-info-close")},updateConnectivityGraphError:function(e){Ht.emit("connectivity-graph-error",e)}},created:function(){this.drawerOpen=this.openAtStart},mounted:function(){Ht.on("PopoverActionClick",e=>{this.$emit("actionClick",e)}),Ht.on("number-of-datasets-for-anatomies",e=>{this.$emit("number-of-datasets-for-anatomies",e)}),Ht.on("anatomy-in-datasets",e=>{this.$emit("anatomy-in-datasets",e)}),Ht.on("contextUpdate",e=>{this.$emit("contextUpdate",e)}),Ht.on("datalink-clicked",e=>{this.$emit("datalink-clicked",e)}),Ht.on("onConnectivityActionClick",e=>{this.tabClicked({id:1,type:"search"}),this.$emit("actionClick",e)}),Ht.on("available-facets",e=>{this.availableAnatomyFacets=e.find(t=>t.label==="Anatomical Structure").children})}},Bde={ref:"container"},Tde={class:"box-card"},Nde={class:"sidebar-container"};function Ode(e,t,n,r,a,i){const s=sh,l=Bt,u=Nu,c=O4,d=N4,f=B4,h=zh;return o.openBlock(),o.createElementBlock("div",Bde,[e.drawerOpen?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("div",{key:0,onClick:t[0]||(t[0]=(...m)=>i.toggleDrawer&&i.toggleDrawer(...m)),class:"open-tab"},[o.createVNode(l,null,{default:o.withCtx(()=>[o.createVNode(s)]),_:1})])),o.createVNode(h,{class:"side-bar my-drawer",modelValue:e.drawerOpen,"onUpdate:modelValue":t[3]||(t[3]=m=>e.drawerOpen=m),teleported:!1,"modal-append-to-body":!1,size:"584","with-header":!1,wrapperClosable:!1,modal:!1,"modal-class":"sidebar-body","z-index":10,"lock-scroll":!1},{default:o.withCtx(()=>[o.createElementVNode("div",Tde,[e.drawerOpen?(o.openBlock(),o.createElementBlock("div",{key:0,onClick:t[1]||(t[1]=(...m)=>i.close&&i.close(...m)),class:"close-tab"},[o.createVNode(l,null,{default:o.withCtx(()=>[o.createVNode(u)]),_:1})])):o.createCommentVNode("",!0),o.createElementVNode("div",Nde,[n.tabs.length>1&&n.connectivityInfo?(o.openBlock(),o.createBlock(c,{key:0,tabTitles:n.tabs,activeId:n.activeTabId,onTitleClicked:i.tabClicked,onTabClose:i.tabClose},null,8,["tabTitles","activeId","onTitleClicked","onTabClose"])):o.createCommentVNode("",!0),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(n.tabs,m=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:"tab.id"},[m.type==="connectivity"&&n.connectivityInfo?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[m.id===n.activeTabId?(o.openBlock(),o.createBlock(d,{key:0,entry:n.connectivityInfo,availableAnatomyFacets:e.availableAnatomyFacets,envVars:n.envVars,ref_for:!0,ref:"connectivityTab_"+m.id,onShowConnectivity:i.showConnectivity,onConnectivityComponentClick:i.onConnectivityComponentClick},null,8,["entry","availableAnatomyFacets","envVars","onShowConnectivity","onConnectivityComponentClick"])):o.createCommentVNode("",!0)],64)):o.withDirectives((o.openBlock(),o.createBlock(f,{key:1,class:"sidebar-content-container",contextCardEntry:m.contextCard,envVars:n.envVars,ref_for:!0,ref:"searchTab_"+m.id,onSearchChanged:p=>i.searchChanged(m.id,p),onHoverChanged:t[2]||(t[2]=p=>i.hoverChanged(p))},null,8,["contextCardEntry","envVars","onSearchChanged"])),[[o.vShow,m.id===n.activeTabId]])],64))),128))])])]),_:1},8,["modelValue"])],512)}const $de=so(_de,[["render",Ode],["__scopeId","data-v-d9b833f7"]]);ht.SideBar=$de,Object.defineProperty(ht,Symbol.toStringTag,{value:"Module"})});
|