@squeed/flow-sdk 0.1.3 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -328,7 +328,7 @@ https://github.com/jquery/jquery/blob/master/src/event.js
328
328
  `).concat(t.picking?`if(outColor.a == 0.0) discard;
329
329
  else outColor = vIndex;`:"",`
330
330
  }
331
- `),s=a3(n,a,o);s.aPosition=n.getAttribLocation(s,"aPosition"),s.aIndex=n.getAttribLocation(s,"aIndex"),s.aVertType=n.getAttribLocation(s,"aVertType"),s.aTransform=n.getAttribLocation(s,"aTransform"),s.aAtlasId=n.getAttribLocation(s,"aAtlasId"),s.aTex=n.getAttribLocation(s,"aTex"),s.aPointAPointB=n.getAttribLocation(s,"aPointAPointB"),s.aPointCPointD=n.getAttribLocation(s,"aPointCPointD"),s.aLineWidth=n.getAttribLocation(s,"aLineWidth"),s.aColor=n.getAttribLocation(s,"aColor"),s.aCornerRadius=n.getAttribLocation(s,"aCornerRadius"),s.aBorderColor=n.getAttribLocation(s,"aBorderColor"),s.uPanZoomMatrix=n.getUniformLocation(s,"uPanZoomMatrix"),s.uAtlasSize=n.getUniformLocation(s,"uAtlasSize"),s.uBGColor=n.getUniformLocation(s,"uBGColor"),s.uZoom=n.getUniformLocation(s,"uZoom"),s.uTextures=[];for(var l=0;l<this.batchManager.getMaxAtlasesPerBatch();l++)s.uTextures.push(n.getUniformLocation(s,"uTexture".concat(l)));return s}},{key:"_createVAO",value:function(){var t=[0,0,1,0,1,1,0,0,1,1,0,1];this.vertexCount=t.length/2;var n=this.maxInstances,a=this.gl,i=this.program,o=a.createVertexArray();return a.bindVertexArray(o),v3(a,"vec2",i.aPosition,t),this.transformBuffer=h3(a,n,i.aTransform),this.indexBuffer=An(a,n,"vec4",i.aIndex),this.vertTypeBuffer=An(a,n,"int",i.aVertType),this.atlasIdBuffer=An(a,n,"int",i.aAtlasId),this.texBuffer=An(a,n,"vec4",i.aTex),this.pointAPointBBuffer=An(a,n,"vec4",i.aPointAPointB),this.pointCPointDBuffer=An(a,n,"vec4",i.aPointCPointD),this.lineWidthBuffer=An(a,n,"vec2",i.aLineWidth),this.colorBuffer=An(a,n,"vec4",i.aColor),this.cornerRadiusBuffer=An(a,n,"vec4",i.aCornerRadius),this.borderColorBuffer=An(a,n,"vec4",i.aBorderColor),a.bindVertexArray(null),o}},{key:"buffers",get:function(){var t=this;return this._buffers||(this._buffers=Object.keys(this).filter(function(n){return ya(n,"Buffer")}).map(function(n){return t[n]})),this._buffers}},{key:"startFrame",value:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ko.SCREEN;this.panZoomMatrix=t,this.renderTarget=n,this.batchDebugInfo=[],this.wrappedCount=0,this.simpleCount=0,this.startBatch()}},{key:"startBatch",value:function(){this.instanceCount=0,this.batchManager.startBatch()}},{key:"endFrame",value:function(){this.endBatch()}},{key:"_isVisible",value:function(t,n){return t.visible()?n&&n.isVisible?n.isVisible(t):!0:!1}},{key:"drawTexture",value:function(t,n,a){var i=this.atlasManager,o=this.batchManager,s=i.getRenderTypeOpts(a);if(this._isVisible(t,s)&&!(t.isEdge()&&!this._isValidEdge(t))){if(this.renderTarget.picking&&s.getTexPickingMode){var l=s.getTexPickingMode(t);if(l===rl.IGNORE)return;if(l==rl.USE_BB){this.drawPickingRectangle(t,n,a);return}}var u=i.getAtlasInfo(t,a),c=zt(u),d;try{for(c.s();!(d=c.n()).done;){var h=d.value,g=h.atlas,p=h.tex1,E=h.tex2;o.canAddToCurrentBatch(g)||this.endBatch();for(var y=o.getAtlasIndexForBatch(g),b=0,w=[[p,!0],[E,!1]];b<w.length;b++){var x=Yr(w[b],2),C=x[0],T=x[1];if(C.w!=0){var S=this.instanceCount;this.vertTypeBuffer.getView(S)[0]=Bd;var _=this.indexBuffer.getView(S);zi(n,_);var A=this.atlasIdBuffer.getView(S);A[0]=y;var P=this.texBuffer.getView(S);P[0]=C.x,P[1]=C.y,P[2]=C.w,P[3]=C.h;var I=this.transformBuffer.getMatrixView(S);this.setTransformMatrix(t,I,s,h,T),this.instanceCount++,T||this.wrappedCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}}}catch(D){c.e(D)}finally{c.f()}}}},{key:"setTransformMatrix",value:function(t,n,a,i){var o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,s=0;if(a.shapeProps&&a.shapeProps.padding&&(s=t.pstyle(a.shapeProps.padding).pfValue),i){var l=i.bb,u=i.tex1,c=i.tex2,d=u.w/(u.w+c.w);o||(d=1-d);var h=this._getAdjustedBB(l,s,o,d);this._applyTransformMatrix(n,h,a,t)}else{var g=a.getBoundingBox(t),p=this._getAdjustedBB(g,s,!0,1);this._applyTransformMatrix(n,p,a,t)}}},{key:"_applyTransformMatrix",value:function(t,n,a,i){var o,s;iE(t);var l=a.getRotation?a.getRotation(i):0;if(l!==0){var u=a.getRotationPoint(i),c=u.x,d=u.y;Fu(t,t,[c,d]),oE(t,t,l);var h=a.getRotationOffset(i);o=h.x+(n.xOffset||0),s=h.y+(n.yOffset||0)}else o=n.x1,s=n.y1;Fu(t,t,[o,s]),wm(t,t,[n.w,n.h])}},{key:"_getAdjustedBB",value:function(t,n,a,i){var o=t.x1,s=t.y1,l=t.w,u=t.h,c=t.yOffset;n&&(o-=n,s-=n,l+=2*n,u+=2*n);var d=0,h=l*i;return a&&i<1?l=h:!a&&i<1&&(d=l-h,o+=d,l=h),{x1:o,y1:s,w:l,h:u,xOffset:d,yOffset:c}}},{key:"drawPickingRectangle",value:function(t,n,a){var i=this.atlasManager.getRenderTypeOpts(a),o=this.instanceCount;this.vertTypeBuffer.getView(o)[0]=$i;var s=this.indexBuffer.getView(o);zi(n,s);var l=this.colorBuffer.getView(o);Za([0,0,0],1,l);var u=this.transformBuffer.getMatrixView(o);this.setTransformMatrix(t,u,i),this.simpleCount++,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}},{key:"drawNode",value:function(t,n,a){var i=this.simpleShapeOptions.get(a);if(this._isVisible(t,i)){var o=i.shapeProps,s=this._getVertTypeForShape(t,o.shape);if(s===void 0||i.isSimple&&!i.isSimple(t)){this.drawTexture(t,n,a);return}var l=this.instanceCount;if(this.vertTypeBuffer.getView(l)[0]=s,s===Ru||s===Oo){var u=i.getBoundingBox(t),c=this._getCornerRadius(t,o.radius,u),d=this.cornerRadiusBuffer.getView(l);d[0]=c,d[1]=c,d[2]=c,d[3]=c,s===Oo&&(d[0]=0,d[2]=0)}var h=this.indexBuffer.getView(l);zi(n,h);var g=t.pstyle(o.color).value,p=t.pstyle(o.opacity).value,E=this.colorBuffer.getView(l);Za(g,p,E);var y=this.lineWidthBuffer.getView(l);if(y[0]=0,y[1]=0,o.border){var b=t.pstyle("border-width").value;if(b>0){var w=t.pstyle("border-color").value,x=t.pstyle("border-opacity").value,C=this.borderColorBuffer.getView(l);Za(w,x,C);var T=t.pstyle("border-position").value;if(T==="inside")y[0]=0,y[1]=-b;else if(T==="outside")y[0]=b,y[1]=0;else{var S=b/2;y[0]=S,y[1]=-S}}}var _=this.transformBuffer.getMatrixView(l);this.setTransformMatrix(t,_,i),this.simpleCount++,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}},{key:"_getVertTypeForShape",value:function(t,n){var a=t.pstyle(n).value;switch(a){case"rectangle":return $i;case"ellipse":return Lo;case"roundrectangle":case"round-rectangle":return Ru;case"bottom-round-rectangle":return Oo;default:return}}},{key:"_getCornerRadius",value:function(t,n,a){var i=a.w,o=a.h;if(t.pstyle(n).value==="auto")return Sa(i,o);var s=t.pstyle(n).pfValue,l=i/2,u=o/2;return Math.min(s,u,l)}},{key:"drawEdgeArrow",value:function(t,n,a){if(t.visible()){var i=t._private.rscratch,o,s,l;if(a==="source"?(o=i.arrowStartX,s=i.arrowStartY,l=i.srcArrowAngle):(o=i.arrowEndX,s=i.arrowEndY,l=i.tgtArrowAngle),!(isNaN(o)||o==null||isNaN(s)||s==null||isNaN(l)||l==null)){var u=t.pstyle(a+"-arrow-shape").value;if(u!=="none"){var c=t.pstyle(a+"-arrow-color").value,d=t.pstyle("opacity").value,h=t.pstyle("line-opacity").value,g=d*h,p=t.pstyle("width").pfValue,E=t.pstyle("arrow-scale").value,y=this.r.getArrowWidth(p,E),b=this.instanceCount,w=this.transformBuffer.getMatrixView(b);iE(w),Fu(w,w,[o,s]),wm(w,w,[y,y]),oE(w,w,l),this.vertTypeBuffer.getView(b)[0]=Md;var x=this.indexBuffer.getView(b);zi(n,x);var C=this.colorBuffer.getView(b);Za(c,g,C),this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}}}},{key:"drawEdgeLine",value:function(t,n){if(t.visible()){var a=this._getEdgePoints(t);if(a){var i=t.pstyle("opacity").value,o=t.pstyle("line-opacity").value,s=t.pstyle("width").pfValue,l=t.pstyle("line-color").value,u=i*o;if(a.length/2+this.instanceCount>this.maxInstances&&this.endBatch(),a.length==4){var c=this.instanceCount;this.vertTypeBuffer.getView(c)[0]=sE;var d=this.indexBuffer.getView(c);zi(n,d);var h=this.colorBuffer.getView(c);Za(l,u,h);var g=this.lineWidthBuffer.getView(c);g[0]=s;var p=this.pointAPointBBuffer.getView(c);p[0]=a[0],p[1]=a[1],p[2]=a[2],p[3]=a[3],this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}else for(var E=0;E<a.length-2;E+=2){var y=this.instanceCount;this.vertTypeBuffer.getView(y)[0]=uE;var b=this.indexBuffer.getView(y);zi(n,b);var w=this.colorBuffer.getView(y);Za(l,u,w);var x=this.lineWidthBuffer.getView(y);x[0]=s;var C=a[E-2],T=a[E-1],S=a[E],_=a[E+1],A=a[E+2],P=a[E+3],I=a[E+4],D=a[E+5];E==0&&(C=2*S-A+.001,T=2*_-P+.001),E==a.length-4&&(I=2*A-S+.001,D=2*P-_+.001);var k=this.pointAPointBBuffer.getView(y);k[0]=C,k[1]=T,k[2]=S,k[3]=_;var M=this.pointCPointDBuffer.getView(y);M[0]=A,M[1]=P,M[2]=I,M[3]=D,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}}}},{key:"_isValidEdge",value:function(t){var n=t._private.rscratch;return!(n.badLine||n.allpts==null||isNaN(n.allpts[0]))}},{key:"_getEdgePoints",value:function(t){var n=t._private.rscratch;if(this._isValidEdge(t)){var a=n.allpts;if(a.length==4)return a;var i=this._getNumSegments(t);return this._getCurveSegmentPoints(a,i)}}},{key:"_getNumSegments",value:function(t){var n=15;return Math.min(Math.max(n,5),this.maxInstances)}},{key:"_getCurveSegmentPoints",value:function(t,n){if(t.length==4)return t;for(var a=Array((n+1)*2),i=0;i<=n;i++)if(i==0)a[0]=t[0],a[1]=t[1];else if(i==n)a[i*2]=t[t.length-2],a[i*2+1]=t[t.length-1];else{var o=i/n;this._setCurvePoint(t,o,a,i*2)}return a}},{key:"_setCurvePoint",value:function(t,n,a,i){if(t.length<=2)a[i]=t[0],a[i+1]=t[1];else{for(var o=Array(t.length-2),s=0;s<o.length;s+=2){var l=(1-n)*t[s]+n*t[s+2],u=(1-n)*t[s+1]+n*t[s+3];o[s]=l,o[s+1]=u}return this._setCurvePoint(o,n,a,i)}}},{key:"endBatch",value:function(){var t=this.gl,n=this.vao,a=this.vertexCount,i=this.instanceCount;if(i!==0){var o=this.renderTarget.picking?this.pickingProgram:this.program;t.useProgram(o),t.bindVertexArray(n);var s=zt(this.buffers),l;try{for(s.s();!(l=s.n()).done;){var u=l.value;u.bufferSubData(i)}}catch(p){s.e(p)}finally{s.f()}for(var c=this.batchManager.getAtlases(),d=0;d<c.length;d++)c[d].bufferIfNeeded(t);for(var h=0;h<c.length;h++)t.activeTexture(t.TEXTURE0+h),t.bindTexture(t.TEXTURE_2D,c[h].texture),t.uniform1i(o.uTextures[h],h);t.uniform1f(o.uZoom,o3(this.r)),t.uniformMatrix3fv(o.uPanZoomMatrix,!1,this.panZoomMatrix),t.uniform1i(o.uAtlasSize,this.batchManager.getAtlasSize());var g=Za(this.bgColor,1);t.uniform4fv(o.uBGColor,g),t.drawArraysInstanced(t.TRIANGLES,0,a,i),t.bindVertexArray(null),t.bindTexture(t.TEXTURE_2D,null),this.debug&&this.batchDebugInfo.push({count:i,atlasCount:c.length}),this.startBatch()}}},{key:"getDebugInfo",value:function(){var t=this.atlasManager.getDebugInfo(),n=t.reduce(function(o,s){return o+s.atlasCount},0),a=this.batchDebugInfo,i=a.reduce(function(o,s){return o+s.count},0);return{atlasInfo:t,totalAtlases:n,wrappedCount:this.wrappedCount,simpleCount:this.simpleCount,batchCount:a.length,batchInfo:a,totalInstances:i}}}])})(),BA={};BA.initWebgl=function(r,e){var t=this,n=t.data.contexts[t.WEBGL];r.bgColor=A3(t),r.webglTexSize=Math.min(r.webglTexSize,n.getParameter(n.MAX_TEXTURE_SIZE)),r.webglTexRows=Math.min(r.webglTexRows,54),r.webglTexRowsNodes=Math.min(r.webglTexRowsNodes,54),r.webglBatchSize=Math.min(r.webglBatchSize,16384),r.webglTexPerBatch=Math.min(r.webglTexPerBatch,n.getParameter(n.MAX_TEXTURE_IMAGE_UNITS)),t.webglDebug=r.webglDebug,t.webglDebugShowAtlases=r.webglDebugShowAtlases,t.pickingFrameBuffer=g3(n),t.pickingFrameBuffer.needsDraw=!0,t.drawing=new R3(t,n,r);var a=function(d){return function(h){return t.getTextAngle(h,d)}},i=function(d){return function(h){var g=h.pstyle(d);return g&&g.value}},o=function(d){return function(h){return h.pstyle("".concat(d,"-opacity")).value>0}},s=function(d){var h=d.pstyle("text-events").strValue==="yes";return h?rl.USE_BB:rl.IGNORE},l=function(d){var h=d.position(),g=h.x,p=h.y,E=d.outerWidth(),y=d.outerHeight();return{w:E,h:y,x1:g-E/2,y1:p-y/2}};t.drawing.addAtlasCollection("node",{texRows:r.webglTexRowsNodes}),t.drawing.addAtlasCollection("label",{texRows:r.webglTexRows}),t.drawing.addTextureAtlasRenderType("node-body",{collection:"node",getKey:e.getStyleKey,getBoundingBox:e.getElementBox,drawElement:e.drawElement}),t.drawing.addSimpleShapeRenderType("node-body",{getBoundingBox:l,isSimple:u3,shapeProps:{shape:"shape",color:"background-color",opacity:"background-opacity",radius:"corner-radius",border:!0}}),t.drawing.addSimpleShapeRenderType("node-overlay",{getBoundingBox:l,isVisible:o("overlay"),shapeProps:{shape:"overlay-shape",color:"overlay-color",opacity:"overlay-opacity",padding:"overlay-padding",radius:"overlay-corner-radius"}}),t.drawing.addSimpleShapeRenderType("node-underlay",{getBoundingBox:l,isVisible:o("underlay"),shapeProps:{shape:"underlay-shape",color:"underlay-color",opacity:"underlay-opacity",padding:"underlay-padding",radius:"underlay-corner-radius"}}),t.drawing.addTextureAtlasRenderType("label",{collection:"label",getTexPickingMode:s,getKey:kd(e.getLabelKey,null),getBoundingBox:Od(e.getLabelBox,null),drawClipped:!0,drawElement:e.drawLabel,getRotation:a(null),getRotationPoint:e.getLabelRotationPoint,getRotationOffset:e.getLabelRotationOffset,isVisible:i("label")}),t.drawing.addTextureAtlasRenderType("edge-source-label",{collection:"label",getTexPickingMode:s,getKey:kd(e.getSourceLabelKey,"source"),getBoundingBox:Od(e.getSourceLabelBox,"source"),drawClipped:!0,drawElement:e.drawSourceLabel,getRotation:a("source"),getRotationPoint:e.getSourceLabelRotationPoint,getRotationOffset:e.getSourceLabelRotationOffset,isVisible:i("source-label")}),t.drawing.addTextureAtlasRenderType("edge-target-label",{collection:"label",getTexPickingMode:s,getKey:kd(e.getTargetLabelKey,"target"),getBoundingBox:Od(e.getTargetLabelBox,"target"),drawClipped:!0,drawElement:e.drawTargetLabel,getRotation:a("target"),getRotationPoint:e.getTargetLabelRotationPoint,getRotationOffset:e.getTargetLabelRotationOffset,isVisible:i("target-label")});var u=hs(function(){console.log("garbage collect flag set"),t.data.gc=!0},1e4);t.onUpdateEleCalcs(function(c,d){var h=!1;d&&d.length>0&&(h|=t.drawing.invalidate(d)),h&&u()}),P3(t)};function A3(r){var e=r.cy.container(),t=e&&e.style&&e.style.backgroundColor||"white";return oR(t)}function MA(r,e){var t=r._private.rscratch;return Nt(t,"labelWrapCachedLines",e)||[]}var kd=function(e,t){return function(n){var a=e(n),i=MA(n,t);return i.length>1?i.map(function(o,s){return"".concat(a,"_").concat(s)}):a}},Od=function(e,t){return function(n,a){var i=e(n);if(typeof a=="string"){var o=a.indexOf("_");if(o>0){var s=Number(a.substring(o+1)),l=MA(n,t),u=i.h/l.length,c=u*s,d=i.y1+c;return{x1:i.x1,w:i.w,y1:d,h:u,yOffset:c}}}return i}};function P3(r){{var e=r.render;r.render=function(i){i=i||{};var o=r.cy;r.webgl&&(o.zoom()>SA?(I3(r),e.call(r,i)):(D3(r),OA(r,i,Ko.SCREEN)))}}{var t=r.matchCanvasSize;r.matchCanvasSize=function(i){t.call(r,i),r.pickingFrameBuffer.setFramebufferAttachmentSizes(r.canvasWidth,r.canvasHeight),r.pickingFrameBuffer.needsDraw=!0}}r.findNearestElements=function(i,o,s,l){return q3(r,i,o)};{var n=r.invalidateCachedZSortedEles;r.invalidateCachedZSortedEles=function(){n.call(r),r.pickingFrameBuffer.needsDraw=!0}}{var a=r.notify;r.notify=function(i,o){a.call(r,i,o),i==="viewport"||i==="bounds"?r.pickingFrameBuffer.needsDraw=!0:i==="background"&&r.drawing.invalidate(o,{type:"node-body"})}}}function I3(r){var e=r.data.contexts[r.WEBGL];e.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT)}function D3(r){var e=function(n){n.save(),n.setTransform(1,0,0,1,0,0),n.clearRect(0,0,r.canvasWidth,r.canvasHeight),n.restore()};e(r.data.contexts[r.NODE]),e(r.data.contexts[r.DRAG])}function B3(r){var e=r.canvasWidth,t=r.canvasHeight,n=Ym(r),a=n.pan,i=n.zoom,o=Dd();Fu(o,o,[a.x,a.y]),wm(o,o,[i,i]);var s=Dd();y3(s,e,t);var l=Dd();return p3(l,s,o),l}function kA(r,e){var t=r.canvasWidth,n=r.canvasHeight,a=Ym(r),i=a.pan,o=a.zoom;e.setTransform(1,0,0,1,0,0),e.clearRect(0,0,t,n),e.translate(i.x,i.y),e.scale(o,o)}function M3(r,e){r.drawSelectionRectangle(e,function(t){return kA(r,t)})}function k3(r){var e=r.data.contexts[r.NODE];e.save(),kA(r,e),e.strokeStyle="rgba(0, 0, 0, 0.3)",e.beginPath(),e.moveTo(-1e3,0),e.lineTo(1e3,0),e.stroke(),e.beginPath(),e.moveTo(0,-1e3),e.lineTo(0,1e3),e.stroke(),e.restore()}function O3(r){var e=function(a,i,o){for(var s=a.atlasManager.getAtlasCollection(i),l=r.data.contexts[r.NODE],u=s.atlases,c=0;c<u.length;c++){var d=u[c],h=d.canvas;if(h){var g=h.width,p=h.height,E=g*c,y=h.height*o,b=.4;l.save(),l.scale(b,b),l.drawImage(h,E,y),l.strokeStyle="black",l.rect(E,y,g,p),l.stroke(),l.restore()}}},t=0;e(r.drawing,"node",t++),e(r.drawing,"label",t++)}function L3(r,e,t,n,a){var i,o,s,l,u=Ym(r),c=u.pan,d=u.zoom;{var h=s3(r,c,d,e,t),g=Yr(h,2),p=g[0],E=g[1],y=6;i=p-y/2,o=E-y/2,s=y,l=y}if(s===0||l===0)return[];var b=r.data.contexts[r.WEBGL];b.bindFramebuffer(b.FRAMEBUFFER,r.pickingFrameBuffer),r.pickingFrameBuffer.needsDraw&&(b.viewport(0,0,b.canvas.width,b.canvas.height),OA(r,null,Ko.PICKING),r.pickingFrameBuffer.needsDraw=!1);var w=s*l,x=new Uint8Array(w*4);b.readPixels(i,o,s,l,b.RGBA,b.UNSIGNED_BYTE,x),b.bindFramebuffer(b.FRAMEBUFFER,null);for(var C=new Set,T=0;T<w;T++){var S=x.slice(T*4,T*4+4),_=f3(S)-1;_>=0&&C.add(_)}return C}function q3(r,e,t){var n=L3(r,e,t),a=r.getCachedZSortedEles(),i,o,s=zt(n),l;try{for(s.s();!(l=s.n()).done;){var u=l.value,c=a[u];if(!i&&c.isNode()&&(i=c),!o&&c.isEdge()&&(o=c),i&&o)break}}catch(d){s.e(d)}finally{s.f()}return[i,o].filter(Boolean)}function Ld(r,e,t){var n=r.drawing;e+=1,t.isNode()?(n.drawNode(t,e,"node-underlay"),n.drawNode(t,e,"node-body"),n.drawTexture(t,e,"label"),n.drawNode(t,e,"node-overlay")):(n.drawEdgeLine(t,e),n.drawEdgeArrow(t,e,"source"),n.drawEdgeArrow(t,e,"target"),n.drawTexture(t,e,"label"),n.drawTexture(t,e,"edge-source-label"),n.drawTexture(t,e,"edge-target-label"))}function OA(r,e,t){var n;r.webglDebug&&(n=performance.now());var a=r.drawing,i=0;if(t.screen&&r.data.canvasNeedsRedraw[r.SELECT_BOX]&&M3(r,e),r.data.canvasNeedsRedraw[r.NODE]||t.picking){var o=r.data.contexts[r.WEBGL];t.screen?(o.clearColor(0,0,0,0),o.enable(o.BLEND),o.blendFunc(o.ONE,o.ONE_MINUS_SRC_ALPHA)):o.disable(o.BLEND),o.clear(o.COLOR_BUFFER_BIT|o.DEPTH_BUFFER_BIT),o.viewport(0,0,o.canvas.width,o.canvas.height);var s=B3(r),l=r.getCachedZSortedEles();if(i=l.length,a.startFrame(s,t),t.screen){for(var u=0;u<l.nondrag.length;u++)Ld(r,u,l.nondrag[u]);for(var c=0;c<l.drag.length;c++)Ld(r,c,l.drag[c])}else if(t.picking)for(var d=0;d<l.length;d++)Ld(r,d,l[d]);a.endFrame(),t.screen&&r.webglDebugShowAtlases&&(k3(r),O3(r)),r.data.canvasNeedsRedraw[r.NODE]=!1,r.data.canvasNeedsRedraw[r.DRAG]=!1}if(r.webglDebug){var h=performance.now(),g=!1,p=Math.ceil(h-n),E=a.getDebugInfo(),y=["".concat(i," elements"),"".concat(E.totalInstances," instances"),"".concat(E.batchCount," batches"),"".concat(E.totalAtlases," atlases"),"".concat(E.wrappedCount," wrapped textures"),"".concat(E.simpleCount," simple shapes")].join(", ");if(g)console.log("WebGL (".concat(t.name,") - time ").concat(p,"ms, ").concat(y));else{console.log("WebGL (".concat(t.name,") - frame time ").concat(p,"ms")),console.log("Totals:"),console.log(" ".concat(y)),console.log("Texture Atlases Used:");var b=E.atlasInfo,w=zt(b),x;try{for(w.s();!(x=w.n()).done;){var C=x.value;console.log(" ".concat(C.type,": ").concat(C.keyCount," keys, ").concat(C.atlasCount," atlases"))}}catch(T){w.e(T)}finally{w.f()}console.log("")}}r.data.gc&&(console.log("Garbage Collect!"),r.data.gc=!1,a.gc())}var La={};La.drawPolygonPath=function(r,e,t,n,a,i){var o=n/2,s=a/2;r.beginPath&&r.beginPath(),r.moveTo(e+o*i[0],t+s*i[1]);for(var l=1;l<i.length/2;l++)r.lineTo(e+o*i[l*2],t+s*i[l*2+1]);r.closePath()};La.drawRoundPolygonPath=function(r,e,t,n,a,i,o){o.forEach(function(s){return pA(r,s)}),r.closePath()};La.drawRoundRectanglePath=function(r,e,t,n,a,i){var o=n/2,s=a/2,l=i==="auto"?Sa(n,a):Math.min(i,s,o);r.beginPath&&r.beginPath(),r.moveTo(e,t-s),r.arcTo(e+o,t-s,e+o,t,l),r.arcTo(e+o,t+s,e,t+s,l),r.arcTo(e-o,t+s,e-o,t,l),r.arcTo(e-o,t-s,e,t-s,l),r.lineTo(e,t-s),r.closePath()};La.drawBottomRoundRectanglePath=function(r,e,t,n,a,i){var o=n/2,s=a/2,l=i==="auto"?Sa(n,a):i;r.beginPath&&r.beginPath(),r.moveTo(e,t-s),r.lineTo(e+o,t-s),r.lineTo(e+o,t),r.arcTo(e+o,t+s,e,t+s,l),r.arcTo(e-o,t+s,e-o,t,l),r.lineTo(e-o,t-s),r.lineTo(e,t-s),r.closePath()};La.drawCutRectanglePath=function(r,e,t,n,a,i,o){var s=n/2,l=a/2,u=o==="auto"?Om():o;r.beginPath&&r.beginPath(),r.moveTo(e-s+u,t-l),r.lineTo(e+s-u,t-l),r.lineTo(e+s,t-l+u),r.lineTo(e+s,t+l-u),r.lineTo(e+s-u,t+l),r.lineTo(e-s+u,t+l),r.lineTo(e-s,t+l-u),r.lineTo(e-s,t-l+u),r.closePath()};La.drawBarrelPath=function(r,e,t,n,a){var i=n/2,o=a/2,s=e-i,l=e+i,u=t-o,c=t+o,d=om(n,a),h=d.widthOffset,g=d.heightOffset,p=d.ctrlPtOffsetPct*h;r.beginPath&&r.beginPath(),r.moveTo(s,u+g),r.lineTo(s,c-g),r.quadraticCurveTo(s+p,c,s+h,c),r.lineTo(l-h,c),r.quadraticCurveTo(l-p,c,l,c-g),r.lineTo(l,u+g),r.quadraticCurveTo(l-p,u,l-h,u),r.lineTo(s+h,u),r.quadraticCurveTo(s+p,u,s,u+g),r.closePath()};var lE=Math.sin(0),fE=Math.cos(0),xm={},Em={},LA=Math.PI/40;for(var Vi=0*Math.PI;Vi<2*Math.PI;Vi+=LA)xm[Vi]=Math.sin(Vi),Em[Vi]=Math.cos(Vi);La.drawEllipsePath=function(r,e,t,n,a){if(r.beginPath&&r.beginPath(),r.ellipse)r.ellipse(e,t,n/2,a/2,0,0,2*Math.PI);else for(var i,o,s=n/2,l=a/2,u=0*Math.PI;u<2*Math.PI;u+=LA)i=e-s*xm[u]*lE+s*Em[u]*fE,o=t+l*Em[u]*lE+l*xm[u]*fE,u===0?r.moveTo(i,o):r.lineTo(i,o);r.closePath()};var ws={};ws.createBuffer=function(r,e){var t=document.createElement("canvas");return t.width=r,t.height=e,[t,t.getContext("2d")]};ws.bufferCanvasImage=function(r){var e=this.cy,t=e.mutableElements(),n=t.boundingBox(),a=this.findContainerClientCoords(),i=r.full?Math.ceil(n.w):a[2],o=r.full?Math.ceil(n.h):a[3],s=Me(r.maxWidth)||Me(r.maxHeight),l=this.getPixelRatio(),u=1;if(r.scale!==void 0)i*=r.scale,o*=r.scale,u=r.scale;else if(s){var c=1/0,d=1/0;Me(r.maxWidth)&&(c=u*r.maxWidth/i),Me(r.maxHeight)&&(d=u*r.maxHeight/o),u=Math.min(c,d),i*=u,o*=u}s||(i*=l,o*=l,u*=l);var h=document.createElement("canvas");h.width=i,h.height=o,h.style.width=i+"px",h.style.height=o+"px";var g=h.getContext("2d");if(i>0&&o>0){g.clearRect(0,0,i,o),g.globalCompositeOperation="source-over";var p=this.getCachedZSortedEles();if(r.full)g.translate(-n.x1*u,-n.y1*u),g.scale(u,u),this.drawElements(g,p),g.scale(1/u,1/u),g.translate(n.x1*u,n.y1*u);else{var E=e.pan(),y={x:E.x*u,y:E.y*u};u*=e.zoom(),g.translate(y.x,y.y),g.scale(u,u),this.drawElements(g,p),g.scale(1/u,1/u),g.translate(-y.x,-y.y)}r.bg&&(g.globalCompositeOperation="destination-over",g.fillStyle=r.bg,g.rect(0,0,i,o),g.fill())}return h};function N3(r,e){for(var t=atob(r),n=new ArrayBuffer(t.length),a=new Uint8Array(n),i=0;i<t.length;i++)a[i]=t.charCodeAt(i);return new Blob([n],{type:e})}function cE(r){var e=r.indexOf(",");return r.substr(e+1)}function qA(r,e,t){var n=function(){return e.toDataURL(t,r.quality)};switch(r.output){case"blob-promise":return new no(function(a,i){try{e.toBlob(function(o){o!=null?a(o):i(new Error("`canvas.toBlob()` sent a null value in its callback"))},t,r.quality)}catch(o){i(o)}});case"blob":return N3(cE(n()),t);case"base64":return cE(n());case"base64uri":default:return n()}}ws.png=function(r){return qA(r,this.bufferCanvasImage(r),"image/png")};ws.jpg=function(r){return qA(r,this.bufferCanvasImage(r),"image/jpeg")};var NA={};NA.nodeShapeImpl=function(r,e,t,n,a,i,o,s){switch(r){case"ellipse":return this.drawEllipsePath(e,t,n,a,i);case"polygon":return this.drawPolygonPath(e,t,n,a,i,o);case"round-polygon":return this.drawRoundPolygonPath(e,t,n,a,i,o,s);case"roundrectangle":case"round-rectangle":return this.drawRoundRectanglePath(e,t,n,a,i,s);case"cutrectangle":case"cut-rectangle":return this.drawCutRectanglePath(e,t,n,a,i,o,s);case"bottomroundrectangle":case"bottom-round-rectangle":return this.drawBottomRoundRectanglePath(e,t,n,a,i,s);case"barrel":return this.drawBarrelPath(e,t,n,a,i)}};var F3=FA,fr=FA.prototype;fr.CANVAS_LAYERS=3;fr.SELECT_BOX=0;fr.DRAG=1;fr.NODE=2;fr.WEBGL=3;fr.CANVAS_TYPES=["2d","2d","2d","webgl2"];fr.BUFFER_COUNT=3;fr.TEXTURE_BUFFER=0;fr.MOTIONBLUR_BUFFER_NODE=1;fr.MOTIONBLUR_BUFFER_DRAG=2;function FA(r){var e=this,t=e.cy.window(),n=t.document;r.webgl&&(fr.CANVAS_LAYERS=e.CANVAS_LAYERS=4,console.log("webgl rendering enabled")),e.data={canvases:new Array(fr.CANVAS_LAYERS),contexts:new Array(fr.CANVAS_LAYERS),canvasNeedsRedraw:new Array(fr.CANVAS_LAYERS),bufferCanvases:new Array(fr.BUFFER_COUNT),bufferContexts:new Array(fr.CANVAS_LAYERS)};var a="-webkit-tap-highlight-color",i="rgba(0,0,0,0)";e.data.canvasContainer=n.createElement("div");var o=e.data.canvasContainer.style;e.data.canvasContainer.style[a]=i,o.position="relative",o.zIndex="0",o.overflow="hidden";var s=r.cy.container();s.appendChild(e.data.canvasContainer),s.style[a]=i;var l={"-webkit-user-select":"none","-moz-user-select":"-moz-none","user-select":"none","-webkit-tap-highlight-color":"rgba(0,0,0,0)","outline-style":"none"};Mq()&&(l["-ms-touch-action"]="none",l["touch-action"]="none");for(var u=0;u<fr.CANVAS_LAYERS;u++){var c=e.data.canvases[u]=n.createElement("canvas"),d=fr.CANVAS_TYPES[u];e.data.contexts[u]=c.getContext(d),e.data.contexts[u]||Lr("Could not create canvas of type "+d),Object.keys(l).forEach(function(se){c.style[se]=l[se]}),c.style.position="absolute",c.setAttribute("data-id","layer"+u),c.style.zIndex=String(fr.CANVAS_LAYERS-u),e.data.canvasContainer.appendChild(c),e.data.canvasNeedsRedraw[u]=!1}e.data.topCanvas=e.data.canvases[0],e.data.canvases[fr.NODE].setAttribute("data-id","layer"+fr.NODE+"-node"),e.data.canvases[fr.SELECT_BOX].setAttribute("data-id","layer"+fr.SELECT_BOX+"-selectbox"),e.data.canvases[fr.DRAG].setAttribute("data-id","layer"+fr.DRAG+"-drag"),e.data.canvases[fr.WEBGL]&&e.data.canvases[fr.WEBGL].setAttribute("data-id","layer"+fr.WEBGL+"-webgl");for(var u=0;u<fr.BUFFER_COUNT;u++)e.data.bufferCanvases[u]=n.createElement("canvas"),e.data.bufferContexts[u]=e.data.bufferCanvases[u].getContext("2d"),e.data.bufferCanvases[u].style.position="absolute",e.data.bufferCanvases[u].setAttribute("data-id","buffer"+u),e.data.bufferCanvases[u].style.zIndex=String(-u-1),e.data.bufferCanvases[u].style.visibility="hidden";e.pathsEnabled=!0;var h=Dt(),g=function(X){return{x:(X.x1+X.x2)/2,y:(X.y1+X.y2)/2}},p=function(X){return{x:-X.w/2,y:-X.h/2}},E=function(X){var Q=X[0]._private,ae=Q.oldBackgroundTimestamp===Q.backgroundTimestamp;return!ae},y=function(X){return X[0]._private.nodeKey},b=function(X){return X[0]._private.labelStyleKey},w=function(X){return X[0]._private.sourceLabelStyleKey},x=function(X){return X[0]._private.targetLabelStyleKey},C=function(X,Q,ae,te,ce){return e.drawElement(X,Q,ae,!1,!1,ce)},T=function(X,Q,ae,te,ce){return e.drawElementText(X,Q,ae,te,"main",ce)},S=function(X,Q,ae,te,ce){return e.drawElementText(X,Q,ae,te,"source",ce)},_=function(X,Q,ae,te,ce){return e.drawElementText(X,Q,ae,te,"target",ce)},A=function(X){return X.boundingBox(),X[0]._private.bodyBounds},P=function(X){return X.boundingBox(),X[0]._private.labelBounds.main||h},I=function(X){return X.boundingBox(),X[0]._private.labelBounds.source||h},D=function(X){return X.boundingBox(),X[0]._private.labelBounds.target||h},k=function(X,Q){return Q},M=function(X){return g(A(X))},N=function(X,Q,ae){var te=X?X+"-":"";return{x:Q.x+ae.pstyle(te+"text-margin-x").pfValue,y:Q.y+ae.pstyle(te+"text-margin-y").pfValue}},z=function(X,Q,ae){var te=X[0]._private.rscratch;return{x:te[Q],y:te[ae]}},$=function(X){return N("",z(X,"labelX","labelY"),X)},q=function(X){return N("source",z(X,"sourceLabelX","sourceLabelY"),X)},V=function(X){return N("target",z(X,"targetLabelX","targetLabelY"),X)},Z=function(X){return p(A(X))},K=function(X){return p(I(X))},j=function(X){return p(D(X))},ee=function(X){var Q=P(X),ae=p(P(X));if(X.isNode()){switch(X.pstyle("text-halign").value){case"left":ae.x=-Q.w-(Q.leftPad||0);break;case"right":ae.x=-(Q.rightPad||0);break}switch(X.pstyle("text-valign").value){case"top":ae.y=-Q.h-(Q.topPad||0);break;case"bottom":ae.y=-(Q.botPad||0);break}}return ae},le=e.data.eleTxrCache=new Fo(e,{getKey:y,doesEleInvalidateKey:E,drawElement:C,getBoundingBox:A,getRotationPoint:M,getRotationOffset:Z,allowEdgeTxrCaching:!1,allowParentTxrCaching:!1}),W=e.data.lblTxrCache=new Fo(e,{getKey:b,drawElement:T,getBoundingBox:P,getRotationPoint:$,getRotationOffset:ee,isVisible:k}),G=e.data.slbTxrCache=new Fo(e,{getKey:w,drawElement:S,getBoundingBox:I,getRotationPoint:q,getRotationOffset:K,isVisible:k}),Y=e.data.tlbTxrCache=new Fo(e,{getKey:x,drawElement:_,getBoundingBox:D,getRotationPoint:V,getRotationOffset:j,isVisible:k}),re=e.data.lyrTxrCache=new TA(e);e.onUpdateEleCalcs(function(X,Q){le.invalidateElements(Q),W.invalidateElements(Q),G.invalidateElements(Q),Y.invalidateElements(Q),re.invalidateElements(Q);for(var ae=0;ae<Q.length;ae++){var te=Q[ae]._private;te.oldBackgroundTimestamp=te.backgroundTimestamp}});var de=function(X){for(var Q=0;Q<X.length;Q++)re.enqueueElementRefinement(X[Q].ele)};le.onDequeue(de),W.onDequeue(de),G.onDequeue(de),Y.onDequeue(de),r.webgl&&e.initWebgl(r,{getStyleKey:y,getLabelKey:b,getSourceLabelKey:w,getTargetLabelKey:x,drawElement:C,drawLabel:T,drawSourceLabel:S,drawTargetLabel:_,getElementBox:A,getLabelBox:P,getSourceLabelBox:I,getTargetLabelBox:D,getElementRotationPoint:M,getElementRotationOffset:Z,getLabelRotationPoint:$,getSourceLabelRotationPoint:q,getTargetLabelRotationPoint:V,getLabelRotationOffset:ee,getSourceLabelRotationOffset:K,getTargetLabelRotationOffset:j})}fr.redrawHint=function(r,e){var t=this;switch(r){case"eles":t.data.canvasNeedsRedraw[fr.NODE]=e;break;case"drag":t.data.canvasNeedsRedraw[fr.DRAG]=e;break;case"select":t.data.canvasNeedsRedraw[fr.SELECT_BOX]=e;break;case"gc":t.data.gc=!0;break}};var z3=typeof Path2D<"u";fr.path2dEnabled=function(r){if(r===void 0)return this.pathsEnabled;this.pathsEnabled=!!r};fr.usePaths=function(){return z3&&this.pathsEnabled};fr.setImgSmoothing=function(r,e){r.imageSmoothingEnabled!=null?r.imageSmoothingEnabled=e:(r.webkitImageSmoothingEnabled=e,r.mozImageSmoothingEnabled=e,r.msImageSmoothingEnabled=e)};fr.getImgSmoothing=function(r){return r.imageSmoothingEnabled!=null?r.imageSmoothingEnabled:r.webkitImageSmoothingEnabled||r.mozImageSmoothingEnabled||r.msImageSmoothingEnabled};fr.makeOffscreenCanvas=function(r,e){var t;if((typeof OffscreenCanvas>"u"?"undefined":tt(OffscreenCanvas))!=="undefined")t=new OffscreenCanvas(r,e);else{var n=this.cy.window(),a=n.document;t=a.createElement("canvas"),t.width=r,t.height=e}return t};[RA,kn,Jn,jm,fi,Oa,Bt,BA,La,ws,NA].forEach(function(r){Ye(fr,r)});var $3=[{name:"null",impl:vA},{name:"base",impl:CA},{name:"canvas",impl:F3}],V3=[{type:"layout",extensions:v$},{type:"renderer",extensions:$3}],zA={},$A={};function VA(r,e,t){var n=t,a=function(A){Er("Can not register `"+e+"` for `"+r+"` since `"+A+"` already exists in the prototype and can not be overridden")};if(r==="core"){if(as.prototype[e])return a(e);as.prototype[e]=t}else if(r==="collection"){if(pt.prototype[e])return a(e);pt.prototype[e]=t}else if(r==="layout"){for(var i=function(A){this.options=A,t.call(this,A),pr(this._private)||(this._private={}),this._private.cy=A.cy,this._private.listeners=[],this.createEmitter()},o=i.prototype=Object.create(t.prototype),s=[],l=0;l<s.length;l++){var u=s[l];o[u]=o[u]||function(){return this}}o.start&&!o.run?o.run=function(){return this.start(),this}:!o.start&&o.run&&(o.start=function(){return this.run(),this});var c=t.prototype.stop;o.stop=function(){var _=this.options;if(_&&_.animate){var A=this.animations;if(A)for(var P=0;P<A.length;P++)A[P].stop()}return c?c.call(this):this.emit("layoutstop"),this},o.destroy||(o.destroy=function(){return this}),o.cy=function(){return this._private.cy};var d=function(A){return A._private.cy},h={addEventFields:function(A,P){P.layout=A,P.cy=d(A),P.target=A},bubble:function(){return!0},parent:function(A){return d(A)}};Ye(o,{createEmitter:function(){return this._private.emitter=new gl(h,this),this},emitter:function(){return this._private.emitter},on:function(A,P){return this.emitter().on(A,P),this},one:function(A,P){return this.emitter().one(A,P),this},once:function(A,P){return this.emitter().one(A,P),this},removeListener:function(A,P){return this.emitter().removeListener(A,P),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},emit:function(A,P){return this.emitter().emit(A,P),this}}),xr.eventAliasesOn(o),n=i}else if(r==="renderer"&&e!=="null"&&e!=="base"){var g=GA("renderer","base"),p=g.prototype,E=t,y=t.prototype,b=function(){g.apply(this,arguments),E.apply(this,arguments)},w=b.prototype;for(var x in p){var C=p[x],T=y[x]!=null;if(T)return a(x);w[x]=C}for(var S in y)w[S]=y[S];p.clientFunctions.forEach(function(_){w[_]=w[_]||function(){Lr("Renderer does not implement `renderer."+_+"()` on its prototype")}}),n=b}else if(r==="__proto__"||r==="constructor"||r==="prototype")return Lr(r+" is an illegal type to be registered, possibly lead to prototype pollutions");return sR({map:zA,keys:[r,e],value:n})}function GA(r,e){return uR({map:zA,keys:[r,e]})}function G3(r,e,t,n,a){return sR({map:$A,keys:[r,e,t,n],value:a})}function W3(r,e,t,n){return uR({map:$A,keys:[r,e,t,n]})}var Cm=function(){if(arguments.length===2)return GA.apply(null,arguments);if(arguments.length===3)return VA.apply(null,arguments);if(arguments.length===4)return W3.apply(null,arguments);if(arguments.length===5)return G3.apply(null,arguments);Lr("Invalid extension access syntax")};as.prototype.extension=Cm;V3.forEach(function(r){r.extensions.forEach(function(e){VA(r.type,e.name,e.impl)})});var tl=function(){if(!(this instanceof tl))return new tl;this.length=0},ui=tl.prototype;ui.instanceString=function(){return"stylesheet"};ui.selector=function(r){var e=this.length++;return this[e]={selector:r,properties:[]},this};ui.css=function(r,e){var t=this.length-1;if(Ke(r))this[t].properties.push({name:r,value:e});else if(pr(r))for(var n=r,a=Object.keys(n),i=0;i<a.length;i++){var o=a[i],s=n[o];if(s!=null){var l=st.properties[o]||st.properties[il(o)];if(l!=null){var u=l.name,c=s;this[t].properties.push({name:u,value:c})}}}return this};ui.style=ui.css;ui.generateStyle=function(r){var e=new st(r);return this.appendToStyle(e)};ui.appendToStyle=function(r){for(var e=0;e<this.length;e++){var t=this[e],n=t.selector,a=t.properties;r.selector(n);for(var i=0;i<a.length;i++){var o=a[i];r.css(o.name,o.value)}}return r};var U3="3.33.1",un=function(e){if(e===void 0&&(e={}),pr(e))return new as(e);if(Ke(e))return Cm.apply(Cm,arguments)};un.use=function(r){var e=Array.prototype.slice.call(arguments,1);return e.unshift(un),r.apply(null,e),this};un.warnings=function(r){return gR(r)};un.version=U3;un.stylesheet=un.Stylesheet=tl;var Et=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Cl(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var zu={exports:{}};function Zm(r){throw new Error('Could not dynamically require "'+r+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var qd,dE;function H3(){if(dE)return qd;dE=1;function r(){this.__data__=[],this.size=0}return qd=r,qd}var Nd,vE;function uo(){if(vE)return Nd;vE=1;function r(e,t){return e===t||e!==e&&t!==t}return Nd=r,Nd}var Fd,hE;function _l(){if(hE)return Fd;hE=1;var r=uo();function e(t,n){for(var a=t.length;a--;)if(r(t[a][0],n))return a;return-1}return Fd=e,Fd}var zd,gE;function K3(){if(gE)return zd;gE=1;var r=_l(),e=Array.prototype,t=e.splice;function n(a){var i=this.__data__,o=r(i,a);if(o<0)return!1;var s=i.length-1;return o==s?i.pop():t.call(i,o,1),--this.size,!0}return zd=n,zd}var $d,pE;function j3(){if(pE)return $d;pE=1;var r=_l();function e(t){var n=this.__data__,a=r(n,t);return a<0?void 0:n[a][1]}return $d=e,$d}var Vd,yE;function Y3(){if(yE)return Vd;yE=1;var r=_l();function e(t){return r(this.__data__,t)>-1}return Vd=e,Vd}var Gd,mE;function Z3(){if(mE)return Gd;mE=1;var r=_l();function e(t,n){var a=this.__data__,i=r(a,t);return i<0?(++this.size,a.push([t,n])):a[i][1]=n,this}return Gd=e,Gd}var Wd,bE;function Sl(){if(bE)return Wd;bE=1;var r=H3(),e=K3(),t=j3(),n=Y3(),a=Z3();function i(o){var s=-1,l=o==null?0:o.length;for(this.clear();++s<l;){var u=o[s];this.set(u[0],u[1])}}return i.prototype.clear=r,i.prototype.delete=e,i.prototype.get=t,i.prototype.has=n,i.prototype.set=a,Wd=i,Wd}var Ud,wE;function X3(){if(wE)return Ud;wE=1;var r=Sl();function e(){this.__data__=new r,this.size=0}return Ud=e,Ud}var Hd,xE;function Q3(){if(xE)return Hd;xE=1;function r(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}return Hd=r,Hd}var Kd,EE;function J3(){if(EE)return Kd;EE=1;function r(e){return this.__data__.get(e)}return Kd=r,Kd}var jd,CE;function eV(){if(CE)return jd;CE=1;function r(e){return this.__data__.has(e)}return jd=r,jd}var Yd,_E;function WA(){if(_E)return Yd;_E=1;var r=typeof Et=="object"&&Et&&Et.Object===Object&&Et;return Yd=r,Yd}var Zd,SE;function En(){if(SE)return Zd;SE=1;var r=WA(),e=typeof self=="object"&&self&&self.Object===Object&&self,t=r||e||Function("return this")();return Zd=t,Zd}var Xd,TE;function lo(){if(TE)return Xd;TE=1;var r=En(),e=r.Symbol;return Xd=e,Xd}var Qd,RE;function rV(){if(RE)return Qd;RE=1;var r=lo(),e=Object.prototype,t=e.hasOwnProperty,n=e.toString,a=r?r.toStringTag:void 0;function i(o){var s=t.call(o,a),l=o[a];try{o[a]=void 0;var u=!0}catch{}var c=n.call(o);return u&&(s?o[a]=l:delete o[a]),c}return Qd=i,Qd}var Jd,AE;function tV(){if(AE)return Jd;AE=1;var r=Object.prototype,e=r.toString;function t(n){return e.call(n)}return Jd=t,Jd}var ev,PE;function ci(){if(PE)return ev;PE=1;var r=lo(),e=rV(),t=tV(),n="[object Null]",a="[object Undefined]",i=r?r.toStringTag:void 0;function o(s){return s==null?s===void 0?a:n:i&&i in Object(s)?e(s):t(s)}return ev=o,ev}var rv,IE;function fn(){if(IE)return rv;IE=1;function r(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}return rv=r,rv}var tv,DE;function xs(){if(DE)return tv;DE=1;var r=ci(),e=fn(),t="[object AsyncFunction]",n="[object Function]",a="[object GeneratorFunction]",i="[object Proxy]";function o(s){if(!e(s))return!1;var l=r(s);return l==n||l==a||l==t||l==i}return tv=o,tv}var nv,BE;function nV(){if(BE)return nv;BE=1;var r=En(),e=r["__core-js_shared__"];return nv=e,nv}var av,ME;function aV(){if(ME)return av;ME=1;var r=nV(),e=(function(){var n=/[^.]+$/.exec(r&&r.keys&&r.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""})();function t(n){return!!e&&e in n}return av=t,av}var iv,kE;function UA(){if(kE)return iv;kE=1;var r=Function.prototype,e=r.toString;function t(n){if(n!=null){try{return e.call(n)}catch{}try{return n+""}catch{}}return""}return iv=t,iv}var ov,OE;function iV(){if(OE)return ov;OE=1;var r=xs(),e=aV(),t=fn(),n=UA(),a=/[\\^$.*+?()[\]{}|]/g,i=/^\[object .+?Constructor\]$/,o=Function.prototype,s=Object.prototype,l=o.toString,u=s.hasOwnProperty,c=RegExp("^"+l.call(u).replace(a,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function d(h){if(!t(h)||e(h))return!1;var g=r(h)?c:i;return g.test(n(h))}return ov=d,ov}var sv,LE;function oV(){if(LE)return sv;LE=1;function r(e,t){return e==null?void 0:e[t]}return sv=r,sv}var uv,qE;function di(){if(qE)return uv;qE=1;var r=iV(),e=oV();function t(n,a){var i=e(n,a);return r(i)?i:void 0}return uv=t,uv}var lv,NE;function Xm(){if(NE)return lv;NE=1;var r=di(),e=En(),t=r(e,"Map");return lv=t,lv}var fv,FE;function Tl(){if(FE)return fv;FE=1;var r=di(),e=r(Object,"create");return fv=e,fv}var cv,zE;function sV(){if(zE)return cv;zE=1;var r=Tl();function e(){this.__data__=r?r(null):{},this.size=0}return cv=e,cv}var dv,$E;function uV(){if($E)return dv;$E=1;function r(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}return dv=r,dv}var vv,VE;function lV(){if(VE)return vv;VE=1;var r=Tl(),e="__lodash_hash_undefined__",t=Object.prototype,n=t.hasOwnProperty;function a(i){var o=this.__data__;if(r){var s=o[i];return s===e?void 0:s}return n.call(o,i)?o[i]:void 0}return vv=a,vv}var hv,GE;function fV(){if(GE)return hv;GE=1;var r=Tl(),e=Object.prototype,t=e.hasOwnProperty;function n(a){var i=this.__data__;return r?i[a]!==void 0:t.call(i,a)}return hv=n,hv}var gv,WE;function cV(){if(WE)return gv;WE=1;var r=Tl(),e="__lodash_hash_undefined__";function t(n,a){var i=this.__data__;return this.size+=this.has(n)?0:1,i[n]=r&&a===void 0?e:a,this}return gv=t,gv}var pv,UE;function dV(){if(UE)return pv;UE=1;var r=sV(),e=uV(),t=lV(),n=fV(),a=cV();function i(o){var s=-1,l=o==null?0:o.length;for(this.clear();++s<l;){var u=o[s];this.set(u[0],u[1])}}return i.prototype.clear=r,i.prototype.delete=e,i.prototype.get=t,i.prototype.has=n,i.prototype.set=a,pv=i,pv}var yv,HE;function vV(){if(HE)return yv;HE=1;var r=dV(),e=Sl(),t=Xm();function n(){this.size=0,this.__data__={hash:new r,map:new(t||e),string:new r}}return yv=n,yv}var mv,KE;function hV(){if(KE)return mv;KE=1;function r(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}return mv=r,mv}var bv,jE;function Rl(){if(jE)return bv;jE=1;var r=hV();function e(t,n){var a=t.__data__;return r(n)?a[typeof n=="string"?"string":"hash"]:a.map}return bv=e,bv}var wv,YE;function gV(){if(YE)return wv;YE=1;var r=Rl();function e(t){var n=r(this,t).delete(t);return this.size-=n?1:0,n}return wv=e,wv}var xv,ZE;function pV(){if(ZE)return xv;ZE=1;var r=Rl();function e(t){return r(this,t).get(t)}return xv=e,xv}var Ev,XE;function yV(){if(XE)return Ev;XE=1;var r=Rl();function e(t){return r(this,t).has(t)}return Ev=e,Ev}var Cv,QE;function mV(){if(QE)return Cv;QE=1;var r=Rl();function e(t,n){var a=r(this,t),i=a.size;return a.set(t,n),this.size+=a.size==i?0:1,this}return Cv=e,Cv}var _v,JE;function Qm(){if(JE)return _v;JE=1;var r=vV(),e=gV(),t=pV(),n=yV(),a=mV();function i(o){var s=-1,l=o==null?0:o.length;for(this.clear();++s<l;){var u=o[s];this.set(u[0],u[1])}}return i.prototype.clear=r,i.prototype.delete=e,i.prototype.get=t,i.prototype.has=n,i.prototype.set=a,_v=i,_v}var Sv,eC;function bV(){if(eC)return Sv;eC=1;var r=Sl(),e=Xm(),t=Qm(),n=200;function a(i,o){var s=this.__data__;if(s instanceof r){var l=s.__data__;if(!e||l.length<n-1)return l.push([i,o]),this.size=++s.size,this;s=this.__data__=new t(l)}return s.set(i,o),this.size=s.size,this}return Sv=a,Sv}var Tv,rC;function Al(){if(rC)return Tv;rC=1;var r=Sl(),e=X3(),t=Q3(),n=J3(),a=eV(),i=bV();function o(s){var l=this.__data__=new r(s);this.size=l.size}return o.prototype.clear=e,o.prototype.delete=t,o.prototype.get=n,o.prototype.has=a,o.prototype.set=i,Tv=o,Tv}var Rv,tC;function Jm(){if(tC)return Rv;tC=1;function r(e,t){for(var n=-1,a=e==null?0:e.length;++n<a&&t(e[n],n,e)!==!1;);return e}return Rv=r,Rv}var Av,nC;function HA(){if(nC)return Av;nC=1;var r=di(),e=(function(){try{var t=r(Object,"defineProperty");return t({},"",{}),t}catch{}})();return Av=e,Av}var Pv,aC;function Pl(){if(aC)return Pv;aC=1;var r=HA();function e(t,n,a){n=="__proto__"&&r?r(t,n,{configurable:!0,enumerable:!0,value:a,writable:!0}):t[n]=a}return Pv=e,Pv}var Iv,iC;function Il(){if(iC)return Iv;iC=1;var r=Pl(),e=uo(),t=Object.prototype,n=t.hasOwnProperty;function a(i,o,s){var l=i[o];(!(n.call(i,o)&&e(l,s))||s===void 0&&!(o in i))&&r(i,o,s)}return Iv=a,Iv}var Dv,oC;function Es(){if(oC)return Dv;oC=1;var r=Il(),e=Pl();function t(n,a,i,o){var s=!i;i||(i={});for(var l=-1,u=a.length;++l<u;){var c=a[l],d=o?o(i[c],n[c],c,i,n):void 0;d===void 0&&(d=n[c]),s?e(i,c,d):r(i,c,d)}return i}return Dv=t,Dv}var Bv,sC;function wV(){if(sC)return Bv;sC=1;function r(e,t){for(var n=-1,a=Array(e);++n<e;)a[n]=t(n);return a}return Bv=r,Bv}var Mv,uC;function On(){if(uC)return Mv;uC=1;function r(e){return e!=null&&typeof e=="object"}return Mv=r,Mv}var kv,lC;function xV(){if(lC)return kv;lC=1;var r=ci(),e=On(),t="[object Arguments]";function n(a){return e(a)&&r(a)==t}return kv=n,kv}var Ov,fC;function Cs(){if(fC)return Ov;fC=1;var r=xV(),e=On(),t=Object.prototype,n=t.hasOwnProperty,a=t.propertyIsEnumerable,i=r((function(){return arguments})())?r:function(o){return e(o)&&n.call(o,"callee")&&!a.call(o,"callee")};return Ov=i,Ov}var Lv,cC;function Zr(){if(cC)return Lv;cC=1;var r=Array.isArray;return Lv=r,Lv}var zo={exports:{}},qv,dC;function EV(){if(dC)return qv;dC=1;function r(){return!1}return qv=r,qv}zo.exports;var vC;function fo(){return vC||(vC=1,(function(r,e){var t=En(),n=EV(),a=e&&!e.nodeType&&e,i=a&&!0&&r&&!r.nodeType&&r,o=i&&i.exports===a,s=o?t.Buffer:void 0,l=s?s.isBuffer:void 0,u=l||n;r.exports=u})(zo,zo.exports)),zo.exports}var Nv,hC;function Dl(){if(hC)return Nv;hC=1;var r=9007199254740991,e=/^(?:0|[1-9]\d*)$/;function t(n,a){var i=typeof n;return a=a??r,!!a&&(i=="number"||i!="symbol"&&e.test(n))&&n>-1&&n%1==0&&n<a}return Nv=t,Nv}var Fv,gC;function e0(){if(gC)return Fv;gC=1;var r=9007199254740991;function e(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=r}return Fv=e,Fv}var zv,pC;function CV(){if(pC)return zv;pC=1;var r=ci(),e=e0(),t=On(),n="[object Arguments]",a="[object Array]",i="[object Boolean]",o="[object Date]",s="[object Error]",l="[object Function]",u="[object Map]",c="[object Number]",d="[object Object]",h="[object RegExp]",g="[object Set]",p="[object String]",E="[object WeakMap]",y="[object ArrayBuffer]",b="[object DataView]",w="[object Float32Array]",x="[object Float64Array]",C="[object Int8Array]",T="[object Int16Array]",S="[object Int32Array]",_="[object Uint8Array]",A="[object Uint8ClampedArray]",P="[object Uint16Array]",I="[object Uint32Array]",D={};D[w]=D[x]=D[C]=D[T]=D[S]=D[_]=D[A]=D[P]=D[I]=!0,D[n]=D[a]=D[y]=D[i]=D[b]=D[o]=D[s]=D[l]=D[u]=D[c]=D[d]=D[h]=D[g]=D[p]=D[E]=!1;function k(M){return t(M)&&e(M.length)&&!!D[r(M)]}return zv=k,zv}var $v,yC;function Bl(){if(yC)return $v;yC=1;function r(e){return function(t){return e(t)}}return $v=r,$v}var $o={exports:{}};$o.exports;var mC;function r0(){return mC||(mC=1,(function(r,e){var t=WA(),n=e&&!e.nodeType&&e,a=n&&!0&&r&&!r.nodeType&&r,i=a&&a.exports===n,o=i&&t.process,s=(function(){try{var l=a&&a.require&&a.require("util").types;return l||o&&o.binding&&o.binding("util")}catch{}})();r.exports=s})($o,$o.exports)),$o.exports}var Vv,bC;function _s(){if(bC)return Vv;bC=1;var r=CV(),e=Bl(),t=r0(),n=t&&t.isTypedArray,a=n?e(n):r;return Vv=a,Vv}var Gv,wC;function KA(){if(wC)return Gv;wC=1;var r=wV(),e=Cs(),t=Zr(),n=fo(),a=Dl(),i=_s(),o=Object.prototype,s=o.hasOwnProperty;function l(u,c){var d=t(u),h=!d&&e(u),g=!d&&!h&&n(u),p=!d&&!h&&!g&&i(u),E=d||h||g||p,y=E?r(u.length,String):[],b=y.length;for(var w in u)(c||s.call(u,w))&&!(E&&(w=="length"||g&&(w=="offset"||w=="parent")||p&&(w=="buffer"||w=="byteLength"||w=="byteOffset")||a(w,b)))&&y.push(w);return y}return Gv=l,Gv}var Wv,xC;function Ml(){if(xC)return Wv;xC=1;var r=Object.prototype;function e(t){var n=t&&t.constructor,a=typeof n=="function"&&n.prototype||r;return t===a}return Wv=e,Wv}var Uv,EC;function jA(){if(EC)return Uv;EC=1;function r(e,t){return function(n){return e(t(n))}}return Uv=r,Uv}var Hv,CC;function _V(){if(CC)return Hv;CC=1;var r=jA(),e=r(Object.keys,Object);return Hv=e,Hv}var Kv,_C;function t0(){if(_C)return Kv;_C=1;var r=Ml(),e=_V(),t=Object.prototype,n=t.hasOwnProperty;function a(i){if(!r(i))return e(i);var o=[];for(var s in Object(i))n.call(i,s)&&s!="constructor"&&o.push(s);return o}return Kv=a,Kv}var jv,SC;function ea(){if(SC)return jv;SC=1;var r=xs(),e=e0();function t(n){return n!=null&&e(n.length)&&!r(n)}return jv=t,jv}var Yv,TC;function qa(){if(TC)return Yv;TC=1;var r=KA(),e=t0(),t=ea();function n(a){return t(a)?r(a):e(a)}return Yv=n,Yv}var Zv,RC;function SV(){if(RC)return Zv;RC=1;var r=Es(),e=qa();function t(n,a){return n&&r(a,e(a),n)}return Zv=t,Zv}var Xv,AC;function TV(){if(AC)return Xv;AC=1;function r(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}return Xv=r,Xv}var Qv,PC;function RV(){if(PC)return Qv;PC=1;var r=fn(),e=Ml(),t=TV(),n=Object.prototype,a=n.hasOwnProperty;function i(o){if(!r(o))return t(o);var s=e(o),l=[];for(var u in o)u=="constructor"&&(s||!a.call(o,u))||l.push(u);return l}return Qv=i,Qv}var Jv,IC;function vi(){if(IC)return Jv;IC=1;var r=KA(),e=RV(),t=ea();function n(a){return t(a)?r(a,!0):e(a)}return Jv=n,Jv}var eh,DC;function AV(){if(DC)return eh;DC=1;var r=Es(),e=vi();function t(n,a){return n&&r(a,e(a),n)}return eh=t,eh}var Vo={exports:{}};Vo.exports;var BC;function YA(){return BC||(BC=1,(function(r,e){var t=En(),n=e&&!e.nodeType&&e,a=n&&!0&&r&&!r.nodeType&&r,i=a&&a.exports===n,o=i?t.Buffer:void 0,s=o?o.allocUnsafe:void 0;function l(u,c){if(c)return u.slice();var d=u.length,h=s?s(d):new u.constructor(d);return u.copy(h),h}r.exports=l})(Vo,Vo.exports)),Vo.exports}var rh,MC;function ZA(){if(MC)return rh;MC=1;function r(e,t){var n=-1,a=e.length;for(t||(t=Array(a));++n<a;)t[n]=e[n];return t}return rh=r,rh}var th,kC;function XA(){if(kC)return th;kC=1;function r(e,t){for(var n=-1,a=e==null?0:e.length,i=0,o=[];++n<a;){var s=e[n];t(s,n,e)&&(o[i++]=s)}return o}return th=r,th}var nh,OC;function QA(){if(OC)return nh;OC=1;function r(){return[]}return nh=r,nh}var ah,LC;function n0(){if(LC)return ah;LC=1;var r=XA(),e=QA(),t=Object.prototype,n=t.propertyIsEnumerable,a=Object.getOwnPropertySymbols,i=a?function(o){return o==null?[]:(o=Object(o),r(a(o),function(s){return n.call(o,s)}))}:e;return ah=i,ah}var ih,qC;function PV(){if(qC)return ih;qC=1;var r=Es(),e=n0();function t(n,a){return r(n,e(n),a)}return ih=t,ih}var oh,NC;function a0(){if(NC)return oh;NC=1;function r(e,t){for(var n=-1,a=t.length,i=e.length;++n<a;)e[i+n]=t[n];return e}return oh=r,oh}var sh,FC;function kl(){if(FC)return sh;FC=1;var r=jA(),e=r(Object.getPrototypeOf,Object);return sh=e,sh}var uh,zC;function JA(){if(zC)return uh;zC=1;var r=a0(),e=kl(),t=n0(),n=QA(),a=Object.getOwnPropertySymbols,i=a?function(o){for(var s=[];o;)r(s,t(o)),o=e(o);return s}:n;return uh=i,uh}var lh,$C;function IV(){if($C)return lh;$C=1;var r=Es(),e=JA();function t(n,a){return r(n,e(n),a)}return lh=t,lh}var fh,VC;function eP(){if(VC)return fh;VC=1;var r=a0(),e=Zr();function t(n,a,i){var o=a(n);return e(n)?o:r(o,i(n))}return fh=t,fh}var ch,GC;function rP(){if(GC)return ch;GC=1;var r=eP(),e=n0(),t=qa();function n(a){return r(a,t,e)}return ch=n,ch}var dh,WC;function DV(){if(WC)return dh;WC=1;var r=eP(),e=JA(),t=vi();function n(a){return r(a,t,e)}return dh=n,dh}var vh,UC;function BV(){if(UC)return vh;UC=1;var r=di(),e=En(),t=r(e,"DataView");return vh=t,vh}var hh,HC;function MV(){if(HC)return hh;HC=1;var r=di(),e=En(),t=r(e,"Promise");return hh=t,hh}var gh,KC;function tP(){if(KC)return gh;KC=1;var r=di(),e=En(),t=r(e,"Set");return gh=t,gh}var ph,jC;function kV(){if(jC)return ph;jC=1;var r=di(),e=En(),t=r(e,"WeakMap");return ph=t,ph}var yh,YC;function co(){if(YC)return yh;YC=1;var r=BV(),e=Xm(),t=MV(),n=tP(),a=kV(),i=ci(),o=UA(),s="[object Map]",l="[object Object]",u="[object Promise]",c="[object Set]",d="[object WeakMap]",h="[object DataView]",g=o(r),p=o(e),E=o(t),y=o(n),b=o(a),w=i;return(r&&w(new r(new ArrayBuffer(1)))!=h||e&&w(new e)!=s||t&&w(t.resolve())!=u||n&&w(new n)!=c||a&&w(new a)!=d)&&(w=function(x){var C=i(x),T=C==l?x.constructor:void 0,S=T?o(T):"";if(S)switch(S){case g:return h;case p:return s;case E:return u;case y:return c;case b:return d}return C}),yh=w,yh}var mh,ZC;function OV(){if(ZC)return mh;ZC=1;var r=Object.prototype,e=r.hasOwnProperty;function t(n){var a=n.length,i=new n.constructor(a);return a&&typeof n[0]=="string"&&e.call(n,"index")&&(i.index=n.index,i.input=n.input),i}return mh=t,mh}var bh,XC;function nP(){if(XC)return bh;XC=1;var r=En(),e=r.Uint8Array;return bh=e,bh}var wh,QC;function i0(){if(QC)return wh;QC=1;var r=nP();function e(t){var n=new t.constructor(t.byteLength);return new r(n).set(new r(t)),n}return wh=e,wh}var xh,JC;function LV(){if(JC)return xh;JC=1;var r=i0();function e(t,n){var a=n?r(t.buffer):t.buffer;return new t.constructor(a,t.byteOffset,t.byteLength)}return xh=e,xh}var Eh,e_;function qV(){if(e_)return Eh;e_=1;var r=/\w*$/;function e(t){var n=new t.constructor(t.source,r.exec(t));return n.lastIndex=t.lastIndex,n}return Eh=e,Eh}var Ch,r_;function NV(){if(r_)return Ch;r_=1;var r=lo(),e=r?r.prototype:void 0,t=e?e.valueOf:void 0;function n(a){return t?Object(t.call(a)):{}}return Ch=n,Ch}var _h,t_;function aP(){if(t_)return _h;t_=1;var r=i0();function e(t,n){var a=n?r(t.buffer):t.buffer;return new t.constructor(a,t.byteOffset,t.length)}return _h=e,_h}var Sh,n_;function FV(){if(n_)return Sh;n_=1;var r=i0(),e=LV(),t=qV(),n=NV(),a=aP(),i="[object Boolean]",o="[object Date]",s="[object Map]",l="[object Number]",u="[object RegExp]",c="[object Set]",d="[object String]",h="[object Symbol]",g="[object ArrayBuffer]",p="[object DataView]",E="[object Float32Array]",y="[object Float64Array]",b="[object Int8Array]",w="[object Int16Array]",x="[object Int32Array]",C="[object Uint8Array]",T="[object Uint8ClampedArray]",S="[object Uint16Array]",_="[object Uint32Array]";function A(P,I,D){var k=P.constructor;switch(I){case g:return r(P);case i:case o:return new k(+P);case p:return e(P,D);case E:case y:case b:case w:case x:case C:case T:case S:case _:return a(P,D);case s:return new k;case l:case d:return new k(P);case u:return t(P);case c:return new k;case h:return n(P)}}return Sh=A,Sh}var Th,a_;function iP(){if(a_)return Th;a_=1;var r=fn(),e=Object.create,t=(function(){function n(){}return function(a){if(!r(a))return{};if(e)return e(a);n.prototype=a;var i=new n;return n.prototype=void 0,i}})();return Th=t,Th}var Rh,i_;function oP(){if(i_)return Rh;i_=1;var r=iP(),e=kl(),t=Ml();function n(a){return typeof a.constructor=="function"&&!t(a)?r(e(a)):{}}return Rh=n,Rh}var Ah,o_;function zV(){if(o_)return Ah;o_=1;var r=co(),e=On(),t="[object Map]";function n(a){return e(a)&&r(a)==t}return Ah=n,Ah}var Ph,s_;function $V(){if(s_)return Ph;s_=1;var r=zV(),e=Bl(),t=r0(),n=t&&t.isMap,a=n?e(n):r;return Ph=a,Ph}var Ih,u_;function VV(){if(u_)return Ih;u_=1;var r=co(),e=On(),t="[object Set]";function n(a){return e(a)&&r(a)==t}return Ih=n,Ih}var Dh,l_;function GV(){if(l_)return Dh;l_=1;var r=VV(),e=Bl(),t=r0(),n=t&&t.isSet,a=n?e(n):r;return Dh=a,Dh}var Bh,f_;function sP(){if(f_)return Bh;f_=1;var r=Al(),e=Jm(),t=Il(),n=SV(),a=AV(),i=YA(),o=ZA(),s=PV(),l=IV(),u=rP(),c=DV(),d=co(),h=OV(),g=FV(),p=oP(),E=Zr(),y=fo(),b=$V(),w=fn(),x=GV(),C=qa(),T=vi(),S=1,_=2,A=4,P="[object Arguments]",I="[object Array]",D="[object Boolean]",k="[object Date]",M="[object Error]",N="[object Function]",z="[object GeneratorFunction]",$="[object Map]",q="[object Number]",V="[object Object]",Z="[object RegExp]",K="[object Set]",j="[object String]",ee="[object Symbol]",le="[object WeakMap]",W="[object ArrayBuffer]",G="[object DataView]",Y="[object Float32Array]",re="[object Float64Array]",de="[object Int8Array]",se="[object Int16Array]",X="[object Int32Array]",Q="[object Uint8Array]",ae="[object Uint8ClampedArray]",te="[object Uint16Array]",ce="[object Uint32Array]",_e={};_e[P]=_e[I]=_e[W]=_e[G]=_e[D]=_e[k]=_e[Y]=_e[re]=_e[de]=_e[se]=_e[X]=_e[$]=_e[q]=_e[V]=_e[Z]=_e[K]=_e[j]=_e[ee]=_e[Q]=_e[ae]=_e[te]=_e[ce]=!0,_e[M]=_e[N]=_e[le]=!1;function ve(U,fe,xe,ge,be,Ae){var De,Be=fe&S,Le=fe&_,He=fe&A;if(xe&&(De=be?xe(U,ge,be,Ae):xe(U)),De!==void 0)return De;if(!w(U))return U;var Ve=E(U);if(Ve){if(De=h(U),!Be)return o(U,De)}else{var Xe=d(U),er=Xe==N||Xe==z;if(y(U))return i(U,Be);if(Xe==V||Xe==P||er&&!be){if(De=Le||er?{}:p(U),!Be)return Le?l(U,a(De,U)):s(U,n(De,U))}else{if(!_e[Xe])return be?U:{};De=g(U,Xe,Be)}}Ae||(Ae=new r);var $e=Ae.get(U);if($e)return $e;Ae.set(U,De),x(U)?U.forEach(function(O){De.add(ve(O,fe,xe,O,U,Ae))}):b(U)&&U.forEach(function(O,oe){De.set(oe,ve(O,fe,xe,oe,U,Ae))});var ke=He?Le?c:u:Le?T:C,ye=Ve?void 0:ke(U);return e(ye||U,function(O,oe){ye&&(oe=O,O=U[oe]),t(De,oe,ve(O,fe,xe,oe,U,Ae))}),De}return Bh=ve,Bh}var Mh,c_;function WV(){if(c_)return Mh;c_=1;var r=sP(),e=4;function t(n){return r(n,e)}return Mh=t,Mh}var kh,d_;function o0(){if(d_)return kh;d_=1;function r(e){return function(){return e}}return kh=r,kh}var Oh,v_;function UV(){if(v_)return Oh;v_=1;function r(e){return function(t,n,a){for(var i=-1,o=Object(t),s=a(t),l=s.length;l--;){var u=s[e?l:++i];if(n(o[u],u,o)===!1)break}return t}}return Oh=r,Oh}var Lh,h_;function s0(){if(h_)return Lh;h_=1;var r=UV(),e=r();return Lh=e,Lh}var qh,g_;function u0(){if(g_)return qh;g_=1;var r=s0(),e=qa();function t(n,a){return n&&r(n,a,e)}return qh=t,qh}var Nh,p_;function HV(){if(p_)return Nh;p_=1;var r=ea();function e(t,n){return function(a,i){if(a==null)return a;if(!r(a))return t(a,i);for(var o=a.length,s=n?o:-1,l=Object(a);(n?s--:++s<o)&&i(l[s],s,l)!==!1;);return a}}return Nh=e,Nh}var Fh,y_;function Ol(){if(y_)return Fh;y_=1;var r=u0(),e=HV(),t=e(r);return Fh=t,Fh}var zh,m_;function hi(){if(m_)return zh;m_=1;function r(e){return e}return zh=r,zh}var $h,b_;function uP(){if(b_)return $h;b_=1;var r=hi();function e(t){return typeof t=="function"?t:r}return $h=e,$h}var Vh,w_;function lP(){if(w_)return Vh;w_=1;var r=Jm(),e=Ol(),t=uP(),n=Zr();function a(i,o){var s=n(i)?r:e;return s(i,t(o))}return Vh=a,Vh}var Gh,x_;function fP(){return x_||(x_=1,Gh=lP()),Gh}var Wh,E_;function KV(){if(E_)return Wh;E_=1;var r=Ol();function e(t,n){var a=[];return r(t,function(i,o,s){n(i,o,s)&&a.push(i)}),a}return Wh=e,Wh}var Uh,C_;function jV(){if(C_)return Uh;C_=1;var r="__lodash_hash_undefined__";function e(t){return this.__data__.set(t,r),this}return Uh=e,Uh}var Hh,__;function YV(){if(__)return Hh;__=1;function r(e){return this.__data__.has(e)}return Hh=r,Hh}var Kh,S_;function cP(){if(S_)return Kh;S_=1;var r=Qm(),e=jV(),t=YV();function n(a){var i=-1,o=a==null?0:a.length;for(this.__data__=new r;++i<o;)this.add(a[i])}return n.prototype.add=n.prototype.push=e,n.prototype.has=t,Kh=n,Kh}var jh,T_;function ZV(){if(T_)return jh;T_=1;function r(e,t){for(var n=-1,a=e==null?0:e.length;++n<a;)if(t(e[n],n,e))return!0;return!1}return jh=r,jh}var Yh,R_;function dP(){if(R_)return Yh;R_=1;function r(e,t){return e.has(t)}return Yh=r,Yh}var Zh,A_;function vP(){if(A_)return Zh;A_=1;var r=cP(),e=ZV(),t=dP(),n=1,a=2;function i(o,s,l,u,c,d){var h=l&n,g=o.length,p=s.length;if(g!=p&&!(h&&p>g))return!1;var E=d.get(o),y=d.get(s);if(E&&y)return E==s&&y==o;var b=-1,w=!0,x=l&a?new r:void 0;for(d.set(o,s),d.set(s,o);++b<g;){var C=o[b],T=s[b];if(u)var S=h?u(T,C,b,s,o,d):u(C,T,b,o,s,d);if(S!==void 0){if(S)continue;w=!1;break}if(x){if(!e(s,function(_,A){if(!t(x,A)&&(C===_||c(C,_,l,u,d)))return x.push(A)})){w=!1;break}}else if(!(C===T||c(C,T,l,u,d))){w=!1;break}}return d.delete(o),d.delete(s),w}return Zh=i,Zh}var Xh,P_;function XV(){if(P_)return Xh;P_=1;function r(e){var t=-1,n=Array(e.size);return e.forEach(function(a,i){n[++t]=[i,a]}),n}return Xh=r,Xh}var Qh,I_;function l0(){if(I_)return Qh;I_=1;function r(e){var t=-1,n=Array(e.size);return e.forEach(function(a){n[++t]=a}),n}return Qh=r,Qh}var Jh,D_;function QV(){if(D_)return Jh;D_=1;var r=lo(),e=nP(),t=uo(),n=vP(),a=XV(),i=l0(),o=1,s=2,l="[object Boolean]",u="[object Date]",c="[object Error]",d="[object Map]",h="[object Number]",g="[object RegExp]",p="[object Set]",E="[object String]",y="[object Symbol]",b="[object ArrayBuffer]",w="[object DataView]",x=r?r.prototype:void 0,C=x?x.valueOf:void 0;function T(S,_,A,P,I,D,k){switch(A){case w:if(S.byteLength!=_.byteLength||S.byteOffset!=_.byteOffset)return!1;S=S.buffer,_=_.buffer;case b:return!(S.byteLength!=_.byteLength||!D(new e(S),new e(_)));case l:case u:case h:return t(+S,+_);case c:return S.name==_.name&&S.message==_.message;case g:case E:return S==_+"";case d:var M=a;case p:var N=P&o;if(M||(M=i),S.size!=_.size&&!N)return!1;var z=k.get(S);if(z)return z==_;P|=s,k.set(S,_);var $=n(M(S),M(_),P,I,D,k);return k.delete(S),$;case y:if(C)return C.call(S)==C.call(_)}return!1}return Jh=T,Jh}var eg,B_;function JV(){if(B_)return eg;B_=1;var r=rP(),e=1,t=Object.prototype,n=t.hasOwnProperty;function a(i,o,s,l,u,c){var d=s&e,h=r(i),g=h.length,p=r(o),E=p.length;if(g!=E&&!d)return!1;for(var y=g;y--;){var b=h[y];if(!(d?b in o:n.call(o,b)))return!1}var w=c.get(i),x=c.get(o);if(w&&x)return w==o&&x==i;var C=!0;c.set(i,o),c.set(o,i);for(var T=d;++y<g;){b=h[y];var S=i[b],_=o[b];if(l)var A=d?l(_,S,b,o,i,c):l(S,_,b,i,o,c);if(!(A===void 0?S===_||u(S,_,s,l,c):A)){C=!1;break}T||(T=b=="constructor")}if(C&&!T){var P=i.constructor,I=o.constructor;P!=I&&"constructor"in i&&"constructor"in o&&!(typeof P=="function"&&P instanceof P&&typeof I=="function"&&I instanceof I)&&(C=!1)}return c.delete(i),c.delete(o),C}return eg=a,eg}var rg,M_;function e4(){if(M_)return rg;M_=1;var r=Al(),e=vP(),t=QV(),n=JV(),a=co(),i=Zr(),o=fo(),s=_s(),l=1,u="[object Arguments]",c="[object Array]",d="[object Object]",h=Object.prototype,g=h.hasOwnProperty;function p(E,y,b,w,x,C){var T=i(E),S=i(y),_=T?c:a(E),A=S?c:a(y);_=_==u?d:_,A=A==u?d:A;var P=_==d,I=A==d,D=_==A;if(D&&o(E)){if(!o(y))return!1;T=!0,P=!1}if(D&&!P)return C||(C=new r),T||s(E)?e(E,y,b,w,x,C):t(E,y,_,b,w,x,C);if(!(b&l)){var k=P&&g.call(E,"__wrapped__"),M=I&&g.call(y,"__wrapped__");if(k||M){var N=k?E.value():E,z=M?y.value():y;return C||(C=new r),x(N,z,b,w,C)}}return D?(C||(C=new r),n(E,y,b,w,x,C)):!1}return rg=p,rg}var tg,k_;function hP(){if(k_)return tg;k_=1;var r=e4(),e=On();function t(n,a,i,o,s){return n===a?!0:n==null||a==null||!e(n)&&!e(a)?n!==n&&a!==a:r(n,a,i,o,t,s)}return tg=t,tg}var ng,O_;function r4(){if(O_)return ng;O_=1;var r=Al(),e=hP(),t=1,n=2;function a(i,o,s,l){var u=s.length,c=u,d=!l;if(i==null)return!c;for(i=Object(i);u--;){var h=s[u];if(d&&h[2]?h[1]!==i[h[0]]:!(h[0]in i))return!1}for(;++u<c;){h=s[u];var g=h[0],p=i[g],E=h[1];if(d&&h[2]){if(p===void 0&&!(g in i))return!1}else{var y=new r;if(l)var b=l(p,E,g,i,o,y);if(!(b===void 0?e(E,p,t|n,l,y):b))return!1}}return!0}return ng=a,ng}var ag,L_;function gP(){if(L_)return ag;L_=1;var r=fn();function e(t){return t===t&&!r(t)}return ag=e,ag}var ig,q_;function t4(){if(q_)return ig;q_=1;var r=gP(),e=qa();function t(n){for(var a=e(n),i=a.length;i--;){var o=a[i],s=n[o];a[i]=[o,s,r(s)]}return a}return ig=t,ig}var og,N_;function pP(){if(N_)return og;N_=1;function r(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}return og=r,og}var sg,F_;function n4(){if(F_)return sg;F_=1;var r=r4(),e=t4(),t=pP();function n(a){var i=e(a);return i.length==1&&i[0][2]?t(i[0][0],i[0][1]):function(o){return o===a||r(o,a,i)}}return sg=n,sg}var ug,z_;function vo(){if(z_)return ug;z_=1;var r=ci(),e=On(),t="[object Symbol]";function n(a){return typeof a=="symbol"||e(a)&&r(a)==t}return ug=n,ug}var lg,$_;function f0(){if($_)return lg;$_=1;var r=Zr(),e=vo(),t=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,n=/^\w*$/;function a(i,o){if(r(i))return!1;var s=typeof i;return s=="number"||s=="symbol"||s=="boolean"||i==null||e(i)?!0:n.test(i)||!t.test(i)||o!=null&&i in Object(o)}return lg=a,lg}var fg,V_;function a4(){if(V_)return fg;V_=1;var r=Qm(),e="Expected a function";function t(n,a){if(typeof n!="function"||a!=null&&typeof a!="function")throw new TypeError(e);var i=function(){var o=arguments,s=a?a.apply(this,o):o[0],l=i.cache;if(l.has(s))return l.get(s);var u=n.apply(this,o);return i.cache=l.set(s,u)||l,u};return i.cache=new(t.Cache||r),i}return t.Cache=r,fg=t,fg}var cg,G_;function i4(){if(G_)return cg;G_=1;var r=a4(),e=500;function t(n){var a=r(n,function(o){return i.size===e&&i.clear(),o}),i=a.cache;return a}return cg=t,cg}var dg,W_;function o4(){if(W_)return dg;W_=1;var r=i4(),e=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,t=/\\(\\)?/g,n=r(function(a){var i=[];return a.charCodeAt(0)===46&&i.push(""),a.replace(e,function(o,s,l,u){i.push(l?u.replace(t,"$1"):s||o)}),i});return dg=n,dg}var vg,U_;function Ll(){if(U_)return vg;U_=1;function r(e,t){for(var n=-1,a=e==null?0:e.length,i=Array(a);++n<a;)i[n]=t(e[n],n,e);return i}return vg=r,vg}var hg,H_;function s4(){if(H_)return hg;H_=1;var r=lo(),e=Ll(),t=Zr(),n=vo(),a=r?r.prototype:void 0,i=a?a.toString:void 0;function o(s){if(typeof s=="string")return s;if(t(s))return e(s,o)+"";if(n(s))return i?i.call(s):"";var l=s+"";return l=="0"&&1/s==-1/0?"-0":l}return hg=o,hg}var gg,K_;function yP(){if(K_)return gg;K_=1;var r=s4();function e(t){return t==null?"":r(t)}return gg=e,gg}var pg,j_;function ql(){if(j_)return pg;j_=1;var r=Zr(),e=f0(),t=o4(),n=yP();function a(i,o){return r(i)?i:e(i,o)?[i]:t(n(i))}return pg=a,pg}var yg,Y_;function Ss(){if(Y_)return yg;Y_=1;var r=vo();function e(t){if(typeof t=="string"||r(t))return t;var n=t+"";return n=="0"&&1/t==-1/0?"-0":n}return yg=e,yg}var mg,Z_;function Nl(){if(Z_)return mg;Z_=1;var r=ql(),e=Ss();function t(n,a){a=r(a,n);for(var i=0,o=a.length;n!=null&&i<o;)n=n[e(a[i++])];return i&&i==o?n:void 0}return mg=t,mg}var bg,X_;function u4(){if(X_)return bg;X_=1;var r=Nl();function e(t,n,a){var i=t==null?void 0:r(t,n);return i===void 0?a:i}return bg=e,bg}var wg,Q_;function l4(){if(Q_)return wg;Q_=1;function r(e,t){return e!=null&&t in Object(e)}return wg=r,wg}var xg,J_;function mP(){if(J_)return xg;J_=1;var r=ql(),e=Cs(),t=Zr(),n=Dl(),a=e0(),i=Ss();function o(s,l,u){l=r(l,s);for(var c=-1,d=l.length,h=!1;++c<d;){var g=i(l[c]);if(!(h=s!=null&&u(s,g)))break;s=s[g]}return h||++c!=d?h:(d=s==null?0:s.length,!!d&&a(d)&&n(g,d)&&(t(s)||e(s)))}return xg=o,xg}var Eg,eS;function bP(){if(eS)return Eg;eS=1;var r=l4(),e=mP();function t(n,a){return n!=null&&e(n,a,r)}return Eg=t,Eg}var Cg,rS;function f4(){if(rS)return Cg;rS=1;var r=hP(),e=u4(),t=bP(),n=f0(),a=gP(),i=pP(),o=Ss(),s=1,l=2;function u(c,d){return n(c)&&a(d)?i(o(c),d):function(h){var g=e(h,c);return g===void 0&&g===d?t(h,c):r(d,g,s|l)}}return Cg=u,Cg}var _g,tS;function wP(){if(tS)return _g;tS=1;function r(e){return function(t){return t==null?void 0:t[e]}}return _g=r,_g}var Sg,nS;function c4(){if(nS)return Sg;nS=1;var r=Nl();function e(t){return function(n){return r(n,t)}}return Sg=e,Sg}var Tg,aS;function d4(){if(aS)return Tg;aS=1;var r=wP(),e=c4(),t=f0(),n=Ss();function a(i){return t(i)?r(n(i)):e(i)}return Tg=a,Tg}var Rg,iS;function ra(){if(iS)return Rg;iS=1;var r=n4(),e=f4(),t=hi(),n=Zr(),a=d4();function i(o){return typeof o=="function"?o:o==null?t:typeof o=="object"?n(o)?e(o[0],o[1]):r(o):a(o)}return Rg=i,Rg}var Ag,oS;function xP(){if(oS)return Ag;oS=1;var r=XA(),e=KV(),t=ra(),n=Zr();function a(i,o){var s=n(i)?r:e;return s(i,t(o,3))}return Ag=a,Ag}var Pg,sS;function v4(){if(sS)return Pg;sS=1;var r=Object.prototype,e=r.hasOwnProperty;function t(n,a){return n!=null&&e.call(n,a)}return Pg=t,Pg}var Ig,uS;function EP(){if(uS)return Ig;uS=1;var r=v4(),e=mP();function t(n,a){return n!=null&&e(n,a,r)}return Ig=t,Ig}var Dg,lS;function h4(){if(lS)return Dg;lS=1;var r=t0(),e=co(),t=Cs(),n=Zr(),a=ea(),i=fo(),o=Ml(),s=_s(),l="[object Map]",u="[object Set]",c=Object.prototype,d=c.hasOwnProperty;function h(g){if(g==null)return!0;if(a(g)&&(n(g)||typeof g=="string"||typeof g.splice=="function"||i(g)||s(g)||t(g)))return!g.length;var p=e(g);if(p==l||p==u)return!g.size;if(o(g))return!r(g).length;for(var E in g)if(d.call(g,E))return!1;return!0}return Dg=h,Dg}var Bg,fS;function CP(){if(fS)return Bg;fS=1;function r(e){return e===void 0}return Bg=r,Bg}var Mg,cS;function _P(){if(cS)return Mg;cS=1;var r=Ol(),e=ea();function t(n,a){var i=-1,o=e(n)?Array(n.length):[];return r(n,function(s,l,u){o[++i]=a(s,l,u)}),o}return Mg=t,Mg}var kg,dS;function SP(){if(dS)return kg;dS=1;var r=Ll(),e=ra(),t=_P(),n=Zr();function a(i,o){var s=n(i)?r:t;return s(i,e(o,3))}return kg=a,kg}var Og,vS;function g4(){if(vS)return Og;vS=1;function r(e,t,n,a){var i=-1,o=e==null?0:e.length;for(a&&o&&(n=e[++i]);++i<o;)n=t(n,e[i],i,e);return n}return Og=r,Og}var Lg,hS;function p4(){if(hS)return Lg;hS=1;function r(e,t,n,a,i){return i(e,function(o,s,l){n=a?(a=!1,o):t(n,o,s,l)}),n}return Lg=r,Lg}var qg,gS;function TP(){if(gS)return qg;gS=1;var r=g4(),e=Ol(),t=ra(),n=p4(),a=Zr();function i(o,s,l){var u=a(o)?r:n,c=arguments.length<3;return u(o,t(s,4),l,c,e)}return qg=i,qg}var Ng,pS;function y4(){if(pS)return Ng;pS=1;var r=ci(),e=Zr(),t=On(),n="[object String]";function a(i){return typeof i=="string"||!e(i)&&t(i)&&r(i)==n}return Ng=a,Ng}var Fg,yS;function m4(){if(yS)return Fg;yS=1;var r=wP(),e=r("length");return Fg=e,Fg}var zg,mS;function b4(){if(mS)return zg;mS=1;var r="\\ud800-\\udfff",e="\\u0300-\\u036f",t="\\ufe20-\\ufe2f",n="\\u20d0-\\u20ff",a=e+t+n,i="\\ufe0e\\ufe0f",o="\\u200d",s=RegExp("["+o+r+a+i+"]");function l(u){return s.test(u)}return zg=l,zg}var $g,bS;function w4(){if(bS)return $g;bS=1;var r="\\ud800-\\udfff",e="\\u0300-\\u036f",t="\\ufe20-\\ufe2f",n="\\u20d0-\\u20ff",a=e+t+n,i="\\ufe0e\\ufe0f",o="["+r+"]",s="["+a+"]",l="\\ud83c[\\udffb-\\udfff]",u="(?:"+s+"|"+l+")",c="[^"+r+"]",d="(?:\\ud83c[\\udde6-\\uddff]){2}",h="[\\ud800-\\udbff][\\udc00-\\udfff]",g="\\u200d",p=u+"?",E="["+i+"]?",y="(?:"+g+"(?:"+[c,d,h].join("|")+")"+E+p+")*",b=E+p+y,w="(?:"+[c+s+"?",s,d,h,o].join("|")+")",x=RegExp(l+"(?="+l+")|"+w+b,"g");function C(T){for(var S=x.lastIndex=0;x.test(T);)++S;return S}return $g=C,$g}var Vg,wS;function x4(){if(wS)return Vg;wS=1;var r=m4(),e=b4(),t=w4();function n(a){return e(a)?t(a):r(a)}return Vg=n,Vg}var Gg,xS;function E4(){if(xS)return Gg;xS=1;var r=t0(),e=co(),t=ea(),n=y4(),a=x4(),i="[object Map]",o="[object Set]";function s(l){if(l==null)return 0;if(t(l))return n(l)?a(l):l.length;var u=e(l);return u==i||u==o?l.size:r(l).length}return Gg=s,Gg}var Wg,ES;function C4(){if(ES)return Wg;ES=1;var r=Jm(),e=iP(),t=u0(),n=ra(),a=kl(),i=Zr(),o=fo(),s=xs(),l=fn(),u=_s();function c(d,h,g){var p=i(d),E=p||o(d)||u(d);if(h=n(h,4),g==null){var y=d&&d.constructor;E?g=p?new y:[]:l(d)?g=s(y)?e(a(d)):{}:g={}}return(E?r:t)(d,function(b,w,x){return h(g,b,w,x)}),g}return Wg=c,Wg}var Ug,CS;function _4(){if(CS)return Ug;CS=1;var r=lo(),e=Cs(),t=Zr(),n=r?r.isConcatSpreadable:void 0;function a(i){return t(i)||e(i)||!!(n&&i&&i[n])}return Ug=a,Ug}var Hg,_S;function c0(){if(_S)return Hg;_S=1;var r=a0(),e=_4();function t(n,a,i,o,s){var l=-1,u=n.length;for(i||(i=e),s||(s=[]);++l<u;){var c=n[l];a>0&&i(c)?a>1?t(c,a-1,i,o,s):r(s,c):o||(s[s.length]=c)}return s}return Hg=t,Hg}var Kg,SS;function S4(){if(SS)return Kg;SS=1;function r(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}return Kg=r,Kg}var jg,TS;function RP(){if(TS)return jg;TS=1;var r=S4(),e=Math.max;function t(n,a,i){return a=e(a===void 0?n.length-1:a,0),function(){for(var o=arguments,s=-1,l=e(o.length-a,0),u=Array(l);++s<l;)u[s]=o[a+s];s=-1;for(var c=Array(a+1);++s<a;)c[s]=o[s];return c[a]=i(u),r(n,this,c)}}return jg=t,jg}var Yg,RS;function T4(){if(RS)return Yg;RS=1;var r=o0(),e=HA(),t=hi(),n=e?function(a,i){return e(a,"toString",{configurable:!0,enumerable:!1,value:r(i),writable:!0})}:t;return Yg=n,Yg}var Zg,AS;function R4(){if(AS)return Zg;AS=1;var r=800,e=16,t=Date.now;function n(a){var i=0,o=0;return function(){var s=t(),l=e-(s-o);if(o=s,l>0){if(++i>=r)return arguments[0]}else i=0;return a.apply(void 0,arguments)}}return Zg=n,Zg}var Xg,PS;function AP(){if(PS)return Xg;PS=1;var r=T4(),e=R4(),t=e(r);return Xg=t,Xg}var Qg,IS;function Fl(){if(IS)return Qg;IS=1;var r=hi(),e=RP(),t=AP();function n(a,i){return t(e(a,i,r),a+"")}return Qg=n,Qg}var Jg,DS;function PP(){if(DS)return Jg;DS=1;function r(e,t,n,a){for(var i=e.length,o=n+(a?1:-1);a?o--:++o<i;)if(t(e[o],o,e))return o;return-1}return Jg=r,Jg}var ep,BS;function A4(){if(BS)return ep;BS=1;function r(e){return e!==e}return ep=r,ep}var rp,MS;function P4(){if(MS)return rp;MS=1;function r(e,t,n){for(var a=n-1,i=e.length;++a<i;)if(e[a]===t)return a;return-1}return rp=r,rp}var tp,kS;function I4(){if(kS)return tp;kS=1;var r=PP(),e=A4(),t=P4();function n(a,i,o){return i===i?t(a,i,o):r(a,e,o)}return tp=n,tp}var np,OS;function D4(){if(OS)return np;OS=1;var r=I4();function e(t,n){var a=t==null?0:t.length;return!!a&&r(t,n,0)>-1}return np=e,np}var ap,LS;function B4(){if(LS)return ap;LS=1;function r(e,t,n){for(var a=-1,i=e==null?0:e.length;++a<i;)if(n(t,e[a]))return!0;return!1}return ap=r,ap}var ip,qS;function M4(){if(qS)return ip;qS=1;function r(){}return ip=r,ip}var op,NS;function k4(){if(NS)return op;NS=1;var r=tP(),e=M4(),t=l0(),n=1/0,a=r&&1/t(new r([,-0]))[1]==n?function(i){return new r(i)}:e;return op=a,op}var sp,FS;function O4(){if(FS)return sp;FS=1;var r=cP(),e=D4(),t=B4(),n=dP(),a=k4(),i=l0(),o=200;function s(l,u,c){var d=-1,h=e,g=l.length,p=!0,E=[],y=E;if(c)p=!1,h=t;else if(g>=o){var b=u?null:a(l);if(b)return i(b);p=!1,h=n,y=new r}else y=u?[]:E;e:for(;++d<g;){var w=l[d],x=u?u(w):w;if(w=c||w!==0?w:0,p&&x===x){for(var C=y.length;C--;)if(y[C]===x)continue e;u&&y.push(x),E.push(w)}else h(y,x,c)||(y!==E&&y.push(x),E.push(w))}return E}return sp=s,sp}var up,zS;function IP(){if(zS)return up;zS=1;var r=ea(),e=On();function t(n){return e(n)&&r(n)}return up=t,up}var lp,$S;function L4(){if($S)return lp;$S=1;var r=c0(),e=Fl(),t=O4(),n=IP(),a=e(function(i){return t(r(i,1,n,!0))});return lp=a,lp}var fp,VS;function q4(){if(VS)return fp;VS=1;var r=Ll();function e(t,n){return r(n,function(a){return t[a]})}return fp=e,fp}var cp,GS;function DP(){if(GS)return cp;GS=1;var r=q4(),e=qa();function t(n){return n==null?[]:r(n,e(n))}return cp=t,cp}var dp,WS;function cn(){if(WS)return dp;WS=1;var r;if(typeof Zm=="function")try{r={clone:WV(),constant:o0(),each:fP(),filter:xP(),has:EP(),isArray:Zr(),isEmpty:h4(),isFunction:xs(),isUndefined:CP(),keys:qa(),map:SP(),reduce:TP(),size:E4(),transform:C4(),union:L4(),values:DP()}}catch{}return r||(r=window._),dp=r,dp}var vp,US;function d0(){if(US)return vp;US=1;var r=cn();vp=a;var e="\0",t="\0",n="";function a(c){this._isDirected=r.has(c,"directed")?c.directed:!0,this._isMultigraph=r.has(c,"multigraph")?c.multigraph:!1,this._isCompound=r.has(c,"compound")?c.compound:!1,this._label=void 0,this._defaultNodeLabelFn=r.constant(void 0),this._defaultEdgeLabelFn=r.constant(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[t]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}a.prototype._nodeCount=0,a.prototype._edgeCount=0,a.prototype.isDirected=function(){return this._isDirected},a.prototype.isMultigraph=function(){return this._isMultigraph},a.prototype.isCompound=function(){return this._isCompound},a.prototype.setGraph=function(c){return this._label=c,this},a.prototype.graph=function(){return this._label},a.prototype.setDefaultNodeLabel=function(c){return r.isFunction(c)||(c=r.constant(c)),this._defaultNodeLabelFn=c,this},a.prototype.nodeCount=function(){return this._nodeCount},a.prototype.nodes=function(){return r.keys(this._nodes)},a.prototype.sources=function(){var c=this;return r.filter(this.nodes(),function(d){return r.isEmpty(c._in[d])})},a.prototype.sinks=function(){var c=this;return r.filter(this.nodes(),function(d){return r.isEmpty(c._out[d])})},a.prototype.setNodes=function(c,d){var h=arguments,g=this;return r.each(c,function(p){h.length>1?g.setNode(p,d):g.setNode(p)}),this},a.prototype.setNode=function(c,d){return r.has(this._nodes,c)?(arguments.length>1&&(this._nodes[c]=d),this):(this._nodes[c]=arguments.length>1?d:this._defaultNodeLabelFn(c),this._isCompound&&(this._parent[c]=t,this._children[c]={},this._children[t][c]=!0),this._in[c]={},this._preds[c]={},this._out[c]={},this._sucs[c]={},++this._nodeCount,this)},a.prototype.node=function(c){return this._nodes[c]},a.prototype.hasNode=function(c){return r.has(this._nodes,c)},a.prototype.removeNode=function(c){var d=this;if(r.has(this._nodes,c)){var h=function(g){d.removeEdge(d._edgeObjs[g])};delete this._nodes[c],this._isCompound&&(this._removeFromParentsChildList(c),delete this._parent[c],r.each(this.children(c),function(g){d.setParent(g)}),delete this._children[c]),r.each(r.keys(this._in[c]),h),delete this._in[c],delete this._preds[c],r.each(r.keys(this._out[c]),h),delete this._out[c],delete this._sucs[c],--this._nodeCount}return this},a.prototype.setParent=function(c,d){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(r.isUndefined(d))d=t;else{d+="";for(var h=d;!r.isUndefined(h);h=this.parent(h))if(h===c)throw new Error("Setting "+d+" as parent of "+c+" would create a cycle");this.setNode(d)}return this.setNode(c),this._removeFromParentsChildList(c),this._parent[c]=d,this._children[d][c]=!0,this},a.prototype._removeFromParentsChildList=function(c){delete this._children[this._parent[c]][c]},a.prototype.parent=function(c){if(this._isCompound){var d=this._parent[c];if(d!==t)return d}},a.prototype.children=function(c){if(r.isUndefined(c)&&(c=t),this._isCompound){var d=this._children[c];if(d)return r.keys(d)}else{if(c===t)return this.nodes();if(this.hasNode(c))return[]}},a.prototype.predecessors=function(c){var d=this._preds[c];if(d)return r.keys(d)},a.prototype.successors=function(c){var d=this._sucs[c];if(d)return r.keys(d)},a.prototype.neighbors=function(c){var d=this.predecessors(c);if(d)return r.union(d,this.successors(c))},a.prototype.isLeaf=function(c){var d;return this.isDirected()?d=this.successors(c):d=this.neighbors(c),d.length===0},a.prototype.filterNodes=function(c){var d=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});d.setGraph(this.graph());var h=this;r.each(this._nodes,function(E,y){c(y)&&d.setNode(y,E)}),r.each(this._edgeObjs,function(E){d.hasNode(E.v)&&d.hasNode(E.w)&&d.setEdge(E,h.edge(E))});var g={};function p(E){var y=h.parent(E);return y===void 0||d.hasNode(y)?(g[E]=y,y):y in g?g[y]:p(y)}return this._isCompound&&r.each(d.nodes(),function(E){d.setParent(E,p(E))}),d},a.prototype.setDefaultEdgeLabel=function(c){return r.isFunction(c)||(c=r.constant(c)),this._defaultEdgeLabelFn=c,this},a.prototype.edgeCount=function(){return this._edgeCount},a.prototype.edges=function(){return r.values(this._edgeObjs)},a.prototype.setPath=function(c,d){var h=this,g=arguments;return r.reduce(c,function(p,E){return g.length>1?h.setEdge(p,E,d):h.setEdge(p,E),E}),this},a.prototype.setEdge=function(){var c,d,h,g,p=!1,E=arguments[0];typeof E=="object"&&E!==null&&"v"in E?(c=E.v,d=E.w,h=E.name,arguments.length===2&&(g=arguments[1],p=!0)):(c=E,d=arguments[1],h=arguments[3],arguments.length>2&&(g=arguments[2],p=!0)),c=""+c,d=""+d,r.isUndefined(h)||(h=""+h);var y=s(this._isDirected,c,d,h);if(r.has(this._edgeLabels,y))return p&&(this._edgeLabels[y]=g),this;if(!r.isUndefined(h)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(c),this.setNode(d),this._edgeLabels[y]=p?g:this._defaultEdgeLabelFn(c,d,h);var b=l(this._isDirected,c,d,h);return c=b.v,d=b.w,Object.freeze(b),this._edgeObjs[y]=b,i(this._preds[d],c),i(this._sucs[c],d),this._in[d][y]=b,this._out[c][y]=b,this._edgeCount++,this},a.prototype.edge=function(c,d,h){var g=arguments.length===1?u(this._isDirected,arguments[0]):s(this._isDirected,c,d,h);return this._edgeLabels[g]},a.prototype.hasEdge=function(c,d,h){var g=arguments.length===1?u(this._isDirected,arguments[0]):s(this._isDirected,c,d,h);return r.has(this._edgeLabels,g)},a.prototype.removeEdge=function(c,d,h){var g=arguments.length===1?u(this._isDirected,arguments[0]):s(this._isDirected,c,d,h),p=this._edgeObjs[g];return p&&(c=p.v,d=p.w,delete this._edgeLabels[g],delete this._edgeObjs[g],o(this._preds[d],c),o(this._sucs[c],d),delete this._in[d][g],delete this._out[c][g],this._edgeCount--),this},a.prototype.inEdges=function(c,d){var h=this._in[c];if(h){var g=r.values(h);return d?r.filter(g,function(p){return p.v===d}):g}},a.prototype.outEdges=function(c,d){var h=this._out[c];if(h){var g=r.values(h);return d?r.filter(g,function(p){return p.w===d}):g}},a.prototype.nodeEdges=function(c,d){var h=this.inEdges(c,d);if(h)return h.concat(this.outEdges(c,d))};function i(c,d){c[d]?c[d]++:c[d]=1}function o(c,d){--c[d]||delete c[d]}function s(c,d,h,g){var p=""+d,E=""+h;if(!c&&p>E){var y=p;p=E,E=y}return p+n+E+n+(r.isUndefined(g)?e:g)}function l(c,d,h,g){var p=""+d,E=""+h;if(!c&&p>E){var y=p;p=E,E=y}var b={v:p,w:E};return g&&(b.name=g),b}function u(c,d){return s(c,d.v,d.w,d.name)}return vp}var hp,HS;function N4(){return HS||(HS=1,hp="2.1.8"),hp}var gp,KS;function F4(){return KS||(KS=1,gp={Graph:d0(),version:N4()}),gp}var pp,jS;function z4(){if(jS)return pp;jS=1;var r=cn(),e=d0();pp={write:t,read:i};function t(o){var s={options:{directed:o.isDirected(),multigraph:o.isMultigraph(),compound:o.isCompound()},nodes:n(o),edges:a(o)};return r.isUndefined(o.graph())||(s.value=r.clone(o.graph())),s}function n(o){return r.map(o.nodes(),function(s){var l=o.node(s),u=o.parent(s),c={v:s};return r.isUndefined(l)||(c.value=l),r.isUndefined(u)||(c.parent=u),c})}function a(o){return r.map(o.edges(),function(s){var l=o.edge(s),u={v:s.v,w:s.w};return r.isUndefined(s.name)||(u.name=s.name),r.isUndefined(l)||(u.value=l),u})}function i(o){var s=new e(o.options).setGraph(o.value);return r.each(o.nodes,function(l){s.setNode(l.v,l.value),l.parent&&s.setParent(l.v,l.parent)}),r.each(o.edges,function(l){s.setEdge({v:l.v,w:l.w,name:l.name},l.value)}),s}return pp}var yp,YS;function $4(){if(YS)return yp;YS=1;var r=cn();yp=e;function e(t){var n={},a=[],i;function o(s){r.has(n,s)||(n[s]=!0,i.push(s),r.each(t.successors(s),o),r.each(t.predecessors(s),o))}return r.each(t.nodes(),function(s){i=[],o(s),i.length&&a.push(i)}),a}return yp}var mp,ZS;function BP(){if(ZS)return mp;ZS=1;var r=cn();mp=e;function e(){this._arr=[],this._keyIndices={}}return e.prototype.size=function(){return this._arr.length},e.prototype.keys=function(){return this._arr.map(function(t){return t.key})},e.prototype.has=function(t){return r.has(this._keyIndices,t)},e.prototype.priority=function(t){var n=this._keyIndices[t];if(n!==void 0)return this._arr[n].priority},e.prototype.min=function(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key},e.prototype.add=function(t,n){var a=this._keyIndices;if(t=String(t),!r.has(a,t)){var i=this._arr,o=i.length;return a[t]=o,i.push({key:t,priority:n}),this._decrease(o),!0}return!1},e.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var t=this._arr.pop();return delete this._keyIndices[t.key],this._heapify(0),t.key},e.prototype.decrease=function(t,n){var a=this._keyIndices[t];if(n>this._arr[a].priority)throw new Error("New priority is greater than current priority. Key: "+t+" Old: "+this._arr[a].priority+" New: "+n);this._arr[a].priority=n,this._decrease(a)},e.prototype._heapify=function(t){var n=this._arr,a=2*t,i=a+1,o=t;a<n.length&&(o=n[a].priority<n[o].priority?a:o,i<n.length&&(o=n[i].priority<n[o].priority?i:o),o!==t&&(this._swap(t,o),this._heapify(o)))},e.prototype._decrease=function(t){for(var n=this._arr,a=n[t].priority,i;t!==0&&(i=t>>1,!(n[i].priority<a));)this._swap(t,i),t=i},e.prototype._swap=function(t,n){var a=this._arr,i=this._keyIndices,o=a[t],s=a[n];a[t]=s,a[n]=o,i[s.key]=t,i[o.key]=n},mp}var bp,XS;function MP(){if(XS)return bp;XS=1;var r=cn(),e=BP();bp=n;var t=r.constant(1);function n(i,o,s,l){return a(i,String(o),s||t,l||function(u){return i.outEdges(u)})}function a(i,o,s,l){var u={},c=new e,d,h,g=function(p){var E=p.v!==d?p.v:p.w,y=u[E],b=s(p),w=h.distance+b;if(b<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+p+" Weight: "+b);w<y.distance&&(y.distance=w,y.predecessor=d,c.decrease(E,w))};for(i.nodes().forEach(function(p){var E=p===o?0:Number.POSITIVE_INFINITY;u[p]={distance:E},c.add(p,E)});c.size()>0&&(d=c.removeMin(),h=u[d],h.distance!==Number.POSITIVE_INFINITY);)l(d).forEach(g);return u}return bp}var wp,QS;function V4(){if(QS)return wp;QS=1;var r=MP(),e=cn();wp=t;function t(n,a,i){return e.transform(n.nodes(),function(o,s){o[s]=r(n,s,a,i)},{})}return wp}var xp,JS;function kP(){if(JS)return xp;JS=1;var r=cn();xp=e;function e(t){var n=0,a=[],i={},o=[];function s(l){var u=i[l]={onStack:!0,lowlink:n,index:n++};if(a.push(l),t.successors(l).forEach(function(h){r.has(i,h)?i[h].onStack&&(u.lowlink=Math.min(u.lowlink,i[h].index)):(s(h),u.lowlink=Math.min(u.lowlink,i[h].lowlink))}),u.lowlink===u.index){var c=[],d;do d=a.pop(),i[d].onStack=!1,c.push(d);while(l!==d);o.push(c)}}return t.nodes().forEach(function(l){r.has(i,l)||s(l)}),o}return xp}var Ep,eT;function G4(){if(eT)return Ep;eT=1;var r=cn(),e=kP();Ep=t;function t(n){return r.filter(e(n),function(a){return a.length>1||a.length===1&&n.hasEdge(a[0],a[0])})}return Ep}var Cp,rT;function W4(){if(rT)return Cp;rT=1;var r=cn();Cp=t;var e=r.constant(1);function t(a,i,o){return n(a,i||e,o||function(s){return a.outEdges(s)})}function n(a,i,o){var s={},l=a.nodes();return l.forEach(function(u){s[u]={},s[u][u]={distance:0},l.forEach(function(c){u!==c&&(s[u][c]={distance:Number.POSITIVE_INFINITY})}),o(u).forEach(function(c){var d=c.v===u?c.w:c.v,h=i(c);s[u][d]={distance:h,predecessor:u}})}),l.forEach(function(u){var c=s[u];l.forEach(function(d){var h=s[d];l.forEach(function(g){var p=h[u],E=c[g],y=h[g],b=p.distance+E.distance;b<y.distance&&(y.distance=b,y.predecessor=E.predecessor)})})}),s}return Cp}var _p,tT;function OP(){if(tT)return _p;tT=1;var r=cn();_p=e,e.CycleException=t;function e(n){var a={},i={},o=[];function s(l){if(r.has(i,l))throw new t;r.has(a,l)||(i[l]=!0,a[l]=!0,r.each(n.predecessors(l),s),delete i[l],o.push(l))}if(r.each(n.sinks(),s),r.size(a)!==n.nodeCount())throw new t;return o}function t(){}return t.prototype=new Error,_p}var Sp,nT;function U4(){if(nT)return Sp;nT=1;var r=OP();Sp=e;function e(t){try{r(t)}catch(n){if(n instanceof r.CycleException)return!1;throw n}return!0}return Sp}var Tp,aT;function LP(){if(aT)return Tp;aT=1;var r=cn();Tp=e;function e(n,a,i){r.isArray(a)||(a=[a]);var o=(n.isDirected()?n.successors:n.neighbors).bind(n),s=[],l={};return r.each(a,function(u){if(!n.hasNode(u))throw new Error("Graph does not have node: "+u);t(n,u,i==="post",l,o,s)}),s}function t(n,a,i,o,s,l){r.has(o,a)||(o[a]=!0,i||l.push(a),r.each(s(a),function(u){t(n,u,i,o,s,l)}),i&&l.push(a))}return Tp}var Rp,iT;function H4(){if(iT)return Rp;iT=1;var r=LP();Rp=e;function e(t,n){return r(t,n,"post")}return Rp}var Ap,oT;function K4(){if(oT)return Ap;oT=1;var r=LP();Ap=e;function e(t,n){return r(t,n,"pre")}return Ap}var Pp,sT;function j4(){if(sT)return Pp;sT=1;var r=cn(),e=d0(),t=BP();Pp=n;function n(a,i){var o=new e,s={},l=new t,u;function c(h){var g=h.v===u?h.w:h.v,p=l.priority(g);if(p!==void 0){var E=i(h);E<p&&(s[g]=u,l.decrease(g,E))}}if(a.nodeCount()===0)return o;r.each(a.nodes(),function(h){l.add(h,Number.POSITIVE_INFINITY),o.setNode(h)}),l.decrease(a.nodes()[0],0);for(var d=!1;l.size()>0;){if(u=l.removeMin(),r.has(s,u))o.setEdge(u,s[u]);else{if(d)throw new Error("Input graph is not connected: "+a);d=!0}a.nodeEdges(u).forEach(c)}return o}return Pp}var Ip,uT;function Y4(){return uT||(uT=1,Ip={components:$4(),dijkstra:MP(),dijkstraAll:V4(),findCycles:G4(),floydWarshall:W4(),isAcyclic:U4(),postorder:H4(),preorder:K4(),prim:j4(),tarjan:kP(),topsort:OP()}),Ip}var Dp,lT;function Z4(){if(lT)return Dp;lT=1;var r=F4();return Dp={Graph:r.Graph,json:z4(),alg:Y4(),version:r.version},Dp}var Bp,fT;function xn(){if(fT)return Bp;fT=1;var r;if(typeof Zm=="function")try{r=Z4()}catch{}return r||(r=window.graphlib),Bp=r,Bp}var Mp,cT;function X4(){if(cT)return Mp;cT=1;var r=sP(),e=1,t=4;function n(a){return r(a,e|t)}return Mp=n,Mp}var kp,dT;function zl(){if(dT)return kp;dT=1;var r=uo(),e=ea(),t=Dl(),n=fn();function a(i,o,s){if(!n(s))return!1;var l=typeof o;return(l=="number"?e(s)&&t(o,s.length):l=="string"&&o in s)?r(s[o],i):!1}return kp=a,kp}var Op,vT;function Q4(){if(vT)return Op;vT=1;var r=Fl(),e=uo(),t=zl(),n=vi(),a=Object.prototype,i=a.hasOwnProperty,o=r(function(s,l){s=Object(s);var u=-1,c=l.length,d=c>2?l[2]:void 0;for(d&&t(l[0],l[1],d)&&(c=1);++u<c;)for(var h=l[u],g=n(h),p=-1,E=g.length;++p<E;){var y=g[p],b=s[y];(b===void 0||e(b,a[y])&&!i.call(s,y))&&(s[y]=h[y])}return s});return Op=o,Op}var Lp,hT;function J4(){if(hT)return Lp;hT=1;var r=ra(),e=ea(),t=qa();function n(a){return function(i,o,s){var l=Object(i);if(!e(i)){var u=r(o,3);i=t(i),o=function(d){return u(l[d],d,l)}}var c=a(i,o,s);return c>-1?l[u?i[c]:c]:void 0}}return Lp=n,Lp}var qp,gT;function eG(){if(gT)return qp;gT=1;var r=/\s/;function e(t){for(var n=t.length;n--&&r.test(t.charAt(n)););return n}return qp=e,qp}var Np,pT;function rG(){if(pT)return Np;pT=1;var r=eG(),e=/^\s+/;function t(n){return n&&n.slice(0,r(n)+1).replace(e,"")}return Np=t,Np}var Fp,yT;function tG(){if(yT)return Fp;yT=1;var r=rG(),e=fn(),t=vo(),n=NaN,a=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,o=/^0o[0-7]+$/i,s=parseInt;function l(u){if(typeof u=="number")return u;if(t(u))return n;if(e(u)){var c=typeof u.valueOf=="function"?u.valueOf():u;u=e(c)?c+"":c}if(typeof u!="string")return u===0?u:+u;u=r(u);var d=i.test(u);return d||o.test(u)?s(u.slice(2),d?2:8):a.test(u)?n:+u}return Fp=l,Fp}var zp,mT;function qP(){if(mT)return zp;mT=1;var r=tG(),e=1/0,t=17976931348623157e292;function n(a){if(!a)return a===0?a:0;if(a=r(a),a===e||a===-e){var i=a<0?-1:1;return i*t}return a===a?a:0}return zp=n,zp}var $p,bT;function nG(){if(bT)return $p;bT=1;var r=qP();function e(t){var n=r(t),a=n%1;return n===n?a?n-a:n:0}return $p=e,$p}var Vp,wT;function aG(){if(wT)return Vp;wT=1;var r=PP(),e=ra(),t=nG(),n=Math.max;function a(i,o,s){var l=i==null?0:i.length;if(!l)return-1;var u=s==null?0:t(s);return u<0&&(u=n(l+u,0)),r(i,e(o,3),u)}return Vp=a,Vp}var Gp,xT;function iG(){if(xT)return Gp;xT=1;var r=J4(),e=aG(),t=r(e);return Gp=t,Gp}var Wp,ET;function NP(){if(ET)return Wp;ET=1;var r=c0();function e(t){var n=t==null?0:t.length;return n?r(t,1):[]}return Wp=e,Wp}var Up,CT;function oG(){if(CT)return Up;CT=1;var r=s0(),e=uP(),t=vi();function n(a,i){return a==null?a:r(a,e(i),t)}return Up=n,Up}var Hp,_T;function sG(){if(_T)return Hp;_T=1;function r(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}return Hp=r,Hp}var Kp,ST;function uG(){if(ST)return Kp;ST=1;var r=Pl(),e=u0(),t=ra();function n(a,i){var o={};return i=t(i,3),e(a,function(s,l,u){r(o,l,i(s,l,u))}),o}return Kp=n,Kp}var jp,TT;function v0(){if(TT)return jp;TT=1;var r=vo();function e(t,n,a){for(var i=-1,o=t.length;++i<o;){var s=t[i],l=n(s);if(l!=null&&(u===void 0?l===l&&!r(l):a(l,u)))var u=l,c=s}return c}return jp=e,jp}var Yp,RT;function lG(){if(RT)return Yp;RT=1;function r(e,t){return e>t}return Yp=r,Yp}var Zp,AT;function fG(){if(AT)return Zp;AT=1;var r=v0(),e=lG(),t=hi();function n(a){return a&&a.length?r(a,t,e):void 0}return Zp=n,Zp}var Xp,PT;function FP(){if(PT)return Xp;PT=1;var r=Pl(),e=uo();function t(n,a,i){(i!==void 0&&!e(n[a],i)||i===void 0&&!(a in n))&&r(n,a,i)}return Xp=t,Xp}var Qp,IT;function cG(){if(IT)return Qp;IT=1;var r=ci(),e=kl(),t=On(),n="[object Object]",a=Function.prototype,i=Object.prototype,o=a.toString,s=i.hasOwnProperty,l=o.call(Object);function u(c){if(!t(c)||r(c)!=n)return!1;var d=e(c);if(d===null)return!0;var h=s.call(d,"constructor")&&d.constructor;return typeof h=="function"&&h instanceof h&&o.call(h)==l}return Qp=u,Qp}var Jp,DT;function zP(){if(DT)return Jp;DT=1;function r(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}return Jp=r,Jp}var ey,BT;function dG(){if(BT)return ey;BT=1;var r=Es(),e=vi();function t(n){return r(n,e(n))}return ey=t,ey}var ry,MT;function vG(){if(MT)return ry;MT=1;var r=FP(),e=YA(),t=aP(),n=ZA(),a=oP(),i=Cs(),o=Zr(),s=IP(),l=fo(),u=xs(),c=fn(),d=cG(),h=_s(),g=zP(),p=dG();function E(y,b,w,x,C,T,S){var _=g(y,w),A=g(b,w),P=S.get(A);if(P){r(y,w,P);return}var I=T?T(_,A,w+"",y,b,S):void 0,D=I===void 0;if(D){var k=o(A),M=!k&&l(A),N=!k&&!M&&h(A);I=A,k||M||N?o(_)?I=_:s(_)?I=n(_):M?(D=!1,I=e(A,!0)):N?(D=!1,I=t(A,!0)):I=[]:d(A)||i(A)?(I=_,i(_)?I=p(_):(!c(_)||u(_))&&(I=a(A))):D=!1}D&&(S.set(A,I),C(I,A,x,T,S),S.delete(A)),r(y,w,I)}return ry=E,ry}var ty,kT;function hG(){if(kT)return ty;kT=1;var r=Al(),e=FP(),t=s0(),n=vG(),a=fn(),i=vi(),o=zP();function s(l,u,c,d,h){l!==u&&t(u,function(g,p){if(h||(h=new r),a(g))n(l,u,p,c,s,d,h);else{var E=d?d(o(l,p),g,p+"",l,u,h):void 0;E===void 0&&(E=g),e(l,p,E)}},i)}return ty=s,ty}var ny,OT;function gG(){if(OT)return ny;OT=1;var r=Fl(),e=zl();function t(n){return r(function(a,i){var o=-1,s=i.length,l=s>1?i[s-1]:void 0,u=s>2?i[2]:void 0;for(l=n.length>3&&typeof l=="function"?(s--,l):void 0,u&&e(i[0],i[1],u)&&(l=s<3?void 0:l,s=1),a=Object(a);++o<s;){var c=i[o];c&&n(a,c,o,l)}return a})}return ny=t,ny}var ay,LT;function pG(){if(LT)return ay;LT=1;var r=hG(),e=gG(),t=e(function(n,a,i){r(n,a,i)});return ay=t,ay}var iy,qT;function $P(){if(qT)return iy;qT=1;function r(e,t){return e<t}return iy=r,iy}var oy,NT;function yG(){if(NT)return oy;NT=1;var r=v0(),e=$P(),t=hi();function n(a){return a&&a.length?r(a,t,e):void 0}return oy=n,oy}var sy,FT;function mG(){if(FT)return sy;FT=1;var r=v0(),e=ra(),t=$P();function n(a,i){return a&&a.length?r(a,e(i,2),t):void 0}return sy=n,sy}var uy,zT;function bG(){if(zT)return uy;zT=1;var r=En(),e=function(){return r.Date.now()};return uy=e,uy}var ly,$T;function wG(){if($T)return ly;$T=1;var r=Il(),e=ql(),t=Dl(),n=fn(),a=Ss();function i(o,s,l,u){if(!n(o))return o;s=e(s,o);for(var c=-1,d=s.length,h=d-1,g=o;g!=null&&++c<d;){var p=a(s[c]),E=l;if(p==="__proto__"||p==="constructor"||p==="prototype")return o;if(c!=h){var y=g[p];E=u?u(y,p,g):void 0,E===void 0&&(E=n(y)?y:t(s[c+1])?[]:{})}r(g,p,E),g=g[p]}return o}return ly=i,ly}var fy,VT;function xG(){if(VT)return fy;VT=1;var r=Nl(),e=wG(),t=ql();function n(a,i,o){for(var s=-1,l=i.length,u={};++s<l;){var c=i[s],d=r(a,c);o(d,c)&&e(u,t(c,a),d)}return u}return fy=n,fy}var cy,GT;function EG(){if(GT)return cy;GT=1;var r=xG(),e=bP();function t(n,a){return r(n,a,function(i,o){return e(n,o)})}return cy=t,cy}var dy,WT;function CG(){if(WT)return dy;WT=1;var r=NP(),e=RP(),t=AP();function n(a){return t(e(a,void 0,r),a+"")}return dy=n,dy}var vy,UT;function _G(){if(UT)return vy;UT=1;var r=EG(),e=CG(),t=e(function(n,a){return n==null?{}:r(n,a)});return vy=t,vy}var hy,HT;function SG(){if(HT)return hy;HT=1;var r=Math.ceil,e=Math.max;function t(n,a,i,o){for(var s=-1,l=e(r((a-n)/(i||1)),0),u=Array(l);l--;)u[o?l:++s]=n,n+=i;return u}return hy=t,hy}var gy,KT;function TG(){if(KT)return gy;KT=1;var r=SG(),e=zl(),t=qP();function n(a){return function(i,o,s){return s&&typeof s!="number"&&e(i,o,s)&&(o=s=void 0),i=t(i),o===void 0?(o=i,i=0):o=t(o),s=s===void 0?i<o?1:-1:t(s),r(i,o,s,a)}}return gy=n,gy}var py,jT;function RG(){if(jT)return py;jT=1;var r=TG(),e=r();return py=e,py}var yy,YT;function AG(){if(YT)return yy;YT=1;function r(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}return yy=r,yy}var my,ZT;function PG(){if(ZT)return my;ZT=1;var r=vo();function e(t,n){if(t!==n){var a=t!==void 0,i=t===null,o=t===t,s=r(t),l=n!==void 0,u=n===null,c=n===n,d=r(n);if(!u&&!d&&!s&&t>n||s&&l&&c&&!u&&!d||i&&l&&c||!a&&c||!o)return 1;if(!i&&!s&&!d&&t<n||d&&a&&o&&!i&&!s||u&&a&&o||!l&&o||!c)return-1}return 0}return my=e,my}var by,XT;function IG(){if(XT)return by;XT=1;var r=PG();function e(t,n,a){for(var i=-1,o=t.criteria,s=n.criteria,l=o.length,u=a.length;++i<l;){var c=r(o[i],s[i]);if(c){if(i>=u)return c;var d=a[i];return c*(d=="desc"?-1:1)}}return t.index-n.index}return by=e,by}var wy,QT;function DG(){if(QT)return wy;QT=1;var r=Ll(),e=Nl(),t=ra(),n=_P(),a=AG(),i=Bl(),o=IG(),s=hi(),l=Zr();function u(c,d,h){d.length?d=r(d,function(E){return l(E)?function(y){return e(y,E.length===1?E[0]:E)}:E}):d=[s];var g=-1;d=r(d,i(t));var p=n(c,function(E,y,b){var w=r(d,function(x){return x(E)});return{criteria:w,index:++g,value:E}});return a(p,function(E,y){return o(E,y,h)})}return wy=u,wy}var xy,JT;function BG(){if(JT)return xy;JT=1;var r=c0(),e=DG(),t=Fl(),n=zl(),a=t(function(i,o){if(i==null)return[];var s=o.length;return s>1&&n(i,o[0],o[1])?o=[]:s>2&&n(o[0],o[1],o[2])&&(o=[o[0]]),e(i,r(o,1),[])});return xy=a,xy}var Ey,e2;function MG(){if(e2)return Ey;e2=1;var r=yP(),e=0;function t(n){var a=++e;return r(n)+a}return Ey=t,Ey}var Cy,r2;function kG(){if(r2)return Cy;r2=1;function r(e,t,n){for(var a=-1,i=e.length,o=t.length,s={};++a<i;){var l=a<o?t[a]:void 0;n(s,e[a],l)}return s}return Cy=r,Cy}var _y,t2;function OG(){if(t2)return _y;t2=1;var r=Il(),e=kG();function t(n,a){return e(n||[],a||[],r)}return _y=t,_y}var Sy,n2;function qr(){if(n2)return Sy;n2=1;var r;if(typeof Zm=="function")try{r={cloneDeep:X4(),constant:o0(),defaults:Q4(),each:fP(),filter:xP(),find:iG(),flatten:NP(),forEach:lP(),forIn:oG(),has:EP(),isUndefined:CP(),last:sG(),map:SP(),mapValues:uG(),max:fG(),merge:pG(),min:yG(),minBy:mG(),now:bG(),pick:_G(),range:RG(),reduce:TP(),sortBy:BG(),uniqueId:MG(),values:DP(),zipObject:OG()}}catch{}return r||(r=window._),Sy=r,Sy}var Ty,a2;function LG(){if(a2)return Ty;a2=1,Ty=r;function r(){var n={};n._next=n._prev=n,this._sentinel=n}r.prototype.dequeue=function(){var n=this._sentinel,a=n._prev;if(a!==n)return e(a),a},r.prototype.enqueue=function(n){var a=this._sentinel;n._prev&&n._next&&e(n),n._next=a._next,a._next._prev=n,a._next=n,n._prev=a},r.prototype.toString=function(){for(var n=[],a=this._sentinel,i=a._prev;i!==a;)n.push(JSON.stringify(i,t)),i=i._prev;return"["+n.join(", ")+"]"};function e(n){n._prev._next=n._next,n._next._prev=n._prev,delete n._next,delete n._prev}function t(n,a){if(n!=="_next"&&n!=="_prev")return a}return Ty}var Ry,i2;function qG(){if(i2)return Ry;i2=1;var r=qr(),e=xn().Graph,t=LG();Ry=a;var n=r.constant(1);function a(u,c){if(u.nodeCount()<=1)return[];var d=s(u,c||n),h=i(d.graph,d.buckets,d.zeroIdx);return r.flatten(r.map(h,function(g){return u.outEdges(g.v,g.w)}),!0)}function i(u,c,d){for(var h=[],g=c[c.length-1],p=c[0],E;u.nodeCount();){for(;E=p.dequeue();)o(u,c,d,E);for(;E=g.dequeue();)o(u,c,d,E);if(u.nodeCount()){for(var y=c.length-2;y>0;--y)if(E=c[y].dequeue(),E){h=h.concat(o(u,c,d,E,!0));break}}}return h}function o(u,c,d,h,g){var p=g?[]:void 0;return r.forEach(u.inEdges(h.v),function(E){var y=u.edge(E),b=u.node(E.v);g&&p.push({v:E.v,w:E.w}),b.out-=y,l(c,d,b)}),r.forEach(u.outEdges(h.v),function(E){var y=u.edge(E),b=E.w,w=u.node(b);w.in-=y,l(c,d,w)}),u.removeNode(h.v),p}function s(u,c){var d=new e,h=0,g=0;r.forEach(u.nodes(),function(y){d.setNode(y,{v:y,in:0,out:0})}),r.forEach(u.edges(),function(y){var b=d.edge(y.v,y.w)||0,w=c(y),x=b+w;d.setEdge(y.v,y.w,x),g=Math.max(g,d.node(y.v).out+=w),h=Math.max(h,d.node(y.w).in+=w)});var p=r.range(g+h+3).map(function(){return new t}),E=h+1;return r.forEach(d.nodes(),function(y){l(p,E,d.node(y))}),{graph:d,buckets:p,zeroIdx:E}}function l(u,c,d){d.out?d.in?u[d.out-d.in+c].enqueue(d):u[u.length-1].enqueue(d):u[0].enqueue(d)}return Ry}var Ay,o2;function NG(){if(o2)return Ay;o2=1;var r=qr(),e=qG();Ay={run:t,undo:a};function t(i){var o=i.graph().acyclicer==="greedy"?e(i,s(i)):n(i);r.forEach(o,function(l){var u=i.edge(l);i.removeEdge(l),u.forwardName=l.name,u.reversed=!0,i.setEdge(l.w,l.v,u,r.uniqueId("rev"))});function s(l){return function(u){return l.edge(u).weight}}}function n(i){var o=[],s={},l={};function u(c){r.has(l,c)||(l[c]=!0,s[c]=!0,r.forEach(i.outEdges(c),function(d){r.has(s,d.w)?o.push(d):u(d.w)}),delete s[c])}return r.forEach(i.nodes(),u),o}function a(i){r.forEach(i.edges(),function(o){var s=i.edge(o);if(s.reversed){i.removeEdge(o);var l=s.forwardName;delete s.reversed,delete s.forwardName,i.setEdge(o.w,o.v,s,l)}})}return Ay}var Py,s2;function $t(){if(s2)return Py;s2=1;var r=qr(),e=xn().Graph;Py={addDummyNode:t,simplify:n,asNonCompoundGraph:a,successorWeights:i,predecessorWeights:o,intersectRect:s,buildLayerMatrix:l,normalizeRanks:u,removeEmptyRanks:c,addBorderNode:d,maxRank:h,partition:g,time:p,notime:E};function t(y,b,w,x){var C;do C=r.uniqueId(x);while(y.hasNode(C));return w.dummy=b,y.setNode(C,w),C}function n(y){var b=new e().setGraph(y.graph());return r.forEach(y.nodes(),function(w){b.setNode(w,y.node(w))}),r.forEach(y.edges(),function(w){var x=b.edge(w.v,w.w)||{weight:0,minlen:1},C=y.edge(w);b.setEdge(w.v,w.w,{weight:x.weight+C.weight,minlen:Math.max(x.minlen,C.minlen)})}),b}function a(y){var b=new e({multigraph:y.isMultigraph()}).setGraph(y.graph());return r.forEach(y.nodes(),function(w){y.children(w).length||b.setNode(w,y.node(w))}),r.forEach(y.edges(),function(w){b.setEdge(w,y.edge(w))}),b}function i(y){var b=r.map(y.nodes(),function(w){var x={};return r.forEach(y.outEdges(w),function(C){x[C.w]=(x[C.w]||0)+y.edge(C).weight}),x});return r.zipObject(y.nodes(),b)}function o(y){var b=r.map(y.nodes(),function(w){var x={};return r.forEach(y.inEdges(w),function(C){x[C.v]=(x[C.v]||0)+y.edge(C).weight}),x});return r.zipObject(y.nodes(),b)}function s(y,b){var w=y.x,x=y.y,C=b.x-w,T=b.y-x,S=y.width/2,_=y.height/2;if(!C&&!T)throw new Error("Not possible to find intersection inside of the rectangle");var A,P;return Math.abs(T)*S>Math.abs(C)*_?(T<0&&(_=-_),A=_*C/T,P=_):(C<0&&(S=-S),A=S,P=S*T/C),{x:w+A,y:x+P}}function l(y){var b=r.map(r.range(h(y)+1),function(){return[]});return r.forEach(y.nodes(),function(w){var x=y.node(w),C=x.rank;r.isUndefined(C)||(b[C][x.order]=w)}),b}function u(y){var b=r.min(r.map(y.nodes(),function(w){return y.node(w).rank}));r.forEach(y.nodes(),function(w){var x=y.node(w);r.has(x,"rank")&&(x.rank-=b)})}function c(y){var b=r.min(r.map(y.nodes(),function(T){return y.node(T).rank})),w=[];r.forEach(y.nodes(),function(T){var S=y.node(T).rank-b;w[S]||(w[S]=[]),w[S].push(T)});var x=0,C=y.graph().nodeRankFactor;r.forEach(w,function(T,S){r.isUndefined(T)&&S%C!==0?--x:x&&r.forEach(T,function(_){y.node(_).rank+=x})})}function d(y,b,w,x){var C={width:0,height:0};return arguments.length>=4&&(C.rank=w,C.order=x),t(y,"border",C,b)}function h(y){return r.max(r.map(y.nodes(),function(b){var w=y.node(b).rank;if(!r.isUndefined(w))return w}))}function g(y,b){var w={lhs:[],rhs:[]};return r.forEach(y,function(x){b(x)?w.lhs.push(x):w.rhs.push(x)}),w}function p(y,b){var w=r.now();try{return b()}finally{console.log(y+" time: "+(r.now()-w)+"ms")}}function E(y,b){return b()}return Py}var Iy,u2;function FG(){if(u2)return Iy;u2=1;var r=qr(),e=$t();Iy={run:t,undo:a};function t(i){i.graph().dummyChains=[],r.forEach(i.edges(),function(o){n(i,o)})}function n(i,o){var s=o.v,l=i.node(s).rank,u=o.w,c=i.node(u).rank,d=o.name,h=i.edge(o),g=h.labelRank;if(c!==l+1){i.removeEdge(o);var p,E,y;for(y=0,++l;l<c;++y,++l)h.points=[],E={width:0,height:0,edgeLabel:h,edgeObj:o,rank:l},p=e.addDummyNode(i,"edge",E,"_d"),l===g&&(E.width=h.width,E.height=h.height,E.dummy="edge-label",E.labelpos=h.labelpos),i.setEdge(s,p,{weight:h.weight},d),y===0&&i.graph().dummyChains.push(p),s=p;i.setEdge(s,u,{weight:h.weight},d)}}function a(i){r.forEach(i.graph().dummyChains,function(o){var s=i.node(o),l=s.edgeLabel,u;for(i.setEdge(s.edgeObj,l);s.dummy;)u=i.successors(o)[0],i.removeNode(o),l.points.push({x:s.x,y:s.y}),s.dummy==="edge-label"&&(l.x=s.x,l.y=s.y,l.width=s.width,l.height=s.height),o=u,s=i.node(o)})}return Iy}var Dy,l2;function nl(){if(l2)return Dy;l2=1;var r=qr();Dy={longestPath:e,slack:t};function e(n){var a={};function i(o){var s=n.node(o);if(r.has(a,o))return s.rank;a[o]=!0;var l=r.min(r.map(n.outEdges(o),function(u){return i(u.w)-n.edge(u).minlen}));return(l===Number.POSITIVE_INFINITY||l===void 0||l===null)&&(l=0),s.rank=l}r.forEach(n.sources(),i)}function t(n,a){return n.node(a.w).rank-n.node(a.v).rank-n.edge(a).minlen}return Dy}var By,f2;function VP(){if(f2)return By;f2=1;var r=qr(),e=xn().Graph,t=nl().slack;By=n;function n(s){var l=new e({directed:!1}),u=s.nodes()[0],c=s.nodeCount();l.setNode(u,{});for(var d,h;a(l,s)<c;)d=i(l,s),h=l.hasNode(d.v)?t(s,d):-t(s,d),o(l,s,h);return l}function a(s,l){function u(c){r.forEach(l.nodeEdges(c),function(d){var h=d.v,g=c===h?d.w:h;!s.hasNode(g)&&!t(l,d)&&(s.setNode(g,{}),s.setEdge(c,g,{}),u(g))})}return r.forEach(s.nodes(),u),s.nodeCount()}function i(s,l){return r.minBy(l.edges(),function(u){if(s.hasNode(u.v)!==s.hasNode(u.w))return t(l,u)})}function o(s,l,u){r.forEach(s.nodes(),function(c){l.node(c).rank+=u})}return By}var My,c2;function zG(){if(c2)return My;c2=1;var r=qr(),e=VP(),t=nl().slack,n=nl().longestPath,a=xn().alg.preorder,i=xn().alg.postorder,o=$t().simplify;My=s,s.initLowLimValues=d,s.initCutValues=l,s.calcCutValue=c,s.leaveEdge=g,s.enterEdge=p,s.exchangeEdges=E;function s(x){x=o(x),n(x);var C=e(x);d(C),l(C,x);for(var T,S;T=g(C);)S=p(C,x,T),E(C,x,T,S)}function l(x,C){var T=i(x,x.nodes());T=T.slice(0,T.length-1),r.forEach(T,function(S){u(x,C,S)})}function u(x,C,T){var S=x.node(T),_=S.parent;x.edge(T,_).cutvalue=c(x,C,T)}function c(x,C,T){var S=x.node(T),_=S.parent,A=!0,P=C.edge(T,_),I=0;return P||(A=!1,P=C.edge(_,T)),I=P.weight,r.forEach(C.nodeEdges(T),function(D){var k=D.v===T,M=k?D.w:D.v;if(M!==_){var N=k===A,z=C.edge(D).weight;if(I+=N?z:-z,b(x,T,M)){var $=x.edge(T,M).cutvalue;I+=N?-$:$}}}),I}function d(x,C){arguments.length<2&&(C=x.nodes()[0]),h(x,{},1,C)}function h(x,C,T,S,_){var A=T,P=x.node(S);return C[S]=!0,r.forEach(x.neighbors(S),function(I){r.has(C,I)||(T=h(x,C,T,I,S))}),P.low=A,P.lim=T++,_?P.parent=_:delete P.parent,T}function g(x){return r.find(x.edges(),function(C){return x.edge(C).cutvalue<0})}function p(x,C,T){var S=T.v,_=T.w;C.hasEdge(S,_)||(S=T.w,_=T.v);var A=x.node(S),P=x.node(_),I=A,D=!1;A.lim>P.lim&&(I=P,D=!0);var k=r.filter(C.edges(),function(M){return D===w(x,x.node(M.v),I)&&D!==w(x,x.node(M.w),I)});return r.minBy(k,function(M){return t(C,M)})}function E(x,C,T,S){var _=T.v,A=T.w;x.removeEdge(_,A),x.setEdge(S.v,S.w,{}),d(x),l(x,C),y(x,C)}function y(x,C){var T=r.find(x.nodes(),function(_){return!C.node(_).parent}),S=a(x,T);S=S.slice(1),r.forEach(S,function(_){var A=x.node(_).parent,P=C.edge(_,A),I=!1;P||(P=C.edge(A,_),I=!0),C.node(_).rank=C.node(A).rank+(I?P.minlen:-P.minlen)})}function b(x,C,T){return x.hasEdge(C,T)}function w(x,C,T){return T.low<=C.lim&&C.lim<=T.lim}return My}var ky,d2;function $G(){if(d2)return ky;d2=1;var r=nl(),e=r.longestPath,t=VP(),n=zG();ky=a;function a(l){switch(l.graph().ranker){case"network-simplex":s(l);break;case"tight-tree":o(l);break;case"longest-path":i(l);break;default:s(l)}}var i=e;function o(l){e(l),t(l)}function s(l){n(l)}return ky}var Oy,v2;function VG(){if(v2)return Oy;v2=1;var r=qr();Oy=e;function e(a){var i=n(a);r.forEach(a.graph().dummyChains,function(o){for(var s=a.node(o),l=s.edgeObj,u=t(a,i,l.v,l.w),c=u.path,d=u.lca,h=0,g=c[h],p=!0;o!==l.w;){if(s=a.node(o),p){for(;(g=c[h])!==d&&a.node(g).maxRank<s.rank;)h++;g===d&&(p=!1)}if(!p){for(;h<c.length-1&&a.node(g=c[h+1]).minRank<=s.rank;)h++;g=c[h]}a.setParent(o,g),o=a.successors(o)[0]}})}function t(a,i,o,s){var l=[],u=[],c=Math.min(i[o].low,i[s].low),d=Math.max(i[o].lim,i[s].lim),h,g;h=o;do h=a.parent(h),l.push(h);while(h&&(i[h].low>c||d>i[h].lim));for(g=h,h=s;(h=a.parent(h))!==g;)u.push(h);return{path:l.concat(u.reverse()),lca:g}}function n(a){var i={},o=0;function s(l){var u=o;r.forEach(a.children(l),s),i[l]={low:u,lim:o++}}return r.forEach(a.children(),s),i}return Oy}var Ly,h2;function GG(){if(h2)return Ly;h2=1;var r=qr(),e=$t();Ly={run:t,cleanup:o};function t(s){var l=e.addDummyNode(s,"root",{},"_root"),u=a(s),c=r.max(r.values(u))-1,d=2*c+1;s.graph().nestingRoot=l,r.forEach(s.edges(),function(g){s.edge(g).minlen*=d});var h=i(s)+1;r.forEach(s.children(),function(g){n(s,l,d,h,c,u,g)}),s.graph().nodeRankFactor=d}function n(s,l,u,c,d,h,g){var p=s.children(g);if(!p.length){g!==l&&s.setEdge(l,g,{weight:0,minlen:u});return}var E=e.addBorderNode(s,"_bt"),y=e.addBorderNode(s,"_bb"),b=s.node(g);s.setParent(E,g),b.borderTop=E,s.setParent(y,g),b.borderBottom=y,r.forEach(p,function(w){n(s,l,u,c,d,h,w);var x=s.node(w),C=x.borderTop?x.borderTop:w,T=x.borderBottom?x.borderBottom:w,S=x.borderTop?c:2*c,_=C!==T?1:d-h[g]+1;s.setEdge(E,C,{weight:S,minlen:_,nestingEdge:!0}),s.setEdge(T,y,{weight:S,minlen:_,nestingEdge:!0})}),s.parent(g)||s.setEdge(l,E,{weight:0,minlen:d+h[g]})}function a(s){var l={};function u(c,d){var h=s.children(c);h&&h.length&&r.forEach(h,function(g){u(g,d+1)}),l[c]=d}return r.forEach(s.children(),function(c){u(c,1)}),l}function i(s){return r.reduce(s.edges(),function(l,u){return l+s.edge(u).weight},0)}function o(s){var l=s.graph();s.removeNode(l.nestingRoot),delete l.nestingRoot,r.forEach(s.edges(),function(u){var c=s.edge(u);c.nestingEdge&&s.removeEdge(u)})}return Ly}var qy,g2;function WG(){if(g2)return qy;g2=1;var r=qr(),e=$t();qy=t;function t(a){function i(o){var s=a.children(o),l=a.node(o);if(s.length&&r.forEach(s,i),r.has(l,"minRank")){l.borderLeft=[],l.borderRight=[];for(var u=l.minRank,c=l.maxRank+1;u<c;++u)n(a,"borderLeft","_bl",o,l,u),n(a,"borderRight","_br",o,l,u)}}r.forEach(a.children(),i)}function n(a,i,o,s,l,u){var c={width:0,height:0,rank:u,borderType:i},d=l[i][u-1],h=e.addDummyNode(a,"border",c,o);l[i][u]=h,a.setParent(h,s),d&&a.setEdge(d,h,{weight:1})}return qy}var Ny,p2;function UG(){if(p2)return Ny;p2=1;var r=qr();Ny={adjust:e,undo:t};function e(u){var c=u.graph().rankdir.toLowerCase();(c==="lr"||c==="rl")&&n(u)}function t(u){var c=u.graph().rankdir.toLowerCase();(c==="bt"||c==="rl")&&i(u),(c==="lr"||c==="rl")&&(s(u),n(u))}function n(u){r.forEach(u.nodes(),function(c){a(u.node(c))}),r.forEach(u.edges(),function(c){a(u.edge(c))})}function a(u){var c=u.width;u.width=u.height,u.height=c}function i(u){r.forEach(u.nodes(),function(c){o(u.node(c))}),r.forEach(u.edges(),function(c){var d=u.edge(c);r.forEach(d.points,o),r.has(d,"y")&&o(d)})}function o(u){u.y=-u.y}function s(u){r.forEach(u.nodes(),function(c){l(u.node(c))}),r.forEach(u.edges(),function(c){var d=u.edge(c);r.forEach(d.points,l),r.has(d,"x")&&l(d)})}function l(u){var c=u.x;u.x=u.y,u.y=c}return Ny}var Fy,y2;function HG(){if(y2)return Fy;y2=1;var r=qr();Fy=e;function e(t){var n={},a=r.filter(t.nodes(),function(u){return!t.children(u).length}),i=r.max(r.map(a,function(u){return t.node(u).rank})),o=r.map(r.range(i+1),function(){return[]});function s(u){if(!r.has(n,u)){n[u]=!0;var c=t.node(u);o[c.rank].push(u),r.forEach(t.successors(u),s)}}var l=r.sortBy(a,function(u){return t.node(u).rank});return r.forEach(l,s),o}return Fy}var zy,m2;function KG(){if(m2)return zy;m2=1;var r=qr();zy=e;function e(n,a){for(var i=0,o=1;o<a.length;++o)i+=t(n,a[o-1],a[o]);return i}function t(n,a,i){for(var o=r.zipObject(i,r.map(i,function(h,g){return g})),s=r.flatten(r.map(a,function(h){return r.sortBy(r.map(n.outEdges(h),function(g){return{pos:o[g.w],weight:n.edge(g).weight}}),"pos")}),!0),l=1;l<i.length;)l<<=1;var u=2*l-1;l-=1;var c=r.map(new Array(u),function(){return 0}),d=0;return r.forEach(s.forEach(function(h){var g=h.pos+l;c[g]+=h.weight;for(var p=0;g>0;)g%2&&(p+=c[g+1]),g=g-1>>1,c[g]+=h.weight;d+=h.weight*p})),d}return zy}var $y,b2;function jG(){if(b2)return $y;b2=1;var r=qr();$y=e;function e(t,n){return r.map(n,function(a){var i=t.inEdges(a);if(i.length){var o=r.reduce(i,function(s,l){var u=t.edge(l),c=t.node(l.v);return{sum:s.sum+u.weight*c.order,weight:s.weight+u.weight}},{sum:0,weight:0});return{v:a,barycenter:o.sum/o.weight,weight:o.weight}}else return{v:a}})}return $y}var Vy,w2;function YG(){if(w2)return Vy;w2=1;var r=qr();Vy=e;function e(a,i){var o={};r.forEach(a,function(l,u){var c=o[l.v]={indegree:0,in:[],out:[],vs:[l.v],i:u};r.isUndefined(l.barycenter)||(c.barycenter=l.barycenter,c.weight=l.weight)}),r.forEach(i.edges(),function(l){var u=o[l.v],c=o[l.w];!r.isUndefined(u)&&!r.isUndefined(c)&&(c.indegree++,u.out.push(o[l.w]))});var s=r.filter(o,function(l){return!l.indegree});return t(s)}function t(a){var i=[];function o(u){return function(c){c.merged||(r.isUndefined(c.barycenter)||r.isUndefined(u.barycenter)||c.barycenter>=u.barycenter)&&n(u,c)}}function s(u){return function(c){c.in.push(u),--c.indegree===0&&a.push(c)}}for(;a.length;){var l=a.pop();i.push(l),r.forEach(l.in.reverse(),o(l)),r.forEach(l.out,s(l))}return r.map(r.filter(i,function(u){return!u.merged}),function(u){return r.pick(u,["vs","i","barycenter","weight"])})}function n(a,i){var o=0,s=0;a.weight&&(o+=a.barycenter*a.weight,s+=a.weight),i.weight&&(o+=i.barycenter*i.weight,s+=i.weight),a.vs=i.vs.concat(a.vs),a.barycenter=o/s,a.weight=s,a.i=Math.min(i.i,a.i),i.merged=!0}return Vy}var Gy,x2;function ZG(){if(x2)return Gy;x2=1;var r=qr(),e=$t();Gy=t;function t(i,o){var s=e.partition(i,function(E){return r.has(E,"barycenter")}),l=s.lhs,u=r.sortBy(s.rhs,function(E){return-E.i}),c=[],d=0,h=0,g=0;l.sort(a(!!o)),g=n(c,u,g),r.forEach(l,function(E){g+=E.vs.length,c.push(E.vs),d+=E.barycenter*E.weight,h+=E.weight,g=n(c,u,g)});var p={vs:r.flatten(c,!0)};return h&&(p.barycenter=d/h,p.weight=h),p}function n(i,o,s){for(var l;o.length&&(l=r.last(o)).i<=s;)o.pop(),i.push(l.vs),s++;return s}function a(i){return function(o,s){return o.barycenter<s.barycenter?-1:o.barycenter>s.barycenter?1:i?s.i-o.i:o.i-s.i}}return Gy}var Wy,E2;function XG(){if(E2)return Wy;E2=1;var r=qr(),e=jG(),t=YG(),n=ZG();Wy=a;function a(s,l,u,c){var d=s.children(l),h=s.node(l),g=h?h.borderLeft:void 0,p=h?h.borderRight:void 0,E={};g&&(d=r.filter(d,function(T){return T!==g&&T!==p}));var y=e(s,d);r.forEach(y,function(T){if(s.children(T.v).length){var S=a(s,T.v,u,c);E[T.v]=S,r.has(S,"barycenter")&&o(T,S)}});var b=t(y,u);i(b,E);var w=n(b,c);if(g&&(w.vs=r.flatten([g,w.vs,p],!0),s.predecessors(g).length)){var x=s.node(s.predecessors(g)[0]),C=s.node(s.predecessors(p)[0]);r.has(w,"barycenter")||(w.barycenter=0,w.weight=0),w.barycenter=(w.barycenter*w.weight+x.order+C.order)/(w.weight+2),w.weight+=2}return w}function i(s,l){r.forEach(s,function(u){u.vs=r.flatten(u.vs.map(function(c){return l[c]?l[c].vs:c}),!0)})}function o(s,l){r.isUndefined(s.barycenter)?(s.barycenter=l.barycenter,s.weight=l.weight):(s.barycenter=(s.barycenter*s.weight+l.barycenter*l.weight)/(s.weight+l.weight),s.weight+=l.weight)}return Wy}var Uy,C2;function QG(){if(C2)return Uy;C2=1;var r=qr(),e=xn().Graph;Uy=t;function t(a,i,o){var s=n(a),l=new e({compound:!0}).setGraph({root:s}).setDefaultNodeLabel(function(u){return a.node(u)});return r.forEach(a.nodes(),function(u){var c=a.node(u),d=a.parent(u);(c.rank===i||c.minRank<=i&&i<=c.maxRank)&&(l.setNode(u),l.setParent(u,d||s),r.forEach(a[o](u),function(h){var g=h.v===u?h.w:h.v,p=l.edge(g,u),E=r.isUndefined(p)?0:p.weight;l.setEdge(g,u,{weight:a.edge(h).weight+E})}),r.has(c,"minRank")&&l.setNode(u,{borderLeft:c.borderLeft[i],borderRight:c.borderRight[i]}))}),l}function n(a){for(var i;a.hasNode(i=r.uniqueId("_root")););return i}return Uy}var Hy,_2;function JG(){if(_2)return Hy;_2=1;var r=qr();Hy=e;function e(t,n,a){var i={},o;r.forEach(a,function(s){for(var l=t.parent(s),u,c;l;){if(u=t.parent(l),u?(c=i[u],i[u]=l):(c=o,o=l),c&&c!==l){n.setEdge(c,l);return}l=u}})}return Hy}var Ky,S2;function eW(){if(S2)return Ky;S2=1;var r=qr(),e=HG(),t=KG(),n=XG(),a=QG(),i=JG(),o=xn().Graph,s=$t();Ky=l;function l(h){var g=s.maxRank(h),p=u(h,r.range(1,g+1),"inEdges"),E=u(h,r.range(g-1,-1,-1),"outEdges"),y=e(h);d(h,y);for(var b=Number.POSITIVE_INFINITY,w,x=0,C=0;C<4;++x,++C){c(x%2?p:E,x%4>=2),y=s.buildLayerMatrix(h);var T=t(h,y);T<b&&(C=0,w=r.cloneDeep(y),b=T)}d(h,w)}function u(h,g,p){return r.map(g,function(E){return a(h,E,p)})}function c(h,g){var p=new o;r.forEach(h,function(E){var y=E.graph().root,b=n(E,y,p,g);r.forEach(b.vs,function(w,x){E.node(w).order=x}),i(E,p,b.vs)})}function d(h,g){r.forEach(g,function(p){r.forEach(p,function(E,y){h.node(E).order=y})})}return Ky}var jy,T2;function rW(){if(T2)return jy;T2=1;var r=qr(),e=xn().Graph,t=$t();jy={positionX:p,findType1Conflicts:n,findType2Conflicts:a,addConflict:o,hasConflict:s,verticalAlignment:l,horizontalCompaction:u,alignCoordinates:h,findSmallestWidthAlignment:d,balance:g};function n(b,w){var x={};function C(T,S){var _=0,A=0,P=T.length,I=r.last(S);return r.forEach(S,function(D,k){var M=i(b,D),N=M?b.node(M).order:P;(M||D===I)&&(r.forEach(S.slice(A,k+1),function(z){r.forEach(b.predecessors(z),function($){var q=b.node($),V=q.order;(V<_||N<V)&&!(q.dummy&&b.node(z).dummy)&&o(x,$,z)})}),A=k+1,_=N)}),S}return r.reduce(w,C),x}function a(b,w){var x={};function C(S,_,A,P,I){var D;r.forEach(r.range(_,A),function(k){D=S[k],b.node(D).dummy&&r.forEach(b.predecessors(D),function(M){var N=b.node(M);N.dummy&&(N.order<P||N.order>I)&&o(x,M,D)})})}function T(S,_){var A=-1,P,I=0;return r.forEach(_,function(D,k){if(b.node(D).dummy==="border"){var M=b.predecessors(D);M.length&&(P=b.node(M[0]).order,C(_,I,k,A,P),I=k,A=P)}C(_,I,_.length,P,S.length)}),_}return r.reduce(w,T),x}function i(b,w){if(b.node(w).dummy)return r.find(b.predecessors(w),function(x){return b.node(x).dummy})}function o(b,w,x){if(w>x){var C=w;w=x,x=C}var T=b[w];T||(b[w]=T={}),T[x]=!0}function s(b,w,x){if(w>x){var C=w;w=x,x=C}return r.has(b[w],x)}function l(b,w,x,C){var T={},S={},_={};return r.forEach(w,function(A){r.forEach(A,function(P,I){T[P]=P,S[P]=P,_[P]=I})}),r.forEach(w,function(A){var P=-1;r.forEach(A,function(I){var D=C(I);if(D.length){D=r.sortBy(D,function($){return _[$]});for(var k=(D.length-1)/2,M=Math.floor(k),N=Math.ceil(k);M<=N;++M){var z=D[M];S[I]===I&&P<_[z]&&!s(x,I,z)&&(S[z]=I,S[I]=T[I]=T[z],P=_[z])}}})}),{root:T,align:S}}function u(b,w,x,C,T){var S={},_=c(b,w,x,T),A=T?"borderLeft":"borderRight";function P(k,M){for(var N=_.nodes(),z=N.pop(),$={};z;)$[z]?k(z):($[z]=!0,N.push(z),N=N.concat(M(z))),z=N.pop()}function I(k){S[k]=_.inEdges(k).reduce(function(M,N){return Math.max(M,S[N.v]+_.edge(N))},0)}function D(k){var M=_.outEdges(k).reduce(function(z,$){return Math.min(z,S[$.w]-_.edge($))},Number.POSITIVE_INFINITY),N=b.node(k);M!==Number.POSITIVE_INFINITY&&N.borderType!==A&&(S[k]=Math.max(S[k],M))}return P(I,_.predecessors.bind(_)),P(D,_.successors.bind(_)),r.forEach(C,function(k){S[k]=S[x[k]]}),S}function c(b,w,x,C){var T=new e,S=b.graph(),_=E(S.nodesep,S.edgesep,C);return r.forEach(w,function(A){var P;r.forEach(A,function(I){var D=x[I];if(T.setNode(D),P){var k=x[P],M=T.edge(k,D);T.setEdge(k,D,Math.max(_(b,I,P),M||0))}P=I})}),T}function d(b,w){return r.minBy(r.values(w),function(x){var C=Number.NEGATIVE_INFINITY,T=Number.POSITIVE_INFINITY;return r.forIn(x,function(S,_){var A=y(b,_)/2;C=Math.max(S+A,C),T=Math.min(S-A,T)}),C-T})}function h(b,w){var x=r.values(w),C=r.min(x),T=r.max(x);r.forEach(["u","d"],function(S){r.forEach(["l","r"],function(_){var A=S+_,P=b[A],I;if(P!==w){var D=r.values(P);I=_==="l"?C-r.min(D):T-r.max(D),I&&(b[A]=r.mapValues(P,function(k){return k+I}))}})})}function g(b,w){return r.mapValues(b.ul,function(x,C){if(w)return b[w.toLowerCase()][C];var T=r.sortBy(r.map(b,C));return(T[1]+T[2])/2})}function p(b){var w=t.buildLayerMatrix(b),x=r.merge(n(b,w),a(b,w)),C={},T;r.forEach(["u","d"],function(_){T=_==="u"?w:r.values(w).reverse(),r.forEach(["l","r"],function(A){A==="r"&&(T=r.map(T,function(k){return r.values(k).reverse()}));var P=(_==="u"?b.predecessors:b.successors).bind(b),I=l(b,T,x,P),D=u(b,T,I.root,I.align,A==="r");A==="r"&&(D=r.mapValues(D,function(k){return-k})),C[_+A]=D})});var S=d(b,C);return h(C,S),g(C,b.graph().align)}function E(b,w,x){return function(C,T,S){var _=C.node(T),A=C.node(S),P=0,I;if(P+=_.width/2,r.has(_,"labelpos"))switch(_.labelpos.toLowerCase()){case"l":I=-_.width/2;break;case"r":I=_.width/2;break}if(I&&(P+=x?I:-I),I=0,P+=(_.dummy?w:b)/2,P+=(A.dummy?w:b)/2,P+=A.width/2,r.has(A,"labelpos"))switch(A.labelpos.toLowerCase()){case"l":I=A.width/2;break;case"r":I=-A.width/2;break}return I&&(P+=x?I:-I),I=0,P}}function y(b,w){return b.node(w).width}return jy}var Yy,R2;function tW(){if(R2)return Yy;R2=1;var r=qr(),e=$t(),t=rW().positionX;Yy=n;function n(i){i=e.asNonCompoundGraph(i),a(i),r.forEach(t(i),function(o,s){i.node(s).x=o})}function a(i){var o=e.buildLayerMatrix(i),s=i.graph().ranksep,l=0;r.forEach(o,function(u){var c=r.max(r.map(u,function(d){return i.node(d).height}));r.forEach(u,function(d){i.node(d).y=l+c/2}),l+=c+s})}return Yy}var Zy,A2;function nW(){if(A2)return Zy;A2=1;var r=qr(),e=NG(),t=FG(),n=$G(),a=$t().normalizeRanks,i=VG(),o=$t().removeEmptyRanks,s=GG(),l=WG(),u=UG(),c=eW(),d=tW(),h=$t(),g=xn().Graph;Zy=p;function p(W,G){var Y=G&&G.debugTiming?h.time:h.notime;Y("layout",function(){var re=Y(" buildLayoutGraph",function(){return P(W)});Y(" runLayout",function(){E(re,Y)}),Y(" updateInputGraph",function(){y(W,re)})})}function E(W,G){G(" makeSpaceForEdgeLabels",function(){I(W)}),G(" removeSelfEdges",function(){Z(W)}),G(" acyclic",function(){e.run(W)}),G(" nestingGraph.run",function(){s.run(W)}),G(" rank",function(){n(h.asNonCompoundGraph(W))}),G(" injectEdgeLabelProxies",function(){D(W)}),G(" removeEmptyRanks",function(){o(W)}),G(" nestingGraph.cleanup",function(){s.cleanup(W)}),G(" normalizeRanks",function(){a(W)}),G(" assignRankMinMax",function(){k(W)}),G(" removeEdgeLabelProxies",function(){M(W)}),G(" normalize.run",function(){t.run(W)}),G(" parentDummyChains",function(){i(W)}),G(" addBorderSegments",function(){l(W)}),G(" order",function(){c(W)}),G(" insertSelfEdges",function(){K(W)}),G(" adjustCoordinateSystem",function(){u.adjust(W)}),G(" position",function(){d(W)}),G(" positionSelfEdges",function(){j(W)}),G(" removeBorderNodes",function(){V(W)}),G(" normalize.undo",function(){t.undo(W)}),G(" fixupEdgeLabelCoords",function(){$(W)}),G(" undoCoordinateSystem",function(){u.undo(W)}),G(" translateGraph",function(){N(W)}),G(" assignNodeIntersects",function(){z(W)}),G(" reversePoints",function(){q(W)}),G(" acyclic.undo",function(){e.undo(W)})}function y(W,G){r.forEach(W.nodes(),function(Y){var re=W.node(Y),de=G.node(Y);re&&(re.x=de.x,re.y=de.y,G.children(Y).length&&(re.width=de.width,re.height=de.height))}),r.forEach(W.edges(),function(Y){var re=W.edge(Y),de=G.edge(Y);re.points=de.points,r.has(de,"x")&&(re.x=de.x,re.y=de.y)}),W.graph().width=G.graph().width,W.graph().height=G.graph().height}var b=["nodesep","edgesep","ranksep","marginx","marginy"],w={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},x=["acyclicer","ranker","rankdir","align"],C=["width","height"],T={width:0,height:0},S=["minlen","weight","width","height","labeloffset"],_={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},A=["labelpos"];function P(W){var G=new g({multigraph:!0,compound:!0}),Y=le(W.graph());return G.setGraph(r.merge({},w,ee(Y,b),r.pick(Y,x))),r.forEach(W.nodes(),function(re){var de=le(W.node(re));G.setNode(re,r.defaults(ee(de,C),T)),G.setParent(re,W.parent(re))}),r.forEach(W.edges(),function(re){var de=le(W.edge(re));G.setEdge(re,r.merge({},_,ee(de,S),r.pick(de,A)))}),G}function I(W){var G=W.graph();G.ranksep/=2,r.forEach(W.edges(),function(Y){var re=W.edge(Y);re.minlen*=2,re.labelpos.toLowerCase()!=="c"&&(G.rankdir==="TB"||G.rankdir==="BT"?re.width+=re.labeloffset:re.height+=re.labeloffset)})}function D(W){r.forEach(W.edges(),function(G){var Y=W.edge(G);if(Y.width&&Y.height){var re=W.node(G.v),de=W.node(G.w),se={rank:(de.rank-re.rank)/2+re.rank,e:G};h.addDummyNode(W,"edge-proxy",se,"_ep")}})}function k(W){var G=0;r.forEach(W.nodes(),function(Y){var re=W.node(Y);re.borderTop&&(re.minRank=W.node(re.borderTop).rank,re.maxRank=W.node(re.borderBottom).rank,G=r.max(G,re.maxRank))}),W.graph().maxRank=G}function M(W){r.forEach(W.nodes(),function(G){var Y=W.node(G);Y.dummy==="edge-proxy"&&(W.edge(Y.e).labelRank=Y.rank,W.removeNode(G))})}function N(W){var G=Number.POSITIVE_INFINITY,Y=0,re=Number.POSITIVE_INFINITY,de=0,se=W.graph(),X=se.marginx||0,Q=se.marginy||0;function ae(te){var ce=te.x,_e=te.y,ve=te.width,U=te.height;G=Math.min(G,ce-ve/2),Y=Math.max(Y,ce+ve/2),re=Math.min(re,_e-U/2),de=Math.max(de,_e+U/2)}r.forEach(W.nodes(),function(te){ae(W.node(te))}),r.forEach(W.edges(),function(te){var ce=W.edge(te);r.has(ce,"x")&&ae(ce)}),G-=X,re-=Q,r.forEach(W.nodes(),function(te){var ce=W.node(te);ce.x-=G,ce.y-=re}),r.forEach(W.edges(),function(te){var ce=W.edge(te);r.forEach(ce.points,function(_e){_e.x-=G,_e.y-=re}),r.has(ce,"x")&&(ce.x-=G),r.has(ce,"y")&&(ce.y-=re)}),se.width=Y-G+X,se.height=de-re+Q}function z(W){r.forEach(W.edges(),function(G){var Y=W.edge(G),re=W.node(G.v),de=W.node(G.w),se,X;Y.points?(se=Y.points[0],X=Y.points[Y.points.length-1]):(Y.points=[],se=de,X=re),Y.points.unshift(h.intersectRect(re,se)),Y.points.push(h.intersectRect(de,X))})}function $(W){r.forEach(W.edges(),function(G){var Y=W.edge(G);if(r.has(Y,"x"))switch((Y.labelpos==="l"||Y.labelpos==="r")&&(Y.width-=Y.labeloffset),Y.labelpos){case"l":Y.x-=Y.width/2+Y.labeloffset;break;case"r":Y.x+=Y.width/2+Y.labeloffset;break}})}function q(W){r.forEach(W.edges(),function(G){var Y=W.edge(G);Y.reversed&&Y.points.reverse()})}function V(W){r.forEach(W.nodes(),function(G){if(W.children(G).length){var Y=W.node(G),re=W.node(Y.borderTop),de=W.node(Y.borderBottom),se=W.node(r.last(Y.borderLeft)),X=W.node(r.last(Y.borderRight));Y.width=Math.abs(X.x-se.x),Y.height=Math.abs(de.y-re.y),Y.x=se.x+Y.width/2,Y.y=re.y+Y.height/2}}),r.forEach(W.nodes(),function(G){W.node(G).dummy==="border"&&W.removeNode(G)})}function Z(W){r.forEach(W.edges(),function(G){if(G.v===G.w){var Y=W.node(G.v);Y.selfEdges||(Y.selfEdges=[]),Y.selfEdges.push({e:G,label:W.edge(G)}),W.removeEdge(G)}})}function K(W){var G=h.buildLayerMatrix(W);r.forEach(G,function(Y){var re=0;r.forEach(Y,function(de,se){var X=W.node(de);X.order=se+re,r.forEach(X.selfEdges,function(Q){h.addDummyNode(W,"selfedge",{width:Q.label.width,height:Q.label.height,rank:X.rank,order:se+ ++re,e:Q.e,label:Q.label},"_se")}),delete X.selfEdges})})}function j(W){r.forEach(W.nodes(),function(G){var Y=W.node(G);if(Y.dummy==="selfedge"){var re=W.node(Y.e.v),de=re.x+re.width/2,se=re.y,X=Y.x-de,Q=re.height/2;W.setEdge(Y.e,Y.label),W.removeNode(G),Y.label.points=[{x:de+2*X/3,y:se-Q},{x:de+5*X/6,y:se-Q},{x:de+X,y:se},{x:de+5*X/6,y:se+Q},{x:de+2*X/3,y:se+Q}],Y.label.x=Y.x,Y.label.y=Y.y}})}function ee(W,G){return r.mapValues(r.pick(W,G),Number)}function le(W){var G={};return r.forEach(W,function(Y,re){G[re.toLowerCase()]=Y}),G}return Zy}var Xy,P2;function aW(){if(P2)return Xy;P2=1;var r=qr(),e=$t(),t=xn().Graph;Xy={debugOrdering:n};function n(a){var i=e.buildLayerMatrix(a),o=new t({compound:!0,multigraph:!0}).setGraph({});return r.forEach(a.nodes(),function(s){o.setNode(s,{label:s}),o.setParent(s,"layer"+a.node(s).rank)}),r.forEach(a.edges(),function(s){o.setEdge(s.v,s.w,{},s.name)}),r.forEach(i,function(s,l){var u="layer"+l;o.setNode(u,{rank:"same"}),r.reduce(s,function(c,d){return o.setEdge(c,d,{style:"invis"}),d})}),o}return Xy}var Qy,I2;function iW(){return I2||(I2=1,Qy="0.8.5"),Qy}var Jy,D2;function oW(){return D2||(D2=1,Jy={graphlib:xn(),layout:nW(),debug:aW(),util:{time:$t().time,notime:$t().notime},version:iW()}),Jy}var sW=zu.exports,B2;function uW(){return B2||(B2=1,(function(r,e){(function(n,a){r.exports=a(oW())})(sW,function(t){return(function(n){var a={};function i(o){if(a[o])return a[o].exports;var s=a[o]={i:o,l:!1,exports:{}};return n[o].call(s.exports,s,s.exports,i),s.l=!0,s.exports}return i.m=n,i.c=a,i.d=function(o,s,l){i.o(o,s)||Object.defineProperty(o,s,{enumerable:!0,get:l})},i.r=function(o){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(o,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(o,"__esModule",{value:!0})},i.t=function(o,s){if(s&1&&(o=i(o)),s&8||s&4&&typeof o=="object"&&o&&o.__esModule)return o;var l=Object.create(null);if(i.r(l),Object.defineProperty(l,"default",{enumerable:!0,value:o}),s&2&&typeof o!="string")for(var u in o)i.d(l,u,(function(c){return o[c]}).bind(null,u));return l},i.n=function(o){var s=o&&o.__esModule?function(){return o.default}:function(){return o};return i.d(s,"a",s),s},i.o=function(o,s){return Object.prototype.hasOwnProperty.call(o,s)},i.p="",i(i.s=0)})([(function(n,a,i){var o=i(1),s=function(u){u&&u("layout","dagre",o)};typeof cytoscape<"u"&&s(cytoscape),n.exports=s}),(function(n,a,i){function o(h){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?o=function(p){return typeof p}:o=function(p){return p&&typeof Symbol=="function"&&p.constructor===Symbol&&p!==Symbol.prototype?"symbol":typeof p},o(h)}var s=function(g){return typeof g=="function"},l=i(2),u=i(3),c=i(4);function d(h){this.options=u({},l,h)}d.prototype.run=function(){var h=this.options,g=this,p=h.cy,E=h.eles,y=function(j,ee){return s(ee)?ee.apply(j,[j]):ee},b=h.boundingBox||{x1:0,y1:0,w:p.width(),h:p.height()};b.x2===void 0&&(b.x2=b.x1+b.w),b.w===void 0&&(b.w=b.x2-b.x1),b.y2===void 0&&(b.y2=b.y1+b.h),b.h===void 0&&(b.h=b.y2-b.y1);var w=new c.graphlib.Graph({multigraph:!0,compound:!0}),x={},C=function(j,ee){ee!=null&&(x[j]=ee)};C("nodesep",h.nodeSep),C("edgesep",h.edgeSep),C("ranksep",h.rankSep),C("rankdir",h.rankDir),C("align",h.align),C("ranker",h.ranker),C("acyclicer",h.acyclicer),w.setGraph(x),w.setDefaultEdgeLabel(function(){return{}}),w.setDefaultNodeLabel(function(){return{}});var T=E.nodes();s(h.sort)&&(T=T.sort(h.sort));for(var S=0;S<T.length;S++){var _=T[S],A=_.layoutDimensions(h);w.setNode(_.id(),{width:A.w,height:A.h,name:_.id()})}for(var P=0;P<T.length;P++){var I=T[P];I.isChild()&&w.setParent(I.id(),I.parent().id())}var D=E.edges().stdFilter(function(K){return!K.source().isParent()&&!K.target().isParent()});s(h.sort)&&(D=D.sort(h.sort));for(var k=0;k<D.length;k++){var M=D[k];w.setEdge(M.source().id(),M.target().id(),{minlen:y(M,h.minLen),weight:y(M,h.edgeWeight),name:M.id()},M.id())}c.layout(w);for(var N=w.nodes(),z=0;z<N.length;z++){var $=N[z],q=w.node($);p.getElementById($).scratch().dagre=q}var V;h.boundingBox?(V={x1:1/0,x2:-1/0,y1:1/0,y2:-1/0},T.forEach(function(K){var j=K.scratch().dagre;V.x1=Math.min(V.x1,j.x),V.x2=Math.max(V.x2,j.x),V.y1=Math.min(V.y1,j.y),V.y2=Math.max(V.y2,j.y)}),V.w=V.x2-V.x1,V.h=V.y2-V.y1):V=b;var Z=function(j){if(h.boundingBox){var ee=V.w===0?0:(j.x-V.x1)/V.w,le=V.h===0?0:(j.y-V.y1)/V.h;return{x:b.x1+ee*b.w,y:b.y1+le*b.h}}else return j};return T.layoutPositions(g,h,function(K){K=o(K)==="object"?K:this;var j=K.scratch().dagre;return Z({x:j.x,y:j.y})}),this},n.exports=d}),(function(n,a){var i={nodeSep:void 0,edgeSep:void 0,rankSep:void 0,rankDir:void 0,align:void 0,acyclicer:void 0,ranker:void 0,minLen:function(s){return 1},edgeWeight:function(s){return 1},fit:!0,padding:30,spacingFactor:void 0,nodeDimensionsIncludeLabels:!1,animate:!1,animateFilter:function(s,l){return!0},animationDuration:500,animationEasing:void 0,boundingBox:void 0,transform:function(s,l){return l},ready:function(){},sort:void 0,stop:function(){}};n.exports=i}),(function(n,a){n.exports=Object.assign!=null?Object.assign.bind(Object):function(i){for(var o=arguments.length,s=new Array(o>1?o-1:0),l=1;l<o;l++)s[l-1]=arguments[l];return s.forEach(function(u){Object.keys(u).forEach(function(c){return i[c]=u[c]})}),i}}),(function(n,a){n.exports=t})])})})(zu)),zu.exports}var lW=uW();const fW=Cl(lW);var $u={exports:{}},em,M2;function cW(){if(M2)return em;M2=1;var r="Expected a function",e="__lodash_hash_undefined__",t="[object Function]",n="[object GeneratorFunction]",a=/[\\^$.*+?()[\]{}|]/g,i=/^\[object .+?Constructor\]$/,o=typeof Et=="object"&&Et&&Et.Object===Object&&Et,s=typeof self=="object"&&self&&self.Object===Object&&self,l=o||s||Function("return this")();function u(ve,U){return ve==null?void 0:ve[U]}function c(ve){var U=!1;if(ve!=null&&typeof ve.toString!="function")try{U=!!(ve+"")}catch{}return U}var d=Array.prototype,h=Function.prototype,g=Object.prototype,p=l["__core-js_shared__"],E=(function(){var ve=/[^.]+$/.exec(p&&p.keys&&p.keys.IE_PROTO||"");return ve?"Symbol(src)_1."+ve:""})(),y=h.toString,b=g.hasOwnProperty,w=g.toString,x=RegExp("^"+y.call(b).replace(a,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),C=d.splice,T=de(l,"Map"),S=de(Object,"create");function _(ve){var U=-1,fe=ve?ve.length:0;for(this.clear();++U<fe;){var xe=ve[U];this.set(xe[0],xe[1])}}function A(){this.__data__=S?S(null):{}}function P(ve){return this.has(ve)&&delete this.__data__[ve]}function I(ve){var U=this.__data__;if(S){var fe=U[ve];return fe===e?void 0:fe}return b.call(U,ve)?U[ve]:void 0}function D(ve){var U=this.__data__;return S?U[ve]!==void 0:b.call(U,ve)}function k(ve,U){var fe=this.__data__;return fe[ve]=S&&U===void 0?e:U,this}_.prototype.clear=A,_.prototype.delete=P,_.prototype.get=I,_.prototype.has=D,_.prototype.set=k;function M(ve){var U=-1,fe=ve?ve.length:0;for(this.clear();++U<fe;){var xe=ve[U];this.set(xe[0],xe[1])}}function N(){this.__data__=[]}function z(ve){var U=this.__data__,fe=G(U,ve);if(fe<0)return!1;var xe=U.length-1;return fe==xe?U.pop():C.call(U,fe,1),!0}function $(ve){var U=this.__data__,fe=G(U,ve);return fe<0?void 0:U[fe][1]}function q(ve){return G(this.__data__,ve)>-1}function V(ve,U){var fe=this.__data__,xe=G(fe,ve);return xe<0?fe.push([ve,U]):fe[xe][1]=U,this}M.prototype.clear=N,M.prototype.delete=z,M.prototype.get=$,M.prototype.has=q,M.prototype.set=V;function Z(ve){var U=-1,fe=ve?ve.length:0;for(this.clear();++U<fe;){var xe=ve[U];this.set(xe[0],xe[1])}}function K(){this.__data__={hash:new _,map:new(T||M),string:new _}}function j(ve){return re(this,ve).delete(ve)}function ee(ve){return re(this,ve).get(ve)}function le(ve){return re(this,ve).has(ve)}function W(ve,U){return re(this,ve).set(ve,U),this}Z.prototype.clear=K,Z.prototype.delete=j,Z.prototype.get=ee,Z.prototype.has=le,Z.prototype.set=W;function G(ve,U){for(var fe=ve.length;fe--;)if(te(ve[fe][0],U))return fe;return-1}function Y(ve){if(!_e(ve)||X(ve))return!1;var U=ce(ve)||c(ve)?x:i;return U.test(Q(ve))}function re(ve,U){var fe=ve.__data__;return se(U)?fe[typeof U=="string"?"string":"hash"]:fe.map}function de(ve,U){var fe=u(ve,U);return Y(fe)?fe:void 0}function se(ve){var U=typeof ve;return U=="string"||U=="number"||U=="symbol"||U=="boolean"?ve!=="__proto__":ve===null}function X(ve){return!!E&&E in ve}function Q(ve){if(ve!=null){try{return y.call(ve)}catch{}try{return ve+""}catch{}}return""}function ae(ve,U){if(typeof ve!="function"||U&&typeof U!="function")throw new TypeError(r);var fe=function(){var xe=arguments,ge=U?U.apply(this,xe):xe[0],be=fe.cache;if(be.has(ge))return be.get(ge);var Ae=ve.apply(this,xe);return fe.cache=be.set(ge,Ae),Ae};return fe.cache=new(ae.Cache||Z),fe}ae.Cache=Z;function te(ve,U){return ve===U||ve!==ve&&U!==U}function ce(ve){var U=_e(ve)?w.call(ve):"";return U==t||U==n}function _e(ve){var U=typeof ve;return!!ve&&(U=="object"||U=="function")}return em=ae,em}var rm,k2;function dW(){if(k2)return rm;k2=1;var r="Expected a function",e=NaN,t="[object Symbol]",n=/^\s+|\s+$/g,a=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,o=/^0o[0-7]+$/i,s=parseInt,l=typeof Et=="object"&&Et&&Et.Object===Object&&Et,u=typeof self=="object"&&self&&self.Object===Object&&self,c=l||u||Function("return this")(),d=Object.prototype,h=d.toString,g=Math.max,p=Math.min,E=function(){return c.Date.now()};function y(S,_,A){var P,I,D,k,M,N,z=0,$=!1,q=!1,V=!0;if(typeof S!="function")throw new TypeError(r);_=T(_)||0,w(A)&&($=!!A.leading,q="maxWait"in A,D=q?g(T(A.maxWait)||0,_):D,V="trailing"in A?!!A.trailing:V);function Z(de){var se=P,X=I;return P=I=void 0,z=de,k=S.apply(X,se),k}function K(de){return z=de,M=setTimeout(le,_),$?Z(de):k}function j(de){var se=de-N,X=de-z,Q=_-se;return q?p(Q,D-X):Q}function ee(de){var se=de-N,X=de-z;return N===void 0||se>=_||se<0||q&&X>=D}function le(){var de=E();if(ee(de))return W(de);M=setTimeout(le,j(de))}function W(de){return M=void 0,V&&P?Z(de):(P=I=void 0,k)}function G(){M!==void 0&&clearTimeout(M),z=0,P=N=I=M=void 0}function Y(){return M===void 0?k:W(E())}function re(){var de=E(),se=ee(de);if(P=arguments,I=this,N=de,se){if(M===void 0)return K(N);if(q)return M=setTimeout(le,_),Z(N)}return M===void 0&&(M=setTimeout(le,_)),k}return re.cancel=G,re.flush=Y,re}function b(S,_,A){var P=!0,I=!0;if(typeof S!="function")throw new TypeError(r);return w(A)&&(P="leading"in A?!!A.leading:P,I="trailing"in A?!!A.trailing:I),y(S,_,{leading:P,maxWait:_,trailing:I})}function w(S){var _=typeof S;return!!S&&(_=="object"||_=="function")}function x(S){return!!S&&typeof S=="object"}function C(S){return typeof S=="symbol"||x(S)&&h.call(S)==t}function T(S){if(typeof S=="number")return S;if(C(S))return e;if(w(S)){var _=typeof S.valueOf=="function"?S.valueOf():S;S=w(_)?_+"":_}if(typeof S!="string")return S===0?S:+S;S=S.replace(n,"");var A=i.test(S);return A||o.test(S)?s(S.slice(2),A?2:8):a.test(S)?e:+S}return rm=b,rm}var vW=$u.exports,O2;function hW(){return O2||(O2=1,(function(r,e){(function(n,a){r.exports=a(cW(),dW())})(vW,function(t,n){return(function(a){var i={};function o(s){if(i[s])return i[s].exports;var l=i[s]={i:s,l:!1,exports:{}};return a[s].call(l.exports,l,l.exports,o),l.l=!0,l.exports}return o.m=a,o.c=i,o.i=function(s){return s},o.d=function(s,l,u){o.o(s,l)||Object.defineProperty(s,l,{configurable:!1,enumerable:!0,get:u})},o.n=function(s){var l=s&&s.__esModule?function(){return s.default}:function(){return s};return o.d(l,"a",l),l},o.o=function(s,l){return Object.prototype.hasOwnProperty.call(s,l)},o.p="",o(o.s=12)})([(function(a,i,o){a.exports=Object.assign!=null?Object.assign.bind(Object):function(s){for(var l=arguments.length,u=Array(l>1?l-1:0),c=1;c<l;c++)u[c-1]=arguments[c];return u.filter(function(d){return d!=null}).forEach(function(d){Object.keys(d).forEach(function(h){return s[h]=d[h]})}),s}}),(function(a,i,o){var s=o(10),l=o(0);a.exports=function(u){var c=this;return new s(l({cy:c},u))}}),(function(a,i,o){function s(){if(this.saveGestureState(),this.cy.zoomingEnabled(!1).panningEnabled(!1).boxSelectionEnabled(!1),this.options.disableBrowserGestures){var c=this.windowListenerOptions;window.addEventListener("touchstart",this.preventDefault,c),window.addEventListener("touchmove",this.preventDefault,c),window.addEventListener("wheel",this.preventDefault,c)}return this}function l(){if(this.cy.zoomingEnabled(this.lastZoomingEnabled).panningEnabled(this.lastPanningEnabled).boxSelectionEnabled(this.lastBoxSelectionEnabled),this.options.disableBrowserGestures){var c=this.windowListenerOptions;window.removeEventListener("touchstart",this.preventDefault,c),window.removeEventListener("touchmove",this.preventDefault,c),window.removeEventListener("wheel",this.preventDefault,c)}return this}function u(){var c=this.cy;return this.lastPanningEnabled=c.panningEnabled(),this.lastZoomingEnabled=c.zoomingEnabled(),this.lastBoxSelectionEnabled=c.boxSelectionEnabled(),this}a.exports={disableGestures:s,resetGestures:l,saveGestureState:u}}),(function(a,i,o){function s(){var l=this,u=this.cy,c=this.options;return this.addListener(u,"drag",function(){return l.grabbingNode=!0}),this.addListener(u,"free",function(){return l.grabbingNode=!1}),this.addListener(u,"tapstart","node",function(d){var h=d.target;l.drawMode&&l.start(h)}),this.addListener(u,"tapdrag",function(d){l.update(d.position)}),this.addListener(u,"tapdragover","node",function(d){c.snap||l.preview(d.target)}),this.addListener(u,"tapdragout","node",function(d){c.snap||l.unpreview(d.target)}),this.addListener(u,"tapend",function(){l.stop()}),this}a.exports={addCytoscapeListeners:s}}),(function(a,i,o){var s={canConnect:function(u,c){return!u.same(c)},edgeParams:function(u,c){return{}},hoverDelay:150,snap:!0,snapThreshold:50,snapFrequency:15,noEdgeEventsInDraw:!0,disableBrowserGestures:!0};a.exports=s}),(function(a,i,o){function s(c){var d=this.cy;return this.drawMode=c??!this.drawMode,this.drawMode?(this.prevUngrabifyState=d.autoungrabify(),d.autoungrabify(!0),this.emit("drawon")):(d.autoungrabify(this.prevUngrabifyState),this.emit("drawoff")),this}function l(){return this.toggleDrawMode(!0)}function u(){return this.toggleDrawMode(!1)}a.exports={toggleDrawMode:s,enableDrawMode:l,disableDrawMode:u}}),(function(a,i,o){var s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(b){return typeof b}:function(b){return b&&typeof Symbol=="function"&&b.constructor===Symbol&&b!==Symbol.prototype?"symbol":typeof b},l=o(0),u=function(w){return(typeof w>"u"?"undefined":s(w))===s("")},c=function(w){return(typeof w>"u"?"undefined":s(w))===s([])&&w.length!=null};function d(b,w,x){var C={};return l(C,w,b),l(C.data,w.data,b.data),u(w.classes)?C.classes=w.classes+" "+x:c(w.classes)?C.classes=w.classes.join(" ")+" "+x:C.classes=x,C}function h(){var b=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,w=this.cy;this.options;var x=this.presumptiveTargets,C=this.previewEles,T=this.active,S=this.sourceNode,_=this.targetNode,A=b?"eh-preview":"",P=w.collection(),I=this.canConnect(_);if(T&&I){if(!_||_.size()===0){C.remove(),this.emit("cancel",this.mp(),S,x);return}if(!b){C.removeClass("eh-preview").style("events",""),this.emit("complete",this.mp(),S,_,C);return}var D=w.add(d({group:"edges",data:{source:S.id(),target:_.id()}},this.edgeParams(_),A));return P=P.merge(D),b?(this.previewEles=P,P.style("events","no")):(P.style("events",""),this.emit("complete",this.mp(),S,_,P)),this}}function g(){return this.makeEdges(!0),this}function p(){return this.previewEles.nonempty()&&this.previewEles.inside()}function E(){return this.previewShown()&&this.previewEles.remove(),this}function y(){var b=this,w=this.sourceNode,x=this.ghostNode,C=this.cy,T=this.mx,S=this.my,_=T,A=S,P=void 0,I=void 0;if(w)return(!x||x.length===0||x.removed())&&(I=this.ghostEles=C.collection(),C.batch(function(){x=b.ghostNode=C.add({group:"nodes",classes:"eh-ghost eh-ghost-node",position:{x:0,y:0}}),x.style({"background-color":"blue",width:1e-4,height:1e-4,opacity:0,events:"no"});var D={};P=C.add(l({},D,{group:"edges",data:l({},D.data,{source:w.id(),target:x.id()}),classes:"eh-ghost eh-ghost-edge"})),P.style({events:"no"})}),I.merge(x).merge(P)),x.position({x:_,y:A}),this}a.exports={makeEdges:h,makePreview:g,removePreview:E,previewShown:p,updateEdge:y}}),(function(a,i,o){function s(){return this.options.noEdgeEventsInDraw&&this.cy.edges().style("events","no"),this}function l(){return this.options.noEdgeEventsInDraw&&this.cy.edges().style("events",""),this}a.exports={disableEdgeEvents:s,enableEdgeEvents:l}}),(function(a,i,o){function s(){return this.enabled=!0,this.emit("enable"),this}function l(){return this.enabled=!1,this.emit("disable"),this}a.exports={enable:s,disable:l}}),(function(a,i,o){var s=o(13),l=Math.sqrt(2);function u(w){var x=this.previewEles,C=this.ghostEles,T=function(k){return x.anySame(k)},S=function(k){return C.anySame(k)},_=function(k){return T(k)||S(k)},A=this.enabled,P=this.active,I=this.grabbingNode;return A&&!P&&!I&&w!=null&&w.nonempty()&&!_(w)}function c(w){return this.canStartOn(w)&&this.drawMode}function d(w){return this.canStartOn(w)&&!this.drawMode}function h(w){var x=this;if(this.canStartOn(w)){this.active=!0,this.sourceNode=w,this.sourceNode.addClass("eh-source"),this.disableGestures(),this.disableEdgeEvents();var C=function(S){return S.id()};this.canConnect=s(function(T){return x.options.canConnect(x.sourceNode,T)},C),this.edgeParams=s(function(T){return x.options.edgeParams(x.sourceNode,T)},C),this.emit("start",this.hp(),w)}}function g(w){if(this.active){var x=w;return this.mx=x.x,this.my=x.y,this.updateEdge(),this.throttledSnap(),this}}function p(){if(!this.active||!this.options.snap)return!1;var w=this.cy,x=this.targetNode,C=this.options.snapThreshold,T=this.mp(),S=this.previewEles,_=this.ghostNode,A=function(G){return l*Math.max(G.outerWidth(),G.outerHeight())/2},P=function(G,Y,re,de){var se=re-G,X=de-Y;return se*se+X*X},I=function(G,Y){return P(G.x,G.y,Y.x,Y.y)},D=function(G){return I(G.position(),T)},k=function(G){var Y=A(G),re=Y+C;return re*re},M=function(G){return D(G)<=k(G)},N=function(G){var Y=G.position(),re=G.outerWidth()/2,de=G.outerHeight()/2,se=Y.x,X=Y.y,Q=T.x,ae=T.y,te=se-re,ce=se+re,_e=X-de,ve=X+de,U=te<=Q&&Q<=ce,fe=_e<=ae&&ae<=ve;if(U&&fe)return 0;if(U){var xe=ae-_e,ge=ae-ve;return Math.min(xe*xe,ge*ge)}else if(fe){var be=Q-te,Ae=Q-ce;return Math.min(be*be,Ae*Ae)}else return Q<te&&ae<_e?P(Q,ae,te,_e):Q>ce&&ae<_e?P(Q,ae,ce,_e):Q<te&&ae>ve?P(Q,ae,te,ve):P(Q,ae,ce,ve)},z=function(G,Y){return N(G)-N(Y)},$=z,q=!1,V=function(G){var Y=T,re=G.outerWidth(),de=re/2,se=G.outerHeight(),X=se/2,Q=G.position(),ae=Q.x-de,te=Q.x+de,ce=Q.y-X,_e=Q.y+X;return ae<=Y.x&&Y.x<=te&&ce<=Y.y&&Y.y<=_e},Z=function(G){return G.same(S)||G.same(_)},K=w.nodes(function(W){return!Z(W)&&M(W)}).sort($),j=!1;x.nonempty()&&!M(x)&&this.unpreview(x);for(var ee=0;ee<K.length;ee++){var le=K[ee];if(!(le.isParent()&&V(le))&&!(le.isChild()&&!V(le.parent()))&&(le.same(x)||this.preview(le,q))){j=!0;break}}return j}function E(w){var x=this,C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,T=this.options,S=this.sourceNode,_=this.ghostNode,A=this.ghostEles,P=this.presumptiveTargets,I=this.previewEles,D=this.active,k=S,M=w.same(_),N=!this.canConnect(w),z=w.same(this.targetNode);if(!D||M||N||z)return!1;this.targetNode.nonempty()&&this.unpreview(this.targetNode),clearTimeout(this.previewTimeout);var $=function(){x.targetNode=w,P.merge(w),w.addClass("eh-presumptive-target"),w.addClass("eh-target"),x.emit("hoverover",x.mp(),k,w),w.addClass("eh-preview"),A.addClass("eh-preview-active"),S.addClass("eh-preview-active"),w.addClass("eh-preview-active"),x.makePreview(),x.emit("previewon",x.mp(),k,w,I)};return C&&T.hoverDelay>0?this.previewTimeout=setTimeout($,T.hoverDelay):$(),!0}function y(w){if(this.active){var x=this.previewTimeout,C=this.sourceNode,T=this.previewEles,S=this.ghostEles,_=this.cy;clearTimeout(x),this.previewTimeout=null;var A=C;return w.removeClass("eh-preview eh-target eh-presumptive-target eh-preview-active"),S.removeClass("eh-preview-active"),C.removeClass("eh-preview-active"),this.targetNode=_.collection(),this.removePreview(A,w),this.emit("hoverout",this.mp(),A,w),this.emit("previewoff",this.mp(),A,w,T),this}}function b(){if(this.active){var w=this.sourceNode,x=this.targetNode,C=this.ghostEles,T=this.presumptiveTargets;return clearTimeout(this.previewTimeout),w.removeClass("eh-source eh-preview-active"),x.removeClass("eh-target eh-preview eh-hover eh-preview-active"),T.removeClass("eh-presumptive-target"),this.makeEdges(),C.remove(),this.clearCollections(),this.resetGestures(),this.enableEdgeEvents(),this.active=!1,this.emit("stop",this.mp(),w),this}}a.exports={start:h,update:g,preview:E,unpreview:y,stop:b,snap:p,canStartOn:u,canStartDrawModeOn:c,canStartNonDrawModeOn:d}}),(function(a,i,o){var s=o(4),l=o(0),u=o(14),c=o(2),d=o(3),h=o(5),g=o(6),p=o(8),E=o(9),y=o(11),b=o(7);function w(T){var S=T.cy;this.cy=S,this.listeners=[],this.enabled=!0,this.drawMode=!1,this.active=!1,this.grabbingNode=!1,this.clearCollections(),this.mx=0,this.my=0,this.options=l({},s,T),this.saveGestureState(),this.addListeners(),this.throttledSnap=u(this.snap.bind(this),1e3/T.snapFrequency),this.preventDefault=function(P){return P.preventDefault()},this.canConnect=function(){return!1};var _=!1;try{var A=Object.defineProperty({},"passive",{get:function(){_=!0}});window.addEventListener("test",null,A)}catch{}_?this.windowListenerOptions={capture:!0,passive:!1}:this.windowListenerOptions=!0}var x=w.prototype={},C=function(S){return l(x,S)};x.destroy=function(){this.removeListeners()},x.setOptions=function(T){l(this.options,T)},x.mp=function(){return{x:this.mx,y:this.my}},x.hp=function(){return{x:this.hx,y:this.hy}},x.clearCollections=function(){var T=this.cy;this.previewEles=T.collection(),this.ghostEles=T.collection(),this.ghostNode=T.collection(),this.sourceNode=T.collection(),this.targetNode=T.collection(),this.presumptiveTargets=T.collection()},[c,d,h,g,p,E,y,b].forEach(C),a.exports=w}),(function(a,i,o){var s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(E){return typeof E}:function(E){return E&&typeof Symbol=="function"&&E.constructor===Symbol&&E!==Symbol.prototype?"symbol":typeof E};function l(){var E=this;return this.addCytoscapeListeners(),this.addListener(this.cy,"destroy",function(){return E.destroy()}),this}function u(){for(var E=this.listeners.length-1;E>=0;E--){var y=this.listeners[E];this.removeListener(y.target,y.event,y.selector,y.callback,y.options)}return this}function c(E,y,b,w,x){return(typeof b>"u"?"undefined":s(b))!==s("")&&(w=b,x=w,b=null),x==null&&(x=!1),{target:E,event:y,selector:b,callback:w,options:x}}function d(E){return E instanceof Element}function h(E,y,b,w,x){var C=c(E,y,b,w,x);return this.listeners.push(C),d(C.target)?C.target.addEventListener(C.event,C.callback,C.options):C.selector?C.target.addListener(C.event,C.selector,C.callback,C.options):C.target.addListener(C.event,C.callback,C.options),this}function g(E,y,b,w,x){for(var C=c(E,y,b,w,x),T=this.listeners.length-1;T>=0;T--){var S=this.listeners[T];if(C.target===S.target&&C.event===S.event&&(C.selector==null||C.selector===S.selector)&&(C.callback==null||C.callback===S.callback)){this.listeners.splice(T,1),d(C.target)?C.target.removeEventListener(C.event,C.callback,C.options):C.selector?C.target.removeListener(C.event,C.selector,C.callback,C.options):C.target.removeListener(C.event,C.callback,C.options);break}}return this}function p(E,y){for(var b=this.cy,w=arguments.length,x=Array(w>2?w-2:0),C=2;C<w;C++)x[C-2]=arguments[C];return b.emit({type:"eh"+E,position:y},x),this}a.exports={addListener:h,addListeners:l,removeListener:g,removeListeners:u,emit:p}}),(function(a,i,o){var s=o(1),l=function(c){c&&c("core","edgehandles",s)};typeof cytoscape<"u"&&l(cytoscape),a.exports=l}),(function(a,i){a.exports=t}),(function(a,i){a.exports=n})])})})($u)),$u.exports}var gW=hW();const pW=Cl(gW);var tm,L2;function yW(){if(L2)return tm;L2=1;class r{constructor(n,a={}){this._cy=n,this._params=a,this._node_dom={};let i=n.container();if(a.dom_container)this._nodes_dom_container=a.dom_container;else{let s=document.createElement("div");s.style.position="absolute",s.style.zIndex=10,i.querySelector("canvas").parentNode.appendChild(s),this._nodes_dom_container=s}this._resize_observer=new ResizeObserver(s=>{for(let l of s){let u=l.target,c=u.__cy_id;n.getElementById(c).style({width:u.offsetWidth,height:u.offsetHeight,shape:"rectangle"})}}),n.on("add","node",s=>{this._add_node(s.target)}),n.on("remove","node",s=>{this._remove_node(s.target)});for(let s of n.nodes())this._add_node(s);this._nodes_dom_container.style.willChange="transform",this._nodes_dom_container.style.backfaceVisibility="hidden";let o=null;n.on("pan zoom",()=>{o===null&&(o=requestAnimationFrame(()=>{o=null;let s=n.pan(),l=n.zoom(),u="translate3d("+s.x+"px,"+s.y+"px,0) scale("+l+")";this._nodes_dom_container.style.transform=u}))}),this._panZoomRafId=o,n.on("position bounds","node",s=>{let l=s.target,u=l.id();if(!this._node_dom[u])return;let c=this._node_dom[u],d=`translate(-50%, -50%) translate3d(${l.position("x").toFixed(2)}px, ${l.position("y").toFixed(2)}px, 0)`;c.style.transform=d,c.style.display="inline",c.style.position="absolute",c.style["z-index"]=10})}_add_node(n){let a=n.data();a.dom&&(a.skip_node_append!==!0&&this._nodes_dom_container.appendChild(a.dom),a.dom.__cy_id=n.id(),a.dom.style.willChange="transform",a.dom.style.backfaceVisibility="hidden",this._node_dom[n.id()]=a.dom,this._resize_observer.observe(a.dom))}_remove_node(n){let a=n.id(),i=this._node_dom[a];i&&(this._resize_observer.unobserve(i),i.parentNode===this._nodes_dom_container&&this._nodes_dom_container.removeChild(i),delete this._node_dom[a])}node_dom(n){return this._node_dom[n]}update(n,a){let i=this._cy.getElementById(n);if(!i){console.warn(`Node with id ${n} not found`);return}let o=this._node_dom[n];if(!o){console.warn(`DOM element for node ${n} not found`);return}a(o),i.data("dom",o),this._cy.trigger("position",["node",i])}remove(){for(let n in this._node_dom)this._resize_observer.unobserve(this._node_dom[n]);for(;this._nodes_dom_container.firstChild;)this._nodes_dom_container.removeChild(this._nodes_dom_container.firstChild);this._node_dom={},this._cy.removeListener("add","node"),this._cy.removeListener("remove","node"),this._cy.removeListener("pan zoom"),this._cy.removeListener("position bounds","node"),this._params.dom_container||this._nodes_dom_container.parentNode.removeChild(this._nodes_dom_container),this._panZoomRafId!==null&&cancelAnimationFrame(this._panZoomRafId),this._cy=null,this._params=null,this._nodes_dom_container=null,this._resize_observer=null}}function e(t){t&&t("core","domNode",function(n,a){return new r(this,n,a)})}return typeof cytoscape<"u"&&e(cytoscape),tm=e,tm}var mW=yW();const bW=Cl(mW);un.prototype.hasInitialised||(un.use(fW),un.use(pW),un.use(bW),un.prototype.hasInitialised=!0);var Go={exports:{}};/**
331
+ `),s=a3(n,a,o);s.aPosition=n.getAttribLocation(s,"aPosition"),s.aIndex=n.getAttribLocation(s,"aIndex"),s.aVertType=n.getAttribLocation(s,"aVertType"),s.aTransform=n.getAttribLocation(s,"aTransform"),s.aAtlasId=n.getAttribLocation(s,"aAtlasId"),s.aTex=n.getAttribLocation(s,"aTex"),s.aPointAPointB=n.getAttribLocation(s,"aPointAPointB"),s.aPointCPointD=n.getAttribLocation(s,"aPointCPointD"),s.aLineWidth=n.getAttribLocation(s,"aLineWidth"),s.aColor=n.getAttribLocation(s,"aColor"),s.aCornerRadius=n.getAttribLocation(s,"aCornerRadius"),s.aBorderColor=n.getAttribLocation(s,"aBorderColor"),s.uPanZoomMatrix=n.getUniformLocation(s,"uPanZoomMatrix"),s.uAtlasSize=n.getUniformLocation(s,"uAtlasSize"),s.uBGColor=n.getUniformLocation(s,"uBGColor"),s.uZoom=n.getUniformLocation(s,"uZoom"),s.uTextures=[];for(var l=0;l<this.batchManager.getMaxAtlasesPerBatch();l++)s.uTextures.push(n.getUniformLocation(s,"uTexture".concat(l)));return s}},{key:"_createVAO",value:function(){var t=[0,0,1,0,1,1,0,0,1,1,0,1];this.vertexCount=t.length/2;var n=this.maxInstances,a=this.gl,i=this.program,o=a.createVertexArray();return a.bindVertexArray(o),v3(a,"vec2",i.aPosition,t),this.transformBuffer=h3(a,n,i.aTransform),this.indexBuffer=An(a,n,"vec4",i.aIndex),this.vertTypeBuffer=An(a,n,"int",i.aVertType),this.atlasIdBuffer=An(a,n,"int",i.aAtlasId),this.texBuffer=An(a,n,"vec4",i.aTex),this.pointAPointBBuffer=An(a,n,"vec4",i.aPointAPointB),this.pointCPointDBuffer=An(a,n,"vec4",i.aPointCPointD),this.lineWidthBuffer=An(a,n,"vec2",i.aLineWidth),this.colorBuffer=An(a,n,"vec4",i.aColor),this.cornerRadiusBuffer=An(a,n,"vec4",i.aCornerRadius),this.borderColorBuffer=An(a,n,"vec4",i.aBorderColor),a.bindVertexArray(null),o}},{key:"buffers",get:function(){var t=this;return this._buffers||(this._buffers=Object.keys(this).filter(function(n){return ya(n,"Buffer")}).map(function(n){return t[n]})),this._buffers}},{key:"startFrame",value:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ko.SCREEN;this.panZoomMatrix=t,this.renderTarget=n,this.batchDebugInfo=[],this.wrappedCount=0,this.simpleCount=0,this.startBatch()}},{key:"startBatch",value:function(){this.instanceCount=0,this.batchManager.startBatch()}},{key:"endFrame",value:function(){this.endBatch()}},{key:"_isVisible",value:function(t,n){return t.visible()?n&&n.isVisible?n.isVisible(t):!0:!1}},{key:"drawTexture",value:function(t,n,a){var i=this.atlasManager,o=this.batchManager,s=i.getRenderTypeOpts(a);if(this._isVisible(t,s)&&!(t.isEdge()&&!this._isValidEdge(t))){if(this.renderTarget.picking&&s.getTexPickingMode){var l=s.getTexPickingMode(t);if(l===rl.IGNORE)return;if(l==rl.USE_BB){this.drawPickingRectangle(t,n,a);return}}var u=i.getAtlasInfo(t,a),c=zt(u),d;try{for(c.s();!(d=c.n()).done;){var h=d.value,g=h.atlas,p=h.tex1,E=h.tex2;o.canAddToCurrentBatch(g)||this.endBatch();for(var y=o.getAtlasIndexForBatch(g),b=0,w=[[p,!0],[E,!1]];b<w.length;b++){var x=Yr(w[b],2),C=x[0],T=x[1];if(C.w!=0){var S=this.instanceCount;this.vertTypeBuffer.getView(S)[0]=Bd;var _=this.indexBuffer.getView(S);zi(n,_);var A=this.atlasIdBuffer.getView(S);A[0]=y;var P=this.texBuffer.getView(S);P[0]=C.x,P[1]=C.y,P[2]=C.w,P[3]=C.h;var I=this.transformBuffer.getMatrixView(S);this.setTransformMatrix(t,I,s,h,T),this.instanceCount++,T||this.wrappedCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}}}catch(D){c.e(D)}finally{c.f()}}}},{key:"setTransformMatrix",value:function(t,n,a,i){var o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,s=0;if(a.shapeProps&&a.shapeProps.padding&&(s=t.pstyle(a.shapeProps.padding).pfValue),i){var l=i.bb,u=i.tex1,c=i.tex2,d=u.w/(u.w+c.w);o||(d=1-d);var h=this._getAdjustedBB(l,s,o,d);this._applyTransformMatrix(n,h,a,t)}else{var g=a.getBoundingBox(t),p=this._getAdjustedBB(g,s,!0,1);this._applyTransformMatrix(n,p,a,t)}}},{key:"_applyTransformMatrix",value:function(t,n,a,i){var o,s;iE(t);var l=a.getRotation?a.getRotation(i):0;if(l!==0){var u=a.getRotationPoint(i),c=u.x,d=u.y;Fu(t,t,[c,d]),oE(t,t,l);var h=a.getRotationOffset(i);o=h.x+(n.xOffset||0),s=h.y+(n.yOffset||0)}else o=n.x1,s=n.y1;Fu(t,t,[o,s]),wm(t,t,[n.w,n.h])}},{key:"_getAdjustedBB",value:function(t,n,a,i){var o=t.x1,s=t.y1,l=t.w,u=t.h,c=t.yOffset;n&&(o-=n,s-=n,l+=2*n,u+=2*n);var d=0,h=l*i;return a&&i<1?l=h:!a&&i<1&&(d=l-h,o+=d,l=h),{x1:o,y1:s,w:l,h:u,xOffset:d,yOffset:c}}},{key:"drawPickingRectangle",value:function(t,n,a){var i=this.atlasManager.getRenderTypeOpts(a),o=this.instanceCount;this.vertTypeBuffer.getView(o)[0]=$i;var s=this.indexBuffer.getView(o);zi(n,s);var l=this.colorBuffer.getView(o);Za([0,0,0],1,l);var u=this.transformBuffer.getMatrixView(o);this.setTransformMatrix(t,u,i),this.simpleCount++,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}},{key:"drawNode",value:function(t,n,a){var i=this.simpleShapeOptions.get(a);if(this._isVisible(t,i)){var o=i.shapeProps,s=this._getVertTypeForShape(t,o.shape);if(s===void 0||i.isSimple&&!i.isSimple(t)){this.drawTexture(t,n,a);return}var l=this.instanceCount;if(this.vertTypeBuffer.getView(l)[0]=s,s===Ru||s===Oo){var u=i.getBoundingBox(t),c=this._getCornerRadius(t,o.radius,u),d=this.cornerRadiusBuffer.getView(l);d[0]=c,d[1]=c,d[2]=c,d[3]=c,s===Oo&&(d[0]=0,d[2]=0)}var h=this.indexBuffer.getView(l);zi(n,h);var g=t.pstyle(o.color).value,p=t.pstyle(o.opacity).value,E=this.colorBuffer.getView(l);Za(g,p,E);var y=this.lineWidthBuffer.getView(l);if(y[0]=0,y[1]=0,o.border){var b=t.pstyle("border-width").value;if(b>0){var w=t.pstyle("border-color").value,x=t.pstyle("border-opacity").value,C=this.borderColorBuffer.getView(l);Za(w,x,C);var T=t.pstyle("border-position").value;if(T==="inside")y[0]=0,y[1]=-b;else if(T==="outside")y[0]=b,y[1]=0;else{var S=b/2;y[0]=S,y[1]=-S}}}var _=this.transformBuffer.getMatrixView(l);this.setTransformMatrix(t,_,i),this.simpleCount++,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}},{key:"_getVertTypeForShape",value:function(t,n){var a=t.pstyle(n).value;switch(a){case"rectangle":return $i;case"ellipse":return Lo;case"roundrectangle":case"round-rectangle":return Ru;case"bottom-round-rectangle":return Oo;default:return}}},{key:"_getCornerRadius",value:function(t,n,a){var i=a.w,o=a.h;if(t.pstyle(n).value==="auto")return Sa(i,o);var s=t.pstyle(n).pfValue,l=i/2,u=o/2;return Math.min(s,u,l)}},{key:"drawEdgeArrow",value:function(t,n,a){if(t.visible()){var i=t._private.rscratch,o,s,l;if(a==="source"?(o=i.arrowStartX,s=i.arrowStartY,l=i.srcArrowAngle):(o=i.arrowEndX,s=i.arrowEndY,l=i.tgtArrowAngle),!(isNaN(o)||o==null||isNaN(s)||s==null||isNaN(l)||l==null)){var u=t.pstyle(a+"-arrow-shape").value;if(u!=="none"){var c=t.pstyle(a+"-arrow-color").value,d=t.pstyle("opacity").value,h=t.pstyle("line-opacity").value,g=d*h,p=t.pstyle("width").pfValue,E=t.pstyle("arrow-scale").value,y=this.r.getArrowWidth(p,E),b=this.instanceCount,w=this.transformBuffer.getMatrixView(b);iE(w),Fu(w,w,[o,s]),wm(w,w,[y,y]),oE(w,w,l),this.vertTypeBuffer.getView(b)[0]=Md;var x=this.indexBuffer.getView(b);zi(n,x);var C=this.colorBuffer.getView(b);Za(c,g,C),this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}}}},{key:"drawEdgeLine",value:function(t,n){if(t.visible()){var a=this._getEdgePoints(t);if(a){var i=t.pstyle("opacity").value,o=t.pstyle("line-opacity").value,s=t.pstyle("width").pfValue,l=t.pstyle("line-color").value,u=i*o;if(a.length/2+this.instanceCount>this.maxInstances&&this.endBatch(),a.length==4){var c=this.instanceCount;this.vertTypeBuffer.getView(c)[0]=sE;var d=this.indexBuffer.getView(c);zi(n,d);var h=this.colorBuffer.getView(c);Za(l,u,h);var g=this.lineWidthBuffer.getView(c);g[0]=s;var p=this.pointAPointBBuffer.getView(c);p[0]=a[0],p[1]=a[1],p[2]=a[2],p[3]=a[3],this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}else for(var E=0;E<a.length-2;E+=2){var y=this.instanceCount;this.vertTypeBuffer.getView(y)[0]=uE;var b=this.indexBuffer.getView(y);zi(n,b);var w=this.colorBuffer.getView(y);Za(l,u,w);var x=this.lineWidthBuffer.getView(y);x[0]=s;var C=a[E-2],T=a[E-1],S=a[E],_=a[E+1],A=a[E+2],P=a[E+3],I=a[E+4],D=a[E+5];E==0&&(C=2*S-A+.001,T=2*_-P+.001),E==a.length-4&&(I=2*A-S+.001,D=2*P-_+.001);var k=this.pointAPointBBuffer.getView(y);k[0]=C,k[1]=T,k[2]=S,k[3]=_;var M=this.pointCPointDBuffer.getView(y);M[0]=A,M[1]=P,M[2]=I,M[3]=D,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}}}},{key:"_isValidEdge",value:function(t){var n=t._private.rscratch;return!(n.badLine||n.allpts==null||isNaN(n.allpts[0]))}},{key:"_getEdgePoints",value:function(t){var n=t._private.rscratch;if(this._isValidEdge(t)){var a=n.allpts;if(a.length==4)return a;var i=this._getNumSegments(t);return this._getCurveSegmentPoints(a,i)}}},{key:"_getNumSegments",value:function(t){var n=15;return Math.min(Math.max(n,5),this.maxInstances)}},{key:"_getCurveSegmentPoints",value:function(t,n){if(t.length==4)return t;for(var a=Array((n+1)*2),i=0;i<=n;i++)if(i==0)a[0]=t[0],a[1]=t[1];else if(i==n)a[i*2]=t[t.length-2],a[i*2+1]=t[t.length-1];else{var o=i/n;this._setCurvePoint(t,o,a,i*2)}return a}},{key:"_setCurvePoint",value:function(t,n,a,i){if(t.length<=2)a[i]=t[0],a[i+1]=t[1];else{for(var o=Array(t.length-2),s=0;s<o.length;s+=2){var l=(1-n)*t[s]+n*t[s+2],u=(1-n)*t[s+1]+n*t[s+3];o[s]=l,o[s+1]=u}return this._setCurvePoint(o,n,a,i)}}},{key:"endBatch",value:function(){var t=this.gl,n=this.vao,a=this.vertexCount,i=this.instanceCount;if(i!==0){var o=this.renderTarget.picking?this.pickingProgram:this.program;t.useProgram(o),t.bindVertexArray(n);var s=zt(this.buffers),l;try{for(s.s();!(l=s.n()).done;){var u=l.value;u.bufferSubData(i)}}catch(p){s.e(p)}finally{s.f()}for(var c=this.batchManager.getAtlases(),d=0;d<c.length;d++)c[d].bufferIfNeeded(t);for(var h=0;h<c.length;h++)t.activeTexture(t.TEXTURE0+h),t.bindTexture(t.TEXTURE_2D,c[h].texture),t.uniform1i(o.uTextures[h],h);t.uniform1f(o.uZoom,o3(this.r)),t.uniformMatrix3fv(o.uPanZoomMatrix,!1,this.panZoomMatrix),t.uniform1i(o.uAtlasSize,this.batchManager.getAtlasSize());var g=Za(this.bgColor,1);t.uniform4fv(o.uBGColor,g),t.drawArraysInstanced(t.TRIANGLES,0,a,i),t.bindVertexArray(null),t.bindTexture(t.TEXTURE_2D,null),this.debug&&this.batchDebugInfo.push({count:i,atlasCount:c.length}),this.startBatch()}}},{key:"getDebugInfo",value:function(){var t=this.atlasManager.getDebugInfo(),n=t.reduce(function(o,s){return o+s.atlasCount},0),a=this.batchDebugInfo,i=a.reduce(function(o,s){return o+s.count},0);return{atlasInfo:t,totalAtlases:n,wrappedCount:this.wrappedCount,simpleCount:this.simpleCount,batchCount:a.length,batchInfo:a,totalInstances:i}}}])})(),BA={};BA.initWebgl=function(r,e){var t=this,n=t.data.contexts[t.WEBGL];r.bgColor=A3(t),r.webglTexSize=Math.min(r.webglTexSize,n.getParameter(n.MAX_TEXTURE_SIZE)),r.webglTexRows=Math.min(r.webglTexRows,54),r.webglTexRowsNodes=Math.min(r.webglTexRowsNodes,54),r.webglBatchSize=Math.min(r.webglBatchSize,16384),r.webglTexPerBatch=Math.min(r.webglTexPerBatch,n.getParameter(n.MAX_TEXTURE_IMAGE_UNITS)),t.webglDebug=r.webglDebug,t.webglDebugShowAtlases=r.webglDebugShowAtlases,t.pickingFrameBuffer=g3(n),t.pickingFrameBuffer.needsDraw=!0,t.drawing=new R3(t,n,r);var a=function(d){return function(h){return t.getTextAngle(h,d)}},i=function(d){return function(h){var g=h.pstyle(d);return g&&g.value}},o=function(d){return function(h){return h.pstyle("".concat(d,"-opacity")).value>0}},s=function(d){var h=d.pstyle("text-events").strValue==="yes";return h?rl.USE_BB:rl.IGNORE},l=function(d){var h=d.position(),g=h.x,p=h.y,E=d.outerWidth(),y=d.outerHeight();return{w:E,h:y,x1:g-E/2,y1:p-y/2}};t.drawing.addAtlasCollection("node",{texRows:r.webglTexRowsNodes}),t.drawing.addAtlasCollection("label",{texRows:r.webglTexRows}),t.drawing.addTextureAtlasRenderType("node-body",{collection:"node",getKey:e.getStyleKey,getBoundingBox:e.getElementBox,drawElement:e.drawElement}),t.drawing.addSimpleShapeRenderType("node-body",{getBoundingBox:l,isSimple:u3,shapeProps:{shape:"shape",color:"background-color",opacity:"background-opacity",radius:"corner-radius",border:!0}}),t.drawing.addSimpleShapeRenderType("node-overlay",{getBoundingBox:l,isVisible:o("overlay"),shapeProps:{shape:"overlay-shape",color:"overlay-color",opacity:"overlay-opacity",padding:"overlay-padding",radius:"overlay-corner-radius"}}),t.drawing.addSimpleShapeRenderType("node-underlay",{getBoundingBox:l,isVisible:o("underlay"),shapeProps:{shape:"underlay-shape",color:"underlay-color",opacity:"underlay-opacity",padding:"underlay-padding",radius:"underlay-corner-radius"}}),t.drawing.addTextureAtlasRenderType("label",{collection:"label",getTexPickingMode:s,getKey:kd(e.getLabelKey,null),getBoundingBox:Od(e.getLabelBox,null),drawClipped:!0,drawElement:e.drawLabel,getRotation:a(null),getRotationPoint:e.getLabelRotationPoint,getRotationOffset:e.getLabelRotationOffset,isVisible:i("label")}),t.drawing.addTextureAtlasRenderType("edge-source-label",{collection:"label",getTexPickingMode:s,getKey:kd(e.getSourceLabelKey,"source"),getBoundingBox:Od(e.getSourceLabelBox,"source"),drawClipped:!0,drawElement:e.drawSourceLabel,getRotation:a("source"),getRotationPoint:e.getSourceLabelRotationPoint,getRotationOffset:e.getSourceLabelRotationOffset,isVisible:i("source-label")}),t.drawing.addTextureAtlasRenderType("edge-target-label",{collection:"label",getTexPickingMode:s,getKey:kd(e.getTargetLabelKey,"target"),getBoundingBox:Od(e.getTargetLabelBox,"target"),drawClipped:!0,drawElement:e.drawTargetLabel,getRotation:a("target"),getRotationPoint:e.getTargetLabelRotationPoint,getRotationOffset:e.getTargetLabelRotationOffset,isVisible:i("target-label")});var u=hs(function(){console.log("garbage collect flag set"),t.data.gc=!0},1e4);t.onUpdateEleCalcs(function(c,d){var h=!1;d&&d.length>0&&(h|=t.drawing.invalidate(d)),h&&u()}),P3(t)};function A3(r){var e=r.cy.container(),t=e&&e.style&&e.style.backgroundColor||"white";return oR(t)}function MA(r,e){var t=r._private.rscratch;return Nt(t,"labelWrapCachedLines",e)||[]}var kd=function(e,t){return function(n){var a=e(n),i=MA(n,t);return i.length>1?i.map(function(o,s){return"".concat(a,"_").concat(s)}):a}},Od=function(e,t){return function(n,a){var i=e(n);if(typeof a=="string"){var o=a.indexOf("_");if(o>0){var s=Number(a.substring(o+1)),l=MA(n,t),u=i.h/l.length,c=u*s,d=i.y1+c;return{x1:i.x1,w:i.w,y1:d,h:u,yOffset:c}}}return i}};function P3(r){{var e=r.render;r.render=function(i){i=i||{};var o=r.cy;r.webgl&&(o.zoom()>SA?(I3(r),e.call(r,i)):(D3(r),OA(r,i,Ko.SCREEN)))}}{var t=r.matchCanvasSize;r.matchCanvasSize=function(i){t.call(r,i),r.pickingFrameBuffer.setFramebufferAttachmentSizes(r.canvasWidth,r.canvasHeight),r.pickingFrameBuffer.needsDraw=!0}}r.findNearestElements=function(i,o,s,l){return q3(r,i,o)};{var n=r.invalidateCachedZSortedEles;r.invalidateCachedZSortedEles=function(){n.call(r),r.pickingFrameBuffer.needsDraw=!0}}{var a=r.notify;r.notify=function(i,o){a.call(r,i,o),i==="viewport"||i==="bounds"?r.pickingFrameBuffer.needsDraw=!0:i==="background"&&r.drawing.invalidate(o,{type:"node-body"})}}}function I3(r){var e=r.data.contexts[r.WEBGL];e.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT)}function D3(r){var e=function(n){n.save(),n.setTransform(1,0,0,1,0,0),n.clearRect(0,0,r.canvasWidth,r.canvasHeight),n.restore()};e(r.data.contexts[r.NODE]),e(r.data.contexts[r.DRAG])}function B3(r){var e=r.canvasWidth,t=r.canvasHeight,n=Ym(r),a=n.pan,i=n.zoom,o=Dd();Fu(o,o,[a.x,a.y]),wm(o,o,[i,i]);var s=Dd();y3(s,e,t);var l=Dd();return p3(l,s,o),l}function kA(r,e){var t=r.canvasWidth,n=r.canvasHeight,a=Ym(r),i=a.pan,o=a.zoom;e.setTransform(1,0,0,1,0,0),e.clearRect(0,0,t,n),e.translate(i.x,i.y),e.scale(o,o)}function M3(r,e){r.drawSelectionRectangle(e,function(t){return kA(r,t)})}function k3(r){var e=r.data.contexts[r.NODE];e.save(),kA(r,e),e.strokeStyle="rgba(0, 0, 0, 0.3)",e.beginPath(),e.moveTo(-1e3,0),e.lineTo(1e3,0),e.stroke(),e.beginPath(),e.moveTo(0,-1e3),e.lineTo(0,1e3),e.stroke(),e.restore()}function O3(r){var e=function(a,i,o){for(var s=a.atlasManager.getAtlasCollection(i),l=r.data.contexts[r.NODE],u=s.atlases,c=0;c<u.length;c++){var d=u[c],h=d.canvas;if(h){var g=h.width,p=h.height,E=g*c,y=h.height*o,b=.4;l.save(),l.scale(b,b),l.drawImage(h,E,y),l.strokeStyle="black",l.rect(E,y,g,p),l.stroke(),l.restore()}}},t=0;e(r.drawing,"node",t++),e(r.drawing,"label",t++)}function L3(r,e,t,n,a){var i,o,s,l,u=Ym(r),c=u.pan,d=u.zoom;{var h=s3(r,c,d,e,t),g=Yr(h,2),p=g[0],E=g[1],y=6;i=p-y/2,o=E-y/2,s=y,l=y}if(s===0||l===0)return[];var b=r.data.contexts[r.WEBGL];b.bindFramebuffer(b.FRAMEBUFFER,r.pickingFrameBuffer),r.pickingFrameBuffer.needsDraw&&(b.viewport(0,0,b.canvas.width,b.canvas.height),OA(r,null,Ko.PICKING),r.pickingFrameBuffer.needsDraw=!1);var w=s*l,x=new Uint8Array(w*4);b.readPixels(i,o,s,l,b.RGBA,b.UNSIGNED_BYTE,x),b.bindFramebuffer(b.FRAMEBUFFER,null);for(var C=new Set,T=0;T<w;T++){var S=x.slice(T*4,T*4+4),_=f3(S)-1;_>=0&&C.add(_)}return C}function q3(r,e,t){var n=L3(r,e,t),a=r.getCachedZSortedEles(),i,o,s=zt(n),l;try{for(s.s();!(l=s.n()).done;){var u=l.value,c=a[u];if(!i&&c.isNode()&&(i=c),!o&&c.isEdge()&&(o=c),i&&o)break}}catch(d){s.e(d)}finally{s.f()}return[i,o].filter(Boolean)}function Ld(r,e,t){var n=r.drawing;e+=1,t.isNode()?(n.drawNode(t,e,"node-underlay"),n.drawNode(t,e,"node-body"),n.drawTexture(t,e,"label"),n.drawNode(t,e,"node-overlay")):(n.drawEdgeLine(t,e),n.drawEdgeArrow(t,e,"source"),n.drawEdgeArrow(t,e,"target"),n.drawTexture(t,e,"label"),n.drawTexture(t,e,"edge-source-label"),n.drawTexture(t,e,"edge-target-label"))}function OA(r,e,t){var n;r.webglDebug&&(n=performance.now());var a=r.drawing,i=0;if(t.screen&&r.data.canvasNeedsRedraw[r.SELECT_BOX]&&M3(r,e),r.data.canvasNeedsRedraw[r.NODE]||t.picking){var o=r.data.contexts[r.WEBGL];t.screen?(o.clearColor(0,0,0,0),o.enable(o.BLEND),o.blendFunc(o.ONE,o.ONE_MINUS_SRC_ALPHA)):o.disable(o.BLEND),o.clear(o.COLOR_BUFFER_BIT|o.DEPTH_BUFFER_BIT),o.viewport(0,0,o.canvas.width,o.canvas.height);var s=B3(r),l=r.getCachedZSortedEles();if(i=l.length,a.startFrame(s,t),t.screen){for(var u=0;u<l.nondrag.length;u++)Ld(r,u,l.nondrag[u]);for(var c=0;c<l.drag.length;c++)Ld(r,c,l.drag[c])}else if(t.picking)for(var d=0;d<l.length;d++)Ld(r,d,l[d]);a.endFrame(),t.screen&&r.webglDebugShowAtlases&&(k3(r),O3(r)),r.data.canvasNeedsRedraw[r.NODE]=!1,r.data.canvasNeedsRedraw[r.DRAG]=!1}if(r.webglDebug){var h=performance.now(),g=!1,p=Math.ceil(h-n),E=a.getDebugInfo(),y=["".concat(i," elements"),"".concat(E.totalInstances," instances"),"".concat(E.batchCount," batches"),"".concat(E.totalAtlases," atlases"),"".concat(E.wrappedCount," wrapped textures"),"".concat(E.simpleCount," simple shapes")].join(", ");if(g)console.log("WebGL (".concat(t.name,") - time ").concat(p,"ms, ").concat(y));else{console.log("WebGL (".concat(t.name,") - frame time ").concat(p,"ms")),console.log("Totals:"),console.log(" ".concat(y)),console.log("Texture Atlases Used:");var b=E.atlasInfo,w=zt(b),x;try{for(w.s();!(x=w.n()).done;){var C=x.value;console.log(" ".concat(C.type,": ").concat(C.keyCount," keys, ").concat(C.atlasCount," atlases"))}}catch(T){w.e(T)}finally{w.f()}console.log("")}}r.data.gc&&(console.log("Garbage Collect!"),r.data.gc=!1,a.gc())}var La={};La.drawPolygonPath=function(r,e,t,n,a,i){var o=n/2,s=a/2;r.beginPath&&r.beginPath(),r.moveTo(e+o*i[0],t+s*i[1]);for(var l=1;l<i.length/2;l++)r.lineTo(e+o*i[l*2],t+s*i[l*2+1]);r.closePath()};La.drawRoundPolygonPath=function(r,e,t,n,a,i,o){o.forEach(function(s){return pA(r,s)}),r.closePath()};La.drawRoundRectanglePath=function(r,e,t,n,a,i){var o=n/2,s=a/2,l=i==="auto"?Sa(n,a):Math.min(i,s,o);r.beginPath&&r.beginPath(),r.moveTo(e,t-s),r.arcTo(e+o,t-s,e+o,t,l),r.arcTo(e+o,t+s,e,t+s,l),r.arcTo(e-o,t+s,e-o,t,l),r.arcTo(e-o,t-s,e,t-s,l),r.lineTo(e,t-s),r.closePath()};La.drawBottomRoundRectanglePath=function(r,e,t,n,a,i){var o=n/2,s=a/2,l=i==="auto"?Sa(n,a):i;r.beginPath&&r.beginPath(),r.moveTo(e,t-s),r.lineTo(e+o,t-s),r.lineTo(e+o,t),r.arcTo(e+o,t+s,e,t+s,l),r.arcTo(e-o,t+s,e-o,t,l),r.lineTo(e-o,t-s),r.lineTo(e,t-s),r.closePath()};La.drawCutRectanglePath=function(r,e,t,n,a,i,o){var s=n/2,l=a/2,u=o==="auto"?Om():o;r.beginPath&&r.beginPath(),r.moveTo(e-s+u,t-l),r.lineTo(e+s-u,t-l),r.lineTo(e+s,t-l+u),r.lineTo(e+s,t+l-u),r.lineTo(e+s-u,t+l),r.lineTo(e-s+u,t+l),r.lineTo(e-s,t+l-u),r.lineTo(e-s,t-l+u),r.closePath()};La.drawBarrelPath=function(r,e,t,n,a){var i=n/2,o=a/2,s=e-i,l=e+i,u=t-o,c=t+o,d=om(n,a),h=d.widthOffset,g=d.heightOffset,p=d.ctrlPtOffsetPct*h;r.beginPath&&r.beginPath(),r.moveTo(s,u+g),r.lineTo(s,c-g),r.quadraticCurveTo(s+p,c,s+h,c),r.lineTo(l-h,c),r.quadraticCurveTo(l-p,c,l,c-g),r.lineTo(l,u+g),r.quadraticCurveTo(l-p,u,l-h,u),r.lineTo(s+h,u),r.quadraticCurveTo(s+p,u,s,u+g),r.closePath()};var lE=Math.sin(0),fE=Math.cos(0),xm={},Em={},LA=Math.PI/40;for(var Vi=0*Math.PI;Vi<2*Math.PI;Vi+=LA)xm[Vi]=Math.sin(Vi),Em[Vi]=Math.cos(Vi);La.drawEllipsePath=function(r,e,t,n,a){if(r.beginPath&&r.beginPath(),r.ellipse)r.ellipse(e,t,n/2,a/2,0,0,2*Math.PI);else for(var i,o,s=n/2,l=a/2,u=0*Math.PI;u<2*Math.PI;u+=LA)i=e-s*xm[u]*lE+s*Em[u]*fE,o=t+l*Em[u]*lE+l*xm[u]*fE,u===0?r.moveTo(i,o):r.lineTo(i,o);r.closePath()};var ws={};ws.createBuffer=function(r,e){var t=document.createElement("canvas");return t.width=r,t.height=e,[t,t.getContext("2d")]};ws.bufferCanvasImage=function(r){var e=this.cy,t=e.mutableElements(),n=t.boundingBox(),a=this.findContainerClientCoords(),i=r.full?Math.ceil(n.w):a[2],o=r.full?Math.ceil(n.h):a[3],s=Me(r.maxWidth)||Me(r.maxHeight),l=this.getPixelRatio(),u=1;if(r.scale!==void 0)i*=r.scale,o*=r.scale,u=r.scale;else if(s){var c=1/0,d=1/0;Me(r.maxWidth)&&(c=u*r.maxWidth/i),Me(r.maxHeight)&&(d=u*r.maxHeight/o),u=Math.min(c,d),i*=u,o*=u}s||(i*=l,o*=l,u*=l);var h=document.createElement("canvas");h.width=i,h.height=o,h.style.width=i+"px",h.style.height=o+"px";var g=h.getContext("2d");if(i>0&&o>0){g.clearRect(0,0,i,o),g.globalCompositeOperation="source-over";var p=this.getCachedZSortedEles();if(r.full)g.translate(-n.x1*u,-n.y1*u),g.scale(u,u),this.drawElements(g,p),g.scale(1/u,1/u),g.translate(n.x1*u,n.y1*u);else{var E=e.pan(),y={x:E.x*u,y:E.y*u};u*=e.zoom(),g.translate(y.x,y.y),g.scale(u,u),this.drawElements(g,p),g.scale(1/u,1/u),g.translate(-y.x,-y.y)}r.bg&&(g.globalCompositeOperation="destination-over",g.fillStyle=r.bg,g.rect(0,0,i,o),g.fill())}return h};function N3(r,e){for(var t=atob(r),n=new ArrayBuffer(t.length),a=new Uint8Array(n),i=0;i<t.length;i++)a[i]=t.charCodeAt(i);return new Blob([n],{type:e})}function cE(r){var e=r.indexOf(",");return r.substr(e+1)}function qA(r,e,t){var n=function(){return e.toDataURL(t,r.quality)};switch(r.output){case"blob-promise":return new no(function(a,i){try{e.toBlob(function(o){o!=null?a(o):i(new Error("`canvas.toBlob()` sent a null value in its callback"))},t,r.quality)}catch(o){i(o)}});case"blob":return N3(cE(n()),t);case"base64":return cE(n());case"base64uri":default:return n()}}ws.png=function(r){return qA(r,this.bufferCanvasImage(r),"image/png")};ws.jpg=function(r){return qA(r,this.bufferCanvasImage(r),"image/jpeg")};var NA={};NA.nodeShapeImpl=function(r,e,t,n,a,i,o,s){switch(r){case"ellipse":return this.drawEllipsePath(e,t,n,a,i);case"polygon":return this.drawPolygonPath(e,t,n,a,i,o);case"round-polygon":return this.drawRoundPolygonPath(e,t,n,a,i,o,s);case"roundrectangle":case"round-rectangle":return this.drawRoundRectanglePath(e,t,n,a,i,s);case"cutrectangle":case"cut-rectangle":return this.drawCutRectanglePath(e,t,n,a,i,o,s);case"bottomroundrectangle":case"bottom-round-rectangle":return this.drawBottomRoundRectanglePath(e,t,n,a,i,s);case"barrel":return this.drawBarrelPath(e,t,n,a,i)}};var F3=FA,fr=FA.prototype;fr.CANVAS_LAYERS=3;fr.SELECT_BOX=0;fr.DRAG=1;fr.NODE=2;fr.WEBGL=3;fr.CANVAS_TYPES=["2d","2d","2d","webgl2"];fr.BUFFER_COUNT=3;fr.TEXTURE_BUFFER=0;fr.MOTIONBLUR_BUFFER_NODE=1;fr.MOTIONBLUR_BUFFER_DRAG=2;function FA(r){var e=this,t=e.cy.window(),n=t.document;r.webgl&&(fr.CANVAS_LAYERS=e.CANVAS_LAYERS=4,console.log("webgl rendering enabled")),e.data={canvases:new Array(fr.CANVAS_LAYERS),contexts:new Array(fr.CANVAS_LAYERS),canvasNeedsRedraw:new Array(fr.CANVAS_LAYERS),bufferCanvases:new Array(fr.BUFFER_COUNT),bufferContexts:new Array(fr.CANVAS_LAYERS)};var a="-webkit-tap-highlight-color",i="rgba(0,0,0,0)";e.data.canvasContainer=n.createElement("div");var o=e.data.canvasContainer.style;e.data.canvasContainer.style[a]=i,o.position="relative",o.zIndex="0",o.overflow="hidden";var s=r.cy.container();s.appendChild(e.data.canvasContainer),s.style[a]=i;var l={"-webkit-user-select":"none","-moz-user-select":"-moz-none","user-select":"none","-webkit-tap-highlight-color":"rgba(0,0,0,0)","outline-style":"none"};Mq()&&(l["-ms-touch-action"]="none",l["touch-action"]="none");for(var u=0;u<fr.CANVAS_LAYERS;u++){var c=e.data.canvases[u]=n.createElement("canvas"),d=fr.CANVAS_TYPES[u];e.data.contexts[u]=c.getContext(d),e.data.contexts[u]||Lr("Could not create canvas of type "+d),Object.keys(l).forEach(function(se){c.style[se]=l[se]}),c.style.position="absolute",c.setAttribute("data-id","layer"+u),c.style.zIndex=String(fr.CANVAS_LAYERS-u),e.data.canvasContainer.appendChild(c),e.data.canvasNeedsRedraw[u]=!1}e.data.topCanvas=e.data.canvases[0],e.data.canvases[fr.NODE].setAttribute("data-id","layer"+fr.NODE+"-node"),e.data.canvases[fr.SELECT_BOX].setAttribute("data-id","layer"+fr.SELECT_BOX+"-selectbox"),e.data.canvases[fr.DRAG].setAttribute("data-id","layer"+fr.DRAG+"-drag"),e.data.canvases[fr.WEBGL]&&e.data.canvases[fr.WEBGL].setAttribute("data-id","layer"+fr.WEBGL+"-webgl");for(var u=0;u<fr.BUFFER_COUNT;u++)e.data.bufferCanvases[u]=n.createElement("canvas"),e.data.bufferContexts[u]=e.data.bufferCanvases[u].getContext("2d"),e.data.bufferCanvases[u].style.position="absolute",e.data.bufferCanvases[u].setAttribute("data-id","buffer"+u),e.data.bufferCanvases[u].style.zIndex=String(-u-1),e.data.bufferCanvases[u].style.visibility="hidden";e.pathsEnabled=!0;var h=Dt(),g=function(X){return{x:(X.x1+X.x2)/2,y:(X.y1+X.y2)/2}},p=function(X){return{x:-X.w/2,y:-X.h/2}},E=function(X){var Q=X[0]._private,ae=Q.oldBackgroundTimestamp===Q.backgroundTimestamp;return!ae},y=function(X){return X[0]._private.nodeKey},b=function(X){return X[0]._private.labelStyleKey},w=function(X){return X[0]._private.sourceLabelStyleKey},x=function(X){return X[0]._private.targetLabelStyleKey},C=function(X,Q,ae,te,ce){return e.drawElement(X,Q,ae,!1,!1,ce)},T=function(X,Q,ae,te,ce){return e.drawElementText(X,Q,ae,te,"main",ce)},S=function(X,Q,ae,te,ce){return e.drawElementText(X,Q,ae,te,"source",ce)},_=function(X,Q,ae,te,ce){return e.drawElementText(X,Q,ae,te,"target",ce)},A=function(X){return X.boundingBox(),X[0]._private.bodyBounds},P=function(X){return X.boundingBox(),X[0]._private.labelBounds.main||h},I=function(X){return X.boundingBox(),X[0]._private.labelBounds.source||h},D=function(X){return X.boundingBox(),X[0]._private.labelBounds.target||h},k=function(X,Q){return Q},M=function(X){return g(A(X))},N=function(X,Q,ae){var te=X?X+"-":"";return{x:Q.x+ae.pstyle(te+"text-margin-x").pfValue,y:Q.y+ae.pstyle(te+"text-margin-y").pfValue}},z=function(X,Q,ae){var te=X[0]._private.rscratch;return{x:te[Q],y:te[ae]}},$=function(X){return N("",z(X,"labelX","labelY"),X)},q=function(X){return N("source",z(X,"sourceLabelX","sourceLabelY"),X)},V=function(X){return N("target",z(X,"targetLabelX","targetLabelY"),X)},Z=function(X){return p(A(X))},K=function(X){return p(I(X))},j=function(X){return p(D(X))},ee=function(X){var Q=P(X),ae=p(P(X));if(X.isNode()){switch(X.pstyle("text-halign").value){case"left":ae.x=-Q.w-(Q.leftPad||0);break;case"right":ae.x=-(Q.rightPad||0);break}switch(X.pstyle("text-valign").value){case"top":ae.y=-Q.h-(Q.topPad||0);break;case"bottom":ae.y=-(Q.botPad||0);break}}return ae},le=e.data.eleTxrCache=new Fo(e,{getKey:y,doesEleInvalidateKey:E,drawElement:C,getBoundingBox:A,getRotationPoint:M,getRotationOffset:Z,allowEdgeTxrCaching:!1,allowParentTxrCaching:!1}),W=e.data.lblTxrCache=new Fo(e,{getKey:b,drawElement:T,getBoundingBox:P,getRotationPoint:$,getRotationOffset:ee,isVisible:k}),G=e.data.slbTxrCache=new Fo(e,{getKey:w,drawElement:S,getBoundingBox:I,getRotationPoint:q,getRotationOffset:K,isVisible:k}),Y=e.data.tlbTxrCache=new Fo(e,{getKey:x,drawElement:_,getBoundingBox:D,getRotationPoint:V,getRotationOffset:j,isVisible:k}),re=e.data.lyrTxrCache=new TA(e);e.onUpdateEleCalcs(function(X,Q){le.invalidateElements(Q),W.invalidateElements(Q),G.invalidateElements(Q),Y.invalidateElements(Q),re.invalidateElements(Q);for(var ae=0;ae<Q.length;ae++){var te=Q[ae]._private;te.oldBackgroundTimestamp=te.backgroundTimestamp}});var de=function(X){for(var Q=0;Q<X.length;Q++)re.enqueueElementRefinement(X[Q].ele)};le.onDequeue(de),W.onDequeue(de),G.onDequeue(de),Y.onDequeue(de),r.webgl&&e.initWebgl(r,{getStyleKey:y,getLabelKey:b,getSourceLabelKey:w,getTargetLabelKey:x,drawElement:C,drawLabel:T,drawSourceLabel:S,drawTargetLabel:_,getElementBox:A,getLabelBox:P,getSourceLabelBox:I,getTargetLabelBox:D,getElementRotationPoint:M,getElementRotationOffset:Z,getLabelRotationPoint:$,getSourceLabelRotationPoint:q,getTargetLabelRotationPoint:V,getLabelRotationOffset:ee,getSourceLabelRotationOffset:K,getTargetLabelRotationOffset:j})}fr.redrawHint=function(r,e){var t=this;switch(r){case"eles":t.data.canvasNeedsRedraw[fr.NODE]=e;break;case"drag":t.data.canvasNeedsRedraw[fr.DRAG]=e;break;case"select":t.data.canvasNeedsRedraw[fr.SELECT_BOX]=e;break;case"gc":t.data.gc=!0;break}};var z3=typeof Path2D<"u";fr.path2dEnabled=function(r){if(r===void 0)return this.pathsEnabled;this.pathsEnabled=!!r};fr.usePaths=function(){return z3&&this.pathsEnabled};fr.setImgSmoothing=function(r,e){r.imageSmoothingEnabled!=null?r.imageSmoothingEnabled=e:(r.webkitImageSmoothingEnabled=e,r.mozImageSmoothingEnabled=e,r.msImageSmoothingEnabled=e)};fr.getImgSmoothing=function(r){return r.imageSmoothingEnabled!=null?r.imageSmoothingEnabled:r.webkitImageSmoothingEnabled||r.mozImageSmoothingEnabled||r.msImageSmoothingEnabled};fr.makeOffscreenCanvas=function(r,e){var t;if((typeof OffscreenCanvas>"u"?"undefined":tt(OffscreenCanvas))!=="undefined")t=new OffscreenCanvas(r,e);else{var n=this.cy.window(),a=n.document;t=a.createElement("canvas"),t.width=r,t.height=e}return t};[RA,kn,Jn,jm,fi,Oa,Bt,BA,La,ws,NA].forEach(function(r){Ye(fr,r)});var $3=[{name:"null",impl:vA},{name:"base",impl:CA},{name:"canvas",impl:F3}],V3=[{type:"layout",extensions:v$},{type:"renderer",extensions:$3}],zA={},$A={};function VA(r,e,t){var n=t,a=function(A){Er("Can not register `"+e+"` for `"+r+"` since `"+A+"` already exists in the prototype and can not be overridden")};if(r==="core"){if(as.prototype[e])return a(e);as.prototype[e]=t}else if(r==="collection"){if(pt.prototype[e])return a(e);pt.prototype[e]=t}else if(r==="layout"){for(var i=function(A){this.options=A,t.call(this,A),pr(this._private)||(this._private={}),this._private.cy=A.cy,this._private.listeners=[],this.createEmitter()},o=i.prototype=Object.create(t.prototype),s=[],l=0;l<s.length;l++){var u=s[l];o[u]=o[u]||function(){return this}}o.start&&!o.run?o.run=function(){return this.start(),this}:!o.start&&o.run&&(o.start=function(){return this.run(),this});var c=t.prototype.stop;o.stop=function(){var _=this.options;if(_&&_.animate){var A=this.animations;if(A)for(var P=0;P<A.length;P++)A[P].stop()}return c?c.call(this):this.emit("layoutstop"),this},o.destroy||(o.destroy=function(){return this}),o.cy=function(){return this._private.cy};var d=function(A){return A._private.cy},h={addEventFields:function(A,P){P.layout=A,P.cy=d(A),P.target=A},bubble:function(){return!0},parent:function(A){return d(A)}};Ye(o,{createEmitter:function(){return this._private.emitter=new gl(h,this),this},emitter:function(){return this._private.emitter},on:function(A,P){return this.emitter().on(A,P),this},one:function(A,P){return this.emitter().one(A,P),this},once:function(A,P){return this.emitter().one(A,P),this},removeListener:function(A,P){return this.emitter().removeListener(A,P),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},emit:function(A,P){return this.emitter().emit(A,P),this}}),xr.eventAliasesOn(o),n=i}else if(r==="renderer"&&e!=="null"&&e!=="base"){var g=GA("renderer","base"),p=g.prototype,E=t,y=t.prototype,b=function(){g.apply(this,arguments),E.apply(this,arguments)},w=b.prototype;for(var x in p){var C=p[x],T=y[x]!=null;if(T)return a(x);w[x]=C}for(var S in y)w[S]=y[S];p.clientFunctions.forEach(function(_){w[_]=w[_]||function(){Lr("Renderer does not implement `renderer."+_+"()` on its prototype")}}),n=b}else if(r==="__proto__"||r==="constructor"||r==="prototype")return Lr(r+" is an illegal type to be registered, possibly lead to prototype pollutions");return sR({map:zA,keys:[r,e],value:n})}function GA(r,e){return uR({map:zA,keys:[r,e]})}function G3(r,e,t,n,a){return sR({map:$A,keys:[r,e,t,n],value:a})}function W3(r,e,t,n){return uR({map:$A,keys:[r,e,t,n]})}var Cm=function(){if(arguments.length===2)return GA.apply(null,arguments);if(arguments.length===3)return VA.apply(null,arguments);if(arguments.length===4)return W3.apply(null,arguments);if(arguments.length===5)return G3.apply(null,arguments);Lr("Invalid extension access syntax")};as.prototype.extension=Cm;V3.forEach(function(r){r.extensions.forEach(function(e){VA(r.type,e.name,e.impl)})});var tl=function(){if(!(this instanceof tl))return new tl;this.length=0},ui=tl.prototype;ui.instanceString=function(){return"stylesheet"};ui.selector=function(r){var e=this.length++;return this[e]={selector:r,properties:[]},this};ui.css=function(r,e){var t=this.length-1;if(Ke(r))this[t].properties.push({name:r,value:e});else if(pr(r))for(var n=r,a=Object.keys(n),i=0;i<a.length;i++){var o=a[i],s=n[o];if(s!=null){var l=st.properties[o]||st.properties[il(o)];if(l!=null){var u=l.name,c=s;this[t].properties.push({name:u,value:c})}}}return this};ui.style=ui.css;ui.generateStyle=function(r){var e=new st(r);return this.appendToStyle(e)};ui.appendToStyle=function(r){for(var e=0;e<this.length;e++){var t=this[e],n=t.selector,a=t.properties;r.selector(n);for(var i=0;i<a.length;i++){var o=a[i];r.css(o.name,o.value)}}return r};var U3="3.33.1",un=function(e){if(e===void 0&&(e={}),pr(e))return new as(e);if(Ke(e))return Cm.apply(Cm,arguments)};un.use=function(r){var e=Array.prototype.slice.call(arguments,1);return e.unshift(un),r.apply(null,e),this};un.warnings=function(r){return gR(r)};un.version=U3;un.stylesheet=un.Stylesheet=tl;var Et=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Cl(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var zu={exports:{}};function Zm(r){throw new Error('Could not dynamically require "'+r+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var qd,dE;function H3(){if(dE)return qd;dE=1;function r(){this.__data__=[],this.size=0}return qd=r,qd}var Nd,vE;function uo(){if(vE)return Nd;vE=1;function r(e,t){return e===t||e!==e&&t!==t}return Nd=r,Nd}var Fd,hE;function _l(){if(hE)return Fd;hE=1;var r=uo();function e(t,n){for(var a=t.length;a--;)if(r(t[a][0],n))return a;return-1}return Fd=e,Fd}var zd,gE;function K3(){if(gE)return zd;gE=1;var r=_l(),e=Array.prototype,t=e.splice;function n(a){var i=this.__data__,o=r(i,a);if(o<0)return!1;var s=i.length-1;return o==s?i.pop():t.call(i,o,1),--this.size,!0}return zd=n,zd}var $d,pE;function j3(){if(pE)return $d;pE=1;var r=_l();function e(t){var n=this.__data__,a=r(n,t);return a<0?void 0:n[a][1]}return $d=e,$d}var Vd,yE;function Y3(){if(yE)return Vd;yE=1;var r=_l();function e(t){return r(this.__data__,t)>-1}return Vd=e,Vd}var Gd,mE;function Z3(){if(mE)return Gd;mE=1;var r=_l();function e(t,n){var a=this.__data__,i=r(a,t);return i<0?(++this.size,a.push([t,n])):a[i][1]=n,this}return Gd=e,Gd}var Wd,bE;function Sl(){if(bE)return Wd;bE=1;var r=H3(),e=K3(),t=j3(),n=Y3(),a=Z3();function i(o){var s=-1,l=o==null?0:o.length;for(this.clear();++s<l;){var u=o[s];this.set(u[0],u[1])}}return i.prototype.clear=r,i.prototype.delete=e,i.prototype.get=t,i.prototype.has=n,i.prototype.set=a,Wd=i,Wd}var Ud,wE;function X3(){if(wE)return Ud;wE=1;var r=Sl();function e(){this.__data__=new r,this.size=0}return Ud=e,Ud}var Hd,xE;function Q3(){if(xE)return Hd;xE=1;function r(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}return Hd=r,Hd}var Kd,EE;function J3(){if(EE)return Kd;EE=1;function r(e){return this.__data__.get(e)}return Kd=r,Kd}var jd,CE;function eV(){if(CE)return jd;CE=1;function r(e){return this.__data__.has(e)}return jd=r,jd}var Yd,_E;function WA(){if(_E)return Yd;_E=1;var r=typeof Et=="object"&&Et&&Et.Object===Object&&Et;return Yd=r,Yd}var Zd,SE;function En(){if(SE)return Zd;SE=1;var r=WA(),e=typeof self=="object"&&self&&self.Object===Object&&self,t=r||e||Function("return this")();return Zd=t,Zd}var Xd,TE;function lo(){if(TE)return Xd;TE=1;var r=En(),e=r.Symbol;return Xd=e,Xd}var Qd,RE;function rV(){if(RE)return Qd;RE=1;var r=lo(),e=Object.prototype,t=e.hasOwnProperty,n=e.toString,a=r?r.toStringTag:void 0;function i(o){var s=t.call(o,a),l=o[a];try{o[a]=void 0;var u=!0}catch{}var c=n.call(o);return u&&(s?o[a]=l:delete o[a]),c}return Qd=i,Qd}var Jd,AE;function tV(){if(AE)return Jd;AE=1;var r=Object.prototype,e=r.toString;function t(n){return e.call(n)}return Jd=t,Jd}var ev,PE;function ci(){if(PE)return ev;PE=1;var r=lo(),e=rV(),t=tV(),n="[object Null]",a="[object Undefined]",i=r?r.toStringTag:void 0;function o(s){return s==null?s===void 0?a:n:i&&i in Object(s)?e(s):t(s)}return ev=o,ev}var rv,IE;function fn(){if(IE)return rv;IE=1;function r(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}return rv=r,rv}var tv,DE;function xs(){if(DE)return tv;DE=1;var r=ci(),e=fn(),t="[object AsyncFunction]",n="[object Function]",a="[object GeneratorFunction]",i="[object Proxy]";function o(s){if(!e(s))return!1;var l=r(s);return l==n||l==a||l==t||l==i}return tv=o,tv}var nv,BE;function nV(){if(BE)return nv;BE=1;var r=En(),e=r["__core-js_shared__"];return nv=e,nv}var av,ME;function aV(){if(ME)return av;ME=1;var r=nV(),e=(function(){var n=/[^.]+$/.exec(r&&r.keys&&r.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""})();function t(n){return!!e&&e in n}return av=t,av}var iv,kE;function UA(){if(kE)return iv;kE=1;var r=Function.prototype,e=r.toString;function t(n){if(n!=null){try{return e.call(n)}catch{}try{return n+""}catch{}}return""}return iv=t,iv}var ov,OE;function iV(){if(OE)return ov;OE=1;var r=xs(),e=aV(),t=fn(),n=UA(),a=/[\\^$.*+?()[\]{}|]/g,i=/^\[object .+?Constructor\]$/,o=Function.prototype,s=Object.prototype,l=o.toString,u=s.hasOwnProperty,c=RegExp("^"+l.call(u).replace(a,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function d(h){if(!t(h)||e(h))return!1;var g=r(h)?c:i;return g.test(n(h))}return ov=d,ov}var sv,LE;function oV(){if(LE)return sv;LE=1;function r(e,t){return e==null?void 0:e[t]}return sv=r,sv}var uv,qE;function di(){if(qE)return uv;qE=1;var r=iV(),e=oV();function t(n,a){var i=e(n,a);return r(i)?i:void 0}return uv=t,uv}var lv,NE;function Xm(){if(NE)return lv;NE=1;var r=di(),e=En(),t=r(e,"Map");return lv=t,lv}var fv,FE;function Tl(){if(FE)return fv;FE=1;var r=di(),e=r(Object,"create");return fv=e,fv}var cv,zE;function sV(){if(zE)return cv;zE=1;var r=Tl();function e(){this.__data__=r?r(null):{},this.size=0}return cv=e,cv}var dv,$E;function uV(){if($E)return dv;$E=1;function r(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}return dv=r,dv}var vv,VE;function lV(){if(VE)return vv;VE=1;var r=Tl(),e="__lodash_hash_undefined__",t=Object.prototype,n=t.hasOwnProperty;function a(i){var o=this.__data__;if(r){var s=o[i];return s===e?void 0:s}return n.call(o,i)?o[i]:void 0}return vv=a,vv}var hv,GE;function fV(){if(GE)return hv;GE=1;var r=Tl(),e=Object.prototype,t=e.hasOwnProperty;function n(a){var i=this.__data__;return r?i[a]!==void 0:t.call(i,a)}return hv=n,hv}var gv,WE;function cV(){if(WE)return gv;WE=1;var r=Tl(),e="__lodash_hash_undefined__";function t(n,a){var i=this.__data__;return this.size+=this.has(n)?0:1,i[n]=r&&a===void 0?e:a,this}return gv=t,gv}var pv,UE;function dV(){if(UE)return pv;UE=1;var r=sV(),e=uV(),t=lV(),n=fV(),a=cV();function i(o){var s=-1,l=o==null?0:o.length;for(this.clear();++s<l;){var u=o[s];this.set(u[0],u[1])}}return i.prototype.clear=r,i.prototype.delete=e,i.prototype.get=t,i.prototype.has=n,i.prototype.set=a,pv=i,pv}var yv,HE;function vV(){if(HE)return yv;HE=1;var r=dV(),e=Sl(),t=Xm();function n(){this.size=0,this.__data__={hash:new r,map:new(t||e),string:new r}}return yv=n,yv}var mv,KE;function hV(){if(KE)return mv;KE=1;function r(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}return mv=r,mv}var bv,jE;function Rl(){if(jE)return bv;jE=1;var r=hV();function e(t,n){var a=t.__data__;return r(n)?a[typeof n=="string"?"string":"hash"]:a.map}return bv=e,bv}var wv,YE;function gV(){if(YE)return wv;YE=1;var r=Rl();function e(t){var n=r(this,t).delete(t);return this.size-=n?1:0,n}return wv=e,wv}var xv,ZE;function pV(){if(ZE)return xv;ZE=1;var r=Rl();function e(t){return r(this,t).get(t)}return xv=e,xv}var Ev,XE;function yV(){if(XE)return Ev;XE=1;var r=Rl();function e(t){return r(this,t).has(t)}return Ev=e,Ev}var Cv,QE;function mV(){if(QE)return Cv;QE=1;var r=Rl();function e(t,n){var a=r(this,t),i=a.size;return a.set(t,n),this.size+=a.size==i?0:1,this}return Cv=e,Cv}var _v,JE;function Qm(){if(JE)return _v;JE=1;var r=vV(),e=gV(),t=pV(),n=yV(),a=mV();function i(o){var s=-1,l=o==null?0:o.length;for(this.clear();++s<l;){var u=o[s];this.set(u[0],u[1])}}return i.prototype.clear=r,i.prototype.delete=e,i.prototype.get=t,i.prototype.has=n,i.prototype.set=a,_v=i,_v}var Sv,eC;function bV(){if(eC)return Sv;eC=1;var r=Sl(),e=Xm(),t=Qm(),n=200;function a(i,o){var s=this.__data__;if(s instanceof r){var l=s.__data__;if(!e||l.length<n-1)return l.push([i,o]),this.size=++s.size,this;s=this.__data__=new t(l)}return s.set(i,o),this.size=s.size,this}return Sv=a,Sv}var Tv,rC;function Al(){if(rC)return Tv;rC=1;var r=Sl(),e=X3(),t=Q3(),n=J3(),a=eV(),i=bV();function o(s){var l=this.__data__=new r(s);this.size=l.size}return o.prototype.clear=e,o.prototype.delete=t,o.prototype.get=n,o.prototype.has=a,o.prototype.set=i,Tv=o,Tv}var Rv,tC;function Jm(){if(tC)return Rv;tC=1;function r(e,t){for(var n=-1,a=e==null?0:e.length;++n<a&&t(e[n],n,e)!==!1;);return e}return Rv=r,Rv}var Av,nC;function HA(){if(nC)return Av;nC=1;var r=di(),e=(function(){try{var t=r(Object,"defineProperty");return t({},"",{}),t}catch{}})();return Av=e,Av}var Pv,aC;function Pl(){if(aC)return Pv;aC=1;var r=HA();function e(t,n,a){n=="__proto__"&&r?r(t,n,{configurable:!0,enumerable:!0,value:a,writable:!0}):t[n]=a}return Pv=e,Pv}var Iv,iC;function Il(){if(iC)return Iv;iC=1;var r=Pl(),e=uo(),t=Object.prototype,n=t.hasOwnProperty;function a(i,o,s){var l=i[o];(!(n.call(i,o)&&e(l,s))||s===void 0&&!(o in i))&&r(i,o,s)}return Iv=a,Iv}var Dv,oC;function Es(){if(oC)return Dv;oC=1;var r=Il(),e=Pl();function t(n,a,i,o){var s=!i;i||(i={});for(var l=-1,u=a.length;++l<u;){var c=a[l],d=o?o(i[c],n[c],c,i,n):void 0;d===void 0&&(d=n[c]),s?e(i,c,d):r(i,c,d)}return i}return Dv=t,Dv}var Bv,sC;function wV(){if(sC)return Bv;sC=1;function r(e,t){for(var n=-1,a=Array(e);++n<e;)a[n]=t(n);return a}return Bv=r,Bv}var Mv,uC;function On(){if(uC)return Mv;uC=1;function r(e){return e!=null&&typeof e=="object"}return Mv=r,Mv}var kv,lC;function xV(){if(lC)return kv;lC=1;var r=ci(),e=On(),t="[object Arguments]";function n(a){return e(a)&&r(a)==t}return kv=n,kv}var Ov,fC;function Cs(){if(fC)return Ov;fC=1;var r=xV(),e=On(),t=Object.prototype,n=t.hasOwnProperty,a=t.propertyIsEnumerable,i=r((function(){return arguments})())?r:function(o){return e(o)&&n.call(o,"callee")&&!a.call(o,"callee")};return Ov=i,Ov}var Lv,cC;function Zr(){if(cC)return Lv;cC=1;var r=Array.isArray;return Lv=r,Lv}var zo={exports:{}},qv,dC;function EV(){if(dC)return qv;dC=1;function r(){return!1}return qv=r,qv}zo.exports;var vC;function fo(){return vC||(vC=1,(function(r,e){var t=En(),n=EV(),a=e&&!e.nodeType&&e,i=a&&!0&&r&&!r.nodeType&&r,o=i&&i.exports===a,s=o?t.Buffer:void 0,l=s?s.isBuffer:void 0,u=l||n;r.exports=u})(zo,zo.exports)),zo.exports}var Nv,hC;function Dl(){if(hC)return Nv;hC=1;var r=9007199254740991,e=/^(?:0|[1-9]\d*)$/;function t(n,a){var i=typeof n;return a=a??r,!!a&&(i=="number"||i!="symbol"&&e.test(n))&&n>-1&&n%1==0&&n<a}return Nv=t,Nv}var Fv,gC;function e0(){if(gC)return Fv;gC=1;var r=9007199254740991;function e(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=r}return Fv=e,Fv}var zv,pC;function CV(){if(pC)return zv;pC=1;var r=ci(),e=e0(),t=On(),n="[object Arguments]",a="[object Array]",i="[object Boolean]",o="[object Date]",s="[object Error]",l="[object Function]",u="[object Map]",c="[object Number]",d="[object Object]",h="[object RegExp]",g="[object Set]",p="[object String]",E="[object WeakMap]",y="[object ArrayBuffer]",b="[object DataView]",w="[object Float32Array]",x="[object Float64Array]",C="[object Int8Array]",T="[object Int16Array]",S="[object Int32Array]",_="[object Uint8Array]",A="[object Uint8ClampedArray]",P="[object Uint16Array]",I="[object Uint32Array]",D={};D[w]=D[x]=D[C]=D[T]=D[S]=D[_]=D[A]=D[P]=D[I]=!0,D[n]=D[a]=D[y]=D[i]=D[b]=D[o]=D[s]=D[l]=D[u]=D[c]=D[d]=D[h]=D[g]=D[p]=D[E]=!1;function k(M){return t(M)&&e(M.length)&&!!D[r(M)]}return zv=k,zv}var $v,yC;function Bl(){if(yC)return $v;yC=1;function r(e){return function(t){return e(t)}}return $v=r,$v}var $o={exports:{}};$o.exports;var mC;function r0(){return mC||(mC=1,(function(r,e){var t=WA(),n=e&&!e.nodeType&&e,a=n&&!0&&r&&!r.nodeType&&r,i=a&&a.exports===n,o=i&&t.process,s=(function(){try{var l=a&&a.require&&a.require("util").types;return l||o&&o.binding&&o.binding("util")}catch{}})();r.exports=s})($o,$o.exports)),$o.exports}var Vv,bC;function _s(){if(bC)return Vv;bC=1;var r=CV(),e=Bl(),t=r0(),n=t&&t.isTypedArray,a=n?e(n):r;return Vv=a,Vv}var Gv,wC;function KA(){if(wC)return Gv;wC=1;var r=wV(),e=Cs(),t=Zr(),n=fo(),a=Dl(),i=_s(),o=Object.prototype,s=o.hasOwnProperty;function l(u,c){var d=t(u),h=!d&&e(u),g=!d&&!h&&n(u),p=!d&&!h&&!g&&i(u),E=d||h||g||p,y=E?r(u.length,String):[],b=y.length;for(var w in u)(c||s.call(u,w))&&!(E&&(w=="length"||g&&(w=="offset"||w=="parent")||p&&(w=="buffer"||w=="byteLength"||w=="byteOffset")||a(w,b)))&&y.push(w);return y}return Gv=l,Gv}var Wv,xC;function Ml(){if(xC)return Wv;xC=1;var r=Object.prototype;function e(t){var n=t&&t.constructor,a=typeof n=="function"&&n.prototype||r;return t===a}return Wv=e,Wv}var Uv,EC;function jA(){if(EC)return Uv;EC=1;function r(e,t){return function(n){return e(t(n))}}return Uv=r,Uv}var Hv,CC;function _V(){if(CC)return Hv;CC=1;var r=jA(),e=r(Object.keys,Object);return Hv=e,Hv}var Kv,_C;function t0(){if(_C)return Kv;_C=1;var r=Ml(),e=_V(),t=Object.prototype,n=t.hasOwnProperty;function a(i){if(!r(i))return e(i);var o=[];for(var s in Object(i))n.call(i,s)&&s!="constructor"&&o.push(s);return o}return Kv=a,Kv}var jv,SC;function ea(){if(SC)return jv;SC=1;var r=xs(),e=e0();function t(n){return n!=null&&e(n.length)&&!r(n)}return jv=t,jv}var Yv,TC;function qa(){if(TC)return Yv;TC=1;var r=KA(),e=t0(),t=ea();function n(a){return t(a)?r(a):e(a)}return Yv=n,Yv}var Zv,RC;function SV(){if(RC)return Zv;RC=1;var r=Es(),e=qa();function t(n,a){return n&&r(a,e(a),n)}return Zv=t,Zv}var Xv,AC;function TV(){if(AC)return Xv;AC=1;function r(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}return Xv=r,Xv}var Qv,PC;function RV(){if(PC)return Qv;PC=1;var r=fn(),e=Ml(),t=TV(),n=Object.prototype,a=n.hasOwnProperty;function i(o){if(!r(o))return t(o);var s=e(o),l=[];for(var u in o)u=="constructor"&&(s||!a.call(o,u))||l.push(u);return l}return Qv=i,Qv}var Jv,IC;function vi(){if(IC)return Jv;IC=1;var r=KA(),e=RV(),t=ea();function n(a){return t(a)?r(a,!0):e(a)}return Jv=n,Jv}var eh,DC;function AV(){if(DC)return eh;DC=1;var r=Es(),e=vi();function t(n,a){return n&&r(a,e(a),n)}return eh=t,eh}var Vo={exports:{}};Vo.exports;var BC;function YA(){return BC||(BC=1,(function(r,e){var t=En(),n=e&&!e.nodeType&&e,a=n&&!0&&r&&!r.nodeType&&r,i=a&&a.exports===n,o=i?t.Buffer:void 0,s=o?o.allocUnsafe:void 0;function l(u,c){if(c)return u.slice();var d=u.length,h=s?s(d):new u.constructor(d);return u.copy(h),h}r.exports=l})(Vo,Vo.exports)),Vo.exports}var rh,MC;function ZA(){if(MC)return rh;MC=1;function r(e,t){var n=-1,a=e.length;for(t||(t=Array(a));++n<a;)t[n]=e[n];return t}return rh=r,rh}var th,kC;function XA(){if(kC)return th;kC=1;function r(e,t){for(var n=-1,a=e==null?0:e.length,i=0,o=[];++n<a;){var s=e[n];t(s,n,e)&&(o[i++]=s)}return o}return th=r,th}var nh,OC;function QA(){if(OC)return nh;OC=1;function r(){return[]}return nh=r,nh}var ah,LC;function n0(){if(LC)return ah;LC=1;var r=XA(),e=QA(),t=Object.prototype,n=t.propertyIsEnumerable,a=Object.getOwnPropertySymbols,i=a?function(o){return o==null?[]:(o=Object(o),r(a(o),function(s){return n.call(o,s)}))}:e;return ah=i,ah}var ih,qC;function PV(){if(qC)return ih;qC=1;var r=Es(),e=n0();function t(n,a){return r(n,e(n),a)}return ih=t,ih}var oh,NC;function a0(){if(NC)return oh;NC=1;function r(e,t){for(var n=-1,a=t.length,i=e.length;++n<a;)e[i+n]=t[n];return e}return oh=r,oh}var sh,FC;function kl(){if(FC)return sh;FC=1;var r=jA(),e=r(Object.getPrototypeOf,Object);return sh=e,sh}var uh,zC;function JA(){if(zC)return uh;zC=1;var r=a0(),e=kl(),t=n0(),n=QA(),a=Object.getOwnPropertySymbols,i=a?function(o){for(var s=[];o;)r(s,t(o)),o=e(o);return s}:n;return uh=i,uh}var lh,$C;function IV(){if($C)return lh;$C=1;var r=Es(),e=JA();function t(n,a){return r(n,e(n),a)}return lh=t,lh}var fh,VC;function eP(){if(VC)return fh;VC=1;var r=a0(),e=Zr();function t(n,a,i){var o=a(n);return e(n)?o:r(o,i(n))}return fh=t,fh}var ch,GC;function rP(){if(GC)return ch;GC=1;var r=eP(),e=n0(),t=qa();function n(a){return r(a,t,e)}return ch=n,ch}var dh,WC;function DV(){if(WC)return dh;WC=1;var r=eP(),e=JA(),t=vi();function n(a){return r(a,t,e)}return dh=n,dh}var vh,UC;function BV(){if(UC)return vh;UC=1;var r=di(),e=En(),t=r(e,"DataView");return vh=t,vh}var hh,HC;function MV(){if(HC)return hh;HC=1;var r=di(),e=En(),t=r(e,"Promise");return hh=t,hh}var gh,KC;function tP(){if(KC)return gh;KC=1;var r=di(),e=En(),t=r(e,"Set");return gh=t,gh}var ph,jC;function kV(){if(jC)return ph;jC=1;var r=di(),e=En(),t=r(e,"WeakMap");return ph=t,ph}var yh,YC;function co(){if(YC)return yh;YC=1;var r=BV(),e=Xm(),t=MV(),n=tP(),a=kV(),i=ci(),o=UA(),s="[object Map]",l="[object Object]",u="[object Promise]",c="[object Set]",d="[object WeakMap]",h="[object DataView]",g=o(r),p=o(e),E=o(t),y=o(n),b=o(a),w=i;return(r&&w(new r(new ArrayBuffer(1)))!=h||e&&w(new e)!=s||t&&w(t.resolve())!=u||n&&w(new n)!=c||a&&w(new a)!=d)&&(w=function(x){var C=i(x),T=C==l?x.constructor:void 0,S=T?o(T):"";if(S)switch(S){case g:return h;case p:return s;case E:return u;case y:return c;case b:return d}return C}),yh=w,yh}var mh,ZC;function OV(){if(ZC)return mh;ZC=1;var r=Object.prototype,e=r.hasOwnProperty;function t(n){var a=n.length,i=new n.constructor(a);return a&&typeof n[0]=="string"&&e.call(n,"index")&&(i.index=n.index,i.input=n.input),i}return mh=t,mh}var bh,XC;function nP(){if(XC)return bh;XC=1;var r=En(),e=r.Uint8Array;return bh=e,bh}var wh,QC;function i0(){if(QC)return wh;QC=1;var r=nP();function e(t){var n=new t.constructor(t.byteLength);return new r(n).set(new r(t)),n}return wh=e,wh}var xh,JC;function LV(){if(JC)return xh;JC=1;var r=i0();function e(t,n){var a=n?r(t.buffer):t.buffer;return new t.constructor(a,t.byteOffset,t.byteLength)}return xh=e,xh}var Eh,e_;function qV(){if(e_)return Eh;e_=1;var r=/\w*$/;function e(t){var n=new t.constructor(t.source,r.exec(t));return n.lastIndex=t.lastIndex,n}return Eh=e,Eh}var Ch,r_;function NV(){if(r_)return Ch;r_=1;var r=lo(),e=r?r.prototype:void 0,t=e?e.valueOf:void 0;function n(a){return t?Object(t.call(a)):{}}return Ch=n,Ch}var _h,t_;function aP(){if(t_)return _h;t_=1;var r=i0();function e(t,n){var a=n?r(t.buffer):t.buffer;return new t.constructor(a,t.byteOffset,t.length)}return _h=e,_h}var Sh,n_;function FV(){if(n_)return Sh;n_=1;var r=i0(),e=LV(),t=qV(),n=NV(),a=aP(),i="[object Boolean]",o="[object Date]",s="[object Map]",l="[object Number]",u="[object RegExp]",c="[object Set]",d="[object String]",h="[object Symbol]",g="[object ArrayBuffer]",p="[object DataView]",E="[object Float32Array]",y="[object Float64Array]",b="[object Int8Array]",w="[object Int16Array]",x="[object Int32Array]",C="[object Uint8Array]",T="[object Uint8ClampedArray]",S="[object Uint16Array]",_="[object Uint32Array]";function A(P,I,D){var k=P.constructor;switch(I){case g:return r(P);case i:case o:return new k(+P);case p:return e(P,D);case E:case y:case b:case w:case x:case C:case T:case S:case _:return a(P,D);case s:return new k;case l:case d:return new k(P);case u:return t(P);case c:return new k;case h:return n(P)}}return Sh=A,Sh}var Th,a_;function iP(){if(a_)return Th;a_=1;var r=fn(),e=Object.create,t=(function(){function n(){}return function(a){if(!r(a))return{};if(e)return e(a);n.prototype=a;var i=new n;return n.prototype=void 0,i}})();return Th=t,Th}var Rh,i_;function oP(){if(i_)return Rh;i_=1;var r=iP(),e=kl(),t=Ml();function n(a){return typeof a.constructor=="function"&&!t(a)?r(e(a)):{}}return Rh=n,Rh}var Ah,o_;function zV(){if(o_)return Ah;o_=1;var r=co(),e=On(),t="[object Map]";function n(a){return e(a)&&r(a)==t}return Ah=n,Ah}var Ph,s_;function $V(){if(s_)return Ph;s_=1;var r=zV(),e=Bl(),t=r0(),n=t&&t.isMap,a=n?e(n):r;return Ph=a,Ph}var Ih,u_;function VV(){if(u_)return Ih;u_=1;var r=co(),e=On(),t="[object Set]";function n(a){return e(a)&&r(a)==t}return Ih=n,Ih}var Dh,l_;function GV(){if(l_)return Dh;l_=1;var r=VV(),e=Bl(),t=r0(),n=t&&t.isSet,a=n?e(n):r;return Dh=a,Dh}var Bh,f_;function sP(){if(f_)return Bh;f_=1;var r=Al(),e=Jm(),t=Il(),n=SV(),a=AV(),i=YA(),o=ZA(),s=PV(),l=IV(),u=rP(),c=DV(),d=co(),h=OV(),g=FV(),p=oP(),E=Zr(),y=fo(),b=$V(),w=fn(),x=GV(),C=qa(),T=vi(),S=1,_=2,A=4,P="[object Arguments]",I="[object Array]",D="[object Boolean]",k="[object Date]",M="[object Error]",N="[object Function]",z="[object GeneratorFunction]",$="[object Map]",q="[object Number]",V="[object Object]",Z="[object RegExp]",K="[object Set]",j="[object String]",ee="[object Symbol]",le="[object WeakMap]",W="[object ArrayBuffer]",G="[object DataView]",Y="[object Float32Array]",re="[object Float64Array]",de="[object Int8Array]",se="[object Int16Array]",X="[object Int32Array]",Q="[object Uint8Array]",ae="[object Uint8ClampedArray]",te="[object Uint16Array]",ce="[object Uint32Array]",_e={};_e[P]=_e[I]=_e[W]=_e[G]=_e[D]=_e[k]=_e[Y]=_e[re]=_e[de]=_e[se]=_e[X]=_e[$]=_e[q]=_e[V]=_e[Z]=_e[K]=_e[j]=_e[ee]=_e[Q]=_e[ae]=_e[te]=_e[ce]=!0,_e[M]=_e[N]=_e[le]=!1;function ve(U,fe,xe,ge,be,Ae){var De,Be=fe&S,Le=fe&_,He=fe&A;if(xe&&(De=be?xe(U,ge,be,Ae):xe(U)),De!==void 0)return De;if(!w(U))return U;var Ve=E(U);if(Ve){if(De=h(U),!Be)return o(U,De)}else{var Xe=d(U),er=Xe==N||Xe==z;if(y(U))return i(U,Be);if(Xe==V||Xe==P||er&&!be){if(De=Le||er?{}:p(U),!Be)return Le?l(U,a(De,U)):s(U,n(De,U))}else{if(!_e[Xe])return be?U:{};De=g(U,Xe,Be)}}Ae||(Ae=new r);var $e=Ae.get(U);if($e)return $e;Ae.set(U,De),x(U)?U.forEach(function(O){De.add(ve(O,fe,xe,O,U,Ae))}):b(U)&&U.forEach(function(O,oe){De.set(oe,ve(O,fe,xe,oe,U,Ae))});var ke=He?Le?c:u:Le?T:C,ye=Ve?void 0:ke(U);return e(ye||U,function(O,oe){ye&&(oe=O,O=U[oe]),t(De,oe,ve(O,fe,xe,oe,U,Ae))}),De}return Bh=ve,Bh}var Mh,c_;function WV(){if(c_)return Mh;c_=1;var r=sP(),e=4;function t(n){return r(n,e)}return Mh=t,Mh}var kh,d_;function o0(){if(d_)return kh;d_=1;function r(e){return function(){return e}}return kh=r,kh}var Oh,v_;function UV(){if(v_)return Oh;v_=1;function r(e){return function(t,n,a){for(var i=-1,o=Object(t),s=a(t),l=s.length;l--;){var u=s[e?l:++i];if(n(o[u],u,o)===!1)break}return t}}return Oh=r,Oh}var Lh,h_;function s0(){if(h_)return Lh;h_=1;var r=UV(),e=r();return Lh=e,Lh}var qh,g_;function u0(){if(g_)return qh;g_=1;var r=s0(),e=qa();function t(n,a){return n&&r(n,a,e)}return qh=t,qh}var Nh,p_;function HV(){if(p_)return Nh;p_=1;var r=ea();function e(t,n){return function(a,i){if(a==null)return a;if(!r(a))return t(a,i);for(var o=a.length,s=n?o:-1,l=Object(a);(n?s--:++s<o)&&i(l[s],s,l)!==!1;);return a}}return Nh=e,Nh}var Fh,y_;function Ol(){if(y_)return Fh;y_=1;var r=u0(),e=HV(),t=e(r);return Fh=t,Fh}var zh,m_;function hi(){if(m_)return zh;m_=1;function r(e){return e}return zh=r,zh}var $h,b_;function uP(){if(b_)return $h;b_=1;var r=hi();function e(t){return typeof t=="function"?t:r}return $h=e,$h}var Vh,w_;function lP(){if(w_)return Vh;w_=1;var r=Jm(),e=Ol(),t=uP(),n=Zr();function a(i,o){var s=n(i)?r:e;return s(i,t(o))}return Vh=a,Vh}var Gh,x_;function fP(){return x_||(x_=1,Gh=lP()),Gh}var Wh,E_;function KV(){if(E_)return Wh;E_=1;var r=Ol();function e(t,n){var a=[];return r(t,function(i,o,s){n(i,o,s)&&a.push(i)}),a}return Wh=e,Wh}var Uh,C_;function jV(){if(C_)return Uh;C_=1;var r="__lodash_hash_undefined__";function e(t){return this.__data__.set(t,r),this}return Uh=e,Uh}var Hh,__;function YV(){if(__)return Hh;__=1;function r(e){return this.__data__.has(e)}return Hh=r,Hh}var Kh,S_;function cP(){if(S_)return Kh;S_=1;var r=Qm(),e=jV(),t=YV();function n(a){var i=-1,o=a==null?0:a.length;for(this.__data__=new r;++i<o;)this.add(a[i])}return n.prototype.add=n.prototype.push=e,n.prototype.has=t,Kh=n,Kh}var jh,T_;function ZV(){if(T_)return jh;T_=1;function r(e,t){for(var n=-1,a=e==null?0:e.length;++n<a;)if(t(e[n],n,e))return!0;return!1}return jh=r,jh}var Yh,R_;function dP(){if(R_)return Yh;R_=1;function r(e,t){return e.has(t)}return Yh=r,Yh}var Zh,A_;function vP(){if(A_)return Zh;A_=1;var r=cP(),e=ZV(),t=dP(),n=1,a=2;function i(o,s,l,u,c,d){var h=l&n,g=o.length,p=s.length;if(g!=p&&!(h&&p>g))return!1;var E=d.get(o),y=d.get(s);if(E&&y)return E==s&&y==o;var b=-1,w=!0,x=l&a?new r:void 0;for(d.set(o,s),d.set(s,o);++b<g;){var C=o[b],T=s[b];if(u)var S=h?u(T,C,b,s,o,d):u(C,T,b,o,s,d);if(S!==void 0){if(S)continue;w=!1;break}if(x){if(!e(s,function(_,A){if(!t(x,A)&&(C===_||c(C,_,l,u,d)))return x.push(A)})){w=!1;break}}else if(!(C===T||c(C,T,l,u,d))){w=!1;break}}return d.delete(o),d.delete(s),w}return Zh=i,Zh}var Xh,P_;function XV(){if(P_)return Xh;P_=1;function r(e){var t=-1,n=Array(e.size);return e.forEach(function(a,i){n[++t]=[i,a]}),n}return Xh=r,Xh}var Qh,I_;function l0(){if(I_)return Qh;I_=1;function r(e){var t=-1,n=Array(e.size);return e.forEach(function(a){n[++t]=a}),n}return Qh=r,Qh}var Jh,D_;function QV(){if(D_)return Jh;D_=1;var r=lo(),e=nP(),t=uo(),n=vP(),a=XV(),i=l0(),o=1,s=2,l="[object Boolean]",u="[object Date]",c="[object Error]",d="[object Map]",h="[object Number]",g="[object RegExp]",p="[object Set]",E="[object String]",y="[object Symbol]",b="[object ArrayBuffer]",w="[object DataView]",x=r?r.prototype:void 0,C=x?x.valueOf:void 0;function T(S,_,A,P,I,D,k){switch(A){case w:if(S.byteLength!=_.byteLength||S.byteOffset!=_.byteOffset)return!1;S=S.buffer,_=_.buffer;case b:return!(S.byteLength!=_.byteLength||!D(new e(S),new e(_)));case l:case u:case h:return t(+S,+_);case c:return S.name==_.name&&S.message==_.message;case g:case E:return S==_+"";case d:var M=a;case p:var N=P&o;if(M||(M=i),S.size!=_.size&&!N)return!1;var z=k.get(S);if(z)return z==_;P|=s,k.set(S,_);var $=n(M(S),M(_),P,I,D,k);return k.delete(S),$;case y:if(C)return C.call(S)==C.call(_)}return!1}return Jh=T,Jh}var eg,B_;function JV(){if(B_)return eg;B_=1;var r=rP(),e=1,t=Object.prototype,n=t.hasOwnProperty;function a(i,o,s,l,u,c){var d=s&e,h=r(i),g=h.length,p=r(o),E=p.length;if(g!=E&&!d)return!1;for(var y=g;y--;){var b=h[y];if(!(d?b in o:n.call(o,b)))return!1}var w=c.get(i),x=c.get(o);if(w&&x)return w==o&&x==i;var C=!0;c.set(i,o),c.set(o,i);for(var T=d;++y<g;){b=h[y];var S=i[b],_=o[b];if(l)var A=d?l(_,S,b,o,i,c):l(S,_,b,i,o,c);if(!(A===void 0?S===_||u(S,_,s,l,c):A)){C=!1;break}T||(T=b=="constructor")}if(C&&!T){var P=i.constructor,I=o.constructor;P!=I&&"constructor"in i&&"constructor"in o&&!(typeof P=="function"&&P instanceof P&&typeof I=="function"&&I instanceof I)&&(C=!1)}return c.delete(i),c.delete(o),C}return eg=a,eg}var rg,M_;function e4(){if(M_)return rg;M_=1;var r=Al(),e=vP(),t=QV(),n=JV(),a=co(),i=Zr(),o=fo(),s=_s(),l=1,u="[object Arguments]",c="[object Array]",d="[object Object]",h=Object.prototype,g=h.hasOwnProperty;function p(E,y,b,w,x,C){var T=i(E),S=i(y),_=T?c:a(E),A=S?c:a(y);_=_==u?d:_,A=A==u?d:A;var P=_==d,I=A==d,D=_==A;if(D&&o(E)){if(!o(y))return!1;T=!0,P=!1}if(D&&!P)return C||(C=new r),T||s(E)?e(E,y,b,w,x,C):t(E,y,_,b,w,x,C);if(!(b&l)){var k=P&&g.call(E,"__wrapped__"),M=I&&g.call(y,"__wrapped__");if(k||M){var N=k?E.value():E,z=M?y.value():y;return C||(C=new r),x(N,z,b,w,C)}}return D?(C||(C=new r),n(E,y,b,w,x,C)):!1}return rg=p,rg}var tg,k_;function hP(){if(k_)return tg;k_=1;var r=e4(),e=On();function t(n,a,i,o,s){return n===a?!0:n==null||a==null||!e(n)&&!e(a)?n!==n&&a!==a:r(n,a,i,o,t,s)}return tg=t,tg}var ng,O_;function r4(){if(O_)return ng;O_=1;var r=Al(),e=hP(),t=1,n=2;function a(i,o,s,l){var u=s.length,c=u,d=!l;if(i==null)return!c;for(i=Object(i);u--;){var h=s[u];if(d&&h[2]?h[1]!==i[h[0]]:!(h[0]in i))return!1}for(;++u<c;){h=s[u];var g=h[0],p=i[g],E=h[1];if(d&&h[2]){if(p===void 0&&!(g in i))return!1}else{var y=new r;if(l)var b=l(p,E,g,i,o,y);if(!(b===void 0?e(E,p,t|n,l,y):b))return!1}}return!0}return ng=a,ng}var ag,L_;function gP(){if(L_)return ag;L_=1;var r=fn();function e(t){return t===t&&!r(t)}return ag=e,ag}var ig,q_;function t4(){if(q_)return ig;q_=1;var r=gP(),e=qa();function t(n){for(var a=e(n),i=a.length;i--;){var o=a[i],s=n[o];a[i]=[o,s,r(s)]}return a}return ig=t,ig}var og,N_;function pP(){if(N_)return og;N_=1;function r(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}return og=r,og}var sg,F_;function n4(){if(F_)return sg;F_=1;var r=r4(),e=t4(),t=pP();function n(a){var i=e(a);return i.length==1&&i[0][2]?t(i[0][0],i[0][1]):function(o){return o===a||r(o,a,i)}}return sg=n,sg}var ug,z_;function vo(){if(z_)return ug;z_=1;var r=ci(),e=On(),t="[object Symbol]";function n(a){return typeof a=="symbol"||e(a)&&r(a)==t}return ug=n,ug}var lg,$_;function f0(){if($_)return lg;$_=1;var r=Zr(),e=vo(),t=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,n=/^\w*$/;function a(i,o){if(r(i))return!1;var s=typeof i;return s=="number"||s=="symbol"||s=="boolean"||i==null||e(i)?!0:n.test(i)||!t.test(i)||o!=null&&i in Object(o)}return lg=a,lg}var fg,V_;function a4(){if(V_)return fg;V_=1;var r=Qm(),e="Expected a function";function t(n,a){if(typeof n!="function"||a!=null&&typeof a!="function")throw new TypeError(e);var i=function(){var o=arguments,s=a?a.apply(this,o):o[0],l=i.cache;if(l.has(s))return l.get(s);var u=n.apply(this,o);return i.cache=l.set(s,u)||l,u};return i.cache=new(t.Cache||r),i}return t.Cache=r,fg=t,fg}var cg,G_;function i4(){if(G_)return cg;G_=1;var r=a4(),e=500;function t(n){var a=r(n,function(o){return i.size===e&&i.clear(),o}),i=a.cache;return a}return cg=t,cg}var dg,W_;function o4(){if(W_)return dg;W_=1;var r=i4(),e=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,t=/\\(\\)?/g,n=r(function(a){var i=[];return a.charCodeAt(0)===46&&i.push(""),a.replace(e,function(o,s,l,u){i.push(l?u.replace(t,"$1"):s||o)}),i});return dg=n,dg}var vg,U_;function Ll(){if(U_)return vg;U_=1;function r(e,t){for(var n=-1,a=e==null?0:e.length,i=Array(a);++n<a;)i[n]=t(e[n],n,e);return i}return vg=r,vg}var hg,H_;function s4(){if(H_)return hg;H_=1;var r=lo(),e=Ll(),t=Zr(),n=vo(),a=r?r.prototype:void 0,i=a?a.toString:void 0;function o(s){if(typeof s=="string")return s;if(t(s))return e(s,o)+"";if(n(s))return i?i.call(s):"";var l=s+"";return l=="0"&&1/s==-1/0?"-0":l}return hg=o,hg}var gg,K_;function yP(){if(K_)return gg;K_=1;var r=s4();function e(t){return t==null?"":r(t)}return gg=e,gg}var pg,j_;function ql(){if(j_)return pg;j_=1;var r=Zr(),e=f0(),t=o4(),n=yP();function a(i,o){return r(i)?i:e(i,o)?[i]:t(n(i))}return pg=a,pg}var yg,Y_;function Ss(){if(Y_)return yg;Y_=1;var r=vo();function e(t){if(typeof t=="string"||r(t))return t;var n=t+"";return n=="0"&&1/t==-1/0?"-0":n}return yg=e,yg}var mg,Z_;function Nl(){if(Z_)return mg;Z_=1;var r=ql(),e=Ss();function t(n,a){a=r(a,n);for(var i=0,o=a.length;n!=null&&i<o;)n=n[e(a[i++])];return i&&i==o?n:void 0}return mg=t,mg}var bg,X_;function u4(){if(X_)return bg;X_=1;var r=Nl();function e(t,n,a){var i=t==null?void 0:r(t,n);return i===void 0?a:i}return bg=e,bg}var wg,Q_;function l4(){if(Q_)return wg;Q_=1;function r(e,t){return e!=null&&t in Object(e)}return wg=r,wg}var xg,J_;function mP(){if(J_)return xg;J_=1;var r=ql(),e=Cs(),t=Zr(),n=Dl(),a=e0(),i=Ss();function o(s,l,u){l=r(l,s);for(var c=-1,d=l.length,h=!1;++c<d;){var g=i(l[c]);if(!(h=s!=null&&u(s,g)))break;s=s[g]}return h||++c!=d?h:(d=s==null?0:s.length,!!d&&a(d)&&n(g,d)&&(t(s)||e(s)))}return xg=o,xg}var Eg,eS;function bP(){if(eS)return Eg;eS=1;var r=l4(),e=mP();function t(n,a){return n!=null&&e(n,a,r)}return Eg=t,Eg}var Cg,rS;function f4(){if(rS)return Cg;rS=1;var r=hP(),e=u4(),t=bP(),n=f0(),a=gP(),i=pP(),o=Ss(),s=1,l=2;function u(c,d){return n(c)&&a(d)?i(o(c),d):function(h){var g=e(h,c);return g===void 0&&g===d?t(h,c):r(d,g,s|l)}}return Cg=u,Cg}var _g,tS;function wP(){if(tS)return _g;tS=1;function r(e){return function(t){return t==null?void 0:t[e]}}return _g=r,_g}var Sg,nS;function c4(){if(nS)return Sg;nS=1;var r=Nl();function e(t){return function(n){return r(n,t)}}return Sg=e,Sg}var Tg,aS;function d4(){if(aS)return Tg;aS=1;var r=wP(),e=c4(),t=f0(),n=Ss();function a(i){return t(i)?r(n(i)):e(i)}return Tg=a,Tg}var Rg,iS;function ra(){if(iS)return Rg;iS=1;var r=n4(),e=f4(),t=hi(),n=Zr(),a=d4();function i(o){return typeof o=="function"?o:o==null?t:typeof o=="object"?n(o)?e(o[0],o[1]):r(o):a(o)}return Rg=i,Rg}var Ag,oS;function xP(){if(oS)return Ag;oS=1;var r=XA(),e=KV(),t=ra(),n=Zr();function a(i,o){var s=n(i)?r:e;return s(i,t(o,3))}return Ag=a,Ag}var Pg,sS;function v4(){if(sS)return Pg;sS=1;var r=Object.prototype,e=r.hasOwnProperty;function t(n,a){return n!=null&&e.call(n,a)}return Pg=t,Pg}var Ig,uS;function EP(){if(uS)return Ig;uS=1;var r=v4(),e=mP();function t(n,a){return n!=null&&e(n,a,r)}return Ig=t,Ig}var Dg,lS;function h4(){if(lS)return Dg;lS=1;var r=t0(),e=co(),t=Cs(),n=Zr(),a=ea(),i=fo(),o=Ml(),s=_s(),l="[object Map]",u="[object Set]",c=Object.prototype,d=c.hasOwnProperty;function h(g){if(g==null)return!0;if(a(g)&&(n(g)||typeof g=="string"||typeof g.splice=="function"||i(g)||s(g)||t(g)))return!g.length;var p=e(g);if(p==l||p==u)return!g.size;if(o(g))return!r(g).length;for(var E in g)if(d.call(g,E))return!1;return!0}return Dg=h,Dg}var Bg,fS;function CP(){if(fS)return Bg;fS=1;function r(e){return e===void 0}return Bg=r,Bg}var Mg,cS;function _P(){if(cS)return Mg;cS=1;var r=Ol(),e=ea();function t(n,a){var i=-1,o=e(n)?Array(n.length):[];return r(n,function(s,l,u){o[++i]=a(s,l,u)}),o}return Mg=t,Mg}var kg,dS;function SP(){if(dS)return kg;dS=1;var r=Ll(),e=ra(),t=_P(),n=Zr();function a(i,o){var s=n(i)?r:t;return s(i,e(o,3))}return kg=a,kg}var Og,vS;function g4(){if(vS)return Og;vS=1;function r(e,t,n,a){var i=-1,o=e==null?0:e.length;for(a&&o&&(n=e[++i]);++i<o;)n=t(n,e[i],i,e);return n}return Og=r,Og}var Lg,hS;function p4(){if(hS)return Lg;hS=1;function r(e,t,n,a,i){return i(e,function(o,s,l){n=a?(a=!1,o):t(n,o,s,l)}),n}return Lg=r,Lg}var qg,gS;function TP(){if(gS)return qg;gS=1;var r=g4(),e=Ol(),t=ra(),n=p4(),a=Zr();function i(o,s,l){var u=a(o)?r:n,c=arguments.length<3;return u(o,t(s,4),l,c,e)}return qg=i,qg}var Ng,pS;function y4(){if(pS)return Ng;pS=1;var r=ci(),e=Zr(),t=On(),n="[object String]";function a(i){return typeof i=="string"||!e(i)&&t(i)&&r(i)==n}return Ng=a,Ng}var Fg,yS;function m4(){if(yS)return Fg;yS=1;var r=wP(),e=r("length");return Fg=e,Fg}var zg,mS;function b4(){if(mS)return zg;mS=1;var r="\\ud800-\\udfff",e="\\u0300-\\u036f",t="\\ufe20-\\ufe2f",n="\\u20d0-\\u20ff",a=e+t+n,i="\\ufe0e\\ufe0f",o="\\u200d",s=RegExp("["+o+r+a+i+"]");function l(u){return s.test(u)}return zg=l,zg}var $g,bS;function w4(){if(bS)return $g;bS=1;var r="\\ud800-\\udfff",e="\\u0300-\\u036f",t="\\ufe20-\\ufe2f",n="\\u20d0-\\u20ff",a=e+t+n,i="\\ufe0e\\ufe0f",o="["+r+"]",s="["+a+"]",l="\\ud83c[\\udffb-\\udfff]",u="(?:"+s+"|"+l+")",c="[^"+r+"]",d="(?:\\ud83c[\\udde6-\\uddff]){2}",h="[\\ud800-\\udbff][\\udc00-\\udfff]",g="\\u200d",p=u+"?",E="["+i+"]?",y="(?:"+g+"(?:"+[c,d,h].join("|")+")"+E+p+")*",b=E+p+y,w="(?:"+[c+s+"?",s,d,h,o].join("|")+")",x=RegExp(l+"(?="+l+")|"+w+b,"g");function C(T){for(var S=x.lastIndex=0;x.test(T);)++S;return S}return $g=C,$g}var Vg,wS;function x4(){if(wS)return Vg;wS=1;var r=m4(),e=b4(),t=w4();function n(a){return e(a)?t(a):r(a)}return Vg=n,Vg}var Gg,xS;function E4(){if(xS)return Gg;xS=1;var r=t0(),e=co(),t=ea(),n=y4(),a=x4(),i="[object Map]",o="[object Set]";function s(l){if(l==null)return 0;if(t(l))return n(l)?a(l):l.length;var u=e(l);return u==i||u==o?l.size:r(l).length}return Gg=s,Gg}var Wg,ES;function C4(){if(ES)return Wg;ES=1;var r=Jm(),e=iP(),t=u0(),n=ra(),a=kl(),i=Zr(),o=fo(),s=xs(),l=fn(),u=_s();function c(d,h,g){var p=i(d),E=p||o(d)||u(d);if(h=n(h,4),g==null){var y=d&&d.constructor;E?g=p?new y:[]:l(d)?g=s(y)?e(a(d)):{}:g={}}return(E?r:t)(d,function(b,w,x){return h(g,b,w,x)}),g}return Wg=c,Wg}var Ug,CS;function _4(){if(CS)return Ug;CS=1;var r=lo(),e=Cs(),t=Zr(),n=r?r.isConcatSpreadable:void 0;function a(i){return t(i)||e(i)||!!(n&&i&&i[n])}return Ug=a,Ug}var Hg,_S;function c0(){if(_S)return Hg;_S=1;var r=a0(),e=_4();function t(n,a,i,o,s){var l=-1,u=n.length;for(i||(i=e),s||(s=[]);++l<u;){var c=n[l];a>0&&i(c)?a>1?t(c,a-1,i,o,s):r(s,c):o||(s[s.length]=c)}return s}return Hg=t,Hg}var Kg,SS;function S4(){if(SS)return Kg;SS=1;function r(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}return Kg=r,Kg}var jg,TS;function RP(){if(TS)return jg;TS=1;var r=S4(),e=Math.max;function t(n,a,i){return a=e(a===void 0?n.length-1:a,0),function(){for(var o=arguments,s=-1,l=e(o.length-a,0),u=Array(l);++s<l;)u[s]=o[a+s];s=-1;for(var c=Array(a+1);++s<a;)c[s]=o[s];return c[a]=i(u),r(n,this,c)}}return jg=t,jg}var Yg,RS;function T4(){if(RS)return Yg;RS=1;var r=o0(),e=HA(),t=hi(),n=e?function(a,i){return e(a,"toString",{configurable:!0,enumerable:!1,value:r(i),writable:!0})}:t;return Yg=n,Yg}var Zg,AS;function R4(){if(AS)return Zg;AS=1;var r=800,e=16,t=Date.now;function n(a){var i=0,o=0;return function(){var s=t(),l=e-(s-o);if(o=s,l>0){if(++i>=r)return arguments[0]}else i=0;return a.apply(void 0,arguments)}}return Zg=n,Zg}var Xg,PS;function AP(){if(PS)return Xg;PS=1;var r=T4(),e=R4(),t=e(r);return Xg=t,Xg}var Qg,IS;function Fl(){if(IS)return Qg;IS=1;var r=hi(),e=RP(),t=AP();function n(a,i){return t(e(a,i,r),a+"")}return Qg=n,Qg}var Jg,DS;function PP(){if(DS)return Jg;DS=1;function r(e,t,n,a){for(var i=e.length,o=n+(a?1:-1);a?o--:++o<i;)if(t(e[o],o,e))return o;return-1}return Jg=r,Jg}var ep,BS;function A4(){if(BS)return ep;BS=1;function r(e){return e!==e}return ep=r,ep}var rp,MS;function P4(){if(MS)return rp;MS=1;function r(e,t,n){for(var a=n-1,i=e.length;++a<i;)if(e[a]===t)return a;return-1}return rp=r,rp}var tp,kS;function I4(){if(kS)return tp;kS=1;var r=PP(),e=A4(),t=P4();function n(a,i,o){return i===i?t(a,i,o):r(a,e,o)}return tp=n,tp}var np,OS;function D4(){if(OS)return np;OS=1;var r=I4();function e(t,n){var a=t==null?0:t.length;return!!a&&r(t,n,0)>-1}return np=e,np}var ap,LS;function B4(){if(LS)return ap;LS=1;function r(e,t,n){for(var a=-1,i=e==null?0:e.length;++a<i;)if(n(t,e[a]))return!0;return!1}return ap=r,ap}var ip,qS;function M4(){if(qS)return ip;qS=1;function r(){}return ip=r,ip}var op,NS;function k4(){if(NS)return op;NS=1;var r=tP(),e=M4(),t=l0(),n=1/0,a=r&&1/t(new r([,-0]))[1]==n?function(i){return new r(i)}:e;return op=a,op}var sp,FS;function O4(){if(FS)return sp;FS=1;var r=cP(),e=D4(),t=B4(),n=dP(),a=k4(),i=l0(),o=200;function s(l,u,c){var d=-1,h=e,g=l.length,p=!0,E=[],y=E;if(c)p=!1,h=t;else if(g>=o){var b=u?null:a(l);if(b)return i(b);p=!1,h=n,y=new r}else y=u?[]:E;e:for(;++d<g;){var w=l[d],x=u?u(w):w;if(w=c||w!==0?w:0,p&&x===x){for(var C=y.length;C--;)if(y[C]===x)continue e;u&&y.push(x),E.push(w)}else h(y,x,c)||(y!==E&&y.push(x),E.push(w))}return E}return sp=s,sp}var up,zS;function IP(){if(zS)return up;zS=1;var r=ea(),e=On();function t(n){return e(n)&&r(n)}return up=t,up}var lp,$S;function L4(){if($S)return lp;$S=1;var r=c0(),e=Fl(),t=O4(),n=IP(),a=e(function(i){return t(r(i,1,n,!0))});return lp=a,lp}var fp,VS;function q4(){if(VS)return fp;VS=1;var r=Ll();function e(t,n){return r(n,function(a){return t[a]})}return fp=e,fp}var cp,GS;function DP(){if(GS)return cp;GS=1;var r=q4(),e=qa();function t(n){return n==null?[]:r(n,e(n))}return cp=t,cp}var dp,WS;function cn(){if(WS)return dp;WS=1;var r;if(typeof Zm=="function")try{r={clone:WV(),constant:o0(),each:fP(),filter:xP(),has:EP(),isArray:Zr(),isEmpty:h4(),isFunction:xs(),isUndefined:CP(),keys:qa(),map:SP(),reduce:TP(),size:E4(),transform:C4(),union:L4(),values:DP()}}catch{}return r||(r=window._),dp=r,dp}var vp,US;function d0(){if(US)return vp;US=1;var r=cn();vp=a;var e="\0",t="\0",n="";function a(c){this._isDirected=r.has(c,"directed")?c.directed:!0,this._isMultigraph=r.has(c,"multigraph")?c.multigraph:!1,this._isCompound=r.has(c,"compound")?c.compound:!1,this._label=void 0,this._defaultNodeLabelFn=r.constant(void 0),this._defaultEdgeLabelFn=r.constant(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[t]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}a.prototype._nodeCount=0,a.prototype._edgeCount=0,a.prototype.isDirected=function(){return this._isDirected},a.prototype.isMultigraph=function(){return this._isMultigraph},a.prototype.isCompound=function(){return this._isCompound},a.prototype.setGraph=function(c){return this._label=c,this},a.prototype.graph=function(){return this._label},a.prototype.setDefaultNodeLabel=function(c){return r.isFunction(c)||(c=r.constant(c)),this._defaultNodeLabelFn=c,this},a.prototype.nodeCount=function(){return this._nodeCount},a.prototype.nodes=function(){return r.keys(this._nodes)},a.prototype.sources=function(){var c=this;return r.filter(this.nodes(),function(d){return r.isEmpty(c._in[d])})},a.prototype.sinks=function(){var c=this;return r.filter(this.nodes(),function(d){return r.isEmpty(c._out[d])})},a.prototype.setNodes=function(c,d){var h=arguments,g=this;return r.each(c,function(p){h.length>1?g.setNode(p,d):g.setNode(p)}),this},a.prototype.setNode=function(c,d){return r.has(this._nodes,c)?(arguments.length>1&&(this._nodes[c]=d),this):(this._nodes[c]=arguments.length>1?d:this._defaultNodeLabelFn(c),this._isCompound&&(this._parent[c]=t,this._children[c]={},this._children[t][c]=!0),this._in[c]={},this._preds[c]={},this._out[c]={},this._sucs[c]={},++this._nodeCount,this)},a.prototype.node=function(c){return this._nodes[c]},a.prototype.hasNode=function(c){return r.has(this._nodes,c)},a.prototype.removeNode=function(c){var d=this;if(r.has(this._nodes,c)){var h=function(g){d.removeEdge(d._edgeObjs[g])};delete this._nodes[c],this._isCompound&&(this._removeFromParentsChildList(c),delete this._parent[c],r.each(this.children(c),function(g){d.setParent(g)}),delete this._children[c]),r.each(r.keys(this._in[c]),h),delete this._in[c],delete this._preds[c],r.each(r.keys(this._out[c]),h),delete this._out[c],delete this._sucs[c],--this._nodeCount}return this},a.prototype.setParent=function(c,d){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(r.isUndefined(d))d=t;else{d+="";for(var h=d;!r.isUndefined(h);h=this.parent(h))if(h===c)throw new Error("Setting "+d+" as parent of "+c+" would create a cycle");this.setNode(d)}return this.setNode(c),this._removeFromParentsChildList(c),this._parent[c]=d,this._children[d][c]=!0,this},a.prototype._removeFromParentsChildList=function(c){delete this._children[this._parent[c]][c]},a.prototype.parent=function(c){if(this._isCompound){var d=this._parent[c];if(d!==t)return d}},a.prototype.children=function(c){if(r.isUndefined(c)&&(c=t),this._isCompound){var d=this._children[c];if(d)return r.keys(d)}else{if(c===t)return this.nodes();if(this.hasNode(c))return[]}},a.prototype.predecessors=function(c){var d=this._preds[c];if(d)return r.keys(d)},a.prototype.successors=function(c){var d=this._sucs[c];if(d)return r.keys(d)},a.prototype.neighbors=function(c){var d=this.predecessors(c);if(d)return r.union(d,this.successors(c))},a.prototype.isLeaf=function(c){var d;return this.isDirected()?d=this.successors(c):d=this.neighbors(c),d.length===0},a.prototype.filterNodes=function(c){var d=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});d.setGraph(this.graph());var h=this;r.each(this._nodes,function(E,y){c(y)&&d.setNode(y,E)}),r.each(this._edgeObjs,function(E){d.hasNode(E.v)&&d.hasNode(E.w)&&d.setEdge(E,h.edge(E))});var g={};function p(E){var y=h.parent(E);return y===void 0||d.hasNode(y)?(g[E]=y,y):y in g?g[y]:p(y)}return this._isCompound&&r.each(d.nodes(),function(E){d.setParent(E,p(E))}),d},a.prototype.setDefaultEdgeLabel=function(c){return r.isFunction(c)||(c=r.constant(c)),this._defaultEdgeLabelFn=c,this},a.prototype.edgeCount=function(){return this._edgeCount},a.prototype.edges=function(){return r.values(this._edgeObjs)},a.prototype.setPath=function(c,d){var h=this,g=arguments;return r.reduce(c,function(p,E){return g.length>1?h.setEdge(p,E,d):h.setEdge(p,E),E}),this},a.prototype.setEdge=function(){var c,d,h,g,p=!1,E=arguments[0];typeof E=="object"&&E!==null&&"v"in E?(c=E.v,d=E.w,h=E.name,arguments.length===2&&(g=arguments[1],p=!0)):(c=E,d=arguments[1],h=arguments[3],arguments.length>2&&(g=arguments[2],p=!0)),c=""+c,d=""+d,r.isUndefined(h)||(h=""+h);var y=s(this._isDirected,c,d,h);if(r.has(this._edgeLabels,y))return p&&(this._edgeLabels[y]=g),this;if(!r.isUndefined(h)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(c),this.setNode(d),this._edgeLabels[y]=p?g:this._defaultEdgeLabelFn(c,d,h);var b=l(this._isDirected,c,d,h);return c=b.v,d=b.w,Object.freeze(b),this._edgeObjs[y]=b,i(this._preds[d],c),i(this._sucs[c],d),this._in[d][y]=b,this._out[c][y]=b,this._edgeCount++,this},a.prototype.edge=function(c,d,h){var g=arguments.length===1?u(this._isDirected,arguments[0]):s(this._isDirected,c,d,h);return this._edgeLabels[g]},a.prototype.hasEdge=function(c,d,h){var g=arguments.length===1?u(this._isDirected,arguments[0]):s(this._isDirected,c,d,h);return r.has(this._edgeLabels,g)},a.prototype.removeEdge=function(c,d,h){var g=arguments.length===1?u(this._isDirected,arguments[0]):s(this._isDirected,c,d,h),p=this._edgeObjs[g];return p&&(c=p.v,d=p.w,delete this._edgeLabels[g],delete this._edgeObjs[g],o(this._preds[d],c),o(this._sucs[c],d),delete this._in[d][g],delete this._out[c][g],this._edgeCount--),this},a.prototype.inEdges=function(c,d){var h=this._in[c];if(h){var g=r.values(h);return d?r.filter(g,function(p){return p.v===d}):g}},a.prototype.outEdges=function(c,d){var h=this._out[c];if(h){var g=r.values(h);return d?r.filter(g,function(p){return p.w===d}):g}},a.prototype.nodeEdges=function(c,d){var h=this.inEdges(c,d);if(h)return h.concat(this.outEdges(c,d))};function i(c,d){c[d]?c[d]++:c[d]=1}function o(c,d){--c[d]||delete c[d]}function s(c,d,h,g){var p=""+d,E=""+h;if(!c&&p>E){var y=p;p=E,E=y}return p+n+E+n+(r.isUndefined(g)?e:g)}function l(c,d,h,g){var p=""+d,E=""+h;if(!c&&p>E){var y=p;p=E,E=y}var b={v:p,w:E};return g&&(b.name=g),b}function u(c,d){return s(c,d.v,d.w,d.name)}return vp}var hp,HS;function N4(){return HS||(HS=1,hp="2.1.8"),hp}var gp,KS;function F4(){return KS||(KS=1,gp={Graph:d0(),version:N4()}),gp}var pp,jS;function z4(){if(jS)return pp;jS=1;var r=cn(),e=d0();pp={write:t,read:i};function t(o){var s={options:{directed:o.isDirected(),multigraph:o.isMultigraph(),compound:o.isCompound()},nodes:n(o),edges:a(o)};return r.isUndefined(o.graph())||(s.value=r.clone(o.graph())),s}function n(o){return r.map(o.nodes(),function(s){var l=o.node(s),u=o.parent(s),c={v:s};return r.isUndefined(l)||(c.value=l),r.isUndefined(u)||(c.parent=u),c})}function a(o){return r.map(o.edges(),function(s){var l=o.edge(s),u={v:s.v,w:s.w};return r.isUndefined(s.name)||(u.name=s.name),r.isUndefined(l)||(u.value=l),u})}function i(o){var s=new e(o.options).setGraph(o.value);return r.each(o.nodes,function(l){s.setNode(l.v,l.value),l.parent&&s.setParent(l.v,l.parent)}),r.each(o.edges,function(l){s.setEdge({v:l.v,w:l.w,name:l.name},l.value)}),s}return pp}var yp,YS;function $4(){if(YS)return yp;YS=1;var r=cn();yp=e;function e(t){var n={},a=[],i;function o(s){r.has(n,s)||(n[s]=!0,i.push(s),r.each(t.successors(s),o),r.each(t.predecessors(s),o))}return r.each(t.nodes(),function(s){i=[],o(s),i.length&&a.push(i)}),a}return yp}var mp,ZS;function BP(){if(ZS)return mp;ZS=1;var r=cn();mp=e;function e(){this._arr=[],this._keyIndices={}}return e.prototype.size=function(){return this._arr.length},e.prototype.keys=function(){return this._arr.map(function(t){return t.key})},e.prototype.has=function(t){return r.has(this._keyIndices,t)},e.prototype.priority=function(t){var n=this._keyIndices[t];if(n!==void 0)return this._arr[n].priority},e.prototype.min=function(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key},e.prototype.add=function(t,n){var a=this._keyIndices;if(t=String(t),!r.has(a,t)){var i=this._arr,o=i.length;return a[t]=o,i.push({key:t,priority:n}),this._decrease(o),!0}return!1},e.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var t=this._arr.pop();return delete this._keyIndices[t.key],this._heapify(0),t.key},e.prototype.decrease=function(t,n){var a=this._keyIndices[t];if(n>this._arr[a].priority)throw new Error("New priority is greater than current priority. Key: "+t+" Old: "+this._arr[a].priority+" New: "+n);this._arr[a].priority=n,this._decrease(a)},e.prototype._heapify=function(t){var n=this._arr,a=2*t,i=a+1,o=t;a<n.length&&(o=n[a].priority<n[o].priority?a:o,i<n.length&&(o=n[i].priority<n[o].priority?i:o),o!==t&&(this._swap(t,o),this._heapify(o)))},e.prototype._decrease=function(t){for(var n=this._arr,a=n[t].priority,i;t!==0&&(i=t>>1,!(n[i].priority<a));)this._swap(t,i),t=i},e.prototype._swap=function(t,n){var a=this._arr,i=this._keyIndices,o=a[t],s=a[n];a[t]=s,a[n]=o,i[s.key]=t,i[o.key]=n},mp}var bp,XS;function MP(){if(XS)return bp;XS=1;var r=cn(),e=BP();bp=n;var t=r.constant(1);function n(i,o,s,l){return a(i,String(o),s||t,l||function(u){return i.outEdges(u)})}function a(i,o,s,l){var u={},c=new e,d,h,g=function(p){var E=p.v!==d?p.v:p.w,y=u[E],b=s(p),w=h.distance+b;if(b<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+p+" Weight: "+b);w<y.distance&&(y.distance=w,y.predecessor=d,c.decrease(E,w))};for(i.nodes().forEach(function(p){var E=p===o?0:Number.POSITIVE_INFINITY;u[p]={distance:E},c.add(p,E)});c.size()>0&&(d=c.removeMin(),h=u[d],h.distance!==Number.POSITIVE_INFINITY);)l(d).forEach(g);return u}return bp}var wp,QS;function V4(){if(QS)return wp;QS=1;var r=MP(),e=cn();wp=t;function t(n,a,i){return e.transform(n.nodes(),function(o,s){o[s]=r(n,s,a,i)},{})}return wp}var xp,JS;function kP(){if(JS)return xp;JS=1;var r=cn();xp=e;function e(t){var n=0,a=[],i={},o=[];function s(l){var u=i[l]={onStack:!0,lowlink:n,index:n++};if(a.push(l),t.successors(l).forEach(function(h){r.has(i,h)?i[h].onStack&&(u.lowlink=Math.min(u.lowlink,i[h].index)):(s(h),u.lowlink=Math.min(u.lowlink,i[h].lowlink))}),u.lowlink===u.index){var c=[],d;do d=a.pop(),i[d].onStack=!1,c.push(d);while(l!==d);o.push(c)}}return t.nodes().forEach(function(l){r.has(i,l)||s(l)}),o}return xp}var Ep,eT;function G4(){if(eT)return Ep;eT=1;var r=cn(),e=kP();Ep=t;function t(n){return r.filter(e(n),function(a){return a.length>1||a.length===1&&n.hasEdge(a[0],a[0])})}return Ep}var Cp,rT;function W4(){if(rT)return Cp;rT=1;var r=cn();Cp=t;var e=r.constant(1);function t(a,i,o){return n(a,i||e,o||function(s){return a.outEdges(s)})}function n(a,i,o){var s={},l=a.nodes();return l.forEach(function(u){s[u]={},s[u][u]={distance:0},l.forEach(function(c){u!==c&&(s[u][c]={distance:Number.POSITIVE_INFINITY})}),o(u).forEach(function(c){var d=c.v===u?c.w:c.v,h=i(c);s[u][d]={distance:h,predecessor:u}})}),l.forEach(function(u){var c=s[u];l.forEach(function(d){var h=s[d];l.forEach(function(g){var p=h[u],E=c[g],y=h[g],b=p.distance+E.distance;b<y.distance&&(y.distance=b,y.predecessor=E.predecessor)})})}),s}return Cp}var _p,tT;function OP(){if(tT)return _p;tT=1;var r=cn();_p=e,e.CycleException=t;function e(n){var a={},i={},o=[];function s(l){if(r.has(i,l))throw new t;r.has(a,l)||(i[l]=!0,a[l]=!0,r.each(n.predecessors(l),s),delete i[l],o.push(l))}if(r.each(n.sinks(),s),r.size(a)!==n.nodeCount())throw new t;return o}function t(){}return t.prototype=new Error,_p}var Sp,nT;function U4(){if(nT)return Sp;nT=1;var r=OP();Sp=e;function e(t){try{r(t)}catch(n){if(n instanceof r.CycleException)return!1;throw n}return!0}return Sp}var Tp,aT;function LP(){if(aT)return Tp;aT=1;var r=cn();Tp=e;function e(n,a,i){r.isArray(a)||(a=[a]);var o=(n.isDirected()?n.successors:n.neighbors).bind(n),s=[],l={};return r.each(a,function(u){if(!n.hasNode(u))throw new Error("Graph does not have node: "+u);t(n,u,i==="post",l,o,s)}),s}function t(n,a,i,o,s,l){r.has(o,a)||(o[a]=!0,i||l.push(a),r.each(s(a),function(u){t(n,u,i,o,s,l)}),i&&l.push(a))}return Tp}var Rp,iT;function H4(){if(iT)return Rp;iT=1;var r=LP();Rp=e;function e(t,n){return r(t,n,"post")}return Rp}var Ap,oT;function K4(){if(oT)return Ap;oT=1;var r=LP();Ap=e;function e(t,n){return r(t,n,"pre")}return Ap}var Pp,sT;function j4(){if(sT)return Pp;sT=1;var r=cn(),e=d0(),t=BP();Pp=n;function n(a,i){var o=new e,s={},l=new t,u;function c(h){var g=h.v===u?h.w:h.v,p=l.priority(g);if(p!==void 0){var E=i(h);E<p&&(s[g]=u,l.decrease(g,E))}}if(a.nodeCount()===0)return o;r.each(a.nodes(),function(h){l.add(h,Number.POSITIVE_INFINITY),o.setNode(h)}),l.decrease(a.nodes()[0],0);for(var d=!1;l.size()>0;){if(u=l.removeMin(),r.has(s,u))o.setEdge(u,s[u]);else{if(d)throw new Error("Input graph is not connected: "+a);d=!0}a.nodeEdges(u).forEach(c)}return o}return Pp}var Ip,uT;function Y4(){return uT||(uT=1,Ip={components:$4(),dijkstra:MP(),dijkstraAll:V4(),findCycles:G4(),floydWarshall:W4(),isAcyclic:U4(),postorder:H4(),preorder:K4(),prim:j4(),tarjan:kP(),topsort:OP()}),Ip}var Dp,lT;function Z4(){if(lT)return Dp;lT=1;var r=F4();return Dp={Graph:r.Graph,json:z4(),alg:Y4(),version:r.version},Dp}var Bp,fT;function xn(){if(fT)return Bp;fT=1;var r;if(typeof Zm=="function")try{r=Z4()}catch{}return r||(r=window.graphlib),Bp=r,Bp}var Mp,cT;function X4(){if(cT)return Mp;cT=1;var r=sP(),e=1,t=4;function n(a){return r(a,e|t)}return Mp=n,Mp}var kp,dT;function zl(){if(dT)return kp;dT=1;var r=uo(),e=ea(),t=Dl(),n=fn();function a(i,o,s){if(!n(s))return!1;var l=typeof o;return(l=="number"?e(s)&&t(o,s.length):l=="string"&&o in s)?r(s[o],i):!1}return kp=a,kp}var Op,vT;function Q4(){if(vT)return Op;vT=1;var r=Fl(),e=uo(),t=zl(),n=vi(),a=Object.prototype,i=a.hasOwnProperty,o=r(function(s,l){s=Object(s);var u=-1,c=l.length,d=c>2?l[2]:void 0;for(d&&t(l[0],l[1],d)&&(c=1);++u<c;)for(var h=l[u],g=n(h),p=-1,E=g.length;++p<E;){var y=g[p],b=s[y];(b===void 0||e(b,a[y])&&!i.call(s,y))&&(s[y]=h[y])}return s});return Op=o,Op}var Lp,hT;function J4(){if(hT)return Lp;hT=1;var r=ra(),e=ea(),t=qa();function n(a){return function(i,o,s){var l=Object(i);if(!e(i)){var u=r(o,3);i=t(i),o=function(d){return u(l[d],d,l)}}var c=a(i,o,s);return c>-1?l[u?i[c]:c]:void 0}}return Lp=n,Lp}var qp,gT;function eG(){if(gT)return qp;gT=1;var r=/\s/;function e(t){for(var n=t.length;n--&&r.test(t.charAt(n)););return n}return qp=e,qp}var Np,pT;function rG(){if(pT)return Np;pT=1;var r=eG(),e=/^\s+/;function t(n){return n&&n.slice(0,r(n)+1).replace(e,"")}return Np=t,Np}var Fp,yT;function tG(){if(yT)return Fp;yT=1;var r=rG(),e=fn(),t=vo(),n=NaN,a=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,o=/^0o[0-7]+$/i,s=parseInt;function l(u){if(typeof u=="number")return u;if(t(u))return n;if(e(u)){var c=typeof u.valueOf=="function"?u.valueOf():u;u=e(c)?c+"":c}if(typeof u!="string")return u===0?u:+u;u=r(u);var d=i.test(u);return d||o.test(u)?s(u.slice(2),d?2:8):a.test(u)?n:+u}return Fp=l,Fp}var zp,mT;function qP(){if(mT)return zp;mT=1;var r=tG(),e=1/0,t=17976931348623157e292;function n(a){if(!a)return a===0?a:0;if(a=r(a),a===e||a===-e){var i=a<0?-1:1;return i*t}return a===a?a:0}return zp=n,zp}var $p,bT;function nG(){if(bT)return $p;bT=1;var r=qP();function e(t){var n=r(t),a=n%1;return n===n?a?n-a:n:0}return $p=e,$p}var Vp,wT;function aG(){if(wT)return Vp;wT=1;var r=PP(),e=ra(),t=nG(),n=Math.max;function a(i,o,s){var l=i==null?0:i.length;if(!l)return-1;var u=s==null?0:t(s);return u<0&&(u=n(l+u,0)),r(i,e(o,3),u)}return Vp=a,Vp}var Gp,xT;function iG(){if(xT)return Gp;xT=1;var r=J4(),e=aG(),t=r(e);return Gp=t,Gp}var Wp,ET;function NP(){if(ET)return Wp;ET=1;var r=c0();function e(t){var n=t==null?0:t.length;return n?r(t,1):[]}return Wp=e,Wp}var Up,CT;function oG(){if(CT)return Up;CT=1;var r=s0(),e=uP(),t=vi();function n(a,i){return a==null?a:r(a,e(i),t)}return Up=n,Up}var Hp,_T;function sG(){if(_T)return Hp;_T=1;function r(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}return Hp=r,Hp}var Kp,ST;function uG(){if(ST)return Kp;ST=1;var r=Pl(),e=u0(),t=ra();function n(a,i){var o={};return i=t(i,3),e(a,function(s,l,u){r(o,l,i(s,l,u))}),o}return Kp=n,Kp}var jp,TT;function v0(){if(TT)return jp;TT=1;var r=vo();function e(t,n,a){for(var i=-1,o=t.length;++i<o;){var s=t[i],l=n(s);if(l!=null&&(u===void 0?l===l&&!r(l):a(l,u)))var u=l,c=s}return c}return jp=e,jp}var Yp,RT;function lG(){if(RT)return Yp;RT=1;function r(e,t){return e>t}return Yp=r,Yp}var Zp,AT;function fG(){if(AT)return Zp;AT=1;var r=v0(),e=lG(),t=hi();function n(a){return a&&a.length?r(a,t,e):void 0}return Zp=n,Zp}var Xp,PT;function FP(){if(PT)return Xp;PT=1;var r=Pl(),e=uo();function t(n,a,i){(i!==void 0&&!e(n[a],i)||i===void 0&&!(a in n))&&r(n,a,i)}return Xp=t,Xp}var Qp,IT;function cG(){if(IT)return Qp;IT=1;var r=ci(),e=kl(),t=On(),n="[object Object]",a=Function.prototype,i=Object.prototype,o=a.toString,s=i.hasOwnProperty,l=o.call(Object);function u(c){if(!t(c)||r(c)!=n)return!1;var d=e(c);if(d===null)return!0;var h=s.call(d,"constructor")&&d.constructor;return typeof h=="function"&&h instanceof h&&o.call(h)==l}return Qp=u,Qp}var Jp,DT;function zP(){if(DT)return Jp;DT=1;function r(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}return Jp=r,Jp}var ey,BT;function dG(){if(BT)return ey;BT=1;var r=Es(),e=vi();function t(n){return r(n,e(n))}return ey=t,ey}var ry,MT;function vG(){if(MT)return ry;MT=1;var r=FP(),e=YA(),t=aP(),n=ZA(),a=oP(),i=Cs(),o=Zr(),s=IP(),l=fo(),u=xs(),c=fn(),d=cG(),h=_s(),g=zP(),p=dG();function E(y,b,w,x,C,T,S){var _=g(y,w),A=g(b,w),P=S.get(A);if(P){r(y,w,P);return}var I=T?T(_,A,w+"",y,b,S):void 0,D=I===void 0;if(D){var k=o(A),M=!k&&l(A),N=!k&&!M&&h(A);I=A,k||M||N?o(_)?I=_:s(_)?I=n(_):M?(D=!1,I=e(A,!0)):N?(D=!1,I=t(A,!0)):I=[]:d(A)||i(A)?(I=_,i(_)?I=p(_):(!c(_)||u(_))&&(I=a(A))):D=!1}D&&(S.set(A,I),C(I,A,x,T,S),S.delete(A)),r(y,w,I)}return ry=E,ry}var ty,kT;function hG(){if(kT)return ty;kT=1;var r=Al(),e=FP(),t=s0(),n=vG(),a=fn(),i=vi(),o=zP();function s(l,u,c,d,h){l!==u&&t(u,function(g,p){if(h||(h=new r),a(g))n(l,u,p,c,s,d,h);else{var E=d?d(o(l,p),g,p+"",l,u,h):void 0;E===void 0&&(E=g),e(l,p,E)}},i)}return ty=s,ty}var ny,OT;function gG(){if(OT)return ny;OT=1;var r=Fl(),e=zl();function t(n){return r(function(a,i){var o=-1,s=i.length,l=s>1?i[s-1]:void 0,u=s>2?i[2]:void 0;for(l=n.length>3&&typeof l=="function"?(s--,l):void 0,u&&e(i[0],i[1],u)&&(l=s<3?void 0:l,s=1),a=Object(a);++o<s;){var c=i[o];c&&n(a,c,o,l)}return a})}return ny=t,ny}var ay,LT;function pG(){if(LT)return ay;LT=1;var r=hG(),e=gG(),t=e(function(n,a,i){r(n,a,i)});return ay=t,ay}var iy,qT;function $P(){if(qT)return iy;qT=1;function r(e,t){return e<t}return iy=r,iy}var oy,NT;function yG(){if(NT)return oy;NT=1;var r=v0(),e=$P(),t=hi();function n(a){return a&&a.length?r(a,t,e):void 0}return oy=n,oy}var sy,FT;function mG(){if(FT)return sy;FT=1;var r=v0(),e=ra(),t=$P();function n(a,i){return a&&a.length?r(a,e(i,2),t):void 0}return sy=n,sy}var uy,zT;function bG(){if(zT)return uy;zT=1;var r=En(),e=function(){return r.Date.now()};return uy=e,uy}var ly,$T;function wG(){if($T)return ly;$T=1;var r=Il(),e=ql(),t=Dl(),n=fn(),a=Ss();function i(o,s,l,u){if(!n(o))return o;s=e(s,o);for(var c=-1,d=s.length,h=d-1,g=o;g!=null&&++c<d;){var p=a(s[c]),E=l;if(p==="__proto__"||p==="constructor"||p==="prototype")return o;if(c!=h){var y=g[p];E=u?u(y,p,g):void 0,E===void 0&&(E=n(y)?y:t(s[c+1])?[]:{})}r(g,p,E),g=g[p]}return o}return ly=i,ly}var fy,VT;function xG(){if(VT)return fy;VT=1;var r=Nl(),e=wG(),t=ql();function n(a,i,o){for(var s=-1,l=i.length,u={};++s<l;){var c=i[s],d=r(a,c);o(d,c)&&e(u,t(c,a),d)}return u}return fy=n,fy}var cy,GT;function EG(){if(GT)return cy;GT=1;var r=xG(),e=bP();function t(n,a){return r(n,a,function(i,o){return e(n,o)})}return cy=t,cy}var dy,WT;function CG(){if(WT)return dy;WT=1;var r=NP(),e=RP(),t=AP();function n(a){return t(e(a,void 0,r),a+"")}return dy=n,dy}var vy,UT;function _G(){if(UT)return vy;UT=1;var r=EG(),e=CG(),t=e(function(n,a){return n==null?{}:r(n,a)});return vy=t,vy}var hy,HT;function SG(){if(HT)return hy;HT=1;var r=Math.ceil,e=Math.max;function t(n,a,i,o){for(var s=-1,l=e(r((a-n)/(i||1)),0),u=Array(l);l--;)u[o?l:++s]=n,n+=i;return u}return hy=t,hy}var gy,KT;function TG(){if(KT)return gy;KT=1;var r=SG(),e=zl(),t=qP();function n(a){return function(i,o,s){return s&&typeof s!="number"&&e(i,o,s)&&(o=s=void 0),i=t(i),o===void 0?(o=i,i=0):o=t(o),s=s===void 0?i<o?1:-1:t(s),r(i,o,s,a)}}return gy=n,gy}var py,jT;function RG(){if(jT)return py;jT=1;var r=TG(),e=r();return py=e,py}var yy,YT;function AG(){if(YT)return yy;YT=1;function r(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}return yy=r,yy}var my,ZT;function PG(){if(ZT)return my;ZT=1;var r=vo();function e(t,n){if(t!==n){var a=t!==void 0,i=t===null,o=t===t,s=r(t),l=n!==void 0,u=n===null,c=n===n,d=r(n);if(!u&&!d&&!s&&t>n||s&&l&&c&&!u&&!d||i&&l&&c||!a&&c||!o)return 1;if(!i&&!s&&!d&&t<n||d&&a&&o&&!i&&!s||u&&a&&o||!l&&o||!c)return-1}return 0}return my=e,my}var by,XT;function IG(){if(XT)return by;XT=1;var r=PG();function e(t,n,a){for(var i=-1,o=t.criteria,s=n.criteria,l=o.length,u=a.length;++i<l;){var c=r(o[i],s[i]);if(c){if(i>=u)return c;var d=a[i];return c*(d=="desc"?-1:1)}}return t.index-n.index}return by=e,by}var wy,QT;function DG(){if(QT)return wy;QT=1;var r=Ll(),e=Nl(),t=ra(),n=_P(),a=AG(),i=Bl(),o=IG(),s=hi(),l=Zr();function u(c,d,h){d.length?d=r(d,function(E){return l(E)?function(y){return e(y,E.length===1?E[0]:E)}:E}):d=[s];var g=-1;d=r(d,i(t));var p=n(c,function(E,y,b){var w=r(d,function(x){return x(E)});return{criteria:w,index:++g,value:E}});return a(p,function(E,y){return o(E,y,h)})}return wy=u,wy}var xy,JT;function BG(){if(JT)return xy;JT=1;var r=c0(),e=DG(),t=Fl(),n=zl(),a=t(function(i,o){if(i==null)return[];var s=o.length;return s>1&&n(i,o[0],o[1])?o=[]:s>2&&n(o[0],o[1],o[2])&&(o=[o[0]]),e(i,r(o,1),[])});return xy=a,xy}var Ey,e2;function MG(){if(e2)return Ey;e2=1;var r=yP(),e=0;function t(n){var a=++e;return r(n)+a}return Ey=t,Ey}var Cy,r2;function kG(){if(r2)return Cy;r2=1;function r(e,t,n){for(var a=-1,i=e.length,o=t.length,s={};++a<i;){var l=a<o?t[a]:void 0;n(s,e[a],l)}return s}return Cy=r,Cy}var _y,t2;function OG(){if(t2)return _y;t2=1;var r=Il(),e=kG();function t(n,a){return e(n||[],a||[],r)}return _y=t,_y}var Sy,n2;function qr(){if(n2)return Sy;n2=1;var r;if(typeof Zm=="function")try{r={cloneDeep:X4(),constant:o0(),defaults:Q4(),each:fP(),filter:xP(),find:iG(),flatten:NP(),forEach:lP(),forIn:oG(),has:EP(),isUndefined:CP(),last:sG(),map:SP(),mapValues:uG(),max:fG(),merge:pG(),min:yG(),minBy:mG(),now:bG(),pick:_G(),range:RG(),reduce:TP(),sortBy:BG(),uniqueId:MG(),values:DP(),zipObject:OG()}}catch{}return r||(r=window._),Sy=r,Sy}var Ty,a2;function LG(){if(a2)return Ty;a2=1,Ty=r;function r(){var n={};n._next=n._prev=n,this._sentinel=n}r.prototype.dequeue=function(){var n=this._sentinel,a=n._prev;if(a!==n)return e(a),a},r.prototype.enqueue=function(n){var a=this._sentinel;n._prev&&n._next&&e(n),n._next=a._next,a._next._prev=n,a._next=n,n._prev=a},r.prototype.toString=function(){for(var n=[],a=this._sentinel,i=a._prev;i!==a;)n.push(JSON.stringify(i,t)),i=i._prev;return"["+n.join(", ")+"]"};function e(n){n._prev._next=n._next,n._next._prev=n._prev,delete n._next,delete n._prev}function t(n,a){if(n!=="_next"&&n!=="_prev")return a}return Ty}var Ry,i2;function qG(){if(i2)return Ry;i2=1;var r=qr(),e=xn().Graph,t=LG();Ry=a;var n=r.constant(1);function a(u,c){if(u.nodeCount()<=1)return[];var d=s(u,c||n),h=i(d.graph,d.buckets,d.zeroIdx);return r.flatten(r.map(h,function(g){return u.outEdges(g.v,g.w)}),!0)}function i(u,c,d){for(var h=[],g=c[c.length-1],p=c[0],E;u.nodeCount();){for(;E=p.dequeue();)o(u,c,d,E);for(;E=g.dequeue();)o(u,c,d,E);if(u.nodeCount()){for(var y=c.length-2;y>0;--y)if(E=c[y].dequeue(),E){h=h.concat(o(u,c,d,E,!0));break}}}return h}function o(u,c,d,h,g){var p=g?[]:void 0;return r.forEach(u.inEdges(h.v),function(E){var y=u.edge(E),b=u.node(E.v);g&&p.push({v:E.v,w:E.w}),b.out-=y,l(c,d,b)}),r.forEach(u.outEdges(h.v),function(E){var y=u.edge(E),b=E.w,w=u.node(b);w.in-=y,l(c,d,w)}),u.removeNode(h.v),p}function s(u,c){var d=new e,h=0,g=0;r.forEach(u.nodes(),function(y){d.setNode(y,{v:y,in:0,out:0})}),r.forEach(u.edges(),function(y){var b=d.edge(y.v,y.w)||0,w=c(y),x=b+w;d.setEdge(y.v,y.w,x),g=Math.max(g,d.node(y.v).out+=w),h=Math.max(h,d.node(y.w).in+=w)});var p=r.range(g+h+3).map(function(){return new t}),E=h+1;return r.forEach(d.nodes(),function(y){l(p,E,d.node(y))}),{graph:d,buckets:p,zeroIdx:E}}function l(u,c,d){d.out?d.in?u[d.out-d.in+c].enqueue(d):u[u.length-1].enqueue(d):u[0].enqueue(d)}return Ry}var Ay,o2;function NG(){if(o2)return Ay;o2=1;var r=qr(),e=qG();Ay={run:t,undo:a};function t(i){var o=i.graph().acyclicer==="greedy"?e(i,s(i)):n(i);r.forEach(o,function(l){var u=i.edge(l);i.removeEdge(l),u.forwardName=l.name,u.reversed=!0,i.setEdge(l.w,l.v,u,r.uniqueId("rev"))});function s(l){return function(u){return l.edge(u).weight}}}function n(i){var o=[],s={},l={};function u(c){r.has(l,c)||(l[c]=!0,s[c]=!0,r.forEach(i.outEdges(c),function(d){r.has(s,d.w)?o.push(d):u(d.w)}),delete s[c])}return r.forEach(i.nodes(),u),o}function a(i){r.forEach(i.edges(),function(o){var s=i.edge(o);if(s.reversed){i.removeEdge(o);var l=s.forwardName;delete s.reversed,delete s.forwardName,i.setEdge(o.w,o.v,s,l)}})}return Ay}var Py,s2;function $t(){if(s2)return Py;s2=1;var r=qr(),e=xn().Graph;Py={addDummyNode:t,simplify:n,asNonCompoundGraph:a,successorWeights:i,predecessorWeights:o,intersectRect:s,buildLayerMatrix:l,normalizeRanks:u,removeEmptyRanks:c,addBorderNode:d,maxRank:h,partition:g,time:p,notime:E};function t(y,b,w,x){var C;do C=r.uniqueId(x);while(y.hasNode(C));return w.dummy=b,y.setNode(C,w),C}function n(y){var b=new e().setGraph(y.graph());return r.forEach(y.nodes(),function(w){b.setNode(w,y.node(w))}),r.forEach(y.edges(),function(w){var x=b.edge(w.v,w.w)||{weight:0,minlen:1},C=y.edge(w);b.setEdge(w.v,w.w,{weight:x.weight+C.weight,minlen:Math.max(x.minlen,C.minlen)})}),b}function a(y){var b=new e({multigraph:y.isMultigraph()}).setGraph(y.graph());return r.forEach(y.nodes(),function(w){y.children(w).length||b.setNode(w,y.node(w))}),r.forEach(y.edges(),function(w){b.setEdge(w,y.edge(w))}),b}function i(y){var b=r.map(y.nodes(),function(w){var x={};return r.forEach(y.outEdges(w),function(C){x[C.w]=(x[C.w]||0)+y.edge(C).weight}),x});return r.zipObject(y.nodes(),b)}function o(y){var b=r.map(y.nodes(),function(w){var x={};return r.forEach(y.inEdges(w),function(C){x[C.v]=(x[C.v]||0)+y.edge(C).weight}),x});return r.zipObject(y.nodes(),b)}function s(y,b){var w=y.x,x=y.y,C=b.x-w,T=b.y-x,S=y.width/2,_=y.height/2;if(!C&&!T)throw new Error("Not possible to find intersection inside of the rectangle");var A,P;return Math.abs(T)*S>Math.abs(C)*_?(T<0&&(_=-_),A=_*C/T,P=_):(C<0&&(S=-S),A=S,P=S*T/C),{x:w+A,y:x+P}}function l(y){var b=r.map(r.range(h(y)+1),function(){return[]});return r.forEach(y.nodes(),function(w){var x=y.node(w),C=x.rank;r.isUndefined(C)||(b[C][x.order]=w)}),b}function u(y){var b=r.min(r.map(y.nodes(),function(w){return y.node(w).rank}));r.forEach(y.nodes(),function(w){var x=y.node(w);r.has(x,"rank")&&(x.rank-=b)})}function c(y){var b=r.min(r.map(y.nodes(),function(T){return y.node(T).rank})),w=[];r.forEach(y.nodes(),function(T){var S=y.node(T).rank-b;w[S]||(w[S]=[]),w[S].push(T)});var x=0,C=y.graph().nodeRankFactor;r.forEach(w,function(T,S){r.isUndefined(T)&&S%C!==0?--x:x&&r.forEach(T,function(_){y.node(_).rank+=x})})}function d(y,b,w,x){var C={width:0,height:0};return arguments.length>=4&&(C.rank=w,C.order=x),t(y,"border",C,b)}function h(y){return r.max(r.map(y.nodes(),function(b){var w=y.node(b).rank;if(!r.isUndefined(w))return w}))}function g(y,b){var w={lhs:[],rhs:[]};return r.forEach(y,function(x){b(x)?w.lhs.push(x):w.rhs.push(x)}),w}function p(y,b){var w=r.now();try{return b()}finally{console.log(y+" time: "+(r.now()-w)+"ms")}}function E(y,b){return b()}return Py}var Iy,u2;function FG(){if(u2)return Iy;u2=1;var r=qr(),e=$t();Iy={run:t,undo:a};function t(i){i.graph().dummyChains=[],r.forEach(i.edges(),function(o){n(i,o)})}function n(i,o){var s=o.v,l=i.node(s).rank,u=o.w,c=i.node(u).rank,d=o.name,h=i.edge(o),g=h.labelRank;if(c!==l+1){i.removeEdge(o);var p,E,y;for(y=0,++l;l<c;++y,++l)h.points=[],E={width:0,height:0,edgeLabel:h,edgeObj:o,rank:l},p=e.addDummyNode(i,"edge",E,"_d"),l===g&&(E.width=h.width,E.height=h.height,E.dummy="edge-label",E.labelpos=h.labelpos),i.setEdge(s,p,{weight:h.weight},d),y===0&&i.graph().dummyChains.push(p),s=p;i.setEdge(s,u,{weight:h.weight},d)}}function a(i){r.forEach(i.graph().dummyChains,function(o){var s=i.node(o),l=s.edgeLabel,u;for(i.setEdge(s.edgeObj,l);s.dummy;)u=i.successors(o)[0],i.removeNode(o),l.points.push({x:s.x,y:s.y}),s.dummy==="edge-label"&&(l.x=s.x,l.y=s.y,l.width=s.width,l.height=s.height),o=u,s=i.node(o)})}return Iy}var Dy,l2;function nl(){if(l2)return Dy;l2=1;var r=qr();Dy={longestPath:e,slack:t};function e(n){var a={};function i(o){var s=n.node(o);if(r.has(a,o))return s.rank;a[o]=!0;var l=r.min(r.map(n.outEdges(o),function(u){return i(u.w)-n.edge(u).minlen}));return(l===Number.POSITIVE_INFINITY||l===void 0||l===null)&&(l=0),s.rank=l}r.forEach(n.sources(),i)}function t(n,a){return n.node(a.w).rank-n.node(a.v).rank-n.edge(a).minlen}return Dy}var By,f2;function VP(){if(f2)return By;f2=1;var r=qr(),e=xn().Graph,t=nl().slack;By=n;function n(s){var l=new e({directed:!1}),u=s.nodes()[0],c=s.nodeCount();l.setNode(u,{});for(var d,h;a(l,s)<c;)d=i(l,s),h=l.hasNode(d.v)?t(s,d):-t(s,d),o(l,s,h);return l}function a(s,l){function u(c){r.forEach(l.nodeEdges(c),function(d){var h=d.v,g=c===h?d.w:h;!s.hasNode(g)&&!t(l,d)&&(s.setNode(g,{}),s.setEdge(c,g,{}),u(g))})}return r.forEach(s.nodes(),u),s.nodeCount()}function i(s,l){return r.minBy(l.edges(),function(u){if(s.hasNode(u.v)!==s.hasNode(u.w))return t(l,u)})}function o(s,l,u){r.forEach(s.nodes(),function(c){l.node(c).rank+=u})}return By}var My,c2;function zG(){if(c2)return My;c2=1;var r=qr(),e=VP(),t=nl().slack,n=nl().longestPath,a=xn().alg.preorder,i=xn().alg.postorder,o=$t().simplify;My=s,s.initLowLimValues=d,s.initCutValues=l,s.calcCutValue=c,s.leaveEdge=g,s.enterEdge=p,s.exchangeEdges=E;function s(x){x=o(x),n(x);var C=e(x);d(C),l(C,x);for(var T,S;T=g(C);)S=p(C,x,T),E(C,x,T,S)}function l(x,C){var T=i(x,x.nodes());T=T.slice(0,T.length-1),r.forEach(T,function(S){u(x,C,S)})}function u(x,C,T){var S=x.node(T),_=S.parent;x.edge(T,_).cutvalue=c(x,C,T)}function c(x,C,T){var S=x.node(T),_=S.parent,A=!0,P=C.edge(T,_),I=0;return P||(A=!1,P=C.edge(_,T)),I=P.weight,r.forEach(C.nodeEdges(T),function(D){var k=D.v===T,M=k?D.w:D.v;if(M!==_){var N=k===A,z=C.edge(D).weight;if(I+=N?z:-z,b(x,T,M)){var $=x.edge(T,M).cutvalue;I+=N?-$:$}}}),I}function d(x,C){arguments.length<2&&(C=x.nodes()[0]),h(x,{},1,C)}function h(x,C,T,S,_){var A=T,P=x.node(S);return C[S]=!0,r.forEach(x.neighbors(S),function(I){r.has(C,I)||(T=h(x,C,T,I,S))}),P.low=A,P.lim=T++,_?P.parent=_:delete P.parent,T}function g(x){return r.find(x.edges(),function(C){return x.edge(C).cutvalue<0})}function p(x,C,T){var S=T.v,_=T.w;C.hasEdge(S,_)||(S=T.w,_=T.v);var A=x.node(S),P=x.node(_),I=A,D=!1;A.lim>P.lim&&(I=P,D=!0);var k=r.filter(C.edges(),function(M){return D===w(x,x.node(M.v),I)&&D!==w(x,x.node(M.w),I)});return r.minBy(k,function(M){return t(C,M)})}function E(x,C,T,S){var _=T.v,A=T.w;x.removeEdge(_,A),x.setEdge(S.v,S.w,{}),d(x),l(x,C),y(x,C)}function y(x,C){var T=r.find(x.nodes(),function(_){return!C.node(_).parent}),S=a(x,T);S=S.slice(1),r.forEach(S,function(_){var A=x.node(_).parent,P=C.edge(_,A),I=!1;P||(P=C.edge(A,_),I=!0),C.node(_).rank=C.node(A).rank+(I?P.minlen:-P.minlen)})}function b(x,C,T){return x.hasEdge(C,T)}function w(x,C,T){return T.low<=C.lim&&C.lim<=T.lim}return My}var ky,d2;function $G(){if(d2)return ky;d2=1;var r=nl(),e=r.longestPath,t=VP(),n=zG();ky=a;function a(l){switch(l.graph().ranker){case"network-simplex":s(l);break;case"tight-tree":o(l);break;case"longest-path":i(l);break;default:s(l)}}var i=e;function o(l){e(l),t(l)}function s(l){n(l)}return ky}var Oy,v2;function VG(){if(v2)return Oy;v2=1;var r=qr();Oy=e;function e(a){var i=n(a);r.forEach(a.graph().dummyChains,function(o){for(var s=a.node(o),l=s.edgeObj,u=t(a,i,l.v,l.w),c=u.path,d=u.lca,h=0,g=c[h],p=!0;o!==l.w;){if(s=a.node(o),p){for(;(g=c[h])!==d&&a.node(g).maxRank<s.rank;)h++;g===d&&(p=!1)}if(!p){for(;h<c.length-1&&a.node(g=c[h+1]).minRank<=s.rank;)h++;g=c[h]}a.setParent(o,g),o=a.successors(o)[0]}})}function t(a,i,o,s){var l=[],u=[],c=Math.min(i[o].low,i[s].low),d=Math.max(i[o].lim,i[s].lim),h,g;h=o;do h=a.parent(h),l.push(h);while(h&&(i[h].low>c||d>i[h].lim));for(g=h,h=s;(h=a.parent(h))!==g;)u.push(h);return{path:l.concat(u.reverse()),lca:g}}function n(a){var i={},o=0;function s(l){var u=o;r.forEach(a.children(l),s),i[l]={low:u,lim:o++}}return r.forEach(a.children(),s),i}return Oy}var Ly,h2;function GG(){if(h2)return Ly;h2=1;var r=qr(),e=$t();Ly={run:t,cleanup:o};function t(s){var l=e.addDummyNode(s,"root",{},"_root"),u=a(s),c=r.max(r.values(u))-1,d=2*c+1;s.graph().nestingRoot=l,r.forEach(s.edges(),function(g){s.edge(g).minlen*=d});var h=i(s)+1;r.forEach(s.children(),function(g){n(s,l,d,h,c,u,g)}),s.graph().nodeRankFactor=d}function n(s,l,u,c,d,h,g){var p=s.children(g);if(!p.length){g!==l&&s.setEdge(l,g,{weight:0,minlen:u});return}var E=e.addBorderNode(s,"_bt"),y=e.addBorderNode(s,"_bb"),b=s.node(g);s.setParent(E,g),b.borderTop=E,s.setParent(y,g),b.borderBottom=y,r.forEach(p,function(w){n(s,l,u,c,d,h,w);var x=s.node(w),C=x.borderTop?x.borderTop:w,T=x.borderBottom?x.borderBottom:w,S=x.borderTop?c:2*c,_=C!==T?1:d-h[g]+1;s.setEdge(E,C,{weight:S,minlen:_,nestingEdge:!0}),s.setEdge(T,y,{weight:S,minlen:_,nestingEdge:!0})}),s.parent(g)||s.setEdge(l,E,{weight:0,minlen:d+h[g]})}function a(s){var l={};function u(c,d){var h=s.children(c);h&&h.length&&r.forEach(h,function(g){u(g,d+1)}),l[c]=d}return r.forEach(s.children(),function(c){u(c,1)}),l}function i(s){return r.reduce(s.edges(),function(l,u){return l+s.edge(u).weight},0)}function o(s){var l=s.graph();s.removeNode(l.nestingRoot),delete l.nestingRoot,r.forEach(s.edges(),function(u){var c=s.edge(u);c.nestingEdge&&s.removeEdge(u)})}return Ly}var qy,g2;function WG(){if(g2)return qy;g2=1;var r=qr(),e=$t();qy=t;function t(a){function i(o){var s=a.children(o),l=a.node(o);if(s.length&&r.forEach(s,i),r.has(l,"minRank")){l.borderLeft=[],l.borderRight=[];for(var u=l.minRank,c=l.maxRank+1;u<c;++u)n(a,"borderLeft","_bl",o,l,u),n(a,"borderRight","_br",o,l,u)}}r.forEach(a.children(),i)}function n(a,i,o,s,l,u){var c={width:0,height:0,rank:u,borderType:i},d=l[i][u-1],h=e.addDummyNode(a,"border",c,o);l[i][u]=h,a.setParent(h,s),d&&a.setEdge(d,h,{weight:1})}return qy}var Ny,p2;function UG(){if(p2)return Ny;p2=1;var r=qr();Ny={adjust:e,undo:t};function e(u){var c=u.graph().rankdir.toLowerCase();(c==="lr"||c==="rl")&&n(u)}function t(u){var c=u.graph().rankdir.toLowerCase();(c==="bt"||c==="rl")&&i(u),(c==="lr"||c==="rl")&&(s(u),n(u))}function n(u){r.forEach(u.nodes(),function(c){a(u.node(c))}),r.forEach(u.edges(),function(c){a(u.edge(c))})}function a(u){var c=u.width;u.width=u.height,u.height=c}function i(u){r.forEach(u.nodes(),function(c){o(u.node(c))}),r.forEach(u.edges(),function(c){var d=u.edge(c);r.forEach(d.points,o),r.has(d,"y")&&o(d)})}function o(u){u.y=-u.y}function s(u){r.forEach(u.nodes(),function(c){l(u.node(c))}),r.forEach(u.edges(),function(c){var d=u.edge(c);r.forEach(d.points,l),r.has(d,"x")&&l(d)})}function l(u){var c=u.x;u.x=u.y,u.y=c}return Ny}var Fy,y2;function HG(){if(y2)return Fy;y2=1;var r=qr();Fy=e;function e(t){var n={},a=r.filter(t.nodes(),function(u){return!t.children(u).length}),i=r.max(r.map(a,function(u){return t.node(u).rank})),o=r.map(r.range(i+1),function(){return[]});function s(u){if(!r.has(n,u)){n[u]=!0;var c=t.node(u);o[c.rank].push(u),r.forEach(t.successors(u),s)}}var l=r.sortBy(a,function(u){return t.node(u).rank});return r.forEach(l,s),o}return Fy}var zy,m2;function KG(){if(m2)return zy;m2=1;var r=qr();zy=e;function e(n,a){for(var i=0,o=1;o<a.length;++o)i+=t(n,a[o-1],a[o]);return i}function t(n,a,i){for(var o=r.zipObject(i,r.map(i,function(h,g){return g})),s=r.flatten(r.map(a,function(h){return r.sortBy(r.map(n.outEdges(h),function(g){return{pos:o[g.w],weight:n.edge(g).weight}}),"pos")}),!0),l=1;l<i.length;)l<<=1;var u=2*l-1;l-=1;var c=r.map(new Array(u),function(){return 0}),d=0;return r.forEach(s.forEach(function(h){var g=h.pos+l;c[g]+=h.weight;for(var p=0;g>0;)g%2&&(p+=c[g+1]),g=g-1>>1,c[g]+=h.weight;d+=h.weight*p})),d}return zy}var $y,b2;function jG(){if(b2)return $y;b2=1;var r=qr();$y=e;function e(t,n){return r.map(n,function(a){var i=t.inEdges(a);if(i.length){var o=r.reduce(i,function(s,l){var u=t.edge(l),c=t.node(l.v);return{sum:s.sum+u.weight*c.order,weight:s.weight+u.weight}},{sum:0,weight:0});return{v:a,barycenter:o.sum/o.weight,weight:o.weight}}else return{v:a}})}return $y}var Vy,w2;function YG(){if(w2)return Vy;w2=1;var r=qr();Vy=e;function e(a,i){var o={};r.forEach(a,function(l,u){var c=o[l.v]={indegree:0,in:[],out:[],vs:[l.v],i:u};r.isUndefined(l.barycenter)||(c.barycenter=l.barycenter,c.weight=l.weight)}),r.forEach(i.edges(),function(l){var u=o[l.v],c=o[l.w];!r.isUndefined(u)&&!r.isUndefined(c)&&(c.indegree++,u.out.push(o[l.w]))});var s=r.filter(o,function(l){return!l.indegree});return t(s)}function t(a){var i=[];function o(u){return function(c){c.merged||(r.isUndefined(c.barycenter)||r.isUndefined(u.barycenter)||c.barycenter>=u.barycenter)&&n(u,c)}}function s(u){return function(c){c.in.push(u),--c.indegree===0&&a.push(c)}}for(;a.length;){var l=a.pop();i.push(l),r.forEach(l.in.reverse(),o(l)),r.forEach(l.out,s(l))}return r.map(r.filter(i,function(u){return!u.merged}),function(u){return r.pick(u,["vs","i","barycenter","weight"])})}function n(a,i){var o=0,s=0;a.weight&&(o+=a.barycenter*a.weight,s+=a.weight),i.weight&&(o+=i.barycenter*i.weight,s+=i.weight),a.vs=i.vs.concat(a.vs),a.barycenter=o/s,a.weight=s,a.i=Math.min(i.i,a.i),i.merged=!0}return Vy}var Gy,x2;function ZG(){if(x2)return Gy;x2=1;var r=qr(),e=$t();Gy=t;function t(i,o){var s=e.partition(i,function(E){return r.has(E,"barycenter")}),l=s.lhs,u=r.sortBy(s.rhs,function(E){return-E.i}),c=[],d=0,h=0,g=0;l.sort(a(!!o)),g=n(c,u,g),r.forEach(l,function(E){g+=E.vs.length,c.push(E.vs),d+=E.barycenter*E.weight,h+=E.weight,g=n(c,u,g)});var p={vs:r.flatten(c,!0)};return h&&(p.barycenter=d/h,p.weight=h),p}function n(i,o,s){for(var l;o.length&&(l=r.last(o)).i<=s;)o.pop(),i.push(l.vs),s++;return s}function a(i){return function(o,s){return o.barycenter<s.barycenter?-1:o.barycenter>s.barycenter?1:i?s.i-o.i:o.i-s.i}}return Gy}var Wy,E2;function XG(){if(E2)return Wy;E2=1;var r=qr(),e=jG(),t=YG(),n=ZG();Wy=a;function a(s,l,u,c){var d=s.children(l),h=s.node(l),g=h?h.borderLeft:void 0,p=h?h.borderRight:void 0,E={};g&&(d=r.filter(d,function(T){return T!==g&&T!==p}));var y=e(s,d);r.forEach(y,function(T){if(s.children(T.v).length){var S=a(s,T.v,u,c);E[T.v]=S,r.has(S,"barycenter")&&o(T,S)}});var b=t(y,u);i(b,E);var w=n(b,c);if(g&&(w.vs=r.flatten([g,w.vs,p],!0),s.predecessors(g).length)){var x=s.node(s.predecessors(g)[0]),C=s.node(s.predecessors(p)[0]);r.has(w,"barycenter")||(w.barycenter=0,w.weight=0),w.barycenter=(w.barycenter*w.weight+x.order+C.order)/(w.weight+2),w.weight+=2}return w}function i(s,l){r.forEach(s,function(u){u.vs=r.flatten(u.vs.map(function(c){return l[c]?l[c].vs:c}),!0)})}function o(s,l){r.isUndefined(s.barycenter)?(s.barycenter=l.barycenter,s.weight=l.weight):(s.barycenter=(s.barycenter*s.weight+l.barycenter*l.weight)/(s.weight+l.weight),s.weight+=l.weight)}return Wy}var Uy,C2;function QG(){if(C2)return Uy;C2=1;var r=qr(),e=xn().Graph;Uy=t;function t(a,i,o){var s=n(a),l=new e({compound:!0}).setGraph({root:s}).setDefaultNodeLabel(function(u){return a.node(u)});return r.forEach(a.nodes(),function(u){var c=a.node(u),d=a.parent(u);(c.rank===i||c.minRank<=i&&i<=c.maxRank)&&(l.setNode(u),l.setParent(u,d||s),r.forEach(a[o](u),function(h){var g=h.v===u?h.w:h.v,p=l.edge(g,u),E=r.isUndefined(p)?0:p.weight;l.setEdge(g,u,{weight:a.edge(h).weight+E})}),r.has(c,"minRank")&&l.setNode(u,{borderLeft:c.borderLeft[i],borderRight:c.borderRight[i]}))}),l}function n(a){for(var i;a.hasNode(i=r.uniqueId("_root")););return i}return Uy}var Hy,_2;function JG(){if(_2)return Hy;_2=1;var r=qr();Hy=e;function e(t,n,a){var i={},o;r.forEach(a,function(s){for(var l=t.parent(s),u,c;l;){if(u=t.parent(l),u?(c=i[u],i[u]=l):(c=o,o=l),c&&c!==l){n.setEdge(c,l);return}l=u}})}return Hy}var Ky,S2;function eW(){if(S2)return Ky;S2=1;var r=qr(),e=HG(),t=KG(),n=XG(),a=QG(),i=JG(),o=xn().Graph,s=$t();Ky=l;function l(h){var g=s.maxRank(h),p=u(h,r.range(1,g+1),"inEdges"),E=u(h,r.range(g-1,-1,-1),"outEdges"),y=e(h);d(h,y);for(var b=Number.POSITIVE_INFINITY,w,x=0,C=0;C<4;++x,++C){c(x%2?p:E,x%4>=2),y=s.buildLayerMatrix(h);var T=t(h,y);T<b&&(C=0,w=r.cloneDeep(y),b=T)}d(h,w)}function u(h,g,p){return r.map(g,function(E){return a(h,E,p)})}function c(h,g){var p=new o;r.forEach(h,function(E){var y=E.graph().root,b=n(E,y,p,g);r.forEach(b.vs,function(w,x){E.node(w).order=x}),i(E,p,b.vs)})}function d(h,g){r.forEach(g,function(p){r.forEach(p,function(E,y){h.node(E).order=y})})}return Ky}var jy,T2;function rW(){if(T2)return jy;T2=1;var r=qr(),e=xn().Graph,t=$t();jy={positionX:p,findType1Conflicts:n,findType2Conflicts:a,addConflict:o,hasConflict:s,verticalAlignment:l,horizontalCompaction:u,alignCoordinates:h,findSmallestWidthAlignment:d,balance:g};function n(b,w){var x={};function C(T,S){var _=0,A=0,P=T.length,I=r.last(S);return r.forEach(S,function(D,k){var M=i(b,D),N=M?b.node(M).order:P;(M||D===I)&&(r.forEach(S.slice(A,k+1),function(z){r.forEach(b.predecessors(z),function($){var q=b.node($),V=q.order;(V<_||N<V)&&!(q.dummy&&b.node(z).dummy)&&o(x,$,z)})}),A=k+1,_=N)}),S}return r.reduce(w,C),x}function a(b,w){var x={};function C(S,_,A,P,I){var D;r.forEach(r.range(_,A),function(k){D=S[k],b.node(D).dummy&&r.forEach(b.predecessors(D),function(M){var N=b.node(M);N.dummy&&(N.order<P||N.order>I)&&o(x,M,D)})})}function T(S,_){var A=-1,P,I=0;return r.forEach(_,function(D,k){if(b.node(D).dummy==="border"){var M=b.predecessors(D);M.length&&(P=b.node(M[0]).order,C(_,I,k,A,P),I=k,A=P)}C(_,I,_.length,P,S.length)}),_}return r.reduce(w,T),x}function i(b,w){if(b.node(w).dummy)return r.find(b.predecessors(w),function(x){return b.node(x).dummy})}function o(b,w,x){if(w>x){var C=w;w=x,x=C}var T=b[w];T||(b[w]=T={}),T[x]=!0}function s(b,w,x){if(w>x){var C=w;w=x,x=C}return r.has(b[w],x)}function l(b,w,x,C){var T={},S={},_={};return r.forEach(w,function(A){r.forEach(A,function(P,I){T[P]=P,S[P]=P,_[P]=I})}),r.forEach(w,function(A){var P=-1;r.forEach(A,function(I){var D=C(I);if(D.length){D=r.sortBy(D,function($){return _[$]});for(var k=(D.length-1)/2,M=Math.floor(k),N=Math.ceil(k);M<=N;++M){var z=D[M];S[I]===I&&P<_[z]&&!s(x,I,z)&&(S[z]=I,S[I]=T[I]=T[z],P=_[z])}}})}),{root:T,align:S}}function u(b,w,x,C,T){var S={},_=c(b,w,x,T),A=T?"borderLeft":"borderRight";function P(k,M){for(var N=_.nodes(),z=N.pop(),$={};z;)$[z]?k(z):($[z]=!0,N.push(z),N=N.concat(M(z))),z=N.pop()}function I(k){S[k]=_.inEdges(k).reduce(function(M,N){return Math.max(M,S[N.v]+_.edge(N))},0)}function D(k){var M=_.outEdges(k).reduce(function(z,$){return Math.min(z,S[$.w]-_.edge($))},Number.POSITIVE_INFINITY),N=b.node(k);M!==Number.POSITIVE_INFINITY&&N.borderType!==A&&(S[k]=Math.max(S[k],M))}return P(I,_.predecessors.bind(_)),P(D,_.successors.bind(_)),r.forEach(C,function(k){S[k]=S[x[k]]}),S}function c(b,w,x,C){var T=new e,S=b.graph(),_=E(S.nodesep,S.edgesep,C);return r.forEach(w,function(A){var P;r.forEach(A,function(I){var D=x[I];if(T.setNode(D),P){var k=x[P],M=T.edge(k,D);T.setEdge(k,D,Math.max(_(b,I,P),M||0))}P=I})}),T}function d(b,w){return r.minBy(r.values(w),function(x){var C=Number.NEGATIVE_INFINITY,T=Number.POSITIVE_INFINITY;return r.forIn(x,function(S,_){var A=y(b,_)/2;C=Math.max(S+A,C),T=Math.min(S-A,T)}),C-T})}function h(b,w){var x=r.values(w),C=r.min(x),T=r.max(x);r.forEach(["u","d"],function(S){r.forEach(["l","r"],function(_){var A=S+_,P=b[A],I;if(P!==w){var D=r.values(P);I=_==="l"?C-r.min(D):T-r.max(D),I&&(b[A]=r.mapValues(P,function(k){return k+I}))}})})}function g(b,w){return r.mapValues(b.ul,function(x,C){if(w)return b[w.toLowerCase()][C];var T=r.sortBy(r.map(b,C));return(T[1]+T[2])/2})}function p(b){var w=t.buildLayerMatrix(b),x=r.merge(n(b,w),a(b,w)),C={},T;r.forEach(["u","d"],function(_){T=_==="u"?w:r.values(w).reverse(),r.forEach(["l","r"],function(A){A==="r"&&(T=r.map(T,function(k){return r.values(k).reverse()}));var P=(_==="u"?b.predecessors:b.successors).bind(b),I=l(b,T,x,P),D=u(b,T,I.root,I.align,A==="r");A==="r"&&(D=r.mapValues(D,function(k){return-k})),C[_+A]=D})});var S=d(b,C);return h(C,S),g(C,b.graph().align)}function E(b,w,x){return function(C,T,S){var _=C.node(T),A=C.node(S),P=0,I;if(P+=_.width/2,r.has(_,"labelpos"))switch(_.labelpos.toLowerCase()){case"l":I=-_.width/2;break;case"r":I=_.width/2;break}if(I&&(P+=x?I:-I),I=0,P+=(_.dummy?w:b)/2,P+=(A.dummy?w:b)/2,P+=A.width/2,r.has(A,"labelpos"))switch(A.labelpos.toLowerCase()){case"l":I=A.width/2;break;case"r":I=-A.width/2;break}return I&&(P+=x?I:-I),I=0,P}}function y(b,w){return b.node(w).width}return jy}var Yy,R2;function tW(){if(R2)return Yy;R2=1;var r=qr(),e=$t(),t=rW().positionX;Yy=n;function n(i){i=e.asNonCompoundGraph(i),a(i),r.forEach(t(i),function(o,s){i.node(s).x=o})}function a(i){var o=e.buildLayerMatrix(i),s=i.graph().ranksep,l=0;r.forEach(o,function(u){var c=r.max(r.map(u,function(d){return i.node(d).height}));r.forEach(u,function(d){i.node(d).y=l+c/2}),l+=c+s})}return Yy}var Zy,A2;function nW(){if(A2)return Zy;A2=1;var r=qr(),e=NG(),t=FG(),n=$G(),a=$t().normalizeRanks,i=VG(),o=$t().removeEmptyRanks,s=GG(),l=WG(),u=UG(),c=eW(),d=tW(),h=$t(),g=xn().Graph;Zy=p;function p(W,G){var Y=G&&G.debugTiming?h.time:h.notime;Y("layout",function(){var re=Y(" buildLayoutGraph",function(){return P(W)});Y(" runLayout",function(){E(re,Y)}),Y(" updateInputGraph",function(){y(W,re)})})}function E(W,G){G(" makeSpaceForEdgeLabels",function(){I(W)}),G(" removeSelfEdges",function(){Z(W)}),G(" acyclic",function(){e.run(W)}),G(" nestingGraph.run",function(){s.run(W)}),G(" rank",function(){n(h.asNonCompoundGraph(W))}),G(" injectEdgeLabelProxies",function(){D(W)}),G(" removeEmptyRanks",function(){o(W)}),G(" nestingGraph.cleanup",function(){s.cleanup(W)}),G(" normalizeRanks",function(){a(W)}),G(" assignRankMinMax",function(){k(W)}),G(" removeEdgeLabelProxies",function(){M(W)}),G(" normalize.run",function(){t.run(W)}),G(" parentDummyChains",function(){i(W)}),G(" addBorderSegments",function(){l(W)}),G(" order",function(){c(W)}),G(" insertSelfEdges",function(){K(W)}),G(" adjustCoordinateSystem",function(){u.adjust(W)}),G(" position",function(){d(W)}),G(" positionSelfEdges",function(){j(W)}),G(" removeBorderNodes",function(){V(W)}),G(" normalize.undo",function(){t.undo(W)}),G(" fixupEdgeLabelCoords",function(){$(W)}),G(" undoCoordinateSystem",function(){u.undo(W)}),G(" translateGraph",function(){N(W)}),G(" assignNodeIntersects",function(){z(W)}),G(" reversePoints",function(){q(W)}),G(" acyclic.undo",function(){e.undo(W)})}function y(W,G){r.forEach(W.nodes(),function(Y){var re=W.node(Y),de=G.node(Y);re&&(re.x=de.x,re.y=de.y,G.children(Y).length&&(re.width=de.width,re.height=de.height))}),r.forEach(W.edges(),function(Y){var re=W.edge(Y),de=G.edge(Y);re.points=de.points,r.has(de,"x")&&(re.x=de.x,re.y=de.y)}),W.graph().width=G.graph().width,W.graph().height=G.graph().height}var b=["nodesep","edgesep","ranksep","marginx","marginy"],w={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},x=["acyclicer","ranker","rankdir","align"],C=["width","height"],T={width:0,height:0},S=["minlen","weight","width","height","labeloffset"],_={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},A=["labelpos"];function P(W){var G=new g({multigraph:!0,compound:!0}),Y=le(W.graph());return G.setGraph(r.merge({},w,ee(Y,b),r.pick(Y,x))),r.forEach(W.nodes(),function(re){var de=le(W.node(re));G.setNode(re,r.defaults(ee(de,C),T)),G.setParent(re,W.parent(re))}),r.forEach(W.edges(),function(re){var de=le(W.edge(re));G.setEdge(re,r.merge({},_,ee(de,S),r.pick(de,A)))}),G}function I(W){var G=W.graph();G.ranksep/=2,r.forEach(W.edges(),function(Y){var re=W.edge(Y);re.minlen*=2,re.labelpos.toLowerCase()!=="c"&&(G.rankdir==="TB"||G.rankdir==="BT"?re.width+=re.labeloffset:re.height+=re.labeloffset)})}function D(W){r.forEach(W.edges(),function(G){var Y=W.edge(G);if(Y.width&&Y.height){var re=W.node(G.v),de=W.node(G.w),se={rank:(de.rank-re.rank)/2+re.rank,e:G};h.addDummyNode(W,"edge-proxy",se,"_ep")}})}function k(W){var G=0;r.forEach(W.nodes(),function(Y){var re=W.node(Y);re.borderTop&&(re.minRank=W.node(re.borderTop).rank,re.maxRank=W.node(re.borderBottom).rank,G=r.max(G,re.maxRank))}),W.graph().maxRank=G}function M(W){r.forEach(W.nodes(),function(G){var Y=W.node(G);Y.dummy==="edge-proxy"&&(W.edge(Y.e).labelRank=Y.rank,W.removeNode(G))})}function N(W){var G=Number.POSITIVE_INFINITY,Y=0,re=Number.POSITIVE_INFINITY,de=0,se=W.graph(),X=se.marginx||0,Q=se.marginy||0;function ae(te){var ce=te.x,_e=te.y,ve=te.width,U=te.height;G=Math.min(G,ce-ve/2),Y=Math.max(Y,ce+ve/2),re=Math.min(re,_e-U/2),de=Math.max(de,_e+U/2)}r.forEach(W.nodes(),function(te){ae(W.node(te))}),r.forEach(W.edges(),function(te){var ce=W.edge(te);r.has(ce,"x")&&ae(ce)}),G-=X,re-=Q,r.forEach(W.nodes(),function(te){var ce=W.node(te);ce.x-=G,ce.y-=re}),r.forEach(W.edges(),function(te){var ce=W.edge(te);r.forEach(ce.points,function(_e){_e.x-=G,_e.y-=re}),r.has(ce,"x")&&(ce.x-=G),r.has(ce,"y")&&(ce.y-=re)}),se.width=Y-G+X,se.height=de-re+Q}function z(W){r.forEach(W.edges(),function(G){var Y=W.edge(G),re=W.node(G.v),de=W.node(G.w),se,X;Y.points?(se=Y.points[0],X=Y.points[Y.points.length-1]):(Y.points=[],se=de,X=re),Y.points.unshift(h.intersectRect(re,se)),Y.points.push(h.intersectRect(de,X))})}function $(W){r.forEach(W.edges(),function(G){var Y=W.edge(G);if(r.has(Y,"x"))switch((Y.labelpos==="l"||Y.labelpos==="r")&&(Y.width-=Y.labeloffset),Y.labelpos){case"l":Y.x-=Y.width/2+Y.labeloffset;break;case"r":Y.x+=Y.width/2+Y.labeloffset;break}})}function q(W){r.forEach(W.edges(),function(G){var Y=W.edge(G);Y.reversed&&Y.points.reverse()})}function V(W){r.forEach(W.nodes(),function(G){if(W.children(G).length){var Y=W.node(G),re=W.node(Y.borderTop),de=W.node(Y.borderBottom),se=W.node(r.last(Y.borderLeft)),X=W.node(r.last(Y.borderRight));Y.width=Math.abs(X.x-se.x),Y.height=Math.abs(de.y-re.y),Y.x=se.x+Y.width/2,Y.y=re.y+Y.height/2}}),r.forEach(W.nodes(),function(G){W.node(G).dummy==="border"&&W.removeNode(G)})}function Z(W){r.forEach(W.edges(),function(G){if(G.v===G.w){var Y=W.node(G.v);Y.selfEdges||(Y.selfEdges=[]),Y.selfEdges.push({e:G,label:W.edge(G)}),W.removeEdge(G)}})}function K(W){var G=h.buildLayerMatrix(W);r.forEach(G,function(Y){var re=0;r.forEach(Y,function(de,se){var X=W.node(de);X.order=se+re,r.forEach(X.selfEdges,function(Q){h.addDummyNode(W,"selfedge",{width:Q.label.width,height:Q.label.height,rank:X.rank,order:se+ ++re,e:Q.e,label:Q.label},"_se")}),delete X.selfEdges})})}function j(W){r.forEach(W.nodes(),function(G){var Y=W.node(G);if(Y.dummy==="selfedge"){var re=W.node(Y.e.v),de=re.x+re.width/2,se=re.y,X=Y.x-de,Q=re.height/2;W.setEdge(Y.e,Y.label),W.removeNode(G),Y.label.points=[{x:de+2*X/3,y:se-Q},{x:de+5*X/6,y:se-Q},{x:de+X,y:se},{x:de+5*X/6,y:se+Q},{x:de+2*X/3,y:se+Q}],Y.label.x=Y.x,Y.label.y=Y.y}})}function ee(W,G){return r.mapValues(r.pick(W,G),Number)}function le(W){var G={};return r.forEach(W,function(Y,re){G[re.toLowerCase()]=Y}),G}return Zy}var Xy,P2;function aW(){if(P2)return Xy;P2=1;var r=qr(),e=$t(),t=xn().Graph;Xy={debugOrdering:n};function n(a){var i=e.buildLayerMatrix(a),o=new t({compound:!0,multigraph:!0}).setGraph({});return r.forEach(a.nodes(),function(s){o.setNode(s,{label:s}),o.setParent(s,"layer"+a.node(s).rank)}),r.forEach(a.edges(),function(s){o.setEdge(s.v,s.w,{},s.name)}),r.forEach(i,function(s,l){var u="layer"+l;o.setNode(u,{rank:"same"}),r.reduce(s,function(c,d){return o.setEdge(c,d,{style:"invis"}),d})}),o}return Xy}var Qy,I2;function iW(){return I2||(I2=1,Qy="0.8.5"),Qy}var Jy,D2;function oW(){return D2||(D2=1,Jy={graphlib:xn(),layout:nW(),debug:aW(),util:{time:$t().time,notime:$t().notime},version:iW()}),Jy}var sW=zu.exports,B2;function uW(){return B2||(B2=1,(function(r,e){(function(n,a){r.exports=a(oW())})(sW,function(t){return(function(n){var a={};function i(o){if(a[o])return a[o].exports;var s=a[o]={i:o,l:!1,exports:{}};return n[o].call(s.exports,s,s.exports,i),s.l=!0,s.exports}return i.m=n,i.c=a,i.d=function(o,s,l){i.o(o,s)||Object.defineProperty(o,s,{enumerable:!0,get:l})},i.r=function(o){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(o,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(o,"__esModule",{value:!0})},i.t=function(o,s){if(s&1&&(o=i(o)),s&8||s&4&&typeof o=="object"&&o&&o.__esModule)return o;var l=Object.create(null);if(i.r(l),Object.defineProperty(l,"default",{enumerable:!0,value:o}),s&2&&typeof o!="string")for(var u in o)i.d(l,u,(function(c){return o[c]}).bind(null,u));return l},i.n=function(o){var s=o&&o.__esModule?function(){return o.default}:function(){return o};return i.d(s,"a",s),s},i.o=function(o,s){return Object.prototype.hasOwnProperty.call(o,s)},i.p="",i(i.s=0)})([(function(n,a,i){var o=i(1),s=function(u){u&&u("layout","dagre",o)};typeof cytoscape<"u"&&s(cytoscape),n.exports=s}),(function(n,a,i){function o(h){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?o=function(p){return typeof p}:o=function(p){return p&&typeof Symbol=="function"&&p.constructor===Symbol&&p!==Symbol.prototype?"symbol":typeof p},o(h)}var s=function(g){return typeof g=="function"},l=i(2),u=i(3),c=i(4);function d(h){this.options=u({},l,h)}d.prototype.run=function(){var h=this.options,g=this,p=h.cy,E=h.eles,y=function(j,ee){return s(ee)?ee.apply(j,[j]):ee},b=h.boundingBox||{x1:0,y1:0,w:p.width(),h:p.height()};b.x2===void 0&&(b.x2=b.x1+b.w),b.w===void 0&&(b.w=b.x2-b.x1),b.y2===void 0&&(b.y2=b.y1+b.h),b.h===void 0&&(b.h=b.y2-b.y1);var w=new c.graphlib.Graph({multigraph:!0,compound:!0}),x={},C=function(j,ee){ee!=null&&(x[j]=ee)};C("nodesep",h.nodeSep),C("edgesep",h.edgeSep),C("ranksep",h.rankSep),C("rankdir",h.rankDir),C("align",h.align),C("ranker",h.ranker),C("acyclicer",h.acyclicer),w.setGraph(x),w.setDefaultEdgeLabel(function(){return{}}),w.setDefaultNodeLabel(function(){return{}});var T=E.nodes();s(h.sort)&&(T=T.sort(h.sort));for(var S=0;S<T.length;S++){var _=T[S],A=_.layoutDimensions(h);w.setNode(_.id(),{width:A.w,height:A.h,name:_.id()})}for(var P=0;P<T.length;P++){var I=T[P];I.isChild()&&w.setParent(I.id(),I.parent().id())}var D=E.edges().stdFilter(function(K){return!K.source().isParent()&&!K.target().isParent()});s(h.sort)&&(D=D.sort(h.sort));for(var k=0;k<D.length;k++){var M=D[k];w.setEdge(M.source().id(),M.target().id(),{minlen:y(M,h.minLen),weight:y(M,h.edgeWeight),name:M.id()},M.id())}c.layout(w);for(var N=w.nodes(),z=0;z<N.length;z++){var $=N[z],q=w.node($);p.getElementById($).scratch().dagre=q}var V;h.boundingBox?(V={x1:1/0,x2:-1/0,y1:1/0,y2:-1/0},T.forEach(function(K){var j=K.scratch().dagre;V.x1=Math.min(V.x1,j.x),V.x2=Math.max(V.x2,j.x),V.y1=Math.min(V.y1,j.y),V.y2=Math.max(V.y2,j.y)}),V.w=V.x2-V.x1,V.h=V.y2-V.y1):V=b;var Z=function(j){if(h.boundingBox){var ee=V.w===0?0:(j.x-V.x1)/V.w,le=V.h===0?0:(j.y-V.y1)/V.h;return{x:b.x1+ee*b.w,y:b.y1+le*b.h}}else return j};return T.layoutPositions(g,h,function(K){K=o(K)==="object"?K:this;var j=K.scratch().dagre;return Z({x:j.x,y:j.y})}),this},n.exports=d}),(function(n,a){var i={nodeSep:void 0,edgeSep:void 0,rankSep:void 0,rankDir:void 0,align:void 0,acyclicer:void 0,ranker:void 0,minLen:function(s){return 1},edgeWeight:function(s){return 1},fit:!0,padding:30,spacingFactor:void 0,nodeDimensionsIncludeLabels:!1,animate:!1,animateFilter:function(s,l){return!0},animationDuration:500,animationEasing:void 0,boundingBox:void 0,transform:function(s,l){return l},ready:function(){},sort:void 0,stop:function(){}};n.exports=i}),(function(n,a){n.exports=Object.assign!=null?Object.assign.bind(Object):function(i){for(var o=arguments.length,s=new Array(o>1?o-1:0),l=1;l<o;l++)s[l-1]=arguments[l];return s.forEach(function(u){Object.keys(u).forEach(function(c){return i[c]=u[c]})}),i}}),(function(n,a){n.exports=t})])})})(zu)),zu.exports}var lW=uW();const fW=Cl(lW);var $u={exports:{}},em,M2;function cW(){if(M2)return em;M2=1;var r="Expected a function",e="__lodash_hash_undefined__",t="[object Function]",n="[object GeneratorFunction]",a=/[\\^$.*+?()[\]{}|]/g,i=/^\[object .+?Constructor\]$/,o=typeof Et=="object"&&Et&&Et.Object===Object&&Et,s=typeof self=="object"&&self&&self.Object===Object&&self,l=o||s||Function("return this")();function u(ve,U){return ve==null?void 0:ve[U]}function c(ve){var U=!1;if(ve!=null&&typeof ve.toString!="function")try{U=!!(ve+"")}catch{}return U}var d=Array.prototype,h=Function.prototype,g=Object.prototype,p=l["__core-js_shared__"],E=(function(){var ve=/[^.]+$/.exec(p&&p.keys&&p.keys.IE_PROTO||"");return ve?"Symbol(src)_1."+ve:""})(),y=h.toString,b=g.hasOwnProperty,w=g.toString,x=RegExp("^"+y.call(b).replace(a,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),C=d.splice,T=de(l,"Map"),S=de(Object,"create");function _(ve){var U=-1,fe=ve?ve.length:0;for(this.clear();++U<fe;){var xe=ve[U];this.set(xe[0],xe[1])}}function A(){this.__data__=S?S(null):{}}function P(ve){return this.has(ve)&&delete this.__data__[ve]}function I(ve){var U=this.__data__;if(S){var fe=U[ve];return fe===e?void 0:fe}return b.call(U,ve)?U[ve]:void 0}function D(ve){var U=this.__data__;return S?U[ve]!==void 0:b.call(U,ve)}function k(ve,U){var fe=this.__data__;return fe[ve]=S&&U===void 0?e:U,this}_.prototype.clear=A,_.prototype.delete=P,_.prototype.get=I,_.prototype.has=D,_.prototype.set=k;function M(ve){var U=-1,fe=ve?ve.length:0;for(this.clear();++U<fe;){var xe=ve[U];this.set(xe[0],xe[1])}}function N(){this.__data__=[]}function z(ve){var U=this.__data__,fe=G(U,ve);if(fe<0)return!1;var xe=U.length-1;return fe==xe?U.pop():C.call(U,fe,1),!0}function $(ve){var U=this.__data__,fe=G(U,ve);return fe<0?void 0:U[fe][1]}function q(ve){return G(this.__data__,ve)>-1}function V(ve,U){var fe=this.__data__,xe=G(fe,ve);return xe<0?fe.push([ve,U]):fe[xe][1]=U,this}M.prototype.clear=N,M.prototype.delete=z,M.prototype.get=$,M.prototype.has=q,M.prototype.set=V;function Z(ve){var U=-1,fe=ve?ve.length:0;for(this.clear();++U<fe;){var xe=ve[U];this.set(xe[0],xe[1])}}function K(){this.__data__={hash:new _,map:new(T||M),string:new _}}function j(ve){return re(this,ve).delete(ve)}function ee(ve){return re(this,ve).get(ve)}function le(ve){return re(this,ve).has(ve)}function W(ve,U){return re(this,ve).set(ve,U),this}Z.prototype.clear=K,Z.prototype.delete=j,Z.prototype.get=ee,Z.prototype.has=le,Z.prototype.set=W;function G(ve,U){for(var fe=ve.length;fe--;)if(te(ve[fe][0],U))return fe;return-1}function Y(ve){if(!_e(ve)||X(ve))return!1;var U=ce(ve)||c(ve)?x:i;return U.test(Q(ve))}function re(ve,U){var fe=ve.__data__;return se(U)?fe[typeof U=="string"?"string":"hash"]:fe.map}function de(ve,U){var fe=u(ve,U);return Y(fe)?fe:void 0}function se(ve){var U=typeof ve;return U=="string"||U=="number"||U=="symbol"||U=="boolean"?ve!=="__proto__":ve===null}function X(ve){return!!E&&E in ve}function Q(ve){if(ve!=null){try{return y.call(ve)}catch{}try{return ve+""}catch{}}return""}function ae(ve,U){if(typeof ve!="function"||U&&typeof U!="function")throw new TypeError(r);var fe=function(){var xe=arguments,ge=U?U.apply(this,xe):xe[0],be=fe.cache;if(be.has(ge))return be.get(ge);var Ae=ve.apply(this,xe);return fe.cache=be.set(ge,Ae),Ae};return fe.cache=new(ae.Cache||Z),fe}ae.Cache=Z;function te(ve,U){return ve===U||ve!==ve&&U!==U}function ce(ve){var U=_e(ve)?w.call(ve):"";return U==t||U==n}function _e(ve){var U=typeof ve;return!!ve&&(U=="object"||U=="function")}return em=ae,em}var rm,k2;function dW(){if(k2)return rm;k2=1;var r="Expected a function",e=NaN,t="[object Symbol]",n=/^\s+|\s+$/g,a=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,o=/^0o[0-7]+$/i,s=parseInt,l=typeof Et=="object"&&Et&&Et.Object===Object&&Et,u=typeof self=="object"&&self&&self.Object===Object&&self,c=l||u||Function("return this")(),d=Object.prototype,h=d.toString,g=Math.max,p=Math.min,E=function(){return c.Date.now()};function y(S,_,A){var P,I,D,k,M,N,z=0,$=!1,q=!1,V=!0;if(typeof S!="function")throw new TypeError(r);_=T(_)||0,w(A)&&($=!!A.leading,q="maxWait"in A,D=q?g(T(A.maxWait)||0,_):D,V="trailing"in A?!!A.trailing:V);function Z(de){var se=P,X=I;return P=I=void 0,z=de,k=S.apply(X,se),k}function K(de){return z=de,M=setTimeout(le,_),$?Z(de):k}function j(de){var se=de-N,X=de-z,Q=_-se;return q?p(Q,D-X):Q}function ee(de){var se=de-N,X=de-z;return N===void 0||se>=_||se<0||q&&X>=D}function le(){var de=E();if(ee(de))return W(de);M=setTimeout(le,j(de))}function W(de){return M=void 0,V&&P?Z(de):(P=I=void 0,k)}function G(){M!==void 0&&clearTimeout(M),z=0,P=N=I=M=void 0}function Y(){return M===void 0?k:W(E())}function re(){var de=E(),se=ee(de);if(P=arguments,I=this,N=de,se){if(M===void 0)return K(N);if(q)return M=setTimeout(le,_),Z(N)}return M===void 0&&(M=setTimeout(le,_)),k}return re.cancel=G,re.flush=Y,re}function b(S,_,A){var P=!0,I=!0;if(typeof S!="function")throw new TypeError(r);return w(A)&&(P="leading"in A?!!A.leading:P,I="trailing"in A?!!A.trailing:I),y(S,_,{leading:P,maxWait:_,trailing:I})}function w(S){var _=typeof S;return!!S&&(_=="object"||_=="function")}function x(S){return!!S&&typeof S=="object"}function C(S){return typeof S=="symbol"||x(S)&&h.call(S)==t}function T(S){if(typeof S=="number")return S;if(C(S))return e;if(w(S)){var _=typeof S.valueOf=="function"?S.valueOf():S;S=w(_)?_+"":_}if(typeof S!="string")return S===0?S:+S;S=S.replace(n,"");var A=i.test(S);return A||o.test(S)?s(S.slice(2),A?2:8):a.test(S)?e:+S}return rm=b,rm}var vW=$u.exports,O2;function hW(){return O2||(O2=1,(function(r,e){(function(n,a){r.exports=a(cW(),dW())})(vW,function(t,n){return(function(a){var i={};function o(s){if(i[s])return i[s].exports;var l=i[s]={i:s,l:!1,exports:{}};return a[s].call(l.exports,l,l.exports,o),l.l=!0,l.exports}return o.m=a,o.c=i,o.i=function(s){return s},o.d=function(s,l,u){o.o(s,l)||Object.defineProperty(s,l,{configurable:!1,enumerable:!0,get:u})},o.n=function(s){var l=s&&s.__esModule?function(){return s.default}:function(){return s};return o.d(l,"a",l),l},o.o=function(s,l){return Object.prototype.hasOwnProperty.call(s,l)},o.p="",o(o.s=12)})([(function(a,i,o){a.exports=Object.assign!=null?Object.assign.bind(Object):function(s){for(var l=arguments.length,u=Array(l>1?l-1:0),c=1;c<l;c++)u[c-1]=arguments[c];return u.filter(function(d){return d!=null}).forEach(function(d){Object.keys(d).forEach(function(h){return s[h]=d[h]})}),s}}),(function(a,i,o){var s=o(10),l=o(0);a.exports=function(u){var c=this;return new s(l({cy:c},u))}}),(function(a,i,o){function s(){if(this.saveGestureState(),this.cy.zoomingEnabled(!1).panningEnabled(!1).boxSelectionEnabled(!1),this.options.disableBrowserGestures){var c=this.windowListenerOptions;window.addEventListener("touchstart",this.preventDefault,c),window.addEventListener("touchmove",this.preventDefault,c),window.addEventListener("wheel",this.preventDefault,c)}return this}function l(){if(this.cy.zoomingEnabled(this.lastZoomingEnabled).panningEnabled(this.lastPanningEnabled).boxSelectionEnabled(this.lastBoxSelectionEnabled),this.options.disableBrowserGestures){var c=this.windowListenerOptions;window.removeEventListener("touchstart",this.preventDefault,c),window.removeEventListener("touchmove",this.preventDefault,c),window.removeEventListener("wheel",this.preventDefault,c)}return this}function u(){var c=this.cy;return this.lastPanningEnabled=c.panningEnabled(),this.lastZoomingEnabled=c.zoomingEnabled(),this.lastBoxSelectionEnabled=c.boxSelectionEnabled(),this}a.exports={disableGestures:s,resetGestures:l,saveGestureState:u}}),(function(a,i,o){function s(){var l=this,u=this.cy,c=this.options;return this.addListener(u,"drag",function(){return l.grabbingNode=!0}),this.addListener(u,"free",function(){return l.grabbingNode=!1}),this.addListener(u,"tapstart","node",function(d){var h=d.target;l.drawMode&&l.start(h)}),this.addListener(u,"tapdrag",function(d){l.update(d.position)}),this.addListener(u,"tapdragover","node",function(d){c.snap||l.preview(d.target)}),this.addListener(u,"tapdragout","node",function(d){c.snap||l.unpreview(d.target)}),this.addListener(u,"tapend",function(){l.stop()}),this}a.exports={addCytoscapeListeners:s}}),(function(a,i,o){var s={canConnect:function(u,c){return!u.same(c)},edgeParams:function(u,c){return{}},hoverDelay:150,snap:!0,snapThreshold:50,snapFrequency:15,noEdgeEventsInDraw:!0,disableBrowserGestures:!0};a.exports=s}),(function(a,i,o){function s(c){var d=this.cy;return this.drawMode=c??!this.drawMode,this.drawMode?(this.prevUngrabifyState=d.autoungrabify(),d.autoungrabify(!0),this.emit("drawon")):(d.autoungrabify(this.prevUngrabifyState),this.emit("drawoff")),this}function l(){return this.toggleDrawMode(!0)}function u(){return this.toggleDrawMode(!1)}a.exports={toggleDrawMode:s,enableDrawMode:l,disableDrawMode:u}}),(function(a,i,o){var s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(b){return typeof b}:function(b){return b&&typeof Symbol=="function"&&b.constructor===Symbol&&b!==Symbol.prototype?"symbol":typeof b},l=o(0),u=function(w){return(typeof w>"u"?"undefined":s(w))===s("")},c=function(w){return(typeof w>"u"?"undefined":s(w))===s([])&&w.length!=null};function d(b,w,x){var C={};return l(C,w,b),l(C.data,w.data,b.data),u(w.classes)?C.classes=w.classes+" "+x:c(w.classes)?C.classes=w.classes.join(" ")+" "+x:C.classes=x,C}function h(){var b=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,w=this.cy;this.options;var x=this.presumptiveTargets,C=this.previewEles,T=this.active,S=this.sourceNode,_=this.targetNode,A=b?"eh-preview":"",P=w.collection(),I=this.canConnect(_);if(T&&I){if(!_||_.size()===0){C.remove(),this.emit("cancel",this.mp(),S,x);return}if(!b){C.removeClass("eh-preview").style("events",""),this.emit("complete",this.mp(),S,_,C);return}var D=w.add(d({group:"edges",data:{source:S.id(),target:_.id()}},this.edgeParams(_),A));return P=P.merge(D),b?(this.previewEles=P,P.style("events","no")):(P.style("events",""),this.emit("complete",this.mp(),S,_,P)),this}}function g(){return this.makeEdges(!0),this}function p(){return this.previewEles.nonempty()&&this.previewEles.inside()}function E(){return this.previewShown()&&this.previewEles.remove(),this}function y(){var b=this,w=this.sourceNode,x=this.ghostNode,C=this.cy,T=this.mx,S=this.my,_=T,A=S,P=void 0,I=void 0;if(w)return(!x||x.length===0||x.removed())&&(I=this.ghostEles=C.collection(),C.batch(function(){x=b.ghostNode=C.add({group:"nodes",classes:"eh-ghost eh-ghost-node",position:{x:0,y:0}}),x.style({"background-color":"blue",width:1e-4,height:1e-4,opacity:0,events:"no"});var D={};P=C.add(l({},D,{group:"edges",data:l({},D.data,{source:w.id(),target:x.id()}),classes:"eh-ghost eh-ghost-edge"})),P.style({events:"no"})}),I.merge(x).merge(P)),x.position({x:_,y:A}),this}a.exports={makeEdges:h,makePreview:g,removePreview:E,previewShown:p,updateEdge:y}}),(function(a,i,o){function s(){return this.options.noEdgeEventsInDraw&&this.cy.edges().style("events","no"),this}function l(){return this.options.noEdgeEventsInDraw&&this.cy.edges().style("events",""),this}a.exports={disableEdgeEvents:s,enableEdgeEvents:l}}),(function(a,i,o){function s(){return this.enabled=!0,this.emit("enable"),this}function l(){return this.enabled=!1,this.emit("disable"),this}a.exports={enable:s,disable:l}}),(function(a,i,o){var s=o(13),l=Math.sqrt(2);function u(w){var x=this.previewEles,C=this.ghostEles,T=function(k){return x.anySame(k)},S=function(k){return C.anySame(k)},_=function(k){return T(k)||S(k)},A=this.enabled,P=this.active,I=this.grabbingNode;return A&&!P&&!I&&w!=null&&w.nonempty()&&!_(w)}function c(w){return this.canStartOn(w)&&this.drawMode}function d(w){return this.canStartOn(w)&&!this.drawMode}function h(w){var x=this;if(this.canStartOn(w)){this.active=!0,this.sourceNode=w,this.sourceNode.addClass("eh-source"),this.disableGestures(),this.disableEdgeEvents();var C=function(S){return S.id()};this.canConnect=s(function(T){return x.options.canConnect(x.sourceNode,T)},C),this.edgeParams=s(function(T){return x.options.edgeParams(x.sourceNode,T)},C),this.emit("start",this.hp(),w)}}function g(w){if(this.active){var x=w;return this.mx=x.x,this.my=x.y,this.updateEdge(),this.throttledSnap(),this}}function p(){if(!this.active||!this.options.snap)return!1;var w=this.cy,x=this.targetNode,C=this.options.snapThreshold,T=this.mp(),S=this.previewEles,_=this.ghostNode,A=function(G){return l*Math.max(G.outerWidth(),G.outerHeight())/2},P=function(G,Y,re,de){var se=re-G,X=de-Y;return se*se+X*X},I=function(G,Y){return P(G.x,G.y,Y.x,Y.y)},D=function(G){return I(G.position(),T)},k=function(G){var Y=A(G),re=Y+C;return re*re},M=function(G){return D(G)<=k(G)},N=function(G){var Y=G.position(),re=G.outerWidth()/2,de=G.outerHeight()/2,se=Y.x,X=Y.y,Q=T.x,ae=T.y,te=se-re,ce=se+re,_e=X-de,ve=X+de,U=te<=Q&&Q<=ce,fe=_e<=ae&&ae<=ve;if(U&&fe)return 0;if(U){var xe=ae-_e,ge=ae-ve;return Math.min(xe*xe,ge*ge)}else if(fe){var be=Q-te,Ae=Q-ce;return Math.min(be*be,Ae*Ae)}else return Q<te&&ae<_e?P(Q,ae,te,_e):Q>ce&&ae<_e?P(Q,ae,ce,_e):Q<te&&ae>ve?P(Q,ae,te,ve):P(Q,ae,ce,ve)},z=function(G,Y){return N(G)-N(Y)},$=z,q=!1,V=function(G){var Y=T,re=G.outerWidth(),de=re/2,se=G.outerHeight(),X=se/2,Q=G.position(),ae=Q.x-de,te=Q.x+de,ce=Q.y-X,_e=Q.y+X;return ae<=Y.x&&Y.x<=te&&ce<=Y.y&&Y.y<=_e},Z=function(G){return G.same(S)||G.same(_)},K=w.nodes(function(W){return!Z(W)&&M(W)}).sort($),j=!1;x.nonempty()&&!M(x)&&this.unpreview(x);for(var ee=0;ee<K.length;ee++){var le=K[ee];if(!(le.isParent()&&V(le))&&!(le.isChild()&&!V(le.parent()))&&(le.same(x)||this.preview(le,q))){j=!0;break}}return j}function E(w){var x=this,C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,T=this.options,S=this.sourceNode,_=this.ghostNode,A=this.ghostEles,P=this.presumptiveTargets,I=this.previewEles,D=this.active,k=S,M=w.same(_),N=!this.canConnect(w),z=w.same(this.targetNode);if(!D||M||N||z)return!1;this.targetNode.nonempty()&&this.unpreview(this.targetNode),clearTimeout(this.previewTimeout);var $=function(){x.targetNode=w,P.merge(w),w.addClass("eh-presumptive-target"),w.addClass("eh-target"),x.emit("hoverover",x.mp(),k,w),w.addClass("eh-preview"),A.addClass("eh-preview-active"),S.addClass("eh-preview-active"),w.addClass("eh-preview-active"),x.makePreview(),x.emit("previewon",x.mp(),k,w,I)};return C&&T.hoverDelay>0?this.previewTimeout=setTimeout($,T.hoverDelay):$(),!0}function y(w){if(this.active){var x=this.previewTimeout,C=this.sourceNode,T=this.previewEles,S=this.ghostEles,_=this.cy;clearTimeout(x),this.previewTimeout=null;var A=C;return w.removeClass("eh-preview eh-target eh-presumptive-target eh-preview-active"),S.removeClass("eh-preview-active"),C.removeClass("eh-preview-active"),this.targetNode=_.collection(),this.removePreview(A,w),this.emit("hoverout",this.mp(),A,w),this.emit("previewoff",this.mp(),A,w,T),this}}function b(){if(this.active){var w=this.sourceNode,x=this.targetNode,C=this.ghostEles,T=this.presumptiveTargets;return clearTimeout(this.previewTimeout),w.removeClass("eh-source eh-preview-active"),x.removeClass("eh-target eh-preview eh-hover eh-preview-active"),T.removeClass("eh-presumptive-target"),this.makeEdges(),C.remove(),this.clearCollections(),this.resetGestures(),this.enableEdgeEvents(),this.active=!1,this.emit("stop",this.mp(),w),this}}a.exports={start:h,update:g,preview:E,unpreview:y,stop:b,snap:p,canStartOn:u,canStartDrawModeOn:c,canStartNonDrawModeOn:d}}),(function(a,i,o){var s=o(4),l=o(0),u=o(14),c=o(2),d=o(3),h=o(5),g=o(6),p=o(8),E=o(9),y=o(11),b=o(7);function w(T){var S=T.cy;this.cy=S,this.listeners=[],this.enabled=!0,this.drawMode=!1,this.active=!1,this.grabbingNode=!1,this.clearCollections(),this.mx=0,this.my=0,this.options=l({},s,T),this.saveGestureState(),this.addListeners(),this.throttledSnap=u(this.snap.bind(this),1e3/T.snapFrequency),this.preventDefault=function(P){return P.preventDefault()},this.canConnect=function(){return!1};var _=!1;try{var A=Object.defineProperty({},"passive",{get:function(){_=!0}});window.addEventListener("test",null,A)}catch{}_?this.windowListenerOptions={capture:!0,passive:!1}:this.windowListenerOptions=!0}var x=w.prototype={},C=function(S){return l(x,S)};x.destroy=function(){this.removeListeners()},x.setOptions=function(T){l(this.options,T)},x.mp=function(){return{x:this.mx,y:this.my}},x.hp=function(){return{x:this.hx,y:this.hy}},x.clearCollections=function(){var T=this.cy;this.previewEles=T.collection(),this.ghostEles=T.collection(),this.ghostNode=T.collection(),this.sourceNode=T.collection(),this.targetNode=T.collection(),this.presumptiveTargets=T.collection()},[c,d,h,g,p,E,y,b].forEach(C),a.exports=w}),(function(a,i,o){var s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(E){return typeof E}:function(E){return E&&typeof Symbol=="function"&&E.constructor===Symbol&&E!==Symbol.prototype?"symbol":typeof E};function l(){var E=this;return this.addCytoscapeListeners(),this.addListener(this.cy,"destroy",function(){return E.destroy()}),this}function u(){for(var E=this.listeners.length-1;E>=0;E--){var y=this.listeners[E];this.removeListener(y.target,y.event,y.selector,y.callback,y.options)}return this}function c(E,y,b,w,x){return(typeof b>"u"?"undefined":s(b))!==s("")&&(w=b,x=w,b=null),x==null&&(x=!1),{target:E,event:y,selector:b,callback:w,options:x}}function d(E){return E instanceof Element}function h(E,y,b,w,x){var C=c(E,y,b,w,x);return this.listeners.push(C),d(C.target)?C.target.addEventListener(C.event,C.callback,C.options):C.selector?C.target.addListener(C.event,C.selector,C.callback,C.options):C.target.addListener(C.event,C.callback,C.options),this}function g(E,y,b,w,x){for(var C=c(E,y,b,w,x),T=this.listeners.length-1;T>=0;T--){var S=this.listeners[T];if(C.target===S.target&&C.event===S.event&&(C.selector==null||C.selector===S.selector)&&(C.callback==null||C.callback===S.callback)){this.listeners.splice(T,1),d(C.target)?C.target.removeEventListener(C.event,C.callback,C.options):C.selector?C.target.removeListener(C.event,C.selector,C.callback,C.options):C.target.removeListener(C.event,C.callback,C.options);break}}return this}function p(E,y){for(var b=this.cy,w=arguments.length,x=Array(w>2?w-2:0),C=2;C<w;C++)x[C-2]=arguments[C];return b.emit({type:"eh"+E,position:y},x),this}a.exports={addListener:h,addListeners:l,removeListener:g,removeListeners:u,emit:p}}),(function(a,i,o){var s=o(1),l=function(c){c&&c("core","edgehandles",s)};typeof cytoscape<"u"&&l(cytoscape),a.exports=l}),(function(a,i){a.exports=t}),(function(a,i){a.exports=n})])})})($u)),$u.exports}var gW=hW();const pW=Cl(gW);var tm,L2;function yW(){if(L2)return tm;L2=1;class r{constructor(n,a={}){this._cy=n,this._params=a,this._node_dom={};let i=n.container();if(a.dom_container)this._nodes_dom_container=a.dom_container;else{let o=document.createElement("div");o.style.position="absolute",o.style.zIndex=10,i.querySelector("canvas").parentNode.appendChild(o),this._nodes_dom_container=o}this._resize_observer=new ResizeObserver(o=>{for(let s of o){let l=s.target,u=l.__cy_id;n.getElementById(u).style({width:l.offsetWidth,height:l.offsetHeight,shape:"rectangle"})}}),n.on("add","node",o=>{this._add_node(o.target)}),n.on("remove","node",o=>{this._remove_node(o.target)});for(let o of n.nodes())this._add_node(o);n.on("pan zoom",o=>{let s=n.pan(),l=n.zoom(),u="translate("+s.x+"px,"+s.y+"px) scale("+l+")";this._nodes_dom_container.style.msTransform=u,this._nodes_dom_container.style.transform=u}),n.on("position bounds","node",o=>{let s=o.target,l=s.id();if(!this._node_dom[l])return;let u=this._node_dom[l],c=`translate(-50%, -50%) translate(${s.position("x").toFixed(2)}px, ${s.position("y").toFixed(2)}px)`;u.style.webkitTransform=c,u.style.msTransform=c,u.style.transform=c,u.style.display="inline",u.style.position="absolute",u.style["z-index"]=10})}_add_node(n){let a=n.data();a.dom&&(a.skip_node_append!==!0&&this._nodes_dom_container.appendChild(a.dom),a.dom.__cy_id=n.id(),this._node_dom[n.id()]=a.dom,this._resize_observer.observe(a.dom))}_remove_node(n){let a=n.id(),i=this._node_dom[a];i&&(this._resize_observer.unobserve(i),i.parentNode===this._nodes_dom_container&&this._nodes_dom_container.removeChild(i),delete this._node_dom[a])}node_dom(n){return this._node_dom[n]}update(n,a){let i=this._cy.getElementById(n);if(!i){console.warn(`Node with id ${n} not found`);return}let o=this._node_dom[n];if(!o){console.warn(`DOM element for node ${n} not found`);return}a(o),i.data("dom",o),this._cy.trigger("position",["node",i])}remove(){for(let n in this._node_dom)this._resize_observer.unobserve(this._node_dom[n]);for(;this._nodes_dom_container.firstChild;)this._nodes_dom_container.removeChild(this._nodes_dom_container.firstChild);this._node_dom={},this._cy.removeListener("add","node"),this._cy.removeListener("remove","node"),this._cy.removeListener("pan zoom"),this._cy.removeListener("position bounds","node"),this._params.dom_container||this._nodes_dom_container.parentNode.removeChild(this._nodes_dom_container),this._cy=null,this._params=null,this._nodes_dom_container=null,this._resize_observer=null}}function e(t){t&&t("core","domNode",function(n,a){return new r(this,n,a)})}return typeof cytoscape<"u"&&e(cytoscape),tm=e,tm}var mW=yW();const bW=Cl(mW);un.prototype.hasInitialised||(un.use(fW),un.use(pW),un.use(bW),un.prototype.hasInitialised=!0);var Go={exports:{}};/**
332
332
  * @license
333
333
  * Lodash <https://lodash.com/>
334
334
  * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
@@ -354,5 +354,5 @@ __p += '`),vr&&(Ie+=`' +
354
354
  function print() { __p += __j.call(arguments, '') }
355
355
  `:`;
356
356
  `)+Ie+`return __p
357
- }`;var sr=D1(function(){return mr(F,Ue+"return "+Ie).apply(t,H)});if(sr.source=Ie,Yf(sr))throw sr;return sr}function nL(f){return wr(f).toLowerCase()}function aL(f){return wr(f).toUpperCase()}function iL(f,v,m){if(f=wr(f),f&&(m||v===t))return z0(f);if(!f||!(v=Ut(v)))return f;var R=hn(f),B=hn(v),F=$0(R,B),H=V0(R,B)+1;return da(R,F,H).join("")}function oL(f,v,m){if(f=wr(f),f&&(m||v===t))return f.slice(0,W0(f)+1);if(!f||!(v=Ut(v)))return f;var R=hn(f),B=V0(R,hn(v))+1;return da(R,0,B).join("")}function sL(f,v,m){if(f=wr(f),f&&(m||v===t))return f.replace(Nr,"");if(!f||!(v=Ut(v)))return f;var R=hn(f),B=$0(R,hn(v));return da(R,B).join("")}function uL(f,v){var m=I,R=D;if(Fr(v)){var B="separator"in v?v.separator:B;m="length"in v?ir(v.length):m,R="omission"in v?Ut(v.omission):R}f=wr(f);var F=f.length;if(Ci(f)){var H=hn(f);F=H.length}if(m>=F)return f;var J=m-_i(R);if(J<1)return R;var ie=H?da(H,0,J).join(""):f.slice(0,J);if(B===t)return ie+R;if(H&&(J+=ie.length-J),Zf(B)){if(f.slice(J).search(B)){var Te,Re=ie;for(B.global||(B=df(B.source,wr(ft.exec(B))+"g")),B.lastIndex=0;Te=B.exec(Re);)var Ie=Te.index;ie=ie.slice(0,Ie===t?J:Ie)}}else if(f.indexOf(Ut(B),J)!=J){var Oe=ie.lastIndexOf(B);Oe>-1&&(ie=ie.slice(0,Oe))}return ie+R}function lL(f){return f=wr(f),f&&or.test(f)?f.replace(Fe,NI):f}var fL=Di(function(f,v,m){return f+(m?" ":"")+v.toUpperCase()}),Jf=Bb("toUpperCase");function I1(f,v,m){return f=wr(f),v=m?t:v,v===t?MI(f)?$I(f):_I(f):f.match(v)||[]}var D1=lr(function(f,v){try{return Gt(f,t,v)}catch(m){return Yf(m)?m:new rr(m)}}),cL=$n(function(f,v){return Qt(v,function(m){m=Tn(m),Fn(f,m,Kf(f[m],f))}),f});function dL(f){var v=f==null?0:f.length,m=Ze();return f=v?Or(f,function(R){if(typeof R[1]!="function")throw new Jt(o);return[m(R[0]),R[1]]}):[],lr(function(R){for(var B=-1;++B<v;){var F=f[B];if(Gt(F[0],this,R))return Gt(F[1],this,R)}})}function vL(f){return ND(rn(f,d))}function ec(f){return function(){return f}}function hL(f,v){return f==null||f!==f?v:f}var gL=kb(),pL=kb(!0);function qt(f){return f}function rc(f){return fb(typeof f=="function"?f:rn(f,d))}function yL(f){return db(rn(f,d))}function mL(f,v){return vb(f,rn(v,d))}var bL=lr(function(f,v){return function(m){return Co(m,f,v)}}),wL=lr(function(f,v){return function(m){return Co(f,m,v)}});function tc(f,v,m){var R=it(v),B=js(v,R);m==null&&!(Fr(v)&&(B.length||!R.length))&&(m=v,v=f,f=this,B=js(v,it(v)));var F=!(Fr(m)&&"chain"in m)||!!m.chain,H=Gn(f);return Qt(B,function(J){var ie=v[J];f[J]=ie,H&&(f.prototype[J]=function(){var Te=this.__chain__;if(F||Te){var Re=f(this.__wrapped__),Ie=Re.__actions__=kt(this.__actions__);return Ie.push({func:ie,args:arguments,thisArg:f}),Re.__chain__=Te,Re}return ie.apply(f,oa([this.value()],arguments))})}),f}function xL(){return ct._===this&&(ct._=KI),this}function nc(){}function EL(f){return f=ir(f),lr(function(v){return hb(v,f)})}var CL=kf(Or),_L=kf(O0),SL=kf(af);function B1(f){return $f(f)?of(Tn(f)):rB(f)}function TL(f){return function(v){return f==null?t:Ua(f,v)}}var RL=Lb(),AL=Lb(!0);function ac(){return[]}function ic(){return!1}function PL(){return{}}function IL(){return""}function DL(){return!0}function BL(f,v){if(f=ir(f),f<1||f>V)return[];var m=j,R=wt(f,j);v=Ze(v),f-=j;for(var B=lf(R,v);++m<f;)v(m);return B}function ML(f){return tr(f)?Or(f,Tn):Ht(f)?[f]:kt(Qb(wr(f)))}function kL(f){var v=++UI;return wr(f)+v}var OL=eu(function(f,v){return f+v},0),LL=Of("ceil"),qL=eu(function(f,v){return f/v},1),NL=Of("floor");function FL(f){return f&&f.length?Ks(f,qt,wf):t}function zL(f,v){return f&&f.length?Ks(f,Ze(v,2),wf):t}function $L(f){return N0(f,qt)}function VL(f,v){return N0(f,Ze(v,2))}function GL(f){return f&&f.length?Ks(f,qt,_f):t}function WL(f,v){return f&&f.length?Ks(f,Ze(v,2),_f):t}var UL=eu(function(f,v){return f*v},1),HL=Of("round"),KL=eu(function(f,v){return f-v},0);function jL(f){return f&&f.length?uf(f,qt):0}function YL(f,v){return f&&f.length?uf(f,Ze(v,2)):0}return L.after=yk,L.ary=l1,L.assign=aO,L.assignIn=C1,L.assignInWith=vu,L.assignWith=iO,L.at=oO,L.before=f1,L.bind=Kf,L.bindAll=cL,L.bindKey=c1,L.castArray=Pk,L.chain=o1,L.chunk=NB,L.compact=FB,L.concat=zB,L.cond=dL,L.conforms=vL,L.constant=ec,L.countBy=jM,L.create=sO,L.curry=d1,L.curryRight=v1,L.debounce=h1,L.defaults=uO,L.defaultsDeep=lO,L.defer=mk,L.delay=bk,L.difference=$B,L.differenceBy=VB,L.differenceWith=GB,L.drop=WB,L.dropRight=UB,L.dropRightWhile=HB,L.dropWhile=KB,L.fill=jB,L.filter=ZM,L.flatMap=JM,L.flatMapDeep=ek,L.flatMapDepth=rk,L.flatten=t1,L.flattenDeep=YB,L.flattenDepth=ZB,L.flip=wk,L.flow=gL,L.flowRight=pL,L.fromPairs=XB,L.functions=pO,L.functionsIn=yO,L.groupBy=tk,L.initial=JB,L.intersection=eM,L.intersectionBy=rM,L.intersectionWith=tM,L.invert=bO,L.invertBy=wO,L.invokeMap=ak,L.iteratee=rc,L.keyBy=ik,L.keys=it,L.keysIn=Lt,L.map=su,L.mapKeys=EO,L.mapValues=CO,L.matches=yL,L.matchesProperty=mL,L.memoize=lu,L.merge=_O,L.mergeWith=_1,L.method=bL,L.methodOf=wL,L.mixin=tc,L.negate=fu,L.nthArg=EL,L.omit=SO,L.omitBy=TO,L.once=xk,L.orderBy=ok,L.over=CL,L.overArgs=Ek,L.overEvery=_L,L.overSome=SL,L.partial=jf,L.partialRight=g1,L.partition=sk,L.pick=RO,L.pickBy=S1,L.property=B1,L.propertyOf=TL,L.pull=oM,L.pullAll=a1,L.pullAllBy=sM,L.pullAllWith=uM,L.pullAt=lM,L.range=RL,L.rangeRight=AL,L.rearg=Ck,L.reject=fk,L.remove=fM,L.rest=_k,L.reverse=Uf,L.sampleSize=dk,L.set=PO,L.setWith=IO,L.shuffle=vk,L.slice=cM,L.sortBy=pk,L.sortedUniq=mM,L.sortedUniqBy=bM,L.split=JO,L.spread=Sk,L.tail=wM,L.take=xM,L.takeRight=EM,L.takeRightWhile=CM,L.takeWhile=_M,L.tap=FM,L.throttle=Tk,L.thru=ou,L.toArray=w1,L.toPairs=T1,L.toPairsIn=R1,L.toPath=ML,L.toPlainObject=E1,L.transform=DO,L.unary=Rk,L.union=SM,L.unionBy=TM,L.unionWith=RM,L.uniq=AM,L.uniqBy=PM,L.uniqWith=IM,L.unset=BO,L.unzip=Hf,L.unzipWith=i1,L.update=MO,L.updateWith=kO,L.values=ki,L.valuesIn=OO,L.without=DM,L.words=I1,L.wrap=Ak,L.xor=BM,L.xorBy=MM,L.xorWith=kM,L.zip=OM,L.zipObject=LM,L.zipObjectDeep=qM,L.zipWith=NM,L.entries=T1,L.entriesIn=R1,L.extend=C1,L.extendWith=vu,tc(L,L),L.add=OL,L.attempt=D1,L.camelCase=FO,L.capitalize=A1,L.ceil=LL,L.clamp=LO,L.clone=Ik,L.cloneDeep=Bk,L.cloneDeepWith=Mk,L.cloneWith=Dk,L.conformsTo=kk,L.deburr=P1,L.defaultTo=hL,L.divide=qL,L.endsWith=zO,L.eq=pn,L.escape=$O,L.escapeRegExp=VO,L.every=YM,L.find=XM,L.findIndex=e1,L.findKey=fO,L.findLast=QM,L.findLastIndex=r1,L.findLastKey=cO,L.floor=NL,L.forEach=s1,L.forEachRight=u1,L.forIn=dO,L.forInRight=vO,L.forOwn=hO,L.forOwnRight=gO,L.get=Xf,L.gt=Ok,L.gte=Lk,L.has=mO,L.hasIn=Qf,L.head=n1,L.identity=qt,L.includes=nk,L.indexOf=QB,L.inRange=qO,L.invoke=xO,L.isArguments=ja,L.isArray=tr,L.isArrayBuffer=qk,L.isArrayLike=Ot,L.isArrayLikeObject=Ur,L.isBoolean=Nk,L.isBuffer=va,L.isDate=Fk,L.isElement=zk,L.isEmpty=$k,L.isEqual=Vk,L.isEqualWith=Gk,L.isError=Yf,L.isFinite=Wk,L.isFunction=Gn,L.isInteger=p1,L.isLength=cu,L.isMap=y1,L.isMatch=Uk,L.isMatchWith=Hk,L.isNaN=Kk,L.isNative=jk,L.isNil=Zk,L.isNull=Yk,L.isNumber=m1,L.isObject=Fr,L.isObjectLike=Vr,L.isPlainObject=Po,L.isRegExp=Zf,L.isSafeInteger=Xk,L.isSet=b1,L.isString=du,L.isSymbol=Ht,L.isTypedArray=Mi,L.isUndefined=Qk,L.isWeakMap=Jk,L.isWeakSet=eO,L.join=nM,L.kebabCase=GO,L.last=nn,L.lastIndexOf=aM,L.lowerCase=WO,L.lowerFirst=UO,L.lt=rO,L.lte=tO,L.max=FL,L.maxBy=zL,L.mean=$L,L.meanBy=VL,L.min=GL,L.minBy=WL,L.stubArray=ac,L.stubFalse=ic,L.stubObject=PL,L.stubString=IL,L.stubTrue=DL,L.multiply=UL,L.nth=iM,L.noConflict=xL,L.noop=nc,L.now=uu,L.pad=HO,L.padEnd=KO,L.padStart=jO,L.parseInt=YO,L.random=NO,L.reduce=uk,L.reduceRight=lk,L.repeat=ZO,L.replace=XO,L.result=AO,L.round=HL,L.runInContext=ne,L.sample=ck,L.size=hk,L.snakeCase=QO,L.some=gk,L.sortedIndex=dM,L.sortedIndexBy=vM,L.sortedIndexOf=hM,L.sortedLastIndex=gM,L.sortedLastIndexBy=pM,L.sortedLastIndexOf=yM,L.startCase=eL,L.startsWith=rL,L.subtract=KL,L.sum=jL,L.sumBy=YL,L.template=tL,L.times=BL,L.toFinite=Wn,L.toInteger=ir,L.toLength=x1,L.toLower=nL,L.toNumber=an,L.toSafeInteger=nO,L.toString=wr,L.toUpper=aL,L.trim=iL,L.trimEnd=oL,L.trimStart=sL,L.truncate=uL,L.unescape=lL,L.uniqueId=kL,L.upperCase=fL,L.upperFirst=Jf,L.each=s1,L.eachRight=u1,L.first=n1,tc(L,(function(){var f={};return _n(L,function(v,m){br.call(L.prototype,m)||(f[m]=v)}),f})(),{chain:!1}),L.VERSION=n,Qt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(f){L[f].placeholder=L}),Qt(["drop","take"],function(f,v){dr.prototype[f]=function(m){m=m===t?1:Jr(ir(m),0);var R=this.__filtered__&&!v?new dr(this):this.clone();return R.__filtered__?R.__takeCount__=wt(m,R.__takeCount__):R.__views__.push({size:wt(m,j),type:f+(R.__dir__<0?"Right":"")}),R},dr.prototype[f+"Right"]=function(m){return this.reverse()[f](m).reverse()}}),Qt(["filter","map","takeWhile"],function(f,v){var m=v+1,R=m==N||m==$;dr.prototype[f]=function(B){var F=this.clone();return F.__iteratees__.push({iteratee:Ze(B,3),type:m}),F.__filtered__=F.__filtered__||R,F}}),Qt(["head","last"],function(f,v){var m="take"+(v?"Right":"");dr.prototype[f]=function(){return this[m](1).value()[0]}}),Qt(["initial","tail"],function(f,v){var m="drop"+(v?"":"Right");dr.prototype[f]=function(){return this.__filtered__?new dr(this):this[m](1)}}),dr.prototype.compact=function(){return this.filter(qt)},dr.prototype.find=function(f){return this.filter(f).head()},dr.prototype.findLast=function(f){return this.reverse().find(f)},dr.prototype.invokeMap=lr(function(f,v){return typeof f=="function"?new dr(this):this.map(function(m){return Co(m,f,v)})}),dr.prototype.reject=function(f){return this.filter(fu(Ze(f)))},dr.prototype.slice=function(f,v){f=ir(f);var m=this;return m.__filtered__&&(f>0||v<0)?new dr(m):(f<0?m=m.takeRight(-f):f&&(m=m.drop(f)),v!==t&&(v=ir(v),m=v<0?m.dropRight(-v):m.take(v-f)),m)},dr.prototype.takeRightWhile=function(f){return this.reverse().takeWhile(f).reverse()},dr.prototype.toArray=function(){return this.take(j)},_n(dr.prototype,function(f,v){var m=/^(?:filter|find|map|reject)|While$/.test(v),R=/^(?:head|last)$/.test(v),B=L[R?"take"+(v=="last"?"Right":""):v],F=R||/^find/.test(v);B&&(L.prototype[v]=function(){var H=this.__wrapped__,J=R?[1]:arguments,ie=H instanceof dr,Te=J[0],Re=ie||tr(H),Ie=function(cr){var vr=B.apply(L,oa([cr],J));return R&&Oe?vr[0]:vr};Re&&m&&typeof Te=="function"&&Te.length!=1&&(ie=Re=!1);var Oe=this.__chain__,Ue=!!this.__actions__.length,Qe=F&&!Oe,sr=ie&&!Ue;if(!F&&Re){H=sr?H:new dr(this);var Je=f.apply(H,J);return Je.__actions__.push({func:ou,args:[Ie],thisArg:t}),new en(Je,Oe)}return Qe&&sr?f.apply(this,J):(Je=this.thru(Ie),Qe?R?Je.value()[0]:Je.value():Je)})}),Qt(["pop","push","shift","sort","splice","unshift"],function(f){var v=Bs[f],m=/^(?:push|sort|unshift)$/.test(f)?"tap":"thru",R=/^(?:pop|shift)$/.test(f);L.prototype[f]=function(){var B=arguments;if(R&&!this.__chain__){var F=this.value();return v.apply(tr(F)?F:[],B)}return this[m](function(H){return v.apply(tr(H)?H:[],B)})}}),_n(dr.prototype,function(f,v){var m=L[v];if(m){var R=m.name+"";br.call(Ai,R)||(Ai[R]=[]),Ai[R].push({name:v,func:m})}}),Ai[Js(t,b).name]=[{name:"wrapper",func:t}],dr.prototype.clone=lD,dr.prototype.reverse=fD,dr.prototype.value=cD,L.prototype.at=zM,L.prototype.chain=$M,L.prototype.commit=VM,L.prototype.next=GM,L.prototype.plant=UM,L.prototype.reverse=HM,L.prototype.toJSON=L.prototype.valueOf=L.prototype.value=KM,L.prototype.first=L.prototype.head,po&&(L.prototype[po]=WM),L}),Si=VI();za?((za.exports=Si)._=Si,ef._=Si):ct._=Si}).call(wW)})(Go,Go.exports)),Go.exports}var hr=xW();const N2=Cl(hr);function EW({cyParams:r,cyInst:e,layoutParams:t,layoutDebounce:n=50,children:a,init:i=()=>{},onCyInit:o}){const[s,l]=Se.useState(!1),u=Se.useRef(null),c=Se.useRef(null),d=Se.useRef(null),h=Se.useRef(!0),g=Se.useCallback(()=>{var y;d.current!==null&&d.current.stop(),c.current&&(d.current=c.current.layout(t),(y=d.current)==null||y.run())},[t]),p=N2.debounce(g,n);Se.useEffect(()=>{if(!u.current)return;const y=un({container:u.current,...r}),b=u.current.querySelector(".cytoscape-react-nodes-and-edges");if(b&&y.domNode({dom_container:b}),c.current=e||y,u.current&&(u.current.cy=c.current),o==null||o(c.current),i(y),u.current&&c.current){const x=u.current.parentElement;let C=0,T=0;x&&(C=x.clientHeight,T=x.clientWidth,C===0&&(C=window.innerHeight-x.getBoundingClientRect().top-100),T===0&&(T=window.innerWidth)),C>0&&T>0&&(u.current.style.width=`${T}px`,u.current.style.height=`${C}px`),c.current.resize(),r.zoom&&r.pan&&c.current.viewport({zoom:r.zoom,pan:r.pan})}l(!0);const w=new ResizeObserver(N2.debounce(()=>{if(u.current&&c.current){const x=u.current.parentElement;let C=0,T=0;x&&(C=x.clientHeight,T=x.clientWidth,C===0&&(C=window.innerHeight-x.getBoundingClientRect().top-100),T===0&&(T=window.innerWidth),C>0&&T>0&&(u.current.style.width=`${T}px`,u.current.style.height=`${C}px`));const S=c.current.zoom()!==void 0?{zoom:c.current.zoom(),pan:c.current.pan()}:null;c.current.resize(),S&&c.current.viewport(S)}},50));return u.current&&w.observe(u.current),()=>{w.disconnect();try{y.destroy()}catch{}c.current=null,l(!1)}},[]),Se.useEffect(()=>{h.current?(h.current=!1,g()):p()},[s,t,p,g]);const E=Se.useMemo(()=>{var y;return c.current!==null?((y=Se.Children.map(a,b=>{var w;return b?Se.cloneElement(b,{key:(w=b==null?void 0:b.props)==null?void 0:w.id,cytoInstance:c.current,layout:p}):null}))==null?void 0:y.filter(Boolean))||[]:[]},[a,s,p]);return ue.jsx("div",{ref:u,className:"cytoscape-react-cy-container",style:{width:"100%",height:"100%",position:"relative",background:"transparent"},children:ue.jsx("div",{className:"cytoscape-react-nodes-and-edges",style:{pointerEvents:"none",position:"absolute",top:0,left:0,transformOrigin:"0 0",zIndex:10},children:E})})}function CW({cytoInstance:r,id:e,parent:t,label:n,children:a,layout:i,classes:o,styleCallback:s}){const l=Se.useRef(null);function u(h){if(s){const g=s(h);h.isParent()&&(h.style("shape","roundrectangle"),h.style(g))}}Se.useEffect(()=>{try{if(l.current){const h={id:e,dom:l.current};t&&(h.parent=t),n&&(h.label=n);const g=r.add({data:h,classes:o});u(g)}}catch{}return()=>{r.getElementById(e).remove()}},[l,t,n]),Se.useEffect(()=>{i();const h=r.getElementById(e);h&&h.isParent()&&u(h)},[e,a]),Se.useEffect(()=>{if(!s)return;const h=r.getElementById(e);h&&h.isParent()&&u(h)},[s]);function c(h){return Se.cloneElement(h,{cytoInstance:r,layout:i})}const d=Se.Children.map(a,c);return ue.jsx("div",{ref:l,className:"cytoscape-react-node",children:d})}const _W={name:"dagre",rankDir:"LR",fit:!1,padding:20,spacingFactor:1.3,animate:!1,nodeDimensionsIncludeLabels:!0,ranker:"network-simplex",rankSep:10,nodeSep:5,edgeSep:10,avoidOverlap:!0,edgeWeight:function(r){return 1},minLen:function(r){return 1},useSimpleEdgeFunction:!0,edgeRouting:!0,controlPoints:!0},GP={padding:20,motionBlur:!1,compound:!0,pixelRatio:"auto",zoomingEnabled:!0,userZoomingEnabled:!0,dragpan:!0,avoidOverlap:!0,panningEnabled:!0,userPanningEnabled:!0,boxSelectionEnabled:!1,selectionType:"additive",minZoom:.01,maxZoom:1.5,autoungrabify:!0,styleEnabled:!0,hideEdgesOnViewport:!1,hideLabelsOnViewport:!0,headless:!1,touchTapThreshold:8,desktopTapThreshold:4,touchHoldDuration:500,desktopHoldDuration:1e3,autolock:!1,autounselectify:!1,wheelPanEnabled:!0,wheelPanThreshold:1,wheelPanDebounce:10,wheelAction:"pan"},WP={...GP,pixelRatio:1,motionBlur:!0,textureOnViewport:!0,wheelPanDebounce:20},SW={...WP,hideEdgesOnViewport:!0,hideLabelsOnViewport:!0},TW=({nodes:r,edges:e})=>{const{themeColor:t,edgeColor:n,direction:a,cyRef:i,callbacks:o,config:s,selectedNodeIds:l,setSelectedNodeIds:u,setSelectedEdgeId:c,setIsPerformanceMode:d,isZoomMode:h,setIsZoomMode:g,isMultiSelectMode:p,setIsMultiSelectMode:E,isDragMode:y,setIsDragMode:b,isEdgeHandlesEnabled:w,isArrayNodeMode:x}=Da(),C=Se.useRef(null),T=Se.useRef(null),S=Se.useRef(x),_=r.length>200;Se.useEffect(()=>{d(_)},[_,d]);const{edgeSep:A,rankSep:P}=Se.useMemo(()=>hq(r.length),[r.length]),{bgColor:I}=ss(t),{background:D,borderSecondary:k}=us(),M=s.backgroundColor||D,N=Se.useCallback(U=>{if(U!=null&&U.includes("gray"))return"whitesmoke";if(!U)return ht(t);switch(U){case"dark":return ht(M);case"light":return ht(k);default:return ht(U)}},[t,M,k]),z=s.colorMode==="dark",$=Se.useMemo(()=>z?N(I):"dark",[z,I,N]),q=n?N(n):$,V=Se.useMemo(()=>vq(N),[N]),Z=s.initialViewport||{pan:{x:0,y:0},zoom:.01},K=Se.useMemo(()=>({..._?SW:r.length>100?WP:GP,style:V,zoom:Z.zoom,pan:Z.pan,minZoom:s.minZoom??.01,maxZoom:s.maxZoom??1.5}),[V,Z,r.length,s.minZoom,s.maxZoom]),j=Se.useRef(!1),ee=Se.useRef();Se.useEffect(()=>()=>{clearTimeout(ee.current)},[]);const le=Se.useMemo(()=>({..._W,...a&&{rankDir:a},edgeSep:A,rankSep:P,get animate(){return j.current&&!_},animationDuration:300,animationEasing:"ease-in-out-cubic",stop:()=>{i.current&&(j.current||setTimeout(()=>{var U;(U=i.current)==null||U.fit(void 0,50)},100),clearTimeout(ee.current),ee.current=setTimeout(()=>{j.current=!0},500))}}),[a,A,P,i,_]),W=Se.useCallback(U=>{const fe=N(U||t);return{"corner-radius":50,"background-color":fe,color:fe,"border-color":fe}},[t,N]),G=Se.useCallback((U,fe,xe,ge)=>{let be={};return ge!=null&&ge.isInverted&&(ge==null?void 0:ge.source)===fe&&(be["target-arrow-shape"]="none",be["source-arrow-shape"]="triangle"),ge!=null&&ge.isEdgeAnimated?(be["line-style"]="dashed",be["line-dash-pattern"]=[32,18],be["line-dash-offset"]=0):ge!=null&&ge.isEdgeDashed?(be["line-style"]="dashed",be["line-dash-pattern"]=[],be["line-dash-offset"]=0):(be["line-style"]="solid",be["line-dash-pattern"]=[],be["line-dash-offset"]=0),a==="TB"&&(be["taxi-direction"]="downward"),a==="BT"&&(be["taxi-direction"]="upward"),a==="LR"&&(be["taxi-direction"]="rightward"),a==="RL"&&(be["taxi-direction"]="leftward"),be["line-color"]=q,be.color=q,be["target-arrow-color"]=q,be["source-arrow-color"]=q,be},[q,a]),Y=Se.useRef(r);Y.current=r;const re=Se.useRef(W);re.current=W;const de=Se.useRef(G);de.current=G,Se.useEffect(()=>{if(!i.current)return;const U=i.current,fe=()=>{U.nodes().forEach(xe=>{var ge,be;if(xe.isParent()){const Ae=Y.current.find(De=>{var Be;return((Be=De.data)==null?void 0:Be.id)===xe.id()});xe.style(re.current((be=(ge=Ae==null?void 0:Ae.data)==null?void 0:ge.viewProps)==null?void 0:be.bgColor))}})};return U.on("add",fe),()=>{U.off("add",fe)}},[]),Se.useEffect(()=>{if(!i.current)return;const U=i.current;U.nodes().forEach(fe=>{var xe,ge;if(fe.isParent()){const be=r.find(Ae=>{var De;return((De=Ae.data)==null?void 0:De.id)===fe.id()});fe.style(W((ge=(xe=be==null?void 0:be.data)==null?void 0:xe.viewProps)==null?void 0:ge.bgColor))}}),e.forEach(({data:fe})=>{const xe=U.getElementById(fe.id);xe!=null&&xe.length&&(xe.data({isEdgeAnimated:fe.isEdgeAnimated,isEdgeDashed:fe.isEdgeDashed}),xe.style(G(xe,fe.source,fe.target,fe)))})},[r,e,q,W,G]);const se=Se.useRef(s);se.current=s;const X=Se.useRef(h);X.current=h;const Q=Se.useRef(w);Q.current=w,S.current=x,Se.useEffect(()=>{if(!i.current||!i.current.container)return;const U=i.current,fe=C.current;if(!fe)return;let xe=null,ge=null,be=0,Ae=0,De=0,Be=0,Le=0;const He=Ve=>{Ve.preventDefault(),Ve.stopPropagation(),X.current||Ve.metaKey||Ve.ctrlKey?(De+=Ve.deltaY,Be=Ve.clientX,Le=Ve.clientY,ge===null&&(ge=requestAnimationFrame(()=>{ge=null;const er=se.current,$e=U.zoom(),ke=De;De=0;let ye=$e-ke*.05/100;ye=Math.max(er.minZoom??.01,Math.min(er.maxZoom??1.5,ye));const O=fe.getBoundingClientRect();U.zoom({level:ye,renderedPosition:{x:Be-O.left,y:Le-O.top}})}))):(be+=Ve.deltaX,Ae+=Ve.deltaY,xe===null&&(xe=requestAnimationFrame(()=>{xe=null;const er=U.pan(),$e=U.zoom(),ke=.35,ye=be,O=Ae;be=0,Ae=0,U.pan({x:er.x+-ye*ke/$e,y:er.y+-O*ke/$e})})))};return fe.addEventListener("wheel",He,{passive:!1}),()=>{fe.removeEventListener("wheel",He),xe!==null&&cancelAnimationFrame(xe),ge!==null&&cancelAnimationFrame(ge)}},[i.current]),Se.useEffect(()=>{i.current&&i.current.userPanningEnabled(y)},[y]),Se.useEffect(()=>{if(!i.current)return;const U=i.current;U.boxSelectionEnabled(!!p),U.selectionType(p?"additive":"single"),U.userPanningEnabled(!p&&y)},[p,y]),Se.useEffect(()=>{T.current&&(w?T.current.enableDrawMode():T.current.disableDrawMode())},[w]);const ae=Se.useRef(l);ae.current=l,Se.useEffect(()=>{if(s.disableKeyboardShortcuts)return;const U=fe=>{var ge,be;const xe=fe.target;if(!(xe.tagName==="INPUT"||xe.tagName==="TEXTAREA"||xe.isContentEditable)&&((fe.key==="z"||fe.key==="Z")&&g(!X.current),(fe.key==="m"||fe.key==="M")&&E(!p),(fe.key==="d"||fe.key==="D")&&b(!y),(fe.key==="Delete"||fe.key==="Backspace")&&ae.current.length>0)){fe.preventDefault();const Ae=ae.current.filter(Be=>Be!=="root");if(Ae.length===0)return;const De=i.current;for(const Be of Ae){const Le=(ge=De==null?void 0:De.getElementById(Be))==null?void 0:ge.data();(be=o.onNodeDelete)==null||be.call(o,Be,Le||{})}u([])}};return window.addEventListener("keydown",U),()=>window.removeEventListener("keydown",U)},[p,y,g,E,b,s.disableKeyboardShortcuts,o,u,i]),Se.useEffect(()=>()=>{if(i.current)try{i.current.removeAllListeners()}catch{}},[]);const te=Se.useMemo(()=>_?300:r.length>50?150:r.length>20?100:50,[r.length,_]),ce=Se.useMemo(()=>{var fe;const U=new Set;for(const xe of r)(fe=xe.data)!=null&&fe.parent&&U.add(xe.data.parent);return U},[r]),_e=Se.useMemo(()=>{var fe;const U=new Map;for(const xe of e)(fe=xe.data)!=null&&fe.source&&!U.has(xe.data.source)&&U.set(xe.data.source,xe.data);return U},[e]),ve=s.backgroundPattern||"dot";return ue.jsx(oq,{pattern:ve,backgroundColor:s.backgroundColor,children:ue.jsx(pe.Box,{ref:C,padding:0,width:"100%",height:"100%",flex:1,position:"relative",children:ue.jsxs(EW,{cyParams:K,layoutParams:le,layoutDebounce:te,onCyInit:U=>{var xe;i.current=U,(xe=o.onCyInit)==null||xe.call(o,U);let fe=null;if(U.on("zoom pan",()=>{fe===null&&(fe=requestAnimationFrame(()=>{var ge;fe=null,(ge=o.onViewportChange)==null||ge.call(o,{zoom:U.zoom(),pan:U.pan()})}))}),U.on("select","edge",ge=>{var Ae;const be=ge.target;c(be.id()),(Ae=o.onEdgeSelect)==null||Ae.call(o,be.id(),be.data())}),U.on("unselect","edge",()=>{var ge;c(null),(ge=o.onEdgeDeselect)==null||ge.call(o)}),U.on("remove","edge",ge=>{var Ae;const be=ge.target;(Ae=o.onEdgeRemove)==null||Ae.call(o,be.id(),be.data())}),U.on("tap",":parent",ge=>{var Ae;const be=ge.target;u([be.id()]),(Ae=o.onNodeSelect)==null||Ae.call(o,be.id(),be.data())}),s.edgeHandles!==!1){const ge={canConnect:(Be,Le)=>!Be.same(Le),edgeParams:(Be,Le)=>({data:{source:Be.id(),target:Le.id(),label:""}}),loopAllowed:()=>!1,hoverDelay:500,snap:!1,snapThreshold:10,snapFrequency:5,noEdgeEventsInDraw:!0,disableBrowserGestures:!0,handlePosition:"left",handleNodes:"node",handleSize:20,handleColor:t||"#0ea5e9",handleOutlineColor:"#B92020FF",handleOutlineWidth:2,handleLineType:"ghost",handleLineWidth:2,preview:!0,ghostEdgeParams:()=>({}),edgeType:()=>"flat",nodeParams:()=>({})},be=U.edgehandles(ge);T.current=be,Q.current&&be.enableDrawMode();let Ae=null,De=null;U.on("ehstart",(Be,Le)=>{De=Le;const He=Be.originalEvent||window.event;if(He!=null&&He.clientX&&(He!=null&&He.clientY))Ae={x:He.clientX,y:He.clientY};else{const Ve=Le.renderedPosition();Ae={x:Ve.x,y:Ve.y}}}),U.on("ehcancel",Be=>{if(!Ae||!De)return;const Le=Be.originalEvent||window.event,He=Le==null?void 0:Le.clientX,Ve=Le==null?void 0:Le.clientY;if(He&&Ve&&o.onNodeCreate){const Xe=Math.abs(He-Ae.x),er=Math.abs(Ve-Ae.y);if(Math.max(Xe,er)>30){const $e=U.renderer().projectIntoViewport(He,Ve);o.onNodeCreate({type:"text",sourceNodeId:De.id(),position:{x:$e[0],y:$e[1]},isArrayMode:S.current})}}Ae=null,De=null}),U.on("ehcomplete",(Be,Le,He)=>{var Ve;(Ve=o.onEdgeCreate)==null||Ve.call(o,Le.id(),He.id())}),U.on("ehstop",()=>{Ae=null,De=null})}},children:[(r||[]).map(U=>{var De,Be,Le,He,Ve,Xe,er,$e,ke;const fe=s.customViews||dq,xe=ce.has((De=U.data)==null?void 0:De.id)&&!((Be=U.data)!=null&&Be.parent),ge=xe?((Le=U.data)==null?void 0:Le.label)||((He=U.data)==null?void 0:He.headerTitle)||"Container":void 0,be=xe?fe.parentContainer:fe[U==null?void 0:U.data.type]||fe.text,Ae=_e.get((Ve=U.data)==null?void 0:Ve.id);return ue.jsx(CW,{id:(Xe=U.data)==null?void 0:Xe.id,parent:(er=U.data)==null?void 0:er.parent,label:ge,styleCallback:()=>{var ye,O;return W((O=(ye=U.data)==null?void 0:ye.viewProps)==null?void 0:O.bgColor)},children:Se.createElement(be,{...U,isInverted:Ae==null?void 0:Ae.isInverted,isParent:xe,key:`${($e=U.data)==null?void 0:$e.id}-${t}`})},(ke=U.data)==null?void 0:ke.id)}),(e||[]).map(({data:U})=>ue.jsx(gq,{id:U==null?void 0:U.id,source:U==null?void 0:U.source,target:U==null?void 0:U.target,label:U==null?void 0:U.label,isPerformanceMode:_,styleCallback:(fe,xe,ge)=>G(fe,xe,ge,U)},U==null?void 0:U.id))]})})})},RW=Se.memo(TW);var Wo=(r=>(r.TOP_DOWN="TB",r.BOTTOM_UP="BT",r.LEFT_RIGHT="LR",r.RIGHT_LEFT="RL",r.CENTER="C",r))(Wo||{});const AW=[{value:"BT",label:"Bottom to Up",icon:Dr.PiArrowUpLight,flowType:Wo.BOTTOM_UP},{value:"TB",label:"Top to Bottom",icon:Dr.PiArrowDownLight,flowType:Wo.TOP_DOWN},{value:"LR",label:"Left to Right",icon:Dr.PiArrowArcRightLight,flowType:Wo.LEFT_RIGHT},{value:"RL",label:"Right to Left",icon:Dr.PiArrowArcLeftLight,flowType:Wo.RIGHT_LEFT}],UP=()=>{const{cyRef:r,themeColor:e,direction:t,selectedNodeIds:n,setSelectedNodeIds:a,selectedEdgeId:i,setSelectedEdgeId:o,isZoomMode:s,setIsZoomMode:l,isMultiSelectMode:u,setIsMultiSelectMode:c,isDragMode:d,setIsDragMode:h,isEdgeHandlesEnabled:g,setIsEdgeHandlesEnabled:p,isArrayNodeMode:E,setIsArrayNodeMode:y,isPinned:b,setIsPinned:w,callbacks:x,config:C}=Da(),T=C.colorMode==="dark",{background:S,border:_,colorInactive:A,colorText:P,colorActive:I,darkBackgroundSecondary:D}=us(),[k,M]=Se.useState(!0),[N,z]=Se.useState(!1),[$,q]=Se.useState(!0),[V,Z]=Se.useState(!1),[K,j]=Se.useState(!1);Se.useEffect(()=>{const te=()=>q(window.innerWidth>=768);return te(),window.addEventListener("resize",te),()=>window.removeEventListener("resize",te)},[]),Se.useEffect(()=>{if(!$){M(!0);return}if(!b){M(!1);return}const te=_e=>{M(window.innerHeight-_e.clientY<=250)},ce=()=>M(!1);return window.addEventListener("mousemove",te),window.addEventListener("mouseleave",ce),()=>{window.removeEventListener("mousemove",te),window.removeEventListener("mouseleave",ce)}},[$,b]);const ee=Se.useCallback(te=>{const ce=r.current;if(!ce)return;const _e=C.minZoom??.01,ve=C.maxZoom??1.5,U=.02,fe=ce.zoomingEnabled(),xe=ce.userZoomingEnabled();ce.zoomingEnabled(!0),ce.userZoomingEnabled(!0);let ge=ce.zoom();switch(te){case"increase":ge=Math.min(ve,ge+U),ce.zoom(ge),ce.center();break;case"decrease":ge=Math.max(_e,ge-U),ce.zoom(ge),ce.center();break;case"reset":ce.fit(void 0,50);break}ce.zoomingEnabled(fe),ce.userZoomingEnabled(xe)},[r,C.minZoom,C.maxZoom]),le=k||N,W=C.renderSelectedNodeToolbar,G=n.length>0&&!!W,Y=Se.useMemo(()=>{if(!G)return[];const te=r.current;return te?n.map(ce=>{const _e=te.getElementById(ce);return _e!=null&&_e.length?{..._e.data(),isParent:_e.isParent()}:{id:ce}}):[]},[G,n,r]),re=Se.useCallback(()=>{var te;a([]),(te=x.onNodeDeselect)==null||te.call(x)},[a,x]),de=C.renderSelectedEdgeToolbar,se=!!i&&!!de,X=Se.useMemo(()=>{if(!se||!i)return null;const te=r.current;if(!te)return{id:i};const ce=te.getElementById(i);return ce!=null&&ce.length?ce.data():{id:i}},[se,i,r]),Q=Se.useCallback(()=>{var ce;o(null);const te=r.current;te&&te.edges().unselect(),(ce=x.onEdgeDeselect)==null||ce.call(x)},[o,r,x]),ae=C.renderBottomBar;return ae?ue.jsxs(ue.Fragment,{children:[G&&ue.jsx(pe.Box,{position:"absolute",bottom:5,left:"50%",transform:"translateX(-50%)",zIndex:101,children:W({selectedNodeIds:n,selectedNodeData:Y,onDeselect:re})}),se&&X&&ue.jsx(pe.Box,{position:"absolute",bottom:5,left:"50%",transform:"translateX(-50%)",zIndex:101,children:de({edgeId:i,edgeData:X,onDeselect:Q})}),ue.jsx(pe.Box,{position:"absolute",bottom:0,left:0,right:0,zIndex:100,w:"100%",children:ae({zoomIn:()=>ee("increase"),zoomOut:()=>ee("decrease"),resetZoom:()=>ee("reset"),direction:t,isZoomMode:s,setIsZoomMode:l,isMultiSelectMode:u,setIsMultiSelectMode:c,isDragMode:d,setIsDragMode:h,isEdgeHandlesEnabled:g,setIsEdgeHandlesEnabled:p,isArrayNodeMode:E,setIsArrayNodeMode:y,selectedNodeIds:n,selectedNodeData:Y,selectedEdgeId:i,selectedEdgeData:X,onNodeDeselect:re,onEdgeDeselect:Q,callbacks:x})})]}):ue.jsxs(ue.Fragment,{children:[G&&ue.jsx(pe.Box,{position:"absolute",bottom:5,left:"50%",transform:"translateX(-50%)",zIndex:101,children:W({selectedNodeIds:n,selectedNodeData:Y,onDeselect:re})}),se&&X&&ue.jsx(pe.Box,{position:"absolute",bottom:5,left:"50%",transform:"translateX(-50%)",zIndex:101,children:de({edgeId:i,edgeData:X,onDeselect:Q})}),!b&&ue.jsx(pe.Box,{position:"absolute",bottom:5,left:0,zIndex:101,w:3,children:ue.jsx(pe.Tooltip,{label:"Show Bottom Bar",placement:"top",fontSize:"xs",children:ue.jsx(pe.Flex,{align:"center",bg:S,borderColor:_,borderWidth:1,py:6,px:0,w:4,h:50,borderRadius:"15px",borderLeftRadius:0,onMouseEnter:()=>{z(!0),M(!0)},onMouseLeave:()=>z(!1),_hover:{bg:D},children:ue.jsx(pe.Icon,{ml:-1,as:Dr.PiLineVerticalBold,boxSize:5,color:_})})})}),ue.jsx(pe.Box,{position:"absolute",bottom:0,left:0,right:0,zIndex:100,w:"100%",transition:"opacity 0.3s ease-in, transform 0.3s ease",transform:le?"translateY(0)":"translateY(100%)",pointerEvents:le?"auto":"none",opacity:le?1:0,onMouseEnter:()=>{b||M(!0)},onMouseLeave:()=>{b||(M(!1),z(!1))},children:ue.jsxs(pe.Flex,{w:"100%",px:5,position:"absolute",bottom:5,flexDirection:"row",justifyContent:"space-between",alignItems:"center",children:[ue.jsx(pe.Box,{bg:S,alignContent:"center",h:50,borderColor:_,borderWidth:1,borderRadius:"15px",children:ue.jsxs(pe.HStack,{px:2,spacing:1,children:[ue.jsx(pe.Tooltip,{label:b?"Unpin":"Pin",placement:"top",fontSize:"xs",children:ue.jsx(pe.IconButton,{"aria-label":"Pin",icon:ue.jsx(pe.Icon,{as:b?Dr.PiPushPinFill:Dr.PiPushPin,boxSize:5}),size:"sm",variant:"ghost",color:b?e:A,onClick:()=>{const te=!b;w(te),M(te)}})}),ue.jsx(pe.Icon,{mx:-1,as:Dr.PiLineVerticalThin,boxSize:5,color:_}),ue.jsx(pe.Tooltip,{label:"Zoom Out",placement:"top",fontSize:"xs",children:ue.jsx(pe.IconButton,{"aria-label":"Zoom out",icon:ue.jsx(pe.Icon,{as:tq.HiMinus,boxSize:5}),size:"sm",variant:"ghost",color:P,onClick:()=>ee("decrease")})}),ue.jsx(pe.Tooltip,{label:"Zoom In",placement:"top",fontSize:"xs",children:ue.jsx(pe.IconButton,{"aria-label":"Zoom in",icon:ue.jsx(pe.Icon,{as:hu.VscAdd,boxSize:5}),size:"sm",variant:"ghost",color:P,onClick:()=>ee("increase")})}),ue.jsx(pe.Tooltip,{label:"Reset Zoom",placement:"top",fontSize:"xs",children:ue.jsx(pe.IconButton,{"aria-label":"Reset zoom",icon:ue.jsx(pe.Icon,{as:nq.GrPowerReset,boxSize:5}),size:"sm",variant:"ghost",color:P,onClick:()=>ee("reset")})}),!K&&ue.jsxs(ue.Fragment,{children:[ue.jsx(pe.Icon,{mx:-1,as:Dr.PiLineVerticalThin,boxSize:5,color:_}),ue.jsx(pe.Tooltip,{label:s?"Zoom Mode (z)":"Pan Mode (z)",placement:"top",fontSize:"xs",children:ue.jsx(pe.IconButton,{"aria-label":"Toggle zoom mode",icon:ue.jsx(pe.Icon,{as:s?hu.VscZoomIn:hu.VscMove,boxSize:5}),size:"sm",variant:"ghost",color:s?e:A,onClick:()=>l(!s)})}),ue.jsx(pe.Icon,{mx:-1,as:Dr.PiLineVerticalThin,boxSize:5,color:_}),ue.jsx(pe.Tooltip,{label:u?"Multi-Select On (m)":"Multi-Select Off (m)",placement:"top",fontSize:"xs",children:ue.jsx(pe.IconButton,{"aria-label":"Toggle multi-select",icon:ue.jsx(pe.Icon,{as:hu.VscGroupByRefType,boxSize:5}),size:"sm",variant:"ghost",color:u?e:A,onClick:()=>c(!u)})}),ue.jsx(pe.Icon,{mx:-1,as:Dr.PiLineVerticalThin,boxSize:5,color:_}),ue.jsx(pe.Tooltip,{label:d?"Drag Mode On (d)":"Drag Mode Off (d)",placement:"top",fontSize:"xs",children:ue.jsx(pe.IconButton,{"aria-label":"Toggle drag mode",icon:ue.jsx(pe.Icon,{as:Dr.PiHandGrabbing,boxSize:5}),size:"sm",variant:"ghost",color:d?e:A,onClick:()=>h(!d)})}),C.edgeHandles!==!1&&ue.jsxs(ue.Fragment,{children:[ue.jsx(pe.Icon,{mx:-1,as:Dr.PiLineVerticalThin,boxSize:5,color:_}),ue.jsx(pe.Tooltip,{label:g?"Draw Mode On":"Draw Mode Off",placement:"top",fontSize:"xs",children:ue.jsx(pe.IconButton,{"aria-label":"Toggle draw mode",icon:ue.jsx(pe.Icon,{as:Dr.PiPencilSimpleLine,boxSize:5}),size:"sm",variant:"ghost",color:g?e:A,onClick:()=>p(!g)})})]}),ue.jsx(pe.Icon,{mx:-1,as:Dr.PiLineVerticalThin,boxSize:5,color:_}),ue.jsx(pe.Tooltip,{label:E?"List mode":"Set mode",placement:"top",fontSize:"xs",children:ue.jsx(pe.Flex,{cursor:"pointer",align:"center",onClick:()=>{var ce;const te=!E;y(te),(ce=x.onArrayModeChange)==null||ce.call(x,te)},_hover:{color:e},children:ue.jsx(pe.Text,{fontSize:"23px",color:E?e:A,children:E?"[]":"{}"})})})]}),ue.jsx(pe.Icon,{mx:-1,as:Dr.PiLineVerticalThin,boxSize:5,color:_}),ue.jsx(pe.Tooltip,{label:K?"Expand toolbar":"Collapse toolbar",placement:"top",fontSize:"xs",children:ue.jsx(pe.IconButton,{"aria-label":"Toggle toolbar collapse",icon:ue.jsx(pe.Icon,{as:K?Dr.PiCaretRight:Dr.PiCaretLeft,boxSize:5}),size:"sm",variant:"ghost",color:A,onClick:()=>j(!K)})})]})}),ue.jsxs(pe.Box,{position:"relative",ml:"auto",children:[ue.jsx(pe.Box,{bg:S,borderWidth:1,borderColor:_,borderRadius:"15px",h:50,px:3,cursor:"pointer",onClick:()=>Z(!V),children:ue.jsxs(pe.Flex,{align:"center",h:"100%",children:[ue.jsx(pe.Tooltip,{label:"Flow Direction",placement:"top",fontSize:"xs",children:ue.jsx(pe.IconButton,{"aria-label":"Direction",icon:ue.jsx(pe.Icon,{as:Dr.PiCaretUp,boxSize:4}),size:"sm",variant:"ghost",color:A})}),ue.jsx(pe.Text,{fontSize:"xs",color:T?"whiteAlpha.600":"blackAlpha.500",ml:1,children:t})]})}),V&&ue.jsxs(pe.Box,{position:"absolute",bottom:"60px",right:0,bg:S,borderWidth:1,borderColor:_,borderRadius:"15px",p:2,zIndex:200,minW:"180px",shadow:"lg",onMouseLeave:()=>Z(!1),children:[AW.map(te=>ue.jsxs(pe.Flex,{align:"center",gap:3,px:3,py:2,borderRadius:"10px",cursor:"pointer",_hover:{bg:T?"whiteAlpha.100":"blackAlpha.50"},onClick:()=>{var ce;(ce=x.onDirectionChange)==null||ce.call(x,te.value),Z(!1)},children:[ue.jsx(pe.Icon,{as:te.icon,boxSize:5,color:P}),ue.jsx(pe.Text,{fontSize:"sm",color:P,flex:1,whiteSpace:"nowrap",children:te.label}),t===te.value&&ue.jsx(pe.Icon,{as:O1.IoCheckmark,boxSize:4,color:I})]},te.value)),ue.jsxs(pe.Flex,{align:"center",gap:3,px:3,py:2,borderRadius:"10px",cursor:"pointer",_hover:{bg:T?"whiteAlpha.100":"blackAlpha.50"},onClick:()=>{var te;(te=x.onDirectionChange)==null||te.call(x,"LR"),Z(!1)},children:[ue.jsx(pe.Icon,{as:aq.TbAlignCenter,boxSize:5,color:P}),ue.jsx(pe.Text,{fontSize:"sm",color:P,flex:1,whiteSpace:"nowrap",children:"Center"}),t==="C"&&ue.jsx(pe.Icon,{as:O1.IoCheckmark,boxSize:4,color:I})]})]})]})]})})]})};UP.displayName="BottomBar";const PW=Se.memo(UP),$l={label:"Untitled",description:"",isTask:!1,isLocked:!1},h0={id:null,type:"text",data:{...$l,viewProps:{width:"max-content !important",maxWidth:700,height:"100%",borderColor:"transparent",borderRadius:25,borderWidth:0,boxShadow:"none",textOverflow:"ellipsis",fontWeight:"bold",textColor:"gray.800",textAlign:"center"}}},F2={id:null,type:"objectView",data:{...$l,headerTitle:null,viewProps:{width:"100%",borderWidth:2,borderRadius:25,height:"100%",justifyContent:"space-between",flexDirection:"row",textColor:"gray.900"}}},IW={id:null,type:"arrayView",data:{...$l,viewProps:{width:"max-content !important",maxWidth:700,height:"100%",textAlign:"center",borderRadius:25,fontSize:"5xl",borderWidth:2,textOverflow:"ellipsis",wordBreak:"keep-all",fontWeight:"bold",textColor:"gray.900",placeholder:"Start Typing"}}},z2={id:null,type:"workflowStep",data:{...$l,viewProps:{width:"max-content !important",maxWidth:350,minWidth:280,height:"100%",borderRadius:15,borderWidth:3}}};let Au;const DW=new Uint8Array(16);function BW(){if(!Au&&(Au=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Au))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Au(DW)}const vt=[];for(let r=0;r<256;++r)vt.push((r+256).toString(16).slice(1));function MW(r,e=0){return vt[r[e+0]]+vt[r[e+1]]+vt[r[e+2]]+vt[r[e+3]]+"-"+vt[r[e+4]]+vt[r[e+5]]+"-"+vt[r[e+6]]+vt[r[e+7]]+"-"+vt[r[e+8]]+vt[r[e+9]]+"-"+vt[r[e+10]]+vt[r[e+11]]+vt[r[e+12]]+vt[r[e+13]]+vt[r[e+14]]+vt[r[e+15]]}const kW=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),$2={randomUUID:kW};function OW(r,e,t){if($2.randomUUID&&!r)return $2.randomUUID();r=r||{};const n=r.random||(r.rng||BW)();return n[6]=n[6]&15|64,n[8]=n[8]&63|128,MW(n)}const Zt=r=>typeof r=="object",HP=r=>Array.isArray(r),LW=["order","position","selected","locked","grabbed","grabbable","scratch"],Pa=r=>Object.entries(r).reduce((e,[t,n])=>(!Zt(n)&&!t.startsWith("$")&&(e[t]=n),e),{}),g0=(r,e)=>typeof r=="string"&&r.startsWith("$")?nm(r,e):Zt(r)&&!HP(r)?Object.entries(r).reduce((t,[n,a])=>(typeof a=="string"&&a.startsWith("$")&&n==="..."?(delete t["..."],t[n]={...nm(a,e),...r}):typeof a=="string"&&a.startsWith("$")?t[n]=nm(a,e):t[n]=a,t),{}):r,Xn=r=>Object.entries(r).reduce((e,[t,n])=>(Zt(n)&&t&&n&&!t.startsWith("$")&&(LW.includes(t)&&(t=t+"#"),e[t]=n),e),{}),ri=(r,e,{label:t,parent:n=void 0},a,i=null)=>(i!==null&&(Zt(i)||HP(i))&&(i=JSON.stringify(i,null,2)),{data:{parent:n,...r.data,id:e,text:t||"",label:t,code:i||null,type:r.type,description:a}}),wa=(r,e,t=null,n=null,a=null,i=!1,o=null)=>({data:{id:OW(),source:a?e:r,target:a?r:e,label:n||"",isInverted:a,isEdgeAnimated:i,parent:o}}),Ia=(r,e=[])=>{const t={},n={};let a=[];if(r)for(const[i,o]of Object.entries(r))i.startsWith("$")&&i!=="$"?t[i.slice(1)]=o:i!=="$"?n[i]=o:i==="$"&&(a=o);return{newConfig:t,updatedObject:n,arrayObject:a}},Ki=(r,e)=>{let t=F2;const{view:n,borderColor:a,borderRadius:i,bgColor:o,textColor:s,fontSize:l,stepType:u}=e;r=n||r,u?t={...z2}:r==="object"?t=F2:r==="text"?t=h0:r==="array"?t=IW:r==="workflowStep"&&(t={...z2});const c=t.data.viewProps;return t.data.viewProps={...c,borderRadius:i||(u?15:50),bgColor:o,borderColor:a,textColor:s,fontSize:l},t.data.config=e,{config:t}},os=(r,e)=>(r=e.find(n=>{var a;return((a=n.data)==null?void 0:a.id)===r||n===r})?`${r}.#`:r,r),nm=(r,{ids:e,jsnObjct:t})=>{if(typeof r=="string"&&(r!=null&&r.startsWith("$"))){const n=r.replace("$","").replace("*","");r==null||r.endsWith("*");const a=e.find(s=>s.split(".").slice(-1)[0]===n||n===s);if(!a)return r;const i=qW(a,t);return JSON.stringify(i).includes(r)?r:i||r}return r},qW=(r,e)=>{let t=r.split(".").splice(1);return t=t[t.length-1]==="#"||t[t.length-1].includes("{")?t.slice(0,-2):t,(i=>t.reduce((o,s)=>{s=s.replace("[","").replace("]","");const{arrayObject:l}=Ia(o);return o=l.length?l:o,o[s]},i))(e)};function Qi(r,e="root",t=[]){try{const{arrayObject:n}=Ia(r);n.length&&(r=n);const a=Pa(r),i=Xn(r);return Zt(r)?(hr.isArray(r)||hr.isArray(r)&&e==="root"||!hr.isArray(r)&&Object.keys(a).length||e==="root")&&t.push(e):t.push(e),Object.keys(i).length&&!hr.isArray(r)?jo({chldPth:null,itrblObjct:i,nodes:t,path:e}):hr.isArray(r)&&r.forEach((o,s)=>{const l=Pa(o),u=Xn(o),{newConfig:c,arrayObject:d}=Ia(o);let h=`${e}.${s}`;Zt(o)?Object.keys(l).length?(Qi(l,h,t),Object.keys(u).length&&!hr.isArray(o)&&jo({chldPth:h,itrblObjct:u,nodes:t,path:e})):Object.keys(u).length&&!hr.isArray(o)?jo({chldPth:h,itrblObjct:u,nodes:t,path:e}):hr.isArray(o)&&KP({chldPth:h,item:o,nodes:t,path:e}):t.push(h)}),{nodes:t}}catch{return{nodes:t}}}const jo=({chldPth:r,itrblObjct:e,nodes:t,path:n})=>Object.entries(e).forEach(([a,i],o)=>{const s=Pa(i),l=Xn(i),{newConfig:u,arrayObject:c}=Ia(i);c.length&&(i=c);let d=r?`${r}.${a}`:`${n}.${a}`;if(Zt(i)&&!hr.isArray(i)){const h=Object.keys(s).length===0;if(h&&(Ki("array",u),t.push(d)),Object.keys(s).length){const g=hr.isArray(i)?`${i.length||""}`:`{${Object.keys(i).length||""}}`;let p=d;h&&(p=`${d}.${g}`),Qi(i,p,t)}else Object.keys(l).length&&!hr.isArray(i)?jo({chldPth:d,itrblObjct:l,path:d,nodes:t}):Qi(i,d,t)}else hr.isArray(i)&&Qi(i,d,t)}),KP=({chldPth:r,item:e,nodes:t,path:n})=>e.forEach((a,i)=>{let o=`${r}.${i}`;const s=Xn(a),l=Pa(a);Zt(a)?!hr.isArray(a)&&Object.keys(l).length?Qi(a,o,t):Object.keys(s).length&&!hr.isArray(a)?jo({chldPth:o,itrblObjct:s,path:n,nodes:t}):hr.isArray(a)&&KP({chldPth:o,item:a,nodes:t,path:n}):t.push(o)});function ni(r,e="root",t=[],n=[],a="untitled",i={hideDefaultObject:!1,sprtObjctKy:!1,isCntr:!1},o={},s){if(s||(s={invrtdRtPths:[],initalObjIds:null}),!r||typeof r!="object")return{nodes:t,edges:n};const l=r;if(!s.initalObjIds){const{nodes:d}=Qi(r);s.initalObjIds={ids:d,jsnObjct:r}}let{hideDefaultObject:u,sprtObjctKy:c}=i;try{e=os(e,t);const{newConfig:d,arrayObject:h}=Ia(r),g=Object.keys(o).length>0?o:d;h.length&&(r=h);const p=Pa(r),E=Xn(r);g.collapsed===void 0&&(Object.keys(E).length>0||hr.isArray(r))&&(g.collapsed=!1);const{label:y,collapsed:b,parent:w}=g;if(!Zt(r))t.push(ri(h0,e,{label:y||e,parent:w},r,l));else if(hr.isArray(r)||hr.isArray(r)&&e==="root"){const{config:x}=Ki("array",g),C=hr.isArray(r)?`${r.length||""}`:`{${Object.keys(r).length||""}}`,T=e==="root"?a:`${a} ${C}`;t.push(ri(x,e,{label:y||T,parent:w},r,hr.isArray(l)?{[a]:l}:l))}else if(!hr.isArray(r)&&Object.keys(p).length||e==="root"){const{config:x}=Ki(null,g),C=e.split("."),T=C[C.length-1];let S=isNaN(Number(T))?null:Number(T)+1;const _=isNaN(Number(T))?T:C[C.length-2]+" "+S,A=e==="root"?a:_,P=r;if(y){const{config:I}=Ki("object",g);I.data.headerTitle=y,t.push(ri(I,e,{label:y||`${y} ${Object.keys(r).length}`,parent:w},p,P))}else x.data.headerTitle=A,t.push(ri(x,e,{label:y,parent:w},p,P))}return b||(Object.keys(E).length&&!hr.isArray(r)?Yo({flowConfig:i,chldPth:null,edges:n,isInverted:null,itrblObjct:E,nodes:t,path:e,newConfig:g,ctx:s}):hr.isArray(r)&&r.forEach((x,C)=>{x=g0(x,s.initalObjIds);const T=x,S=Pa(x),_=Xn(x),{newConfig:A,arrayObject:P}=Ia(x);P.length&&(x=P);const{config:I}=Ki(typeof x=="string"?"text":"array",A),{hideConfig:D,sourceLabel:k,label:M,isEdgeAnimated:N,parent:z}=A;u=u||D;const $=e==="root"&&i.isCntr,q=e.split(".").slice(0,2).join("."),V=s.invrtdRtPths.includes(q),Z=i.isCntr&&V||C%2===0&&$;let K=`${e}.${C}`;K=os(K,t),Z&&s.invrtdRtPths.push(K),Zt(x)?Object.keys(S).length&&!hr.isArray(x)?(n.push(wa(e,K,null,k,Z,N)),ni(x,K,t,n,M||C,i,A,s)):Object.keys(_).length&&!hr.isArray(x)?Yo({flowConfig:i,chldPth:K,isInverted:Z,edges:n,itrblObjct:_,nodes:t,path:e,newConfig:A,forceIsInverted:!0,ctx:s}):hr.isArray(x)?jP({flowConfig:i,chldPth:K,edges:n,isInverted:Z,item:x,nodes:t,path:e,ctx:s}):Zt(x)&&Yo({flowConfig:i,chldPth:K,isInverted:Z,edges:n,itrblObjct:[x],nodes:t,path:e,newConfig:A,ctx:s}):(n.push(wa(e,K,null,k,Z,N)),t.push(ri(I,K,{label:M||String(x),parent:z},x,T)))})),{nodes:t,edges:n}}catch{return{nodes:t,edges:n}}}const Yo=({chldPth:r,flowConfig:e,edges:t,itrblObjct:n,nodes:a,isInverted:i,path:o,newConfig:s,forceIsInverted:l=!1,ctx:u})=>{let{hideDefaultObject:c,sprtObjctKy:d}=e;return Object.entries(n).forEach(([h,g],p)=>{g=g0(g,u.initalObjIds);const E=g,y=Pa(g),b=Xn(g),{newConfig:w,arrayObject:x}=Ia(g);x.length&&(g=x),w.collapsed===void 0&&(Object.keys(b).length>0||hr.isArray(g))&&(w.collapsed=!1);const{hideConfig:C,sourceLabel:T,label:S,content:_,target:A,targetLabel:P,collapsed:I,isEdgeAnimated:D,parent:k}=w;c=c||C;const M=o==="root"&&e.isCntr,N=o.split(".").slice(0,2).join("."),z=u.invrtdRtPths.includes(N);l||(i=e.isCntr&&z||p%2===0&&M);let $=r?`${r}.${h}`:`${o}.${h}`;if($=os($,a),i&&u.invrtdRtPths.push($),A&&t.push(wa($,A,null,P,i,D)),Zt(g)&&!hr.isArray(g)){t.push(wa(o,$,null,T,i,D));const q=d||Object.keys(y).length===0;if(q){const V=_?"object":"array",{config:Z}=Ki(V,w);Z.data.headerTitle=_?S:null,a.push(ri(Z,$,{label:S||h,parent:k},y,E))}if(Object.keys(y).length&&!c&&!I){let V=$;if(q){const Z=hr.isArray(g)?` ${g.length||""}`:`{${Object.keys(g).length||""}}`;V=`${$}.${Z}`,V=os(V,a),t.push(wa($,V,null,T,i,D))}ni(g,V,a,t,S||h,e,{},u)}else Object.keys(b).length&&!hr.isArray(g)&&!I?Yo({chldPth:$,flowConfig:e,itrblObjct:b,path:$,edges:t,nodes:a,newConfig:{},isInverted:i,ctx:u}):I||ni(g,$,a,t,h,e,{},u)}else hr.isArray(g)&&!I&&(t.push(wa(o,$,null,T,i,D)),ni(g,$,a,t,h,e,{},u))})},jP=({flowConfig:r,chldPth:e,edges:t,isInverted:n,item:a,nodes:i,path:o,ctx:s})=>a.forEach((l,u)=>{let c=`${e}.${u}`;c=os(c,i);const d=l;l=g0(l,s.initalObjIds);const h=Xn(l),g=Pa(l),{newConfig:p}=Ia(l),{collapsed:E,label:y,parent:b,sourceLabel:w,isEdgeAnimated:x,content:C}=p;Zt(l)?!hr.isArray(l)&&Object.keys(g).length&&!E?(t.push(wa(o,c,null,w,n,x)),ni(l,c,i,t,u,r,p,s)):Object.keys(h).length&&!hr.isArray(l)&&!E?Yo({chldPth:c,flowConfig:r,itrblObjct:h,path:o,edges:t,nodes:i,isInverted:n,newConfig:p,ctx:s}):hr.isArray(l)&&!E&&jP({flowConfig:r,chldPth:c,edges:t,isInverted:n,item:l,nodes:i,path:o,ctx:s}):(t.push(wa(o,c,null,w,n,x)),i.push(ri(h0,c,{label:y||String(l),parent:b},l,d)))});function YP(r){let e=0,t=0,n=0;const a=(i,o)=>{if(t=Math.max(t,o),e++,i&&typeof i=="object"){const s=Array.isArray(i)?i.length:Object.keys(i).length;if(n+=s+2,Array.isArray(i))for(const l of i)a(l,o+1);else for(const l in i)i.hasOwnProperty(l)&&a(i[l],o+1)}else n+=1};return a(r,0),{lines:n,depth:t,nodes:e}}function ZP(r,e){const t=(n,a,i=null,o="")=>{if(a>0&&a%e===0&&n&&typeof n=="object")if(Array.isArray(n)){i&&o!==""&&n.length>0&&(i[o]={$:n,$collapsed:!0});return}else{if(n.$collapsed===!1)return;const s=Xn(n);if(Object.keys(s).length>0){n.$collapsed=!0;return}}if(n&&typeof n=="object")if(Array.isArray(n))for(let s=0;s<n.length;s++)n[s]&&typeof n[s]=="object"&&t(n[s],a+1,n,s);else for(const s in n)n.hasOwnProperty(s)&&!s.startsWith("$")&&n[s]&&typeof n[s]=="object"&&t(n[s],a+1,n,s)};if(e>0&&r&&typeof r=="object")if(Array.isArray(r))for(let n=0;n<r.length;n++)r[n]&&typeof r[n]=="object"&&t(r[n],1,r,n);else for(const n in r)r.hasOwnProperty(n)&&!n.startsWith("$")&&r[n]&&typeof r[n]=="object"&&t(r[n],1,r,n);return r}const NW=".cytoscape-react-nodes-and-edges{position:absolute!important;top:0!important;left:0!important;z-index:10!important;pointer-events:none!important;overflow:visible!important;transform-origin:0 0!important}.cytoscape-react-node{z-index:0!important;overflow:visible!important;pointer-events:auto!important;position:absolute!important;transform-origin:0 0!important}.cytoscape-react-node input,.cytoscape-react-node textarea{pointer-events:auto!important;user-select:text!important;cursor:text!important}.cytoscape-react-edge{overflow:visible!important;pointer-events:none!important}.cytoscape-react-cy-container{width:100%!important;height:100%!important;overflow:visible!important;position:relative!important;background:transparent!important}.cytoscape-react-cy-container canvas{display:inline!important;vertical-align:baseline!important;overflow:visible!important}.cytoscape-react-cy-container>div{overflow:visible!important}";let V2=!1;function FW(){if(V2||typeof document>"u")return;const r=document.createElement("style");r.setAttribute("data-flow-sdk",""),r.textContent=NW,document.head.appendChild(r),V2=!0}const zW={nodes:[],edges:[]};function $W({json:r,title:e="untitled",nodes:t,edges:n,config:a={},callbacks:i={},className:o,style:s,showBottomBar:l=!0}){FW();const u=a.direction==="C",c=!!(t&&n),[d,h]=Se.useState(null),g=Se.useRef(e);g.current=e,Se.useEffect(()=>{if(c)return;if(!r){h(zW);return}h(null);const y=requestAnimationFrame(()=>{let b=typeof r=="string"?JSON.parse(r):r;if(a.autoCollapse){const x={minLines:800,minDepth:5,collapseEveryNLevels:3},C=a.autoCollapse===!0?x:{...x,...a.autoCollapse},{lines:T,depth:S}=YP(b);T>C.minLines&&S>C.minDepth&&(b=ZP(JSON.parse(JSON.stringify(b)),C.collapseEveryNLevels))}const w=ni(b,"root",[],[],g.current,{hideDefaultObject:!1,sprtObjctKy:!1,isCntr:u});h(w)});return()=>cancelAnimationFrame(y)},[r,e,u,a.autoCollapse]);const p=c?t:d==null?void 0:d.nodes,E=c?n:d==null?void 0:d.edges;return ue.jsx(iq,{config:a,callbacks:i,children:ue.jsx(pe.Box,{className:o,style:s,width:"100%",height:"100%",position:"relative",overflow:"hidden",children:p?ue.jsxs(ue.Fragment,{children:[ue.jsx(RW,{nodes:p,edges:E}),l&&ue.jsx(PW,{})]}):ue.jsxs(pe.Flex,{width:"100%",height:"100%",align:"center",justify:"center",direction:"column",gap:3,children:[ue.jsx(pe.Spinner,{size:"lg",color:a.themeColor||"blue.500",speed:"0.8s"}),ue.jsx(pe.Text,{fontSize:"sm",opacity:.5,children:"Loading diagram..."})]})})})}exports.DynamicIcon=_m;exports.FlowDiagram=$W;exports.applyAutoCollapse=ZP;exports.contentObjTheme=In;exports.createFlowDiagram=ni;exports.getChakraColorHex=ht;exports.getColorVariant=W2;exports.getDarkerHexColor=Vu;exports.getJsonSize=YP;exports.useCustomColors=us;exports.useStopPropagation=U2;exports.useThemeContentColors=ss;
357
+ }`;var sr=D1(function(){return mr(F,Ue+"return "+Ie).apply(t,H)});if(sr.source=Ie,Yf(sr))throw sr;return sr}function nL(f){return wr(f).toLowerCase()}function aL(f){return wr(f).toUpperCase()}function iL(f,v,m){if(f=wr(f),f&&(m||v===t))return z0(f);if(!f||!(v=Ut(v)))return f;var R=hn(f),B=hn(v),F=$0(R,B),H=V0(R,B)+1;return da(R,F,H).join("")}function oL(f,v,m){if(f=wr(f),f&&(m||v===t))return f.slice(0,W0(f)+1);if(!f||!(v=Ut(v)))return f;var R=hn(f),B=V0(R,hn(v))+1;return da(R,0,B).join("")}function sL(f,v,m){if(f=wr(f),f&&(m||v===t))return f.replace(Nr,"");if(!f||!(v=Ut(v)))return f;var R=hn(f),B=$0(R,hn(v));return da(R,B).join("")}function uL(f,v){var m=I,R=D;if(Fr(v)){var B="separator"in v?v.separator:B;m="length"in v?ir(v.length):m,R="omission"in v?Ut(v.omission):R}f=wr(f);var F=f.length;if(Ci(f)){var H=hn(f);F=H.length}if(m>=F)return f;var J=m-_i(R);if(J<1)return R;var ie=H?da(H,0,J).join(""):f.slice(0,J);if(B===t)return ie+R;if(H&&(J+=ie.length-J),Zf(B)){if(f.slice(J).search(B)){var Te,Re=ie;for(B.global||(B=df(B.source,wr(ft.exec(B))+"g")),B.lastIndex=0;Te=B.exec(Re);)var Ie=Te.index;ie=ie.slice(0,Ie===t?J:Ie)}}else if(f.indexOf(Ut(B),J)!=J){var Oe=ie.lastIndexOf(B);Oe>-1&&(ie=ie.slice(0,Oe))}return ie+R}function lL(f){return f=wr(f),f&&or.test(f)?f.replace(Fe,NI):f}var fL=Di(function(f,v,m){return f+(m?" ":"")+v.toUpperCase()}),Jf=Bb("toUpperCase");function I1(f,v,m){return f=wr(f),v=m?t:v,v===t?MI(f)?$I(f):_I(f):f.match(v)||[]}var D1=lr(function(f,v){try{return Gt(f,t,v)}catch(m){return Yf(m)?m:new rr(m)}}),cL=$n(function(f,v){return Qt(v,function(m){m=Tn(m),Fn(f,m,Kf(f[m],f))}),f});function dL(f){var v=f==null?0:f.length,m=Ze();return f=v?Or(f,function(R){if(typeof R[1]!="function")throw new Jt(o);return[m(R[0]),R[1]]}):[],lr(function(R){for(var B=-1;++B<v;){var F=f[B];if(Gt(F[0],this,R))return Gt(F[1],this,R)}})}function vL(f){return ND(rn(f,d))}function ec(f){return function(){return f}}function hL(f,v){return f==null||f!==f?v:f}var gL=kb(),pL=kb(!0);function qt(f){return f}function rc(f){return fb(typeof f=="function"?f:rn(f,d))}function yL(f){return db(rn(f,d))}function mL(f,v){return vb(f,rn(v,d))}var bL=lr(function(f,v){return function(m){return Co(m,f,v)}}),wL=lr(function(f,v){return function(m){return Co(f,m,v)}});function tc(f,v,m){var R=it(v),B=js(v,R);m==null&&!(Fr(v)&&(B.length||!R.length))&&(m=v,v=f,f=this,B=js(v,it(v)));var F=!(Fr(m)&&"chain"in m)||!!m.chain,H=Gn(f);return Qt(B,function(J){var ie=v[J];f[J]=ie,H&&(f.prototype[J]=function(){var Te=this.__chain__;if(F||Te){var Re=f(this.__wrapped__),Ie=Re.__actions__=kt(this.__actions__);return Ie.push({func:ie,args:arguments,thisArg:f}),Re.__chain__=Te,Re}return ie.apply(f,oa([this.value()],arguments))})}),f}function xL(){return ct._===this&&(ct._=KI),this}function nc(){}function EL(f){return f=ir(f),lr(function(v){return hb(v,f)})}var CL=kf(Or),_L=kf(O0),SL=kf(af);function B1(f){return $f(f)?of(Tn(f)):rB(f)}function TL(f){return function(v){return f==null?t:Ua(f,v)}}var RL=Lb(),AL=Lb(!0);function ac(){return[]}function ic(){return!1}function PL(){return{}}function IL(){return""}function DL(){return!0}function BL(f,v){if(f=ir(f),f<1||f>V)return[];var m=j,R=wt(f,j);v=Ze(v),f-=j;for(var B=lf(R,v);++m<f;)v(m);return B}function ML(f){return tr(f)?Or(f,Tn):Ht(f)?[f]:kt(Qb(wr(f)))}function kL(f){var v=++UI;return wr(f)+v}var OL=eu(function(f,v){return f+v},0),LL=Of("ceil"),qL=eu(function(f,v){return f/v},1),NL=Of("floor");function FL(f){return f&&f.length?Ks(f,qt,wf):t}function zL(f,v){return f&&f.length?Ks(f,Ze(v,2),wf):t}function $L(f){return N0(f,qt)}function VL(f,v){return N0(f,Ze(v,2))}function GL(f){return f&&f.length?Ks(f,qt,_f):t}function WL(f,v){return f&&f.length?Ks(f,Ze(v,2),_f):t}var UL=eu(function(f,v){return f*v},1),HL=Of("round"),KL=eu(function(f,v){return f-v},0);function jL(f){return f&&f.length?uf(f,qt):0}function YL(f,v){return f&&f.length?uf(f,Ze(v,2)):0}return L.after=yk,L.ary=l1,L.assign=aO,L.assignIn=C1,L.assignInWith=vu,L.assignWith=iO,L.at=oO,L.before=f1,L.bind=Kf,L.bindAll=cL,L.bindKey=c1,L.castArray=Pk,L.chain=o1,L.chunk=NB,L.compact=FB,L.concat=zB,L.cond=dL,L.conforms=vL,L.constant=ec,L.countBy=jM,L.create=sO,L.curry=d1,L.curryRight=v1,L.debounce=h1,L.defaults=uO,L.defaultsDeep=lO,L.defer=mk,L.delay=bk,L.difference=$B,L.differenceBy=VB,L.differenceWith=GB,L.drop=WB,L.dropRight=UB,L.dropRightWhile=HB,L.dropWhile=KB,L.fill=jB,L.filter=ZM,L.flatMap=JM,L.flatMapDeep=ek,L.flatMapDepth=rk,L.flatten=t1,L.flattenDeep=YB,L.flattenDepth=ZB,L.flip=wk,L.flow=gL,L.flowRight=pL,L.fromPairs=XB,L.functions=pO,L.functionsIn=yO,L.groupBy=tk,L.initial=JB,L.intersection=eM,L.intersectionBy=rM,L.intersectionWith=tM,L.invert=bO,L.invertBy=wO,L.invokeMap=ak,L.iteratee=rc,L.keyBy=ik,L.keys=it,L.keysIn=Lt,L.map=su,L.mapKeys=EO,L.mapValues=CO,L.matches=yL,L.matchesProperty=mL,L.memoize=lu,L.merge=_O,L.mergeWith=_1,L.method=bL,L.methodOf=wL,L.mixin=tc,L.negate=fu,L.nthArg=EL,L.omit=SO,L.omitBy=TO,L.once=xk,L.orderBy=ok,L.over=CL,L.overArgs=Ek,L.overEvery=_L,L.overSome=SL,L.partial=jf,L.partialRight=g1,L.partition=sk,L.pick=RO,L.pickBy=S1,L.property=B1,L.propertyOf=TL,L.pull=oM,L.pullAll=a1,L.pullAllBy=sM,L.pullAllWith=uM,L.pullAt=lM,L.range=RL,L.rangeRight=AL,L.rearg=Ck,L.reject=fk,L.remove=fM,L.rest=_k,L.reverse=Uf,L.sampleSize=dk,L.set=PO,L.setWith=IO,L.shuffle=vk,L.slice=cM,L.sortBy=pk,L.sortedUniq=mM,L.sortedUniqBy=bM,L.split=JO,L.spread=Sk,L.tail=wM,L.take=xM,L.takeRight=EM,L.takeRightWhile=CM,L.takeWhile=_M,L.tap=FM,L.throttle=Tk,L.thru=ou,L.toArray=w1,L.toPairs=T1,L.toPairsIn=R1,L.toPath=ML,L.toPlainObject=E1,L.transform=DO,L.unary=Rk,L.union=SM,L.unionBy=TM,L.unionWith=RM,L.uniq=AM,L.uniqBy=PM,L.uniqWith=IM,L.unset=BO,L.unzip=Hf,L.unzipWith=i1,L.update=MO,L.updateWith=kO,L.values=ki,L.valuesIn=OO,L.without=DM,L.words=I1,L.wrap=Ak,L.xor=BM,L.xorBy=MM,L.xorWith=kM,L.zip=OM,L.zipObject=LM,L.zipObjectDeep=qM,L.zipWith=NM,L.entries=T1,L.entriesIn=R1,L.extend=C1,L.extendWith=vu,tc(L,L),L.add=OL,L.attempt=D1,L.camelCase=FO,L.capitalize=A1,L.ceil=LL,L.clamp=LO,L.clone=Ik,L.cloneDeep=Bk,L.cloneDeepWith=Mk,L.cloneWith=Dk,L.conformsTo=kk,L.deburr=P1,L.defaultTo=hL,L.divide=qL,L.endsWith=zO,L.eq=pn,L.escape=$O,L.escapeRegExp=VO,L.every=YM,L.find=XM,L.findIndex=e1,L.findKey=fO,L.findLast=QM,L.findLastIndex=r1,L.findLastKey=cO,L.floor=NL,L.forEach=s1,L.forEachRight=u1,L.forIn=dO,L.forInRight=vO,L.forOwn=hO,L.forOwnRight=gO,L.get=Xf,L.gt=Ok,L.gte=Lk,L.has=mO,L.hasIn=Qf,L.head=n1,L.identity=qt,L.includes=nk,L.indexOf=QB,L.inRange=qO,L.invoke=xO,L.isArguments=ja,L.isArray=tr,L.isArrayBuffer=qk,L.isArrayLike=Ot,L.isArrayLikeObject=Ur,L.isBoolean=Nk,L.isBuffer=va,L.isDate=Fk,L.isElement=zk,L.isEmpty=$k,L.isEqual=Vk,L.isEqualWith=Gk,L.isError=Yf,L.isFinite=Wk,L.isFunction=Gn,L.isInteger=p1,L.isLength=cu,L.isMap=y1,L.isMatch=Uk,L.isMatchWith=Hk,L.isNaN=Kk,L.isNative=jk,L.isNil=Zk,L.isNull=Yk,L.isNumber=m1,L.isObject=Fr,L.isObjectLike=Vr,L.isPlainObject=Po,L.isRegExp=Zf,L.isSafeInteger=Xk,L.isSet=b1,L.isString=du,L.isSymbol=Ht,L.isTypedArray=Mi,L.isUndefined=Qk,L.isWeakMap=Jk,L.isWeakSet=eO,L.join=nM,L.kebabCase=GO,L.last=nn,L.lastIndexOf=aM,L.lowerCase=WO,L.lowerFirst=UO,L.lt=rO,L.lte=tO,L.max=FL,L.maxBy=zL,L.mean=$L,L.meanBy=VL,L.min=GL,L.minBy=WL,L.stubArray=ac,L.stubFalse=ic,L.stubObject=PL,L.stubString=IL,L.stubTrue=DL,L.multiply=UL,L.nth=iM,L.noConflict=xL,L.noop=nc,L.now=uu,L.pad=HO,L.padEnd=KO,L.padStart=jO,L.parseInt=YO,L.random=NO,L.reduce=uk,L.reduceRight=lk,L.repeat=ZO,L.replace=XO,L.result=AO,L.round=HL,L.runInContext=ne,L.sample=ck,L.size=hk,L.snakeCase=QO,L.some=gk,L.sortedIndex=dM,L.sortedIndexBy=vM,L.sortedIndexOf=hM,L.sortedLastIndex=gM,L.sortedLastIndexBy=pM,L.sortedLastIndexOf=yM,L.startCase=eL,L.startsWith=rL,L.subtract=KL,L.sum=jL,L.sumBy=YL,L.template=tL,L.times=BL,L.toFinite=Wn,L.toInteger=ir,L.toLength=x1,L.toLower=nL,L.toNumber=an,L.toSafeInteger=nO,L.toString=wr,L.toUpper=aL,L.trim=iL,L.trimEnd=oL,L.trimStart=sL,L.truncate=uL,L.unescape=lL,L.uniqueId=kL,L.upperCase=fL,L.upperFirst=Jf,L.each=s1,L.eachRight=u1,L.first=n1,tc(L,(function(){var f={};return _n(L,function(v,m){br.call(L.prototype,m)||(f[m]=v)}),f})(),{chain:!1}),L.VERSION=n,Qt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(f){L[f].placeholder=L}),Qt(["drop","take"],function(f,v){dr.prototype[f]=function(m){m=m===t?1:Jr(ir(m),0);var R=this.__filtered__&&!v?new dr(this):this.clone();return R.__filtered__?R.__takeCount__=wt(m,R.__takeCount__):R.__views__.push({size:wt(m,j),type:f+(R.__dir__<0?"Right":"")}),R},dr.prototype[f+"Right"]=function(m){return this.reverse()[f](m).reverse()}}),Qt(["filter","map","takeWhile"],function(f,v){var m=v+1,R=m==N||m==$;dr.prototype[f]=function(B){var F=this.clone();return F.__iteratees__.push({iteratee:Ze(B,3),type:m}),F.__filtered__=F.__filtered__||R,F}}),Qt(["head","last"],function(f,v){var m="take"+(v?"Right":"");dr.prototype[f]=function(){return this[m](1).value()[0]}}),Qt(["initial","tail"],function(f,v){var m="drop"+(v?"":"Right");dr.prototype[f]=function(){return this.__filtered__?new dr(this):this[m](1)}}),dr.prototype.compact=function(){return this.filter(qt)},dr.prototype.find=function(f){return this.filter(f).head()},dr.prototype.findLast=function(f){return this.reverse().find(f)},dr.prototype.invokeMap=lr(function(f,v){return typeof f=="function"?new dr(this):this.map(function(m){return Co(m,f,v)})}),dr.prototype.reject=function(f){return this.filter(fu(Ze(f)))},dr.prototype.slice=function(f,v){f=ir(f);var m=this;return m.__filtered__&&(f>0||v<0)?new dr(m):(f<0?m=m.takeRight(-f):f&&(m=m.drop(f)),v!==t&&(v=ir(v),m=v<0?m.dropRight(-v):m.take(v-f)),m)},dr.prototype.takeRightWhile=function(f){return this.reverse().takeWhile(f).reverse()},dr.prototype.toArray=function(){return this.take(j)},_n(dr.prototype,function(f,v){var m=/^(?:filter|find|map|reject)|While$/.test(v),R=/^(?:head|last)$/.test(v),B=L[R?"take"+(v=="last"?"Right":""):v],F=R||/^find/.test(v);B&&(L.prototype[v]=function(){var H=this.__wrapped__,J=R?[1]:arguments,ie=H instanceof dr,Te=J[0],Re=ie||tr(H),Ie=function(cr){var vr=B.apply(L,oa([cr],J));return R&&Oe?vr[0]:vr};Re&&m&&typeof Te=="function"&&Te.length!=1&&(ie=Re=!1);var Oe=this.__chain__,Ue=!!this.__actions__.length,Qe=F&&!Oe,sr=ie&&!Ue;if(!F&&Re){H=sr?H:new dr(this);var Je=f.apply(H,J);return Je.__actions__.push({func:ou,args:[Ie],thisArg:t}),new en(Je,Oe)}return Qe&&sr?f.apply(this,J):(Je=this.thru(Ie),Qe?R?Je.value()[0]:Je.value():Je)})}),Qt(["pop","push","shift","sort","splice","unshift"],function(f){var v=Bs[f],m=/^(?:push|sort|unshift)$/.test(f)?"tap":"thru",R=/^(?:pop|shift)$/.test(f);L.prototype[f]=function(){var B=arguments;if(R&&!this.__chain__){var F=this.value();return v.apply(tr(F)?F:[],B)}return this[m](function(H){return v.apply(tr(H)?H:[],B)})}}),_n(dr.prototype,function(f,v){var m=L[v];if(m){var R=m.name+"";br.call(Ai,R)||(Ai[R]=[]),Ai[R].push({name:v,func:m})}}),Ai[Js(t,b).name]=[{name:"wrapper",func:t}],dr.prototype.clone=lD,dr.prototype.reverse=fD,dr.prototype.value=cD,L.prototype.at=zM,L.prototype.chain=$M,L.prototype.commit=VM,L.prototype.next=GM,L.prototype.plant=UM,L.prototype.reverse=HM,L.prototype.toJSON=L.prototype.valueOf=L.prototype.value=KM,L.prototype.first=L.prototype.head,po&&(L.prototype[po]=WM),L}),Si=VI();za?((za.exports=Si)._=Si,ef._=Si):ct._=Si}).call(wW)})(Go,Go.exports)),Go.exports}var hr=xW();const N2=Cl(hr);function EW({cyParams:r,cyInst:e,layoutParams:t,layoutDebounce:n=50,children:a,init:i=()=>{},onCyInit:o}){const[s,l]=Se.useState(!1),u=Se.useRef(null),c=Se.useRef(null),d=Se.useRef(null),h=Se.useRef(!0),g=Se.useCallback(()=>{var y;d.current!==null&&d.current.stop(),c.current&&(d.current=c.current.layout(t),(y=d.current)==null||y.run())},[t]),p=N2.debounce(g,n);Se.useEffect(()=>{if(!u.current)return;const y=un({container:u.current,...r}),b=u.current.querySelector(".cytoscape-react-nodes-and-edges");if(b&&y.domNode({dom_container:b}),c.current=e||y,u.current&&(u.current.cy=c.current),o==null||o(c.current),i(y),u.current&&c.current){const x=u.current.parentElement;let C=0,T=0;x&&(C=x.clientHeight,T=x.clientWidth,C===0&&(C=window.innerHeight-x.getBoundingClientRect().top-100),T===0&&(T=window.innerWidth)),C>0&&T>0&&(u.current.style.width=`${T}px`,u.current.style.height=`${C}px`),c.current.resize(),r.zoom&&r.pan&&c.current.viewport({zoom:r.zoom,pan:r.pan})}l(!0);const w=new ResizeObserver(N2.debounce(()=>{if(u.current&&c.current){const x=u.current.parentElement;let C=0,T=0;x&&(C=x.clientHeight,T=x.clientWidth,C===0&&(C=window.innerHeight-x.getBoundingClientRect().top-100),T===0&&(T=window.innerWidth),C>0&&T>0&&(u.current.style.width=`${T}px`,u.current.style.height=`${C}px`));const S=c.current.zoom()!==void 0?{zoom:c.current.zoom(),pan:c.current.pan()}:null;c.current.resize(),S&&c.current.viewport(S)}},50));return u.current&&w.observe(u.current),()=>{w.disconnect();try{y.destroy()}catch{}c.current=null,l(!1)}},[]),Se.useEffect(()=>{h.current?(h.current=!1,g()):p()},[s,t,p,g]);const E=Se.useMemo(()=>{var y;return c.current!==null?((y=Se.Children.map(a,b=>{var w;return b?Se.cloneElement(b,{key:(w=b==null?void 0:b.props)==null?void 0:w.id,cytoInstance:c.current,layout:p}):null}))==null?void 0:y.filter(Boolean))||[]:[]},[a,s,p]);return ue.jsx("div",{ref:u,className:"cytoscape-react-cy-container",style:{width:"100%",height:"100%",position:"relative",background:"transparent"},children:ue.jsx("div",{className:"cytoscape-react-nodes-and-edges",style:{pointerEvents:"none",position:"absolute",top:0,left:0,transformOrigin:"0 0",zIndex:10},children:E})})}function CW({cytoInstance:r,id:e,parent:t,label:n,children:a,layout:i,classes:o,styleCallback:s}){const l=Se.useRef(null);function u(h){if(s){const g=s(h);h.isParent()&&(h.style("shape","roundrectangle"),h.style(g))}}Se.useEffect(()=>{try{if(l.current){const h={id:e,dom:l.current};t&&(h.parent=t),n&&(h.label=n);const g=r.add({data:h,classes:o});u(g)}}catch{}return()=>{r.getElementById(e).remove()}},[l,t,n]),Se.useEffect(()=>{i();const h=r.getElementById(e);h&&h.isParent()&&u(h)},[e,a]),Se.useEffect(()=>{if(!s)return;const h=r.getElementById(e);h&&h.isParent()&&u(h)},[s]);function c(h){return Se.cloneElement(h,{cytoInstance:r,layout:i})}const d=Se.Children.map(a,c);return ue.jsx("div",{ref:l,className:"cytoscape-react-node",children:d})}const _W={name:"dagre",rankDir:"LR",fit:!1,padding:20,spacingFactor:1.3,animate:!1,nodeDimensionsIncludeLabels:!0,ranker:"network-simplex",rankSep:10,nodeSep:5,edgeSep:10,avoidOverlap:!0,edgeWeight:function(r){return 1},minLen:function(r){return 1},useSimpleEdgeFunction:!0,edgeRouting:!0,controlPoints:!0},GP={padding:20,motionBlur:!1,compound:!0,pixelRatio:"auto",zoomingEnabled:!0,userZoomingEnabled:!0,dragpan:!0,avoidOverlap:!0,panningEnabled:!0,userPanningEnabled:!0,boxSelectionEnabled:!1,selectionType:"additive",minZoom:.01,maxZoom:1.5,autoungrabify:!0,styleEnabled:!0,hideEdgesOnViewport:!1,hideLabelsOnViewport:!0,headless:!1,touchTapThreshold:8,desktopTapThreshold:4,touchHoldDuration:500,desktopHoldDuration:1e3,autolock:!1,autounselectify:!1,wheelPanEnabled:!0,wheelPanThreshold:1,wheelPanDebounce:10,wheelAction:"pan"},WP={...GP,pixelRatio:1,motionBlur:!0,textureOnViewport:!0,wheelPanDebounce:20},SW={...WP,hideEdgesOnViewport:!0,hideLabelsOnViewport:!0},TW=({nodes:r,edges:e})=>{const{themeColor:t,edgeColor:n,direction:a,cyRef:i,callbacks:o,config:s,selectedNodeIds:l,setSelectedNodeIds:u,setSelectedEdgeId:c,setIsPerformanceMode:d,isZoomMode:h,setIsZoomMode:g,isMultiSelectMode:p,setIsMultiSelectMode:E,isDragMode:y,setIsDragMode:b,isEdgeHandlesEnabled:w,isArrayNodeMode:x}=Da(),C=Se.useRef(null),T=Se.useRef(null),S=Se.useRef(x),_=r.length>200;Se.useEffect(()=>{d(_)},[_,d]);const{edgeSep:A,rankSep:P}=Se.useMemo(()=>hq(r.length),[r.length]),{bgColor:I}=ss(t),{background:D,borderSecondary:k}=us(),M=s.backgroundColor||D,N=Se.useCallback(U=>{if(U!=null&&U.includes("gray"))return"whitesmoke";if(!U)return ht(t);switch(U){case"dark":return ht(M);case"light":return ht(k);default:return ht(U)}},[t,M,k]),z=s.colorMode==="dark",$=Se.useMemo(()=>z?N(I):"dark",[z,I,N]),q=n?N(n):$,V=Se.useMemo(()=>vq(N),[N]),Z=s.initialViewport||{pan:{x:0,y:0},zoom:.01},K=Se.useMemo(()=>({..._?SW:r.length>100?WP:GP,style:V,zoom:Z.zoom,pan:Z.pan,minZoom:s.minZoom??.01,maxZoom:s.maxZoom??1.5}),[V,Z,r.length,s.minZoom,s.maxZoom]),j=Se.useRef(!1),ee=Se.useRef();Se.useEffect(()=>()=>{clearTimeout(ee.current)},[]);const le=Se.useMemo(()=>({..._W,...a&&{rankDir:a},edgeSep:A,rankSep:P,get animate(){return j.current&&!_},animationDuration:300,animationEasing:"ease-in-out-cubic",stop:()=>{i.current&&(j.current||setTimeout(()=>{var U;(U=i.current)==null||U.fit(void 0,50)},100),clearTimeout(ee.current),ee.current=setTimeout(()=>{j.current=!0},500))}}),[a,A,P,i,_]),W=Se.useCallback(U=>{const fe=N(U||t);return{"corner-radius":50,"background-color":fe,color:fe,"border-color":fe}},[t,N]),G=Se.useCallback((U,fe,xe,ge)=>{let be={};return ge!=null&&ge.isInverted&&(ge==null?void 0:ge.source)===fe&&(be["target-arrow-shape"]="none",be["source-arrow-shape"]="triangle"),ge!=null&&ge.isEdgeAnimated?(be["line-style"]="dashed",be["line-dash-pattern"]=[32,18],be["line-dash-offset"]=0):ge!=null&&ge.isEdgeDashed?(be["line-style"]="dashed",be["line-dash-pattern"]=[],be["line-dash-offset"]=0):(be["line-style"]="solid",be["line-dash-pattern"]=[],be["line-dash-offset"]=0),a==="TB"&&(be["taxi-direction"]="downward"),a==="BT"&&(be["taxi-direction"]="upward"),a==="LR"&&(be["taxi-direction"]="rightward"),a==="RL"&&(be["taxi-direction"]="leftward"),be["line-color"]=q,be.color=q,be["target-arrow-color"]=q,be["source-arrow-color"]=q,be},[q,a]),Y=Se.useRef(r);Y.current=r;const re=Se.useRef(W);re.current=W;const de=Se.useRef(G);de.current=G,Se.useEffect(()=>{if(!i.current)return;const U=i.current,fe=()=>{U.nodes().forEach(xe=>{var ge,be;if(xe.isParent()){const Ae=Y.current.find(De=>{var Be;return((Be=De.data)==null?void 0:Be.id)===xe.id()});xe.style(re.current((be=(ge=Ae==null?void 0:Ae.data)==null?void 0:ge.viewProps)==null?void 0:be.bgColor))}})};return U.on("add",fe),()=>{U.off("add",fe)}},[]),Se.useEffect(()=>{if(!i.current)return;const U=i.current;U.nodes().forEach(fe=>{var xe,ge;if(fe.isParent()){const be=r.find(Ae=>{var De;return((De=Ae.data)==null?void 0:De.id)===fe.id()});fe.style(W((ge=(xe=be==null?void 0:be.data)==null?void 0:xe.viewProps)==null?void 0:ge.bgColor))}}),e.forEach(({data:fe})=>{const xe=U.getElementById(fe.id);xe!=null&&xe.length&&(xe.data({isEdgeAnimated:fe.isEdgeAnimated,isEdgeDashed:fe.isEdgeDashed}),xe.style(G(xe,fe.source,fe.target,fe)))})},[r,e,q,W,G]);const se=Se.useRef(s);se.current=s;const X=Se.useRef(h);X.current=h;const Q=Se.useRef(w);Q.current=w,S.current=x,Se.useEffect(()=>{if(!i.current||!i.current.container)return;const U=i.current,fe=C.current;if(!fe)return;let xe=null,ge=null,be=0,Ae=0,De=0,Be=0,Le=0;const He=Ve=>{Ve.preventDefault(),Ve.stopPropagation(),X.current||Ve.metaKey||Ve.ctrlKey?(De+=Ve.deltaY,Be=Ve.clientX,Le=Ve.clientY,ge===null&&(ge=requestAnimationFrame(()=>{ge=null;const er=se.current,$e=U.zoom(),ke=De;De=0;let ye=$e-ke*.05/100;ye=Math.max(er.minZoom??.01,Math.min(er.maxZoom??1.5,ye));const O=fe.getBoundingClientRect();U.zoom({level:ye,renderedPosition:{x:Be-O.left,y:Le-O.top}})}))):(be+=Ve.deltaX,Ae+=Ve.deltaY,xe===null&&(xe=requestAnimationFrame(()=>{xe=null;const er=U.pan(),$e=U.zoom(),ke=.35,ye=be,O=Ae;be=0,Ae=0,U.pan({x:er.x+-ye*ke/$e,y:er.y+-O*ke/$e})})))};return fe.addEventListener("wheel",He,{passive:!1}),()=>{fe.removeEventListener("wheel",He),xe!==null&&cancelAnimationFrame(xe),ge!==null&&cancelAnimationFrame(ge)}},[i.current]),Se.useEffect(()=>{i.current&&i.current.userPanningEnabled(y)},[y]),Se.useEffect(()=>{if(!i.current)return;const U=i.current;U.boxSelectionEnabled(!!p),U.selectionType(p?"additive":"single"),U.userPanningEnabled(!p&&y)},[p,y]),Se.useEffect(()=>{T.current&&(w?T.current.enableDrawMode():T.current.disableDrawMode())},[w]);const ae=Se.useRef(l);ae.current=l,Se.useEffect(()=>{if(s.disableKeyboardShortcuts)return;const U=fe=>{var ge,be;const xe=fe.target;if(!(xe.tagName==="INPUT"||xe.tagName==="TEXTAREA"||xe.isContentEditable)&&((fe.key==="z"||fe.key==="Z")&&g(!X.current),(fe.key==="m"||fe.key==="M")&&E(!p),(fe.key==="d"||fe.key==="D")&&b(!y),(fe.key==="Delete"||fe.key==="Backspace")&&ae.current.length>0)){fe.preventDefault();const Ae=ae.current.filter(Be=>Be!=="root");if(Ae.length===0)return;const De=i.current;for(const Be of Ae){const Le=(ge=De==null?void 0:De.getElementById(Be))==null?void 0:ge.data();(be=o.onNodeDelete)==null||be.call(o,Be,Le||{})}u([])}};return window.addEventListener("keydown",U),()=>window.removeEventListener("keydown",U)},[p,y,g,E,b,s.disableKeyboardShortcuts,o,u,i]),Se.useEffect(()=>()=>{if(i.current)try{i.current.removeAllListeners()}catch{}},[]);const te=Se.useMemo(()=>_?300:r.length>50?150:r.length>20?100:50,[r.length,_]),ce=Se.useMemo(()=>{var fe;const U=new Set;for(const xe of r)(fe=xe.data)!=null&&fe.parent&&U.add(xe.data.parent);return U},[r]),_e=Se.useMemo(()=>{var fe;const U=new Map;for(const xe of e)(fe=xe.data)!=null&&fe.source&&!U.has(xe.data.source)&&U.set(xe.data.source,xe.data);return U},[e]),ve=s.backgroundPattern||"dot";return ue.jsx(oq,{pattern:ve,backgroundColor:s.backgroundColor,children:ue.jsx(pe.Box,{ref:C,padding:0,width:"100%",height:"100%",flex:1,position:"relative",children:ue.jsxs(EW,{cyParams:K,layoutParams:le,layoutDebounce:te,onCyInit:U=>{var xe;i.current=U,(xe=o.onCyInit)==null||xe.call(o,U);let fe=null;if(U.on("zoom pan",()=>{fe===null&&(fe=requestAnimationFrame(()=>{var ge;fe=null,(ge=o.onViewportChange)==null||ge.call(o,{zoom:U.zoom(),pan:U.pan()})}))}),U.on("select","edge",ge=>{var Ae;const be=ge.target;c(be.id()),(Ae=o.onEdgeSelect)==null||Ae.call(o,be.id(),be.data())}),U.on("unselect","edge",()=>{var ge;c(null),(ge=o.onEdgeDeselect)==null||ge.call(o)}),U.on("remove","edge",ge=>{var Ae;const be=ge.target;(Ae=o.onEdgeRemove)==null||Ae.call(o,be.id(),be.data())}),U.on("tap",":parent",ge=>{var Ae;const be=ge.target;u([be.id()]),(Ae=o.onNodeSelect)==null||Ae.call(o,be.id(),be.data())}),s.edgeHandles!==!1){const ge={canConnect:(Be,Le)=>!Be.same(Le),edgeParams:(Be,Le)=>({data:{source:Be.id(),target:Le.id(),label:""}}),loopAllowed:()=>!1,hoverDelay:500,snap:!1,snapThreshold:10,snapFrequency:5,noEdgeEventsInDraw:!0,disableBrowserGestures:!0,handlePosition:"left",handleNodes:"node",handleSize:20,handleColor:t||"#0ea5e9",handleOutlineColor:"#B92020FF",handleOutlineWidth:2,handleLineType:"ghost",handleLineWidth:2,preview:!0,ghostEdgeParams:()=>({}),edgeType:()=>"flat",nodeParams:()=>({})},be=U.edgehandles(ge);T.current=be,Q.current&&be.enableDrawMode();let Ae=null,De=null;U.on("ehstart",(Be,Le)=>{De=Le;const He=Be.originalEvent||window.event;if(He!=null&&He.clientX&&(He!=null&&He.clientY))Ae={x:He.clientX,y:He.clientY};else{const Ve=Le.renderedPosition();Ae={x:Ve.x,y:Ve.y}}}),U.on("ehcancel",Be=>{if(!Ae||!De)return;const Le=Be.originalEvent||window.event,He=Le==null?void 0:Le.clientX,Ve=Le==null?void 0:Le.clientY;if(He&&Ve&&o.onNodeCreate){const Xe=Math.abs(He-Ae.x),er=Math.abs(Ve-Ae.y);if(Math.max(Xe,er)>30){const $e=U.renderer().projectIntoViewport(He,Ve);o.onNodeCreate({type:"text",sourceNodeId:De.id(),position:{x:$e[0],y:$e[1]},isArrayMode:S.current})}}Ae=null,De=null}),U.on("ehcomplete",(Be,Le,He)=>{var Ve;(Ve=o.onEdgeCreate)==null||Ve.call(o,Le.id(),He.id())}),U.on("ehstop",()=>{Ae=null,De=null})}},children:[(r||[]).map(U=>{var De,Be,Le,He,Ve,Xe,er,$e,ke;const fe=s.customViews||dq,xe=ce.has((De=U.data)==null?void 0:De.id)&&!((Be=U.data)!=null&&Be.parent),ge=xe?((Le=U.data)==null?void 0:Le.label)||((He=U.data)==null?void 0:He.headerTitle)||"Container":void 0,be=xe?fe.parentContainer:fe[U==null?void 0:U.data.type]||fe.text,Ae=_e.get((Ve=U.data)==null?void 0:Ve.id);return ue.jsx(CW,{id:(Xe=U.data)==null?void 0:Xe.id,parent:(er=U.data)==null?void 0:er.parent,label:ge,styleCallback:()=>{var ye,O;return W((O=(ye=U.data)==null?void 0:ye.viewProps)==null?void 0:O.bgColor)},children:Se.createElement(be,{...U,isInverted:Ae==null?void 0:Ae.isInverted,isParent:xe,key:`${($e=U.data)==null?void 0:$e.id}-${t}`})},(ke=U.data)==null?void 0:ke.id)}),(e||[]).map(({data:U})=>ue.jsx(gq,{id:U==null?void 0:U.id,source:U==null?void 0:U.source,target:U==null?void 0:U.target,label:U==null?void 0:U.label,isPerformanceMode:_,styleCallback:(fe,xe,ge)=>G(fe,xe,ge,U)},U==null?void 0:U.id))]})})})},RW=Se.memo(TW);var Wo=(r=>(r.TOP_DOWN="TB",r.BOTTOM_UP="BT",r.LEFT_RIGHT="LR",r.RIGHT_LEFT="RL",r.CENTER="C",r))(Wo||{});const AW=[{value:"BT",label:"Bottom to Up",icon:Dr.PiArrowUpLight,flowType:Wo.BOTTOM_UP},{value:"TB",label:"Top to Bottom",icon:Dr.PiArrowDownLight,flowType:Wo.TOP_DOWN},{value:"LR",label:"Left to Right",icon:Dr.PiArrowArcRightLight,flowType:Wo.LEFT_RIGHT},{value:"RL",label:"Right to Left",icon:Dr.PiArrowArcLeftLight,flowType:Wo.RIGHT_LEFT}],UP=()=>{const{cyRef:r,themeColor:e,direction:t,selectedNodeIds:n,setSelectedNodeIds:a,selectedEdgeId:i,setSelectedEdgeId:o,isZoomMode:s,setIsZoomMode:l,isMultiSelectMode:u,setIsMultiSelectMode:c,isDragMode:d,setIsDragMode:h,isEdgeHandlesEnabled:g,setIsEdgeHandlesEnabled:p,isArrayNodeMode:E,setIsArrayNodeMode:y,isPinned:b,setIsPinned:w,callbacks:x,config:C}=Da(),T=C.colorMode==="dark",{background:S,border:_,colorInactive:A,colorText:P,colorActive:I,darkBackgroundSecondary:D}=us(),[k,M]=Se.useState(!0),[N,z]=Se.useState(!1),[$,q]=Se.useState(!0),[V,Z]=Se.useState(!1),[K,j]=Se.useState(!1);Se.useEffect(()=>{const te=()=>q(window.innerWidth>=768);return te(),window.addEventListener("resize",te),()=>window.removeEventListener("resize",te)},[]),Se.useEffect(()=>{if(!$){M(!0);return}if(!b){M(!1);return}const te=_e=>{M(window.innerHeight-_e.clientY<=250)},ce=()=>M(!1);return window.addEventListener("mousemove",te),window.addEventListener("mouseleave",ce),()=>{window.removeEventListener("mousemove",te),window.removeEventListener("mouseleave",ce)}},[$,b]);const ee=Se.useCallback(te=>{const ce=r.current;if(!ce)return;const _e=C.minZoom??.01,ve=C.maxZoom??1.5,U=.02,fe=ce.zoomingEnabled(),xe=ce.userZoomingEnabled();ce.zoomingEnabled(!0),ce.userZoomingEnabled(!0);let ge=ce.zoom();switch(te){case"increase":ge=Math.min(ve,ge+U),ce.zoom(ge),ce.center();break;case"decrease":ge=Math.max(_e,ge-U),ce.zoom(ge),ce.center();break;case"reset":ce.fit(void 0,50);break}ce.zoomingEnabled(fe),ce.userZoomingEnabled(xe)},[r,C.minZoom,C.maxZoom]),le=k||N,W=C.renderSelectedNodeToolbar,G=n.length>0&&!!W,Y=Se.useMemo(()=>{if(!G)return[];const te=r.current;return te?n.map(ce=>{const _e=te.getElementById(ce);return _e!=null&&_e.length?{..._e.data(),isParent:_e.isParent()}:{id:ce}}):[]},[G,n,r]),re=Se.useCallback(()=>{var te;a([]),(te=x.onNodeDeselect)==null||te.call(x)},[a,x]),de=C.renderSelectedEdgeToolbar,se=!!i&&!!de,X=Se.useMemo(()=>{if(!se||!i)return null;const te=r.current;if(!te)return{id:i};const ce=te.getElementById(i);return ce!=null&&ce.length?ce.data():{id:i}},[se,i,r]),Q=Se.useCallback(()=>{var ce;o(null);const te=r.current;te&&te.edges().unselect(),(ce=x.onEdgeDeselect)==null||ce.call(x)},[o,r,x]),ae=C.renderBottomBar;return ae?ue.jsxs(ue.Fragment,{children:[G&&ue.jsx(pe.Box,{position:"absolute",bottom:5,left:"50%",transform:"translateX(-50%)",zIndex:101,children:W({selectedNodeIds:n,selectedNodeData:Y,onDeselect:re})}),se&&X&&ue.jsx(pe.Box,{position:"absolute",bottom:5,left:"50%",transform:"translateX(-50%)",zIndex:101,children:de({edgeId:i,edgeData:X,onDeselect:Q})}),ue.jsx(pe.Box,{position:"absolute",bottom:0,left:0,right:0,zIndex:100,w:"100%",children:ae({zoomIn:()=>ee("increase"),zoomOut:()=>ee("decrease"),resetZoom:()=>ee("reset"),direction:t,isZoomMode:s,setIsZoomMode:l,isMultiSelectMode:u,setIsMultiSelectMode:c,isDragMode:d,setIsDragMode:h,isEdgeHandlesEnabled:g,setIsEdgeHandlesEnabled:p,isArrayNodeMode:E,setIsArrayNodeMode:y,selectedNodeIds:n,selectedNodeData:Y,selectedEdgeId:i,selectedEdgeData:X,onNodeDeselect:re,onEdgeDeselect:Q,callbacks:x})})]}):ue.jsxs(ue.Fragment,{children:[G&&ue.jsx(pe.Box,{position:"absolute",bottom:5,left:"50%",transform:"translateX(-50%)",zIndex:101,children:W({selectedNodeIds:n,selectedNodeData:Y,onDeselect:re})}),se&&X&&ue.jsx(pe.Box,{position:"absolute",bottom:5,left:"50%",transform:"translateX(-50%)",zIndex:101,children:de({edgeId:i,edgeData:X,onDeselect:Q})}),!b&&ue.jsx(pe.Box,{position:"absolute",bottom:5,left:0,zIndex:101,w:3,children:ue.jsx(pe.Tooltip,{label:"Show Bottom Bar",placement:"top",fontSize:"xs",children:ue.jsx(pe.Flex,{align:"center",bg:S,borderColor:_,borderWidth:1,py:6,px:0,w:4,h:50,borderRadius:"15px",borderLeftRadius:0,onMouseEnter:()=>{z(!0),M(!0)},onMouseLeave:()=>z(!1),_hover:{bg:D},children:ue.jsx(pe.Icon,{ml:-1,as:Dr.PiLineVerticalBold,boxSize:5,color:_})})})}),ue.jsx(pe.Box,{position:"absolute",bottom:0,left:0,right:0,zIndex:100,w:"100%",transition:"opacity 0.3s ease-in, transform 0.3s ease",transform:le?"translateY(0)":"translateY(100%)",pointerEvents:le?"auto":"none",opacity:le?1:0,onMouseEnter:()=>{b||M(!0)},onMouseLeave:()=>{b||(M(!1),z(!1))},children:ue.jsxs(pe.Flex,{w:"100%",px:5,position:"absolute",bottom:5,flexDirection:"row",justifyContent:"space-between",alignItems:"center",children:[ue.jsx(pe.Box,{bg:S,alignContent:"center",h:50,borderColor:_,borderWidth:1,borderRadius:"15px",children:ue.jsxs(pe.HStack,{px:2,spacing:1,children:[ue.jsx(pe.Tooltip,{label:b?"Unpin":"Pin",placement:"top",fontSize:"xs",children:ue.jsx(pe.IconButton,{"aria-label":"Pin",icon:ue.jsx(pe.Icon,{as:b?Dr.PiPushPinFill:Dr.PiPushPin,boxSize:5}),size:"sm",variant:"ghost",color:b?e:A,onClick:()=>{const te=!b;w(te),M(te)}})}),ue.jsx(pe.Icon,{mx:-1,as:Dr.PiLineVerticalThin,boxSize:5,color:_}),ue.jsx(pe.Tooltip,{label:"Zoom Out",placement:"top",fontSize:"xs",children:ue.jsx(pe.IconButton,{"aria-label":"Zoom out",icon:ue.jsx(pe.Icon,{as:tq.HiMinus,boxSize:5}),size:"sm",variant:"ghost",color:P,onClick:()=>ee("decrease")})}),ue.jsx(pe.Tooltip,{label:"Zoom In",placement:"top",fontSize:"xs",children:ue.jsx(pe.IconButton,{"aria-label":"Zoom in",icon:ue.jsx(pe.Icon,{as:hu.VscAdd,boxSize:5}),size:"sm",variant:"ghost",color:P,onClick:()=>ee("increase")})}),ue.jsx(pe.Tooltip,{label:"Reset Zoom",placement:"top",fontSize:"xs",children:ue.jsx(pe.IconButton,{"aria-label":"Reset zoom",icon:ue.jsx(pe.Icon,{as:nq.GrPowerReset,boxSize:5}),size:"sm",variant:"ghost",color:P,onClick:()=>ee("reset")})}),!K&&ue.jsxs(ue.Fragment,{children:[ue.jsx(pe.Icon,{mx:-1,as:Dr.PiLineVerticalThin,boxSize:5,color:_}),ue.jsx(pe.Tooltip,{label:s?"Zoom Mode (z)":"Pan Mode (z)",placement:"top",fontSize:"xs",children:ue.jsx(pe.IconButton,{"aria-label":"Toggle zoom mode",icon:ue.jsx(pe.Icon,{as:s?hu.VscZoomIn:hu.VscMove,boxSize:5}),size:"sm",variant:"ghost",color:s?e:A,onClick:()=>l(!s)})}),ue.jsx(pe.Icon,{mx:-1,as:Dr.PiLineVerticalThin,boxSize:5,color:_}),ue.jsx(pe.Tooltip,{label:u?"Multi-Select On (m)":"Multi-Select Off (m)",placement:"top",fontSize:"xs",children:ue.jsx(pe.IconButton,{"aria-label":"Toggle multi-select",icon:ue.jsx(pe.Icon,{as:hu.VscGroupByRefType,boxSize:5}),size:"sm",variant:"ghost",color:u?e:A,onClick:()=>c(!u)})}),ue.jsx(pe.Icon,{mx:-1,as:Dr.PiLineVerticalThin,boxSize:5,color:_}),ue.jsx(pe.Tooltip,{label:d?"Drag Mode On (d)":"Drag Mode Off (d)",placement:"top",fontSize:"xs",children:ue.jsx(pe.IconButton,{"aria-label":"Toggle drag mode",icon:ue.jsx(pe.Icon,{as:Dr.PiHandGrabbing,boxSize:5}),size:"sm",variant:"ghost",color:d?e:A,onClick:()=>h(!d)})}),C.edgeHandles!==!1&&ue.jsxs(ue.Fragment,{children:[ue.jsx(pe.Icon,{mx:-1,as:Dr.PiLineVerticalThin,boxSize:5,color:_}),ue.jsx(pe.Tooltip,{label:g?"Draw Mode On":"Draw Mode Off",placement:"top",fontSize:"xs",children:ue.jsx(pe.IconButton,{"aria-label":"Toggle draw mode",icon:ue.jsx(pe.Icon,{as:Dr.PiPencilSimpleLine,boxSize:5}),size:"sm",variant:"ghost",color:g?e:A,onClick:()=>p(!g)})})]}),ue.jsx(pe.Icon,{mx:-1,as:Dr.PiLineVerticalThin,boxSize:5,color:_}),ue.jsx(pe.Tooltip,{label:E?"List mode":"Set mode",placement:"top",fontSize:"xs",children:ue.jsx(pe.Flex,{cursor:"pointer",align:"center",onClick:()=>{var ce;const te=!E;y(te),(ce=x.onArrayModeChange)==null||ce.call(x,te)},_hover:{color:e},children:ue.jsx(pe.Text,{fontSize:"23px",color:E?e:A,children:E?"[]":"{}"})})})]}),ue.jsx(pe.Icon,{mx:-1,as:Dr.PiLineVerticalThin,boxSize:5,color:_}),ue.jsx(pe.Tooltip,{label:K?"Expand toolbar":"Collapse toolbar",placement:"top",fontSize:"xs",children:ue.jsx(pe.IconButton,{"aria-label":"Toggle toolbar collapse",icon:ue.jsx(pe.Icon,{as:K?Dr.PiCaretRight:Dr.PiCaretLeft,boxSize:5}),size:"sm",variant:"ghost",color:A,onClick:()=>j(!K)})})]})}),ue.jsxs(pe.Box,{position:"relative",ml:"auto",children:[ue.jsx(pe.Box,{bg:S,borderWidth:1,borderColor:_,borderRadius:"15px",h:50,px:3,cursor:"pointer",onClick:()=>Z(!V),children:ue.jsxs(pe.Flex,{align:"center",h:"100%",children:[ue.jsx(pe.Tooltip,{label:"Flow Direction",placement:"top",fontSize:"xs",children:ue.jsx(pe.IconButton,{"aria-label":"Direction",icon:ue.jsx(pe.Icon,{as:Dr.PiCaretUp,boxSize:4}),size:"sm",variant:"ghost",color:A})}),ue.jsx(pe.Text,{fontSize:"xs",color:T?"whiteAlpha.600":"blackAlpha.500",ml:1,children:t})]})}),V&&ue.jsxs(pe.Box,{position:"absolute",bottom:"60px",right:0,bg:S,borderWidth:1,borderColor:_,borderRadius:"15px",p:2,zIndex:200,minW:"180px",shadow:"lg",onMouseLeave:()=>Z(!1),children:[AW.map(te=>ue.jsxs(pe.Flex,{align:"center",gap:3,px:3,py:2,borderRadius:"10px",cursor:"pointer",_hover:{bg:T?"whiteAlpha.100":"blackAlpha.50"},onClick:()=>{var ce;(ce=x.onDirectionChange)==null||ce.call(x,te.value),Z(!1)},children:[ue.jsx(pe.Icon,{as:te.icon,boxSize:5,color:P}),ue.jsx(pe.Text,{fontSize:"sm",color:P,flex:1,whiteSpace:"nowrap",children:te.label}),t===te.value&&ue.jsx(pe.Icon,{as:O1.IoCheckmark,boxSize:4,color:I})]},te.value)),ue.jsxs(pe.Flex,{align:"center",gap:3,px:3,py:2,borderRadius:"10px",cursor:"pointer",_hover:{bg:T?"whiteAlpha.100":"blackAlpha.50"},onClick:()=>{var te;(te=x.onDirectionChange)==null||te.call(x,"LR"),Z(!1)},children:[ue.jsx(pe.Icon,{as:aq.TbAlignCenter,boxSize:5,color:P}),ue.jsx(pe.Text,{fontSize:"sm",color:P,flex:1,whiteSpace:"nowrap",children:"Center"}),t==="C"&&ue.jsx(pe.Icon,{as:O1.IoCheckmark,boxSize:4,color:I})]})]})]})]})})]})};UP.displayName="BottomBar";const PW=Se.memo(UP),$l={label:"Untitled",description:"",isTask:!1,isLocked:!1},h0={id:null,type:"text",data:{...$l,viewProps:{width:"max-content !important",maxWidth:700,height:"100%",borderColor:"transparent",borderRadius:25,borderWidth:0,boxShadow:"none",textOverflow:"ellipsis",fontWeight:"bold",textColor:"gray.800",textAlign:"center"}}},F2={id:null,type:"objectView",data:{...$l,headerTitle:null,viewProps:{width:"100%",borderWidth:2,borderRadius:25,height:"100%",justifyContent:"space-between",flexDirection:"row",textColor:"gray.900"}}},IW={id:null,type:"arrayView",data:{...$l,viewProps:{width:"max-content !important",maxWidth:700,height:"100%",textAlign:"center",borderRadius:25,fontSize:"5xl",borderWidth:2,textOverflow:"ellipsis",wordBreak:"keep-all",fontWeight:"bold",textColor:"gray.900",placeholder:"Start Typing"}}},z2={id:null,type:"workflowStep",data:{...$l,viewProps:{width:"max-content !important",maxWidth:350,minWidth:280,height:"100%",borderRadius:15,borderWidth:3}}};let Au;const DW=new Uint8Array(16);function BW(){if(!Au&&(Au=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Au))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Au(DW)}const vt=[];for(let r=0;r<256;++r)vt.push((r+256).toString(16).slice(1));function MW(r,e=0){return vt[r[e+0]]+vt[r[e+1]]+vt[r[e+2]]+vt[r[e+3]]+"-"+vt[r[e+4]]+vt[r[e+5]]+"-"+vt[r[e+6]]+vt[r[e+7]]+"-"+vt[r[e+8]]+vt[r[e+9]]+"-"+vt[r[e+10]]+vt[r[e+11]]+vt[r[e+12]]+vt[r[e+13]]+vt[r[e+14]]+vt[r[e+15]]}const kW=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),$2={randomUUID:kW};function OW(r,e,t){if($2.randomUUID&&!r)return $2.randomUUID();r=r||{};const n=r.random||(r.rng||BW)();return n[6]=n[6]&15|64,n[8]=n[8]&63|128,MW(n)}const Zt=r=>typeof r=="object",HP=r=>Array.isArray(r),LW=["order","position","selected","locked","grabbed","grabbable","scratch"],Pa=r=>Object.entries(r).reduce((e,[t,n])=>(!Zt(n)&&!t.startsWith("$")&&(e[t]=n),e),{}),g0=(r,e)=>typeof r=="string"&&r.startsWith("$")?nm(r,e):Zt(r)&&!HP(r)?Object.entries(r).reduce((t,[n,a])=>(typeof a=="string"&&a.startsWith("$")&&n==="..."?(delete t["..."],t[n]={...nm(a,e),...r}):typeof a=="string"&&a.startsWith("$")?t[n]=nm(a,e):t[n]=a,t),{}):r,Xn=r=>Object.entries(r).reduce((e,[t,n])=>(Zt(n)&&t&&n&&!t.startsWith("$")&&(LW.includes(t)&&(t=t+"#"),e[t]=n),e),{}),ri=(r,e,{label:t,parent:n=void 0},a,i=null)=>(i!==null&&(Zt(i)||HP(i))&&(i=JSON.stringify(i,null,2)),{data:{parent:n,...r.data,id:e,text:t||"",label:t,code:i||null,type:r.type,description:a}}),wa=(r,e,t=null,n=null,a=null,i=!1,o=null)=>({data:{id:OW(),source:a?e:r,target:a?r:e,label:n||"",isInverted:a,isEdgeAnimated:i,parent:o}}),Ia=(r,e=[])=>{const t={},n={};let a=[];if(r)for(const[i,o]of Object.entries(r))i.startsWith("$")&&i!=="$"?t[i.slice(1)]=o:i!=="$"?n[i]=o:i==="$"&&(a=o);return{newConfig:t,updatedObject:n,arrayObject:a}},Ki=(r,e)=>{let t=F2;const{view:n,borderColor:a,borderRadius:i,bgColor:o,textColor:s,fontSize:l,stepType:u}=e;r=n||r,u?t={...z2}:r==="object"?t=F2:r==="text"?t=h0:r==="array"?t=IW:r==="workflowStep"&&(t={...z2});const c=t.data.viewProps;return t.data.viewProps={...c,borderRadius:i||(u?15:50),bgColor:o,borderColor:a,textColor:s,fontSize:l},t.data.config=e,{config:t}},os=(r,e)=>(r=e.find(n=>{var a;return((a=n.data)==null?void 0:a.id)===r||n===r})?`${r}.#`:r,r),nm=(r,{ids:e,jsnObjct:t})=>{if(typeof r=="string"&&(r!=null&&r.startsWith("$"))){const n=r.replace("$","").replace("*","");r==null||r.endsWith("*");const a=e.find(s=>s.split(".").slice(-1)[0]===n||n===s);if(!a)return r;const i=qW(a,t);return JSON.stringify(i).includes(r)?r:i||r}return r},qW=(r,e)=>{let t=r.split(".").splice(1);return t=t[t.length-1]==="#"||t[t.length-1].includes("{")?t.slice(0,-2):t,(i=>t.reduce((o,s)=>{s=s.replace("[","").replace("]","");const{arrayObject:l}=Ia(o);return o=l.length?l:o,o[s]},i))(e)};function Qi(r,e="root",t=[]){try{const{arrayObject:n}=Ia(r);n.length&&(r=n);const a=Pa(r),i=Xn(r);return Zt(r)?(hr.isArray(r)||hr.isArray(r)&&e==="root"||!hr.isArray(r)&&Object.keys(a).length||e==="root")&&t.push(e):t.push(e),Object.keys(i).length&&!hr.isArray(r)?jo({chldPth:null,itrblObjct:i,nodes:t,path:e}):hr.isArray(r)&&r.forEach((o,s)=>{const l=Pa(o),u=Xn(o),{newConfig:c,arrayObject:d}=Ia(o);let h=`${e}.${s}`;Zt(o)?Object.keys(l).length?(Qi(l,h,t),Object.keys(u).length&&!hr.isArray(o)&&jo({chldPth:h,itrblObjct:u,nodes:t,path:e})):Object.keys(u).length&&!hr.isArray(o)?jo({chldPth:h,itrblObjct:u,nodes:t,path:e}):hr.isArray(o)&&KP({chldPth:h,item:o,nodes:t,path:e}):t.push(h)}),{nodes:t}}catch{return{nodes:t}}}const jo=({chldPth:r,itrblObjct:e,nodes:t,path:n})=>Object.entries(e).forEach(([a,i],o)=>{const s=Pa(i),l=Xn(i),{newConfig:u,arrayObject:c}=Ia(i);c.length&&(i=c);let d=r?`${r}.${a}`:`${n}.${a}`;if(Zt(i)&&!hr.isArray(i)){const h=Object.keys(s).length===0;if(h&&(Ki("array",u),t.push(d)),Object.keys(s).length){const g=hr.isArray(i)?`${i.length||""}`:`{${Object.keys(i).length||""}}`;let p=d;h&&(p=`${d}.${g}`),Qi(i,p,t)}else Object.keys(l).length&&!hr.isArray(i)?jo({chldPth:d,itrblObjct:l,path:d,nodes:t}):Qi(i,d,t)}else hr.isArray(i)&&Qi(i,d,t)}),KP=({chldPth:r,item:e,nodes:t,path:n})=>e.forEach((a,i)=>{let o=`${r}.${i}`;const s=Xn(a),l=Pa(a);Zt(a)?!hr.isArray(a)&&Object.keys(l).length?Qi(a,o,t):Object.keys(s).length&&!hr.isArray(a)?jo({chldPth:o,itrblObjct:s,path:n,nodes:t}):hr.isArray(a)&&KP({chldPth:o,item:a,nodes:t,path:n}):t.push(o)});function ni(r,e="root",t=[],n=[],a="untitled",i={hideDefaultObject:!1,sprtObjctKy:!1,isCntr:!1},o={},s){if(s||(s={invrtdRtPths:[],initalObjIds:null}),!r||typeof r!="object")return{nodes:t,edges:n};const l=r;if(!s.initalObjIds){const{nodes:d}=Qi(r);s.initalObjIds={ids:d,jsnObjct:r}}let{hideDefaultObject:u,sprtObjctKy:c}=i;try{e=os(e,t);const{newConfig:d,arrayObject:h}=Ia(r),g=Object.keys(o).length>0?o:d;h.length&&(r=h);const p=Pa(r),E=Xn(r);g.collapsed===void 0&&(Object.keys(E).length>0||hr.isArray(r))&&(g.collapsed=!1);const{label:y,collapsed:b,parent:w}=g;if(!Zt(r))t.push(ri(h0,e,{label:y||e,parent:w},r,l));else if(hr.isArray(r)||hr.isArray(r)&&e==="root"){const{config:x}=Ki("array",g),C=hr.isArray(r)?`${r.length||""}`:`{${Object.keys(r).length||""}}`,T=e==="root"?a:`${a} ${C}`;t.push(ri(x,e,{label:y||T,parent:w},r,hr.isArray(l)?{[a]:l}:l))}else if(!hr.isArray(r)&&Object.keys(p).length||e==="root"){const{config:x}=Ki(null,g),C=e.split("."),T=C[C.length-1];let S=isNaN(Number(T))?null:Number(T)+1;const _=isNaN(Number(T))?T:C[C.length-2]+" "+S,A=e==="root"?a:_,P=r;if(y){const{config:I}=Ki("object",g);I.data.headerTitle=y,t.push(ri(I,e,{label:y||`${y} ${Object.keys(r).length}`,parent:w},p,P))}else x.data.headerTitle=A,t.push(ri(x,e,{label:y,parent:w},p,P))}return b||(Object.keys(E).length&&!hr.isArray(r)?Yo({flowConfig:i,chldPth:null,edges:n,isInverted:null,itrblObjct:E,nodes:t,path:e,newConfig:g,ctx:s}):hr.isArray(r)&&r.forEach((x,C)=>{x=g0(x,s.initalObjIds);const T=x,S=Pa(x),_=Xn(x),{newConfig:A,arrayObject:P}=Ia(x);P.length&&(x=P);const{config:I}=Ki(typeof x=="string"?"text":"array",A),{hideConfig:D,sourceLabel:k,label:M,isEdgeAnimated:N,parent:z}=A;u=u||D;const $=e==="root"&&i.isCntr,q=e.split(".").slice(0,2).join("."),V=s.invrtdRtPths.includes(q),Z=i.isCntr&&V||C%2===0&&$;let K=`${e}.${C}`;K=os(K,t),Z&&s.invrtdRtPths.push(K),Zt(x)?Object.keys(S).length&&!hr.isArray(x)?(n.push(wa(e,K,null,k,Z,N)),ni(x,K,t,n,M||C,i,A,s)):Object.keys(_).length&&!hr.isArray(x)?Yo({flowConfig:i,chldPth:K,isInverted:Z,edges:n,itrblObjct:_,nodes:t,path:e,newConfig:A,forceIsInverted:!0,ctx:s}):hr.isArray(x)?jP({flowConfig:i,chldPth:K,edges:n,isInverted:Z,item:x,nodes:t,path:e,ctx:s}):Zt(x)&&Yo({flowConfig:i,chldPth:K,isInverted:Z,edges:n,itrblObjct:[x],nodes:t,path:e,newConfig:A,ctx:s}):(n.push(wa(e,K,null,k,Z,N)),t.push(ri(I,K,{label:M||String(x),parent:z},x,T)))})),{nodes:t,edges:n}}catch{return{nodes:t,edges:n}}}const Yo=({chldPth:r,flowConfig:e,edges:t,itrblObjct:n,nodes:a,isInverted:i,path:o,newConfig:s,forceIsInverted:l=!1,ctx:u})=>{let{hideDefaultObject:c,sprtObjctKy:d}=e;return Object.entries(n).forEach(([h,g],p)=>{g=g0(g,u.initalObjIds);const E=g,y=Pa(g),b=Xn(g),{newConfig:w,arrayObject:x}=Ia(g);x.length&&(g=x),w.collapsed===void 0&&(Object.keys(b).length>0||hr.isArray(g))&&(w.collapsed=!1);const{hideConfig:C,sourceLabel:T,label:S,content:_,target:A,targetLabel:P,collapsed:I,isEdgeAnimated:D,parent:k}=w;c=c||C;const M=o==="root"&&e.isCntr,N=o.split(".").slice(0,2).join("."),z=u.invrtdRtPths.includes(N);l||(i=e.isCntr&&z||p%2===0&&M);let $=r?`${r}.${h}`:`${o}.${h}`;if($=os($,a),i&&u.invrtdRtPths.push($),A&&t.push(wa($,A,null,P,i,D)),Zt(g)&&!hr.isArray(g)){t.push(wa(o,$,null,T,i,D));const q=d||Object.keys(y).length===0;if(q){const V=_?"object":"array",{config:Z}=Ki(V,w);Z.data.headerTitle=_?S:null,a.push(ri(Z,$,{label:S||h,parent:k},y,E))}if(Object.keys(y).length&&!c&&!I){let V=$;if(q){const Z=hr.isArray(g)?` ${g.length||""}`:`{${Object.keys(g).length||""}}`;V=`${$}.${Z}`,V=os(V,a),t.push(wa($,V,null,T,i,D))}ni(g,V,a,t,S||h,e,{},u)}else Object.keys(b).length&&!hr.isArray(g)&&!I?Yo({chldPth:$,flowConfig:e,itrblObjct:b,path:$,edges:t,nodes:a,newConfig:{},isInverted:i,ctx:u}):I||ni(g,$,a,t,h,e,{},u)}else hr.isArray(g)&&!I&&(t.push(wa(o,$,null,T,i,D)),ni(g,$,a,t,h,e,{},u))})},jP=({flowConfig:r,chldPth:e,edges:t,isInverted:n,item:a,nodes:i,path:o,ctx:s})=>a.forEach((l,u)=>{let c=`${e}.${u}`;c=os(c,i);const d=l;l=g0(l,s.initalObjIds);const h=Xn(l),g=Pa(l),{newConfig:p}=Ia(l),{collapsed:E,label:y,parent:b,sourceLabel:w,isEdgeAnimated:x,content:C}=p;Zt(l)?!hr.isArray(l)&&Object.keys(g).length&&!E?(t.push(wa(o,c,null,w,n,x)),ni(l,c,i,t,u,r,p,s)):Object.keys(h).length&&!hr.isArray(l)&&!E?Yo({chldPth:c,flowConfig:r,itrblObjct:h,path:o,edges:t,nodes:i,isInverted:n,newConfig:p,ctx:s}):hr.isArray(l)&&!E&&jP({flowConfig:r,chldPth:c,edges:t,isInverted:n,item:l,nodes:i,path:o,ctx:s}):(t.push(wa(o,c,null,w,n,x)),i.push(ri(h0,c,{label:y||String(l),parent:b},l,d)))});function YP(r){let e=0,t=0,n=0;const a=(i,o)=>{if(t=Math.max(t,o),e++,i&&typeof i=="object"){const s=Array.isArray(i)?i.length:Object.keys(i).length;if(n+=s+2,Array.isArray(i))for(const l of i)a(l,o+1);else for(const l in i)i.hasOwnProperty(l)&&a(i[l],o+1)}else n+=1};return a(r,0),{lines:n,depth:t,nodes:e}}function ZP(r,e){const t=(n,a,i=null,o="")=>{if(a>0&&a%e===0&&n&&typeof n=="object")if(Array.isArray(n)){i&&o!==""&&n.length>0&&(i[o]={$:n,$collapsed:!0});return}else{if(n.$collapsed===!1)return;const s=Xn(n);if(Object.keys(s).length>0){n.$collapsed=!0;return}}if(n&&typeof n=="object")if(Array.isArray(n))for(let s=0;s<n.length;s++)n[s]&&typeof n[s]=="object"&&t(n[s],a+1,n,s);else for(const s in n)n.hasOwnProperty(s)&&!s.startsWith("$")&&n[s]&&typeof n[s]=="object"&&t(n[s],a+1,n,s)};if(e>0&&r&&typeof r=="object")if(Array.isArray(r))for(let n=0;n<r.length;n++)r[n]&&typeof r[n]=="object"&&t(r[n],1,r,n);else for(const n in r)r.hasOwnProperty(n)&&!n.startsWith("$")&&r[n]&&typeof r[n]=="object"&&t(r[n],1,r,n);return r}const NW=".cytoscape-react-nodes-and-edges{position:absolute!important;top:0!important;left:0!important;z-index:10!important;pointer-events:none!important;overflow:visible!important;transform-origin:0 0!important}.cytoscape-react-node{z-index:0!important;overflow:visible!important;pointer-events:auto!important;position:absolute!important;transform-origin:0 0!important}.cytoscape-react-node input,.cytoscape-react-node textarea{pointer-events:auto!important;user-select:text!important;cursor:text!important}.cytoscape-react-edge{overflow:visible!important;pointer-events:none!important}.cytoscape-react-cy-container{width:100%!important;height:100%!important;overflow:visible!important;position:relative!important;background:transparent!important}.cytoscape-react-cy-container canvas{display:inline!important;vertical-align:baseline!important;overflow:visible!important}.cytoscape-react-cy-container>div{overflow:visible!important}";let V2=!1;function FW(){if(V2||typeof document>"u")return;const r=document.createElement("style");r.setAttribute("data-flow-sdk",""),r.textContent=NW,document.head.appendChild(r),V2=!0}const zW={nodes:[],edges:[]};function $W({json:r,title:e="untitled",nodes:t,edges:n,config:a={},callbacks:i={},className:o,style:s,showBottomBar:l=!0}){FW();const u=a.direction==="C",c=!!(t||n),[d,h]=Se.useState(null),g=Se.useRef(e);g.current=e,Se.useEffect(()=>{if(c)return;if(!r){h(zW);return}h(null);const y=requestAnimationFrame(()=>{let b=typeof r=="string"?JSON.parse(r):r;if(a.autoCollapse){const x={minLines:800,minDepth:5,collapseEveryNLevels:3},C=a.autoCollapse===!0?x:{...x,...a.autoCollapse},{lines:T,depth:S}=YP(b);T>C.minLines&&S>C.minDepth&&(b=ZP(JSON.parse(JSON.stringify(b)),C.collapseEveryNLevels))}const w=ni(b,"root",[],[],g.current,{hideDefaultObject:!1,sprtObjctKy:!1,isCntr:u});h(w)});return()=>cancelAnimationFrame(y)},[r,e,u,a.autoCollapse]);const p=c?t:d==null?void 0:d.nodes,E=c?n:d==null?void 0:d.edges;return ue.jsx(iq,{config:a,callbacks:i,children:ue.jsx(pe.Box,{className:o,style:s,width:"100%",height:"100%",position:"relative",overflow:"hidden",children:p?ue.jsxs(ue.Fragment,{children:[ue.jsx(RW,{nodes:p,edges:E}),l&&ue.jsx(PW,{})]}):ue.jsxs(pe.Flex,{width:"100%",height:"100%",align:"center",justify:"center",direction:"column",gap:3,children:[ue.jsx(pe.Spinner,{size:"lg",color:a.themeColor||"blue.500",speed:"0.8s"}),ue.jsx(pe.Text,{fontSize:"sm",opacity:.5,children:"Loading diagram..."})]})})})}exports.DynamicIcon=_m;exports.FlowDiagram=$W;exports.applyAutoCollapse=ZP;exports.contentObjTheme=In;exports.createFlowDiagram=ni;exports.getChakraColorHex=ht;exports.getColorVariant=W2;exports.getDarkerHexColor=Vu;exports.getJsonSize=YP;exports.useCustomColors=us;exports.useStopPropagation=U2;exports.useThemeContentColors=ss;
358
358
  //# sourceMappingURL=index.cjs.map