@squeed/flow-sdk 0.1.12 → 0.1.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";var JO=Object.create;var F1=Object.defineProperty;var eq=Object.getOwnPropertyDescriptor;var rq=Object.getOwnPropertyNames;var tq=Object.getPrototypeOf,nq=Object.prototype.hasOwnProperty;var aq=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of rq(e))!nq.call(r,a)&&a!==t&&F1(r,a,{get:()=>e[a],enumerable:!(n=eq(e,a))||n.enumerable});return r};var Rr=(r,e,t)=>(t=r!=null?JO(tq(r)):{},aq(e||!r||!r.__esModule?F1(t,"default",{value:r,enumerable:!0}):t,r));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ue=require("react/jsx-runtime"),De=require("@chakra-ui/react"),Te=require("react"),Hr=require("react-icons/pi"),iq=require("react-icons/hi2"),oq=require("react-icons/gr"),fc=require("react-icons/vsc"),sq=require("react-icons/tb"),z1=require("react-icons/io5"),j2=Te.createContext(null);function Mn(){const r=Te.useContext(j2);if(!r)throw new Error("useFlowDiagramContext must be used within FlowDiagram");return r}function uq({config:r,callbacks:e,children:t}){const n=Te.useRef(null),[a,i]=Te.useState([]),[o,s]=Te.useState(null),[l,u]=Te.useState(!0),[c,d]=Te.useState(!1),[h,g]=Te.useState(!0),[p,E]=Te.useState(r.edgeHandles===!0),[m,b]=Te.useState(!1),[w,x]=Te.useState(!0),[C,T]=Te.useState(!1),S=Te.useRef(e);S.current=e;const _=Te.useMemo(()=>{const Y=K=>(...ee)=>{var le,G;return(G=(le=S.current)==null?void 0:le[K])==null?void 0:G.call(le,...ee)};return{onNodeSelect:Y("onNodeSelect"),onNodeDeselect:Y("onNodeDeselect"),onNodeDoubleClick:Y("onNodeDoubleClick"),onNodeCreate:Y("onNodeCreate"),onNodeDelete:Y("onNodeDelete"),onNodeLabelChange:Y("onNodeLabelChange"),onNodeCollapse:Y("onNodeCollapse"),onNodeColorChange:Y("onNodeColorChange"),onNodeIconChange:Y("onNodeIconChange"),onNodeHoverAction:Y("onNodeHoverAction"),onEdgeCreate:Y("onEdgeCreate"),onEdgeSelect:Y("onEdgeSelect"),onEdgeDeselect:Y("onEdgeDeselect"),onEdgeRemove:Y("onEdgeRemove"),onEdgeColorChange:Y("onEdgeColorChange"),onEdgeLabelChange:Y("onEdgeLabelChange"),onEdgeStyleChange:Y("onEdgeStyleChange"),onViewportChange:Y("onViewportChange"),onDirectionChange:Y("onDirectionChange"),onArrayModeChange:Y("onArrayModeChange"),onCyInit:Y("onCyInit")}},[]),A=r.themeColor||"blue.500",P=r.edgeColor||"",D=r.colorMode||"light",I=r.direction||"LR",M=r.readOnly??!1,k=r.isZoomMode!==void 0?r.isZoomMode:l,N=r.isMultiSelectMode!==void 0?r.isMultiSelectMode:c,z=r.isEdgeHandlesEnabled!==void 0?r.isEdgeHandlesEnabled:p,W=r.isDragMode!==void 0?r.isDragMode:h,q=Te.useRef(r);q.current=r;const $=Te.useMemo(()=>({get direction(){return q.current.direction},get themeColor(){return q.current.themeColor},get colorMode(){return q.current.colorMode},get readOnly(){return q.current.readOnly},get editable(){return q.current.editable},get minZoom(){return q.current.minZoom},get maxZoom(){return q.current.maxZoom},get backgroundPattern(){return q.current.backgroundPattern},get edgeColor(){return q.current.edgeColor},get backgroundColor(){return q.current.backgroundColor},get edgeHandles(){return q.current.edgeHandles},get initialViewport(){return q.current.initialViewport},get nodeOverlayActions(){return q.current.nodeOverlayActions},get renderNodeOverlay(){return q.current.renderNodeOverlay},get renderSelectedNodeToolbar(){return q.current.renderSelectedNodeToolbar},get renderSelectedEdgeToolbar(){return q.current.renderSelectedEdgeToolbar},get renderBottomBar(){return q.current.renderBottomBar},get customViews(){return q.current.customViews},get disableKeyboardShortcuts(){return q.current.disableKeyboardShortcuts},get isZoomMode(){return q.current.isZoomMode},get isMultiSelectMode(){return q.current.isMultiSelectMode},get isEdgeHandlesEnabled(){return q.current.isEdgeHandlesEnabled},get isDragMode(){return q.current.isDragMode}}),[]),X=Te.useMemo(()=>({themeColor:A,edgeColor:P,colorMode:D,direction:I,selectedNodeIds:a,setSelectedNodeIds:i,selectedEdgeId:o,setSelectedEdgeId:s,isZoomMode:k,setIsZoomMode:u,isMultiSelectMode:N,setIsMultiSelectMode:d,isDragMode:W,setIsDragMode:g,isEdgeHandlesEnabled:z,setIsEdgeHandlesEnabled:E,isArrayNodeMode:m,setIsArrayNodeMode:b,isPinned:w,setIsPinned:x,isPerformanceMode:C,setIsPerformanceMode:T,cyRef:n,callbacks:_,config:$,readOnly:M}),[A,P,D,I,a,o,k,N,W,z,m,w,C,M,_,$]);return ue.jsx(j2.Provider,{value:X,children:t})}const lq=({children:r,pattern:e="dot",backgroundColor:t})=>{const{colorMode:n}=Mn(),a=n==="dark",i=a?"--chakra-colors-gray-700":"--chakra-colors-gray-500",o=a?"--chakra-colors-gray-700":"--chakra-colors-gray-800";return e==="none"?ue.jsx(De.Box,{width:"100%",height:"100%",padding:0,bg:t,children:r}):ue.jsxs(De.Box,{position:"relative",width:"100%",height:"100%",padding:0,bg:t,children:[ue.jsx(De.Box,{position:"absolute",top:0,left:0,right:0,bottom:0,width:"100%",height:"100%",zIndex:0,pointerEvents:"none",style:{backgroundImage:e==="dot"?`radial-gradient(var(${i}) 8%, transparent 8%)`:e==="steel"?`repeating-linear-gradient(45deg, var(${o}) 0, var(${o}) 1px, transparent 1px, transparent 20px)`:`linear-gradient(var(${o}) 1px, transparent 1px), linear-gradient(90deg, var(${o}) 1px, transparent 1px)`,backgroundSize:"20px 20px",opacity:.3}}),ue.jsx(De.Box,{position:"relative",width:"100%",height:"100%",zIndex:1,padding:0,children:r})]})};function Uu(r,e=.2){const t=r.replace(/^#/,""),n=parseInt(t,16);let a=n>>16&255,i=n>>8&255,o=n&255;return a=Math.max(0,Math.floor(a*(1-e))),i=Math.max(0,Math.floor(i*(1-e))),o=Math.max(0,Math.floor(o*(1-e))),"#"+((1<<24)+(a<<16)+(i<<8)+o).toString(16).slice(1).toUpperCase()}const In=r=>r!=null&&r.startsWith("#")?{background:r,highlight:Uu(r,.1),border:Uu(r,.5),property:"gray.900",boolean:"green.200",string:"gray.900",number:"orange.800"}:r==="gray"?{background:"gray.950",highlight:"gray.800",border:"gray.700",property:"gray.200",boolean:"green.400",string:"gray.200",number:"orange.600"}:r==="white"?{background:"white",highlight:"gray.200",border:"gray.400",property:"gray.900",boolean:"green.400",string:"gray.900",number:"orange.600"}:{background:r+".100",highlight:r+".200",border:r+".700",property:"gray.900",boolean:"green.800",string:"gray.900",number:"orange.800"},Y2=r=>{let e=r;if(e!=null&&e.startsWith("#"))return{secondary:Uu(r)};let t=String(Number(r.slice(-3))+200);t=r.slice(0,-3).concat(t);let n=String(Number(r.slice(-3))-100);return n=r.slice(0,-3).concat(n),{primary:e,secondary:t,light:n}},$1={red:{50:"#FFF5F5",100:"#FED7D7",200:"#FEB2B2",300:"#FC8181",400:"#F56565",500:"#E53E3E",600:"#C53030",700:"#9B2C2C",800:"#822727",900:"#63171B"},orange:{50:"#FFFAF0",100:"#FEEBC8",200:"#FBD38D",300:"#F6AD55",400:"#ED8936",500:"#DD6B20",600:"#C05621",700:"#9C4221",800:"#7B341E",900:"#652B19"},yellow:{50:"#FFFFF0",100:"#FEFCBF",200:"#FAF089",300:"#F6E05E",400:"#ECC94B",500:"#D69E2E",600:"#B7791F",700:"#975A16",800:"#744210",900:"#5F370E"},green:{50:"#F0FFF4",100:"#C6F6D5",200:"#9AE6B4",300:"#68D391",400:"#48BB78",500:"#38A169",600:"#2F855A",700:"#276749",800:"#22543D",900:"#1C4532"},teal:{50:"#E6FFFA",100:"#B2F5EA",200:"#81E6D9",300:"#4FD1C5",400:"#38B2AC",500:"#319795",600:"#2C7A7B",700:"#285E61",800:"#234E52",900:"#1D4044"},blue:{50:"#EBF8FF",100:"#BEE3F8",200:"#90CDF4",300:"#63B3ED",400:"#4299E1",500:"#3182CE",600:"#2B6CB0",700:"#2C5282",800:"#2A4365",900:"#1A365D"},cyan:{50:"#EDFDFD",100:"#C4F1F9",200:"#9DECF9",300:"#76E4F7",400:"#0BC5EA",500:"#00B5D8",600:"#00A3C4",700:"#0987A0",800:"#086F83",900:"#065666"},purple:{50:"#FAF5FF",100:"#E9D8FD",200:"#D6BCFA",300:"#B794F4",400:"#9F7AEA",500:"#805AD5",600:"#6B46C1",700:"#553C9A",800:"#44337A",900:"#322659"},pink:{50:"#FFF5F7",100:"#FED7E2",200:"#FBB6CE",300:"#F687B3",400:"#ED64A6",500:"#D53F8C",600:"#B83280",700:"#97266D",800:"#702459",900:"#521B41"},gray:{50:"#F7FAFC",100:"#EDF2F7",200:"#E2E8F0",300:"#CBD5E0",400:"#A0AEC0",500:"#718096",600:"#4A5568",700:"#2D3748",800:"#1A202C",900:"#171923",950:"#0d1117"}},ht=(r,e)=>{var i;if(r!=null&&r.startsWith("#"))return r;if(!r)return"whitesmoke";const t=r.replace(/\./g,"-");try{const s=getComputedStyle(document.documentElement).getPropertyValue(`--chakra-colors-${t}`).trim();if(s&&s!=="")return s}catch{}const[n,a]=r.split(".");return n&&a&&((i=$1[n])!=null&&i[Number(a)])?$1[n][Number(a)]:`var(--chakra-colors-${t})`};function Et(r,e,t){return r?t:e}function cs(r){const[e]=(r==null?void 0:r.split("."))||[],{secondary:t}=Y2(r),n=In(e).background,a=In(e).highlight,i=In(e).border,o=In(e).property,s=In(e).property;let l=In(e).background,u=In(e).highlight;return l=ht(l)+50,u=ht(u)+20,{bgColor:n,highlightColor:a,borderColor:i,textColor:o,propertyColor:s,secondary:t,bgColorFaint:l,highlightColorFaint:u}}function ds(r=null){const{colorMode:e}=Mn(),t=r==null?void 0:r.includes("gray"),n=e==="dark",a=Et(n,"gray.100","gray.900"),i=Et(n,"gray.200","blackAlpha.400"),o=Et(n,"gray.200","blackAlpha.600"),s=Et(n,"gray.500","gray.800"),l=Et(n,"gray.700","gray.700"),u=Et(n,"gray.900","gray.900"),c=Et(n,"gray.400","gray.500"),d=Et(n,"gray.400","gray.700"),h=Et(n,"gray.900","gray.200"),g=Et(n,t?"gray.900":"gray.200",t?"gray.200":"gray.900"),p=Et(n,"gray.900","gray.200"),E=Et(n,r&&"#000000",r||"#ffffff"),m=Et(n,r||"#ffffff",r?"#000000":"#ffffff"),b=l,w=Et(n,"gray.300","gray.800"),x=Et(n,"white","blackAlpha.400"),C=Et(n,"green.100","green.700");return{background:a,backgroundSecondary:i,darkBackgroundSecondary:o,border:s,darkColor:u,backgroundWhiteColor:x,borderSecondary:l,colorActive:c,colorInactive:d,iconColor:p,moreIconColor:b,colorText:h,themedColorText:g,logoColor:E,logoColorSecondary:m,darkColorActive:w,greenColor:C}}const V1=({icon:r,label:e,onClick:t,color:n,boxSize:a=6,...i})=>{const{background:o,border:s,colorText:l}=ds();return ue.jsxs(De.Tooltip.Root,{positioning:{placement:i.placement||"top"},children:[ue.jsx(De.Tooltip.Trigger,{asChild:!0,children:ue.jsx(De.Flex,{children:ue.jsx(De.Icon,{as:r,boxSize:a,color:n,cursor:t?"pointer":void 0,onClick:t})})}),ue.jsx(De.Tooltip.Positioner,{children:ue.jsx(De.Tooltip.Content,{bgColor:i.bgColor||o,borderColor:i.borderColor||s,borderWidth:1,color:i.textColor||l,borderRadius:15,fontWeight:300,fontSize:"sm",p:2,px:4,shadow:"none",children:e})})]})},fq=({data:r,children:e,isInverted:t,isParent:n})=>{var z,W;const{selectedNodeIds:a,setSelectedNodeIds:i,isMultiSelectMode:o,isPerformanceMode:s,cyRef:l,callbacks:u,config:c,themeColor:d,direction:h}=Mn(),{background:g,border:p,colorText:E}=ds(),m=Te.useRef(null),b=Te.useRef(null),[w,x]=Te.useState(!1),[C,T]=Te.useState(!1),S=r==null?void 0:r.id,_=a.includes(S),A=c.nodeOverlayActions,P=c.renderNodeOverlay,D=(()=>{var q;try{const $=(q=l.current)==null?void 0:q.zoom();return $!==void 0&&$<.08}catch{return!1}})(),I=Te.useCallback(()=>{var q,$,X;if(!C)if(o){const Y=a.includes(S),K=Y?a.filter(ee=>ee!==S):[...a,S];i(K),Y?(q=u.onNodeDeselect)==null||q.call(u):($=u.onNodeSelect)==null||$.call(u,S,r)}else i([S]),(X=u.onNodeSelect)==null||X.call(u,S,r)},[S,r,a,o,C,i,u]),M=Te.useCallback(()=>{var q;C||(q=u.onNodeDoubleClick)==null||q.call(u,S,r)},[S,r,C,u]),k=Te.useCallback(()=>{b.current&&clearTimeout(b.current),b.current=setTimeout(()=>x(!0),100)},[]),N=Te.useCallback(()=>{b.current&&clearTimeout(b.current),x(!1)},[]);return n?ue.jsxs(De.Box,{ref:m,onClick:I,onDoubleClick:M,onMouseEnter:k,onMouseLeave:N,cursor:"pointer",position:"relative",children:[!s&&(P||A&&A.length>0)&&w&&!D&&ue.jsxs(ue.Fragment,{children:[ue.jsx(De.Box,{position:"absolute",top:-150,left:"0",right:"0",height:"150px",pointerEvents:"auto",onMouseEnter:()=>x(!0),onMouseLeave:N}),P?ue.jsx(De.Box,{position:"absolute",zIndex:1e3,top:"-100px",left:"50%",pointerEvents:"auto",transform:"translateX(-50%) scale3d(3, 3, 1)",onMouseEnter:()=>x(!0),onMouseLeave:N,willChange:"transform",children:P({nodeId:S,nodeData:r,isRoot:S==="root",isParent:!0,isHovered:w,setIsHovered:x})}):ue.jsx(De.Box,{position:"absolute",zIndex:1e3,top:"-100px",left:"50%",bg:g,p:3,borderColor:p,borderWidth:1,borderRadius:15,pointerEvents:"auto",transform:"translateX(-50%) scale3d(3, 3, 1)",boxShadow:"lg",onMouseEnter:()=>x(!0),onMouseLeave:N,willChange:"transform",children:ue.jsx(De.HStack,{px:2,gap:2,children:A.map((q,$)=>ue.jsxs(De.Box,{display:"contents",children:[$>0&&ue.jsx(De.Box,{borderColor:p,height:5,borderRightWidth:1}),ue.jsx(V1,{icon:q.icon,label:q.label,color:E,bgColor:g,borderColor:p,textColor:E,boxSize:5,onClick:X=>{var Y;X.stopPropagation(),(Y=u.onNodeHoverAction)==null||Y.call(u,q.id,S,r)}})]},q.id))})})]}),e({id:S,data:r,isActive:_,isLowZoom:D,isEditing:C,onEditStart:()=>T(!0),onEditEnd:()=>T(!1)}),((z=r==null?void 0:r.config)==null?void 0:z.collapsed)!==void 0&&(()=>{var X;const q=h==="TB"||h==="BT",$=t||h==="RL";return ue.jsx(De.IconButton,{position:"absolute",...q?{[h==="BT"?"top":"bottom"]:"-75px",left:"50%",transform:"translateX(-50%)"}:{right:$?void 0:"-75px",left:$?"-75px":void 0,top:"50%",transform:"translateY(-50%)"},"aria-label":r.config.collapsed?"Expand":"Collapse",onClick:Y=>{var K;Y.stopPropagation(),(K=u.onNodeCollapse)==null||K.call(u,S,!r.config.collapsed)},bgColor:ht(((X=r==null?void 0:r.viewProps)==null?void 0:X.bgColor)||d),size:"md",color:"gray.100",rounded:"full",mr:2,px:2,py:4,children:r.config.collapsed?ue.jsx(Hr.PiPlusBold,{size:30,color:"gray.800"}):ue.jsx(Hr.PiMinusBold,{size:30,color:"gray.800"})})})()]}):ue.jsxs(De.Box,{ref:m,onClick:I,onDoubleClick:M,onMouseEnter:k,onMouseLeave:N,cursor:"pointer",transition:"transform 0.1s ease",position:"relative",children:[!s&&(P||A&&A.length>0)&&w&&!D&&ue.jsxs(ue.Fragment,{children:[ue.jsx(De.Box,{position:"absolute",top:-150,left:"0",right:"0",height:"150px",pointerEvents:"auto",onMouseEnter:()=>x(!0),onMouseLeave:N}),P?ue.jsx(De.Box,{position:"absolute",zIndex:1e3,top:"-100px",left:"50%",pointerEvents:"auto",transform:"translateX(-50%) scale3d(3, 3, 1)",onMouseEnter:()=>x(!0),onMouseLeave:N,willChange:"transform",children:P({nodeId:S,nodeData:r,isRoot:S==="root",isParent:!!n,isHovered:w,setIsHovered:x})}):ue.jsx(De.Box,{position:"absolute",zIndex:1e3,top:"-100px",left:"50%",bg:g,p:3,borderColor:p,borderWidth:1,borderRadius:15,pointerEvents:"auto",transform:"translateX(-50%) scale3d(3, 3, 1)",boxShadow:"lg",onMouseEnter:()=>x(!0),onMouseLeave:N,willChange:"transform",children:ue.jsx(De.HStack,{px:2,gap:2,children:A.map((q,$)=>ue.jsxs(De.Box,{display:"contents",children:[$>0&&ue.jsx(De.Box,{borderColor:p,height:5,borderRightWidth:1}),ue.jsx(V1,{icon:q.icon,label:q.label,color:E,bgColor:g,borderColor:p,textColor:E,boxSize:5,onClick:X=>{var Y;X.stopPropagation(),(Y=u.onNodeHoverAction)==null||Y.call(u,q.id,S,r)}})]},q.id))})})]}),ue.jsxs(De.Box,{position:"relative",display:"flex",h:"100%",w:"100%",children:[((W=r==null?void 0:r.config)==null?void 0:W.collapsed)!==void 0&&!n&&(()=>{var X;const q=h==="TB"||h==="BT",$=t||h==="RL";return ue.jsx(De.IconButton,{position:"absolute",...q?{[h==="BT"?"top":"bottom"]:"-75px",left:"50%",transform:"translateX(-50%)"}:{right:$?void 0:"-75px",left:$?"-75px":void 0,alignSelf:"center"},"aria-label":r.config.collapsed?"Expand":"Collapse",onClick:Y=>{var K;Y.stopPropagation(),(K=u.onNodeCollapse)==null||K.call(u,S,!r.config.collapsed)},bgColor:ht(((X=r==null?void 0:r.viewProps)==null?void 0:X.bgColor)||d),size:"md",color:"gray.100",rounded:"full",mr:2,px:2,py:4,children:r.config.collapsed?ue.jsx(Hr.PiPlusBold,{size:30,color:"gray.800"}):ue.jsx(Hr.PiMinusBold,{size:30,color:"gray.800"})})})(),e({id:S,data:r,isActive:_,isLowZoom:D,isEditing:C,onEditStart:()=>T(!0),onEditEnd:()=>T(!1)})]})]})},ul=Te.memo(fq);function Z2(r=!0){const e=Te.useRef(null);return Te.useEffect(()=>{if(!r||!e.current)return;const t=i=>{i.stopPropagation(),i.stopImmediatePropagation()},n=e.current,a=["mousedown","mouseup","click","pointerdown","pointerup","keydown","keyup","keypress","input","focus"];return a.forEach(i=>n.addEventListener(i,t,!0)),()=>{a.forEach(i=>n.removeEventListener(i,t,!0))}},[r]),e}const X2=({nodeId:r,label:e,color:t,fontWeight:n="bold",fontSize:a="5xl",isEditing:i,onEditStart:o,onEditEnd:s})=>{const{callbacks:l,config:u,readOnly:c}=Mn(),d=u.editable&&!c,[h,g]=Te.useState(e),p=Te.useRef(null),E=Te.useRef(!1),m=Z2(i);Te.useEffect(()=>{i&&(E.current=!1,p.current&&(p.current.focus(),p.current.select()))},[i]);const b=()=>{var x;if(E.current)return;E.current=!0;const w=h.trim();w&&w!==e&&((x=l.onNodeLabelChange)==null||x.call(l,r,w)),s()};return!d||!i?ue.jsx(De.Text,{color:t,fontWeight:n,fontSize:a,onDoubleClick:d?w=>{w.stopPropagation(),g(e),o()}:void 0,cursor:d?"text":void 0,children:e}):ue.jsx("div",{ref:m,children:ue.jsx(De.Input,{ref:p,value:h,onChange:w=>g(w.target.value),onBlur:b,onKeyDown:w=>{w.key==="Enter"&&b(),w.key==="Escape"&&s()},color:t,fontWeight:n,fontSize:a,bg:"transparent",borderWidth:0,p:0,h:"auto",lineHeight:"normal"})})},cq=({id:r,data:e,isActive:t,isEditing:n,onEditStart:a,onEditEnd:i})=>{var d,h,g;const{themeColor:o}=Mn(),{bgColor:s,borderColor:l,textColor:u}=cs(((d=e==null?void 0:e.viewProps)==null?void 0:d.bgColor)||o),c=ht(((h=e==null?void 0:e.viewProps)==null?void 0:h.textColor)||u);return ue.jsx(De.Box,{borderRadius:(g=e==null?void 0:e.viewProps)==null?void 0:g.borderRadius,bgColor:s,borderColor:t?"white":l,_hover:{borderColor:"white"},borderWidth:2,py:14,px:20,whiteSpace:"normal",children:ue.jsx(De.Flex,{justifyContent:"start",w:900,fontSize:"5xl",lineHeight:"normal",children:ue.jsx(X2,{nodeId:r,label:(e==null?void 0:e.label)||(e==null?void 0:e.text)||"",color:c,isEditing:n,onEditStart:a,onEditEnd:i})})})},dq=({id:r,isActive:e,data:t,isEditing:n,onEditStart:a,onEditEnd:i})=>{var p,E,m,b;const{themeColor:o}=Mn(),s=((p=t==null?void 0:t.viewProps)==null?void 0:p.bgColor)||o,{borderColor:l,highlightColor:u,textColor:c}=cs(s),d=ht(((E=t==null?void 0:t.viewProps)==null?void 0:E.textColor)||c),h=ht(((m=t==null?void 0:t.viewProps)==null?void 0:m.borderColor)||l),g=s!=null&&s.startsWith("#")?s:ht(u);return ue.jsx(De.Flex,{align:"center",borderRadius:(b=t==null?void 0:t.viewProps)==null?void 0:b.borderRadius,bgColor:g,style:{backgroundColor:g},textTransform:"capitalize",borderColor:e?"white":h,_hover:{borderColor:"white"},borderWidth:2,px:50,whiteSpace:"nowrap",children:ue.jsx(De.Flex,{justifyContent:"start",py:14,fontSize:"5xl",lineHeight:"normal",w:900,children:ue.jsx(X2,{nodeId:r,label:(t==null?void 0:t.label)||(t==null?void 0:t.text)||"",color:d,isEditing:n,onEditStart:a,onEditEnd:i})})})},Pm=({name:r,...e})=>{const[t,n]=Te.useState(null),[a,i]=Te.useState(!0),[o,s]=Te.useState(!1);return Te.useEffect(()=>{if(!r||r.length<2){n(null),i(!1);return}i(!0),s(!1),(async()=>{try{let u;if(r.startsWith("Md"))u="md";else if(r.startsWith("Fa"))u="fa6";else if(r.startsWith("Io5"))u="io5";else if(r.startsWith("Io"))u="io";else if(r.startsWith("Ti"))u="ti";else if(r.startsWith("Go"))u="go";else if(r.startsWith("Fi"))u="fi";else if(r.startsWith("Di"))u="di";else if(r.startsWith("Ai"))u="ai";else if(r.startsWith("Bs"))u="bs";else if(r.startsWith("Ri"))u="ri";else if(r.startsWith("Fc"))u="fc";else if(r.startsWith("Gi"))u="gi";else if(r.startsWith("Hi2"))u="hi2";else if(r.startsWith("Hi"))u="hi";else if(r.startsWith("Si"))u="si";else if(r.startsWith("Sl"))u="sl";else if(r.startsWith("Im"))u="im";else if(r.startsWith("Bi"))u="bi";else if(r.startsWith("Pi"))u="pi";else if(r.startsWith("Vsc"))u="vsc";else if(r.startsWith("Tb"))u="tb";else if(r.startsWith("Tfi"))u="tfi";else if(r.startsWith("Cg"))u="cg";else if(r.startsWith("Lia"))u="lia";else if(r.startsWith("Lu"))u="lu";else throw new Error(`Unknown library prefix for icon: ${r}`);let c;switch(u){case"md":c=await import("react-icons/md");break;case"fa6":c=await import("react-icons/fa6");break;case"io5":c=await import("react-icons/io5");break;case"io":c=await import("react-icons/io");break;case"ti":c=await import("react-icons/ti");break;case"go":c=await import("react-icons/go");break;case"fi":c=await import("react-icons/fi");break;case"di":c=await import("react-icons/di");break;case"ai":c=await import("react-icons/ai");break;case"bs":c=await import("react-icons/bs");break;case"ri":c=await import("react-icons/ri");break;case"fc":c=await import("react-icons/fc");break;case"gi":c=await import("react-icons/gi");break;case"hi2":c=await import("react-icons/hi2");break;case"hi":c=await import("react-icons/hi");break;case"si":c=await import("react-icons/si");break;case"sl":c=await import("react-icons/sl");break;case"im":c=await import("react-icons/im");break;case"bi":c=await import("react-icons/bi");break;case"pi":c=await import("react-icons/pi");break;case"vsc":c=await import("react-icons/vsc");break;case"tb":c=await import("react-icons/tb");break;case"tfi":c=await import("react-icons/tfi");break;case"cg":c=await import("react-icons/cg");break;case"lia":c=await import("react-icons/lia");break;case"lu":c=await import("react-icons/lu");break;default:throw new Error(`Unsupported library: ${u}`)}const d=c[r];if(!d)throw new Error(`Icon ${r} not found in library ${u}`);n(()=>d)}catch(u){console.warn(`Failed to load icon ${r}:`,u.message),s(!0),n(null)}finally{i(!1)}})()},[r]),a||!t?null:ue.jsx(t,{...e})},Q2=(r,e)=>{var l,u,c;const t=((l=r==null?void 0:r.viewProps)==null?void 0:l.bgColor)||e,[n]=t.split("."),a=cs(t),i=t!=null&&t.startsWith("#")?ht(t):ht(a.bgColor),o=ht(((u=r==null?void 0:r.viewProps)==null?void 0:u.textColor)||a.textColor),s=ht(((c=r==null?void 0:r.viewProps)==null?void 0:c.borderColor)||a.borderColor);return{...a,bg:t,wordBeforeDot:n,hexbgColor:i,hextextColor:o,hexborderColor:s}},vq=(r,e=350)=>`${String(r).substring(0,e)}${String(r).length>e?"...":""}`,J2=r=>r!=null&&r.includes("root")?r.replace("root","untitled"):r,hq=r=>{const e=Math.max(...Object.keys(r||{}).map(n=>n.length),0);return Math.max(e*28+30,200)},eR=r=>ue.jsx(ul,{...r,children:e=>ue.jsx(cq,{...e})}),rR=r=>ue.jsx(ul,{...r,children:e=>ue.jsx(dq,{...e})}),tR=r=>{const{themeColor:e}=Mn(),[t,n]=Te.useState(!1);return ue.jsx(ul,{...r,children:({data:a,isActive:i,isLowZoom:o})=>{var h,g,p,E,m,b,w,x;const s=Q2(a,e),l=Object.entries(a.description||{}).length>0,u=hq(a.description),c=(g=(h=r.data)==null?void 0:h.config)==null?void 0:g.icon,d=(E=(p=r.data)==null?void 0:p.config)==null?void 0:E.content;return ue.jsx(De.Flex,{justifyContent:"space-between",...a==null?void 0:a.viewProps,direction:"column",p:0,borderRadius:(m=a==null?void 0:a.viewProps)==null?void 0:m.borderRadius,overflow:"hidden",alignItems:"center",style:{backgroundColor:s.hexbgColor,transition:"border-color 0.2s ease-in-out"},width:"100%",borderColor:i?"white":s.hexborderColor,_hover:{borderColor:"white"},borderWidth:3,children:ue.jsxs(De.Flex,{width:"100%",direction:"column",borderRadius:(b=a==null?void 0:a.viewProps)==null?void 0:b.borderRadius,borderColor:s.hexborderColor,borderWidth:0,overflow:"hidden",children:[a.headerTitle&&ue.jsxs(De.Flex,{justify:"flex-start",direction:"row",p:Object.entries(a.description||{}).length?8:20,borderBottomWidth:1,minWidth:"max-content !important",width:"100%",textTransform:"capitalize",align:d?"left":"center",textOverflow:"ellipsis",alignItems:"center",fontWeight:"bold",color:s.propertyColor,bgColor:s.highlightColor,borderBottomColor:!l&&!d?"transparent":s.hexborderColor,children:[!!c&&ue.jsx(De.Box,{mr:8,justifyContent:"flex-start",height:"100%",w:50,alignItems:"center",rounded:"full",children:ue.jsx(Pm,{name:c,size:80,color:s.hextextColor},s.hextextColor)}),ue.jsx(De.Text,{fontSize:"5xl",lineClamp:2,textOverflow:"ellipsis",whiteSpace:"nowrap",color:(w=a==null?void 0:a.viewProps)==null?void 0:w.textColor,children:J2(a.headerTitle)}),!!d&&ue.jsx(De.Box,{ml:10,onClick:()=>n(!t),children:t?ue.jsx(Hr.PiGear,{size:30,style:{cursor:"pointer"}}):ue.jsx(Hr.PiNotepad,{size:30,style:{cursor:"pointer"}})})]}),d&&!t?ue.jsx(De.Flex,{w:"100%",overflow:"auto",justifyContent:"start",background:s.highlightColor,p:10,fontSize:"5xl",lineHeight:"normal",cursor:"text",children:ue.jsx(De.Text,{whiteSpace:"pre-wrap",overflow:"hidden",textOverflow:"ellipsis",color:(x=a==null?void 0:a.viewProps)==null?void 0:x.textColor,children:d})}):ue.jsx(De.Box,{children:Object.entries(a.description||{}).map(([C,T],S)=>{var P,D;const _=In(s.wordBeforeDot)[typeof T],A=In(s.wordBeforeDot).property;return ue.jsxs(De.Box,{children:[ue.jsxs(De.Flex,{flexWrap:"nowrap",overflow:"hidden",children:[ue.jsx(De.Flex,{justifyContent:"start",align:"center",background:s.highlightColor,width:`${u}px`,minWidth:`${u}px`,borderRightColor:s.hexborderColor,borderRightWidth:1,children:ue.jsx(De.Text,{py:5,px:10,w:"100%",whiteSpace:"nowrap",fontWeight:"bold",fontSize:"4xl",color:((P=a==null?void 0:a.viewProps)==null?void 0:P.textColor)||A,children:C})}),ue.jsx(De.Flex,{flex:1,justifyContent:"start",overflow:"hidden",p:4,background:s.hexbgColor,w:600,maxH:200,children:ue.jsx(De.Text,{overflow:"hidden",py:3,px:4,whiteSpace:"normal",textOverflow:"ellipsis",fontSize:"4xl",color:((D=a==null?void 0:a.viewProps)==null?void 0:D.textColor)||_,fontWeight:400,children:vq(T)})})]}),S!==Object.entries(a.description||{}).length-1&&ue.jsx(De.Separator,{borderWidth:1,orientation:"horizontal",my:0,borderColor:s.hexborderColor})]},S)})})]})})}})},nR=r=>{const{themeColor:e}=Mn();return ue.jsx(ul,{...r,children:({data:t,isActive:n})=>{var o,s,l,u;const a=Q2(t,e),i=(s=(o=r.data)==null?void 0:o.config)==null?void 0:s.icon;return ue.jsx(De.Flex,{justifyContent:"space-between",...t==null?void 0:t.viewProps,direction:"column",p:0,borderRadius:((l=t==null?void 0:t.viewProps)==null?void 0:l.borderRadius)||15,overflow:"hidden",bgColor:a.bgColor,position:"absolute",top:0,left:0,right:0,bottom:0,alignItems:"center",style:{backgroundColor:a.hexbgColor,transition:"border-color 0.2s ease-in-out"},borderColor:n?"white":a.hexborderColor,_hover:{borderColor:"white"},borderWidth:3,children:t.headerTitle&&ue.jsxs(De.Flex,{justify:"flex-start",direction:"row",p:20,borderBottomWidth:1,minWidth:"max-content !important",width:"100%",textTransform:"capitalize",align:"center",alignItems:"center",fontWeight:"bold",color:a.propertyColor,bgColor:a.highlightColor,borderBottomColor:a.hexborderColor,children:[!!i&&ue.jsx(De.Box,{mr:8,justifyContent:"flex-start",height:"100%",w:50,alignItems:"center",rounded:"full",children:ue.jsx(Pm,{name:i,size:80,color:a.hextextColor},a.hextextColor)}),ue.jsx(De.Text,{fontSize:"5xl",lineClamp:2,textOverflow:"ellipsis",whiteSpace:"nowrap",color:(u=t==null?void 0:t.viewProps)==null?void 0:u.textColor,children:J2(t.headerTitle)})]})})}})};eR.displayName="text";rR.displayName="arrayView";tR.displayName="NodeJsonObjectView";nR.displayName="ParentContainerView";const gq={objectView:tR,arrayView:rR,text:eR,parentContainer:nR},pq=r=>[{selector:"node",style:{"outline-opacity":0,"background-opacity":0,"background-color":"transparent","border-color":"transparent",color:"transparent","border-opacity":0,"text-valign":"center","text-halign":"center","border-width":0,"outline-width":0,width:60,height:60}},{selector:"node:selected",style:{"overlay-opacity":0,"overlay-color":"transparent"}},{selector:"node:active",style:{"overlay-opacity":0,"overlay-color":"transparent"}},{selector:":parent",style:{shape:"round-rectangle","background-opacity":.4,"corner-radius":50,"line-color":r("light"),"background-color":r(),"border-color":r(),"border-width":6,"border-style":"solid","border-opacity":1,padding:"120px","text-valign":"top","font-size":"70px","font-weight":"bold","text-margin-y":90,"text-background-opacity":0,"text-background-padding":"45px","z-index":1e3,"compound-sizing-wrt-labels":"include",label:"data(label)"}},{selector:"edge",style:{width:6,label:"data(label)","z-index":-100,"control-point-step-size":10,"taxi-direction":"horizontal","curve-style":"round-taxi","edge-distances":"intersection","line-color":r("light"),color:r("light"),"text-rotation":"autorotate","target-arrow-color":r("light"),"source-arrow-color":r("light"),"target-arrow-shape":"triangle","arrow-scale":"3","text-background-color":r("dark"),"text-background-opacity":1,"text-background-padding":"15px","taxi-radius":500,"source-arrow-fill":"filled","target-arrow-fill":"filled","text-max-width":"200px","font-size":"45px","text-wrap":"wrap","text-margin-x":50,"transition-duration":"0.5s","source-endpoint":"outside-to-node","target-endpoint":"outside-to-node","source-distance-from-node":80,"target-distance-from-node":80}}],cc=(r,e,t,n)=>{if(!r)return{controlPointDistances:[0],controlPointWeights:[.5]};const a=r.edges().filter(u=>{const c=u.data();return c.source===e&&c.target===t||c.source===t&&c.target===e});if(a.length<=1)return{controlPointDistances:[0],controlPointWeights:[.5]};let i=0;a.forEach((u,c)=>{u.data().id===n&&(i=c)});const o=a.length;return{controlPointDistances:[(i-(o-1)/2)*60],controlPointWeights:[.5]}},yq=r=>{const n=1/(Math.cbrt(r)*.8);let a=Math.round(650*n),i=Math.round(350*n);return a=Math.max(40,Math.min(450,a)),i=Math.max(30,Math.min(300,i)),{edgeSep:a,rankSep:i}};function mq({cytoInstance:r,id:e,source:t,type:n,target:a,label:i,children:o,layout:s,styleCallback:l,isPerformanceMode:u}){const c=Te.useRef(null),d=Te.useRef(null),[h,g]=Te.useState(2);let p,E;function m(S){if(l){const _=l(S,t,a);p=_.hasOwnProperty("line-style"),E=_.hasOwnProperty("source-arrow-shape"),S.style(_)}}const b=Te.useCallback(()=>{if(!p||u)return;const S=r.getElementById(e);if(S.length===0)return;const D=Date.now()*.1%(20*50),I=E?D:-D;S.style("line-dash-offset",I),d.current=requestAnimationFrame(b)},[p,r,e,E,u]);function w(S){const _=cc(r,t,a,e),A=r.add({data:{...S,controlPointDistances:_.controlPointDistances,controlPointWeights:_.controlPointWeights}});m(A),p&&(d.current=requestAnimationFrame(b))}function x(S,_){let A=2;return r.getElementById(S).length===1&&(A-=1),r.getElementById(_).length===1&&(A-=1),A}if(Te.useEffect(()=>{if(x(t,a)===0){const _=r.getElementById(e);if(_.length===0){const A=cc(r,t,a,e),P=r.add({data:{id:e,source:t,target:a,label:i,type:n,controlPointDistances:A.controlPointDistances,controlPointWeights:A.controlPointWeights}});m(P),p&&(d.current=requestAnimationFrame(b))}else{const A=cc(r,t,a,e);_.data({source:t,target:a,label:i,type:n,controlPointDistances:A.controlPointDistances,controlPointWeights:A.controlPointWeights}),m(_)}}},[t,a,e,i,n,r,p,b]),Te.useEffect(()=>{function S(A){const P=A.target.id();if(P===t||P===a){const D=x(t,a);D!==h&&g(D),D===0&&w({id:e,source:t,target:a,label:i,type:n})}}function _(A){const P=A.target.id();if(P===t||P===a){const D=x(t,a);D!==h&&g(D),D>0&&(r.getElementById(e).remove(),d.current&&cancelAnimationFrame(d.current))}}return r.on("add","node",S),r.on("remove","node",_),p&&h===0&&(d.current=requestAnimationFrame(b)),()=>{r.getElementById(e).remove(),r.off("add","node",S),r.off("remove","node",_),d.current&&cancelAnimationFrame(d.current)}},[]),Te.useEffect(()=>(p&&h===0?d.current||(d.current=requestAnimationFrame(b)):!p&&d.current&&(cancelAnimationFrame(d.current),d.current=null),()=>{d.current&&cancelAnimationFrame(d.current)}),[p,h,b]),Te.useEffect(()=>{s()},[e,o]),Te.useEffect(()=>{if(!h){const S=r.getElementById(e);m(S)}},[l,h]),h>0)return null;function C(S){return Te.cloneElement(S,{cytoInstance:r,layout:s})}const T=Te.Children.map(o,C);return ue.jsx("div",{ref:c,className:"cytoscape-react-edge",children:T})}function lm(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,n=Array(e);t<e;t++)n[t]=r[t];return n}function bq(r){if(Array.isArray(r))return r}function wq(r){if(Array.isArray(r))return lm(r)}function La(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function xq(r,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(r,iR(n.key),n)}}function Oa(r,e,t){return e&&xq(r.prototype,e),Object.defineProperty(r,"prototype",{writable:!1}),r}function $t(r,e){var t=typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=Dm(r))||e){t&&(r=t);var n=0,a=function(){};return{s:a,n:function(){return n>=r.length?{done:!0}:{done:!1,value:r[n++]}},e:function(l){throw l},f:a}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
1
+ "use strict";var JO=Object.create;var F1=Object.defineProperty;var eq=Object.getOwnPropertyDescriptor;var rq=Object.getOwnPropertyNames;var tq=Object.getPrototypeOf,nq=Object.prototype.hasOwnProperty;var aq=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of rq(e))!nq.call(r,a)&&a!==t&&F1(r,a,{get:()=>e[a],enumerable:!(n=eq(e,a))||n.enumerable});return r};var Rr=(r,e,t)=>(t=r!=null?JO(tq(r)):{},aq(e||!r||!r.__esModule?F1(t,"default",{value:r,enumerable:!0}):t,r));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ue=require("react/jsx-runtime"),De=require("@chakra-ui/react"),Te=require("react"),Hr=require("react-icons/pi"),iq=require("react-icons/hi2"),oq=require("react-icons/gr"),fc=require("react-icons/vsc"),sq=require("react-icons/tb"),z1=require("react-icons/io5"),j2=Te.createContext(null);function Mn(){const r=Te.useContext(j2);if(!r)throw new Error("useFlowDiagramContext must be used within FlowDiagram");return r}function uq({config:r,callbacks:e,children:t}){const n=Te.useRef(null),[a,i]=Te.useState([]),[o,s]=Te.useState(null),[l,u]=Te.useState(!0),[c,d]=Te.useState(!1),[h,g]=Te.useState(!0),[p,E]=Te.useState(r.edgeHandles===!0),[m,b]=Te.useState(!1),[w,x]=Te.useState(!0),[C,T]=Te.useState(!1),S=Te.useRef(e);S.current=e;const _=Te.useMemo(()=>{const Y=K=>(...ee)=>{var le,G;return(G=(le=S.current)==null?void 0:le[K])==null?void 0:G.call(le,...ee)};return{onNodeSelect:Y("onNodeSelect"),onNodeDeselect:Y("onNodeDeselect"),onNodeDoubleClick:Y("onNodeDoubleClick"),onNodeCreate:Y("onNodeCreate"),onNodeDelete:Y("onNodeDelete"),onNodeLabelChange:Y("onNodeLabelChange"),onNodeCollapse:Y("onNodeCollapse"),onNodeColorChange:Y("onNodeColorChange"),onNodeIconChange:Y("onNodeIconChange"),onNodeHoverAction:Y("onNodeHoverAction"),onEdgeCreate:Y("onEdgeCreate"),onEdgeSelect:Y("onEdgeSelect"),onEdgeDeselect:Y("onEdgeDeselect"),onEdgeRemove:Y("onEdgeRemove"),onEdgeColorChange:Y("onEdgeColorChange"),onEdgeLabelChange:Y("onEdgeLabelChange"),onEdgeStyleChange:Y("onEdgeStyleChange"),onViewportChange:Y("onViewportChange"),onDirectionChange:Y("onDirectionChange"),onArrayModeChange:Y("onArrayModeChange"),onCyInit:Y("onCyInit")}},[]),A=r.themeColor||"blue.500",P=r.edgeColor||"",D=r.colorMode||"light",I=r.direction||"LR",M=r.readOnly??!1,k=r.isZoomMode!==void 0?r.isZoomMode:l,N=r.isMultiSelectMode!==void 0?r.isMultiSelectMode:c,z=r.isEdgeHandlesEnabled!==void 0?r.isEdgeHandlesEnabled:p,W=r.isDragMode!==void 0?r.isDragMode:h,q=Te.useRef(r);q.current=r;const $=Te.useMemo(()=>({get direction(){return q.current.direction},get themeColor(){return q.current.themeColor},get colorMode(){return q.current.colorMode},get readOnly(){return q.current.readOnly},get editable(){return q.current.editable},get minZoom(){return q.current.minZoom},get maxZoom(){return q.current.maxZoom},get backgroundPattern(){return q.current.backgroundPattern},get edgeColor(){return q.current.edgeColor},get backgroundColor(){return q.current.backgroundColor},get edgeHandles(){return q.current.edgeHandles},get initialViewport(){return q.current.initialViewport},get nodeOverlayActions(){return q.current.nodeOverlayActions},get renderNodeOverlay(){return q.current.renderNodeOverlay},get renderSelectedNodeToolbar(){return q.current.renderSelectedNodeToolbar},get renderSelectedEdgeToolbar(){return q.current.renderSelectedEdgeToolbar},get renderBottomBar(){return q.current.renderBottomBar},get customViews(){return q.current.customViews},get disableKeyboardShortcuts(){return q.current.disableKeyboardShortcuts},get isZoomMode(){return q.current.isZoomMode},get isMultiSelectMode(){return q.current.isMultiSelectMode},get isEdgeHandlesEnabled(){return q.current.isEdgeHandlesEnabled},get isDragMode(){return q.current.isDragMode}}),[]),X=Te.useMemo(()=>({themeColor:A,edgeColor:P,colorMode:D,direction:I,selectedNodeIds:a,setSelectedNodeIds:i,selectedEdgeId:o,setSelectedEdgeId:s,isZoomMode:k,setIsZoomMode:u,isMultiSelectMode:N,setIsMultiSelectMode:d,isDragMode:W,setIsDragMode:g,isEdgeHandlesEnabled:z,setIsEdgeHandlesEnabled:E,isArrayNodeMode:m,setIsArrayNodeMode:b,isPinned:w,setIsPinned:x,isPerformanceMode:C,setIsPerformanceMode:T,cyRef:n,callbacks:_,config:$,readOnly:M}),[A,P,D,I,a,o,k,N,W,z,m,w,C,M,_,$]);return ue.jsx(j2.Provider,{value:X,children:t})}const lq=({children:r,pattern:e="dot",backgroundColor:t})=>{const{colorMode:n}=Mn(),a=n==="dark",i=a?"--chakra-colors-gray-700":"--chakra-colors-gray-500",o=a?"--chakra-colors-gray-700":"--chakra-colors-gray-800";return e==="none"?ue.jsx(De.Box,{width:"100%",height:"100%",padding:0,bg:t,children:r}):ue.jsxs(De.Box,{position:"relative",width:"100%",height:"100%",padding:0,bg:t,children:[ue.jsx(De.Box,{position:"absolute",top:0,left:0,right:0,bottom:0,width:"100%",height:"100%",zIndex:0,pointerEvents:"none",style:{backgroundImage:e==="dot"?`radial-gradient(var(${i}) 8%, transparent 8%)`:e==="steel"?`repeating-linear-gradient(45deg, var(${o}) 0, var(${o}) 1px, transparent 1px, transparent 20px)`:`linear-gradient(var(${o}) 1px, transparent 1px), linear-gradient(90deg, var(${o}) 1px, transparent 1px)`,backgroundSize:"20px 20px",opacity:.3}}),ue.jsx(De.Box,{position:"relative",width:"100%",height:"100%",zIndex:1,padding:0,children:r})]})};function Uu(r,e=.2){const t=r.replace(/^#/,""),n=parseInt(t,16);let a=n>>16&255,i=n>>8&255,o=n&255;return a=Math.max(0,Math.floor(a*(1-e))),i=Math.max(0,Math.floor(i*(1-e))),o=Math.max(0,Math.floor(o*(1-e))),"#"+((1<<24)+(a<<16)+(i<<8)+o).toString(16).slice(1).toUpperCase()}const In=r=>r!=null&&r.startsWith("#")?{background:r,highlight:Uu(r,.1),border:Uu(r,.5),property:"gray.900",boolean:"green.200",string:"gray.900",number:"orange.800"}:r==="gray"?{background:"gray.950",highlight:"gray.800",border:"gray.700",property:"gray.200",boolean:"green.400",string:"gray.200",number:"orange.600"}:r==="white"?{background:"white",highlight:"gray.200",border:"gray.400",property:"gray.900",boolean:"green.400",string:"gray.900",number:"orange.600"}:{background:r+".100",highlight:r+".200",border:r+".700",property:"gray.900",boolean:"green.800",string:"gray.900",number:"orange.800"},Y2=r=>{let e=r;if(e!=null&&e.startsWith("#"))return{secondary:Uu(r)};let t=String(Number(r.slice(-3))+200);t=r.slice(0,-3).concat(t);let n=String(Number(r.slice(-3))-100);return n=r.slice(0,-3).concat(n),{primary:e,secondary:t,light:n}},$1={red:{50:"#FFF5F5",100:"#FED7D7",200:"#FEB2B2",300:"#FC8181",400:"#F56565",500:"#E53E3E",600:"#C53030",700:"#9B2C2C",800:"#822727",900:"#63171B"},orange:{50:"#FFFAF0",100:"#FEEBC8",200:"#FBD38D",300:"#F6AD55",400:"#ED8936",500:"#DD6B20",600:"#C05621",700:"#9C4221",800:"#7B341E",900:"#652B19"},yellow:{50:"#FFFFF0",100:"#FEFCBF",200:"#FAF089",300:"#F6E05E",400:"#ECC94B",500:"#D69E2E",600:"#B7791F",700:"#975A16",800:"#744210",900:"#5F370E"},green:{50:"#F0FFF4",100:"#C6F6D5",200:"#9AE6B4",300:"#68D391",400:"#48BB78",500:"#38A169",600:"#2F855A",700:"#276749",800:"#22543D",900:"#1C4532"},teal:{50:"#E6FFFA",100:"#B2F5EA",200:"#81E6D9",300:"#4FD1C5",400:"#38B2AC",500:"#319795",600:"#2C7A7B",700:"#285E61",800:"#234E52",900:"#1D4044"},blue:{50:"#EBF8FF",100:"#BEE3F8",200:"#90CDF4",300:"#63B3ED",400:"#4299E1",500:"#3182CE",600:"#2B6CB0",700:"#2C5282",800:"#2A4365",900:"#1A365D"},cyan:{50:"#EDFDFD",100:"#C4F1F9",200:"#9DECF9",300:"#76E4F7",400:"#0BC5EA",500:"#00B5D8",600:"#00A3C4",700:"#0987A0",800:"#086F83",900:"#065666"},purple:{50:"#FAF5FF",100:"#E9D8FD",200:"#D6BCFA",300:"#B794F4",400:"#9F7AEA",500:"#805AD5",600:"#6B46C1",700:"#553C9A",800:"#44337A",900:"#322659"},pink:{50:"#FFF5F7",100:"#FED7E2",200:"#FBB6CE",300:"#F687B3",400:"#ED64A6",500:"#D53F8C",600:"#B83280",700:"#97266D",800:"#702459",900:"#521B41"},gray:{50:"#F7FAFC",100:"#EDF2F7",200:"#E2E8F0",300:"#CBD5E0",400:"#A0AEC0",500:"#718096",600:"#4A5568",700:"#2D3748",800:"#1A202C",900:"#171923",950:"#0d1117"}},ht=(r,e)=>{var i;if(r!=null&&r.startsWith("#"))return r;if(!r)return"whitesmoke";const t=r.replace(/\./g,"-");try{const s=getComputedStyle(document.documentElement).getPropertyValue(`--chakra-colors-${t}`).trim();if(s&&s!=="")return s}catch{}const[n,a]=r.split(".");return n&&a&&((i=$1[n])!=null&&i[Number(a)])?$1[n][Number(a)]:`var(--chakra-colors-${t})`};function Et(r,e,t){return r?t:e}function cs(r){const[e]=(r==null?void 0:r.split("."))||[],{secondary:t}=Y2(r),n=In(e).background,a=In(e).highlight,i=In(e).border,o=In(e).property,s=In(e).property;let l=In(e).background,u=In(e).highlight;return l=ht(l)+50,u=ht(u)+20,{bgColor:n,highlightColor:a,borderColor:i,textColor:o,propertyColor:s,secondary:t,bgColorFaint:l,highlightColorFaint:u}}function ds(r=null){const{colorMode:e}=Mn(),t=r==null?void 0:r.includes("gray"),n=e==="dark",a=Et(n,"gray.100","gray.900"),i=Et(n,"gray.200","blackAlpha.400"),o=Et(n,"gray.200","blackAlpha.600"),s=Et(n,"gray.500","gray.800"),l=Et(n,"gray.700","gray.700"),u=Et(n,"gray.900","gray.900"),c=Et(n,"gray.400","gray.500"),d=Et(n,"gray.400","gray.700"),h=Et(n,"gray.900","gray.200"),g=Et(n,t?"gray.900":"gray.200",t?"gray.200":"gray.900"),p=Et(n,"gray.900","gray.200"),E=Et(n,r&&"#000000",r||"#ffffff"),m=Et(n,r||"#ffffff",r?"#000000":"#ffffff"),b=l,w=Et(n,"gray.300","gray.800"),x=Et(n,"white","blackAlpha.400"),C=Et(n,"green.100","green.700");return{background:a,backgroundSecondary:i,darkBackgroundSecondary:o,border:s,darkColor:u,backgroundWhiteColor:x,borderSecondary:l,colorActive:c,colorInactive:d,iconColor:p,moreIconColor:b,colorText:h,themedColorText:g,logoColor:E,logoColorSecondary:m,darkColorActive:w,greenColor:C}}const V1=({icon:r,label:e,onClick:t,color:n,boxSize:a=6,...i})=>{const{background:o,border:s,colorText:l}=ds();return ue.jsxs(De.Tooltip.Root,{positioning:{placement:i.placement||"top"},children:[ue.jsx(De.Tooltip.Trigger,{asChild:!0,children:ue.jsx(De.Flex,{children:ue.jsx(De.Icon,{as:r,boxSize:a,color:n,cursor:t?"pointer":void 0,onClick:t})})}),ue.jsx(De.Tooltip.Positioner,{children:ue.jsx(De.Tooltip.Content,{bgColor:i.bgColor||o,borderColor:i.borderColor||s,borderWidth:1,color:i.textColor||l,borderRadius:15,fontWeight:300,fontSize:"sm",p:2,px:4,shadow:"none",children:e})})]})},fq=({data:r,children:e,isInverted:t,isParent:n})=>{var z,W;const{selectedNodeIds:a,setSelectedNodeIds:i,isMultiSelectMode:o,isPerformanceMode:s,cyRef:l,callbacks:u,config:c,themeColor:d,direction:h}=Mn(),{background:g,border:p,colorText:E}=ds(),m=Te.useRef(null),b=Te.useRef(null),[w,x]=Te.useState(!1),[C,T]=Te.useState(!1),S=r==null?void 0:r.id,_=a.includes(S),A=c.nodeOverlayActions,P=c.renderNodeOverlay,D=(()=>{var q;try{const $=(q=l.current)==null?void 0:q.zoom();return $!==void 0&&$<.08}catch{return!1}})(),I=Te.useCallback(()=>{var q,$,X;if(!C)if(o){const Y=a.includes(S),K=Y?a.filter(ee=>ee!==S):[...a,S];i(K),Y?(q=u.onNodeDeselect)==null||q.call(u):($=u.onNodeSelect)==null||$.call(u,S,r)}else i([S]),(X=u.onNodeSelect)==null||X.call(u,S,r)},[S,r,a,o,C,i,u]),M=Te.useCallback(()=>{var q;C||(q=u.onNodeDoubleClick)==null||q.call(u,S,r)},[S,r,C,u]),k=Te.useCallback(()=>{b.current&&clearTimeout(b.current),b.current=setTimeout(()=>x(!0),100)},[]),N=Te.useCallback(()=>{b.current&&clearTimeout(b.current),x(!1)},[]);return n?ue.jsxs(De.Box,{ref:m,onClick:I,onDoubleClick:M,onMouseEnter:k,onMouseLeave:N,cursor:"pointer",position:"relative",children:[!s&&(P||A&&A.length>0)&&w&&!D&&ue.jsxs(ue.Fragment,{children:[ue.jsx(De.Box,{position:"absolute",top:-150,left:"0",right:"0",height:"150px",pointerEvents:"auto",onMouseEnter:()=>x(!0),onMouseLeave:N}),P?ue.jsx(De.Box,{position:"absolute",zIndex:1e3,top:"-100px",left:"50%",pointerEvents:"auto",transform:"translateX(-50%) scale3d(3, 3, 1)",onMouseEnter:()=>x(!0),onMouseLeave:N,willChange:"transform",children:P({nodeId:S,nodeData:r,isRoot:S==="root",isParent:!0,isHovered:w,setIsHovered:x})}):ue.jsx(De.Box,{position:"absolute",zIndex:1e3,top:"-100px",left:"50%",bg:g,p:3,borderColor:p,borderWidth:1,borderRadius:15,pointerEvents:"auto",transform:"translateX(-50%) scale3d(3, 3, 1)",boxShadow:"lg",onMouseEnter:()=>x(!0),onMouseLeave:N,willChange:"transform",children:ue.jsx(De.HStack,{px:2,gap:2,children:A.map((q,$)=>ue.jsxs(De.Box,{display:"contents",children:[$>0&&ue.jsx(De.Box,{borderColor:p,height:5,borderRightWidth:1}),ue.jsx(V1,{icon:q.icon,label:q.label,color:E,bgColor:g,borderColor:p,textColor:E,boxSize:5,onClick:X=>{var Y;X.stopPropagation(),(Y=u.onNodeHoverAction)==null||Y.call(u,q.id,S,r)}})]},q.id))})})]}),e({id:S,data:r,isActive:_,isLowZoom:D,isEditing:C,onEditStart:()=>T(!0),onEditEnd:()=>T(!1)}),((z=r==null?void 0:r.config)==null?void 0:z.collapsed)!==void 0&&(()=>{var X;const q=h==="TB"||h==="BT",$=t||h==="RL";return ue.jsx(De.IconButton,{position:"absolute",...q?{[h==="BT"?"top":"bottom"]:"-75px",left:"50%",transform:"translateX(-50%)"}:{right:$?void 0:"-75px",left:$?"-75px":void 0,top:"50%",transform:"translateY(-50%)"},"aria-label":r.config.collapsed?"Expand":"Collapse",onClick:Y=>{var K;Y.stopPropagation(),(K=u.onNodeCollapse)==null||K.call(u,S,!r.config.collapsed)},bgColor:ht(((X=r==null?void 0:r.viewProps)==null?void 0:X.bgColor)||d),size:"md",color:"gray.100",rounded:"full",mr:2,px:2,py:4,children:r.config.collapsed?ue.jsx(Hr.PiPlusBold,{size:30,color:"gray.800"}):ue.jsx(Hr.PiMinusBold,{size:30,color:"gray.800"})})})()]}):ue.jsxs(De.Box,{ref:m,onClick:I,onDoubleClick:M,onMouseEnter:k,onMouseLeave:N,cursor:"pointer",transition:"transform 0.1s ease",position:"relative",children:[!s&&(P||A&&A.length>0)&&w&&!D&&ue.jsxs(ue.Fragment,{children:[ue.jsx(De.Box,{position:"absolute",top:-150,left:"0",right:"0",height:"150px",pointerEvents:"auto",onMouseEnter:()=>x(!0),onMouseLeave:N}),P?ue.jsx(De.Box,{position:"absolute",zIndex:1e3,top:"-100px",left:"50%",pointerEvents:"auto",transform:"translateX(-50%) scale3d(3, 3, 1)",onMouseEnter:()=>x(!0),onMouseLeave:N,willChange:"transform",children:P({nodeId:S,nodeData:r,isRoot:S==="root",isParent:!!n,isHovered:w,setIsHovered:x})}):ue.jsx(De.Box,{position:"absolute",zIndex:1e3,top:"-100px",left:"50%",bg:g,p:3,borderColor:p,borderWidth:1,borderRadius:15,pointerEvents:"auto",transform:"translateX(-50%) scale3d(3, 3, 1)",boxShadow:"lg",onMouseEnter:()=>x(!0),onMouseLeave:N,willChange:"transform",children:ue.jsx(De.HStack,{px:2,gap:2,children:A.map((q,$)=>ue.jsxs(De.Box,{display:"contents",children:[$>0&&ue.jsx(De.Box,{borderColor:p,height:5,borderRightWidth:1}),ue.jsx(V1,{icon:q.icon,label:q.label,color:E,bgColor:g,borderColor:p,textColor:E,boxSize:5,onClick:X=>{var Y;X.stopPropagation(),(Y=u.onNodeHoverAction)==null||Y.call(u,q.id,S,r)}})]},q.id))})})]}),ue.jsxs(De.Box,{position:"relative",display:"flex",h:"100%",w:"100%",children:[((W=r==null?void 0:r.config)==null?void 0:W.collapsed)!==void 0&&!n&&(()=>{var X;const q=h==="TB"||h==="BT",$=t||h==="RL";return ue.jsx(De.IconButton,{position:"absolute",...q?{[h==="BT"?"top":"bottom"]:"-75px",left:"50%",transform:"translateX(-50%)"}:{right:$?void 0:"-75px",left:$?"-75px":void 0,alignSelf:"center"},"aria-label":r.config.collapsed?"Expand":"Collapse",onClick:Y=>{var K;Y.stopPropagation(),(K=u.onNodeCollapse)==null||K.call(u,S,!r.config.collapsed)},bgColor:ht(((X=r==null?void 0:r.viewProps)==null?void 0:X.bgColor)||d),size:"md",color:"gray.100",rounded:"full",mr:2,px:2,py:4,children:r.config.collapsed?ue.jsx(Hr.PiPlusBold,{size:30,color:"gray.800"}):ue.jsx(Hr.PiMinusBold,{size:30,color:"gray.800"})})})(),e({id:S,data:r,isActive:_,isLowZoom:D,isEditing:C,onEditStart:()=>T(!0),onEditEnd:()=>T(!1)})]})]})},ul=Te.memo(fq);function Z2(r=!0){const e=Te.useRef(null);return Te.useEffect(()=>{if(!r||!e.current)return;const t=i=>{i.stopPropagation(),i.stopImmediatePropagation()},n=e.current,a=["mousedown","mouseup","click","pointerdown","pointerup","keydown","keyup","keypress","input","focus"];return a.forEach(i=>n.addEventListener(i,t,!0)),()=>{a.forEach(i=>n.removeEventListener(i,t,!0))}},[r]),e}const X2=({nodeId:r,label:e,color:t,fontWeight:n="bold",fontSize:a="5xl",isEditing:i,onEditStart:o,onEditEnd:s})=>{const{callbacks:l,config:u,readOnly:c}=Mn(),d=u.editable&&!c,[h,g]=Te.useState(e),p=Te.useRef(null),E=Te.useRef(!1),m=Z2(i);Te.useEffect(()=>{i&&(E.current=!1,p.current&&(p.current.focus(),p.current.select()))},[i]);const b=()=>{var x;if(E.current)return;E.current=!0;const w=h.trim();w&&w!==e&&((x=l.onNodeLabelChange)==null||x.call(l,r,w)),s()};return!d||!i?ue.jsx(De.Text,{color:t,fontWeight:n,fontSize:a,onDoubleClick:d?w=>{w.stopPropagation(),g(e),o()}:void 0,cursor:d?"text":void 0,children:e}):ue.jsx("div",{ref:m,children:ue.jsx(De.Input,{ref:p,value:h,onChange:w=>g(w.target.value),onBlur:b,onKeyDown:w=>{w.key==="Enter"&&b(),w.key==="Escape"&&s()},color:t,fontWeight:n,fontSize:a,bg:"transparent",borderWidth:0,p:0,h:"auto",lineHeight:"normal"})})},cq=({id:r,data:e,isActive:t,isEditing:n,onEditStart:a,onEditEnd:i})=>{var d,h,g;const{themeColor:o}=Mn(),{bgColor:s,borderColor:l,textColor:u}=cs(((d=e==null?void 0:e.viewProps)==null?void 0:d.bgColor)||o),c=ht(((h=e==null?void 0:e.viewProps)==null?void 0:h.textColor)||u);return ue.jsx(De.Box,{borderRadius:(g=e==null?void 0:e.viewProps)==null?void 0:g.borderRadius,bgColor:s,borderColor:t?"white":l,_hover:{borderColor:"white"},borderWidth:2,py:14,px:20,whiteSpace:"normal",children:ue.jsx(De.Flex,{justifyContent:"start",w:900,fontSize:"5xl",lineHeight:"normal",children:ue.jsx(X2,{nodeId:r,label:(e==null?void 0:e.label)||(e==null?void 0:e.text)||"",color:c,isEditing:n,onEditStart:a,onEditEnd:i})})})},dq=({id:r,isActive:e,data:t,isEditing:n,onEditStart:a,onEditEnd:i})=>{var p,E,m,b;const{themeColor:o}=Mn(),s=((p=t==null?void 0:t.viewProps)==null?void 0:p.bgColor)||o,{borderColor:l,highlightColor:u,textColor:c}=cs(s),d=ht(((E=t==null?void 0:t.viewProps)==null?void 0:E.textColor)||c),h=ht(((m=t==null?void 0:t.viewProps)==null?void 0:m.borderColor)||l),g=s!=null&&s.startsWith("#")?s:ht(u);return ue.jsx(De.Flex,{align:"center",borderRadius:(b=t==null?void 0:t.viewProps)==null?void 0:b.borderRadius,bgColor:g,style:{backgroundColor:g},textTransform:"capitalize",borderColor:e?"white":h,_hover:{borderColor:"white"},borderWidth:2,px:50,whiteSpace:"nowrap",children:ue.jsx(De.Flex,{justifyContent:"start",py:14,fontSize:"5xl",lineHeight:"normal",w:900,children:ue.jsx(X2,{nodeId:r,label:(t==null?void 0:t.label)||(t==null?void 0:t.text)||"",color:d,isEditing:n,onEditStart:a,onEditEnd:i})})})},Pm=({name:r,...e})=>{const[t,n]=Te.useState(null),[a,i]=Te.useState(!0),[o,s]=Te.useState(!1);return Te.useEffect(()=>{if(!r||r.length<2){n(null),i(!1);return}i(!0),s(!1),(async()=>{try{let u;if(r.startsWith("Md"))u="md";else if(r.startsWith("Fa"))u="fa6";else if(r.startsWith("Io5"))u="io5";else if(r.startsWith("Io"))u="io";else if(r.startsWith("Ti"))u="ti";else if(r.startsWith("Go"))u="go";else if(r.startsWith("Fi"))u="fi";else if(r.startsWith("Di"))u="di";else if(r.startsWith("Ai"))u="ai";else if(r.startsWith("Bs"))u="bs";else if(r.startsWith("Ri"))u="ri";else if(r.startsWith("Fc"))u="fc";else if(r.startsWith("Gi"))u="gi";else if(r.startsWith("Hi2"))u="hi2";else if(r.startsWith("Hi"))u="hi";else if(r.startsWith("Si"))u="si";else if(r.startsWith("Sl"))u="sl";else if(r.startsWith("Im"))u="im";else if(r.startsWith("Bi"))u="bi";else if(r.startsWith("Pi"))u="pi";else if(r.startsWith("Vsc"))u="vsc";else if(r.startsWith("Tb"))u="tb";else if(r.startsWith("Tfi"))u="tfi";else if(r.startsWith("Cg"))u="cg";else if(r.startsWith("Lia"))u="lia";else if(r.startsWith("Lu"))u="lu";else throw new Error(`Unknown library prefix for icon: ${r}`);let c;switch(u){case"md":c=await import("react-icons/md");break;case"fa6":c=await import("react-icons/fa6");break;case"io5":c=await import("react-icons/io5");break;case"io":c=await import("react-icons/io");break;case"ti":c=await import("react-icons/ti");break;case"go":c=await import("react-icons/go");break;case"fi":c=await import("react-icons/fi");break;case"di":c=await import("react-icons/di");break;case"ai":c=await import("react-icons/ai");break;case"bs":c=await import("react-icons/bs");break;case"ri":c=await import("react-icons/ri");break;case"fc":c=await import("react-icons/fc");break;case"gi":c=await import("react-icons/gi");break;case"hi2":c=await import("react-icons/hi2");break;case"hi":c=await import("react-icons/hi");break;case"si":c=await import("react-icons/si");break;case"sl":c=await import("react-icons/sl");break;case"im":c=await import("react-icons/im");break;case"bi":c=await import("react-icons/bi");break;case"pi":c=await import("react-icons/pi");break;case"vsc":c=await import("react-icons/vsc");break;case"tb":c=await import("react-icons/tb");break;case"tfi":c=await import("react-icons/tfi");break;case"cg":c=await import("react-icons/cg");break;case"lia":c=await import("react-icons/lia");break;case"lu":c=await import("react-icons/lu");break;default:throw new Error(`Unsupported library: ${u}`)}const d=c[r];if(!d)throw new Error(`Icon ${r} not found in library ${u}`);n(()=>d)}catch(u){console.warn(`Failed to load icon ${r}:`,u.message),s(!0),n(null)}finally{i(!1)}})()},[r]),a||!t?null:ue.jsx(t,{...e})},Q2=(r,e)=>{var l,u,c;const t=((l=r==null?void 0:r.viewProps)==null?void 0:l.bgColor)||e,[n]=t.split("."),a=cs(t),i=t!=null&&t.startsWith("#")?ht(t):ht(a.bgColor),o=ht(((u=r==null?void 0:r.viewProps)==null?void 0:u.textColor)||a.textColor),s=ht(((c=r==null?void 0:r.viewProps)==null?void 0:c.borderColor)||a.borderColor);return{...a,bg:t,wordBeforeDot:n,hexbgColor:i,hextextColor:o,hexborderColor:s}},vq=(r,e=350)=>`${String(r).substring(0,e)}${String(r).length>e?"...":""}`,J2=r=>r!=null&&r.includes("root")?r.replace("root","untitled"):r,hq=r=>{const e=Math.max(...Object.keys(r||{}).map(n=>n.length),0);return Math.max(e*28+30,200)},eR=r=>ue.jsx(ul,{...r,children:e=>ue.jsx(cq,{...e})}),rR=r=>ue.jsx(ul,{...r,children:e=>ue.jsx(dq,{...e})}),tR=r=>{const{themeColor:e}=Mn(),[t,n]=Te.useState(!1);return ue.jsx(ul,{...r,children:({data:a,isActive:i,isLowZoom:o})=>{var h,g,p,E,m,b,w,x;const s=Q2(a,e),l=Object.entries(a.description||{}).length>0,u=hq(a.description),c=(g=(h=r.data)==null?void 0:h.config)==null?void 0:g.icon,d=(E=(p=r.data)==null?void 0:p.config)==null?void 0:E.content;return ue.jsx(De.Flex,{justifyContent:"space-between",...a==null?void 0:a.viewProps,direction:"column",p:0,borderRadius:(m=a==null?void 0:a.viewProps)==null?void 0:m.borderRadius,overflow:"hidden",alignItems:"center",style:{backgroundColor:s.hexbgColor,transition:"border-color 0.2s ease-in-out"},width:"100%",borderColor:i?"white":s.hexborderColor,_hover:{borderColor:"white"},borderWidth:3,children:ue.jsxs(De.Flex,{width:"100%",direction:"column",borderRadius:(b=a==null?void 0:a.viewProps)==null?void 0:b.borderRadius,borderColor:s.hexborderColor,borderWidth:0,overflow:"hidden",children:[a.headerTitle&&ue.jsxs(De.Flex,{justify:"flex-start",direction:"row",p:Object.entries(a.description||{}).length?8:20,borderBottomWidth:1,minWidth:"max-content !important",width:"100%",textTransform:"capitalize",align:d?"left":"center",textOverflow:"ellipsis",alignItems:"center",fontWeight:"bold",color:s.propertyColor,bgColor:s.highlightColor,borderBottomColor:!l&&!d?"transparent":s.hexborderColor,children:[!!c&&ue.jsx(De.Box,{mr:8,justifyContent:"flex-start",height:"100%",w:50,alignItems:"center",rounded:"full",children:ue.jsx(Pm,{name:c,size:80,color:s.hextextColor},s.hextextColor)}),ue.jsx(De.Text,{fontSize:"5xl",lineClamp:2,textOverflow:"ellipsis",whiteSpace:"nowrap",color:(w=a==null?void 0:a.viewProps)==null?void 0:w.textColor,children:J2(a.headerTitle)}),!!d&&ue.jsx(De.Box,{ml:10,onClick:()=>n(!t),children:t?ue.jsx(Hr.PiGear,{size:30,style:{cursor:"pointer"}}):ue.jsx(Hr.PiNotepad,{size:30,style:{cursor:"pointer"}})})]}),d&&!t?ue.jsx(De.Flex,{w:"100%",overflow:"auto",justifyContent:"start",background:s.highlightColor,p:10,fontSize:"5xl",lineHeight:"normal",cursor:"text",children:ue.jsx(De.Text,{whiteSpace:"pre-wrap",overflow:"hidden",textOverflow:"ellipsis",color:(x=a==null?void 0:a.viewProps)==null?void 0:x.textColor,children:d})}):ue.jsx(De.Box,{children:Object.entries(a.description||{}).map(([C,T],S)=>{var P,D;const _=In(s.wordBeforeDot)[typeof T],A=In(s.wordBeforeDot).property;return ue.jsxs(De.Box,{children:[ue.jsxs(De.Flex,{flexWrap:"nowrap",overflow:"hidden",children:[ue.jsx(De.Flex,{justifyContent:"start",align:"center",background:s.highlightColor,width:`${u}px`,minWidth:`${u}px`,borderRightColor:s.hexborderColor,borderRightWidth:1,children:ue.jsx(De.Text,{py:5,px:10,w:"100%",whiteSpace:"nowrap",fontWeight:"bold",fontSize:"4xl",color:((P=a==null?void 0:a.viewProps)==null?void 0:P.textColor)||A,children:C})}),ue.jsx(De.Flex,{flex:1,justifyContent:"start",overflow:"hidden",p:4,background:s.hexbgColor,w:600,maxH:200,children:ue.jsx(De.Text,{overflow:"hidden",py:3,px:4,whiteSpace:"normal",textOverflow:"ellipsis",fontSize:"4xl",color:((D=a==null?void 0:a.viewProps)==null?void 0:D.textColor)||_,fontWeight:400,children:vq(T)})})]}),S!==Object.entries(a.description||{}).length-1&&ue.jsx(De.Box,{borderTopWidth:1,my:0,borderColor:s.hexborderColor})]},S)})})]})})}})},nR=r=>{const{themeColor:e}=Mn();return ue.jsx(ul,{...r,children:({data:t,isActive:n})=>{var o,s,l,u;const a=Q2(t,e),i=(s=(o=r.data)==null?void 0:o.config)==null?void 0:s.icon;return ue.jsx(De.Flex,{justifyContent:"space-between",...t==null?void 0:t.viewProps,direction:"column",p:0,borderRadius:((l=t==null?void 0:t.viewProps)==null?void 0:l.borderRadius)||15,overflow:"hidden",bgColor:a.bgColor,position:"absolute",top:0,left:0,right:0,bottom:0,alignItems:"center",style:{backgroundColor:a.hexbgColor,transition:"border-color 0.2s ease-in-out"},borderColor:n?"white":a.hexborderColor,_hover:{borderColor:"white"},borderWidth:3,children:t.headerTitle&&ue.jsxs(De.Flex,{justify:"flex-start",direction:"row",p:20,borderBottomWidth:1,minWidth:"max-content !important",width:"100%",textTransform:"capitalize",align:"center",alignItems:"center",fontWeight:"bold",color:a.propertyColor,bgColor:a.highlightColor,borderBottomColor:a.hexborderColor,children:[!!i&&ue.jsx(De.Box,{mr:8,justifyContent:"flex-start",height:"100%",w:50,alignItems:"center",rounded:"full",children:ue.jsx(Pm,{name:i,size:80,color:a.hextextColor},a.hextextColor)}),ue.jsx(De.Text,{fontSize:"5xl",lineClamp:2,textOverflow:"ellipsis",whiteSpace:"nowrap",color:(u=t==null?void 0:t.viewProps)==null?void 0:u.textColor,children:J2(t.headerTitle)})]})})}})};eR.displayName="text";rR.displayName="arrayView";tR.displayName="NodeJsonObjectView";nR.displayName="ParentContainerView";const gq={objectView:tR,arrayView:rR,text:eR,parentContainer:nR},pq=r=>[{selector:"node",style:{"outline-opacity":0,"background-opacity":0,"background-color":"transparent","border-color":"transparent",color:"transparent","border-opacity":0,"text-valign":"center","text-halign":"center","border-width":0,"outline-width":0,width:60,height:60}},{selector:"node:selected",style:{"overlay-opacity":0,"overlay-color":"transparent"}},{selector:"node:active",style:{"overlay-opacity":0,"overlay-color":"transparent"}},{selector:":parent",style:{shape:"round-rectangle","background-opacity":.4,"corner-radius":50,"line-color":r("light"),"background-color":r(),"border-color":r(),"border-width":6,"border-style":"solid","border-opacity":1,padding:"120px","text-valign":"top","font-size":"70px","font-weight":"bold","text-margin-y":90,"text-background-opacity":0,"text-background-padding":"45px","z-index":1e3,"compound-sizing-wrt-labels":"include",label:"data(label)"}},{selector:"edge",style:{width:6,label:"data(label)","z-index":-100,"control-point-step-size":10,"taxi-direction":"horizontal","curve-style":"round-taxi","edge-distances":"intersection","line-color":r("light"),color:r("light"),"text-rotation":"autorotate","target-arrow-color":r("light"),"source-arrow-color":r("light"),"target-arrow-shape":"triangle","arrow-scale":"3","text-background-color":r("dark"),"text-background-opacity":1,"text-background-padding":"15px","taxi-radius":500,"source-arrow-fill":"filled","target-arrow-fill":"filled","text-max-width":"200px","font-size":"45px","text-wrap":"wrap","text-margin-x":50,"transition-duration":"0.5s","source-endpoint":"outside-to-node","target-endpoint":"outside-to-node","source-distance-from-node":80,"target-distance-from-node":80}}],cc=(r,e,t,n)=>{if(!r)return{controlPointDistances:[0],controlPointWeights:[.5]};const a=r.edges().filter(u=>{const c=u.data();return c.source===e&&c.target===t||c.source===t&&c.target===e});if(a.length<=1)return{controlPointDistances:[0],controlPointWeights:[.5]};let i=0;a.forEach((u,c)=>{u.data().id===n&&(i=c)});const o=a.length;return{controlPointDistances:[(i-(o-1)/2)*60],controlPointWeights:[.5]}},yq=r=>{const n=1/(Math.cbrt(r)*.8);let a=Math.round(650*n),i=Math.round(350*n);return a=Math.max(40,Math.min(450,a)),i=Math.max(30,Math.min(300,i)),{edgeSep:a,rankSep:i}};function mq({cytoInstance:r,id:e,source:t,type:n,target:a,label:i,children:o,layout:s,styleCallback:l,isPerformanceMode:u}){const c=Te.useRef(null),d=Te.useRef(null),[h,g]=Te.useState(2);let p,E;function m(S){if(l){const _=l(S,t,a);p=_.hasOwnProperty("line-style"),E=_.hasOwnProperty("source-arrow-shape"),S.style(_)}}const b=Te.useCallback(()=>{if(!p||u)return;const S=r.getElementById(e);if(S.length===0)return;const D=Date.now()*.1%(20*50),I=E?D:-D;S.style("line-dash-offset",I),d.current=requestAnimationFrame(b)},[p,r,e,E,u]);function w(S){const _=cc(r,t,a,e),A=r.add({data:{...S,controlPointDistances:_.controlPointDistances,controlPointWeights:_.controlPointWeights}});m(A),p&&(d.current=requestAnimationFrame(b))}function x(S,_){let A=2;return r.getElementById(S).length===1&&(A-=1),r.getElementById(_).length===1&&(A-=1),A}if(Te.useEffect(()=>{if(x(t,a)===0){const _=r.getElementById(e);if(_.length===0){const A=cc(r,t,a,e),P=r.add({data:{id:e,source:t,target:a,label:i,type:n,controlPointDistances:A.controlPointDistances,controlPointWeights:A.controlPointWeights}});m(P),p&&(d.current=requestAnimationFrame(b))}else{const A=cc(r,t,a,e);_.data({source:t,target:a,label:i,type:n,controlPointDistances:A.controlPointDistances,controlPointWeights:A.controlPointWeights}),m(_)}}},[t,a,e,i,n,r,p,b]),Te.useEffect(()=>{function S(A){const P=A.target.id();if(P===t||P===a){const D=x(t,a);D!==h&&g(D),D===0&&w({id:e,source:t,target:a,label:i,type:n})}}function _(A){const P=A.target.id();if(P===t||P===a){const D=x(t,a);D!==h&&g(D),D>0&&(r.getElementById(e).remove(),d.current&&cancelAnimationFrame(d.current))}}return r.on("add","node",S),r.on("remove","node",_),p&&h===0&&(d.current=requestAnimationFrame(b)),()=>{r.getElementById(e).remove(),r.off("add","node",S),r.off("remove","node",_),d.current&&cancelAnimationFrame(d.current)}},[]),Te.useEffect(()=>(p&&h===0?d.current||(d.current=requestAnimationFrame(b)):!p&&d.current&&(cancelAnimationFrame(d.current),d.current=null),()=>{d.current&&cancelAnimationFrame(d.current)}),[p,h,b]),Te.useEffect(()=>{s()},[e,o]),Te.useEffect(()=>{if(!h){const S=r.getElementById(e);m(S)}},[l,h]),h>0)return null;function C(S){return Te.cloneElement(S,{cytoInstance:r,layout:s})}const T=Te.Children.map(o,C);return ue.jsx("div",{ref:c,className:"cytoscape-react-edge",children:T})}function lm(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,n=Array(e);t<e;t++)n[t]=r[t];return n}function bq(r){if(Array.isArray(r))return r}function wq(r){if(Array.isArray(r))return lm(r)}function La(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function xq(r,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(r,iR(n.key),n)}}function Oa(r,e,t){return e&&xq(r.prototype,e),Object.defineProperty(r,"prototype",{writable:!1}),r}function $t(r,e){var t=typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=Dm(r))||e){t&&(r=t);var n=0,a=function(){};return{s:a,n:function(){return n>=r.length?{done:!0}:{done:!1,value:r[n++]}},e:function(l){throw l},f:a}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
2
2
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i,o=!0,s=!1;return{s:function(){t=t.call(r)},n:function(){var l=t.next();return o=l.done,l},e:function(l){s=!0,i=l},f:function(){try{o||t.return==null||t.return()}finally{if(s)throw i}}}}function aR(r,e,t){return(e=iR(e))in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Eq(r){if(typeof Symbol<"u"&&r[Symbol.iterator]!=null||r["@@iterator"]!=null)return Array.from(r)}function Cq(r,e){var t=r==null?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(t!=null){var n,a,i,o,s=[],l=!0,u=!1;try{if(i=(t=t.call(r)).next,e===0){if(Object(t)!==t)return;l=!1}else for(;!(l=(n=i.call(t)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(c){u=!0,a=c}finally{try{if(!l&&t.return!=null&&(o=t.return(),Object(o)!==o))return}finally{if(u)throw a}}return s}}function _q(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
3
3
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Sq(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
4
4
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Yr(r,e){return bq(r)||Cq(r,e)||Dm(r,e)||_q()}function Hu(r){return wq(r)||Eq(r)||Dm(r)||Sq()}function Tq(r,e){if(typeof r!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(r)}function iR(r){var e=Tq(r,"string");return typeof e=="symbol"?e:e+""}function tt(r){"@babel/helpers - typeof";return tt=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},tt(r)}function Dm(r,e){if(r){if(typeof r=="string")return lm(r,e);var t={}.toString.call(r).slice(8,-1);return t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set"?Array.from(r):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?lm(r,e):void 0}}var et=typeof window>"u"?null:window,G1=et?et.navigator:null;et&&et.document;var Rq=tt(""),oR=tt({}),Aq=tt(function(){}),Pq=typeof HTMLElement>"u"?"undefined":tt(HTMLElement),vs=function(e){return e&&e.instanceString&&Fr(e.instanceString)?e.instanceString():null},Ke=function(e){return e!=null&&tt(e)==Rq},Fr=function(e){return e!=null&&tt(e)===Aq},Sr=function(e){return!Zt(e)&&(Array.isArray?Array.isArray(e):e!=null&&e instanceof Array)},pr=function(e){return e!=null&&tt(e)===oR&&!Sr(e)&&e.constructor===Object},Dq=function(e){return e!=null&&tt(e)===oR},ke=function(e){return e!=null&&tt(e)===tt(1)&&!isNaN(e)},Iq=function(e){return ke(e)&&Math.floor(e)===e},Ku=function(e){if(Pq!=="undefined")return e!=null&&e instanceof HTMLElement},Zt=function(e){return hs(e)||sR(e)},hs=function(e){return vs(e)==="collection"&&e._private.single},sR=function(e){return vs(e)==="collection"&&!e._private.single},Im=function(e){return vs(e)==="core"},uR=function(e){return vs(e)==="stylesheet"},Bq=function(e){return vs(e)==="event"},Ta=function(e){return e==null?!0:!!(e===""||e.match(/^\s+$/))},kq=function(e){return typeof HTMLElement>"u"?!1:e instanceof HTMLElement},Mq=function(e){return pr(e)&&ke(e.x1)&&ke(e.x2)&&ke(e.y1)&&ke(e.y2)},Lq=function(e){return Dq(e)&&Fr(e.then)},Oq=function(){return G1&&G1.userAgent.match(/msie|trident|edge/i)},to=function(e,t){t||(t=function(){if(arguments.length===1)return arguments[0];if(arguments.length===0)return"undefined";for(var i=[],o=0;o<arguments.length;o++)i.push(arguments[o]);return i.join("$")});var n=function(){var i=this,o=arguments,s,l=t.apply(i,o),u=n.cache;return(s=u[l])||(s=u[l]=e.apply(i,o)),s};return n.cache={},n},Bm=to(function(r){return r.replace(/([A-Z])/g,function(e){return"-"+e.toLowerCase()})}),ll=to(function(r){return r.replace(/(-\w)/g,function(e){return e[1].toUpperCase()})}),lR=to(function(r,e){return r+e[0].toUpperCase()+e.substring(1)},function(r,e){return r+"$"+e}),W1=function(e){return Ta(e)?e:e.charAt(0).toUpperCase()+e.substring(1)},wa=function(e,t){return e.slice(-1*t.length)===t},rt="(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))",qq="rgb[a]?\\(("+rt+"[%]?)\\s*,\\s*("+rt+"[%]?)\\s*,\\s*("+rt+"[%]?)(?:\\s*,\\s*("+rt+"))?\\)",Nq="rgb[a]?\\((?:"+rt+"[%]?)\\s*,\\s*(?:"+rt+"[%]?)\\s*,\\s*(?:"+rt+"[%]?)(?:\\s*,\\s*(?:"+rt+"))?\\)",Fq="hsl[a]?\\(("+rt+")\\s*,\\s*("+rt+"[%])\\s*,\\s*("+rt+"[%])(?:\\s*,\\s*("+rt+"))?\\)",zq="hsl[a]?\\((?:"+rt+")\\s*,\\s*(?:"+rt+"[%])\\s*,\\s*(?:"+rt+"[%])(?:\\s*,\\s*(?:"+rt+"))?\\)",$q="\\#[0-9a-fA-F]{3}",Vq="\\#[0-9a-fA-F]{6}",fR=function(e,t){return e<t?-1:e>t?1:0},Gq=function(e,t){return-1*fR(e,t)},Ye=Object.assign!=null?Object.assign.bind(Object):function(r){for(var e=arguments,t=1;t<e.length;t++){var n=e[t];if(n!=null)for(var a=Object.keys(n),i=0;i<a.length;i++){var o=a[i];r[o]=n[o]}}return r},Wq=function(e){if(!(!(e.length===4||e.length===7)||e[0]!=="#")){var t=e.length===4,n,a,i,o=16;return t?(n=parseInt(e[1]+e[1],o),a=parseInt(e[2]+e[2],o),i=parseInt(e[3]+e[3],o)):(n=parseInt(e[1]+e[2],o),a=parseInt(e[3]+e[4],o),i=parseInt(e[5]+e[6],o)),[n,a,i]}},Uq=function(e){var t,n,a,i,o,s,l,u;function c(p,E,m){return m<0&&(m+=1),m>1&&(m-=1),m<1/6?p+(E-p)*6*m:m<1/2?E:m<2/3?p+(E-p)*(2/3-m)*6:p}var d=new RegExp("^"+Fq+"$").exec(e);if(d){if(n=parseInt(d[1]),n<0?n=(360- -1*n%360)%360:n>360&&(n=n%360),n/=360,a=parseFloat(d[2]),a<0||a>100||(a=a/100,i=parseFloat(d[3]),i<0||i>100)||(i=i/100,o=d[4],o!==void 0&&(o=parseFloat(o),o<0||o>1)))return;if(a===0)s=l=u=Math.round(i*255);else{var h=i<.5?i*(1+a):i+a-i*a,g=2*i-h;s=Math.round(255*c(g,h,n+1/3)),l=Math.round(255*c(g,h,n)),u=Math.round(255*c(g,h,n-1/3))}t=[s,l,u,o]}return t},Hq=function(e){var t,n=new RegExp("^"+qq+"$").exec(e);if(n){t=[];for(var a=[],i=1;i<=3;i++){var o=n[i];if(o[o.length-1]==="%"&&(a[i]=!0),o=parseFloat(o),a[i]&&(o=o/100*255),o<0||o>255)return;t.push(Math.floor(o))}var s=a[1]||a[2]||a[3],l=a[1]&&a[2]&&a[3];if(s&&!l)return;var u=n[4];if(u!==void 0){if(u=parseFloat(u),u<0||u>1)return;t.push(u)}}return t},Kq=function(e){return jq[e.toLowerCase()]},cR=function(e){return(Sr(e)?e:null)||Kq(e)||Wq(e)||Hq(e)||Uq(e)},jq={transparent:[0,0,0,0],aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],grey:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},dR=function(e){for(var t=e.map,n=e.keys,a=n.length,i=0;i<a;i++){var o=n[i];if(pr(o))throw Error("Tried to set map with object key");i<n.length-1?(t[o]==null&&(t[o]={}),t=t[o]):t[o]=e.value}},vR=function(e){for(var t=e.map,n=e.keys,a=n.length,i=0;i<a;i++){var o=n[i];if(pr(o))throw Error("Tried to get map with object key");if(t=t[o],t==null)return t}return t},mu=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function gs(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var dc,U1;function ps(){if(U1)return dc;U1=1;function r(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}return dc=r,dc}var vc,H1;function Yq(){if(H1)return vc;H1=1;var r=typeof mu=="object"&&mu&&mu.Object===Object&&mu;return vc=r,vc}var hc,K1;function fl(){if(K1)return hc;K1=1;var r=Yq(),e=typeof self=="object"&&self&&self.Object===Object&&self,t=r||e||Function("return this")();return hc=t,hc}var gc,j1;function Zq(){if(j1)return gc;j1=1;var r=fl(),e=function(){return r.Date.now()};return gc=e,gc}var pc,Y1;function Xq(){if(Y1)return pc;Y1=1;var r=/\s/;function e(t){for(var n=t.length;n--&&r.test(t.charAt(n)););return n}return pc=e,pc}var yc,Z1;function Qq(){if(Z1)return yc;Z1=1;var r=Xq(),e=/^\s+/;function t(n){return n&&n.slice(0,r(n)+1).replace(e,"")}return yc=t,yc}var mc,X1;function km(){if(X1)return mc;X1=1;var r=fl(),e=r.Symbol;return mc=e,mc}var bc,Q1;function Jq(){if(Q1)return bc;Q1=1;var r=km(),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 bc=i,bc}var wc,J1;function eN(){if(J1)return wc;J1=1;var r=Object.prototype,e=r.toString;function t(n){return e.call(n)}return wc=t,wc}var xc,ew;function hR(){if(ew)return xc;ew=1;var r=km(),e=Jq(),t=eN(),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 xc=o,xc}var Ec,rw;function rN(){if(rw)return Ec;rw=1;function r(e){return e!=null&&typeof e=="object"}return Ec=r,Ec}var Cc,tw;function ys(){if(tw)return Cc;tw=1;var r=hR(),e=rN(),t="[object Symbol]";function n(a){return typeof a=="symbol"||e(a)&&r(a)==t}return Cc=n,Cc}var _c,nw;function tN(){if(nw)return _c;nw=1;var r=Qq(),e=ps(),t=ys(),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 _c=l,_c}var Sc,aw;function nN(){if(aw)return Sc;aw=1;var r=ps(),e=Zq(),t=tN(),n="Expected a function",a=Math.max,i=Math.min;function o(s,l,u){var c,d,h,g,p,E,m=0,b=!1,w=!1,x=!0;if(typeof s!="function")throw new TypeError(n);l=t(l)||0,r(u)&&(b=!!u.leading,w="maxWait"in u,h=w?a(t(u.maxWait)||0,l):h,x="trailing"in u?!!u.trailing:x);function C(k){var N=c,z=d;return c=d=void 0,m=k,g=s.apply(z,N),g}function T(k){return m=k,p=setTimeout(A,l),b?C(k):g}function S(k){var N=k-E,z=k-m,W=l-N;return w?i(W,h-z):W}function _(k){var N=k-E,z=k-m;return E===void 0||N>=l||N<0||w&&z>=h}function A(){var k=e();if(_(k))return P(k);p=setTimeout(A,S(k))}function P(k){return p=void 0,x&&c?C(k):(c=d=void 0,g)}function D(){p!==void 0&&clearTimeout(p),m=0,c=E=d=p=void 0}function I(){return p===void 0?g:P(e())}function M(){var k=e(),N=_(k);if(c=arguments,d=this,E=k,N){if(p===void 0)return T(E);if(w)return clearTimeout(p),p=setTimeout(A,l),C(E)}return p===void 0&&(p=setTimeout(A,l)),g}return M.cancel=D,M.flush=I,M}return Sc=o,Sc}var aN=nN(),ms=gs(aN),Tc=et?et.performance:null,gR=Tc&&Tc.now?function(){return Tc.now()}:function(){return Date.now()},iN=(function(){if(et){if(et.requestAnimationFrame)return function(r){et.requestAnimationFrame(r)};if(et.mozRequestAnimationFrame)return function(r){et.mozRequestAnimationFrame(r)};if(et.webkitRequestAnimationFrame)return function(r){et.webkitRequestAnimationFrame(r)};if(et.msRequestAnimationFrame)return function(r){et.msRequestAnimationFrame(r)}}return function(r){r&&setTimeout(function(){r(gR())},1e3/60)}})(),ju=function(e){return iN(e)},Qn=gR,ti=9261,pR=65599,Ui=5381,yR=function(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ti,n=t,a;a=e.next(),!a.done;)n=n*pR+a.value|0;return n},es=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ti;return t*pR+e|0},rs=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ui;return(t<<5)+t+e|0},oN=function(e,t){return e*2097152+t},pa=function(e){return e[0]*2097152+e[1]},bu=function(e,t){return[es(e[0],t[0]),rs(e[1],t[1])]},iw=function(e,t){var n={value:0,done:!1},a=0,i=e.length,o={next:function(){return a<i?n.value=e[a++]:n.done=!0,n}};return yR(o,t)},oi=function(e,t){var n={value:0,done:!1},a=0,i=e.length,o={next:function(){return a<i?n.value=e.charCodeAt(a++):n.done=!0,n}};return yR(o,t)},mR=function(){return sN(arguments)},sN=function(e){for(var t,n=0;n<e.length;n++){var a=e[n];n===0?t=oi(a):t=oi(a,t)}return t};function uN(r,e,t,n,a){var i=a*Math.PI/180,o=Math.cos(i)*(r-t)-Math.sin(i)*(e-n)+t,s=Math.sin(i)*(r-t)+Math.cos(i)*(e-n)+n;return{x:o,y:s}}var lN=function(e,t,n,a,i,o){return{x:(e-n)*i+n,y:(t-a)*o+a}};function fN(r,e,t){if(t===0)return r;var n=(e.x1+e.x2)/2,a=(e.y1+e.y2)/2,i=e.w/e.h,o=1/i,s=uN(r.x,r.y,n,a,t),l=lN(s.x,s.y,n,a,i,o);return{x:l.x,y:l.y}}var ow=!0,cN=console.warn!=null,dN=console.trace!=null,Mm=Number.MAX_SAFE_INTEGER||9007199254740991,bR=function(){return!0},Yu=function(){return!1},sw=function(){return 0},Lm=function(){},Lr=function(e){throw new Error(e)},wR=function(e){if(e!==void 0)ow=!!e;else return ow},Er=function(e){wR()&&(cN?console.warn(e):(console.log(e),dN&&console.trace()))},vN=function(e){return Ye({},e)},Bn=function(e){return e==null?e:Sr(e)?e.slice():pr(e)?vN(e):e},hN=function(e){return e.slice()},xR=function(e,t){for(t=e="";e++<36;t+=e*51&52?(e^15?8^Math.random()*(e^20?16:4):4).toString(16):"-");return t},gN={},ER=function(){return gN},yt=function(e){var t=Object.keys(e);return function(n){for(var a={},i=0;i<t.length;i++){var o=t[i],s=n==null?void 0:n[o];a[o]=s===void 0?e[o]:s}return a}},Ra=function(e,t,n){for(var a=e.length-1;a>=0;a--)e[a]===t&&e.splice(a,1)},Om=function(e){e.splice(0,e.length)},pN=function(e,t){for(var n=0;n<t.length;n++){var a=t[n];e.push(a)}},Ft=function(e,t,n){return n&&(t=lR(n,t)),e[t]},Zn=function(e,t,n,a){n&&(t=lR(n,t)),e[t]=a},yN=(function(){function r(){La(this,r),this._obj={}}return Oa(r,[{key:"set",value:function(t,n){return this._obj[t]=n,this}},{key:"delete",value:function(t){return this._obj[t]=void 0,this}},{key:"clear",value:function(){this._obj={}}},{key:"has",value:function(t){return this._obj[t]!==void 0}},{key:"get",value:function(t){return this._obj[t]}}])})(),Xn=typeof Map<"u"?Map:yN,mN="undefined",bN=(function(){function r(e){if(La(this,r),this._obj=Object.create(null),this.size=0,e!=null){var t;e.instanceString!=null&&e.instanceString()===this.instanceString()?t=e.toArray():t=e;for(var n=0;n<t.length;n++)this.add(t[n])}}return Oa(r,[{key:"instanceString",value:function(){return"set"}},{key:"add",value:function(t){var n=this._obj;n[t]!==1&&(n[t]=1,this.size++)}},{key:"delete",value:function(t){var n=this._obj;n[t]===1&&(n[t]=0,this.size--)}},{key:"clear",value:function(){this._obj=Object.create(null)}},{key:"has",value:function(t){return this._obj[t]===1}},{key:"toArray",value:function(){var t=this;return Object.keys(this._obj).filter(function(n){return t.has(n)})}},{key:"forEach",value:function(t,n){return this.toArray().forEach(t,n)}}])})(),io=(typeof Set>"u"?"undefined":tt(Set))!==mN?Set:bN,cl=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(e===void 0||t===void 0||!Im(e)){Lr("An element must have a core reference and parameters set");return}var a=t.group;if(a==null&&(t.data&&t.data.source!=null&&t.data.target!=null?a="edges":a="nodes"),a!=="nodes"&&a!=="edges"){Lr("An element must be of type `nodes` or `edges`; you specified `"+a+"`");return}this.length=1,this[0]=this;var i=this._private={cy:e,single:!0,data:t.data||{},position:t.position||{x:0,y:0},autoWidth:void 0,autoHeight:void 0,autoPadding:void 0,compoundBoundsClean:!1,listeners:[],group:a,style:{},rstyle:{},styleCxts:[],styleKeys:{},removed:!0,selected:!!t.selected,selectable:t.selectable===void 0?!0:!!t.selectable,locked:!!t.locked,grabbed:!1,grabbable:t.grabbable===void 0?!0:!!t.grabbable,pannable:t.pannable===void 0?a==="edges":!!t.pannable,active:!1,classes:new io,animation:{current:[],queue:[]},rscratch:{},scratch:t.scratch||{},edges:[],children:[],parent:t.parent&&t.parent.isNode()?t.parent:null,traversalCache:{},backgrounding:!1,bbCache:null,bbCacheShift:{x:0,y:0},bodyBounds:null,overlayBounds:null,labelBounds:{all:null,source:null,target:null,main:null},arrowBounds:{source:null,target:null,"mid-source":null,"mid-target":null}};if(i.position.x==null&&(i.position.x=0),i.position.y==null&&(i.position.y=0),t.renderedPosition){var o=t.renderedPosition,s=e.pan(),l=e.zoom();i.position={x:(o.x-s.x)/l,y:(o.y-s.y)/l}}var u=[];Sr(t.classes)?u=t.classes:Ke(t.classes)&&(u=t.classes.split(/\s+/));for(var c=0,d=u.length;c<d;c++){var h=u[c];!h||h===""||i.classes.add(h)}this.createEmitter(),(n===void 0||n)&&this.restore();var g=t.style||t.css;g&&(Er("Setting a `style` bypass at element creation should be done only when absolutely necessary. Try to use the stylesheet instead."),this.style(g))},uw=function(e){return e={bfs:e.bfs||!e.dfs,dfs:e.dfs||!e.bfs},function(n,a,i){var o;pr(n)&&!Zt(n)&&(o=n,n=o.roots||o.root,a=o.visit,i=o.directed),i=arguments.length===2&&!Fr(a)?a:i,a=Fr(a)?a:function(){};for(var s=this._private.cy,l=n=Ke(n)?this.filter(n):n,u=[],c=[],d={},h={},g={},p=0,E,m=this.byGroup(),b=m.nodes,w=m.edges,x=0;x<l.length;x++){var C=l[x],T=C.id();C.isNode()&&(u.unshift(C),e.bfs&&(g[T]=!0,c.push(C)),h[T]=0)}for(var S=function(){var k=e.bfs?u.shift():u.pop(),N=k.id();if(e.dfs){if(g[N])return 0;g[N]=!0,c.push(k)}var z=h[N],W=d[N],q=W!=null?W.source():null,$=W!=null?W.target():null,X=W==null?void 0:k.same(q)?$[0]:q[0],Y;if(Y=a(k,W,X,p++,z),Y===!0)return E=k,1;if(Y===!1)return 1;for(var K=k.connectedEdges().filter(function(j){return(!i||j.source().same(k))&&w.has(j)}),ee=0;ee<K.length;ee++){var le=K[ee],G=le.connectedNodes().filter(function(j){return!j.same(k)&&b.has(j)}),V=G.id();G.length!==0&&!g[V]&&(G=G[0],u.push(G),e.bfs&&(g[V]=!0,c.push(G)),d[V]=le,h[V]=h[N]+1)}},_;u.length!==0&&(_=S(),!(_!==0&&_===1)););for(var A=s.collection(),P=0;P<c.length;P++){var D=c[P],I=d[D.id()];I!=null&&A.push(I),A.push(D)}return{path:s.collection(A),found:s.collection(E)}}},ts={breadthFirstSearch:uw({bfs:!0}),depthFirstSearch:uw({dfs:!0})};ts.bfs=ts.breadthFirstSearch;ts.dfs=ts.depthFirstSearch;var Bu={exports:{}},wN=Bu.exports,lw;function xN(){return lw||(lw=1,(function(r,e){(function(){var t,n,a,i,o,s,l,u,c,d,h,g,p,E,m;a=Math.floor,d=Math.min,n=function(b,w){return b<w?-1:b>w?1:0},c=function(b,w,x,C,T){var S;if(x==null&&(x=0),T==null&&(T=n),x<0)throw new Error("lo must be non-negative");for(C==null&&(C=b.length);x<C;)S=a((x+C)/2),T(w,b[S])<0?C=S:x=S+1;return[].splice.apply(b,[x,x-x].concat(w)),w},s=function(b,w,x){return x==null&&(x=n),b.push(w),E(b,0,b.length-1,x)},o=function(b,w){var x,C;return w==null&&(w=n),x=b.pop(),b.length?(C=b[0],b[0]=x,m(b,0,w)):C=x,C},u=function(b,w,x){var C;return x==null&&(x=n),C=b[0],b[0]=w,m(b,0,x),C},l=function(b,w,x){var C;return x==null&&(x=n),b.length&&x(b[0],w)<0&&(C=[b[0],w],w=C[0],b[0]=C[1],m(b,0,x)),w},i=function(b,w){var x,C,T,S,_,A;for(w==null&&(w=n),S=(function(){A=[];for(var P=0,D=a(b.length/2);0<=D?P<D:P>D;0<=D?P++:P--)A.push(P);return A}).apply(this).reverse(),_=[],C=0,T=S.length;C<T;C++)x=S[C],_.push(m(b,x,w));return _},p=function(b,w,x){var C;if(x==null&&(x=n),C=b.indexOf(w),C!==-1)return E(b,0,C,x),m(b,C,x)},h=function(b,w,x){var C,T,S,_,A;if(x==null&&(x=n),T=b.slice(0,w),!T.length)return T;for(i(T,x),A=b.slice(w),S=0,_=A.length;S<_;S++)C=A[S],l(T,C,x);return T.sort(x).reverse()},g=function(b,w,x){var C,T,S,_,A,P,D,I,M;if(x==null&&(x=n),w*10<=b.length){if(S=b.slice(0,w).sort(x),!S.length)return S;for(T=S[S.length-1],D=b.slice(w),_=0,P=D.length;_<P;_++)C=D[_],x(C,T)<0&&(c(S,C,0,null,x),S.pop(),T=S[S.length-1]);return S}for(i(b,x),M=[],A=0,I=d(w,b.length);0<=I?A<I:A>I;0<=I?++A:--A)M.push(o(b,x));return M},E=function(b,w,x,C){var T,S,_;for(C==null&&(C=n),T=b[x];x>w;){if(_=x-1>>1,S=b[_],C(T,S)<0){b[x]=S,x=_;continue}break}return b[x]=T},m=function(b,w,x){var C,T,S,_,A;for(x==null&&(x=n),T=b.length,A=w,S=b[w],C=2*w+1;C<T;)_=C+1,_<T&&!(x(b[C],b[_])<0)&&(C=_),b[w]=b[C],w=C,C=2*w+1;return b[w]=S,E(b,A,w,x)},t=(function(){b.push=s,b.pop=o,b.replace=u,b.pushpop=l,b.heapify=i,b.updateItem=p,b.nlargest=h,b.nsmallest=g;function b(w){this.cmp=w??n,this.nodes=[]}return b.prototype.push=function(w){return s(this.nodes,w,this.cmp)},b.prototype.pop=function(){return o(this.nodes,this.cmp)},b.prototype.peek=function(){return this.nodes[0]},b.prototype.contains=function(w){return this.nodes.indexOf(w)!==-1},b.prototype.replace=function(w){return u(this.nodes,w,this.cmp)},b.prototype.pushpop=function(w){return l(this.nodes,w,this.cmp)},b.prototype.heapify=function(){return i(this.nodes,this.cmp)},b.prototype.updateItem=function(w){return p(this.nodes,w,this.cmp)},b.prototype.clear=function(){return this.nodes=[]},b.prototype.empty=function(){return this.nodes.length===0},b.prototype.size=function(){return this.nodes.length},b.prototype.clone=function(){var w;return w=new b,w.nodes=this.nodes.slice(0),w},b.prototype.toArray=function(){return this.nodes.slice(0)},b.prototype.insert=b.prototype.push,b.prototype.top=b.prototype.peek,b.prototype.front=b.prototype.peek,b.prototype.has=b.prototype.contains,b.prototype.copy=b.prototype.clone,b})(),(function(b,w){return r.exports=w()})(this,function(){return t})}).call(wN)})(Bu)),Bu.exports}var Rc,fw;function EN(){return fw||(fw=1,Rc=xN()),Rc}var CN=EN(),bs=gs(CN),_N=yt({root:null,weight:function(e){return 1},directed:!1}),SN={dijkstra:function(e){if(!pr(e)){var t=arguments;e={root:t[0],weight:t[1],directed:t[2]}}var n=_N(e),a=n.root,i=n.weight,o=n.directed,s=this,l=i,u=Ke(a)?this.filter(a)[0]:a[0],c={},d={},h={},g=this.byGroup(),p=g.nodes,E=g.edges;E.unmergeBy(function(z){return z.isLoop()});for(var m=function(W){return c[W.id()]},b=function(W,q){c[W.id()]=q,w.updateItem(W)},w=new bs(function(z,W){return m(z)-m(W)}),x=0;x<p.length;x++){var C=p[x];c[C.id()]=C.same(u)?0:1/0,w.push(C)}for(var T=function(W,q){for(var $=(o?W.edgesTo(q):W.edgesWith(q)).intersect(E),X=1/0,Y,K=0;K<$.length;K++){var ee=$[K],le=l(ee);(le<X||!Y)&&(X=le,Y=ee)}return{edge:Y,dist:X}};w.size()>0;){var S=w.pop(),_=m(S),A=S.id();if(h[A]=_,_!==1/0)for(var P=S.neighborhood().intersect(p),D=0;D<P.length;D++){var I=P[D],M=I.id(),k=T(S,I),N=_+k.dist;N<m(I)&&(b(I,N),d[M]={node:S,edge:k.edge})}}return{distanceTo:function(W){var q=Ke(W)?p.filter(W)[0]:W[0];return h[q.id()]},pathTo:function(W){var q=Ke(W)?p.filter(W)[0]:W[0],$=[],X=q,Y=X.id();if(q.length>0)for($.unshift(q);d[Y];){var K=d[Y];$.unshift(K.edge),$.unshift(K.node),X=K.node,Y=X.id()}return s.spawn($)}}}},TN={kruskal:function(e){e=e||function(x){return 1};for(var t=this.byGroup(),n=t.nodes,a=t.edges,i=n.length,o=new Array(i),s=n,l=function(C){for(var T=0;T<o.length;T++){var S=o[T];if(S.has(C))return T}},u=0;u<i;u++)o[u]=this.spawn(n[u]);for(var c=a.sort(function(x,C){return e(x)-e(C)}),d=0;d<c.length;d++){var h=c[d],g=h.source()[0],p=h.target()[0],E=l(g),m=l(p),b=o[E],w=o[m];E!==m&&(s.merge(h),b.merge(w),o.splice(m,1))}return s}},RN=yt({root:null,goal:null,weight:function(e){return 1},heuristic:function(e){return 0},directed:!1}),AN={aStar:function(e){var t=this.cy(),n=RN(e),a=n.root,i=n.goal,o=n.heuristic,s=n.directed,l=n.weight;a=t.collection(a)[0],i=t.collection(i)[0];var u=a.id(),c=i.id(),d={},h={},g={},p=new bs(function(Y,K){return h[Y.id()]-h[K.id()]}),E=new io,m={},b={},w=function(K,ee){p.push(K),E.add(ee)},x,C,T=function(){x=p.pop(),C=x.id(),E.delete(C)},S=function(K){return E.has(K)};w(a,u),d[u]=0,h[u]=o(a);for(var _=0;p.size()>0;){if(T(),_++,C===c){for(var A=[],P=i,D=c,I=b[D];A.unshift(P),I!=null&&A.unshift(I),P=m[D],P!=null;)D=P.id(),I=b[D];return{found:!0,distance:d[C],path:this.spawn(A),steps:_}}g[C]=!0;for(var M=x._private.edges,k=0;k<M.length;k++){var N=M[k];if(this.hasElementWithId(N.id())&&!(s&&N.data("source")!==C)){var z=N.source(),W=N.target(),q=z.id()!==C?z:W,$=q.id();if(this.hasElementWithId($)&&!g[$]){var X=d[C]+l(N);if(!S($)){d[$]=X,h[$]=X+o(q),w(q,$),m[$]=x,b[$]=N;continue}X<d[$]&&(d[$]=X,h[$]=X+o(q),m[$]=x,b[$]=N)}}}}return{found:!1,distance:void 0,path:void 0,steps:_}}},PN=yt({weight:function(e){return 1},directed:!1}),DN={floydWarshall:function(e){for(var t=this.cy(),n=PN(e),a=n.weight,i=n.directed,o=a,s=this.byGroup(),l=s.nodes,u=s.edges,c=l.length,d=c*c,h=function(le){return l.indexOf(le)},g=function(le){return l[le]},p=new Array(d),E=0;E<d;E++){var m=E%c,b=(E-m)/c;b===m?p[E]=0:p[E]=1/0}for(var w=new Array(d),x=new Array(d),C=0;C<u.length;C++){var T=u[C],S=T.source()[0],_=T.target()[0];if(S!==_){var A=h(S),P=h(_),D=A*c+P,I=o(T);if(p[D]>I&&(p[D]=I,w[D]=P,x[D]=T),!i){var M=P*c+A;!i&&p[M]>I&&(p[M]=I,w[M]=A,x[M]=T)}}}for(var k=0;k<c;k++)for(var N=0;N<c;N++)for(var z=N*c+k,W=0;W<c;W++){var q=N*c+W,$=k*c+W;p[z]+p[$]<p[q]&&(p[q]=p[z]+p[$],w[q]=w[z])}var X=function(le){return(Ke(le)?t.filter(le):le)[0]},Y=function(le){return h(X(le))},K={distance:function(le,G){var V=Y(le),j=Y(G);return p[V*c+j]},path:function(le,G){var V=Y(le),j=Y(G),re=g(V);if(V===j)return re.collection();if(w[V*c+j]==null)return t.collection();var ce=t.collection(),se=V,Z;for(ce.merge(re);V!==j;)se=V,V=w[V*c+j],Z=x[se*c+V],ce.merge(Z),ce.merge(g(V));return ce}};return K}},IN=yt({weight:function(e){return 1},directed:!1,root:null}),BN={bellmanFord:function(e){var t=this,n=IN(e),a=n.weight,i=n.directed,o=n.root,s=a,l=this,u=this.cy(),c=this.byGroup(),d=c.edges,h=c.nodes,g=h.length,p=new Xn,E=!1,m=[];o=u.collection(o)[0],d.unmergeBy(function(U){return U.isLoop()});for(var b=d.length,w=function(fe){var we=p.get(fe.id());return we||(we={},p.set(fe.id(),we)),we},x=function(fe){return(Ke(fe)?u.$(fe):fe)[0]},C=function(fe){return w(x(fe)).dist},T=function(fe){for(var we=arguments.length>1&&arguments[1]!==void 0?arguments[1]:o,ge=x(fe),me=[],Re=ge;;){if(Re==null)return t.spawn();var Ie=w(Re),Be=Ie.edge,Oe=Ie.pred;if(me.unshift(Re[0]),Re.same(we)&&me.length>0)break;Be!=null&&me.unshift(Be),Re=Oe}return l.spawn(me)},S=0;S<g;S++){var _=h[S],A=w(_);_.same(o)?A.dist=0:A.dist=1/0,A.pred=null,A.edge=null}for(var P=!1,D=function(fe,we,ge,me,Re,Ie){var Be=me.dist+Ie;Be<Re.dist&&!ge.same(me.edge)&&(Re.dist=Be,Re.pred=fe,Re.edge=ge,P=!0)},I=1;I<g;I++){P=!1;for(var M=0;M<b;M++){var k=d[M],N=k.source(),z=k.target(),W=s(k),q=w(N),$=w(z);D(N,z,k,q,$,W),i||D(z,N,k,$,q,W)}if(!P)break}if(P)for(var X=[],Y=0;Y<b;Y++){var K=d[Y],ee=K.source(),le=K.target(),G=s(K),V=w(ee).dist,j=w(le).dist;if(V+G<j||!i&&j+G<V)if(E||(Er("Graph contains a negative weight cycle for Bellman-Ford"),E=!0),e.findNegativeWeightCycles!==!1){var re=[];V+G<j&&re.push(ee),!i&&j+G<V&&re.push(le);for(var ce=re.length,se=0;se<ce;se++){var Z=re[se],Q=[Z];Q.push(w(Z).edge);for(var ae=w(Z).pred;Q.indexOf(ae)===-1;)Q.push(ae),Q.push(w(ae).edge),ae=w(ae).pred;Q=Q.slice(Q.indexOf(ae));for(var ne=Q[0].id(),de=0,Ce=2;Ce<Q.length;Ce+=2)Q[Ce].id()<ne&&(ne=Q[Ce].id(),de=Ce);Q=Q.slice(de).concat(Q.slice(0,de)),Q.push(Q[0]);var ve=Q.map(function(U){return U.id()}).join(",");X.indexOf(ve)===-1&&(m.push(l.spawn(Q)),X.push(ve))}}else break}return{distanceTo:C,pathTo:T,hasNegativeWeightCycle:E,negativeWeightCycles:m}}},kN=Math.sqrt(2),MN=function(e,t,n){n.length===0&&Lr("Karger-Stein must be run on a connected (sub)graph");for(var a=n[e],i=a[1],o=a[2],s=t[i],l=t[o],u=n,c=u.length-1;c>=0;c--){var d=u[c],h=d[1],g=d[2];(t[h]===s&&t[g]===l||t[h]===l&&t[g]===s)&&u.splice(c,1)}for(var p=0;p<u.length;p++){var E=u[p];E[1]===l?(u[p]=E.slice(),u[p][1]=s):E[2]===l&&(u[p]=E.slice(),u[p][2]=s)}for(var m=0;m<t.length;m++)t[m]===l&&(t[m]=s);return u},Ac=function(e,t,n,a){for(;n>a;){var i=Math.floor(Math.random()*t.length);t=MN(i,e,t),n--}return t},LN={kargerStein:function(){var e=this,t=this.byGroup(),n=t.nodes,a=t.edges;a.unmergeBy(function($){return $.isLoop()});var i=n.length,o=a.length,s=Math.ceil(Math.pow(Math.log(i)/Math.LN2,2)),l=Math.floor(i/kN);if(i<2){Lr("At least 2 nodes are required for Karger-Stein algorithm");return}for(var u=[],c=0;c<o;c++){var d=a[c];u.push([c,n.indexOf(d.source()),n.indexOf(d.target())])}for(var h=1/0,g=[],p=new Array(i),E=new Array(i),m=new Array(i),b=function(X,Y){for(var K=0;K<i;K++)Y[K]=X[K]},w=0;w<=s;w++){for(var x=0;x<i;x++)E[x]=x;var C=Ac(E,u.slice(),i,l),T=C.slice();b(E,m);var S=Ac(E,C,l,2),_=Ac(m,T,l,2);S.length<=_.length&&S.length<h?(h=S.length,g=S,b(E,p)):_.length<=S.length&&_.length<h&&(h=_.length,g=_,b(m,p))}for(var A=this.spawn(g.map(function($){return a[$[0]]})),P=this.spawn(),D=this.spawn(),I=p[0],M=0;M<p.length;M++){var k=p[M],N=n[M];k===I?P.merge(N):D.merge(N)}var z=function(X){var Y=e.spawn();return X.forEach(function(K){Y.merge(K),K.connectedEdges().forEach(function(ee){e.contains(ee)&&!A.contains(ee)&&Y.merge(ee)})}),Y},W=[z(P),z(D)],q={cut:A,components:W,partition1:P,partition2:D};return q}},Pc,ON=function(e){return{x:e.x,y:e.y}},dl=function(e,t,n){return{x:e.x*t+n.x,y:e.y*t+n.y}},CR=function(e,t,n){return{x:(e.x-n.x)/t,y:(e.y-n.y)/t}},Hi=function(e){return{x:e[0],y:e[1]}},qN=function(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,a=1/0,i=t;i<n;i++){var o=e[i];isFinite(o)&&(a=Math.min(o,a))}return a},NN=function(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,a=-1/0,i=t;i<n;i++){var o=e[i];isFinite(o)&&(a=Math.max(o,a))}return a},FN=function(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,a=0,i=0,o=t;o<n;o++){var s=e[o];isFinite(s)&&(a+=s,i++)}return a/i},zN=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0;a?e=e.slice(t,n):(n<e.length&&e.splice(n,e.length-n),t>0&&e.splice(0,t));for(var s=0,l=e.length-1;l>=0;l--){var u=e[l];o?isFinite(u)||(e[l]=-1/0,s++):e.splice(l,1)}i&&e.sort(function(h,g){return h-g});var c=e.length,d=Math.floor(c/2);return c%2!==0?e[d+1+s]:(e[d-1+s]+e[d+s])/2},$N=function(e){return Math.PI*e/180},wu=function(e,t){return Math.atan2(t,e)-Math.PI/2},qm=Math.log2||function(r){return Math.log(r)/Math.log(2)},Nm=function(e){return e>0?1:e<0?-1:0},si=function(e,t){return Math.sqrt(ei(e,t))},ei=function(e,t){var n=t.x-e.x,a=t.y-e.y;return n*n+a*a},VN=function(e){for(var t=e.length,n=0,a=0;a<t;a++)n+=e[a];for(var i=0;i<t;i++)e[i]=e[i]/n;return e},ot=function(e,t,n,a){return(1-a)*(1-a)*e+2*(1-a)*a*t+a*a*n},Zi=function(e,t,n,a){return{x:ot(e.x,t.x,n.x,a),y:ot(e.y,t.y,n.y,a)}},GN=function(e,t,n,a){var i={x:t.x-e.x,y:t.y-e.y},o=si(e,t),s={x:i.x/o,y:i.y/o};return n=n??0,a=a??n*o,{x:e.x+s.x*a,y:e.y+s.y*a}},ns=function(e,t,n){return Math.max(e,Math.min(n,t))},Bt=function(e){if(e==null)return{x1:1/0,y1:1/0,x2:-1/0,y2:-1/0,w:0,h:0};if(e.x1!=null&&e.y1!=null){if(e.x2!=null&&e.y2!=null&&e.x2>=e.x1&&e.y2>=e.y1)return{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,w:e.x2-e.x1,h:e.y2-e.y1};if(e.w!=null&&e.h!=null&&e.w>=0&&e.h>=0)return{x1:e.x1,y1:e.y1,x2:e.x1+e.w,y2:e.y1+e.h,w:e.w,h:e.h}}},WN=function(e){return{x1:e.x1,x2:e.x2,w:e.w,y1:e.y1,y2:e.y2,h:e.h}},UN=function(e){e.x1=1/0,e.y1=1/0,e.x2=-1/0,e.y2=-1/0,e.w=0,e.h=0},HN=function(e,t){e.x1=Math.min(e.x1,t.x1),e.x2=Math.max(e.x2,t.x2),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,t.y1),e.y2=Math.max(e.y2,t.y2),e.h=e.y2-e.y1},_R=function(e,t,n){e.x1=Math.min(e.x1,t),e.x2=Math.max(e.x2,t),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,n),e.y2=Math.max(e.y2,n),e.h=e.y2-e.y1},ku=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return e.x1-=t,e.x2+=t,e.y1-=t,e.y2+=t,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},Mu=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0],n,a,i,o;if(t.length===1)n=a=i=o=t[0];else if(t.length===2)n=i=t[0],o=a=t[1];else if(t.length===4){var s=Yr(t,4);n=s[0],a=s[1],i=s[2],o=s[3]}return e.x1-=o,e.x2+=a,e.y1-=n,e.y2+=i,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},cw=function(e,t){e.x1=t.x1,e.y1=t.y1,e.x2=t.x2,e.y2=t.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1},Fm=function(e,t){return!(e.x1>t.x2||t.x1>e.x2||e.x2<t.x1||t.x2<e.x1||e.y2<t.y1||t.y2<e.y1||e.y1>t.y2||t.y1>e.y2)},xa=function(e,t,n){return e.x1<=t&&t<=e.x2&&e.y1<=n&&n<=e.y2},dw=function(e,t){return xa(e,t.x,t.y)},SR=function(e,t){return xa(e,t.x1,t.y1)&&xa(e,t.x2,t.y2)},KN=(Pc=Math.hypot)!==null&&Pc!==void 0?Pc:function(r,e){return Math.sqrt(r*r+e*e)};function jN(r,e){if(r.length<3)throw new Error("Need at least 3 vertices");var t=function(A,P){return{x:A.x+P.x,y:A.y+P.y}},n=function(A,P){return{x:A.x-P.x,y:A.y-P.y}},a=function(A,P){return{x:A.x*P,y:A.y*P}},i=function(A,P){return A.x*P.y-A.y*P.x},o=function(A){var P=KN(A.x,A.y);return P===0?{x:0,y:0}:{x:A.x/P,y:A.y/P}},s=function(A){for(var P=0,D=0;D<A.length;D++){var I=A[D],M=A[(D+1)%A.length];P+=I.x*M.y-M.x*I.y}return P/2},l=function(A,P,D,I){var M=n(P,A),k=n(I,D),N=i(M,k);if(Math.abs(N)<1e-9)return t(A,a(M,.5));var z=i(n(D,A),k)/N;return t(A,a(M,z))},u=r.map(function(_){return{x:_.x,y:_.y}});s(u)<0&&u.reverse();for(var c=u.length,d=[],h=0;h<c;h++){var g=u[h],p=u[(h+1)%c],E=n(p,g),m=o({x:E.y,y:-E.x});d.push(m)}for(var b=d.map(function(_,A){var P=t(u[A],a(_,e)),D=t(u[(A+1)%c],a(_,e));return{p1:P,p2:D}}),w=[],x=0;x<c;x++){var C=b[(x-1+c)%c],T=b[x],S=l(C.p1,C.p2,T.p1,T.p2);w.push(S)}return w}function YN(r,e,t,n,a,i){var o=aF(r,e,t,n,a),s=jN(o,i),l=Bt();return s.forEach(function(u){return _R(l,u.x,u.y)}),l}var TR=function(e,t,n,a,i,o,s){var l=arguments.length>7&&arguments[7]!==void 0?arguments[7]:"auto",u=l==="auto"?Aa(i,o):l,c=i/2,d=o/2;u=Math.min(u,c,d);var h=u!==c,g=u!==d,p;if(h){var E=n-c+u-s,m=a-d-s,b=n+c-u+s,w=m;if(p=Ea(e,t,n,a,E,m,b,w,!1),p.length>0)return p}if(g){var x=n+c+s,C=a-d+u-s,T=x,S=a+d-u+s;if(p=Ea(e,t,n,a,x,C,T,S,!1),p.length>0)return p}if(h){var _=n-c+u-s,A=a+d+s,P=n+c-u+s,D=A;if(p=Ea(e,t,n,a,_,A,P,D,!1),p.length>0)return p}if(g){var I=n-c-s,M=a-d+u-s,k=I,N=a+d-u+s;if(p=Ea(e,t,n,a,I,M,k,N,!1),p.length>0)return p}var z;{var W=n-c+u,q=a-d+u;if(z=zo(e,t,n,a,W,q,u+s),z.length>0&&z[0]<=W&&z[1]<=q)return[z[0],z[1]]}{var $=n+c-u,X=a-d+u;if(z=zo(e,t,n,a,$,X,u+s),z.length>0&&z[0]>=$&&z[1]<=X)return[z[0],z[1]]}{var Y=n+c-u,K=a+d-u;if(z=zo(e,t,n,a,Y,K,u+s),z.length>0&&z[0]>=Y&&z[1]>=K)return[z[0],z[1]]}{var ee=n-c+u,le=a+d-u;if(z=zo(e,t,n,a,ee,le,u+s),z.length>0&&z[0]<=ee&&z[1]>=le)return[z[0],z[1]]}return[]},ZN=function(e,t,n,a,i,o,s){var l=s,u=Math.min(n,i),c=Math.max(n,i),d=Math.min(a,o),h=Math.max(a,o);return u-l<=e&&e<=c+l&&d-l<=t&&t<=h+l},XN=function(e,t,n,a,i,o,s,l,u){var c={x1:Math.min(n,s,i)-u,x2:Math.max(n,s,i)+u,y1:Math.min(a,l,o)-u,y2:Math.max(a,l,o)+u};return!(e<c.x1||e>c.x2||t<c.y1||t>c.y2)},QN=function(e,t,n,a){n-=a;var i=t*t-4*e*n;if(i<0)return[];var o=Math.sqrt(i),s=2*e,l=(-t+o)/s,u=(-t-o)/s;return[l,u]},JN=function(e,t,n,a,i){var o=1e-5;e===0&&(e=o),t/=e,n/=e,a/=e;var s,l,u,c,d,h,g,p;if(l=(3*n-t*t)/9,u=-(27*a)+t*(9*n-2*(t*t)),u/=54,s=l*l*l+u*u,i[1]=0,g=t/3,s>0){d=u+Math.sqrt(s),d=d<0?-Math.pow(-d,1/3):Math.pow(d,1/3),h=u-Math.sqrt(s),h=h<0?-Math.pow(-h,1/3):Math.pow(h,1/3),i[0]=-g+d+h,g+=(d+h)/2,i[4]=i[2]=-g,g=Math.sqrt(3)*(-h+d)/2,i[3]=g,i[5]=-g;return}if(i[5]=i[3]=0,s===0){p=u<0?-Math.pow(-u,1/3):Math.pow(u,1/3),i[0]=-g+2*p,i[4]=i[2]=-(p+g);return}l=-l,c=l*l*l,c=Math.acos(u/Math.sqrt(c)),p=2*Math.sqrt(l),i[0]=-g+p*Math.cos(c/3),i[2]=-g+p*Math.cos((c+2*Math.PI)/3),i[4]=-g+p*Math.cos((c+4*Math.PI)/3)},eF=function(e,t,n,a,i,o,s,l){var u=1*n*n-4*n*i+2*n*s+4*i*i-4*i*s+s*s+a*a-4*a*o+2*a*l+4*o*o-4*o*l+l*l,c=9*n*i-3*n*n-3*n*s-6*i*i+3*i*s+9*a*o-3*a*a-3*a*l-6*o*o+3*o*l,d=3*n*n-6*n*i+n*s-n*e+2*i*i+2*i*e-s*e+3*a*a-6*a*o+a*l-a*t+2*o*o+2*o*t-l*t,h=1*n*i-n*n+n*e-i*e+a*o-a*a+a*t-o*t,g=[];JN(u,c,d,h,g);for(var p=1e-7,E=[],m=0;m<6;m+=2)Math.abs(g[m+1])<p&&g[m]>=0&&g[m]<=1&&E.push(g[m]);E.push(1),E.push(0);for(var b=-1,w,x,C,T=0;T<E.length;T++)w=Math.pow(1-E[T],2)*n+2*(1-E[T])*E[T]*i+E[T]*E[T]*s,x=Math.pow(1-E[T],2)*a+2*(1-E[T])*E[T]*o+E[T]*E[T]*l,C=Math.pow(w-e,2)+Math.pow(x-t,2),b>=0?C<b&&(b=C):b=C;return b},rF=function(e,t,n,a,i,o){var s=[e-n,t-a],l=[i-n,o-a],u=l[0]*l[0]+l[1]*l[1],c=s[0]*s[0]+s[1]*s[1],d=s[0]*l[0]+s[1]*l[1],h=d*d/u;return d<0?c:h>u?(e-i)*(e-i)+(t-o)*(t-o):c-h},zt=function(e,t,n){for(var a,i,o,s,l,u=0,c=0;c<n.length/2;c++)if(a=n[c*2],i=n[c*2+1],c+1<n.length/2?(o=n[(c+1)*2],s=n[(c+1)*2+1]):(o=n[(c+1-n.length/2)*2],s=n[(c+1-n.length/2)*2+1]),!(a==e&&o==e))if(a>=e&&e>=o||a<=e&&e<=o)l=(e-a)/(o-a)*(s-i)+i,l>t&&u++;else continue;return u%2!==0},Jn=function(e,t,n,a,i,o,s,l,u){var c=new Array(n.length),d;l[0]!=null?(d=Math.atan(l[1]/l[0]),l[0]<0?d=d+Math.PI/2:d=-d-Math.PI/2):d=l;for(var h=Math.cos(-d),g=Math.sin(-d),p=0;p<c.length/2;p++)c[p*2]=o/2*(n[p*2]*h-n[p*2+1]*g),c[p*2+1]=s/2*(n[p*2+1]*h+n[p*2]*g),c[p*2]+=a,c[p*2+1]+=i;var E;if(u>0){var m=Xu(c,-u);E=Zu(m)}else E=c;return zt(e,t,E)},tF=function(e,t,n,a,i,o,s,l){for(var u=new Array(n.length*2),c=0;c<l.length;c++){var d=l[c];u[c*4+0]=d.startX,u[c*4+1]=d.startY,u[c*4+2]=d.stopX,u[c*4+3]=d.stopY;var h=Math.pow(d.cx-e,2)+Math.pow(d.cy-t,2);if(h<=Math.pow(d.radius,2))return!0}return zt(e,t,u)},Zu=function(e){for(var t=new Array(e.length/2),n,a,i,o,s,l,u,c,d=0;d<e.length/4;d++){n=e[d*4],a=e[d*4+1],i=e[d*4+2],o=e[d*4+3],d<e.length/4-1?(s=e[(d+1)*4],l=e[(d+1)*4+1],u=e[(d+1)*4+2],c=e[(d+1)*4+3]):(s=e[0],l=e[1],u=e[2],c=e[3]);var h=Ea(n,a,i,o,s,l,u,c,!0);t[d*2]=h[0],t[d*2+1]=h[1]}return t},Xu=function(e,t){for(var n=new Array(e.length*2),a,i,o,s,l=0;l<e.length/2;l++){a=e[l*2],i=e[l*2+1],l<e.length/2-1?(o=e[(l+1)*2],s=e[(l+1)*2+1]):(o=e[0],s=e[1]);var u=s-i,c=-(o-a),d=Math.sqrt(u*u+c*c),h=u/d,g=c/d;n[l*4]=a+h*t,n[l*4+1]=i+g*t,n[l*4+2]=o+h*t,n[l*4+3]=s+g*t}return n},nF=function(e,t,n,a,i,o){var s=n-e,l=a-t;s/=i,l/=o;var u=Math.sqrt(s*s+l*l),c=u-1;if(c<0)return[];var d=c/u;return[(n-e)*d+e,(a-t)*d+t]},ii=function(e,t,n,a,i,o,s){return e-=i,t-=o,e/=n/2+s,t/=a/2+s,e*e+t*t<=1},zo=function(e,t,n,a,i,o,s){var l=[n-e,a-t],u=[e-i,t-o],c=l[0]*l[0]+l[1]*l[1],d=2*(u[0]*l[0]+u[1]*l[1]),h=u[0]*u[0]+u[1]*u[1]-s*s,g=d*d-4*c*h;if(g<0)return[];var p=(-d+Math.sqrt(g))/(2*c),E=(-d-Math.sqrt(g))/(2*c),m=Math.min(p,E),b=Math.max(p,E),w=[];if(m>=0&&m<=1&&w.push(m),b>=0&&b<=1&&w.push(b),w.length===0)return[];var x=w[0]*l[0]+e,C=w[0]*l[1]+t;if(w.length>1){if(w[0]==w[1])return[x,C];var T=w[1]*l[0]+e,S=w[1]*l[1]+t;return[x,C,T,S]}else return[x,C]},Dc=function(e,t,n){return t<=e&&e<=n||n<=e&&e<=t?e:e<=t&&t<=n||n<=t&&t<=e?t:n},Ea=function(e,t,n,a,i,o,s,l,u){var c=e-i,d=n-e,h=s-i,g=t-o,p=a-t,E=l-o,m=h*g-E*c,b=d*g-p*c,w=E*d-h*p;if(w!==0){var x=m/w,C=b/w,T=.001,S=0-T,_=1+T;return S<=x&&x<=_&&S<=C&&C<=_?[e+x*d,t+x*p]:u?[e+x*d,t+x*p]:[]}else return m===0||b===0?Dc(e,n,s)===s?[s,l]:Dc(e,n,i)===i?[i,o]:Dc(i,s,n)===n?[n,a]:[]:[]},aF=function(e,t,n,a,i){var o=[],s=a/2,l=i/2,u=t,c=n;o.push({x:u+s*e[0],y:c+l*e[1]});for(var d=1;d<e.length/2;d++)o.push({x:u+s*e[d*2],y:c+l*e[d*2+1]});return o},as=function(e,t,n,a,i,o,s,l){var u=[],c,d=new Array(n.length),h=!0;o==null&&(h=!1);var g;if(h){for(var p=0;p<d.length/2;p++)d[p*2]=n[p*2]*o+a,d[p*2+1]=n[p*2+1]*s+i;if(l>0){var E=Xu(d,-l);g=Zu(E)}else g=d}else g=n;for(var m,b,w,x,C=0;C<g.length/2;C++)m=g[C*2],b=g[C*2+1],C<g.length/2-1?(w=g[(C+1)*2],x=g[(C+1)*2+1]):(w=g[0],x=g[1]),c=Ea(e,t,a,i,m,b,w,x),c.length!==0&&u.push(c[0],c[1]);return u},iF=function(e,t,n,a,i,o,s,l,u){var c=[],d,h=new Array(n.length*2);u.forEach(function(w,x){x===0?(h[h.length-2]=w.startX,h[h.length-1]=w.startY):(h[x*4-2]=w.startX,h[x*4-1]=w.startY),h[x*4]=w.stopX,h[x*4+1]=w.stopY,d=zo(e,t,a,i,w.cx,w.cy,w.radius),d.length!==0&&c.push(d[0],d[1])});for(var g=0;g<h.length/4;g++)d=Ea(e,t,a,i,h[g*4],h[g*4+1],h[g*4+2],h[g*4+3],!1),d.length!==0&&c.push(d[0],d[1]);if(c.length>2){for(var p=[c[0],c[1]],E=Math.pow(p[0]-e,2)+Math.pow(p[1]-t,2),m=1;m<c.length/2;m++){var b=Math.pow(c[m*2]-e,2)+Math.pow(c[m*2+1]-t,2);b<=E&&(p[0]=c[m*2],p[1]=c[m*2+1],E=b)}return p}return c},xu=function(e,t,n){var a=[e[0]-t[0],e[1]-t[1]],i=Math.sqrt(a[0]*a[0]+a[1]*a[1]),o=(i-n)/i;return o<0&&(o=1e-5),[t[0]+o*a[0],t[1]+o*a[1]]},It=function(e,t){var n=fm(e,t);return n=RR(n),n},RR=function(e){for(var t,n,a=e.length/2,i=1/0,o=1/0,s=-1/0,l=-1/0,u=0;u<a;u++)t=e[2*u],n=e[2*u+1],i=Math.min(i,t),s=Math.max(s,t),o=Math.min(o,n),l=Math.max(l,n);for(var c=2/(s-i),d=2/(l-o),h=0;h<a;h++)t=e[2*h]=e[2*h]*c,n=e[2*h+1]=e[2*h+1]*d,i=Math.min(i,t),s=Math.max(s,t),o=Math.min(o,n),l=Math.max(l,n);if(o<-1)for(var g=0;g<a;g++)n=e[2*g+1]=e[2*g+1]+(-1-o);return e},fm=function(e,t){var n=1/e*2*Math.PI,a=e%2===0?Math.PI/2+n/2:Math.PI/2;a+=t;for(var i=new Array(e*2),o,s=0;s<e;s++)o=s*n+a,i[2*s]=Math.cos(o),i[2*s+1]=Math.sin(-o);return i},Aa=function(e,t){return Math.min(e/4,t/4,8)},AR=function(e,t){return Math.min(e/10,t/10,8)},zm=function(){return 8},oF=function(e,t,n){return[e-2*t+n,2*(t-e),e]},cm=function(e,t){return{heightOffset:Math.min(15,.05*t),widthOffset:Math.min(100,.25*e),ctrlPtOffsetPct:.05}};function Ic(r,e){function t(d){for(var h=[],g=0;g<d.length;g++){var p=d[g],E=d[(g+1)%d.length],m={x:E.x-p.x,y:E.y-p.y},b={x:-m.y,y:m.x},w=Math.sqrt(b.x*b.x+b.y*b.y);h.push({x:b.x/w,y:b.y/w})}return h}function n(d,h){var g=1/0,p=-1/0,E=$t(d),m;try{for(E.s();!(m=E.n()).done;){var b=m.value,w=b.x*h.x+b.y*h.y;g=Math.min(g,w),p=Math.max(p,w)}}catch(x){E.e(x)}finally{E.f()}return{min:g,max:p}}function a(d,h){return!(d.max<h.min||h.max<d.min)}var i=[].concat(Hu(t(r)),Hu(t(e))),o=$t(i),s;try{for(o.s();!(s=o.n()).done;){var l=s.value,u=n(r,l),c=n(e,l);if(!a(u,c))return!1}}catch(d){o.e(d)}finally{o.f()}return!0}var sF=yt({dampingFactor:.8,precision:1e-6,iterations:200,weight:function(e){return 1}}),uF={pageRank:function(e){for(var t=sF(e),n=t.dampingFactor,a=t.precision,i=t.iterations,o=t.weight,s=this._private.cy,l=this.byGroup(),u=l.nodes,c=l.edges,d=u.length,h=d*d,g=c.length,p=new Array(h),E=new Array(d),m=(1-n)/d,b=0;b<d;b++){for(var w=0;w<d;w++){var x=b*d+w;p[x]=0}E[b]=0}for(var C=0;C<g;C++){var T=c[C],S=T.data("source"),_=T.data("target");if(S!==_){var A=u.indexOfId(S),P=u.indexOfId(_),D=o(T),I=P*d+A;p[I]+=D,E[A]+=D}}for(var M=1/d+m,k=0;k<d;k++)if(E[k]===0)for(var N=0;N<d;N++){var z=N*d+k;p[z]=M}else for(var W=0;W<d;W++){var q=W*d+k;p[q]=p[q]/E[k]+m}for(var $=new Array(d),X=new Array(d),Y,K=0;K<d;K++)$[K]=1;for(var ee=0;ee<i;ee++){for(var le=0;le<d;le++)X[le]=0;for(var G=0;G<d;G++)for(var V=0;V<d;V++){var j=G*d+V;X[G]+=p[j]*$[V]}VN(X),Y=$,$=X,X=Y;for(var re=0,ce=0;ce<d;ce++){var se=Y[ce]-$[ce];re+=se*se}if(re<a)break}var Z={rank:function(ae){return ae=s.collection(ae)[0],$[u.indexOf(ae)]}};return Z}},vw=yt({root:null,weight:function(e){return 1},directed:!1,alpha:0}),Xi={degreeCentralityNormalized:function(e){e=vw(e);var t=this.cy(),n=this.nodes(),a=n.length;if(e.directed){for(var c={},d={},h=0,g=0,p=0;p<a;p++){var E=n[p],m=E.id();e.root=E;var b=this.degreeCentrality(e);h<b.indegree&&(h=b.indegree),g<b.outdegree&&(g=b.outdegree),c[m]=b.indegree,d[m]=b.outdegree}return{indegree:function(x){return h==0?0:(Ke(x)&&(x=t.filter(x)),c[x.id()]/h)},outdegree:function(x){return g===0?0:(Ke(x)&&(x=t.filter(x)),d[x.id()]/g)}}}else{for(var i={},o=0,s=0;s<a;s++){var l=n[s];e.root=l;var u=this.degreeCentrality(e);o<u.degree&&(o=u.degree),i[l.id()]=u.degree}return{degree:function(x){return o===0?0:(Ke(x)&&(x=t.filter(x)),i[x.id()]/o)}}}},degreeCentrality:function(e){e=vw(e);var t=this.cy(),n=this,a=e,i=a.root,o=a.weight,s=a.directed,l=a.alpha;if(i=t.collection(i)[0],s){for(var g=i.connectedEdges(),p=g.filter(function(S){return S.target().same(i)&&n.has(S)}),E=g.filter(function(S){return S.source().same(i)&&n.has(S)}),m=p.length,b=E.length,w=0,x=0,C=0;C<p.length;C++)w+=o(p[C]);for(var T=0;T<E.length;T++)x+=o(E[T]);return{indegree:Math.pow(m,1-l)*Math.pow(w,l),outdegree:Math.pow(b,1-l)*Math.pow(x,l)}}else{for(var u=i.connectedEdges().intersection(n),c=u.length,d=0,h=0;h<u.length;h++)d+=o(u[h]);return{degree:Math.pow(c,1-l)*Math.pow(d,l)}}}};Xi.dc=Xi.degreeCentrality;Xi.dcn=Xi.degreeCentralityNormalised=Xi.degreeCentralityNormalized;var hw=yt({harmonic:!0,weight:function(){return 1},directed:!1,root:null}),Qi={closenessCentralityNormalized:function(e){for(var t=hw(e),n=t.harmonic,a=t.weight,i=t.directed,o=this.cy(),s={},l=0,u=this.nodes(),c=this.floydWarshall({weight:a,directed:i}),d=0;d<u.length;d++){for(var h=0,g=u[d],p=0;p<u.length;p++)if(d!==p){var E=c.distance(g,u[p]);n?h+=1/E:h+=E}n||(h=1/h),l<h&&(l=h),s[g.id()]=h}return{closeness:function(b){return l==0?0:(Ke(b)?b=o.filter(b)[0].id():b=b.id(),s[b]/l)}}},closenessCentrality:function(e){var t=hw(e),n=t.root,a=t.weight,i=t.directed,o=t.harmonic;n=this.filter(n)[0];for(var s=this.dijkstra({root:n,weight:a,directed:i}),l=0,u=this.nodes(),c=0;c<u.length;c++){var d=u[c];if(!d.same(n)){var h=s.distanceTo(d);o?l+=1/h:l+=h}}return o?l:1/l}};Qi.cc=Qi.closenessCentrality;Qi.ccn=Qi.closenessCentralityNormalised=Qi.closenessCentralityNormalized;var lF=yt({weight:null,directed:!1}),dm={betweennessCentrality:function(e){for(var t=lF(e),n=t.directed,a=t.weight,i=a!=null,o=this.cy(),s=this.nodes(),l={},u={},c=0,d={set:function(x,C){u[x]=C,C>c&&(c=C)},get:function(x){return u[x]}},h=0;h<s.length;h++){var g=s[h],p=g.id();n?l[p]=g.outgoers().nodes():l[p]=g.openNeighborhood().nodes(),d.set(p,0)}for(var E=function(){for(var x=s[m].id(),C=[],T={},S={},_={},A=new bs(function(G,V){return _[G]-_[V]}),P=0;P<s.length;P++){var D=s[P].id();T[D]=[],S[D]=0,_[D]=1/0}for(S[x]=1,_[x]=0,A.push(x);!A.empty();){var I=A.pop();if(C.push(I),i)for(var M=0;M<l[I].length;M++){var k=l[I][M],N=o.getElementById(I),z=void 0;N.edgesTo(k).length>0?z=N.edgesTo(k)[0]:z=k.edgesTo(N)[0];var W=a(z);k=k.id(),_[k]>_[I]+W&&(_[k]=_[I]+W,A.nodes.indexOf(k)<0?A.push(k):A.updateItem(k),S[k]=0,T[k]=[]),_[k]==_[I]+W&&(S[k]=S[k]+S[I],T[k].push(I))}else for(var q=0;q<l[I].length;q++){var $=l[I][q].id();_[$]==1/0&&(A.push($),_[$]=_[I]+1),_[$]==_[I]+1&&(S[$]=S[$]+S[I],T[$].push(I))}}for(var X={},Y=0;Y<s.length;Y++)X[s[Y].id()]=0;for(;C.length>0;){for(var K=C.pop(),ee=0;ee<T[K].length;ee++){var le=T[K][ee];X[le]=X[le]+S[le]/S[K]*(1+X[K])}K!=s[m].id()&&d.set(K,d.get(K)+X[K])}},m=0;m<s.length;m++)E();var b={betweenness:function(x){var C=o.collection(x).id();return d.get(C)},betweennessNormalized:function(x){if(c==0)return 0;var C=o.collection(x).id();return d.get(C)/c}};return b.betweennessNormalised=b.betweennessNormalized,b}};dm.bc=dm.betweennessCentrality;var fF=yt({expandFactor:2,inflateFactor:2,multFactor:1,maxIterations:20,attributes:[function(r){return 1}]}),cF=function(e){return fF(e)},dF=function(e,t){for(var n=0,a=0;a<t.length;a++)n+=t[a](e);return n},vF=function(e,t,n){for(var a=0;a<t;a++)e[a*t+a]=n},PR=function(e,t){for(var n,a=0;a<t;a++){n=0;for(var i=0;i<t;i++)n+=e[i*t+a];for(var o=0;o<t;o++)e[o*t+a]=e[o*t+a]/n}},hF=function(e,t,n){for(var a=new Array(n*n),i=0;i<n;i++){for(var o=0;o<n;o++)a[i*n+o]=0;for(var s=0;s<n;s++)for(var l=0;l<n;l++)a[i*n+l]+=e[i*n+s]*t[s*n+l]}return a},gF=function(e,t,n){for(var a=e.slice(0),i=1;i<n;i++)e=hF(e,a,t);return e},pF=function(e,t,n){for(var a=new Array(t*t),i=0;i<t*t;i++)a[i]=Math.pow(e[i],n);return PR(a,t),a},yF=function(e,t,n,a){for(var i=0;i<n;i++){var o=Math.round(e[i]*Math.pow(10,a))/Math.pow(10,a),s=Math.round(t[i]*Math.pow(10,a))/Math.pow(10,a);if(o!==s)return!1}return!0},mF=function(e,t,n,a){for(var i=[],o=0;o<t;o++){for(var s=[],l=0;l<t;l++)Math.round(e[o*t+l]*1e3)/1e3>0&&s.push(n[l]);s.length!==0&&i.push(a.collection(s))}return i},bF=function(e,t){for(var n=0;n<e.length;n++)if(!t[n]||e[n].id()!==t[n].id())return!1;return!0},wF=function(e){for(var t=0;t<e.length;t++)for(var n=0;n<e.length;n++)t!=n&&bF(e[t],e[n])&&e.splice(n,1);return e},gw=function(e){for(var t=this.nodes(),n=this.edges(),a=this.cy(),i=cF(e),o={},s=0;s<t.length;s++)o[t[s].id()]=s;for(var l=t.length,u=l*l,c=new Array(u),d,h=0;h<u;h++)c[h]=0;for(var g=0;g<n.length;g++){var p=n[g],E=o[p.source().id()],m=o[p.target().id()],b=dF(p,i.attributes);c[E*l+m]+=b,c[m*l+E]+=b}vF(c,l,i.multFactor),PR(c,l);for(var w=!0,x=0;w&&x<i.maxIterations;)w=!1,d=gF(c,l,i.expandFactor),c=pF(d,l,i.inflateFactor),yF(c,d,u,4)||(w=!0),x++;var C=mF(c,l,t,a);return C=wF(C),C},xF={markovClustering:gw,mcl:gw},EF=function(e){return e},DR=function(e,t){return Math.abs(t-e)},pw=function(e,t,n){return e+DR(t,n)},yw=function(e,t,n){return e+Math.pow(n-t,2)},CF=function(e){return Math.sqrt(e)},_F=function(e,t,n){return Math.max(e,DR(t,n))},ko=function(e,t,n,a,i){for(var o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:EF,s=a,l,u,c=0;c<e;c++)l=t(c),u=n(c),s=i(s,l,u);return o(s)},no={euclidean:function(e,t,n){return e>=2?ko(e,t,n,0,yw,CF):ko(e,t,n,0,pw)},squaredEuclidean:function(e,t,n){return ko(e,t,n,0,yw)},manhattan:function(e,t,n){return ko(e,t,n,0,pw)},max:function(e,t,n){return ko(e,t,n,-1/0,_F)}};no["squared-euclidean"]=no.squaredEuclidean;no.squaredeuclidean=no.squaredEuclidean;function vl(r,e,t,n,a,i){var o;return Fr(r)?o=r:o=no[r]||no.euclidean,e===0&&Fr(r)?o(a,i):o(e,t,n,a,i)}var SF=yt({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),$m=function(e){return SF(e)},Qu=function(e,t,n,a,i){var o=i!=="kMedoids",s=o?function(d){return n[d]}:function(d){return a[d](n)},l=function(h){return a[h](t)},u=n,c=t;return vl(e,a.length,s,l,u,c)},Bc=function(e,t,n){for(var a=n.length,i=new Array(a),o=new Array(a),s=new Array(t),l=null,u=0;u<a;u++)i[u]=e.min(n[u]).value,o[u]=e.max(n[u]).value;for(var c=0;c<t;c++){l=[];for(var d=0;d<a;d++)l[d]=Math.random()*(o[d]-i[d])+i[d];s[c]=l}return s},IR=function(e,t,n,a,i){for(var o=1/0,s=0,l=0;l<t.length;l++){var u=Qu(n,e,t[l],a,i);u<o&&(o=u,s=l)}return s},BR=function(e,t,n){for(var a=[],i=null,o=0;o<t.length;o++)i=t[o],n[i.id()]===e&&a.push(i);return a},TF=function(e,t,n){return Math.abs(t-e)<=n},RF=function(e,t,n){for(var a=0;a<e.length;a++)for(var i=0;i<e[a].length;i++){var o=Math.abs(e[a][i]-t[a][i]);if(o>n)return!1}return!0},AF=function(e,t,n){for(var a=0;a<n;a++)if(e===t[a])return!0;return!1},mw=function(e,t){var n=new Array(t);if(e.length<50)for(var a=0;a<t;a++){for(var i=e[Math.floor(Math.random()*e.length)];AF(i,n,a);)i=e[Math.floor(Math.random()*e.length)];n[a]=i}else for(var o=0;o<t;o++)n[o]=e[Math.floor(Math.random()*e.length)];return n},bw=function(e,t,n){for(var a=0,i=0;i<t.length;i++)a+=Qu("manhattan",t[i],e,n,"kMedoids");return a},PF=function(e){var t=this.cy(),n=this.nodes(),a=null,i=$m(e),o=new Array(i.k),s={},l;i.testMode?typeof i.testCentroids=="number"?(i.testCentroids,l=Bc(n,i.k,i.attributes)):tt(i.testCentroids)==="object"?l=i.testCentroids:l=Bc(n,i.k,i.attributes):l=Bc(n,i.k,i.attributes);for(var u=!0,c=0;u&&c<i.maxIterations;){for(var d=0;d<n.length;d++)a=n[d],s[a.id()]=IR(a,l,i.distance,i.attributes,"kMeans");u=!1;for(var h=0;h<i.k;h++){var g=BR(h,n,s);if(g.length!==0){for(var p=i.attributes.length,E=l[h],m=new Array(p),b=new Array(p),w=0;w<p;w++){b[w]=0;for(var x=0;x<g.length;x++)a=g[x],b[w]+=i.attributes[w](a);m[w]=b[w]/g.length,TF(m[w],E[w],i.sensitivityThreshold)||(u=!0)}l[h]=m,o[h]=t.collection(g)}}c++}return o},DF=function(e){var t=this.cy(),n=this.nodes(),a=null,i=$m(e),o=new Array(i.k),s,l={},u,c=new Array(i.k);i.testMode?typeof i.testCentroids=="number"||(tt(i.testCentroids)==="object"?s=i.testCentroids:s=mw(n,i.k)):s=mw(n,i.k);for(var d=!0,h=0;d&&h<i.maxIterations;){for(var g=0;g<n.length;g++)a=n[g],l[a.id()]=IR(a,s,i.distance,i.attributes,"kMedoids");d=!1;for(var p=0;p<s.length;p++){var E=BR(p,n,l);if(E.length!==0){c[p]=bw(s[p],E,i.attributes);for(var m=0;m<E.length;m++)u=bw(E[m],E,i.attributes),u<c[p]&&(c[p]=u,s[p]=E[m],d=!0);o[p]=t.collection(E)}}h++}return o},IF=function(e,t,n,a,i){for(var o,s,l=0;l<t.length;l++)for(var u=0;u<e.length;u++)a[l][u]=Math.pow(n[l][u],i.m);for(var c=0;c<e.length;c++)for(var d=0;d<i.attributes.length;d++){o=0,s=0;for(var h=0;h<t.length;h++)o+=a[h][c]*i.attributes[d](t[h]),s+=a[h][c];e[c][d]=o/s}},BF=function(e,t,n,a,i){for(var o=0;o<e.length;o++)t[o]=e[o].slice();for(var s,l,u,c=2/(i.m-1),d=0;d<n.length;d++)for(var h=0;h<a.length;h++){s=0;for(var g=0;g<n.length;g++)l=Qu(i.distance,a[h],n[d],i.attributes,"cmeans"),u=Qu(i.distance,a[h],n[g],i.attributes,"cmeans"),s+=Math.pow(l/u,c);e[h][d]=1/s}},kF=function(e,t,n,a){for(var i=new Array(n.k),o=0;o<i.length;o++)i[o]=[];for(var s,l,u=0;u<t.length;u++){s=-1/0,l=-1;for(var c=0;c<t[0].length;c++)t[u][c]>s&&(s=t[u][c],l=c);i[l].push(e[u])}for(var d=0;d<i.length;d++)i[d]=a.collection(i[d]);return i},ww=function(e){var t=this.cy(),n=this.nodes(),a=$m(e),i,o,s,l,u;l=new Array(n.length);for(var c=0;c<n.length;c++)l[c]=new Array(a.k);s=new Array(n.length);for(var d=0;d<n.length;d++)s[d]=new Array(a.k);for(var h=0;h<n.length;h++){for(var g=0,p=0;p<a.k;p++)s[h][p]=Math.random(),g+=s[h][p];for(var E=0;E<a.k;E++)s[h][E]=s[h][E]/g}o=new Array(a.k);for(var m=0;m<a.k;m++)o[m]=new Array(a.attributes.length);u=new Array(n.length);for(var b=0;b<n.length;b++)u[b]=new Array(a.k);for(var w=!0,x=0;w&&x<a.maxIterations;)w=!1,IF(o,n,s,u,a),BF(s,l,o,n,a),RF(s,l,a.sensitivityThreshold)||(w=!0),x++;return i=kF(n,s,a,t),{clusters:i,degreeOfMembership:s}},MF={kMeans:PF,kMedoids:DF,fuzzyCMeans:ww,fcm:ww},LF=yt({distance:"euclidean",linkage:"min",mode:"threshold",threshold:1/0,addDendrogram:!1,dendrogramDepth:0,attributes:[]}),OF={single:"min",complete:"max"},qF=function(e){var t=LF(e),n=OF[t.linkage];return n!=null&&(t.linkage=n),t},xw=function(e,t,n,a,i){for(var o=0,s=1/0,l,u=i.attributes,c=function(P,D){return vl(i.distance,u.length,function(I){return u[I](P)},function(I){return u[I](D)},P,D)},d=0;d<e.length;d++){var h=e[d].key,g=n[h][a[h]];g<s&&(o=h,s=g)}if(i.mode==="threshold"&&s>=i.threshold||i.mode==="dendrogram"&&e.length===1)return!1;var p=t[o],E=t[a[o]],m;i.mode==="dendrogram"?m={left:p,right:E,key:p.key}:m={value:p.value.concat(E.value),key:p.key},e[p.index]=m,e.splice(E.index,1),t[p.key]=m;for(var b=0;b<e.length;b++){var w=e[b];p.key===w.key?l=1/0:i.linkage==="min"?(l=n[p.key][w.key],n[p.key][w.key]>n[E.key][w.key]&&(l=n[E.key][w.key])):i.linkage==="max"?(l=n[p.key][w.key],n[p.key][w.key]<n[E.key][w.key]&&(l=n[E.key][w.key])):i.linkage==="mean"?l=(n[p.key][w.key]*p.size+n[E.key][w.key]*E.size)/(p.size+E.size):i.mode==="dendrogram"?l=c(w.value,p.value):l=c(w.value[0],p.value[0]),n[p.key][w.key]=n[w.key][p.key]=l}for(var x=0;x<e.length;x++){var C=e[x].key;if(a[C]===p.key||a[C]===E.key){for(var T=C,S=0;S<e.length;S++){var _=e[S].key;n[C][_]<n[C][T]&&(T=_)}a[C]=T}e[x].index=x}return p.key=E.key=p.index=E.index=null,!0},Ki=function(e,t,n){e&&(e.value?t.push(e.value):(e.left&&Ki(e.left,t),e.right&&Ki(e.right,t)))},vm=function(e,t){if(!e)return"";if(e.left&&e.right){var n=vm(e.left,t),a=vm(e.right,t),i=t.add({group:"nodes",data:{id:n+","+a}});return t.add({group:"edges",data:{source:n,target:i.id()}}),t.add({group:"edges",data:{source:a,target:i.id()}}),i.id()}else if(e.value)return e.value.id()},hm=function(e,t,n){if(!e)return[];var a=[],i=[],o=[];return t===0?(e.left&&Ki(e.left,a),e.right&&Ki(e.right,i),o=a.concat(i),[n.collection(o)]):t===1?e.value?[n.collection(e.value)]:(e.left&&Ki(e.left,a),e.right&&Ki(e.right,i),[n.collection(a),n.collection(i)]):e.value?[n.collection(e.value)]:(e.left&&(a=hm(e.left,t-1,n)),e.right&&(i=hm(e.right,t-1,n)),a.concat(i))},Ew=function(e){for(var t=this.cy(),n=this.nodes(),a=qF(e),i=a.attributes,o=function(x,C){return vl(a.distance,i.length,function(T){return i[T](x)},function(T){return i[T](C)},x,C)},s=[],l=[],u=[],c=[],d=0;d<n.length;d++){var h={value:a.mode==="dendrogram"?n[d]:[n[d]],key:d,index:d};s[d]=h,c[d]=h,l[d]=[],u[d]=0}for(var g=0;g<s.length;g++)for(var p=0;p<=g;p++){var E=void 0;a.mode==="dendrogram"?E=g===p?1/0:o(s[g].value,s[p].value):E=g===p?1/0:o(s[g].value[0],s[p].value[0]),l[g][p]=E,l[p][g]=E,E<l[g][u[g]]&&(u[g]=p)}for(var m=xw(s,c,l,u,a);m;)m=xw(s,c,l,u,a);var b;return a.mode==="dendrogram"?(b=hm(s[0],a.dendrogramDepth,t),a.addDendrogram&&vm(s[0],t)):(b=new Array(s.length),s.forEach(function(w,x){w.key=w.index=null,b[x]=t.collection(w.value)})),b},NF={hierarchicalClustering:Ew,hca:Ew},FF=yt({distance:"euclidean",preference:"median",damping:.8,maxIterations:1e3,minIterations:100,attributes:[]}),zF=function(e){var t=e.damping,n=e.preference;.5<=t&&t<1||Lr("Damping must range on [0.5, 1). Got: ".concat(t));var a=["median","mean","min","max"];return a.some(function(i){return i===n})||ke(n)||Lr("Preference must be one of [".concat(a.map(function(i){return"'".concat(i,"'")}).join(", "),"] or a number. Got: ").concat(n)),FF(e)},$F=function(e,t,n,a){var i=function(s,l){return a[l](s)};return-vl(e,a.length,function(o){return i(t,o)},function(o){return i(n,o)},t,n)},VF=function(e,t){var n=null;return t==="median"?n=zN(e):t==="mean"?n=FN(e):t==="min"?n=qN(e):t==="max"?n=NN(e):n=t,n},GF=function(e,t,n){for(var a=[],i=0;i<e;i++)t[i*e+i]+n[i*e+i]>0&&a.push(i);return a},Cw=function(e,t,n){for(var a=[],i=0;i<e;i++){for(var o=-1,s=-1/0,l=0;l<n.length;l++){var u=n[l];t[i*e+u]>s&&(o=u,s=t[i*e+u])}o>0&&a.push(o)}for(var c=0;c<n.length;c++)a[n[c]]=n[c];return a},WF=function(e,t,n){for(var a=Cw(e,t,n),i=0;i<n.length;i++){for(var o=[],s=0;s<a.length;s++)a[s]===n[i]&&o.push(s);for(var l=-1,u=-1/0,c=0;c<o.length;c++){for(var d=0,h=0;h<o.length;h++)d+=t[o[h]*e+o[c]];d>u&&(l=c,u=d)}n[i]=o[l]}return a=Cw(e,t,n),a},_w=function(e){for(var t=this.cy(),n=this.nodes(),a=zF(e),i={},o=0;o<n.length;o++)i[n[o].id()]=o;var s,l,u,c,d,h;s=n.length,l=s*s,u=new Array(l);for(var g=0;g<l;g++)u[g]=-1/0;for(var p=0;p<s;p++)for(var E=0;E<s;E++)p!==E&&(u[p*s+E]=$F(a.distance,n[p],n[E],a.attributes));c=VF(u,a.preference);for(var m=0;m<s;m++)u[m*s+m]=c;d=new Array(l);for(var b=0;b<l;b++)d[b]=0;h=new Array(l);for(var w=0;w<l;w++)h[w]=0;for(var x=new Array(s),C=new Array(s),T=new Array(s),S=0;S<s;S++)x[S]=0,C[S]=0,T[S]=0;for(var _=new Array(s*a.minIterations),A=0;A<_.length;A++)_[A]=0;var P;for(P=0;P<a.maxIterations;P++){for(var D=0;D<s;D++){for(var I=-1/0,M=-1/0,k=-1,N=0,z=0;z<s;z++)x[z]=d[D*s+z],N=h[D*s+z]+u[D*s+z],N>=I?(M=I,I=N,k=z):N>M&&(M=N);for(var W=0;W<s;W++)d[D*s+W]=(1-a.damping)*(u[D*s+W]-I)+a.damping*x[W];d[D*s+k]=(1-a.damping)*(u[D*s+k]-M)+a.damping*x[k]}for(var q=0;q<s;q++){for(var $=0,X=0;X<s;X++)x[X]=h[X*s+q],C[X]=Math.max(0,d[X*s+q]),$+=C[X];$-=C[q],C[q]=d[q*s+q],$+=C[q];for(var Y=0;Y<s;Y++)h[Y*s+q]=(1-a.damping)*Math.min(0,$-C[Y])+a.damping*x[Y];h[q*s+q]=(1-a.damping)*($-C[q])+a.damping*x[q]}for(var K=0,ee=0;ee<s;ee++){var le=h[ee*s+ee]+d[ee*s+ee]>0?1:0;_[P%a.minIterations*s+ee]=le,K+=le}if(K>0&&(P>=a.minIterations-1||P==a.maxIterations-1)){for(var G=0,V=0;V<s;V++){T[V]=0;for(var j=0;j<a.minIterations;j++)T[V]+=_[j*s+V];(T[V]===0||T[V]===a.minIterations)&&G++}if(G===s)break}}for(var re=GF(s,d,h),ce=WF(s,u,re),se={},Z=0;Z<re.length;Z++)se[re[Z]]=[];for(var Q=0;Q<n.length;Q++){var ae=i[n[Q].id()],ne=ce[ae];ne!=null&&se[ne].push(n[Q])}for(var de=new Array(re.length),Ce=0;Ce<re.length;Ce++)de[Ce]=t.collection(se[re[Ce]]);return de},UF={affinityPropagation:_w,ap:_w},HF=yt({root:void 0,directed:!1}),KF={hierholzer:function(e){if(!pr(e)){var t=arguments;e={root:t[0],directed:t[1]}}var n=HF(e),a=n.root,i=n.directed,o=this,s=!1,l,u,c;a&&(c=Ke(a)?this.filter(a)[0].id():a[0].id());var d={},h={};i?o.forEach(function(w){var x=w.id();if(w.isNode()){var C=w.indegree(!0),T=w.outdegree(!0),S=C-T,_=T-C;S==1?l?s=!0:l=x:_==1?u?s=!0:u=x:(_>1||S>1)&&(s=!0),d[x]=[],w.outgoers().forEach(function(A){A.isEdge()&&d[x].push(A.id())})}else h[x]=[void 0,w.target().id()]}):o.forEach(function(w){var x=w.id();if(w.isNode()){var C=w.degree(!0);C%2&&(l?u?s=!0:u=x:l=x),d[x]=[],w.connectedEdges().forEach(function(T){return d[x].push(T.id())})}else h[x]=[w.source().id(),w.target().id()]});var g={found:!1,trail:void 0};if(s)return g;if(u&&l)if(i){if(c&&u!=c)return g;c=u}else{if(c&&u!=c&&l!=c)return g;c||(c=u)}else c||(c=o[0].id());var p=function(x){for(var C=x,T=[x],S,_,A;d[C].length;)S=d[C].shift(),_=h[S][0],A=h[S][1],C!=A?(d[A]=d[A].filter(function(P){return P!=S}),C=A):!i&&C!=_&&(d[_]=d[_].filter(function(P){return P!=S}),C=_),T.unshift(S),T.unshift(C);return T},E=[],m=[];for(m=p(c);m.length!=1;)d[m[0]].length==0?(E.unshift(o.getElementById(m.shift())),E.unshift(o.getElementById(m.shift()))):m=p(m.shift()).concat(m);E.unshift(o.getElementById(m.shift()));for(var b in d)if(d[b].length)return g;return g.found=!0,g.trail=this.spawn(E,!0),g}},Eu=function(){var e=this,t={},n=0,a=0,i=[],o=[],s={},l=function(h,g){for(var p=o.length-1,E=[],m=e.spawn();o[p].x!=h||o[p].y!=g;)E.push(o.pop().edge),p--;E.push(o.pop().edge),E.forEach(function(b){var w=b.connectedNodes().intersection(e);m.merge(b),w.forEach(function(x){var C=x.id(),T=x.connectedEdges().intersection(e);m.merge(x),t[C].cutVertex?m.merge(T.filter(function(S){return S.isLoop()})):m.merge(T)})}),i.push(m)},u=function(h,g,p){h===p&&(a+=1),t[g]={id:n,low:n++,cutVertex:!1};var E=e.getElementById(g).connectedEdges().intersection(e);if(E.size()===0)i.push(e.spawn(e.getElementById(g)));else{var m,b,w,x;E.forEach(function(C){m=C.source().id(),b=C.target().id(),w=m===g?b:m,w!==p&&(x=C.id(),s[x]||(s[x]=!0,o.push({x:g,y:w,edge:C})),w in t?t[g].low=Math.min(t[g].low,t[w].id):(u(h,w,g),t[g].low=Math.min(t[g].low,t[w].low),t[g].id<=t[w].low&&(t[g].cutVertex=!0,l(g,w))))})}};e.forEach(function(d){if(d.isNode()){var h=d.id();h in t||(a=0,u(h,h),t[h].cutVertex=a>1)}});var c=Object.keys(t).filter(function(d){return t[d].cutVertex}).map(function(d){return e.getElementById(d)});return{cut:e.spawn(c),components:i}},jF={hopcroftTarjanBiconnected:Eu,htbc:Eu,htb:Eu,hopcroftTarjanBiconnectedComponents:Eu},Cu=function(){var e=this,t={},n=0,a=[],i=[],o=e.spawn(e),s=function(u){i.push(u),t[u]={index:n,low:n++,explored:!1};var c=e.getElementById(u).connectedEdges().intersection(e);if(c.forEach(function(E){var m=E.target().id();m!==u&&(m in t||s(m),t[m].explored||(t[u].low=Math.min(t[u].low,t[m].low)))}),t[u].index===t[u].low){for(var d=e.spawn();;){var h=i.pop();if(d.merge(e.getElementById(h)),t[h].low=t[u].index,t[h].explored=!0,h===u)break}var g=d.edgesWith(d),p=d.merge(g);a.push(p),o=o.difference(p)}};return e.forEach(function(l){if(l.isNode()){var u=l.id();u in t||s(u)}}),{cut:o,components:a}},YF={tarjanStronglyConnected:Cu,tsc:Cu,tscc:Cu,tarjanStronglyConnectedComponents:Cu},kR={};[ts,SN,TN,AN,DN,BN,LN,uF,Xi,Qi,dm,xF,MF,NF,UF,KF,jF,YF].forEach(function(r){Ye(kR,r)});/*!
@@ -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=s3(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),p3(a,"vec2",i.aPosition,t),this.transformBuffer=y3(a,n,i.aTransform),this.indexBuffer=Pn(a,n,"vec4",i.aIndex),this.vertTypeBuffer=Pn(a,n,"int",i.aVertType),this.atlasIdBuffer=Pn(a,n,"int",i.aAtlasId),this.texBuffer=Pn(a,n,"vec4",i.aTex),this.pointAPointBBuffer=Pn(a,n,"vec4",i.aPointAPointB),this.pointCPointDBuffer=Pn(a,n,"vec4",i.aPointCPointD),this.lineWidthBuffer=Pn(a,n,"vec2",i.aLineWidth),this.colorBuffer=Pn(a,n,"vec4",i.aColor),this.cornerRadiusBuffer=Pn(a,n,"vec4",i.aCornerRadius),this.borderColorBuffer=Pn(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 wa(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]:Zo.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===al.IGNORE)return;if(l==al.USE_BB){this.drawPickingRectangle(t,n,a);return}}var u=i.getAtlasInfo(t,a),c=$t(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 m=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]=qd;var _=this.indexBuffer.getView(S);Vi(n,_);var A=this.atlasIdBuffer.getView(S);A[0]=m;var P=this.texBuffer.getView(S);P[0]=C.x,P[1]=C.y,P[2]=C.w,P[3]=C.h;var D=this.transformBuffer.getMatrixView(S);this.setTransformMatrix(t,D,s,h,T),this.instanceCount++,T||this.wrappedCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}}}catch(I){c.e(I)}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;fE(t);var l=a.getRotation?a.getRotation(i):0;if(l!==0){var u=a.getRotationPoint(i),c=u.x,d=u.y;Vu(t,t,[c,d]),cE(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;Vu(t,t,[o,s]),Sm(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]=Gi;var s=this.indexBuffer.getView(o);Vi(n,s);var l=this.colorBuffer.getView(o);Ja([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===Du||s===No){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===No&&(d[0]=0,d[2]=0)}var h=this.indexBuffer.getView(l);Vi(n,h);var g=t.pstyle(o.color).value,p=t.pstyle(o.opacity).value,E=this.colorBuffer.getView(l);Ja(g,p,E);var m=this.lineWidthBuffer.getView(l);if(m[0]=0,m[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);Ja(w,x,C);var T=t.pstyle("border-position").value;if(T==="inside")m[0]=0,m[1]=-b;else if(T==="outside")m[0]=b,m[1]=0;else{var S=b/2;m[0]=S,m[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 Gi;case"ellipse":return Fo;case"roundrectangle":case"round-rectangle":return Du;case"bottom-round-rectangle":return No;default:return}}},{key:"_getCornerRadius",value:function(t,n,a){var i=a.w,o=a.h;if(t.pstyle(n).value==="auto")return Aa(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,m=this.r.getArrowWidth(p,E),b=this.instanceCount,w=this.transformBuffer.getMatrixView(b);fE(w),Vu(w,w,[o,s]),Sm(w,w,[m,m]),cE(w,w,l),this.vertTypeBuffer.getView(b)[0]=Nd;var x=this.indexBuffer.getView(b);Vi(n,x);var C=this.colorBuffer.getView(b);Ja(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]=dE;var d=this.indexBuffer.getView(c);Vi(n,d);var h=this.colorBuffer.getView(c);Ja(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 m=this.instanceCount;this.vertTypeBuffer.getView(m)[0]=vE;var b=this.indexBuffer.getView(m);Vi(n,b);var w=this.colorBuffer.getView(m);Ja(l,u,w);var x=this.lineWidthBuffer.getView(m);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],D=a[E+4],I=a[E+5];E==0&&(C=2*S-A+.001,T=2*_-P+.001),E==a.length-4&&(D=2*A-S+.001,I=2*P-_+.001);var M=this.pointAPointBBuffer.getView(m);M[0]=C,M[1]=T,M[2]=S,M[3]=_;var k=this.pointCPointDBuffer.getView(m);k[0]=A,k[1]=P,k[2]=D,k[3]=I,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=$t(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,l3(this.r)),t.uniformMatrix3fv(o.uPanZoomMatrix,!1,this.panZoomMatrix),t.uniform1i(o.uAtlasSize,this.batchManager.getAtlasSize());var g=Ja(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}}}])})(),qA={};qA.initWebgl=function(r,e){var t=this,n=t.data.contexts[t.WEBGL];r.bgColor=I3(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=m3(n),t.pickingFrameBuffer.needsDraw=!0,t.drawing=new D3(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?al.USE_BB:al.IGNORE},l=function(d){var h=d.position(),g=h.x,p=h.y,E=d.outerWidth(),m=d.outerHeight();return{w:E,h:m,x1:g-E/2,y1:p-m/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:c3,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:Fd(e.getLabelKey,null),getBoundingBox:zd(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:Fd(e.getSourceLabelKey,"source"),getBoundingBox:zd(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:Fd(e.getTargetLabelKey,"target"),getBoundingBox:zd(e.getTargetLabelBox,"target"),drawClipped:!0,drawElement:e.drawTargetLabel,getRotation:a("target"),getRotationPoint:e.getTargetLabelRotationPoint,getRotationOffset:e.getTargetLabelRotationOffset,isVisible:i("target-label")});var u=ms(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()}),B3(t)};function I3(r){var e=r.cy.container(),t=e&&e.style&&e.style.backgroundColor||"white";return cR(t)}function NA(r,e){var t=r._private.rscratch;return Ft(t,"labelWrapCachedLines",e)||[]}var Fd=function(e,t){return function(n){var a=e(n),i=NA(n,t);return i.length>1?i.map(function(o,s){return"".concat(a,"_").concat(s)}):a}},zd=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=NA(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 B3(r){{var e=r.render;r.render=function(i){i=i||{};var o=r.cy;r.webgl&&(o.zoom()>DA?(k3(r),e.call(r,i)):(M3(r),zA(r,i,Zo.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 z3(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 k3(r){var e=r.data.contexts[r.WEBGL];e.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT)}function M3(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 L3(r){var e=r.canvasWidth,t=r.canvasHeight,n=e0(r),a=n.pan,i=n.zoom,o=Od();Vu(o,o,[a.x,a.y]),Sm(o,o,[i,i]);var s=Od();w3(s,e,t);var l=Od();return b3(l,s,o),l}function FA(r,e){var t=r.canvasWidth,n=r.canvasHeight,a=e0(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 O3(r,e){r.drawSelectionRectangle(e,function(t){return FA(r,t)})}function q3(r){var e=r.data.contexts[r.NODE];e.save(),FA(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 N3(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,m=h.height*o,b=.4;l.save(),l.scale(b,b),l.drawImage(h,E,m),l.strokeStyle="black",l.rect(E,m,g,p),l.stroke(),l.restore()}}},t=0;e(r.drawing,"node",t++),e(r.drawing,"label",t++)}function F3(r,e,t,n,a){var i,o,s,l,u=e0(r),c=u.pan,d=u.zoom;{var h=f3(r,c,d,e,t),g=Yr(h,2),p=g[0],E=g[1],m=6;i=p-m/2,o=E-m/2,s=m,l=m}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),zA(r,null,Zo.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),_=v3(S)-1;_>=0&&C.add(_)}return C}function z3(r,e,t){var n=F3(r,e,t),a=r.getCachedZSortedEles(),i,o,s=$t(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 $d(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 zA(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]&&O3(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=L3(r),l=r.getCachedZSortedEles();if(i=l.length,a.startFrame(s,t),t.screen){for(var u=0;u<l.nondrag.length;u++)$d(r,u,l.nondrag[u]);for(var c=0;c<l.drag.length;c++)$d(r,c,l.drag[c])}else if(t.picking)for(var d=0;d<l.length;d++)$d(r,d,l[d]);a.endFrame(),t.screen&&r.webglDebugShowAtlases&&(q3(r),N3(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(),m=["".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(m));else{console.log("WebGL (".concat(t.name,") - frame time ").concat(p,"ms")),console.log("Totals:"),console.log(" ".concat(m)),console.log("Texture Atlases Used:");var b=E.atlasInfo,w=$t(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 Fa={};Fa.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()};Fa.drawRoundPolygonPath=function(r,e,t,n,a,i,o){o.forEach(function(s){return xA(r,s)}),r.closePath()};Fa.drawRoundRectanglePath=function(r,e,t,n,a,i){var o=n/2,s=a/2,l=i==="auto"?Aa(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()};Fa.drawBottomRoundRectanglePath=function(r,e,t,n,a,i){var o=n/2,s=a/2,l=i==="auto"?Aa(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()};Fa.drawCutRectanglePath=function(r,e,t,n,a,i,o){var s=n/2,l=a/2,u=o==="auto"?zm():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()};Fa.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=cm(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 hE=Math.sin(0),gE=Math.cos(0),Tm={},Rm={},$A=Math.PI/40;for(var Wi=0*Math.PI;Wi<2*Math.PI;Wi+=$A)Tm[Wi]=Math.sin(Wi),Rm[Wi]=Math.cos(Wi);Fa.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+=$A)i=e-s*Tm[u]*hE+s*Rm[u]*gE,o=t+l*Rm[u]*hE+l*Tm[u]*gE,u===0?r.moveTo(i,o):r.lineTo(i,o);r.closePath()};var _s={};_s.createBuffer=function(r,e){var t=document.createElement("canvas");return t.width=r,t.height=e,[t,t.getContext("2d")]};_s.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=ke(r.maxWidth)||ke(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;ke(r.maxWidth)&&(c=u*r.maxWidth/i),ke(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(),m={x:E.x*u,y:E.y*u};u*=e.zoom(),g.translate(m.x,m.y),g.scale(u,u),this.drawElements(g,p),g.scale(1/u,1/u),g.translate(-m.x,-m.y)}r.bg&&(g.globalCompositeOperation="destination-over",g.fillStyle=r.bg,g.rect(0,0,i,o),g.fill())}return h};function $3(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 pE(r){var e=r.indexOf(",");return r.substr(e+1)}function VA(r,e,t){var n=function(){return e.toDataURL(t,r.quality)};switch(r.output){case"blob-promise":return new oo(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 $3(pE(n()),t);case"base64":return pE(n());case"base64uri":default:return n()}}_s.png=function(r){return VA(r,this.bufferCanvasImage(r),"image/png")};_s.jpg=function(r){return VA(r,this.bufferCanvasImage(r),"image/jpeg")};var GA={};GA.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 V3=WA,fr=WA.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 WA(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"};Oq()&&(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=Bt(),g=function(Z){return{x:(Z.x1+Z.x2)/2,y:(Z.y1+Z.y2)/2}},p=function(Z){return{x:-Z.w/2,y:-Z.h/2}},E=function(Z){var Q=Z[0]._private,ae=Q.oldBackgroundTimestamp===Q.backgroundTimestamp;return!ae},m=function(Z){return Z[0]._private.nodeKey},b=function(Z){return Z[0]._private.labelStyleKey},w=function(Z){return Z[0]._private.sourceLabelStyleKey},x=function(Z){return Z[0]._private.targetLabelStyleKey},C=function(Z,Q,ae,ne,de){return e.drawElement(Z,Q,ae,!1,!1,de)},T=function(Z,Q,ae,ne,de){return e.drawElementText(Z,Q,ae,ne,"main",de)},S=function(Z,Q,ae,ne,de){return e.drawElementText(Z,Q,ae,ne,"source",de)},_=function(Z,Q,ae,ne,de){return e.drawElementText(Z,Q,ae,ne,"target",de)},A=function(Z){return Z.boundingBox(),Z[0]._private.bodyBounds},P=function(Z){return Z.boundingBox(),Z[0]._private.labelBounds.main||h},D=function(Z){return Z.boundingBox(),Z[0]._private.labelBounds.source||h},I=function(Z){return Z.boundingBox(),Z[0]._private.labelBounds.target||h},M=function(Z,Q){return Q},k=function(Z){return g(A(Z))},N=function(Z,Q,ae){var ne=Z?Z+"-":"";return{x:Q.x+ae.pstyle(ne+"text-margin-x").pfValue,y:Q.y+ae.pstyle(ne+"text-margin-y").pfValue}},z=function(Z,Q,ae){var ne=Z[0]._private.rscratch;return{x:ne[Q],y:ne[ae]}},W=function(Z){return N("",z(Z,"labelX","labelY"),Z)},q=function(Z){return N("source",z(Z,"sourceLabelX","sourceLabelY"),Z)},$=function(Z){return N("target",z(Z,"targetLabelX","targetLabelY"),Z)},X=function(Z){return p(A(Z))},Y=function(Z){return p(D(Z))},K=function(Z){return p(I(Z))},ee=function(Z){var Q=P(Z),ae=p(P(Z));if(Z.isNode()){switch(Z.pstyle("text-halign").value){case"left":ae.x=-Q.w-(Q.leftPad||0);break;case"right":ae.x=-(Q.rightPad||0);break}switch(Z.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 Vo(e,{getKey:m,doesEleInvalidateKey:E,drawElement:C,getBoundingBox:A,getRotationPoint:k,getRotationOffset:X,allowEdgeTxrCaching:!1,allowParentTxrCaching:!1}),G=e.data.lblTxrCache=new Vo(e,{getKey:b,drawElement:T,getBoundingBox:P,getRotationPoint:W,getRotationOffset:ee,isVisible:M}),V=e.data.slbTxrCache=new Vo(e,{getKey:w,drawElement:S,getBoundingBox:D,getRotationPoint:q,getRotationOffset:Y,isVisible:M}),j=e.data.tlbTxrCache=new Vo(e,{getKey:x,drawElement:_,getBoundingBox:I,getRotationPoint:$,getRotationOffset:K,isVisible:M}),re=e.data.lyrTxrCache=new IA(e);e.onUpdateEleCalcs(function(Z,Q){le.invalidateElements(Q),G.invalidateElements(Q),V.invalidateElements(Q),j.invalidateElements(Q),re.invalidateElements(Q);for(var ae=0;ae<Q.length;ae++){var ne=Q[ae]._private;ne.oldBackgroundTimestamp=ne.backgroundTimestamp}});var ce=function(Z){for(var Q=0;Q<Z.length;Q++)re.enqueueElementRefinement(Z[Q].ele)};le.onDequeue(ce),G.onDequeue(ce),V.onDequeue(ce),j.onDequeue(ce),r.webgl&&e.initWebgl(r,{getStyleKey:m,getLabelKey:b,getSourceLabelKey:w,getTargetLabelKey:x,drawElement:C,drawLabel:T,drawSourceLabel:S,drawTargetLabel:_,getElementBox:A,getLabelBox:P,getSourceLabelBox:D,getTargetLabelBox:I,getElementRotationPoint:k,getElementRotationOffset:X,getLabelRotationPoint:W,getSourceLabelRotationPoint:q,getTargetLabelRotationPoint:$,getLabelRotationOffset:ee,getSourceLabelRotationOffset:Y,getTargetLabelRotationOffset:K})}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 G3=typeof Path2D<"u";fr.path2dEnabled=function(r){if(r===void 0)return this.pathsEnabled;this.pathsEnabled=!!r};fr.usePaths=function(){return G3&&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};[BA,On,ra,Jm,di,Na,kt,qA,Fa,_s,GA].forEach(function(r){Ye(fr,r)});var W3=[{name:"null",impl:mA},{name:"base",impl:AA},{name:"canvas",impl:V3}],U3=[{type:"layout",extensions:p$},{type:"renderer",extensions:W3}],UA={},HA={};function KA(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(us.prototype[e])return a(e);us.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 bl(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=jA("renderer","base"),p=g.prototype,E=t,m=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=m[x]!=null;if(T)return a(x);w[x]=C}for(var S in m)w[S]=m[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 dR({map:UA,keys:[r,e],value:n})}function jA(r,e){return vR({map:UA,keys:[r,e]})}function H3(r,e,t,n,a){return dR({map:HA,keys:[r,e,t,n],value:a})}function K3(r,e,t,n){return vR({map:HA,keys:[r,e,t,n]})}var Am=function(){if(arguments.length===2)return jA.apply(null,arguments);if(arguments.length===3)return KA.apply(null,arguments);if(arguments.length===4)return K3.apply(null,arguments);if(arguments.length===5)return H3.apply(null,arguments);Lr("Invalid extension access syntax")};us.prototype.extension=Am;U3.forEach(function(r){r.extensions.forEach(function(e){KA(r.type,e.name,e.impl)})});var il=function(){if(!(this instanceof il))return new il;this.length=0},fi=il.prototype;fi.instanceString=function(){return"stylesheet"};fi.selector=function(r){var e=this.length++;return this[e]={selector:r,properties:[]},this};fi.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[ll(o)];if(l!=null){var u=l.name,c=s;this[t].properties.push({name:u,value:c})}}}return this};fi.style=fi.css;fi.generateStyle=function(r){var e=new st(r);return this.appendToStyle(e)};fi.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 j3="3.33.1",ln=function(e){if(e===void 0&&(e={}),pr(e))return new us(e);if(Ke(e))return Am.apply(Am,arguments)};ln.use=function(r){var e=Array.prototype.slice.call(arguments,1);return e.unshift(ln),r.apply(null,e),this};ln.warnings=function(r){return wR(r)};ln.version=j3;ln.stylesheet=ln.Stylesheet=il;var Ct=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Rl(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var Gu={exports:{}};function r0(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 Vd,yE;function Y3(){if(yE)return Vd;yE=1;function r(){this.__data__=[],this.size=0}return Vd=r,Vd}var Gd,mE;function co(){if(mE)return Gd;mE=1;function r(e,t){return e===t||e!==e&&t!==t}return Gd=r,Gd}var Wd,bE;function Al(){if(bE)return Wd;bE=1;var r=co();function e(t,n){for(var a=t.length;a--;)if(r(t[a][0],n))return a;return-1}return Wd=e,Wd}var Ud,wE;function Z3(){if(wE)return Ud;wE=1;var r=Al(),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 Ud=n,Ud}var Hd,xE;function X3(){if(xE)return Hd;xE=1;var r=Al();function e(t){var n=this.__data__,a=r(n,t);return a<0?void 0:n[a][1]}return Hd=e,Hd}var Kd,EE;function Q3(){if(EE)return Kd;EE=1;var r=Al();function e(t){return r(this.__data__,t)>-1}return Kd=e,Kd}var jd,CE;function J3(){if(CE)return jd;CE=1;var r=Al();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 jd=e,jd}var Yd,_E;function Pl(){if(_E)return Yd;_E=1;var r=Y3(),e=Z3(),t=X3(),n=Q3(),a=J3();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,Yd=i,Yd}var Zd,SE;function eV(){if(SE)return Zd;SE=1;var r=Pl();function e(){this.__data__=new r,this.size=0}return Zd=e,Zd}var Xd,TE;function rV(){if(TE)return Xd;TE=1;function r(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}return Xd=r,Xd}var Qd,RE;function tV(){if(RE)return Qd;RE=1;function r(e){return this.__data__.get(e)}return Qd=r,Qd}var Jd,AE;function nV(){if(AE)return Jd;AE=1;function r(e){return this.__data__.has(e)}return Jd=r,Jd}var ev,PE;function YA(){if(PE)return ev;PE=1;var r=typeof Ct=="object"&&Ct&&Ct.Object===Object&&Ct;return ev=r,ev}var rv,DE;function Cn(){if(DE)return rv;DE=1;var r=YA(),e=typeof self=="object"&&self&&self.Object===Object&&self,t=r||e||Function("return this")();return rv=t,rv}var tv,IE;function vo(){if(IE)return tv;IE=1;var r=Cn(),e=r.Symbol;return tv=e,tv}var nv,BE;function aV(){if(BE)return nv;BE=1;var r=vo(),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 nv=i,nv}var av,kE;function iV(){if(kE)return av;kE=1;var r=Object.prototype,e=r.toString;function t(n){return e.call(n)}return av=t,av}var iv,ME;function vi(){if(ME)return iv;ME=1;var r=vo(),e=aV(),t=iV(),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 iv=o,iv}var ov,LE;function cn(){if(LE)return ov;LE=1;function r(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}return ov=r,ov}var sv,OE;function Ss(){if(OE)return sv;OE=1;var r=vi(),e=cn(),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 sv=o,sv}var uv,qE;function oV(){if(qE)return uv;qE=1;var r=Cn(),e=r["__core-js_shared__"];return uv=e,uv}var lv,NE;function sV(){if(NE)return lv;NE=1;var r=oV(),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 lv=t,lv}var fv,FE;function ZA(){if(FE)return fv;FE=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 fv=t,fv}var cv,zE;function uV(){if(zE)return cv;zE=1;var r=Ss(),e=sV(),t=cn(),n=ZA(),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 cv=d,cv}var dv,$E;function lV(){if($E)return dv;$E=1;function r(e,t){return e==null?void 0:e[t]}return dv=r,dv}var vv,VE;function hi(){if(VE)return vv;VE=1;var r=uV(),e=lV();function t(n,a){var i=e(n,a);return r(i)?i:void 0}return vv=t,vv}var hv,GE;function t0(){if(GE)return hv;GE=1;var r=hi(),e=Cn(),t=r(e,"Map");return hv=t,hv}var gv,WE;function Dl(){if(WE)return gv;WE=1;var r=hi(),e=r(Object,"create");return gv=e,gv}var pv,UE;function fV(){if(UE)return pv;UE=1;var r=Dl();function e(){this.__data__=r?r(null):{},this.size=0}return pv=e,pv}var yv,HE;function cV(){if(HE)return yv;HE=1;function r(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}return yv=r,yv}var mv,KE;function dV(){if(KE)return mv;KE=1;var r=Dl(),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 mv=a,mv}var bv,jE;function vV(){if(jE)return bv;jE=1;var r=Dl(),e=Object.prototype,t=e.hasOwnProperty;function n(a){var i=this.__data__;return r?i[a]!==void 0:t.call(i,a)}return bv=n,bv}var wv,YE;function hV(){if(YE)return wv;YE=1;var r=Dl(),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 wv=t,wv}var xv,ZE;function gV(){if(ZE)return xv;ZE=1;var r=fV(),e=cV(),t=dV(),n=vV(),a=hV();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,xv=i,xv}var Ev,XE;function pV(){if(XE)return Ev;XE=1;var r=gV(),e=Pl(),t=t0();function n(){this.size=0,this.__data__={hash:new r,map:new(t||e),string:new r}}return Ev=n,Ev}var Cv,QE;function yV(){if(QE)return Cv;QE=1;function r(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}return Cv=r,Cv}var _v,JE;function Il(){if(JE)return _v;JE=1;var r=yV();function e(t,n){var a=t.__data__;return r(n)?a[typeof n=="string"?"string":"hash"]:a.map}return _v=e,_v}var Sv,eC;function mV(){if(eC)return Sv;eC=1;var r=Il();function e(t){var n=r(this,t).delete(t);return this.size-=n?1:0,n}return Sv=e,Sv}var Tv,rC;function bV(){if(rC)return Tv;rC=1;var r=Il();function e(t){return r(this,t).get(t)}return Tv=e,Tv}var Rv,tC;function wV(){if(tC)return Rv;tC=1;var r=Il();function e(t){return r(this,t).has(t)}return Rv=e,Rv}var Av,nC;function xV(){if(nC)return Av;nC=1;var r=Il();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 Av=e,Av}var Pv,aC;function n0(){if(aC)return Pv;aC=1;var r=pV(),e=mV(),t=bV(),n=wV(),a=xV();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 Dv,iC;function EV(){if(iC)return Dv;iC=1;var r=Pl(),e=t0(),t=n0(),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 Dv=a,Dv}var Iv,oC;function Bl(){if(oC)return Iv;oC=1;var r=Pl(),e=eV(),t=rV(),n=tV(),a=nV(),i=EV();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,Iv=o,Iv}var Bv,sC;function a0(){if(sC)return Bv;sC=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 Bv=r,Bv}var kv,uC;function XA(){if(uC)return kv;uC=1;var r=hi(),e=(function(){try{var t=r(Object,"defineProperty");return t({},"",{}),t}catch{}})();return kv=e,kv}var Mv,lC;function kl(){if(lC)return Mv;lC=1;var r=XA();function e(t,n,a){n=="__proto__"&&r?r(t,n,{configurable:!0,enumerable:!0,value:a,writable:!0}):t[n]=a}return Mv=e,Mv}var Lv,fC;function Ml(){if(fC)return Lv;fC=1;var r=kl(),e=co(),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 Lv=a,Lv}var Ov,cC;function Ts(){if(cC)return Ov;cC=1;var r=Ml(),e=kl();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 Ov=t,Ov}var qv,dC;function CV(){if(dC)return qv;dC=1;function r(e,t){for(var n=-1,a=Array(e);++n<e;)a[n]=t(n);return a}return qv=r,qv}var Nv,vC;function qn(){if(vC)return Nv;vC=1;function r(e){return e!=null&&typeof e=="object"}return Nv=r,Nv}var Fv,hC;function _V(){if(hC)return Fv;hC=1;var r=vi(),e=qn(),t="[object Arguments]";function n(a){return e(a)&&r(a)==t}return Fv=n,Fv}var zv,gC;function Rs(){if(gC)return zv;gC=1;var r=_V(),e=qn(),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 zv=i,zv}var $v,pC;function Zr(){if(pC)return $v;pC=1;var r=Array.isArray;return $v=r,$v}var Go={exports:{}},Vv,yC;function SV(){if(yC)return Vv;yC=1;function r(){return!1}return Vv=r,Vv}Go.exports;var mC;function ho(){return mC||(mC=1,(function(r,e){var t=Cn(),n=SV(),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})(Go,Go.exports)),Go.exports}var Gv,bC;function Ll(){if(bC)return Gv;bC=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 Gv=t,Gv}var Wv,wC;function i0(){if(wC)return Wv;wC=1;var r=9007199254740991;function e(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=r}return Wv=e,Wv}var Uv,xC;function TV(){if(xC)return Uv;xC=1;var r=vi(),e=i0(),t=qn(),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]",m="[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]",D="[object Uint32Array]",I={};I[w]=I[x]=I[C]=I[T]=I[S]=I[_]=I[A]=I[P]=I[D]=!0,I[n]=I[a]=I[m]=I[i]=I[b]=I[o]=I[s]=I[l]=I[u]=I[c]=I[d]=I[h]=I[g]=I[p]=I[E]=!1;function M(k){return t(k)&&e(k.length)&&!!I[r(k)]}return Uv=M,Uv}var Hv,EC;function Ol(){if(EC)return Hv;EC=1;function r(e){return function(t){return e(t)}}return Hv=r,Hv}var Wo={exports:{}};Wo.exports;var CC;function o0(){return CC||(CC=1,(function(r,e){var t=YA(),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})(Wo,Wo.exports)),Wo.exports}var Kv,_C;function As(){if(_C)return Kv;_C=1;var r=TV(),e=Ol(),t=o0(),n=t&&t.isTypedArray,a=n?e(n):r;return Kv=a,Kv}var jv,SC;function QA(){if(SC)return jv;SC=1;var r=CV(),e=Rs(),t=Zr(),n=ho(),a=Ll(),i=As(),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,m=E?r(u.length,String):[],b=m.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)))&&m.push(w);return m}return jv=l,jv}var Yv,TC;function ql(){if(TC)return Yv;TC=1;var r=Object.prototype;function e(t){var n=t&&t.constructor,a=typeof n=="function"&&n.prototype||r;return t===a}return Yv=e,Yv}var Zv,RC;function JA(){if(RC)return Zv;RC=1;function r(e,t){return function(n){return e(t(n))}}return Zv=r,Zv}var Xv,AC;function RV(){if(AC)return Xv;AC=1;var r=JA(),e=r(Object.keys,Object);return Xv=e,Xv}var Qv,PC;function s0(){if(PC)return Qv;PC=1;var r=ql(),e=RV(),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 Qv=a,Qv}var Jv,DC;function ta(){if(DC)return Jv;DC=1;var r=Ss(),e=i0();function t(n){return n!=null&&e(n.length)&&!r(n)}return Jv=t,Jv}var eh,IC;function za(){if(IC)return eh;IC=1;var r=QA(),e=s0(),t=ta();function n(a){return t(a)?r(a):e(a)}return eh=n,eh}var rh,BC;function AV(){if(BC)return rh;BC=1;var r=Ts(),e=za();function t(n,a){return n&&r(a,e(a),n)}return rh=t,rh}var th,kC;function PV(){if(kC)return th;kC=1;function r(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}return th=r,th}var nh,MC;function DV(){if(MC)return nh;MC=1;var r=cn(),e=ql(),t=PV(),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 nh=i,nh}var ah,LC;function gi(){if(LC)return ah;LC=1;var r=QA(),e=DV(),t=ta();function n(a){return t(a)?r(a,!0):e(a)}return ah=n,ah}var ih,OC;function IV(){if(OC)return ih;OC=1;var r=Ts(),e=gi();function t(n,a){return n&&r(a,e(a),n)}return ih=t,ih}var Uo={exports:{}};Uo.exports;var qC;function eP(){return qC||(qC=1,(function(r,e){var t=Cn(),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})(Uo,Uo.exports)),Uo.exports}var oh,NC;function rP(){if(NC)return oh;NC=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 oh=r,oh}var sh,FC;function tP(){if(FC)return sh;FC=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 sh=r,sh}var uh,zC;function nP(){if(zC)return uh;zC=1;function r(){return[]}return uh=r,uh}var lh,$C;function u0(){if($C)return lh;$C=1;var r=tP(),e=nP(),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 lh=i,lh}var fh,VC;function BV(){if(VC)return fh;VC=1;var r=Ts(),e=u0();function t(n,a){return r(n,e(n),a)}return fh=t,fh}var ch,GC;function l0(){if(GC)return ch;GC=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 ch=r,ch}var dh,WC;function Nl(){if(WC)return dh;WC=1;var r=JA(),e=r(Object.getPrototypeOf,Object);return dh=e,dh}var vh,UC;function aP(){if(UC)return vh;UC=1;var r=l0(),e=Nl(),t=u0(),n=nP(),a=Object.getOwnPropertySymbols,i=a?function(o){for(var s=[];o;)r(s,t(o)),o=e(o);return s}:n;return vh=i,vh}var hh,HC;function kV(){if(HC)return hh;HC=1;var r=Ts(),e=aP();function t(n,a){return r(n,e(n),a)}return hh=t,hh}var gh,KC;function iP(){if(KC)return gh;KC=1;var r=l0(),e=Zr();function t(n,a,i){var o=a(n);return e(n)?o:r(o,i(n))}return gh=t,gh}var ph,jC;function oP(){if(jC)return ph;jC=1;var r=iP(),e=u0(),t=za();function n(a){return r(a,t,e)}return ph=n,ph}var yh,YC;function MV(){if(YC)return yh;YC=1;var r=iP(),e=aP(),t=gi();function n(a){return r(a,t,e)}return yh=n,yh}var mh,ZC;function LV(){if(ZC)return mh;ZC=1;var r=hi(),e=Cn(),t=r(e,"DataView");return mh=t,mh}var bh,XC;function OV(){if(XC)return bh;XC=1;var r=hi(),e=Cn(),t=r(e,"Promise");return bh=t,bh}var wh,QC;function sP(){if(QC)return wh;QC=1;var r=hi(),e=Cn(),t=r(e,"Set");return wh=t,wh}var xh,JC;function qV(){if(JC)return xh;JC=1;var r=hi(),e=Cn(),t=r(e,"WeakMap");return xh=t,xh}var Eh,e_;function go(){if(e_)return Eh;e_=1;var r=LV(),e=t0(),t=OV(),n=sP(),a=qV(),i=vi(),o=ZA(),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),m=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 m:return c;case b:return d}return C}),Eh=w,Eh}var Ch,r_;function NV(){if(r_)return Ch;r_=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 Ch=t,Ch}var _h,t_;function uP(){if(t_)return _h;t_=1;var r=Cn(),e=r.Uint8Array;return _h=e,_h}var Sh,n_;function f0(){if(n_)return Sh;n_=1;var r=uP();function e(t){var n=new t.constructor(t.byteLength);return new r(n).set(new r(t)),n}return Sh=e,Sh}var Th,a_;function FV(){if(a_)return Th;a_=1;var r=f0();function e(t,n){var a=n?r(t.buffer):t.buffer;return new t.constructor(a,t.byteOffset,t.byteLength)}return Th=e,Th}var Rh,i_;function zV(){if(i_)return Rh;i_=1;var r=/\w*$/;function e(t){var n=new t.constructor(t.source,r.exec(t));return n.lastIndex=t.lastIndex,n}return Rh=e,Rh}var Ah,o_;function $V(){if(o_)return Ah;o_=1;var r=vo(),e=r?r.prototype:void 0,t=e?e.valueOf:void 0;function n(a){return t?Object(t.call(a)):{}}return Ah=n,Ah}var Ph,s_;function lP(){if(s_)return Ph;s_=1;var r=f0();function e(t,n){var a=n?r(t.buffer):t.buffer;return new t.constructor(a,t.byteOffset,t.length)}return Ph=e,Ph}var Dh,u_;function VV(){if(u_)return Dh;u_=1;var r=f0(),e=FV(),t=zV(),n=$V(),a=lP(),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]",m="[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,D,I){var M=P.constructor;switch(D){case g:return r(P);case i:case o:return new M(+P);case p:return e(P,I);case E:case m:case b:case w:case x:case C:case T:case S:case _:return a(P,I);case s:return new M;case l:case d:return new M(P);case u:return t(P);case c:return new M;case h:return n(P)}}return Dh=A,Dh}var Ih,l_;function fP(){if(l_)return Ih;l_=1;var r=cn(),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 Ih=t,Ih}var Bh,f_;function cP(){if(f_)return Bh;f_=1;var r=fP(),e=Nl(),t=ql();function n(a){return typeof a.constructor=="function"&&!t(a)?r(e(a)):{}}return Bh=n,Bh}var kh,c_;function GV(){if(c_)return kh;c_=1;var r=go(),e=qn(),t="[object Map]";function n(a){return e(a)&&r(a)==t}return kh=n,kh}var Mh,d_;function WV(){if(d_)return Mh;d_=1;var r=GV(),e=Ol(),t=o0(),n=t&&t.isMap,a=n?e(n):r;return Mh=a,Mh}var Lh,v_;function UV(){if(v_)return Lh;v_=1;var r=go(),e=qn(),t="[object Set]";function n(a){return e(a)&&r(a)==t}return Lh=n,Lh}var Oh,h_;function HV(){if(h_)return Oh;h_=1;var r=UV(),e=Ol(),t=o0(),n=t&&t.isSet,a=n?e(n):r;return Oh=a,Oh}var qh,g_;function dP(){if(g_)return qh;g_=1;var r=Bl(),e=a0(),t=Ml(),n=AV(),a=IV(),i=eP(),o=rP(),s=BV(),l=kV(),u=oP(),c=MV(),d=go(),h=NV(),g=VV(),p=cP(),E=Zr(),m=ho(),b=WV(),w=cn(),x=HV(),C=za(),T=gi(),S=1,_=2,A=4,P="[object Arguments]",D="[object Array]",I="[object Boolean]",M="[object Date]",k="[object Error]",N="[object Function]",z="[object GeneratorFunction]",W="[object Map]",q="[object Number]",$="[object Object]",X="[object RegExp]",Y="[object Set]",K="[object String]",ee="[object Symbol]",le="[object WeakMap]",G="[object ArrayBuffer]",V="[object DataView]",j="[object Float32Array]",re="[object Float64Array]",ce="[object Int8Array]",se="[object Int16Array]",Z="[object Int32Array]",Q="[object Uint8Array]",ae="[object Uint8ClampedArray]",ne="[object Uint16Array]",de="[object Uint32Array]",Ce={};Ce[P]=Ce[D]=Ce[G]=Ce[V]=Ce[I]=Ce[M]=Ce[j]=Ce[re]=Ce[ce]=Ce[se]=Ce[Z]=Ce[W]=Ce[q]=Ce[$]=Ce[X]=Ce[Y]=Ce[K]=Ce[ee]=Ce[Q]=Ce[ae]=Ce[ne]=Ce[de]=!0,Ce[k]=Ce[N]=Ce[le]=!1;function ve(U,fe,we,ge,me,Re){var Ie,Be=fe&S,Oe=fe&_,He=fe&A;if(we&&(Ie=me?we(U,ge,me,Re):we(U)),Ie!==void 0)return Ie;if(!w(U))return U;var Ve=E(U);if(Ve){if(Ie=h(U),!Be)return o(U,Ie)}else{var Xe=d(U),er=Xe==N||Xe==z;if(m(U))return i(U,Be);if(Xe==$||Xe==P||er&&!me){if(Ie=Oe||er?{}:p(U),!Be)return Oe?l(U,a(Ie,U)):s(U,n(Ie,U))}else{if(!Ce[Xe])return me?U:{};Ie=g(U,Xe,Be)}}Re||(Re=new r);var $e=Re.get(U);if($e)return $e;Re.set(U,Ie),x(U)?U.forEach(function(L){Ie.add(ve(L,fe,we,L,U,Re))}):b(U)&&U.forEach(function(L,oe){Ie.set(oe,ve(L,fe,we,oe,U,Re))});var Me=He?Oe?c:u:Oe?T:C,pe=Ve?void 0:Me(U);return e(pe||U,function(L,oe){pe&&(oe=L,L=U[oe]),t(Ie,oe,ve(L,fe,we,oe,U,Re))}),Ie}return qh=ve,qh}var Nh,p_;function KV(){if(p_)return Nh;p_=1;var r=dP(),e=4;function t(n){return r(n,e)}return Nh=t,Nh}var Fh,y_;function c0(){if(y_)return Fh;y_=1;function r(e){return function(){return e}}return Fh=r,Fh}var zh,m_;function jV(){if(m_)return zh;m_=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 zh=r,zh}var $h,b_;function d0(){if(b_)return $h;b_=1;var r=jV(),e=r();return $h=e,$h}var Vh,w_;function v0(){if(w_)return Vh;w_=1;var r=d0(),e=za();function t(n,a){return n&&r(n,a,e)}return Vh=t,Vh}var Gh,x_;function YV(){if(x_)return Gh;x_=1;var r=ta();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 Gh=e,Gh}var Wh,E_;function Fl(){if(E_)return Wh;E_=1;var r=v0(),e=YV(),t=e(r);return Wh=t,Wh}var Uh,C_;function pi(){if(C_)return Uh;C_=1;function r(e){return e}return Uh=r,Uh}var Hh,__;function vP(){if(__)return Hh;__=1;var r=pi();function e(t){return typeof t=="function"?t:r}return Hh=e,Hh}var Kh,S_;function hP(){if(S_)return Kh;S_=1;var r=a0(),e=Fl(),t=vP(),n=Zr();function a(i,o){var s=n(i)?r:e;return s(i,t(o))}return Kh=a,Kh}var jh,T_;function gP(){return T_||(T_=1,jh=hP()),jh}var Yh,R_;function ZV(){if(R_)return Yh;R_=1;var r=Fl();function e(t,n){var a=[];return r(t,function(i,o,s){n(i,o,s)&&a.push(i)}),a}return Yh=e,Yh}var Zh,A_;function XV(){if(A_)return Zh;A_=1;var r="__lodash_hash_undefined__";function e(t){return this.__data__.set(t,r),this}return Zh=e,Zh}var Xh,P_;function QV(){if(P_)return Xh;P_=1;function r(e){return this.__data__.has(e)}return Xh=r,Xh}var Qh,D_;function pP(){if(D_)return Qh;D_=1;var r=n0(),e=XV(),t=QV();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,Qh=n,Qh}var Jh,I_;function JV(){if(I_)return Jh;I_=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 eg,B_;function yP(){if(B_)return eg;B_=1;function r(e,t){return e.has(t)}return eg=r,eg}var rg,k_;function mP(){if(k_)return rg;k_=1;var r=pP(),e=JV(),t=yP(),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),m=d.get(s);if(E&&m)return E==s&&m==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 rg=i,rg}var tg,M_;function e4(){if(M_)return tg;M_=1;function r(e){var t=-1,n=Array(e.size);return e.forEach(function(a,i){n[++t]=[i,a]}),n}return tg=r,tg}var ng,L_;function h0(){if(L_)return ng;L_=1;function r(e){var t=-1,n=Array(e.size);return e.forEach(function(a){n[++t]=a}),n}return ng=r,ng}var ag,O_;function r4(){if(O_)return ag;O_=1;var r=vo(),e=uP(),t=co(),n=mP(),a=e4(),i=h0(),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]",m="[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,D,I,M){switch(A){case w:if(S.byteLength!=_.byteLength||S.byteOffset!=_.byteOffset)return!1;S=S.buffer,_=_.buffer;case b:return!(S.byteLength!=_.byteLength||!I(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 k=a;case p:var N=P&o;if(k||(k=i),S.size!=_.size&&!N)return!1;var z=M.get(S);if(z)return z==_;P|=s,M.set(S,_);var W=n(k(S),k(_),P,D,I,M);return M.delete(S),W;case m:if(C)return C.call(S)==C.call(_)}return!1}return ag=T,ag}var ig,q_;function t4(){if(q_)return ig;q_=1;var r=oP(),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 m=g;m--;){var b=h[m];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;++m<g;){b=h[m];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,D=o.constructor;P!=D&&"constructor"in i&&"constructor"in o&&!(typeof P=="function"&&P instanceof P&&typeof D=="function"&&D instanceof D)&&(C=!1)}return c.delete(i),c.delete(o),C}return ig=a,ig}var og,N_;function n4(){if(N_)return og;N_=1;var r=Bl(),e=mP(),t=r4(),n=t4(),a=go(),i=Zr(),o=ho(),s=As(),l=1,u="[object Arguments]",c="[object Array]",d="[object Object]",h=Object.prototype,g=h.hasOwnProperty;function p(E,m,b,w,x,C){var T=i(E),S=i(m),_=T?c:a(E),A=S?c:a(m);_=_==u?d:_,A=A==u?d:A;var P=_==d,D=A==d,I=_==A;if(I&&o(E)){if(!o(m))return!1;T=!0,P=!1}if(I&&!P)return C||(C=new r),T||s(E)?e(E,m,b,w,x,C):t(E,m,_,b,w,x,C);if(!(b&l)){var M=P&&g.call(E,"__wrapped__"),k=D&&g.call(m,"__wrapped__");if(M||k){var N=M?E.value():E,z=k?m.value():m;return C||(C=new r),x(N,z,b,w,C)}}return I?(C||(C=new r),n(E,m,b,w,x,C)):!1}return og=p,og}var sg,F_;function bP(){if(F_)return sg;F_=1;var r=n4(),e=qn();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 sg=t,sg}var ug,z_;function a4(){if(z_)return ug;z_=1;var r=Bl(),e=bP(),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 m=new r;if(l)var b=l(p,E,g,i,o,m);if(!(b===void 0?e(E,p,t|n,l,m):b))return!1}}return!0}return ug=a,ug}var lg,$_;function wP(){if($_)return lg;$_=1;var r=cn();function e(t){return t===t&&!r(t)}return lg=e,lg}var fg,V_;function i4(){if(V_)return fg;V_=1;var r=wP(),e=za();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 fg=t,fg}var cg,G_;function xP(){if(G_)return cg;G_=1;function r(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}return cg=r,cg}var dg,W_;function o4(){if(W_)return dg;W_=1;var r=a4(),e=i4(),t=xP();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 dg=n,dg}var vg,U_;function po(){if(U_)return vg;U_=1;var r=vi(),e=qn(),t="[object Symbol]";function n(a){return typeof a=="symbol"||e(a)&&r(a)==t}return vg=n,vg}var hg,H_;function g0(){if(H_)return hg;H_=1;var r=Zr(),e=po(),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 hg=a,hg}var gg,K_;function s4(){if(K_)return gg;K_=1;var r=n0(),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,gg=t,gg}var pg,j_;function u4(){if(j_)return pg;j_=1;var r=s4(),e=500;function t(n){var a=r(n,function(o){return i.size===e&&i.clear(),o}),i=a.cache;return a}return pg=t,pg}var yg,Y_;function l4(){if(Y_)return yg;Y_=1;var r=u4(),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 yg=n,yg}var mg,Z_;function zl(){if(Z_)return mg;Z_=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 mg=r,mg}var bg,X_;function f4(){if(X_)return bg;X_=1;var r=vo(),e=zl(),t=Zr(),n=po(),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 bg=o,bg}var wg,Q_;function EP(){if(Q_)return wg;Q_=1;var r=f4();function e(t){return t==null?"":r(t)}return wg=e,wg}var xg,J_;function $l(){if(J_)return xg;J_=1;var r=Zr(),e=g0(),t=l4(),n=EP();function a(i,o){return r(i)?i:e(i,o)?[i]:t(n(i))}return xg=a,xg}var Eg,eS;function Ps(){if(eS)return Eg;eS=1;var r=po();function e(t){if(typeof t=="string"||r(t))return t;var n=t+"";return n=="0"&&1/t==-1/0?"-0":n}return Eg=e,Eg}var Cg,rS;function Vl(){if(rS)return Cg;rS=1;var r=$l(),e=Ps();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 Cg=t,Cg}var _g,tS;function c4(){if(tS)return _g;tS=1;var r=Vl();function e(t,n,a){var i=t==null?void 0:r(t,n);return i===void 0?a:i}return _g=e,_g}var Sg,nS;function d4(){if(nS)return Sg;nS=1;function r(e,t){return e!=null&&t in Object(e)}return Sg=r,Sg}var Tg,aS;function CP(){if(aS)return Tg;aS=1;var r=$l(),e=Rs(),t=Zr(),n=Ll(),a=i0(),i=Ps();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 Tg=o,Tg}var Rg,iS;function _P(){if(iS)return Rg;iS=1;var r=d4(),e=CP();function t(n,a){return n!=null&&e(n,a,r)}return Rg=t,Rg}var Ag,oS;function v4(){if(oS)return Ag;oS=1;var r=bP(),e=c4(),t=_P(),n=g0(),a=wP(),i=xP(),o=Ps(),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 Ag=u,Ag}var Pg,sS;function SP(){if(sS)return Pg;sS=1;function r(e){return function(t){return t==null?void 0:t[e]}}return Pg=r,Pg}var Dg,uS;function h4(){if(uS)return Dg;uS=1;var r=Vl();function e(t){return function(n){return r(n,t)}}return Dg=e,Dg}var Ig,lS;function g4(){if(lS)return Ig;lS=1;var r=SP(),e=h4(),t=g0(),n=Ps();function a(i){return t(i)?r(n(i)):e(i)}return Ig=a,Ig}var Bg,fS;function na(){if(fS)return Bg;fS=1;var r=o4(),e=v4(),t=pi(),n=Zr(),a=g4();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 Bg=i,Bg}var kg,cS;function TP(){if(cS)return kg;cS=1;var r=tP(),e=ZV(),t=na(),n=Zr();function a(i,o){var s=n(i)?r:e;return s(i,t(o,3))}return kg=a,kg}var Mg,dS;function p4(){if(dS)return Mg;dS=1;var r=Object.prototype,e=r.hasOwnProperty;function t(n,a){return n!=null&&e.call(n,a)}return Mg=t,Mg}var Lg,vS;function RP(){if(vS)return Lg;vS=1;var r=p4(),e=CP();function t(n,a){return n!=null&&e(n,a,r)}return Lg=t,Lg}var Og,hS;function y4(){if(hS)return Og;hS=1;var r=s0(),e=go(),t=Rs(),n=Zr(),a=ta(),i=ho(),o=ql(),s=As(),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 Og=h,Og}var qg,gS;function AP(){if(gS)return qg;gS=1;function r(e){return e===void 0}return qg=r,qg}var Ng,pS;function PP(){if(pS)return Ng;pS=1;var r=Fl(),e=ta();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 Ng=t,Ng}var Fg,yS;function DP(){if(yS)return Fg;yS=1;var r=zl(),e=na(),t=PP(),n=Zr();function a(i,o){var s=n(i)?r:t;return s(i,e(o,3))}return Fg=a,Fg}var zg,mS;function m4(){if(mS)return zg;mS=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 zg=r,zg}var $g,bS;function b4(){if(bS)return $g;bS=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 $g=r,$g}var Vg,wS;function IP(){if(wS)return Vg;wS=1;var r=m4(),e=Fl(),t=na(),n=b4(),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 Vg=i,Vg}var Gg,xS;function w4(){if(xS)return Gg;xS=1;var r=vi(),e=Zr(),t=qn(),n="[object String]";function a(i){return typeof i=="string"||!e(i)&&t(i)&&r(i)==n}return Gg=a,Gg}var Wg,ES;function x4(){if(ES)return Wg;ES=1;var r=SP(),e=r("length");return Wg=e,Wg}var Ug,CS;function E4(){if(CS)return Ug;CS=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 Ug=l,Ug}var Hg,_S;function C4(){if(_S)return Hg;_S=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+"]?",m="(?:"+g+"(?:"+[c,d,h].join("|")+")"+E+p+")*",b=E+p+m,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 Hg=C,Hg}var Kg,SS;function _4(){if(SS)return Kg;SS=1;var r=x4(),e=E4(),t=C4();function n(a){return e(a)?t(a):r(a)}return Kg=n,Kg}var jg,TS;function S4(){if(TS)return jg;TS=1;var r=s0(),e=go(),t=ta(),n=w4(),a=_4(),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 jg=s,jg}var Yg,RS;function T4(){if(RS)return Yg;RS=1;var r=a0(),e=fP(),t=v0(),n=na(),a=Nl(),i=Zr(),o=ho(),s=Ss(),l=cn(),u=As();function c(d,h,g){var p=i(d),E=p||o(d)||u(d);if(h=n(h,4),g==null){var m=d&&d.constructor;E?g=p?new m:[]:l(d)?g=s(m)?e(a(d)):{}:g={}}return(E?r:t)(d,function(b,w,x){return h(g,b,w,x)}),g}return Yg=c,Yg}var Zg,AS;function R4(){if(AS)return Zg;AS=1;var r=vo(),e=Rs(),t=Zr(),n=r?r.isConcatSpreadable:void 0;function a(i){return t(i)||e(i)||!!(n&&i&&i[n])}return Zg=a,Zg}var Xg,PS;function p0(){if(PS)return Xg;PS=1;var r=l0(),e=R4();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 Xg=t,Xg}var Qg,DS;function A4(){if(DS)return Qg;DS=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 Qg=r,Qg}var Jg,IS;function BP(){if(IS)return Jg;IS=1;var r=A4(),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 ep,BS;function P4(){if(BS)return ep;BS=1;var r=c0(),e=XA(),t=pi(),n=e?function(a,i){return e(a,"toString",{configurable:!0,enumerable:!1,value:r(i),writable:!0})}:t;return ep=n,ep}var rp,kS;function D4(){if(kS)return rp;kS=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 rp=n,rp}var tp,MS;function kP(){if(MS)return tp;MS=1;var r=P4(),e=D4(),t=e(r);return tp=t,tp}var np,LS;function Gl(){if(LS)return np;LS=1;var r=pi(),e=BP(),t=kP();function n(a,i){return t(e(a,i,r),a+"")}return np=n,np}var ap,OS;function MP(){if(OS)return ap;OS=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 ap=r,ap}var ip,qS;function I4(){if(qS)return ip;qS=1;function r(e){return e!==e}return ip=r,ip}var op,NS;function B4(){if(NS)return op;NS=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 op=r,op}var sp,FS;function k4(){if(FS)return sp;FS=1;var r=MP(),e=I4(),t=B4();function n(a,i,o){return i===i?t(a,i,o):r(a,e,o)}return sp=n,sp}var up,zS;function M4(){if(zS)return up;zS=1;var r=k4();function e(t,n){var a=t==null?0:t.length;return!!a&&r(t,n,0)>-1}return up=e,up}var lp,$S;function L4(){if($S)return lp;$S=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 lp=r,lp}var fp,VS;function O4(){if(VS)return fp;VS=1;function r(){}return fp=r,fp}var cp,GS;function q4(){if(GS)return cp;GS=1;var r=sP(),e=O4(),t=h0(),n=1/0,a=r&&1/t(new r([,-0]))[1]==n?function(i){return new r(i)}:e;return cp=a,cp}var dp,WS;function N4(){if(WS)return dp;WS=1;var r=pP(),e=M4(),t=L4(),n=yP(),a=q4(),i=h0(),o=200;function s(l,u,c){var d=-1,h=e,g=l.length,p=!0,E=[],m=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,m=new r}else m=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=m.length;C--;)if(m[C]===x)continue e;u&&m.push(x),E.push(w)}else h(m,x,c)||(m!==E&&m.push(x),E.push(w))}return E}return dp=s,dp}var vp,US;function LP(){if(US)return vp;US=1;var r=ta(),e=qn();function t(n){return e(n)&&r(n)}return vp=t,vp}var hp,HS;function F4(){if(HS)return hp;HS=1;var r=p0(),e=Gl(),t=N4(),n=LP(),a=e(function(i){return t(r(i,1,n,!0))});return hp=a,hp}var gp,KS;function z4(){if(KS)return gp;KS=1;var r=zl();function e(t,n){return r(n,function(a){return t[a]})}return gp=e,gp}var pp,jS;function OP(){if(jS)return pp;jS=1;var r=z4(),e=za();function t(n){return n==null?[]:r(n,e(n))}return pp=t,pp}var yp,YS;function dn(){if(YS)return yp;YS=1;var r;if(typeof r0=="function")try{r={clone:KV(),constant:c0(),each:gP(),filter:TP(),has:RP(),isArray:Zr(),isEmpty:y4(),isFunction:Ss(),isUndefined:AP(),keys:za(),map:DP(),reduce:IP(),size:S4(),transform:T4(),union:F4(),values:OP()}}catch{}return r||(r=window._),yp=r,yp}var mp,ZS;function y0(){if(ZS)return mp;ZS=1;var r=dn();mp=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,m){c(m)&&d.setNode(m,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 m=h.parent(E);return m===void 0||d.hasNode(m)?(g[E]=m,m):m in g?g[m]:p(m)}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 m=s(this._isDirected,c,d,h);if(r.has(this._edgeLabels,m))return p&&(this._edgeLabels[m]=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[m]=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[m]=b,i(this._preds[d],c),i(this._sucs[c],d),this._in[d][m]=b,this._out[c][m]=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 m=p;p=E,E=m}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 m=p;p=E,E=m}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 mp}var bp,XS;function $4(){return XS||(XS=1,bp="2.1.8"),bp}var wp,QS;function V4(){return QS||(QS=1,wp={Graph:y0(),version:$4()}),wp}var xp,JS;function G4(){if(JS)return xp;JS=1;var r=dn(),e=y0();xp={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 xp}var Ep,eT;function W4(){if(eT)return Ep;eT=1;var r=dn();Ep=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 Ep}var Cp,rT;function qP(){if(rT)return Cp;rT=1;var r=dn();Cp=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},Cp}var _p,tT;function NP(){if(tT)return _p;tT=1;var r=dn(),e=qP();_p=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,m=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<m.distance&&(m.distance=w,m.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 _p}var Sp,nT;function U4(){if(nT)return Sp;nT=1;var r=NP(),e=dn();Sp=t;function t(n,a,i){return e.transform(n.nodes(),function(o,s){o[s]=r(n,s,a,i)},{})}return Sp}var Tp,aT;function FP(){if(aT)return Tp;aT=1;var r=dn();Tp=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 Tp}var Rp,iT;function H4(){if(iT)return Rp;iT=1;var r=dn(),e=FP();Rp=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 Rp}var Ap,oT;function K4(){if(oT)return Ap;oT=1;var r=dn();Ap=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],m=h[g],b=p.distance+E.distance;b<m.distance&&(m.distance=b,m.predecessor=E.predecessor)})})}),s}return Ap}var Pp,sT;function zP(){if(sT)return Pp;sT=1;var r=dn();Pp=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,Pp}var Dp,uT;function j4(){if(uT)return Dp;uT=1;var r=zP();Dp=e;function e(t){try{r(t)}catch(n){if(n instanceof r.CycleException)return!1;throw n}return!0}return Dp}var Ip,lT;function $P(){if(lT)return Ip;lT=1;var r=dn();Ip=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 Ip}var Bp,fT;function Y4(){if(fT)return Bp;fT=1;var r=$P();Bp=e;function e(t,n){return r(t,n,"post")}return Bp}var kp,cT;function Z4(){if(cT)return kp;cT=1;var r=$P();kp=e;function e(t,n){return r(t,n,"pre")}return kp}var Mp,dT;function X4(){if(dT)return Mp;dT=1;var r=dn(),e=y0(),t=qP();Mp=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 Mp}var Lp,vT;function Q4(){return vT||(vT=1,Lp={components:W4(),dijkstra:NP(),dijkstraAll:U4(),findCycles:H4(),floydWarshall:K4(),isAcyclic:j4(),postorder:Y4(),preorder:Z4(),prim:X4(),tarjan:FP(),topsort:zP()}),Lp}var Op,hT;function J4(){if(hT)return Op;hT=1;var r=V4();return Op={Graph:r.Graph,json:G4(),alg:Q4(),version:r.version},Op}var qp,gT;function En(){if(gT)return qp;gT=1;var r;if(typeof r0=="function")try{r=J4()}catch{}return r||(r=window.graphlib),qp=r,qp}var Np,pT;function eG(){if(pT)return Np;pT=1;var r=dP(),e=1,t=4;function n(a){return r(a,e|t)}return Np=n,Np}var Fp,yT;function Wl(){if(yT)return Fp;yT=1;var r=co(),e=ta(),t=Ll(),n=cn();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 Fp=a,Fp}var zp,mT;function rG(){if(mT)return zp;mT=1;var r=Gl(),e=co(),t=Wl(),n=gi(),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 m=g[p],b=s[m];(b===void 0||e(b,a[m])&&!i.call(s,m))&&(s[m]=h[m])}return s});return zp=o,zp}var $p,bT;function tG(){if(bT)return $p;bT=1;var r=na(),e=ta(),t=za();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 $p=n,$p}var Vp,wT;function nG(){if(wT)return Vp;wT=1;var r=/\s/;function e(t){for(var n=t.length;n--&&r.test(t.charAt(n)););return n}return Vp=e,Vp}var Gp,xT;function aG(){if(xT)return Gp;xT=1;var r=nG(),e=/^\s+/;function t(n){return n&&n.slice(0,r(n)+1).replace(e,"")}return Gp=t,Gp}var Wp,ET;function iG(){if(ET)return Wp;ET=1;var r=aG(),e=cn(),t=po(),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 Wp=l,Wp}var Up,CT;function VP(){if(CT)return Up;CT=1;var r=iG(),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 Up=n,Up}var Hp,_T;function oG(){if(_T)return Hp;_T=1;var r=VP();function e(t){var n=r(t),a=n%1;return n===n?a?n-a:n:0}return Hp=e,Hp}var Kp,ST;function sG(){if(ST)return Kp;ST=1;var r=MP(),e=na(),t=oG(),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 Kp=a,Kp}var jp,TT;function uG(){if(TT)return jp;TT=1;var r=tG(),e=sG(),t=r(e);return jp=t,jp}var Yp,RT;function GP(){if(RT)return Yp;RT=1;var r=p0();function e(t){var n=t==null?0:t.length;return n?r(t,1):[]}return Yp=e,Yp}var Zp,AT;function lG(){if(AT)return Zp;AT=1;var r=d0(),e=vP(),t=gi();function n(a,i){return a==null?a:r(a,e(i),t)}return Zp=n,Zp}var Xp,PT;function fG(){if(PT)return Xp;PT=1;function r(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}return Xp=r,Xp}var Qp,DT;function cG(){if(DT)return Qp;DT=1;var r=kl(),e=v0(),t=na();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 Qp=n,Qp}var Jp,IT;function m0(){if(IT)return Jp;IT=1;var r=po();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 ey,BT;function dG(){if(BT)return ey;BT=1;function r(e,t){return e>t}return ey=r,ey}var ry,kT;function vG(){if(kT)return ry;kT=1;var r=m0(),e=dG(),t=pi();function n(a){return a&&a.length?r(a,t,e):void 0}return ry=n,ry}var ty,MT;function WP(){if(MT)return ty;MT=1;var r=kl(),e=co();function t(n,a,i){(i!==void 0&&!e(n[a],i)||i===void 0&&!(a in n))&&r(n,a,i)}return ty=t,ty}var ny,LT;function hG(){if(LT)return ny;LT=1;var r=vi(),e=Nl(),t=qn(),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 ny=u,ny}var ay,OT;function UP(){if(OT)return ay;OT=1;function r(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}return ay=r,ay}var iy,qT;function gG(){if(qT)return iy;qT=1;var r=Ts(),e=gi();function t(n){return r(n,e(n))}return iy=t,iy}var oy,NT;function pG(){if(NT)return oy;NT=1;var r=WP(),e=eP(),t=lP(),n=rP(),a=cP(),i=Rs(),o=Zr(),s=LP(),l=ho(),u=Ss(),c=cn(),d=hG(),h=As(),g=UP(),p=gG();function E(m,b,w,x,C,T,S){var _=g(m,w),A=g(b,w),P=S.get(A);if(P){r(m,w,P);return}var D=T?T(_,A,w+"",m,b,S):void 0,I=D===void 0;if(I){var M=o(A),k=!M&&l(A),N=!M&&!k&&h(A);D=A,M||k||N?o(_)?D=_:s(_)?D=n(_):k?(I=!1,D=e(A,!0)):N?(I=!1,D=t(A,!0)):D=[]:d(A)||i(A)?(D=_,i(_)?D=p(_):(!c(_)||u(_))&&(D=a(A))):I=!1}I&&(S.set(A,D),C(D,A,x,T,S),S.delete(A)),r(m,w,D)}return oy=E,oy}var sy,FT;function yG(){if(FT)return sy;FT=1;var r=Bl(),e=WP(),t=d0(),n=pG(),a=cn(),i=gi(),o=UP();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 sy=s,sy}var uy,zT;function mG(){if(zT)return uy;zT=1;var r=Gl(),e=Wl();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 uy=t,uy}var ly,$T;function bG(){if($T)return ly;$T=1;var r=yG(),e=mG(),t=e(function(n,a,i){r(n,a,i)});return ly=t,ly}var fy,VT;function HP(){if(VT)return fy;VT=1;function r(e,t){return e<t}return fy=r,fy}var cy,GT;function wG(){if(GT)return cy;GT=1;var r=m0(),e=HP(),t=pi();function n(a){return a&&a.length?r(a,t,e):void 0}return cy=n,cy}var dy,WT;function xG(){if(WT)return dy;WT=1;var r=m0(),e=na(),t=HP();function n(a,i){return a&&a.length?r(a,e(i,2),t):void 0}return dy=n,dy}var vy,UT;function EG(){if(UT)return vy;UT=1;var r=Cn(),e=function(){return r.Date.now()};return vy=e,vy}var hy,HT;function CG(){if(HT)return hy;HT=1;var r=Ml(),e=$l(),t=Ll(),n=cn(),a=Ps();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 m=g[p];E=u?u(m,p,g):void 0,E===void 0&&(E=n(m)?m:t(s[c+1])?[]:{})}r(g,p,E),g=g[p]}return o}return hy=i,hy}var gy,KT;function _G(){if(KT)return gy;KT=1;var r=Vl(),e=CG(),t=$l();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 gy=n,gy}var py,jT;function SG(){if(jT)return py;jT=1;var r=_G(),e=_P();function t(n,a){return r(n,a,function(i,o){return e(n,o)})}return py=t,py}var yy,YT;function TG(){if(YT)return yy;YT=1;var r=GP(),e=BP(),t=kP();function n(a){return t(e(a,void 0,r),a+"")}return yy=n,yy}var my,ZT;function RG(){if(ZT)return my;ZT=1;var r=SG(),e=TG(),t=e(function(n,a){return n==null?{}:r(n,a)});return my=t,my}var by,XT;function AG(){if(XT)return by;XT=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 by=t,by}var wy,QT;function PG(){if(QT)return wy;QT=1;var r=AG(),e=Wl(),t=VP();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 wy=n,wy}var xy,JT;function DG(){if(JT)return xy;JT=1;var r=PG(),e=r();return xy=e,xy}var Ey,e2;function IG(){if(e2)return Ey;e2=1;function r(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}return Ey=r,Ey}var Cy,r2;function BG(){if(r2)return Cy;r2=1;var r=po();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 Cy=e,Cy}var _y,t2;function kG(){if(t2)return _y;t2=1;var r=BG();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 _y=e,_y}var Sy,n2;function MG(){if(n2)return Sy;n2=1;var r=zl(),e=Vl(),t=na(),n=PP(),a=IG(),i=Ol(),o=kG(),s=pi(),l=Zr();function u(c,d,h){d.length?d=r(d,function(E){return l(E)?function(m){return e(m,E.length===1?E[0]:E)}:E}):d=[s];var g=-1;d=r(d,i(t));var p=n(c,function(E,m,b){var w=r(d,function(x){return x(E)});return{criteria:w,index:++g,value:E}});return a(p,function(E,m){return o(E,m,h)})}return Sy=u,Sy}var Ty,a2;function LG(){if(a2)return Ty;a2=1;var r=p0(),e=MG(),t=Gl(),n=Wl(),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 Ty=a,Ty}var Ry,i2;function OG(){if(i2)return Ry;i2=1;var r=EP(),e=0;function t(n){var a=++e;return r(n)+a}return Ry=t,Ry}var Ay,o2;function qG(){if(o2)return Ay;o2=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 Ay=r,Ay}var Py,s2;function NG(){if(s2)return Py;s2=1;var r=Ml(),e=qG();function t(n,a){return e(n||[],a||[],r)}return Py=t,Py}var Dy,u2;function Or(){if(u2)return Dy;u2=1;var r;if(typeof r0=="function")try{r={cloneDeep:eG(),constant:c0(),defaults:rG(),each:gP(),filter:TP(),find:uG(),flatten:GP(),forEach:hP(),forIn:lG(),has:RP(),isUndefined:AP(),last:fG(),map:DP(),mapValues:cG(),max:vG(),merge:bG(),min:wG(),minBy:xG(),now:EG(),pick:RG(),range:DG(),reduce:IP(),sortBy:LG(),uniqueId:OG(),values:OP(),zipObject:NG()}}catch{}return r||(r=window._),Dy=r,Dy}var Iy,l2;function FG(){if(l2)return Iy;l2=1,Iy=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 Iy}var By,f2;function zG(){if(f2)return By;f2=1;var r=Or(),e=En().Graph,t=FG();By=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 m=c.length-2;m>0;--m)if(E=c[m].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 m=u.edge(E),b=u.node(E.v);g&&p.push({v:E.v,w:E.w}),b.out-=m,l(c,d,b)}),r.forEach(u.outEdges(h.v),function(E){var m=u.edge(E),b=E.w,w=u.node(b);w.in-=m,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(m){d.setNode(m,{v:m,in:0,out:0})}),r.forEach(u.edges(),function(m){var b=d.edge(m.v,m.w)||0,w=c(m),x=b+w;d.setEdge(m.v,m.w,x),g=Math.max(g,d.node(m.v).out+=w),h=Math.max(h,d.node(m.w).in+=w)});var p=r.range(g+h+3).map(function(){return new t}),E=h+1;return r.forEach(d.nodes(),function(m){l(p,E,d.node(m))}),{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 By}var ky,c2;function $G(){if(c2)return ky;c2=1;var r=Or(),e=zG();ky={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 ky}var My,d2;function Vt(){if(d2)return My;d2=1;var r=Or(),e=En().Graph;My={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(m,b,w,x){var C;do C=r.uniqueId(x);while(m.hasNode(C));return w.dummy=b,m.setNode(C,w),C}function n(m){var b=new e().setGraph(m.graph());return r.forEach(m.nodes(),function(w){b.setNode(w,m.node(w))}),r.forEach(m.edges(),function(w){var x=b.edge(w.v,w.w)||{weight:0,minlen:1},C=m.edge(w);b.setEdge(w.v,w.w,{weight:x.weight+C.weight,minlen:Math.max(x.minlen,C.minlen)})}),b}function a(m){var b=new e({multigraph:m.isMultigraph()}).setGraph(m.graph());return r.forEach(m.nodes(),function(w){m.children(w).length||b.setNode(w,m.node(w))}),r.forEach(m.edges(),function(w){b.setEdge(w,m.edge(w))}),b}function i(m){var b=r.map(m.nodes(),function(w){var x={};return r.forEach(m.outEdges(w),function(C){x[C.w]=(x[C.w]||0)+m.edge(C).weight}),x});return r.zipObject(m.nodes(),b)}function o(m){var b=r.map(m.nodes(),function(w){var x={};return r.forEach(m.inEdges(w),function(C){x[C.v]=(x[C.v]||0)+m.edge(C).weight}),x});return r.zipObject(m.nodes(),b)}function s(m,b){var w=m.x,x=m.y,C=b.x-w,T=b.y-x,S=m.width/2,_=m.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(m){var b=r.map(r.range(h(m)+1),function(){return[]});return r.forEach(m.nodes(),function(w){var x=m.node(w),C=x.rank;r.isUndefined(C)||(b[C][x.order]=w)}),b}function u(m){var b=r.min(r.map(m.nodes(),function(w){return m.node(w).rank}));r.forEach(m.nodes(),function(w){var x=m.node(w);r.has(x,"rank")&&(x.rank-=b)})}function c(m){var b=r.min(r.map(m.nodes(),function(T){return m.node(T).rank})),w=[];r.forEach(m.nodes(),function(T){var S=m.node(T).rank-b;w[S]||(w[S]=[]),w[S].push(T)});var x=0,C=m.graph().nodeRankFactor;r.forEach(w,function(T,S){r.isUndefined(T)&&S%C!==0?--x:x&&r.forEach(T,function(_){m.node(_).rank+=x})})}function d(m,b,w,x){var C={width:0,height:0};return arguments.length>=4&&(C.rank=w,C.order=x),t(m,"border",C,b)}function h(m){return r.max(r.map(m.nodes(),function(b){var w=m.node(b).rank;if(!r.isUndefined(w))return w}))}function g(m,b){var w={lhs:[],rhs:[]};return r.forEach(m,function(x){b(x)?w.lhs.push(x):w.rhs.push(x)}),w}function p(m,b){var w=r.now();try{return b()}finally{console.log(m+" time: "+(r.now()-w)+"ms")}}function E(m,b){return b()}return My}var Ly,v2;function VG(){if(v2)return Ly;v2=1;var r=Or(),e=Vt();Ly={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,m;for(m=0,++l;l<c;++m,++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),m===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 Ly}var Oy,h2;function ol(){if(h2)return Oy;h2=1;var r=Or();Oy={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 Oy}var qy,g2;function KP(){if(g2)return qy;g2=1;var r=Or(),e=En().Graph,t=ol().slack;qy=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 qy}var Ny,p2;function GG(){if(p2)return Ny;p2=1;var r=Or(),e=KP(),t=ol().slack,n=ol().longestPath,a=En().alg.preorder,i=En().alg.postorder,o=Vt().simplify;Ny=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,_),D=0;return P||(A=!1,P=C.edge(_,T)),D=P.weight,r.forEach(C.nodeEdges(T),function(I){var M=I.v===T,k=M?I.w:I.v;if(k!==_){var N=M===A,z=C.edge(I).weight;if(D+=N?z:-z,b(x,T,k)){var W=x.edge(T,k).cutvalue;D+=N?-W:W}}}),D}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(D){r.has(C,D)||(T=h(x,C,T,D,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(_),D=A,I=!1;A.lim>P.lim&&(D=P,I=!0);var M=r.filter(C.edges(),function(k){return I===w(x,x.node(k.v),D)&&I!==w(x,x.node(k.w),D)});return r.minBy(M,function(k){return t(C,k)})}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),m(x,C)}function m(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),D=!1;P||(P=C.edge(A,_),D=!0),C.node(_).rank=C.node(A).rank+(D?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 Ny}var Fy,y2;function WG(){if(y2)return Fy;y2=1;var r=ol(),e=r.longestPath,t=KP(),n=GG();Fy=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 Fy}var zy,m2;function UG(){if(m2)return zy;m2=1;var r=Or();zy=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 zy}var $y,b2;function HG(){if(b2)return $y;b2=1;var r=Or(),e=Vt();$y={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"),m=e.addBorderNode(s,"_bb"),b=s.node(g);s.setParent(E,g),b.borderTop=E,s.setParent(m,g),b.borderBottom=m,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,m,{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 $y}var Vy,w2;function KG(){if(w2)return Vy;w2=1;var r=Or(),e=Vt();Vy=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 Vy}var Gy,x2;function jG(){if(x2)return Gy;x2=1;var r=Or();Gy={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 Gy}var Wy,E2;function YG(){if(E2)return Wy;E2=1;var r=Or();Wy=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 Wy}var Uy,C2;function ZG(){if(C2)return Uy;C2=1;var r=Or();Uy=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 Uy}var Hy,_2;function XG(){if(_2)return Hy;_2=1;var r=Or();Hy=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 Hy}var Ky,S2;function QG(){if(S2)return Ky;S2=1;var r=Or();Ky=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 Ky}var jy,T2;function JG(){if(T2)return jy;T2=1;var r=Or(),e=Vt();jy=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 jy}var Yy,R2;function eW(){if(R2)return Yy;R2=1;var r=Or(),e=XG(),t=QG(),n=JG();Yy=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 m=e(s,d);r.forEach(m,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(m,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 Yy}var Zy,A2;function rW(){if(A2)return Zy;A2=1;var r=Or(),e=En().Graph;Zy=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 Zy}var Xy,P2;function tW(){if(P2)return Xy;P2=1;var r=Or();Xy=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 Xy}var Qy,D2;function nW(){if(D2)return Qy;D2=1;var r=Or(),e=YG(),t=ZG(),n=eW(),a=rW(),i=tW(),o=En().Graph,s=Vt();Qy=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"),m=e(h);d(h,m);for(var b=Number.POSITIVE_INFINITY,w,x=0,C=0;C<4;++x,++C){c(x%2?p:E,x%4>=2),m=s.buildLayerMatrix(h);var T=t(h,m);T<b&&(C=0,w=r.cloneDeep(m),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 m=E.graph().root,b=n(E,m,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,m){h.node(E).order=m})})}return Qy}var Jy,I2;function aW(){if(I2)return Jy;I2=1;var r=Or(),e=En().Graph,t=Vt();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,D=r.last(S);return r.forEach(S,function(I,M){var k=i(b,I),N=k?b.node(k).order:P;(k||I===D)&&(r.forEach(S.slice(A,M+1),function(z){r.forEach(b.predecessors(z),function(W){var q=b.node(W),$=q.order;($<_||N<$)&&!(q.dummy&&b.node(z).dummy)&&o(x,W,z)})}),A=M+1,_=N)}),S}return r.reduce(w,C),x}function a(b,w){var x={};function C(S,_,A,P,D){var I;r.forEach(r.range(_,A),function(M){I=S[M],b.node(I).dummy&&r.forEach(b.predecessors(I),function(k){var N=b.node(k);N.dummy&&(N.order<P||N.order>D)&&o(x,k,I)})})}function T(S,_){var A=-1,P,D=0;return r.forEach(_,function(I,M){if(b.node(I).dummy==="border"){var k=b.predecessors(I);k.length&&(P=b.node(k[0]).order,C(_,D,M,A,P),D=M,A=P)}C(_,D,_.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,D){T[P]=P,S[P]=P,_[P]=D})}),r.forEach(w,function(A){var P=-1;r.forEach(A,function(D){var I=C(D);if(I.length){I=r.sortBy(I,function(W){return _[W]});for(var M=(I.length-1)/2,k=Math.floor(M),N=Math.ceil(M);k<=N;++k){var z=I[k];S[D]===D&&P<_[z]&&!s(x,D,z)&&(S[z]=D,S[D]=T[D]=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(M,k){for(var N=_.nodes(),z=N.pop(),W={};z;)W[z]?M(z):(W[z]=!0,N.push(z),N=N.concat(k(z))),z=N.pop()}function D(M){S[M]=_.inEdges(M).reduce(function(k,N){return Math.max(k,S[N.v]+_.edge(N))},0)}function I(M){var k=_.outEdges(M).reduce(function(z,W){return Math.min(z,S[W.w]-_.edge(W))},Number.POSITIVE_INFINITY),N=b.node(M);k!==Number.POSITIVE_INFINITY&&N.borderType!==A&&(S[M]=Math.max(S[M],k))}return P(D,_.predecessors.bind(_)),P(I,_.successors.bind(_)),r.forEach(C,function(M){S[M]=S[x[M]]}),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(D){var I=x[D];if(T.setNode(I),P){var M=x[P],k=T.edge(M,I);T.setEdge(M,I,Math.max(_(b,D,P),k||0))}P=D})}),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=m(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],D;if(P!==w){var I=r.values(P);D=_==="l"?C-r.min(I):T-r.max(I),D&&(b[A]=r.mapValues(P,function(M){return M+D}))}})})}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(M){return r.values(M).reverse()}));var P=(_==="u"?b.predecessors:b.successors).bind(b),D=l(b,T,x,P),I=u(b,T,D.root,D.align,A==="r");A==="r"&&(I=r.mapValues(I,function(M){return-M})),C[_+A]=I})});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,D;if(P+=_.width/2,r.has(_,"labelpos"))switch(_.labelpos.toLowerCase()){case"l":D=-_.width/2;break;case"r":D=_.width/2;break}if(D&&(P+=x?D:-D),D=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":D=A.width/2;break;case"r":D=-A.width/2;break}return D&&(P+=x?D:-D),D=0,P}}function m(b,w){return b.node(w).width}return Jy}var em,B2;function iW(){if(B2)return em;B2=1;var r=Or(),e=Vt(),t=aW().positionX;em=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 em}var rm,k2;function oW(){if(k2)return rm;k2=1;var r=Or(),e=$G(),t=VG(),n=WG(),a=Vt().normalizeRanks,i=UG(),o=Vt().removeEmptyRanks,s=HG(),l=KG(),u=jG(),c=nW(),d=iW(),h=Vt(),g=En().Graph;rm=p;function p(G,V){var j=V&&V.debugTiming?h.time:h.notime;j("layout",function(){var re=j(" buildLayoutGraph",function(){return P(G)});j(" runLayout",function(){E(re,j)}),j(" updateInputGraph",function(){m(G,re)})})}function E(G,V){V(" makeSpaceForEdgeLabels",function(){D(G)}),V(" removeSelfEdges",function(){X(G)}),V(" acyclic",function(){e.run(G)}),V(" nestingGraph.run",function(){s.run(G)}),V(" rank",function(){n(h.asNonCompoundGraph(G))}),V(" injectEdgeLabelProxies",function(){I(G)}),V(" removeEmptyRanks",function(){o(G)}),V(" nestingGraph.cleanup",function(){s.cleanup(G)}),V(" normalizeRanks",function(){a(G)}),V(" assignRankMinMax",function(){M(G)}),V(" removeEdgeLabelProxies",function(){k(G)}),V(" normalize.run",function(){t.run(G)}),V(" parentDummyChains",function(){i(G)}),V(" addBorderSegments",function(){l(G)}),V(" order",function(){c(G)}),V(" insertSelfEdges",function(){Y(G)}),V(" adjustCoordinateSystem",function(){u.adjust(G)}),V(" position",function(){d(G)}),V(" positionSelfEdges",function(){K(G)}),V(" removeBorderNodes",function(){$(G)}),V(" normalize.undo",function(){t.undo(G)}),V(" fixupEdgeLabelCoords",function(){W(G)}),V(" undoCoordinateSystem",function(){u.undo(G)}),V(" translateGraph",function(){N(G)}),V(" assignNodeIntersects",function(){z(G)}),V(" reversePoints",function(){q(G)}),V(" acyclic.undo",function(){e.undo(G)})}function m(G,V){r.forEach(G.nodes(),function(j){var re=G.node(j),ce=V.node(j);re&&(re.x=ce.x,re.y=ce.y,V.children(j).length&&(re.width=ce.width,re.height=ce.height))}),r.forEach(G.edges(),function(j){var re=G.edge(j),ce=V.edge(j);re.points=ce.points,r.has(ce,"x")&&(re.x=ce.x,re.y=ce.y)}),G.graph().width=V.graph().width,G.graph().height=V.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(G){var V=new g({multigraph:!0,compound:!0}),j=le(G.graph());return V.setGraph(r.merge({},w,ee(j,b),r.pick(j,x))),r.forEach(G.nodes(),function(re){var ce=le(G.node(re));V.setNode(re,r.defaults(ee(ce,C),T)),V.setParent(re,G.parent(re))}),r.forEach(G.edges(),function(re){var ce=le(G.edge(re));V.setEdge(re,r.merge({},_,ee(ce,S),r.pick(ce,A)))}),V}function D(G){var V=G.graph();V.ranksep/=2,r.forEach(G.edges(),function(j){var re=G.edge(j);re.minlen*=2,re.labelpos.toLowerCase()!=="c"&&(V.rankdir==="TB"||V.rankdir==="BT"?re.width+=re.labeloffset:re.height+=re.labeloffset)})}function I(G){r.forEach(G.edges(),function(V){var j=G.edge(V);if(j.width&&j.height){var re=G.node(V.v),ce=G.node(V.w),se={rank:(ce.rank-re.rank)/2+re.rank,e:V};h.addDummyNode(G,"edge-proxy",se,"_ep")}})}function M(G){var V=0;r.forEach(G.nodes(),function(j){var re=G.node(j);re.borderTop&&(re.minRank=G.node(re.borderTop).rank,re.maxRank=G.node(re.borderBottom).rank,V=r.max(V,re.maxRank))}),G.graph().maxRank=V}function k(G){r.forEach(G.nodes(),function(V){var j=G.node(V);j.dummy==="edge-proxy"&&(G.edge(j.e).labelRank=j.rank,G.removeNode(V))})}function N(G){var V=Number.POSITIVE_INFINITY,j=0,re=Number.POSITIVE_INFINITY,ce=0,se=G.graph(),Z=se.marginx||0,Q=se.marginy||0;function ae(ne){var de=ne.x,Ce=ne.y,ve=ne.width,U=ne.height;V=Math.min(V,de-ve/2),j=Math.max(j,de+ve/2),re=Math.min(re,Ce-U/2),ce=Math.max(ce,Ce+U/2)}r.forEach(G.nodes(),function(ne){ae(G.node(ne))}),r.forEach(G.edges(),function(ne){var de=G.edge(ne);r.has(de,"x")&&ae(de)}),V-=Z,re-=Q,r.forEach(G.nodes(),function(ne){var de=G.node(ne);de.x-=V,de.y-=re}),r.forEach(G.edges(),function(ne){var de=G.edge(ne);r.forEach(de.points,function(Ce){Ce.x-=V,Ce.y-=re}),r.has(de,"x")&&(de.x-=V),r.has(de,"y")&&(de.y-=re)}),se.width=j-V+Z,se.height=ce-re+Q}function z(G){r.forEach(G.edges(),function(V){var j=G.edge(V),re=G.node(V.v),ce=G.node(V.w),se,Z;j.points?(se=j.points[0],Z=j.points[j.points.length-1]):(j.points=[],se=ce,Z=re),j.points.unshift(h.intersectRect(re,se)),j.points.push(h.intersectRect(ce,Z))})}function W(G){r.forEach(G.edges(),function(V){var j=G.edge(V);if(r.has(j,"x"))switch((j.labelpos==="l"||j.labelpos==="r")&&(j.width-=j.labeloffset),j.labelpos){case"l":j.x-=j.width/2+j.labeloffset;break;case"r":j.x+=j.width/2+j.labeloffset;break}})}function q(G){r.forEach(G.edges(),function(V){var j=G.edge(V);j.reversed&&j.points.reverse()})}function $(G){r.forEach(G.nodes(),function(V){if(G.children(V).length){var j=G.node(V),re=G.node(j.borderTop),ce=G.node(j.borderBottom),se=G.node(r.last(j.borderLeft)),Z=G.node(r.last(j.borderRight));j.width=Math.abs(Z.x-se.x),j.height=Math.abs(ce.y-re.y),j.x=se.x+j.width/2,j.y=re.y+j.height/2}}),r.forEach(G.nodes(),function(V){G.node(V).dummy==="border"&&G.removeNode(V)})}function X(G){r.forEach(G.edges(),function(V){if(V.v===V.w){var j=G.node(V.v);j.selfEdges||(j.selfEdges=[]),j.selfEdges.push({e:V,label:G.edge(V)}),G.removeEdge(V)}})}function Y(G){var V=h.buildLayerMatrix(G);r.forEach(V,function(j){var re=0;r.forEach(j,function(ce,se){var Z=G.node(ce);Z.order=se+re,r.forEach(Z.selfEdges,function(Q){h.addDummyNode(G,"selfedge",{width:Q.label.width,height:Q.label.height,rank:Z.rank,order:se+ ++re,e:Q.e,label:Q.label},"_se")}),delete Z.selfEdges})})}function K(G){r.forEach(G.nodes(),function(V){var j=G.node(V);if(j.dummy==="selfedge"){var re=G.node(j.e.v),ce=re.x+re.width/2,se=re.y,Z=j.x-ce,Q=re.height/2;G.setEdge(j.e,j.label),G.removeNode(V),j.label.points=[{x:ce+2*Z/3,y:se-Q},{x:ce+5*Z/6,y:se-Q},{x:ce+Z,y:se},{x:ce+5*Z/6,y:se+Q},{x:ce+2*Z/3,y:se+Q}],j.label.x=j.x,j.label.y=j.y}})}function ee(G,V){return r.mapValues(r.pick(G,V),Number)}function le(G){var V={};return r.forEach(G,function(j,re){V[re.toLowerCase()]=j}),V}return rm}var tm,M2;function sW(){if(M2)return tm;M2=1;var r=Or(),e=Vt(),t=En().Graph;tm={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 tm}var nm,L2;function uW(){return L2||(L2=1,nm="0.8.5"),nm}var am,O2;function lW(){return O2||(O2=1,am={graphlib:En(),layout:oW(),debug:sW(),util:{time:Vt().time,notime:Vt().notime},version:uW()}),am}var fW=Gu.exports,q2;function cW(){return q2||(q2=1,(function(r,e){(function(n,a){r.exports=a(lW())})(fW,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,m=function(K,ee){return s(ee)?ee.apply(K,[K]):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(K,ee){ee!=null&&(x[K]=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 D=T[P];D.isChild()&&w.setParent(D.id(),D.parent().id())}var I=E.edges().stdFilter(function(Y){return!Y.source().isParent()&&!Y.target().isParent()});s(h.sort)&&(I=I.sort(h.sort));for(var M=0;M<I.length;M++){var k=I[M];w.setEdge(k.source().id(),k.target().id(),{minlen:m(k,h.minLen),weight:m(k,h.edgeWeight),name:k.id()},k.id())}c.layout(w);for(var N=w.nodes(),z=0;z<N.length;z++){var W=N[z],q=w.node(W);p.getElementById(W).scratch().dagre=q}var $;h.boundingBox?($={x1:1/0,x2:-1/0,y1:1/0,y2:-1/0},T.forEach(function(Y){var K=Y.scratch().dagre;$.x1=Math.min($.x1,K.x),$.x2=Math.max($.x2,K.x),$.y1=Math.min($.y1,K.y),$.y2=Math.max($.y2,K.y)}),$.w=$.x2-$.x1,$.h=$.y2-$.y1):$=b;var X=function(K){if(h.boundingBox){var ee=$.w===0?0:(K.x-$.x1)/$.w,le=$.h===0?0:(K.y-$.y1)/$.h;return{x:b.x1+ee*b.w,y:b.y1+le*b.h}}else return K};return T.layoutPositions(g,h,function(Y){Y=o(Y)==="object"?Y:this;var K=Y.scratch().dagre;return X({x:K.x,y:K.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})])})})(Gu)),Gu.exports}var dW=cW();const vW=Rl(dW);var Wu={exports:{}},im,N2;function hW(){if(N2)return im;N2=1;var r="Expected a function",e="__lodash_hash_undefined__",t="[object Function]",n="[object GeneratorFunction]",a=/[\\^$.*+?()[\]{}|]/g,i=/^\[object .+?Constructor\]$/,o=typeof Ct=="object"&&Ct&&Ct.Object===Object&&Ct,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:""})(),m=h.toString,b=g.hasOwnProperty,w=g.toString,x=RegExp("^"+m.call(b).replace(a,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),C=d.splice,T=ce(l,"Map"),S=ce(Object,"create");function _(ve){var U=-1,fe=ve?ve.length:0;for(this.clear();++U<fe;){var we=ve[U];this.set(we[0],we[1])}}function A(){this.__data__=S?S(null):{}}function P(ve){return this.has(ve)&&delete this.__data__[ve]}function D(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 I(ve){var U=this.__data__;return S?U[ve]!==void 0:b.call(U,ve)}function M(ve,U){var fe=this.__data__;return fe[ve]=S&&U===void 0?e:U,this}_.prototype.clear=A,_.prototype.delete=P,_.prototype.get=D,_.prototype.has=I,_.prototype.set=M;function k(ve){var U=-1,fe=ve?ve.length:0;for(this.clear();++U<fe;){var we=ve[U];this.set(we[0],we[1])}}function N(){this.__data__=[]}function z(ve){var U=this.__data__,fe=V(U,ve);if(fe<0)return!1;var we=U.length-1;return fe==we?U.pop():C.call(U,fe,1),!0}function W(ve){var U=this.__data__,fe=V(U,ve);return fe<0?void 0:U[fe][1]}function q(ve){return V(this.__data__,ve)>-1}function $(ve,U){var fe=this.__data__,we=V(fe,ve);return we<0?fe.push([ve,U]):fe[we][1]=U,this}k.prototype.clear=N,k.prototype.delete=z,k.prototype.get=W,k.prototype.has=q,k.prototype.set=$;function X(ve){var U=-1,fe=ve?ve.length:0;for(this.clear();++U<fe;){var we=ve[U];this.set(we[0],we[1])}}function Y(){this.__data__={hash:new _,map:new(T||k),string:new _}}function K(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 G(ve,U){return re(this,ve).set(ve,U),this}X.prototype.clear=Y,X.prototype.delete=K,X.prototype.get=ee,X.prototype.has=le,X.prototype.set=G;function V(ve,U){for(var fe=ve.length;fe--;)if(ne(ve[fe][0],U))return fe;return-1}function j(ve){if(!Ce(ve)||Z(ve))return!1;var U=de(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 ce(ve,U){var fe=u(ve,U);return j(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 Z(ve){return!!E&&E in ve}function Q(ve){if(ve!=null){try{return m.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 we=arguments,ge=U?U.apply(this,we):we[0],me=fe.cache;if(me.has(ge))return me.get(ge);var Re=ve.apply(this,we);return fe.cache=me.set(ge,Re),Re};return fe.cache=new(ae.Cache||X),fe}ae.Cache=X;function ne(ve,U){return ve===U||ve!==ve&&U!==U}function de(ve){var U=Ce(ve)?w.call(ve):"";return U==t||U==n}function Ce(ve){var U=typeof ve;return!!ve&&(U=="object"||U=="function")}return im=ae,im}var om,F2;function gW(){if(F2)return om;F2=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 Ct=="object"&&Ct&&Ct.Object===Object&&Ct,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 m(S,_,A){var P,D,I,M,k,N,z=0,W=!1,q=!1,$=!0;if(typeof S!="function")throw new TypeError(r);_=T(_)||0,w(A)&&(W=!!A.leading,q="maxWait"in A,I=q?g(T(A.maxWait)||0,_):I,$="trailing"in A?!!A.trailing:$);function X(ce){var se=P,Z=D;return P=D=void 0,z=ce,M=S.apply(Z,se),M}function Y(ce){return z=ce,k=setTimeout(le,_),W?X(ce):M}function K(ce){var se=ce-N,Z=ce-z,Q=_-se;return q?p(Q,I-Z):Q}function ee(ce){var se=ce-N,Z=ce-z;return N===void 0||se>=_||se<0||q&&Z>=I}function le(){var ce=E();if(ee(ce))return G(ce);k=setTimeout(le,K(ce))}function G(ce){return k=void 0,$&&P?X(ce):(P=D=void 0,M)}function V(){k!==void 0&&clearTimeout(k),z=0,P=N=D=k=void 0}function j(){return k===void 0?M:G(E())}function re(){var ce=E(),se=ee(ce);if(P=arguments,D=this,N=ce,se){if(k===void 0)return Y(N);if(q)return k=setTimeout(le,_),X(N)}return k===void 0&&(k=setTimeout(le,_)),M}return re.cancel=V,re.flush=j,re}function b(S,_,A){var P=!0,D=!0;if(typeof S!="function")throw new TypeError(r);return w(A)&&(P="leading"in A?!!A.leading:P,D="trailing"in A?!!A.trailing:D),m(S,_,{leading:P,maxWait:_,trailing:D})}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 om=b,om}var pW=Wu.exports,z2;function yW(){return z2||(z2=1,(function(r,e){(function(n,a){r.exports=a(hW(),gW())})(pW,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(),D=this.canConnect(_);if(T&&D){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 I=w.add(d({group:"edges",data:{source:S.id(),target:_.id()}},this.edgeParams(_),A));return P=P.merge(I),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 m(){var b=this,w=this.sourceNode,x=this.ghostNode,C=this.cy,T=this.mx,S=this.my,_=T,A=S,P=void 0,D=void 0;if(w)return(!x||x.length===0||x.removed())&&(D=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 I={};P=C.add(l({},I,{group:"edges",data:l({},I.data,{source:w.id(),target:x.id()}),classes:"eh-ghost eh-ghost-edge"})),P.style({events:"no"})}),D.merge(x).merge(P)),x.position({x:_,y:A}),this}a.exports={makeEdges:h,makePreview:g,removePreview:E,previewShown:p,updateEdge:m}}),(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(M){return x.anySame(M)},S=function(M){return C.anySame(M)},_=function(M){return T(M)||S(M)},A=this.enabled,P=this.active,D=this.grabbingNode;return A&&!P&&!D&&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(V){return l*Math.max(V.outerWidth(),V.outerHeight())/2},P=function(V,j,re,ce){var se=re-V,Z=ce-j;return se*se+Z*Z},D=function(V,j){return P(V.x,V.y,j.x,j.y)},I=function(V){return D(V.position(),T)},M=function(V){var j=A(V),re=j+C;return re*re},k=function(V){return I(V)<=M(V)},N=function(V){var j=V.position(),re=V.outerWidth()/2,ce=V.outerHeight()/2,se=j.x,Z=j.y,Q=T.x,ae=T.y,ne=se-re,de=se+re,Ce=Z-ce,ve=Z+ce,U=ne<=Q&&Q<=de,fe=Ce<=ae&&ae<=ve;if(U&&fe)return 0;if(U){var we=ae-Ce,ge=ae-ve;return Math.min(we*we,ge*ge)}else if(fe){var me=Q-ne,Re=Q-de;return Math.min(me*me,Re*Re)}else return Q<ne&&ae<Ce?P(Q,ae,ne,Ce):Q>de&&ae<Ce?P(Q,ae,de,Ce):Q<ne&&ae>ve?P(Q,ae,ne,ve):P(Q,ae,de,ve)},z=function(V,j){return N(V)-N(j)},W=z,q=!1,$=function(V){var j=T,re=V.outerWidth(),ce=re/2,se=V.outerHeight(),Z=se/2,Q=V.position(),ae=Q.x-ce,ne=Q.x+ce,de=Q.y-Z,Ce=Q.y+Z;return ae<=j.x&&j.x<=ne&&de<=j.y&&j.y<=Ce},X=function(V){return V.same(S)||V.same(_)},Y=w.nodes(function(G){return!X(G)&&k(G)}).sort(W),K=!1;x.nonempty()&&!k(x)&&this.unpreview(x);for(var ee=0;ee<Y.length;ee++){var le=Y[ee];if(!(le.isParent()&&$(le))&&!(le.isChild()&&!$(le.parent()))&&(le.same(x)||this.preview(le,q))){K=!0;break}}return K}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,D=this.previewEles,I=this.active,M=S,k=w.same(_),N=!this.canConnect(w),z=w.same(this.targetNode);if(!I||k||N||z)return!1;this.targetNode.nonempty()&&this.unpreview(this.targetNode),clearTimeout(this.previewTimeout);var W=function(){x.targetNode=w,P.merge(w),w.addClass("eh-presumptive-target"),w.addClass("eh-target"),x.emit("hoverover",x.mp(),M,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(),M,w,D)};return C&&T.hoverDelay>0?this.previewTimeout=setTimeout(W,T.hoverDelay):W(),!0}function m(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:m,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),m=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,m,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 m=this.listeners[E];this.removeListener(m.target,m.event,m.selector,m.callback,m.options)}return this}function c(E,m,b,w,x){return(typeof b>"u"?"undefined":s(b))!==s("")&&(w=b,x=w,b=null),x==null&&(x=!1),{target:E,event:m,selector:b,callback:w,options:x}}function d(E){return E instanceof Element}function h(E,m,b,w,x){var C=c(E,m,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,m,b,w,x){for(var C=c(E,m,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,m){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:m},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})])})})(Wu)),Wu.exports}var mW=yW();const bW=Rl(mW);var sm,$2;function wW(){if($2)return sm;$2=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),sm=e,sm}var xW=wW();const EW=Rl(xW);ln.prototype.hasInitialised||(ln.use(vW),ln.use(bW),ln.use(EW),ln.prototype.hasInitialised=!0);var Ho={exports:{}};/**
331
+ `),s=s3(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),p3(a,"vec2",i.aPosition,t),this.transformBuffer=y3(a,n,i.aTransform),this.indexBuffer=Pn(a,n,"vec4",i.aIndex),this.vertTypeBuffer=Pn(a,n,"int",i.aVertType),this.atlasIdBuffer=Pn(a,n,"int",i.aAtlasId),this.texBuffer=Pn(a,n,"vec4",i.aTex),this.pointAPointBBuffer=Pn(a,n,"vec4",i.aPointAPointB),this.pointCPointDBuffer=Pn(a,n,"vec4",i.aPointCPointD),this.lineWidthBuffer=Pn(a,n,"vec2",i.aLineWidth),this.colorBuffer=Pn(a,n,"vec4",i.aColor),this.cornerRadiusBuffer=Pn(a,n,"vec4",i.aCornerRadius),this.borderColorBuffer=Pn(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 wa(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]:Zo.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===al.IGNORE)return;if(l==al.USE_BB){this.drawPickingRectangle(t,n,a);return}}var u=i.getAtlasInfo(t,a),c=$t(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 m=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]=qd;var _=this.indexBuffer.getView(S);Vi(n,_);var A=this.atlasIdBuffer.getView(S);A[0]=m;var P=this.texBuffer.getView(S);P[0]=C.x,P[1]=C.y,P[2]=C.w,P[3]=C.h;var D=this.transformBuffer.getMatrixView(S);this.setTransformMatrix(t,D,s,h,T),this.instanceCount++,T||this.wrappedCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}}}catch(I){c.e(I)}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;fE(t);var l=a.getRotation?a.getRotation(i):0;if(l!==0){var u=a.getRotationPoint(i),c=u.x,d=u.y;Vu(t,t,[c,d]),cE(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;Vu(t,t,[o,s]),Sm(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]=Gi;var s=this.indexBuffer.getView(o);Vi(n,s);var l=this.colorBuffer.getView(o);Ja([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===Du||s===No){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===No&&(d[0]=0,d[2]=0)}var h=this.indexBuffer.getView(l);Vi(n,h);var g=t.pstyle(o.color).value,p=t.pstyle(o.opacity).value,E=this.colorBuffer.getView(l);Ja(g,p,E);var m=this.lineWidthBuffer.getView(l);if(m[0]=0,m[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);Ja(w,x,C);var T=t.pstyle("border-position").value;if(T==="inside")m[0]=0,m[1]=-b;else if(T==="outside")m[0]=b,m[1]=0;else{var S=b/2;m[0]=S,m[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 Gi;case"ellipse":return Fo;case"roundrectangle":case"round-rectangle":return Du;case"bottom-round-rectangle":return No;default:return}}},{key:"_getCornerRadius",value:function(t,n,a){var i=a.w,o=a.h;if(t.pstyle(n).value==="auto")return Aa(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,m=this.r.getArrowWidth(p,E),b=this.instanceCount,w=this.transformBuffer.getMatrixView(b);fE(w),Vu(w,w,[o,s]),Sm(w,w,[m,m]),cE(w,w,l),this.vertTypeBuffer.getView(b)[0]=Nd;var x=this.indexBuffer.getView(b);Vi(n,x);var C=this.colorBuffer.getView(b);Ja(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]=dE;var d=this.indexBuffer.getView(c);Vi(n,d);var h=this.colorBuffer.getView(c);Ja(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 m=this.instanceCount;this.vertTypeBuffer.getView(m)[0]=vE;var b=this.indexBuffer.getView(m);Vi(n,b);var w=this.colorBuffer.getView(m);Ja(l,u,w);var x=this.lineWidthBuffer.getView(m);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],D=a[E+4],I=a[E+5];E==0&&(C=2*S-A+.001,T=2*_-P+.001),E==a.length-4&&(D=2*A-S+.001,I=2*P-_+.001);var M=this.pointAPointBBuffer.getView(m);M[0]=C,M[1]=T,M[2]=S,M[3]=_;var k=this.pointCPointDBuffer.getView(m);k[0]=A,k[1]=P,k[2]=D,k[3]=I,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=$t(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,l3(this.r)),t.uniformMatrix3fv(o.uPanZoomMatrix,!1,this.panZoomMatrix),t.uniform1i(o.uAtlasSize,this.batchManager.getAtlasSize());var g=Ja(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}}}])})(),qA={};qA.initWebgl=function(r,e){var t=this,n=t.data.contexts[t.WEBGL];r.bgColor=I3(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=m3(n),t.pickingFrameBuffer.needsDraw=!0,t.drawing=new D3(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?al.USE_BB:al.IGNORE},l=function(d){var h=d.position(),g=h.x,p=h.y,E=d.outerWidth(),m=d.outerHeight();return{w:E,h:m,x1:g-E/2,y1:p-m/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:c3,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:Fd(e.getLabelKey,null),getBoundingBox:zd(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:Fd(e.getSourceLabelKey,"source"),getBoundingBox:zd(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:Fd(e.getTargetLabelKey,"target"),getBoundingBox:zd(e.getTargetLabelBox,"target"),drawClipped:!0,drawElement:e.drawTargetLabel,getRotation:a("target"),getRotationPoint:e.getTargetLabelRotationPoint,getRotationOffset:e.getTargetLabelRotationOffset,isVisible:i("target-label")});var u=ms(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()}),B3(t)};function I3(r){var e=r.cy.container(),t=e&&e.style&&e.style.backgroundColor||"white";return cR(t)}function NA(r,e){var t=r._private.rscratch;return Ft(t,"labelWrapCachedLines",e)||[]}var Fd=function(e,t){return function(n){var a=e(n),i=NA(n,t);return i.length>1?i.map(function(o,s){return"".concat(a,"_").concat(s)}):a}},zd=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=NA(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 B3(r){{var e=r.render;r.render=function(i){i=i||{};var o=r.cy;r.webgl&&(o.zoom()>DA?(k3(r),e.call(r,i)):(M3(r),zA(r,i,Zo.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 z3(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 k3(r){var e=r.data.contexts[r.WEBGL];e.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT)}function M3(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 L3(r){var e=r.canvasWidth,t=r.canvasHeight,n=e0(r),a=n.pan,i=n.zoom,o=Od();Vu(o,o,[a.x,a.y]),Sm(o,o,[i,i]);var s=Od();w3(s,e,t);var l=Od();return b3(l,s,o),l}function FA(r,e){var t=r.canvasWidth,n=r.canvasHeight,a=e0(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 O3(r,e){r.drawSelectionRectangle(e,function(t){return FA(r,t)})}function q3(r){var e=r.data.contexts[r.NODE];e.save(),FA(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 N3(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,m=h.height*o,b=.4;l.save(),l.scale(b,b),l.drawImage(h,E,m),l.strokeStyle="black",l.rect(E,m,g,p),l.stroke(),l.restore()}}},t=0;e(r.drawing,"node",t++),e(r.drawing,"label",t++)}function F3(r,e,t,n,a){var i,o,s,l,u=e0(r),c=u.pan,d=u.zoom;{var h=f3(r,c,d,e,t),g=Yr(h,2),p=g[0],E=g[1],m=6;i=p-m/2,o=E-m/2,s=m,l=m}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),zA(r,null,Zo.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),_=v3(S)-1;_>=0&&C.add(_)}return C}function z3(r,e,t){var n=F3(r,e,t),a=r.getCachedZSortedEles(),i,o,s=$t(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 $d(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 zA(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]&&O3(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=L3(r),l=r.getCachedZSortedEles();if(i=l.length,a.startFrame(s,t),t.screen){for(var u=0;u<l.nondrag.length;u++)$d(r,u,l.nondrag[u]);for(var c=0;c<l.drag.length;c++)$d(r,c,l.drag[c])}else if(t.picking)for(var d=0;d<l.length;d++)$d(r,d,l[d]);a.endFrame(),t.screen&&r.webglDebugShowAtlases&&(q3(r),N3(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(),m=["".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(m));else{console.log("WebGL (".concat(t.name,") - frame time ").concat(p,"ms")),console.log("Totals:"),console.log(" ".concat(m)),console.log("Texture Atlases Used:");var b=E.atlasInfo,w=$t(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 Fa={};Fa.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()};Fa.drawRoundPolygonPath=function(r,e,t,n,a,i,o){o.forEach(function(s){return xA(r,s)}),r.closePath()};Fa.drawRoundRectanglePath=function(r,e,t,n,a,i){var o=n/2,s=a/2,l=i==="auto"?Aa(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()};Fa.drawBottomRoundRectanglePath=function(r,e,t,n,a,i){var o=n/2,s=a/2,l=i==="auto"?Aa(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()};Fa.drawCutRectanglePath=function(r,e,t,n,a,i,o){var s=n/2,l=a/2,u=o==="auto"?zm():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()};Fa.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=cm(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 hE=Math.sin(0),gE=Math.cos(0),Tm={},Rm={},$A=Math.PI/40;for(var Wi=0*Math.PI;Wi<2*Math.PI;Wi+=$A)Tm[Wi]=Math.sin(Wi),Rm[Wi]=Math.cos(Wi);Fa.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+=$A)i=e-s*Tm[u]*hE+s*Rm[u]*gE,o=t+l*Rm[u]*hE+l*Tm[u]*gE,u===0?r.moveTo(i,o):r.lineTo(i,o);r.closePath()};var _s={};_s.createBuffer=function(r,e){var t=document.createElement("canvas");return t.width=r,t.height=e,[t,t.getContext("2d")]};_s.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=ke(r.maxWidth)||ke(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;ke(r.maxWidth)&&(c=u*r.maxWidth/i),ke(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(),m={x:E.x*u,y:E.y*u};u*=e.zoom(),g.translate(m.x,m.y),g.scale(u,u),this.drawElements(g,p),g.scale(1/u,1/u),g.translate(-m.x,-m.y)}r.bg&&(g.globalCompositeOperation="destination-over",g.fillStyle=r.bg,g.rect(0,0,i,o),g.fill())}return h};function $3(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 pE(r){var e=r.indexOf(",");return r.substr(e+1)}function VA(r,e,t){var n=function(){return e.toDataURL(t,r.quality)};switch(r.output){case"blob-promise":return new oo(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 $3(pE(n()),t);case"base64":return pE(n());case"base64uri":default:return n()}}_s.png=function(r){return VA(r,this.bufferCanvasImage(r),"image/png")};_s.jpg=function(r){return VA(r,this.bufferCanvasImage(r),"image/jpeg")};var GA={};GA.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 V3=WA,fr=WA.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 WA(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"};Oq()&&(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=Bt(),g=function(Z){return{x:(Z.x1+Z.x2)/2,y:(Z.y1+Z.y2)/2}},p=function(Z){return{x:-Z.w/2,y:-Z.h/2}},E=function(Z){var Q=Z[0]._private,ae=Q.oldBackgroundTimestamp===Q.backgroundTimestamp;return!ae},m=function(Z){return Z[0]._private.nodeKey},b=function(Z){return Z[0]._private.labelStyleKey},w=function(Z){return Z[0]._private.sourceLabelStyleKey},x=function(Z){return Z[0]._private.targetLabelStyleKey},C=function(Z,Q,ae,ne,de){return e.drawElement(Z,Q,ae,!1,!1,de)},T=function(Z,Q,ae,ne,de){return e.drawElementText(Z,Q,ae,ne,"main",de)},S=function(Z,Q,ae,ne,de){return e.drawElementText(Z,Q,ae,ne,"source",de)},_=function(Z,Q,ae,ne,de){return e.drawElementText(Z,Q,ae,ne,"target",de)},A=function(Z){return Z.boundingBox(),Z[0]._private.bodyBounds},P=function(Z){return Z.boundingBox(),Z[0]._private.labelBounds.main||h},D=function(Z){return Z.boundingBox(),Z[0]._private.labelBounds.source||h},I=function(Z){return Z.boundingBox(),Z[0]._private.labelBounds.target||h},M=function(Z,Q){return Q},k=function(Z){return g(A(Z))},N=function(Z,Q,ae){var ne=Z?Z+"-":"";return{x:Q.x+ae.pstyle(ne+"text-margin-x").pfValue,y:Q.y+ae.pstyle(ne+"text-margin-y").pfValue}},z=function(Z,Q,ae){var ne=Z[0]._private.rscratch;return{x:ne[Q],y:ne[ae]}},W=function(Z){return N("",z(Z,"labelX","labelY"),Z)},q=function(Z){return N("source",z(Z,"sourceLabelX","sourceLabelY"),Z)},$=function(Z){return N("target",z(Z,"targetLabelX","targetLabelY"),Z)},X=function(Z){return p(A(Z))},Y=function(Z){return p(D(Z))},K=function(Z){return p(I(Z))},ee=function(Z){var Q=P(Z),ae=p(P(Z));if(Z.isNode()){switch(Z.pstyle("text-halign").value){case"left":ae.x=-Q.w-(Q.leftPad||0);break;case"right":ae.x=-(Q.rightPad||0);break}switch(Z.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 Vo(e,{getKey:m,doesEleInvalidateKey:E,drawElement:C,getBoundingBox:A,getRotationPoint:k,getRotationOffset:X,allowEdgeTxrCaching:!1,allowParentTxrCaching:!1}),G=e.data.lblTxrCache=new Vo(e,{getKey:b,drawElement:T,getBoundingBox:P,getRotationPoint:W,getRotationOffset:ee,isVisible:M}),V=e.data.slbTxrCache=new Vo(e,{getKey:w,drawElement:S,getBoundingBox:D,getRotationPoint:q,getRotationOffset:Y,isVisible:M}),j=e.data.tlbTxrCache=new Vo(e,{getKey:x,drawElement:_,getBoundingBox:I,getRotationPoint:$,getRotationOffset:K,isVisible:M}),re=e.data.lyrTxrCache=new IA(e);e.onUpdateEleCalcs(function(Z,Q){le.invalidateElements(Q),G.invalidateElements(Q),V.invalidateElements(Q),j.invalidateElements(Q),re.invalidateElements(Q);for(var ae=0;ae<Q.length;ae++){var ne=Q[ae]._private;ne.oldBackgroundTimestamp=ne.backgroundTimestamp}});var ce=function(Z){for(var Q=0;Q<Z.length;Q++)re.enqueueElementRefinement(Z[Q].ele)};le.onDequeue(ce),G.onDequeue(ce),V.onDequeue(ce),j.onDequeue(ce),r.webgl&&e.initWebgl(r,{getStyleKey:m,getLabelKey:b,getSourceLabelKey:w,getTargetLabelKey:x,drawElement:C,drawLabel:T,drawSourceLabel:S,drawTargetLabel:_,getElementBox:A,getLabelBox:P,getSourceLabelBox:D,getTargetLabelBox:I,getElementRotationPoint:k,getElementRotationOffset:X,getLabelRotationPoint:W,getSourceLabelRotationPoint:q,getTargetLabelRotationPoint:$,getLabelRotationOffset:ee,getSourceLabelRotationOffset:Y,getTargetLabelRotationOffset:K})}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 G3=typeof Path2D<"u";fr.path2dEnabled=function(r){if(r===void 0)return this.pathsEnabled;this.pathsEnabled=!!r};fr.usePaths=function(){return G3&&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};[BA,On,ra,Jm,di,Na,kt,qA,Fa,_s,GA].forEach(function(r){Ye(fr,r)});var W3=[{name:"null",impl:mA},{name:"base",impl:AA},{name:"canvas",impl:V3}],U3=[{type:"layout",extensions:p$},{type:"renderer",extensions:W3}],UA={},HA={};function KA(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(us.prototype[e])return a(e);us.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 bl(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=jA("renderer","base"),p=g.prototype,E=t,m=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=m[x]!=null;if(T)return a(x);w[x]=C}for(var S in m)w[S]=m[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 dR({map:UA,keys:[r,e],value:n})}function jA(r,e){return vR({map:UA,keys:[r,e]})}function H3(r,e,t,n,a){return dR({map:HA,keys:[r,e,t,n],value:a})}function K3(r,e,t,n){return vR({map:HA,keys:[r,e,t,n]})}var Am=function(){if(arguments.length===2)return jA.apply(null,arguments);if(arguments.length===3)return KA.apply(null,arguments);if(arguments.length===4)return K3.apply(null,arguments);if(arguments.length===5)return H3.apply(null,arguments);Lr("Invalid extension access syntax")};us.prototype.extension=Am;U3.forEach(function(r){r.extensions.forEach(function(e){KA(r.type,e.name,e.impl)})});var il=function(){if(!(this instanceof il))return new il;this.length=0},fi=il.prototype;fi.instanceString=function(){return"stylesheet"};fi.selector=function(r){var e=this.length++;return this[e]={selector:r,properties:[]},this};fi.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[ll(o)];if(l!=null){var u=l.name,c=s;this[t].properties.push({name:u,value:c})}}}return this};fi.style=fi.css;fi.generateStyle=function(r){var e=new st(r);return this.appendToStyle(e)};fi.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 j3="3.33.1",ln=function(e){if(e===void 0&&(e={}),pr(e))return new us(e);if(Ke(e))return Am.apply(Am,arguments)};ln.use=function(r){var e=Array.prototype.slice.call(arguments,1);return e.unshift(ln),r.apply(null,e),this};ln.warnings=function(r){return wR(r)};ln.version=j3;ln.stylesheet=ln.Stylesheet=il;var Ct=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Rl(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var Gu={exports:{}};function r0(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 Vd,yE;function Y3(){if(yE)return Vd;yE=1;function r(){this.__data__=[],this.size=0}return Vd=r,Vd}var Gd,mE;function co(){if(mE)return Gd;mE=1;function r(e,t){return e===t||e!==e&&t!==t}return Gd=r,Gd}var Wd,bE;function Al(){if(bE)return Wd;bE=1;var r=co();function e(t,n){for(var a=t.length;a--;)if(r(t[a][0],n))return a;return-1}return Wd=e,Wd}var Ud,wE;function Z3(){if(wE)return Ud;wE=1;var r=Al(),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 Ud=n,Ud}var Hd,xE;function X3(){if(xE)return Hd;xE=1;var r=Al();function e(t){var n=this.__data__,a=r(n,t);return a<0?void 0:n[a][1]}return Hd=e,Hd}var Kd,EE;function Q3(){if(EE)return Kd;EE=1;var r=Al();function e(t){return r(this.__data__,t)>-1}return Kd=e,Kd}var jd,CE;function J3(){if(CE)return jd;CE=1;var r=Al();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 jd=e,jd}var Yd,_E;function Pl(){if(_E)return Yd;_E=1;var r=Y3(),e=Z3(),t=X3(),n=Q3(),a=J3();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,Yd=i,Yd}var Zd,SE;function eV(){if(SE)return Zd;SE=1;var r=Pl();function e(){this.__data__=new r,this.size=0}return Zd=e,Zd}var Xd,TE;function rV(){if(TE)return Xd;TE=1;function r(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}return Xd=r,Xd}var Qd,RE;function tV(){if(RE)return Qd;RE=1;function r(e){return this.__data__.get(e)}return Qd=r,Qd}var Jd,AE;function nV(){if(AE)return Jd;AE=1;function r(e){return this.__data__.has(e)}return Jd=r,Jd}var ev,PE;function YA(){if(PE)return ev;PE=1;var r=typeof Ct=="object"&&Ct&&Ct.Object===Object&&Ct;return ev=r,ev}var rv,DE;function Cn(){if(DE)return rv;DE=1;var r=YA(),e=typeof self=="object"&&self&&self.Object===Object&&self,t=r||e||Function("return this")();return rv=t,rv}var tv,IE;function vo(){if(IE)return tv;IE=1;var r=Cn(),e=r.Symbol;return tv=e,tv}var nv,BE;function aV(){if(BE)return nv;BE=1;var r=vo(),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 nv=i,nv}var av,kE;function iV(){if(kE)return av;kE=1;var r=Object.prototype,e=r.toString;function t(n){return e.call(n)}return av=t,av}var iv,ME;function vi(){if(ME)return iv;ME=1;var r=vo(),e=aV(),t=iV(),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 iv=o,iv}var ov,LE;function cn(){if(LE)return ov;LE=1;function r(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}return ov=r,ov}var sv,OE;function Ss(){if(OE)return sv;OE=1;var r=vi(),e=cn(),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 sv=o,sv}var uv,qE;function oV(){if(qE)return uv;qE=1;var r=Cn(),e=r["__core-js_shared__"];return uv=e,uv}var lv,NE;function sV(){if(NE)return lv;NE=1;var r=oV(),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 lv=t,lv}var fv,FE;function ZA(){if(FE)return fv;FE=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 fv=t,fv}var cv,zE;function uV(){if(zE)return cv;zE=1;var r=Ss(),e=sV(),t=cn(),n=ZA(),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 cv=d,cv}var dv,$E;function lV(){if($E)return dv;$E=1;function r(e,t){return e==null?void 0:e[t]}return dv=r,dv}var vv,VE;function hi(){if(VE)return vv;VE=1;var r=uV(),e=lV();function t(n,a){var i=e(n,a);return r(i)?i:void 0}return vv=t,vv}var hv,GE;function t0(){if(GE)return hv;GE=1;var r=hi(),e=Cn(),t=r(e,"Map");return hv=t,hv}var gv,WE;function Dl(){if(WE)return gv;WE=1;var r=hi(),e=r(Object,"create");return gv=e,gv}var pv,UE;function fV(){if(UE)return pv;UE=1;var r=Dl();function e(){this.__data__=r?r(null):{},this.size=0}return pv=e,pv}var yv,HE;function cV(){if(HE)return yv;HE=1;function r(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}return yv=r,yv}var mv,KE;function dV(){if(KE)return mv;KE=1;var r=Dl(),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 mv=a,mv}var bv,jE;function vV(){if(jE)return bv;jE=1;var r=Dl(),e=Object.prototype,t=e.hasOwnProperty;function n(a){var i=this.__data__;return r?i[a]!==void 0:t.call(i,a)}return bv=n,bv}var wv,YE;function hV(){if(YE)return wv;YE=1;var r=Dl(),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 wv=t,wv}var xv,ZE;function gV(){if(ZE)return xv;ZE=1;var r=fV(),e=cV(),t=dV(),n=vV(),a=hV();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,xv=i,xv}var Ev,XE;function pV(){if(XE)return Ev;XE=1;var r=gV(),e=Pl(),t=t0();function n(){this.size=0,this.__data__={hash:new r,map:new(t||e),string:new r}}return Ev=n,Ev}var Cv,QE;function yV(){if(QE)return Cv;QE=1;function r(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}return Cv=r,Cv}var _v,JE;function Il(){if(JE)return _v;JE=1;var r=yV();function e(t,n){var a=t.__data__;return r(n)?a[typeof n=="string"?"string":"hash"]:a.map}return _v=e,_v}var Sv,eC;function mV(){if(eC)return Sv;eC=1;var r=Il();function e(t){var n=r(this,t).delete(t);return this.size-=n?1:0,n}return Sv=e,Sv}var Tv,rC;function bV(){if(rC)return Tv;rC=1;var r=Il();function e(t){return r(this,t).get(t)}return Tv=e,Tv}var Rv,tC;function wV(){if(tC)return Rv;tC=1;var r=Il();function e(t){return r(this,t).has(t)}return Rv=e,Rv}var Av,nC;function xV(){if(nC)return Av;nC=1;var r=Il();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 Av=e,Av}var Pv,aC;function n0(){if(aC)return Pv;aC=1;var r=pV(),e=mV(),t=bV(),n=wV(),a=xV();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 Dv,iC;function EV(){if(iC)return Dv;iC=1;var r=Pl(),e=t0(),t=n0(),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 Dv=a,Dv}var Iv,oC;function Bl(){if(oC)return Iv;oC=1;var r=Pl(),e=eV(),t=rV(),n=tV(),a=nV(),i=EV();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,Iv=o,Iv}var Bv,sC;function a0(){if(sC)return Bv;sC=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 Bv=r,Bv}var kv,uC;function XA(){if(uC)return kv;uC=1;var r=hi(),e=(function(){try{var t=r(Object,"defineProperty");return t({},"",{}),t}catch{}})();return kv=e,kv}var Mv,lC;function kl(){if(lC)return Mv;lC=1;var r=XA();function e(t,n,a){n=="__proto__"&&r?r(t,n,{configurable:!0,enumerable:!0,value:a,writable:!0}):t[n]=a}return Mv=e,Mv}var Lv,fC;function Ml(){if(fC)return Lv;fC=1;var r=kl(),e=co(),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 Lv=a,Lv}var Ov,cC;function Ts(){if(cC)return Ov;cC=1;var r=Ml(),e=kl();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 Ov=t,Ov}var qv,dC;function CV(){if(dC)return qv;dC=1;function r(e,t){for(var n=-1,a=Array(e);++n<e;)a[n]=t(n);return a}return qv=r,qv}var Nv,vC;function qn(){if(vC)return Nv;vC=1;function r(e){return e!=null&&typeof e=="object"}return Nv=r,Nv}var Fv,hC;function _V(){if(hC)return Fv;hC=1;var r=vi(),e=qn(),t="[object Arguments]";function n(a){return e(a)&&r(a)==t}return Fv=n,Fv}var zv,gC;function Rs(){if(gC)return zv;gC=1;var r=_V(),e=qn(),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 zv=i,zv}var $v,pC;function Zr(){if(pC)return $v;pC=1;var r=Array.isArray;return $v=r,$v}var Go={exports:{}},Vv,yC;function SV(){if(yC)return Vv;yC=1;function r(){return!1}return Vv=r,Vv}Go.exports;var mC;function ho(){return mC||(mC=1,(function(r,e){var t=Cn(),n=SV(),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})(Go,Go.exports)),Go.exports}var Gv,bC;function Ll(){if(bC)return Gv;bC=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 Gv=t,Gv}var Wv,wC;function i0(){if(wC)return Wv;wC=1;var r=9007199254740991;function e(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=r}return Wv=e,Wv}var Uv,xC;function TV(){if(xC)return Uv;xC=1;var r=vi(),e=i0(),t=qn(),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]",m="[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]",D="[object Uint32Array]",I={};I[w]=I[x]=I[C]=I[T]=I[S]=I[_]=I[A]=I[P]=I[D]=!0,I[n]=I[a]=I[m]=I[i]=I[b]=I[o]=I[s]=I[l]=I[u]=I[c]=I[d]=I[h]=I[g]=I[p]=I[E]=!1;function M(k){return t(k)&&e(k.length)&&!!I[r(k)]}return Uv=M,Uv}var Hv,EC;function Ol(){if(EC)return Hv;EC=1;function r(e){return function(t){return e(t)}}return Hv=r,Hv}var Wo={exports:{}};Wo.exports;var CC;function o0(){return CC||(CC=1,(function(r,e){var t=YA(),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})(Wo,Wo.exports)),Wo.exports}var Kv,_C;function As(){if(_C)return Kv;_C=1;var r=TV(),e=Ol(),t=o0(),n=t&&t.isTypedArray,a=n?e(n):r;return Kv=a,Kv}var jv,SC;function QA(){if(SC)return jv;SC=1;var r=CV(),e=Rs(),t=Zr(),n=ho(),a=Ll(),i=As(),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,m=E?r(u.length,String):[],b=m.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)))&&m.push(w);return m}return jv=l,jv}var Yv,TC;function ql(){if(TC)return Yv;TC=1;var r=Object.prototype;function e(t){var n=t&&t.constructor,a=typeof n=="function"&&n.prototype||r;return t===a}return Yv=e,Yv}var Zv,RC;function JA(){if(RC)return Zv;RC=1;function r(e,t){return function(n){return e(t(n))}}return Zv=r,Zv}var Xv,AC;function RV(){if(AC)return Xv;AC=1;var r=JA(),e=r(Object.keys,Object);return Xv=e,Xv}var Qv,PC;function s0(){if(PC)return Qv;PC=1;var r=ql(),e=RV(),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 Qv=a,Qv}var Jv,DC;function ta(){if(DC)return Jv;DC=1;var r=Ss(),e=i0();function t(n){return n!=null&&e(n.length)&&!r(n)}return Jv=t,Jv}var eh,IC;function za(){if(IC)return eh;IC=1;var r=QA(),e=s0(),t=ta();function n(a){return t(a)?r(a):e(a)}return eh=n,eh}var rh,BC;function AV(){if(BC)return rh;BC=1;var r=Ts(),e=za();function t(n,a){return n&&r(a,e(a),n)}return rh=t,rh}var th,kC;function PV(){if(kC)return th;kC=1;function r(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}return th=r,th}var nh,MC;function DV(){if(MC)return nh;MC=1;var r=cn(),e=ql(),t=PV(),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 nh=i,nh}var ah,LC;function gi(){if(LC)return ah;LC=1;var r=QA(),e=DV(),t=ta();function n(a){return t(a)?r(a,!0):e(a)}return ah=n,ah}var ih,OC;function IV(){if(OC)return ih;OC=1;var r=Ts(),e=gi();function t(n,a){return n&&r(a,e(a),n)}return ih=t,ih}var Uo={exports:{}};Uo.exports;var qC;function eP(){return qC||(qC=1,(function(r,e){var t=Cn(),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})(Uo,Uo.exports)),Uo.exports}var oh,NC;function rP(){if(NC)return oh;NC=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 oh=r,oh}var sh,FC;function tP(){if(FC)return sh;FC=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 sh=r,sh}var uh,zC;function nP(){if(zC)return uh;zC=1;function r(){return[]}return uh=r,uh}var lh,$C;function u0(){if($C)return lh;$C=1;var r=tP(),e=nP(),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 lh=i,lh}var fh,VC;function BV(){if(VC)return fh;VC=1;var r=Ts(),e=u0();function t(n,a){return r(n,e(n),a)}return fh=t,fh}var ch,GC;function l0(){if(GC)return ch;GC=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 ch=r,ch}var dh,WC;function Nl(){if(WC)return dh;WC=1;var r=JA(),e=r(Object.getPrototypeOf,Object);return dh=e,dh}var vh,UC;function aP(){if(UC)return vh;UC=1;var r=l0(),e=Nl(),t=u0(),n=nP(),a=Object.getOwnPropertySymbols,i=a?function(o){for(var s=[];o;)r(s,t(o)),o=e(o);return s}:n;return vh=i,vh}var hh,HC;function kV(){if(HC)return hh;HC=1;var r=Ts(),e=aP();function t(n,a){return r(n,e(n),a)}return hh=t,hh}var gh,KC;function iP(){if(KC)return gh;KC=1;var r=l0(),e=Zr();function t(n,a,i){var o=a(n);return e(n)?o:r(o,i(n))}return gh=t,gh}var ph,jC;function oP(){if(jC)return ph;jC=1;var r=iP(),e=u0(),t=za();function n(a){return r(a,t,e)}return ph=n,ph}var yh,YC;function MV(){if(YC)return yh;YC=1;var r=iP(),e=aP(),t=gi();function n(a){return r(a,t,e)}return yh=n,yh}var mh,ZC;function LV(){if(ZC)return mh;ZC=1;var r=hi(),e=Cn(),t=r(e,"DataView");return mh=t,mh}var bh,XC;function OV(){if(XC)return bh;XC=1;var r=hi(),e=Cn(),t=r(e,"Promise");return bh=t,bh}var wh,QC;function sP(){if(QC)return wh;QC=1;var r=hi(),e=Cn(),t=r(e,"Set");return wh=t,wh}var xh,JC;function qV(){if(JC)return xh;JC=1;var r=hi(),e=Cn(),t=r(e,"WeakMap");return xh=t,xh}var Eh,e_;function go(){if(e_)return Eh;e_=1;var r=LV(),e=t0(),t=OV(),n=sP(),a=qV(),i=vi(),o=ZA(),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),m=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 m:return c;case b:return d}return C}),Eh=w,Eh}var Ch,r_;function NV(){if(r_)return Ch;r_=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 Ch=t,Ch}var _h,t_;function uP(){if(t_)return _h;t_=1;var r=Cn(),e=r.Uint8Array;return _h=e,_h}var Sh,n_;function f0(){if(n_)return Sh;n_=1;var r=uP();function e(t){var n=new t.constructor(t.byteLength);return new r(n).set(new r(t)),n}return Sh=e,Sh}var Th,a_;function FV(){if(a_)return Th;a_=1;var r=f0();function e(t,n){var a=n?r(t.buffer):t.buffer;return new t.constructor(a,t.byteOffset,t.byteLength)}return Th=e,Th}var Rh,i_;function zV(){if(i_)return Rh;i_=1;var r=/\w*$/;function e(t){var n=new t.constructor(t.source,r.exec(t));return n.lastIndex=t.lastIndex,n}return Rh=e,Rh}var Ah,o_;function $V(){if(o_)return Ah;o_=1;var r=vo(),e=r?r.prototype:void 0,t=e?e.valueOf:void 0;function n(a){return t?Object(t.call(a)):{}}return Ah=n,Ah}var Ph,s_;function lP(){if(s_)return Ph;s_=1;var r=f0();function e(t,n){var a=n?r(t.buffer):t.buffer;return new t.constructor(a,t.byteOffset,t.length)}return Ph=e,Ph}var Dh,u_;function VV(){if(u_)return Dh;u_=1;var r=f0(),e=FV(),t=zV(),n=$V(),a=lP(),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]",m="[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,D,I){var M=P.constructor;switch(D){case g:return r(P);case i:case o:return new M(+P);case p:return e(P,I);case E:case m:case b:case w:case x:case C:case T:case S:case _:return a(P,I);case s:return new M;case l:case d:return new M(P);case u:return t(P);case c:return new M;case h:return n(P)}}return Dh=A,Dh}var Ih,l_;function fP(){if(l_)return Ih;l_=1;var r=cn(),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 Ih=t,Ih}var Bh,f_;function cP(){if(f_)return Bh;f_=1;var r=fP(),e=Nl(),t=ql();function n(a){return typeof a.constructor=="function"&&!t(a)?r(e(a)):{}}return Bh=n,Bh}var kh,c_;function GV(){if(c_)return kh;c_=1;var r=go(),e=qn(),t="[object Map]";function n(a){return e(a)&&r(a)==t}return kh=n,kh}var Mh,d_;function WV(){if(d_)return Mh;d_=1;var r=GV(),e=Ol(),t=o0(),n=t&&t.isMap,a=n?e(n):r;return Mh=a,Mh}var Lh,v_;function UV(){if(v_)return Lh;v_=1;var r=go(),e=qn(),t="[object Set]";function n(a){return e(a)&&r(a)==t}return Lh=n,Lh}var Oh,h_;function HV(){if(h_)return Oh;h_=1;var r=UV(),e=Ol(),t=o0(),n=t&&t.isSet,a=n?e(n):r;return Oh=a,Oh}var qh,g_;function dP(){if(g_)return qh;g_=1;var r=Bl(),e=a0(),t=Ml(),n=AV(),a=IV(),i=eP(),o=rP(),s=BV(),l=kV(),u=oP(),c=MV(),d=go(),h=NV(),g=VV(),p=cP(),E=Zr(),m=ho(),b=WV(),w=cn(),x=HV(),C=za(),T=gi(),S=1,_=2,A=4,P="[object Arguments]",D="[object Array]",I="[object Boolean]",M="[object Date]",k="[object Error]",N="[object Function]",z="[object GeneratorFunction]",W="[object Map]",q="[object Number]",$="[object Object]",X="[object RegExp]",Y="[object Set]",K="[object String]",ee="[object Symbol]",le="[object WeakMap]",G="[object ArrayBuffer]",V="[object DataView]",j="[object Float32Array]",re="[object Float64Array]",ce="[object Int8Array]",se="[object Int16Array]",Z="[object Int32Array]",Q="[object Uint8Array]",ae="[object Uint8ClampedArray]",ne="[object Uint16Array]",de="[object Uint32Array]",Ce={};Ce[P]=Ce[D]=Ce[G]=Ce[V]=Ce[I]=Ce[M]=Ce[j]=Ce[re]=Ce[ce]=Ce[se]=Ce[Z]=Ce[W]=Ce[q]=Ce[$]=Ce[X]=Ce[Y]=Ce[K]=Ce[ee]=Ce[Q]=Ce[ae]=Ce[ne]=Ce[de]=!0,Ce[k]=Ce[N]=Ce[le]=!1;function ve(U,fe,we,ge,me,Re){var Ie,Be=fe&S,Oe=fe&_,He=fe&A;if(we&&(Ie=me?we(U,ge,me,Re):we(U)),Ie!==void 0)return Ie;if(!w(U))return U;var Ve=E(U);if(Ve){if(Ie=h(U),!Be)return o(U,Ie)}else{var Xe=d(U),er=Xe==N||Xe==z;if(m(U))return i(U,Be);if(Xe==$||Xe==P||er&&!me){if(Ie=Oe||er?{}:p(U),!Be)return Oe?l(U,a(Ie,U)):s(U,n(Ie,U))}else{if(!Ce[Xe])return me?U:{};Ie=g(U,Xe,Be)}}Re||(Re=new r);var $e=Re.get(U);if($e)return $e;Re.set(U,Ie),x(U)?U.forEach(function(L){Ie.add(ve(L,fe,we,L,U,Re))}):b(U)&&U.forEach(function(L,oe){Ie.set(oe,ve(L,fe,we,oe,U,Re))});var Me=He?Oe?c:u:Oe?T:C,pe=Ve?void 0:Me(U);return e(pe||U,function(L,oe){pe&&(oe=L,L=U[oe]),t(Ie,oe,ve(L,fe,we,oe,U,Re))}),Ie}return qh=ve,qh}var Nh,p_;function KV(){if(p_)return Nh;p_=1;var r=dP(),e=4;function t(n){return r(n,e)}return Nh=t,Nh}var Fh,y_;function c0(){if(y_)return Fh;y_=1;function r(e){return function(){return e}}return Fh=r,Fh}var zh,m_;function jV(){if(m_)return zh;m_=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 zh=r,zh}var $h,b_;function d0(){if(b_)return $h;b_=1;var r=jV(),e=r();return $h=e,$h}var Vh,w_;function v0(){if(w_)return Vh;w_=1;var r=d0(),e=za();function t(n,a){return n&&r(n,a,e)}return Vh=t,Vh}var Gh,x_;function YV(){if(x_)return Gh;x_=1;var r=ta();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 Gh=e,Gh}var Wh,E_;function Fl(){if(E_)return Wh;E_=1;var r=v0(),e=YV(),t=e(r);return Wh=t,Wh}var Uh,C_;function pi(){if(C_)return Uh;C_=1;function r(e){return e}return Uh=r,Uh}var Hh,__;function vP(){if(__)return Hh;__=1;var r=pi();function e(t){return typeof t=="function"?t:r}return Hh=e,Hh}var Kh,S_;function hP(){if(S_)return Kh;S_=1;var r=a0(),e=Fl(),t=vP(),n=Zr();function a(i,o){var s=n(i)?r:e;return s(i,t(o))}return Kh=a,Kh}var jh,T_;function gP(){return T_||(T_=1,jh=hP()),jh}var Yh,R_;function ZV(){if(R_)return Yh;R_=1;var r=Fl();function e(t,n){var a=[];return r(t,function(i,o,s){n(i,o,s)&&a.push(i)}),a}return Yh=e,Yh}var Zh,A_;function XV(){if(A_)return Zh;A_=1;var r="__lodash_hash_undefined__";function e(t){return this.__data__.set(t,r),this}return Zh=e,Zh}var Xh,P_;function QV(){if(P_)return Xh;P_=1;function r(e){return this.__data__.has(e)}return Xh=r,Xh}var Qh,D_;function pP(){if(D_)return Qh;D_=1;var r=n0(),e=XV(),t=QV();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,Qh=n,Qh}var Jh,I_;function JV(){if(I_)return Jh;I_=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 eg,B_;function yP(){if(B_)return eg;B_=1;function r(e,t){return e.has(t)}return eg=r,eg}var rg,k_;function mP(){if(k_)return rg;k_=1;var r=pP(),e=JV(),t=yP(),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),m=d.get(s);if(E&&m)return E==s&&m==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 rg=i,rg}var tg,M_;function e4(){if(M_)return tg;M_=1;function r(e){var t=-1,n=Array(e.size);return e.forEach(function(a,i){n[++t]=[i,a]}),n}return tg=r,tg}var ng,L_;function h0(){if(L_)return ng;L_=1;function r(e){var t=-1,n=Array(e.size);return e.forEach(function(a){n[++t]=a}),n}return ng=r,ng}var ag,O_;function r4(){if(O_)return ag;O_=1;var r=vo(),e=uP(),t=co(),n=mP(),a=e4(),i=h0(),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]",m="[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,D,I,M){switch(A){case w:if(S.byteLength!=_.byteLength||S.byteOffset!=_.byteOffset)return!1;S=S.buffer,_=_.buffer;case b:return!(S.byteLength!=_.byteLength||!I(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 k=a;case p:var N=P&o;if(k||(k=i),S.size!=_.size&&!N)return!1;var z=M.get(S);if(z)return z==_;P|=s,M.set(S,_);var W=n(k(S),k(_),P,D,I,M);return M.delete(S),W;case m:if(C)return C.call(S)==C.call(_)}return!1}return ag=T,ag}var ig,q_;function t4(){if(q_)return ig;q_=1;var r=oP(),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 m=g;m--;){var b=h[m];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;++m<g;){b=h[m];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,D=o.constructor;P!=D&&"constructor"in i&&"constructor"in o&&!(typeof P=="function"&&P instanceof P&&typeof D=="function"&&D instanceof D)&&(C=!1)}return c.delete(i),c.delete(o),C}return ig=a,ig}var og,N_;function n4(){if(N_)return og;N_=1;var r=Bl(),e=mP(),t=r4(),n=t4(),a=go(),i=Zr(),o=ho(),s=As(),l=1,u="[object Arguments]",c="[object Array]",d="[object Object]",h=Object.prototype,g=h.hasOwnProperty;function p(E,m,b,w,x,C){var T=i(E),S=i(m),_=T?c:a(E),A=S?c:a(m);_=_==u?d:_,A=A==u?d:A;var P=_==d,D=A==d,I=_==A;if(I&&o(E)){if(!o(m))return!1;T=!0,P=!1}if(I&&!P)return C||(C=new r),T||s(E)?e(E,m,b,w,x,C):t(E,m,_,b,w,x,C);if(!(b&l)){var M=P&&g.call(E,"__wrapped__"),k=D&&g.call(m,"__wrapped__");if(M||k){var N=M?E.value():E,z=k?m.value():m;return C||(C=new r),x(N,z,b,w,C)}}return I?(C||(C=new r),n(E,m,b,w,x,C)):!1}return og=p,og}var sg,F_;function bP(){if(F_)return sg;F_=1;var r=n4(),e=qn();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 sg=t,sg}var ug,z_;function a4(){if(z_)return ug;z_=1;var r=Bl(),e=bP(),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 m=new r;if(l)var b=l(p,E,g,i,o,m);if(!(b===void 0?e(E,p,t|n,l,m):b))return!1}}return!0}return ug=a,ug}var lg,$_;function wP(){if($_)return lg;$_=1;var r=cn();function e(t){return t===t&&!r(t)}return lg=e,lg}var fg,V_;function i4(){if(V_)return fg;V_=1;var r=wP(),e=za();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 fg=t,fg}var cg,G_;function xP(){if(G_)return cg;G_=1;function r(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}return cg=r,cg}var dg,W_;function o4(){if(W_)return dg;W_=1;var r=a4(),e=i4(),t=xP();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 dg=n,dg}var vg,U_;function po(){if(U_)return vg;U_=1;var r=vi(),e=qn(),t="[object Symbol]";function n(a){return typeof a=="symbol"||e(a)&&r(a)==t}return vg=n,vg}var hg,H_;function g0(){if(H_)return hg;H_=1;var r=Zr(),e=po(),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 hg=a,hg}var gg,K_;function s4(){if(K_)return gg;K_=1;var r=n0(),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,gg=t,gg}var pg,j_;function u4(){if(j_)return pg;j_=1;var r=s4(),e=500;function t(n){var a=r(n,function(o){return i.size===e&&i.clear(),o}),i=a.cache;return a}return pg=t,pg}var yg,Y_;function l4(){if(Y_)return yg;Y_=1;var r=u4(),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 yg=n,yg}var mg,Z_;function zl(){if(Z_)return mg;Z_=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 mg=r,mg}var bg,X_;function f4(){if(X_)return bg;X_=1;var r=vo(),e=zl(),t=Zr(),n=po(),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 bg=o,bg}var wg,Q_;function EP(){if(Q_)return wg;Q_=1;var r=f4();function e(t){return t==null?"":r(t)}return wg=e,wg}var xg,J_;function $l(){if(J_)return xg;J_=1;var r=Zr(),e=g0(),t=l4(),n=EP();function a(i,o){return r(i)?i:e(i,o)?[i]:t(n(i))}return xg=a,xg}var Eg,eS;function Ps(){if(eS)return Eg;eS=1;var r=po();function e(t){if(typeof t=="string"||r(t))return t;var n=t+"";return n=="0"&&1/t==-1/0?"-0":n}return Eg=e,Eg}var Cg,rS;function Vl(){if(rS)return Cg;rS=1;var r=$l(),e=Ps();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 Cg=t,Cg}var _g,tS;function c4(){if(tS)return _g;tS=1;var r=Vl();function e(t,n,a){var i=t==null?void 0:r(t,n);return i===void 0?a:i}return _g=e,_g}var Sg,nS;function d4(){if(nS)return Sg;nS=1;function r(e,t){return e!=null&&t in Object(e)}return Sg=r,Sg}var Tg,aS;function CP(){if(aS)return Tg;aS=1;var r=$l(),e=Rs(),t=Zr(),n=Ll(),a=i0(),i=Ps();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 Tg=o,Tg}var Rg,iS;function _P(){if(iS)return Rg;iS=1;var r=d4(),e=CP();function t(n,a){return n!=null&&e(n,a,r)}return Rg=t,Rg}var Ag,oS;function v4(){if(oS)return Ag;oS=1;var r=bP(),e=c4(),t=_P(),n=g0(),a=wP(),i=xP(),o=Ps(),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 Ag=u,Ag}var Pg,sS;function SP(){if(sS)return Pg;sS=1;function r(e){return function(t){return t==null?void 0:t[e]}}return Pg=r,Pg}var Dg,uS;function h4(){if(uS)return Dg;uS=1;var r=Vl();function e(t){return function(n){return r(n,t)}}return Dg=e,Dg}var Ig,lS;function g4(){if(lS)return Ig;lS=1;var r=SP(),e=h4(),t=g0(),n=Ps();function a(i){return t(i)?r(n(i)):e(i)}return Ig=a,Ig}var Bg,fS;function na(){if(fS)return Bg;fS=1;var r=o4(),e=v4(),t=pi(),n=Zr(),a=g4();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 Bg=i,Bg}var kg,cS;function TP(){if(cS)return kg;cS=1;var r=tP(),e=ZV(),t=na(),n=Zr();function a(i,o){var s=n(i)?r:e;return s(i,t(o,3))}return kg=a,kg}var Mg,dS;function p4(){if(dS)return Mg;dS=1;var r=Object.prototype,e=r.hasOwnProperty;function t(n,a){return n!=null&&e.call(n,a)}return Mg=t,Mg}var Lg,vS;function RP(){if(vS)return Lg;vS=1;var r=p4(),e=CP();function t(n,a){return n!=null&&e(n,a,r)}return Lg=t,Lg}var Og,hS;function y4(){if(hS)return Og;hS=1;var r=s0(),e=go(),t=Rs(),n=Zr(),a=ta(),i=ho(),o=ql(),s=As(),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 Og=h,Og}var qg,gS;function AP(){if(gS)return qg;gS=1;function r(e){return e===void 0}return qg=r,qg}var Ng,pS;function PP(){if(pS)return Ng;pS=1;var r=Fl(),e=ta();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 Ng=t,Ng}var Fg,yS;function DP(){if(yS)return Fg;yS=1;var r=zl(),e=na(),t=PP(),n=Zr();function a(i,o){var s=n(i)?r:t;return s(i,e(o,3))}return Fg=a,Fg}var zg,mS;function m4(){if(mS)return zg;mS=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 zg=r,zg}var $g,bS;function b4(){if(bS)return $g;bS=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 $g=r,$g}var Vg,wS;function IP(){if(wS)return Vg;wS=1;var r=m4(),e=Fl(),t=na(),n=b4(),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 Vg=i,Vg}var Gg,xS;function w4(){if(xS)return Gg;xS=1;var r=vi(),e=Zr(),t=qn(),n="[object String]";function a(i){return typeof i=="string"||!e(i)&&t(i)&&r(i)==n}return Gg=a,Gg}var Wg,ES;function x4(){if(ES)return Wg;ES=1;var r=SP(),e=r("length");return Wg=e,Wg}var Ug,CS;function E4(){if(CS)return Ug;CS=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 Ug=l,Ug}var Hg,_S;function C4(){if(_S)return Hg;_S=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+"]?",m="(?:"+g+"(?:"+[c,d,h].join("|")+")"+E+p+")*",b=E+p+m,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 Hg=C,Hg}var Kg,SS;function _4(){if(SS)return Kg;SS=1;var r=x4(),e=E4(),t=C4();function n(a){return e(a)?t(a):r(a)}return Kg=n,Kg}var jg,TS;function S4(){if(TS)return jg;TS=1;var r=s0(),e=go(),t=ta(),n=w4(),a=_4(),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 jg=s,jg}var Yg,RS;function T4(){if(RS)return Yg;RS=1;var r=a0(),e=fP(),t=v0(),n=na(),a=Nl(),i=Zr(),o=ho(),s=Ss(),l=cn(),u=As();function c(d,h,g){var p=i(d),E=p||o(d)||u(d);if(h=n(h,4),g==null){var m=d&&d.constructor;E?g=p?new m:[]:l(d)?g=s(m)?e(a(d)):{}:g={}}return(E?r:t)(d,function(b,w,x){return h(g,b,w,x)}),g}return Yg=c,Yg}var Zg,AS;function R4(){if(AS)return Zg;AS=1;var r=vo(),e=Rs(),t=Zr(),n=r?r.isConcatSpreadable:void 0;function a(i){return t(i)||e(i)||!!(n&&i&&i[n])}return Zg=a,Zg}var Xg,PS;function p0(){if(PS)return Xg;PS=1;var r=l0(),e=R4();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 Xg=t,Xg}var Qg,DS;function A4(){if(DS)return Qg;DS=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 Qg=r,Qg}var Jg,IS;function BP(){if(IS)return Jg;IS=1;var r=A4(),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 ep,BS;function P4(){if(BS)return ep;BS=1;var r=c0(),e=XA(),t=pi(),n=e?function(a,i){return e(a,"toString",{configurable:!0,enumerable:!1,value:r(i),writable:!0})}:t;return ep=n,ep}var rp,kS;function D4(){if(kS)return rp;kS=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 rp=n,rp}var tp,MS;function kP(){if(MS)return tp;MS=1;var r=P4(),e=D4(),t=e(r);return tp=t,tp}var np,LS;function Gl(){if(LS)return np;LS=1;var r=pi(),e=BP(),t=kP();function n(a,i){return t(e(a,i,r),a+"")}return np=n,np}var ap,OS;function MP(){if(OS)return ap;OS=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 ap=r,ap}var ip,qS;function I4(){if(qS)return ip;qS=1;function r(e){return e!==e}return ip=r,ip}var op,NS;function B4(){if(NS)return op;NS=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 op=r,op}var sp,FS;function k4(){if(FS)return sp;FS=1;var r=MP(),e=I4(),t=B4();function n(a,i,o){return i===i?t(a,i,o):r(a,e,o)}return sp=n,sp}var up,zS;function M4(){if(zS)return up;zS=1;var r=k4();function e(t,n){var a=t==null?0:t.length;return!!a&&r(t,n,0)>-1}return up=e,up}var lp,$S;function L4(){if($S)return lp;$S=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 lp=r,lp}var fp,VS;function O4(){if(VS)return fp;VS=1;function r(){}return fp=r,fp}var cp,GS;function q4(){if(GS)return cp;GS=1;var r=sP(),e=O4(),t=h0(),n=1/0,a=r&&1/t(new r([,-0]))[1]==n?function(i){return new r(i)}:e;return cp=a,cp}var dp,WS;function N4(){if(WS)return dp;WS=1;var r=pP(),e=M4(),t=L4(),n=yP(),a=q4(),i=h0(),o=200;function s(l,u,c){var d=-1,h=e,g=l.length,p=!0,E=[],m=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,m=new r}else m=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=m.length;C--;)if(m[C]===x)continue e;u&&m.push(x),E.push(w)}else h(m,x,c)||(m!==E&&m.push(x),E.push(w))}return E}return dp=s,dp}var vp,US;function LP(){if(US)return vp;US=1;var r=ta(),e=qn();function t(n){return e(n)&&r(n)}return vp=t,vp}var hp,HS;function F4(){if(HS)return hp;HS=1;var r=p0(),e=Gl(),t=N4(),n=LP(),a=e(function(i){return t(r(i,1,n,!0))});return hp=a,hp}var gp,KS;function z4(){if(KS)return gp;KS=1;var r=zl();function e(t,n){return r(n,function(a){return t[a]})}return gp=e,gp}var pp,jS;function OP(){if(jS)return pp;jS=1;var r=z4(),e=za();function t(n){return n==null?[]:r(n,e(n))}return pp=t,pp}var yp,YS;function dn(){if(YS)return yp;YS=1;var r;if(typeof r0=="function")try{r={clone:KV(),constant:c0(),each:gP(),filter:TP(),has:RP(),isArray:Zr(),isEmpty:y4(),isFunction:Ss(),isUndefined:AP(),keys:za(),map:DP(),reduce:IP(),size:S4(),transform:T4(),union:F4(),values:OP()}}catch{}return r||(r=window._),yp=r,yp}var mp,ZS;function y0(){if(ZS)return mp;ZS=1;var r=dn();mp=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,m){c(m)&&d.setNode(m,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 m=h.parent(E);return m===void 0||d.hasNode(m)?(g[E]=m,m):m in g?g[m]:p(m)}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 m=s(this._isDirected,c,d,h);if(r.has(this._edgeLabels,m))return p&&(this._edgeLabels[m]=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[m]=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[m]=b,i(this._preds[d],c),i(this._sucs[c],d),this._in[d][m]=b,this._out[c][m]=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 m=p;p=E,E=m}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 m=p;p=E,E=m}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 mp}var bp,XS;function $4(){return XS||(XS=1,bp="2.1.8"),bp}var wp,QS;function V4(){return QS||(QS=1,wp={Graph:y0(),version:$4()}),wp}var xp,JS;function G4(){if(JS)return xp;JS=1;var r=dn(),e=y0();xp={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 xp}var Ep,eT;function W4(){if(eT)return Ep;eT=1;var r=dn();Ep=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 Ep}var Cp,rT;function qP(){if(rT)return Cp;rT=1;var r=dn();Cp=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},Cp}var _p,tT;function NP(){if(tT)return _p;tT=1;var r=dn(),e=qP();_p=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,m=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<m.distance&&(m.distance=w,m.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 _p}var Sp,nT;function U4(){if(nT)return Sp;nT=1;var r=NP(),e=dn();Sp=t;function t(n,a,i){return e.transform(n.nodes(),function(o,s){o[s]=r(n,s,a,i)},{})}return Sp}var Tp,aT;function FP(){if(aT)return Tp;aT=1;var r=dn();Tp=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 Tp}var Rp,iT;function H4(){if(iT)return Rp;iT=1;var r=dn(),e=FP();Rp=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 Rp}var Ap,oT;function K4(){if(oT)return Ap;oT=1;var r=dn();Ap=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],m=h[g],b=p.distance+E.distance;b<m.distance&&(m.distance=b,m.predecessor=E.predecessor)})})}),s}return Ap}var Pp,sT;function zP(){if(sT)return Pp;sT=1;var r=dn();Pp=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,Pp}var Dp,uT;function j4(){if(uT)return Dp;uT=1;var r=zP();Dp=e;function e(t){try{r(t)}catch(n){if(n instanceof r.CycleException)return!1;throw n}return!0}return Dp}var Ip,lT;function $P(){if(lT)return Ip;lT=1;var r=dn();Ip=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 Ip}var Bp,fT;function Y4(){if(fT)return Bp;fT=1;var r=$P();Bp=e;function e(t,n){return r(t,n,"post")}return Bp}var kp,cT;function Z4(){if(cT)return kp;cT=1;var r=$P();kp=e;function e(t,n){return r(t,n,"pre")}return kp}var Mp,dT;function X4(){if(dT)return Mp;dT=1;var r=dn(),e=y0(),t=qP();Mp=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 Mp}var Lp,vT;function Q4(){return vT||(vT=1,Lp={components:W4(),dijkstra:NP(),dijkstraAll:U4(),findCycles:H4(),floydWarshall:K4(),isAcyclic:j4(),postorder:Y4(),preorder:Z4(),prim:X4(),tarjan:FP(),topsort:zP()}),Lp}var Op,hT;function J4(){if(hT)return Op;hT=1;var r=V4();return Op={Graph:r.Graph,json:G4(),alg:Q4(),version:r.version},Op}var qp,gT;function En(){if(gT)return qp;gT=1;var r;if(typeof r0=="function")try{r=J4()}catch{}return r||(r=window.graphlib),qp=r,qp}var Np,pT;function eG(){if(pT)return Np;pT=1;var r=dP(),e=1,t=4;function n(a){return r(a,e|t)}return Np=n,Np}var Fp,yT;function Wl(){if(yT)return Fp;yT=1;var r=co(),e=ta(),t=Ll(),n=cn();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 Fp=a,Fp}var zp,mT;function rG(){if(mT)return zp;mT=1;var r=Gl(),e=co(),t=Wl(),n=gi(),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 m=g[p],b=s[m];(b===void 0||e(b,a[m])&&!i.call(s,m))&&(s[m]=h[m])}return s});return zp=o,zp}var $p,bT;function tG(){if(bT)return $p;bT=1;var r=na(),e=ta(),t=za();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 $p=n,$p}var Vp,wT;function nG(){if(wT)return Vp;wT=1;var r=/\s/;function e(t){for(var n=t.length;n--&&r.test(t.charAt(n)););return n}return Vp=e,Vp}var Gp,xT;function aG(){if(xT)return Gp;xT=1;var r=nG(),e=/^\s+/;function t(n){return n&&n.slice(0,r(n)+1).replace(e,"")}return Gp=t,Gp}var Wp,ET;function iG(){if(ET)return Wp;ET=1;var r=aG(),e=cn(),t=po(),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 Wp=l,Wp}var Up,CT;function VP(){if(CT)return Up;CT=1;var r=iG(),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 Up=n,Up}var Hp,_T;function oG(){if(_T)return Hp;_T=1;var r=VP();function e(t){var n=r(t),a=n%1;return n===n?a?n-a:n:0}return Hp=e,Hp}var Kp,ST;function sG(){if(ST)return Kp;ST=1;var r=MP(),e=na(),t=oG(),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 Kp=a,Kp}var jp,TT;function uG(){if(TT)return jp;TT=1;var r=tG(),e=sG(),t=r(e);return jp=t,jp}var Yp,RT;function GP(){if(RT)return Yp;RT=1;var r=p0();function e(t){var n=t==null?0:t.length;return n?r(t,1):[]}return Yp=e,Yp}var Zp,AT;function lG(){if(AT)return Zp;AT=1;var r=d0(),e=vP(),t=gi();function n(a,i){return a==null?a:r(a,e(i),t)}return Zp=n,Zp}var Xp,PT;function fG(){if(PT)return Xp;PT=1;function r(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}return Xp=r,Xp}var Qp,DT;function cG(){if(DT)return Qp;DT=1;var r=kl(),e=v0(),t=na();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 Qp=n,Qp}var Jp,IT;function m0(){if(IT)return Jp;IT=1;var r=po();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 ey,BT;function dG(){if(BT)return ey;BT=1;function r(e,t){return e>t}return ey=r,ey}var ry,kT;function vG(){if(kT)return ry;kT=1;var r=m0(),e=dG(),t=pi();function n(a){return a&&a.length?r(a,t,e):void 0}return ry=n,ry}var ty,MT;function WP(){if(MT)return ty;MT=1;var r=kl(),e=co();function t(n,a,i){(i!==void 0&&!e(n[a],i)||i===void 0&&!(a in n))&&r(n,a,i)}return ty=t,ty}var ny,LT;function hG(){if(LT)return ny;LT=1;var r=vi(),e=Nl(),t=qn(),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 ny=u,ny}var ay,OT;function UP(){if(OT)return ay;OT=1;function r(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}return ay=r,ay}var iy,qT;function gG(){if(qT)return iy;qT=1;var r=Ts(),e=gi();function t(n){return r(n,e(n))}return iy=t,iy}var oy,NT;function pG(){if(NT)return oy;NT=1;var r=WP(),e=eP(),t=lP(),n=rP(),a=cP(),i=Rs(),o=Zr(),s=LP(),l=ho(),u=Ss(),c=cn(),d=hG(),h=As(),g=UP(),p=gG();function E(m,b,w,x,C,T,S){var _=g(m,w),A=g(b,w),P=S.get(A);if(P){r(m,w,P);return}var D=T?T(_,A,w+"",m,b,S):void 0,I=D===void 0;if(I){var M=o(A),k=!M&&l(A),N=!M&&!k&&h(A);D=A,M||k||N?o(_)?D=_:s(_)?D=n(_):k?(I=!1,D=e(A,!0)):N?(I=!1,D=t(A,!0)):D=[]:d(A)||i(A)?(D=_,i(_)?D=p(_):(!c(_)||u(_))&&(D=a(A))):I=!1}I&&(S.set(A,D),C(D,A,x,T,S),S.delete(A)),r(m,w,D)}return oy=E,oy}var sy,FT;function yG(){if(FT)return sy;FT=1;var r=Bl(),e=WP(),t=d0(),n=pG(),a=cn(),i=gi(),o=UP();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 sy=s,sy}var uy,zT;function mG(){if(zT)return uy;zT=1;var r=Gl(),e=Wl();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 uy=t,uy}var ly,$T;function bG(){if($T)return ly;$T=1;var r=yG(),e=mG(),t=e(function(n,a,i){r(n,a,i)});return ly=t,ly}var fy,VT;function HP(){if(VT)return fy;VT=1;function r(e,t){return e<t}return fy=r,fy}var cy,GT;function wG(){if(GT)return cy;GT=1;var r=m0(),e=HP(),t=pi();function n(a){return a&&a.length?r(a,t,e):void 0}return cy=n,cy}var dy,WT;function xG(){if(WT)return dy;WT=1;var r=m0(),e=na(),t=HP();function n(a,i){return a&&a.length?r(a,e(i,2),t):void 0}return dy=n,dy}var vy,UT;function EG(){if(UT)return vy;UT=1;var r=Cn(),e=function(){return r.Date.now()};return vy=e,vy}var hy,HT;function CG(){if(HT)return hy;HT=1;var r=Ml(),e=$l(),t=Ll(),n=cn(),a=Ps();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 m=g[p];E=u?u(m,p,g):void 0,E===void 0&&(E=n(m)?m:t(s[c+1])?[]:{})}r(g,p,E),g=g[p]}return o}return hy=i,hy}var gy,KT;function _G(){if(KT)return gy;KT=1;var r=Vl(),e=CG(),t=$l();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 gy=n,gy}var py,jT;function SG(){if(jT)return py;jT=1;var r=_G(),e=_P();function t(n,a){return r(n,a,function(i,o){return e(n,o)})}return py=t,py}var yy,YT;function TG(){if(YT)return yy;YT=1;var r=GP(),e=BP(),t=kP();function n(a){return t(e(a,void 0,r),a+"")}return yy=n,yy}var my,ZT;function RG(){if(ZT)return my;ZT=1;var r=SG(),e=TG(),t=e(function(n,a){return n==null?{}:r(n,a)});return my=t,my}var by,XT;function AG(){if(XT)return by;XT=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 by=t,by}var wy,QT;function PG(){if(QT)return wy;QT=1;var r=AG(),e=Wl(),t=VP();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 wy=n,wy}var xy,JT;function DG(){if(JT)return xy;JT=1;var r=PG(),e=r();return xy=e,xy}var Ey,e2;function IG(){if(e2)return Ey;e2=1;function r(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}return Ey=r,Ey}var Cy,r2;function BG(){if(r2)return Cy;r2=1;var r=po();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 Cy=e,Cy}var _y,t2;function kG(){if(t2)return _y;t2=1;var r=BG();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 _y=e,_y}var Sy,n2;function MG(){if(n2)return Sy;n2=1;var r=zl(),e=Vl(),t=na(),n=PP(),a=IG(),i=Ol(),o=kG(),s=pi(),l=Zr();function u(c,d,h){d.length?d=r(d,function(E){return l(E)?function(m){return e(m,E.length===1?E[0]:E)}:E}):d=[s];var g=-1;d=r(d,i(t));var p=n(c,function(E,m,b){var w=r(d,function(x){return x(E)});return{criteria:w,index:++g,value:E}});return a(p,function(E,m){return o(E,m,h)})}return Sy=u,Sy}var Ty,a2;function LG(){if(a2)return Ty;a2=1;var r=p0(),e=MG(),t=Gl(),n=Wl(),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 Ty=a,Ty}var Ry,i2;function OG(){if(i2)return Ry;i2=1;var r=EP(),e=0;function t(n){var a=++e;return r(n)+a}return Ry=t,Ry}var Ay,o2;function qG(){if(o2)return Ay;o2=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 Ay=r,Ay}var Py,s2;function NG(){if(s2)return Py;s2=1;var r=Ml(),e=qG();function t(n,a){return e(n||[],a||[],r)}return Py=t,Py}var Dy,u2;function Or(){if(u2)return Dy;u2=1;var r;if(typeof r0=="function")try{r={cloneDeep:eG(),constant:c0(),defaults:rG(),each:gP(),filter:TP(),find:uG(),flatten:GP(),forEach:hP(),forIn:lG(),has:RP(),isUndefined:AP(),last:fG(),map:DP(),mapValues:cG(),max:vG(),merge:bG(),min:wG(),minBy:xG(),now:EG(),pick:RG(),range:DG(),reduce:IP(),sortBy:LG(),uniqueId:OG(),values:OP(),zipObject:NG()}}catch{}return r||(r=window._),Dy=r,Dy}var Iy,l2;function FG(){if(l2)return Iy;l2=1,Iy=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 Iy}var By,f2;function zG(){if(f2)return By;f2=1;var r=Or(),e=En().Graph,t=FG();By=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 m=c.length-2;m>0;--m)if(E=c[m].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 m=u.edge(E),b=u.node(E.v);g&&p.push({v:E.v,w:E.w}),b.out-=m,l(c,d,b)}),r.forEach(u.outEdges(h.v),function(E){var m=u.edge(E),b=E.w,w=u.node(b);w.in-=m,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(m){d.setNode(m,{v:m,in:0,out:0})}),r.forEach(u.edges(),function(m){var b=d.edge(m.v,m.w)||0,w=c(m),x=b+w;d.setEdge(m.v,m.w,x),g=Math.max(g,d.node(m.v).out+=w),h=Math.max(h,d.node(m.w).in+=w)});var p=r.range(g+h+3).map(function(){return new t}),E=h+1;return r.forEach(d.nodes(),function(m){l(p,E,d.node(m))}),{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 By}var ky,c2;function $G(){if(c2)return ky;c2=1;var r=Or(),e=zG();ky={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 ky}var My,d2;function Vt(){if(d2)return My;d2=1;var r=Or(),e=En().Graph;My={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(m,b,w,x){var C;do C=r.uniqueId(x);while(m.hasNode(C));return w.dummy=b,m.setNode(C,w),C}function n(m){var b=new e().setGraph(m.graph());return r.forEach(m.nodes(),function(w){b.setNode(w,m.node(w))}),r.forEach(m.edges(),function(w){var x=b.edge(w.v,w.w)||{weight:0,minlen:1},C=m.edge(w);b.setEdge(w.v,w.w,{weight:x.weight+C.weight,minlen:Math.max(x.minlen,C.minlen)})}),b}function a(m){var b=new e({multigraph:m.isMultigraph()}).setGraph(m.graph());return r.forEach(m.nodes(),function(w){m.children(w).length||b.setNode(w,m.node(w))}),r.forEach(m.edges(),function(w){b.setEdge(w,m.edge(w))}),b}function i(m){var b=r.map(m.nodes(),function(w){var x={};return r.forEach(m.outEdges(w),function(C){x[C.w]=(x[C.w]||0)+m.edge(C).weight}),x});return r.zipObject(m.nodes(),b)}function o(m){var b=r.map(m.nodes(),function(w){var x={};return r.forEach(m.inEdges(w),function(C){x[C.v]=(x[C.v]||0)+m.edge(C).weight}),x});return r.zipObject(m.nodes(),b)}function s(m,b){var w=m.x,x=m.y,C=b.x-w,T=b.y-x,S=m.width/2,_=m.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(m){var b=r.map(r.range(h(m)+1),function(){return[]});return r.forEach(m.nodes(),function(w){var x=m.node(w),C=x.rank;r.isUndefined(C)||(b[C][x.order]=w)}),b}function u(m){var b=r.min(r.map(m.nodes(),function(w){return m.node(w).rank}));r.forEach(m.nodes(),function(w){var x=m.node(w);r.has(x,"rank")&&(x.rank-=b)})}function c(m){var b=r.min(r.map(m.nodes(),function(T){return m.node(T).rank})),w=[];r.forEach(m.nodes(),function(T){var S=m.node(T).rank-b;w[S]||(w[S]=[]),w[S].push(T)});var x=0,C=m.graph().nodeRankFactor;r.forEach(w,function(T,S){r.isUndefined(T)&&S%C!==0?--x:x&&r.forEach(T,function(_){m.node(_).rank+=x})})}function d(m,b,w,x){var C={width:0,height:0};return arguments.length>=4&&(C.rank=w,C.order=x),t(m,"border",C,b)}function h(m){return r.max(r.map(m.nodes(),function(b){var w=m.node(b).rank;if(!r.isUndefined(w))return w}))}function g(m,b){var w={lhs:[],rhs:[]};return r.forEach(m,function(x){b(x)?w.lhs.push(x):w.rhs.push(x)}),w}function p(m,b){var w=r.now();try{return b()}finally{console.log(m+" time: "+(r.now()-w)+"ms")}}function E(m,b){return b()}return My}var Ly,v2;function VG(){if(v2)return Ly;v2=1;var r=Or(),e=Vt();Ly={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,m;for(m=0,++l;l<c;++m,++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),m===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 Ly}var Oy,h2;function ol(){if(h2)return Oy;h2=1;var r=Or();Oy={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 Oy}var qy,g2;function KP(){if(g2)return qy;g2=1;var r=Or(),e=En().Graph,t=ol().slack;qy=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 qy}var Ny,p2;function GG(){if(p2)return Ny;p2=1;var r=Or(),e=KP(),t=ol().slack,n=ol().longestPath,a=En().alg.preorder,i=En().alg.postorder,o=Vt().simplify;Ny=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,_),D=0;return P||(A=!1,P=C.edge(_,T)),D=P.weight,r.forEach(C.nodeEdges(T),function(I){var M=I.v===T,k=M?I.w:I.v;if(k!==_){var N=M===A,z=C.edge(I).weight;if(D+=N?z:-z,b(x,T,k)){var W=x.edge(T,k).cutvalue;D+=N?-W:W}}}),D}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(D){r.has(C,D)||(T=h(x,C,T,D,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(_),D=A,I=!1;A.lim>P.lim&&(D=P,I=!0);var M=r.filter(C.edges(),function(k){return I===w(x,x.node(k.v),D)&&I!==w(x,x.node(k.w),D)});return r.minBy(M,function(k){return t(C,k)})}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),m(x,C)}function m(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),D=!1;P||(P=C.edge(A,_),D=!0),C.node(_).rank=C.node(A).rank+(D?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 Ny}var Fy,y2;function WG(){if(y2)return Fy;y2=1;var r=ol(),e=r.longestPath,t=KP(),n=GG();Fy=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 Fy}var zy,m2;function UG(){if(m2)return zy;m2=1;var r=Or();zy=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 zy}var $y,b2;function HG(){if(b2)return $y;b2=1;var r=Or(),e=Vt();$y={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"),m=e.addBorderNode(s,"_bb"),b=s.node(g);s.setParent(E,g),b.borderTop=E,s.setParent(m,g),b.borderBottom=m,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,m,{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 $y}var Vy,w2;function KG(){if(w2)return Vy;w2=1;var r=Or(),e=Vt();Vy=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 Vy}var Gy,x2;function jG(){if(x2)return Gy;x2=1;var r=Or();Gy={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 Gy}var Wy,E2;function YG(){if(E2)return Wy;E2=1;var r=Or();Wy=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 Wy}var Uy,C2;function ZG(){if(C2)return Uy;C2=1;var r=Or();Uy=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 Uy}var Hy,_2;function XG(){if(_2)return Hy;_2=1;var r=Or();Hy=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 Hy}var Ky,S2;function QG(){if(S2)return Ky;S2=1;var r=Or();Ky=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 Ky}var jy,T2;function JG(){if(T2)return jy;T2=1;var r=Or(),e=Vt();jy=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 jy}var Yy,R2;function eW(){if(R2)return Yy;R2=1;var r=Or(),e=XG(),t=QG(),n=JG();Yy=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 m=e(s,d);r.forEach(m,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(m,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 Yy}var Zy,A2;function rW(){if(A2)return Zy;A2=1;var r=Or(),e=En().Graph;Zy=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 Zy}var Xy,P2;function tW(){if(P2)return Xy;P2=1;var r=Or();Xy=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 Xy}var Qy,D2;function nW(){if(D2)return Qy;D2=1;var r=Or(),e=YG(),t=ZG(),n=eW(),a=rW(),i=tW(),o=En().Graph,s=Vt();Qy=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"),m=e(h);d(h,m);for(var b=Number.POSITIVE_INFINITY,w,x=0,C=0;C<4;++x,++C){c(x%2?p:E,x%4>=2),m=s.buildLayerMatrix(h);var T=t(h,m);T<b&&(C=0,w=r.cloneDeep(m),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 m=E.graph().root,b=n(E,m,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,m){h.node(E).order=m})})}return Qy}var Jy,I2;function aW(){if(I2)return Jy;I2=1;var r=Or(),e=En().Graph,t=Vt();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,D=r.last(S);return r.forEach(S,function(I,M){var k=i(b,I),N=k?b.node(k).order:P;(k||I===D)&&(r.forEach(S.slice(A,M+1),function(z){r.forEach(b.predecessors(z),function(W){var q=b.node(W),$=q.order;($<_||N<$)&&!(q.dummy&&b.node(z).dummy)&&o(x,W,z)})}),A=M+1,_=N)}),S}return r.reduce(w,C),x}function a(b,w){var x={};function C(S,_,A,P,D){var I;r.forEach(r.range(_,A),function(M){I=S[M],b.node(I).dummy&&r.forEach(b.predecessors(I),function(k){var N=b.node(k);N.dummy&&(N.order<P||N.order>D)&&o(x,k,I)})})}function T(S,_){var A=-1,P,D=0;return r.forEach(_,function(I,M){if(b.node(I).dummy==="border"){var k=b.predecessors(I);k.length&&(P=b.node(k[0]).order,C(_,D,M,A,P),D=M,A=P)}C(_,D,_.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,D){T[P]=P,S[P]=P,_[P]=D})}),r.forEach(w,function(A){var P=-1;r.forEach(A,function(D){var I=C(D);if(I.length){I=r.sortBy(I,function(W){return _[W]});for(var M=(I.length-1)/2,k=Math.floor(M),N=Math.ceil(M);k<=N;++k){var z=I[k];S[D]===D&&P<_[z]&&!s(x,D,z)&&(S[z]=D,S[D]=T[D]=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(M,k){for(var N=_.nodes(),z=N.pop(),W={};z;)W[z]?M(z):(W[z]=!0,N.push(z),N=N.concat(k(z))),z=N.pop()}function D(M){S[M]=_.inEdges(M).reduce(function(k,N){return Math.max(k,S[N.v]+_.edge(N))},0)}function I(M){var k=_.outEdges(M).reduce(function(z,W){return Math.min(z,S[W.w]-_.edge(W))},Number.POSITIVE_INFINITY),N=b.node(M);k!==Number.POSITIVE_INFINITY&&N.borderType!==A&&(S[M]=Math.max(S[M],k))}return P(D,_.predecessors.bind(_)),P(I,_.successors.bind(_)),r.forEach(C,function(M){S[M]=S[x[M]]}),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(D){var I=x[D];if(T.setNode(I),P){var M=x[P],k=T.edge(M,I);T.setEdge(M,I,Math.max(_(b,D,P),k||0))}P=D})}),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=m(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],D;if(P!==w){var I=r.values(P);D=_==="l"?C-r.min(I):T-r.max(I),D&&(b[A]=r.mapValues(P,function(M){return M+D}))}})})}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(M){return r.values(M).reverse()}));var P=(_==="u"?b.predecessors:b.successors).bind(b),D=l(b,T,x,P),I=u(b,T,D.root,D.align,A==="r");A==="r"&&(I=r.mapValues(I,function(M){return-M})),C[_+A]=I})});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,D;if(P+=_.width/2,r.has(_,"labelpos"))switch(_.labelpos.toLowerCase()){case"l":D=-_.width/2;break;case"r":D=_.width/2;break}if(D&&(P+=x?D:-D),D=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":D=A.width/2;break;case"r":D=-A.width/2;break}return D&&(P+=x?D:-D),D=0,P}}function m(b,w){return b.node(w).width}return Jy}var em,B2;function iW(){if(B2)return em;B2=1;var r=Or(),e=Vt(),t=aW().positionX;em=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 em}var rm,k2;function oW(){if(k2)return rm;k2=1;var r=Or(),e=$G(),t=VG(),n=WG(),a=Vt().normalizeRanks,i=UG(),o=Vt().removeEmptyRanks,s=HG(),l=KG(),u=jG(),c=nW(),d=iW(),h=Vt(),g=En().Graph;rm=p;function p(G,V){var j=V&&V.debugTiming?h.time:h.notime;j("layout",function(){var re=j(" buildLayoutGraph",function(){return P(G)});j(" runLayout",function(){E(re,j)}),j(" updateInputGraph",function(){m(G,re)})})}function E(G,V){V(" makeSpaceForEdgeLabels",function(){D(G)}),V(" removeSelfEdges",function(){X(G)}),V(" acyclic",function(){e.run(G)}),V(" nestingGraph.run",function(){s.run(G)}),V(" rank",function(){n(h.asNonCompoundGraph(G))}),V(" injectEdgeLabelProxies",function(){I(G)}),V(" removeEmptyRanks",function(){o(G)}),V(" nestingGraph.cleanup",function(){s.cleanup(G)}),V(" normalizeRanks",function(){a(G)}),V(" assignRankMinMax",function(){M(G)}),V(" removeEdgeLabelProxies",function(){k(G)}),V(" normalize.run",function(){t.run(G)}),V(" parentDummyChains",function(){i(G)}),V(" addBorderSegments",function(){l(G)}),V(" order",function(){c(G)}),V(" insertSelfEdges",function(){Y(G)}),V(" adjustCoordinateSystem",function(){u.adjust(G)}),V(" position",function(){d(G)}),V(" positionSelfEdges",function(){K(G)}),V(" removeBorderNodes",function(){$(G)}),V(" normalize.undo",function(){t.undo(G)}),V(" fixupEdgeLabelCoords",function(){W(G)}),V(" undoCoordinateSystem",function(){u.undo(G)}),V(" translateGraph",function(){N(G)}),V(" assignNodeIntersects",function(){z(G)}),V(" reversePoints",function(){q(G)}),V(" acyclic.undo",function(){e.undo(G)})}function m(G,V){r.forEach(G.nodes(),function(j){var re=G.node(j),ce=V.node(j);re&&(re.x=ce.x,re.y=ce.y,V.children(j).length&&(re.width=ce.width,re.height=ce.height))}),r.forEach(G.edges(),function(j){var re=G.edge(j),ce=V.edge(j);re.points=ce.points,r.has(ce,"x")&&(re.x=ce.x,re.y=ce.y)}),G.graph().width=V.graph().width,G.graph().height=V.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(G){var V=new g({multigraph:!0,compound:!0}),j=le(G.graph());return V.setGraph(r.merge({},w,ee(j,b),r.pick(j,x))),r.forEach(G.nodes(),function(re){var ce=le(G.node(re));V.setNode(re,r.defaults(ee(ce,C),T)),V.setParent(re,G.parent(re))}),r.forEach(G.edges(),function(re){var ce=le(G.edge(re));V.setEdge(re,r.merge({},_,ee(ce,S),r.pick(ce,A)))}),V}function D(G){var V=G.graph();V.ranksep/=2,r.forEach(G.edges(),function(j){var re=G.edge(j);re.minlen*=2,re.labelpos.toLowerCase()!=="c"&&(V.rankdir==="TB"||V.rankdir==="BT"?re.width+=re.labeloffset:re.height+=re.labeloffset)})}function I(G){r.forEach(G.edges(),function(V){var j=G.edge(V);if(j.width&&j.height){var re=G.node(V.v),ce=G.node(V.w),se={rank:(ce.rank-re.rank)/2+re.rank,e:V};h.addDummyNode(G,"edge-proxy",se,"_ep")}})}function M(G){var V=0;r.forEach(G.nodes(),function(j){var re=G.node(j);re.borderTop&&(re.minRank=G.node(re.borderTop).rank,re.maxRank=G.node(re.borderBottom).rank,V=r.max(V,re.maxRank))}),G.graph().maxRank=V}function k(G){r.forEach(G.nodes(),function(V){var j=G.node(V);j.dummy==="edge-proxy"&&(G.edge(j.e).labelRank=j.rank,G.removeNode(V))})}function N(G){var V=Number.POSITIVE_INFINITY,j=0,re=Number.POSITIVE_INFINITY,ce=0,se=G.graph(),Z=se.marginx||0,Q=se.marginy||0;function ae(ne){var de=ne.x,Ce=ne.y,ve=ne.width,U=ne.height;V=Math.min(V,de-ve/2),j=Math.max(j,de+ve/2),re=Math.min(re,Ce-U/2),ce=Math.max(ce,Ce+U/2)}r.forEach(G.nodes(),function(ne){ae(G.node(ne))}),r.forEach(G.edges(),function(ne){var de=G.edge(ne);r.has(de,"x")&&ae(de)}),V-=Z,re-=Q,r.forEach(G.nodes(),function(ne){var de=G.node(ne);de.x-=V,de.y-=re}),r.forEach(G.edges(),function(ne){var de=G.edge(ne);r.forEach(de.points,function(Ce){Ce.x-=V,Ce.y-=re}),r.has(de,"x")&&(de.x-=V),r.has(de,"y")&&(de.y-=re)}),se.width=j-V+Z,se.height=ce-re+Q}function z(G){r.forEach(G.edges(),function(V){var j=G.edge(V),re=G.node(V.v),ce=G.node(V.w),se,Z;j.points?(se=j.points[0],Z=j.points[j.points.length-1]):(j.points=[],se=ce,Z=re),j.points.unshift(h.intersectRect(re,se)),j.points.push(h.intersectRect(ce,Z))})}function W(G){r.forEach(G.edges(),function(V){var j=G.edge(V);if(r.has(j,"x"))switch((j.labelpos==="l"||j.labelpos==="r")&&(j.width-=j.labeloffset),j.labelpos){case"l":j.x-=j.width/2+j.labeloffset;break;case"r":j.x+=j.width/2+j.labeloffset;break}})}function q(G){r.forEach(G.edges(),function(V){var j=G.edge(V);j.reversed&&j.points.reverse()})}function $(G){r.forEach(G.nodes(),function(V){if(G.children(V).length){var j=G.node(V),re=G.node(j.borderTop),ce=G.node(j.borderBottom),se=G.node(r.last(j.borderLeft)),Z=G.node(r.last(j.borderRight));j.width=Math.abs(Z.x-se.x),j.height=Math.abs(ce.y-re.y),j.x=se.x+j.width/2,j.y=re.y+j.height/2}}),r.forEach(G.nodes(),function(V){G.node(V).dummy==="border"&&G.removeNode(V)})}function X(G){r.forEach(G.edges(),function(V){if(V.v===V.w){var j=G.node(V.v);j.selfEdges||(j.selfEdges=[]),j.selfEdges.push({e:V,label:G.edge(V)}),G.removeEdge(V)}})}function Y(G){var V=h.buildLayerMatrix(G);r.forEach(V,function(j){var re=0;r.forEach(j,function(ce,se){var Z=G.node(ce);Z.order=se+re,r.forEach(Z.selfEdges,function(Q){h.addDummyNode(G,"selfedge",{width:Q.label.width,height:Q.label.height,rank:Z.rank,order:se+ ++re,e:Q.e,label:Q.label},"_se")}),delete Z.selfEdges})})}function K(G){r.forEach(G.nodes(),function(V){var j=G.node(V);if(j.dummy==="selfedge"){var re=G.node(j.e.v),ce=re.x+re.width/2,se=re.y,Z=j.x-ce,Q=re.height/2;G.setEdge(j.e,j.label),G.removeNode(V),j.label.points=[{x:ce+2*Z/3,y:se-Q},{x:ce+5*Z/6,y:se-Q},{x:ce+Z,y:se},{x:ce+5*Z/6,y:se+Q},{x:ce+2*Z/3,y:se+Q}],j.label.x=j.x,j.label.y=j.y}})}function ee(G,V){return r.mapValues(r.pick(G,V),Number)}function le(G){var V={};return r.forEach(G,function(j,re){V[re.toLowerCase()]=j}),V}return rm}var tm,M2;function sW(){if(M2)return tm;M2=1;var r=Or(),e=Vt(),t=En().Graph;tm={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 tm}var nm,L2;function uW(){return L2||(L2=1,nm="0.8.5"),nm}var am,O2;function lW(){return O2||(O2=1,am={graphlib:En(),layout:oW(),debug:sW(),util:{time:Vt().time,notime:Vt().notime},version:uW()}),am}var fW=Gu.exports,q2;function cW(){return q2||(q2=1,(function(r,e){(function(n,a){r.exports=a(lW())})(fW,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,m=function(K,ee){return s(ee)?ee.apply(K,[K]):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(K,ee){ee!=null&&(x[K]=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 D=T[P];D.isChild()&&w.setParent(D.id(),D.parent().id())}var I=E.edges().stdFilter(function(Y){return!Y.source().isParent()&&!Y.target().isParent()});s(h.sort)&&(I=I.sort(h.sort));for(var M=0;M<I.length;M++){var k=I[M];w.setEdge(k.source().id(),k.target().id(),{minlen:m(k,h.minLen),weight:m(k,h.edgeWeight),name:k.id()},k.id())}c.layout(w);for(var N=w.nodes(),z=0;z<N.length;z++){var W=N[z],q=w.node(W);p.getElementById(W).scratch().dagre=q}var $;h.boundingBox?($={x1:1/0,x2:-1/0,y1:1/0,y2:-1/0},T.forEach(function(Y){var K=Y.scratch().dagre;$.x1=Math.min($.x1,K.x),$.x2=Math.max($.x2,K.x),$.y1=Math.min($.y1,K.y),$.y2=Math.max($.y2,K.y)}),$.w=$.x2-$.x1,$.h=$.y2-$.y1):$=b;var X=function(K){if(h.boundingBox){var ee=$.w===0?0:(K.x-$.x1)/$.w,le=$.h===0?0:(K.y-$.y1)/$.h;return{x:b.x1+ee*b.w,y:b.y1+le*b.h}}else return K};return T.layoutPositions(g,h,function(Y){Y=o(Y)==="object"?Y:this;var K=Y.scratch().dagre;return X({x:K.x,y:K.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})])})})(Gu)),Gu.exports}var dW=cW();const vW=Rl(dW);var Wu={exports:{}},im,N2;function hW(){if(N2)return im;N2=1;var r="Expected a function",e="__lodash_hash_undefined__",t="[object Function]",n="[object GeneratorFunction]",a=/[\\^$.*+?()[\]{}|]/g,i=/^\[object .+?Constructor\]$/,o=typeof Ct=="object"&&Ct&&Ct.Object===Object&&Ct,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:""})(),m=h.toString,b=g.hasOwnProperty,w=g.toString,x=RegExp("^"+m.call(b).replace(a,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),C=d.splice,T=ce(l,"Map"),S=ce(Object,"create");function _(ve){var U=-1,fe=ve?ve.length:0;for(this.clear();++U<fe;){var we=ve[U];this.set(we[0],we[1])}}function A(){this.__data__=S?S(null):{}}function P(ve){return this.has(ve)&&delete this.__data__[ve]}function D(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 I(ve){var U=this.__data__;return S?U[ve]!==void 0:b.call(U,ve)}function M(ve,U){var fe=this.__data__;return fe[ve]=S&&U===void 0?e:U,this}_.prototype.clear=A,_.prototype.delete=P,_.prototype.get=D,_.prototype.has=I,_.prototype.set=M;function k(ve){var U=-1,fe=ve?ve.length:0;for(this.clear();++U<fe;){var we=ve[U];this.set(we[0],we[1])}}function N(){this.__data__=[]}function z(ve){var U=this.__data__,fe=V(U,ve);if(fe<0)return!1;var we=U.length-1;return fe==we?U.pop():C.call(U,fe,1),!0}function W(ve){var U=this.__data__,fe=V(U,ve);return fe<0?void 0:U[fe][1]}function q(ve){return V(this.__data__,ve)>-1}function $(ve,U){var fe=this.__data__,we=V(fe,ve);return we<0?fe.push([ve,U]):fe[we][1]=U,this}k.prototype.clear=N,k.prototype.delete=z,k.prototype.get=W,k.prototype.has=q,k.prototype.set=$;function X(ve){var U=-1,fe=ve?ve.length:0;for(this.clear();++U<fe;){var we=ve[U];this.set(we[0],we[1])}}function Y(){this.__data__={hash:new _,map:new(T||k),string:new _}}function K(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 G(ve,U){return re(this,ve).set(ve,U),this}X.prototype.clear=Y,X.prototype.delete=K,X.prototype.get=ee,X.prototype.has=le,X.prototype.set=G;function V(ve,U){for(var fe=ve.length;fe--;)if(ne(ve[fe][0],U))return fe;return-1}function j(ve){if(!Ce(ve)||Z(ve))return!1;var U=de(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 ce(ve,U){var fe=u(ve,U);return j(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 Z(ve){return!!E&&E in ve}function Q(ve){if(ve!=null){try{return m.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 we=arguments,ge=U?U.apply(this,we):we[0],me=fe.cache;if(me.has(ge))return me.get(ge);var Re=ve.apply(this,we);return fe.cache=me.set(ge,Re),Re};return fe.cache=new(ae.Cache||X),fe}ae.Cache=X;function ne(ve,U){return ve===U||ve!==ve&&U!==U}function de(ve){var U=Ce(ve)?w.call(ve):"";return U==t||U==n}function Ce(ve){var U=typeof ve;return!!ve&&(U=="object"||U=="function")}return im=ae,im}var om,F2;function gW(){if(F2)return om;F2=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 Ct=="object"&&Ct&&Ct.Object===Object&&Ct,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 m(S,_,A){var P,D,I,M,k,N,z=0,W=!1,q=!1,$=!0;if(typeof S!="function")throw new TypeError(r);_=T(_)||0,w(A)&&(W=!!A.leading,q="maxWait"in A,I=q?g(T(A.maxWait)||0,_):I,$="trailing"in A?!!A.trailing:$);function X(ce){var se=P,Z=D;return P=D=void 0,z=ce,M=S.apply(Z,se),M}function Y(ce){return z=ce,k=setTimeout(le,_),W?X(ce):M}function K(ce){var se=ce-N,Z=ce-z,Q=_-se;return q?p(Q,I-Z):Q}function ee(ce){var se=ce-N,Z=ce-z;return N===void 0||se>=_||se<0||q&&Z>=I}function le(){var ce=E();if(ee(ce))return G(ce);k=setTimeout(le,K(ce))}function G(ce){return k=void 0,$&&P?X(ce):(P=D=void 0,M)}function V(){k!==void 0&&clearTimeout(k),z=0,P=N=D=k=void 0}function j(){return k===void 0?M:G(E())}function re(){var ce=E(),se=ee(ce);if(P=arguments,D=this,N=ce,se){if(k===void 0)return Y(N);if(q)return k=setTimeout(le,_),X(N)}return k===void 0&&(k=setTimeout(le,_)),M}return re.cancel=V,re.flush=j,re}function b(S,_,A){var P=!0,D=!0;if(typeof S!="function")throw new TypeError(r);return w(A)&&(P="leading"in A?!!A.leading:P,D="trailing"in A?!!A.trailing:D),m(S,_,{leading:P,maxWait:_,trailing:D})}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 om=b,om}var pW=Wu.exports,z2;function yW(){return z2||(z2=1,(function(r,e){(function(n,a){r.exports=a(hW(),gW())})(pW,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(),D=this.canConnect(_);if(T&&D){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 I=w.add(d({group:"edges",data:{source:S.id(),target:_.id()}},this.edgeParams(_),A));return P=P.merge(I),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 m(){var b=this,w=this.sourceNode,x=this.ghostNode,C=this.cy,T=this.mx,S=this.my,_=T,A=S,P=void 0,D=void 0;if(w)return(!x||x.length===0||x.removed())&&(D=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 I={};P=C.add(l({},I,{group:"edges",data:l({},I.data,{source:w.id(),target:x.id()}),classes:"eh-ghost eh-ghost-edge"})),P.style({events:"no"})}),D.merge(x).merge(P)),x.position({x:_,y:A}),this}a.exports={makeEdges:h,makePreview:g,removePreview:E,previewShown:p,updateEdge:m}}),(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(M){return x.anySame(M)},S=function(M){return C.anySame(M)},_=function(M){return T(M)||S(M)},A=this.enabled,P=this.active,D=this.grabbingNode;return A&&!P&&!D&&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(V){return l*Math.max(V.outerWidth(),V.outerHeight())/2},P=function(V,j,re,ce){var se=re-V,Z=ce-j;return se*se+Z*Z},D=function(V,j){return P(V.x,V.y,j.x,j.y)},I=function(V){return D(V.position(),T)},M=function(V){var j=A(V),re=j+C;return re*re},k=function(V){return I(V)<=M(V)},N=function(V){var j=V.position(),re=V.outerWidth()/2,ce=V.outerHeight()/2,se=j.x,Z=j.y,Q=T.x,ae=T.y,ne=se-re,de=se+re,Ce=Z-ce,ve=Z+ce,U=ne<=Q&&Q<=de,fe=Ce<=ae&&ae<=ve;if(U&&fe)return 0;if(U){var we=ae-Ce,ge=ae-ve;return Math.min(we*we,ge*ge)}else if(fe){var me=Q-ne,Re=Q-de;return Math.min(me*me,Re*Re)}else return Q<ne&&ae<Ce?P(Q,ae,ne,Ce):Q>de&&ae<Ce?P(Q,ae,de,Ce):Q<ne&&ae>ve?P(Q,ae,ne,ve):P(Q,ae,de,ve)},z=function(V,j){return N(V)-N(j)},W=z,q=!1,$=function(V){var j=T,re=V.outerWidth(),ce=re/2,se=V.outerHeight(),Z=se/2,Q=V.position(),ae=Q.x-ce,ne=Q.x+ce,de=Q.y-Z,Ce=Q.y+Z;return ae<=j.x&&j.x<=ne&&de<=j.y&&j.y<=Ce},X=function(V){return V.same(S)||V.same(_)},Y=w.nodes(function(G){return!X(G)&&k(G)}).sort(W),K=!1;x.nonempty()&&!k(x)&&this.unpreview(x);for(var ee=0;ee<Y.length;ee++){var le=Y[ee];if(!(le.isParent()&&$(le))&&!(le.isChild()&&!$(le.parent()))&&(le.same(x)||this.preview(le,q))){K=!0;break}}return K}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,D=this.previewEles,I=this.active,M=S,k=w.same(_),N=!this.canConnect(w),z=w.same(this.targetNode);if(!I||k||N||z)return!1;this.targetNode.nonempty()&&this.unpreview(this.targetNode),clearTimeout(this.previewTimeout);var W=function(){x.targetNode=w,P.merge(w),w.addClass("eh-presumptive-target"),w.addClass("eh-target"),x.emit("hoverover",x.mp(),M,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(),M,w,D)};return C&&T.hoverDelay>0?this.previewTimeout=setTimeout(W,T.hoverDelay):W(),!0}function m(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:m,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),m=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,m,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 m=this.listeners[E];this.removeListener(m.target,m.event,m.selector,m.callback,m.options)}return this}function c(E,m,b,w,x){return(typeof b>"u"?"undefined":s(b))!==s("")&&(w=b,x=w,b=null),x==null&&(x=!1),{target:E,event:m,selector:b,callback:w,options:x}}function d(E){return E instanceof Element}function h(E,m,b,w,x){var C=c(E,m,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,m,b,w,x){for(var C=c(E,m,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,m){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:m},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})])})})(Wu)),Wu.exports}var mW=yW();const bW=Rl(mW);var sm,$2;function wW(){if($2)return sm;$2=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),sm=e,sm}var xW=wW();const EW=Rl(xW);ln.prototype.hasInitialised||(ln.use(vW),ln.use(bW),ln.use(EW),ln.prototype.hasInitialised=!0);var Ho={exports:{}};/**
332
332
  * @license
333
333
  * Lodash <https://lodash.com/>
334
334
  * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>