@majdibo/flow-visualizer 1.0.0
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/README.md +339 -0
- package/dist/flow-visualizer.css +1 -0
- package/dist/flow-visualizer.es.js +5686 -0
- package/dist/flow-visualizer.umd.js +6 -0
- package/dist/logo.svg +24 -0
- package/package.json +60 -0
- package/public/logo.svg +24 -0
- package/src/FlowVisualizer.tsx +257 -0
- package/src/NodeDetailModal.tsx +63 -0
- package/src/index.css +119 -0
- package/src/index.ts +26 -0
- package/src/layoutEngine.ts +141 -0
- package/src/modal.css +153 -0
- package/src/theme.css +225 -0
- package/src/vite-env.d.ts +1 -0
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
(function(ue,W){typeof exports=="object"&&typeof module<"u"?W(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],W):(ue=typeof globalThis<"u"?globalThis:ue||self,W(ue.FlowVisualizer={},ue.React))})(this,(function(ue,W){"use strict";var De=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function qh(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ge={exports:{}},Ce={};var Hu;function wh(){if(Hu)return Ce;Hu=1;var e=Symbol.for("react.transitional.element"),a=Symbol.for("react.fragment");function t(n,r,i){var s=null;if(i!==void 0&&(s=""+i),r.key!==void 0&&(s=""+r.key),"key"in r){i={};for(var u in r)u!=="key"&&(i[u]=r[u])}else i=r;return r=i.ref,{$$typeof:e,type:n,key:s,ref:r!==void 0?r:null,props:i}}return Ce.Fragment=a,Ce.jsx=t,Ce.jsxs=t,Ce}var xe={};var Ku;function Rh(){return Ku||(Ku=1,process.env.NODE_ENV!=="production"&&(function(){function e(T){if(T==null)return null;if(typeof T=="function")return T.$$typeof===I?null:T.displayName||T.name||null;if(typeof T=="string")return T;switch(T){case h:return"Fragment";case _:return"Profiler";case p:return"StrictMode";case w:return"Suspense";case E:return"SuspenseList";case x:return"Activity"}if(typeof T=="object")switch(typeof T.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),T.$$typeof){case g:return"Portal";case y:return T.displayName||"Context";case b:return(T._context.displayName||"Context")+".Consumer";case q:var N=T.render;return T=T.displayName,T||(T=N.displayName||N.name||"",T=T!==""?"ForwardRef("+T+")":"ForwardRef"),T;case C:return N=T.displayName||null,N!==null?N:e(T.type)||"Memo";case S:N=T._payload,T=T._init;try{return e(T(N))}catch{}}return null}function a(T){return""+T}function t(T){try{a(T);var N=!1}catch{N=!0}if(N){N=console;var B=N.error,R=typeof Symbol=="function"&&Symbol.toStringTag&&T[Symbol.toStringTag]||T.constructor.name||"Object";return B.call(N,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",R),a(T)}}function n(T){if(T===h)return"<>";if(typeof T=="object"&&T!==null&&T.$$typeof===S)return"<...>";try{var N=e(T);return N?"<"+N+">":"<...>"}catch{return"<...>"}}function r(){var T=k.A;return T===null?null:T.getOwner()}function i(){return Error("react-stack-top-frame")}function s(T){if(M.call(T,"key")){var N=Object.getOwnPropertyDescriptor(T,"key").get;if(N&&N.isReactWarning)return!1}return T.key!==void 0}function u(T,N){function B(){K||(K=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",N))}B.isReactWarning=!0,Object.defineProperty(T,"key",{get:B,configurable:!0})}function o(){var T=e(this.type);return fe[T]||(fe[T]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),T=this.props.ref,T!==void 0?T:null}function c(T,N,B,R,A,O){var P=B.ref;return T={$$typeof:m,type:T,key:N,props:B,_owner:R},(P!==void 0?P:null)!==null?Object.defineProperty(T,"ref",{enumerable:!1,get:o}):Object.defineProperty(T,"ref",{enumerable:!1,value:null}),T._store={},Object.defineProperty(T._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(T,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(T,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:A}),Object.defineProperty(T,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:O}),Object.freeze&&(Object.freeze(T.props),Object.freeze(T)),T}function f(T,N,B,R,A,O){var P=N.children;if(P!==void 0)if(R)if(j(P)){for(R=0;R<P.length;R++)d(P[R]);Object.freeze&&Object.freeze(P)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else d(P);if(M.call(N,"key")){P=e(T);var L=Object.keys(N).filter(function(H){return H!=="key"});R=0<L.length?"{key: someKey, "+L.join(": ..., ")+": ...}":"{key: someKey}",Te[P+R]||(L=0<L.length?"{"+L.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
2
|
+
let props = %s;
|
|
3
|
+
<%s {...props} />
|
|
4
|
+
React keys must be passed directly to JSX without using spread:
|
|
5
|
+
let props = %s;
|
|
6
|
+
<%s key={someKey} {...props} />`,R,P,L,P),Te[P+R]=!0)}if(P=null,B!==void 0&&(t(B),P=""+B),s(N)&&(t(N.key),P=""+N.key),"key"in N){B={};for(var U in N)U!=="key"&&(B[U]=N[U])}else B=N;return P&&u(B,typeof T=="function"?T.displayName||T.name||"Unknown":T),c(T,P,B,r(),A,O)}function d(T){l(T)?T._store&&(T._store.validated=1):typeof T=="object"&&T!==null&&T.$$typeof===S&&(T._payload.status==="fulfilled"?l(T._payload.value)&&T._payload.value._store&&(T._payload.value._store.validated=1):T._store&&(T._store.validated=1))}function l(T){return typeof T=="object"&&T!==null&&T.$$typeof===m}var v=W,m=Symbol.for("react.transitional.element"),g=Symbol.for("react.portal"),h=Symbol.for("react.fragment"),p=Symbol.for("react.strict_mode"),_=Symbol.for("react.profiler"),b=Symbol.for("react.consumer"),y=Symbol.for("react.context"),q=Symbol.for("react.forward_ref"),w=Symbol.for("react.suspense"),E=Symbol.for("react.suspense_list"),C=Symbol.for("react.memo"),S=Symbol.for("react.lazy"),x=Symbol.for("react.activity"),I=Symbol.for("react.client.reference"),k=v.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,M=Object.prototype.hasOwnProperty,j=Array.isArray,F=console.createTask?console.createTask:function(){return null};v={react_stack_bottom_frame:function(T){return T()}};var K,fe={},ie=v.react_stack_bottom_frame.bind(v,i)(),Ee=F(n(i)),Te={};xe.Fragment=h,xe.jsx=function(T,N,B){var R=1e4>k.recentlyCreatedOwnerStacks++;return f(T,N,B,!1,R?Error("react-stack-top-frame"):ie,R?F(n(T)):Ee)},xe.jsxs=function(T,N,B){var R=1e4>k.recentlyCreatedOwnerStacks++;return f(T,N,B,!0,R?Error("react-stack-top-frame"):ie,R?F(n(T)):Ee)}})()),xe}var Yu;function Eh(){return Yu||(Yu=1,process.env.NODE_ENV==="production"?Ge.exports=wh():Ge.exports=Rh()),Ge.exports}var V=Eh();function Th({node:e,state:a,onClick:t}){const n=a.nodeStates[e.id],r=n==="current",i=e.x+e.width/2,s=e.y+e.height/2,u=e.type==="decision"?`M${i},${s-e.height/2} L${i+e.width/2},${s} L${i},${s+e.height/2} L${i-e.width/2},${s} Z`:void 0;return V.jsxs("g",{onClick:t,className:`flow-node flow-node-${n} ${t?"cursor-pointer":""}`,style:{filter:`var(--flow-node-${n}-shadow)`},"data-node":e.id,children:[u?V.jsx("path",{d:u,fill:`var(--flow-node-${n}-fill)`,stroke:`var(--flow-node-${n}-stroke)`,strokeWidth:r?3:2}):V.jsx("rect",{x:e.x,y:e.y,width:e.width,height:e.height,rx:16,fill:`var(--flow-node-${n}-fill)`,stroke:`var(--flow-node-${n}-stroke)`,strokeWidth:r?3:2}),V.jsx("text",{x:i,y:s+(e.type==="decision"?4:0),textAnchor:"middle",fill:r?"var(--flow-text-current)":n==="traversed"?"var(--flow-text-secondary)":"var(--flow-text-primary)",className:"flow-node-label",dominantBaseline:"middle",children:e.label})]})}function Sh({nodes:e,edges:a,state:t,onNodeClick:n}){const r=W.useRef(null),[i,s]=W.useState({x:0,y:0,scale:1}),[u,o]=W.useState(!1),c=W.useRef({x:0,y:0}),f=W.useMemo(()=>{if(e.length===0)return"0 0 1200 800";let h=1/0,p=1/0,_=-1/0,b=-1/0;e.forEach(I=>{h=Math.min(h,I.x),p=Math.min(p,I.y),_=Math.max(_,I.x+I.width),b=Math.max(b,I.y+I.height)});const y=100;h-=y,p-=y,_+=y,b+=y;let q=_-h,w=b-p;const E=1200,C=800;if(q<E){const I=E-q;h-=I/2,q=E}if(w<C){const I=C-w;p-=I/2,w=C}const S=1.5,x=q/w;if(x>S){const I=q/S,k=I-w;p-=k/2,w=I}else if(x<S){const I=w*S,k=I-q;h-=k/2,q=I}return`${h} ${p} ${q} ${w}`},[e]);W.useEffect(()=>{const h=r.current;if(!h)return;const p=_=>{_.preventDefault(),s(b=>{const y=h.getBoundingClientRect(),q=_.clientX-y.left,w=_.clientY-y.top,E=_.deltaY>0?.9:1.1,C=Math.min(Math.max(b.scale*E,.1),5),S=C-b.scale;return{x:b.x-q/b.scale*S,y:b.y-w/b.scale*S,scale:C}})};return h.addEventListener("wheel",p,{passive:!1}),()=>h.removeEventListener("wheel",p)},[]);const d=W.useCallback(h=>h.closest("g[data-node]"),[]),l=W.useCallback(h=>{h.button!==0||d(h.target)||(o(!0),c.current={x:h.clientX-i.x,y:h.clientY-i.y})},[i.x,i.y,d]),v=W.useCallback(h=>{u&&s(p=>({...p,x:h.clientX-c.current.x,y:h.clientY-c.current.y}))},[u]),m=W.useCallback(()=>o(!1),[]),g=W.useCallback(h=>{d(h.target)||s({x:0,y:0,scale:1})},[d]);return V.jsxs("svg",{ref:r,viewBox:f,className:"w-full h-full",style:{cursor:u?"grabbing":"grab"},onMouseDown:l,onMouseMove:v,onMouseUp:m,onMouseLeave:m,onDoubleClick:g,children:[V.jsxs("defs",{children:[V.jsxs("linearGradient",{id:"gradient-current",x1:"0%",y1:"0%",x2:"100%",y2:"100%",children:[V.jsx("stop",{offset:"0%",stopColor:"var(--flow-gradient-start)"}),V.jsx("stop",{offset:"100%",stopColor:"var(--flow-gradient-end)"})]}),V.jsx("marker",{id:"arrow-current",markerWidth:"12",markerHeight:"12",refX:"10",refY:"3",orient:"auto",children:V.jsx("path",{d:"M0,0 L0,6 L9,3 z",className:"flow-arrow-current",fill:"var(--flow-edge-current)"})}),V.jsx("marker",{id:"arrow-traversed",markerWidth:"12",markerHeight:"12",refX:"10",refY:"3",orient:"auto",children:V.jsx("path",{d:"M0,0 L0,6 L9,3 z",className:"flow-arrow-traversed",fill:"var(--flow-edge-traversed)"})}),V.jsx("marker",{id:"arrow-untraversed",markerWidth:"12",markerHeight:"12",refX:"10",refY:"3",orient:"auto",children:V.jsx("path",{d:"M0,0 L0,6 L9,3 z",className:"flow-arrow-untraversed",fill:"var(--flow-edge-untraversed)"})})]}),V.jsx("rect",{width:"100%",height:"100%",fill:"var(--flow-bg)"}),V.jsxs("g",{transform:`translate(${i.x}, ${i.y}) scale(${i.scale})`,children:[a.map(h=>{const p=t.edgeStates[h.id];return V.jsxs("g",{className:`flow-edge-${p}`,children:[V.jsx("path",{d:h.path,stroke:`var(--flow-edge-${p})`,strokeWidth:p==="current"?2.5:p==="traversed"?2:1.5,fill:"none",markerEnd:`url(#arrow-${p})`,strokeDasharray:p==="untraversed"?"5,5":"none"}),h.label&&h.labelX&&h.labelY&&V.jsx("text",{x:h.labelX,y:h.labelY,fill:p==="current"?"var(--flow-edge-current)":"var(--flow-text-secondary)",className:"flow-node-sublabel",children:h.label})]},h.id)}),e.map(h=>V.jsx(Th,{node:h,state:t,onClick:n?()=>n(h.id):void 0},h.id))]})]})}function Ah({onClose:e,children:a}){return V.jsxs("div",{className:"flow-modal-overlay",onClick:e,children:[V.jsx("div",{className:"flow-modal-backdrop"}),V.jsx("div",{className:"flow-modal-container",onClick:t=>t.stopPropagation(),children:a})]})}function fr(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var cr,Wu;function Ih(){if(Wu)return cr;Wu=1;function e(){this.__data__=[],this.size=0}return cr=e,cr}var dr,$u;function ye(){if($u)return dr;$u=1;function e(a,t){return a===t||a!==a&&t!==t}return dr=e,dr}var lr,Xu;function Be(){if(Xu)return lr;Xu=1;var e=ye();function a(t,n){for(var r=t.length;r--;)if(e(t[r][0],n))return r;return-1}return lr=a,lr}var hr,Ju;function Ch(){if(Ju)return hr;Ju=1;var e=Be(),a=Array.prototype,t=a.splice;function n(r){var i=this.__data__,s=e(i,r);if(s<0)return!1;var u=i.length-1;return s==u?i.pop():t.call(i,s,1),--this.size,!0}return hr=n,hr}var vr,Zu;function xh(){if(Zu)return vr;Zu=1;var e=Be();function a(t){var n=this.__data__,r=e(n,t);return r<0?void 0:n[r][1]}return vr=a,vr}var pr,Qu;function Oh(){if(Qu)return pr;Qu=1;var e=Be();function a(t){return e(this.__data__,t)>-1}return pr=a,pr}var _r,es;function Ph(){if(es)return _r;es=1;var e=Be();function a(t,n){var r=this.__data__,i=e(r,t);return i<0?(++this.size,r.push([t,n])):r[i][1]=n,this}return _r=a,_r}var br,rs;function Ue(){if(rs)return br;rs=1;var e=Ih(),a=Ch(),t=xh(),n=Oh(),r=Ph();function i(s){var u=-1,o=s==null?0:s.length;for(this.clear();++u<o;){var c=s[u];this.set(c[0],c[1])}}return i.prototype.clear=e,i.prototype.delete=a,i.prototype.get=t,i.prototype.has=n,i.prototype.set=r,br=i,br}var gr,ns;function kh(){if(ns)return gr;ns=1;var e=Ue();function a(){this.__data__=new e,this.size=0}return gr=a,gr}var yr,ts;function Mh(){if(ts)return yr;ts=1;function e(a){var t=this.__data__,n=t.delete(a);return this.size=t.size,n}return yr=e,yr}var mr,as;function Nh(){if(as)return mr;as=1;function e(a){return this.__data__.get(a)}return mr=e,mr}var qr,is;function Lh(){if(is)return qr;is=1;function e(a){return this.__data__.has(a)}return qr=e,qr}var wr,us;function ss(){if(us)return wr;us=1;var e=typeof De=="object"&&De&&De.Object===Object&&De;return wr=e,wr}var Rr,os;function ne(){if(os)return Rr;os=1;var e=ss(),a=typeof self=="object"&&self&&self.Object===Object&&self,t=e||a||Function("return this")();return Rr=t,Rr}var Er,fs;function me(){if(fs)return Er;fs=1;var e=ne(),a=e.Symbol;return Er=a,Er}var Tr,cs;function jh(){if(cs)return Tr;cs=1;var e=me(),a=Object.prototype,t=a.hasOwnProperty,n=a.toString,r=e?e.toStringTag:void 0;function i(s){var u=t.call(s,r),o=s[r];try{s[r]=void 0;var c=!0}catch{}var f=n.call(s);return c&&(u?s[r]=o:delete s[r]),f}return Tr=i,Tr}var Sr,ds;function Fh(){if(ds)return Sr;ds=1;var e=Object.prototype,a=e.toString;function t(n){return a.call(n)}return Sr=t,Sr}var Ar,ls;function he(){if(ls)return Ar;ls=1;var e=me(),a=jh(),t=Fh(),n="[object Null]",r="[object Undefined]",i=e?e.toStringTag:void 0;function s(u){return u==null?u===void 0?r:n:i&&i in Object(u)?a(u):t(u)}return Ar=s,Ar}var Ir,hs;function ee(){if(hs)return Ir;hs=1;function e(a){var t=typeof a;return a!=null&&(t=="object"||t=="function")}return Ir=e,Ir}var Cr,vs;function Oe(){if(vs)return Cr;vs=1;var e=he(),a=ee(),t="[object AsyncFunction]",n="[object Function]",r="[object GeneratorFunction]",i="[object Proxy]";function s(u){if(!a(u))return!1;var o=e(u);return o==n||o==r||o==t||o==i}return Cr=s,Cr}var xr,ps;function Dh(){if(ps)return xr;ps=1;var e=ne(),a=e["__core-js_shared__"];return xr=a,xr}var Or,_s;function Gh(){if(_s)return Or;_s=1;var e=Dh(),a=(function(){var n=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""})();function t(n){return!!a&&a in n}return Or=t,Or}var Pr,bs;function gs(){if(bs)return Pr;bs=1;var e=Function.prototype,a=e.toString;function t(n){if(n!=null){try{return a.call(n)}catch{}try{return n+""}catch{}}return""}return Pr=t,Pr}var kr,ys;function Bh(){if(ys)return kr;ys=1;var e=Oe(),a=Gh(),t=ee(),n=gs(),r=/[\\^$.*+?()[\]{}|]/g,i=/^\[object .+?Constructor\]$/,s=Function.prototype,u=Object.prototype,o=s.toString,c=u.hasOwnProperty,f=RegExp("^"+o.call(c).replace(r,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function d(l){if(!t(l)||a(l))return!1;var v=e(l)?f:i;return v.test(n(l))}return kr=d,kr}var Mr,ms;function Uh(){if(ms)return Mr;ms=1;function e(a,t){return a?.[t]}return Mr=e,Mr}var Nr,qs;function ve(){if(qs)return Nr;qs=1;var e=Bh(),a=Uh();function t(n,r){var i=a(n,r);return e(i)?i:void 0}return Nr=t,Nr}var Lr,ws;function jr(){if(ws)return Lr;ws=1;var e=ve(),a=ne(),t=e(a,"Map");return Lr=t,Lr}var Fr,Rs;function Ve(){if(Rs)return Fr;Rs=1;var e=ve(),a=e(Object,"create");return Fr=a,Fr}var Dr,Es;function Vh(){if(Es)return Dr;Es=1;var e=Ve();function a(){this.__data__=e?e(null):{},this.size=0}return Dr=a,Dr}var Gr,Ts;function zh(){if(Ts)return Gr;Ts=1;function e(a){var t=this.has(a)&&delete this.__data__[a];return this.size-=t?1:0,t}return Gr=e,Gr}var Br,Ss;function Hh(){if(Ss)return Br;Ss=1;var e=Ve(),a="__lodash_hash_undefined__",t=Object.prototype,n=t.hasOwnProperty;function r(i){var s=this.__data__;if(e){var u=s[i];return u===a?void 0:u}return n.call(s,i)?s[i]:void 0}return Br=r,Br}var Ur,As;function Kh(){if(As)return Ur;As=1;var e=Ve(),a=Object.prototype,t=a.hasOwnProperty;function n(r){var i=this.__data__;return e?i[r]!==void 0:t.call(i,r)}return Ur=n,Ur}var Vr,Is;function Yh(){if(Is)return Vr;Is=1;var e=Ve(),a="__lodash_hash_undefined__";function t(n,r){var i=this.__data__;return this.size+=this.has(n)?0:1,i[n]=e&&r===void 0?a:r,this}return Vr=t,Vr}var zr,Cs;function Wh(){if(Cs)return zr;Cs=1;var e=Vh(),a=zh(),t=Hh(),n=Kh(),r=Yh();function i(s){var u=-1,o=s==null?0:s.length;for(this.clear();++u<o;){var c=s[u];this.set(c[0],c[1])}}return i.prototype.clear=e,i.prototype.delete=a,i.prototype.get=t,i.prototype.has=n,i.prototype.set=r,zr=i,zr}var Hr,xs;function $h(){if(xs)return Hr;xs=1;var e=Wh(),a=Ue(),t=jr();function n(){this.size=0,this.__data__={hash:new e,map:new(t||a),string:new e}}return Hr=n,Hr}var Kr,Os;function Xh(){if(Os)return Kr;Os=1;function e(a){var t=typeof a;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?a!=="__proto__":a===null}return Kr=e,Kr}var Yr,Ps;function ze(){if(Ps)return Yr;Ps=1;var e=Xh();function a(t,n){var r=t.__data__;return e(n)?r[typeof n=="string"?"string":"hash"]:r.map}return Yr=a,Yr}var Wr,ks;function Jh(){if(ks)return Wr;ks=1;var e=ze();function a(t){var n=e(this,t).delete(t);return this.size-=n?1:0,n}return Wr=a,Wr}var $r,Ms;function Zh(){if(Ms)return $r;Ms=1;var e=ze();function a(t){return e(this,t).get(t)}return $r=a,$r}var Xr,Ns;function Qh(){if(Ns)return Xr;Ns=1;var e=ze();function a(t){return e(this,t).has(t)}return Xr=a,Xr}var Jr,Ls;function ev(){if(Ls)return Jr;Ls=1;var e=ze();function a(t,n){var r=e(this,t),i=r.size;return r.set(t,n),this.size+=r.size==i?0:1,this}return Jr=a,Jr}var Zr,js;function Qr(){if(js)return Zr;js=1;var e=$h(),a=Jh(),t=Zh(),n=Qh(),r=ev();function i(s){var u=-1,o=s==null?0:s.length;for(this.clear();++u<o;){var c=s[u];this.set(c[0],c[1])}}return i.prototype.clear=e,i.prototype.delete=a,i.prototype.get=t,i.prototype.has=n,i.prototype.set=r,Zr=i,Zr}var en,Fs;function rv(){if(Fs)return en;Fs=1;var e=Ue(),a=jr(),t=Qr(),n=200;function r(i,s){var u=this.__data__;if(u instanceof e){var o=u.__data__;if(!a||o.length<n-1)return o.push([i,s]),this.size=++u.size,this;u=this.__data__=new t(o)}return u.set(i,s),this.size=u.size,this}return en=r,en}var rn,Ds;function He(){if(Ds)return rn;Ds=1;var e=Ue(),a=kh(),t=Mh(),n=Nh(),r=Lh(),i=rv();function s(u){var o=this.__data__=new e(u);this.size=o.size}return s.prototype.clear=a,s.prototype.delete=t,s.prototype.get=n,s.prototype.has=r,s.prototype.set=i,rn=s,rn}var nn,Gs;function tn(){if(Gs)return nn;Gs=1;function e(a,t){for(var n=-1,r=a==null?0:a.length;++n<r&&t(a[n],n,a)!==!1;);return a}return nn=e,nn}var an,Bs;function Us(){if(Bs)return an;Bs=1;var e=ve(),a=(function(){try{var t=e(Object,"defineProperty");return t({},"",{}),t}catch{}})();return an=a,an}var un,Vs;function Ke(){if(Vs)return un;Vs=1;var e=Us();function a(t,n,r){n=="__proto__"&&e?e(t,n,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[n]=r}return un=a,un}var sn,zs;function Ye(){if(zs)return sn;zs=1;var e=Ke(),a=ye(),t=Object.prototype,n=t.hasOwnProperty;function r(i,s,u){var o=i[s];(!(n.call(i,s)&&a(o,u))||u===void 0&&!(s in i))&&e(i,s,u)}return sn=r,sn}var on,Hs;function Pe(){if(Hs)return on;Hs=1;var e=Ye(),a=Ke();function t(n,r,i,s){var u=!i;i||(i={});for(var o=-1,c=r.length;++o<c;){var f=r[o],d=s?s(i[f],n[f],f,i,n):void 0;d===void 0&&(d=n[f]),u?a(i,f,d):e(i,f,d)}return i}return on=t,on}var fn,Ks;function nv(){if(Ks)return fn;Ks=1;function e(a,t){for(var n=-1,r=Array(a);++n<a;)r[n]=t(n);return r}return fn=e,fn}var cn,Ys;function ae(){if(Ys)return cn;Ys=1;function e(a){return a!=null&&typeof a=="object"}return cn=e,cn}var dn,Ws;function tv(){if(Ws)return dn;Ws=1;var e=he(),a=ae(),t="[object Arguments]";function n(r){return a(r)&&e(r)==t}return dn=n,dn}var ln,$s;function ke(){if($s)return ln;$s=1;var e=tv(),a=ae(),t=Object.prototype,n=t.hasOwnProperty,r=t.propertyIsEnumerable,i=e((function(){return arguments})())?e:function(s){return a(s)&&n.call(s,"callee")&&!r.call(s,"callee")};return ln=i,ln}var hn,Xs;function Y(){if(Xs)return hn;Xs=1;var e=Array.isArray;return hn=e,hn}var Me={exports:{}},vn,Js;function av(){if(Js)return vn;Js=1;function e(){return!1}return vn=e,vn}Me.exports;var Zs;function qe(){return Zs||(Zs=1,(function(e,a){var t=ne(),n=av(),r=a&&!a.nodeType&&a,i=r&&!0&&e&&!e.nodeType&&e,s=i&&i.exports===r,u=s?t.Buffer:void 0,o=u?u.isBuffer:void 0,c=o||n;e.exports=c})(Me,Me.exports)),Me.exports}var pn,Qs;function We(){if(Qs)return pn;Qs=1;var e=9007199254740991,a=/^(?:0|[1-9]\d*)$/;function t(n,r){var i=typeof n;return r=r??e,!!r&&(i=="number"||i!="symbol"&&a.test(n))&&n>-1&&n%1==0&&n<r}return pn=t,pn}var _n,eo;function bn(){if(eo)return _n;eo=1;var e=9007199254740991;function a(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=e}return _n=a,_n}var gn,ro;function iv(){if(ro)return gn;ro=1;var e=he(),a=bn(),t=ae(),n="[object Arguments]",r="[object Array]",i="[object Boolean]",s="[object Date]",u="[object Error]",o="[object Function]",c="[object Map]",f="[object Number]",d="[object Object]",l="[object RegExp]",v="[object Set]",m="[object String]",g="[object WeakMap]",h="[object ArrayBuffer]",p="[object DataView]",_="[object Float32Array]",b="[object Float64Array]",y="[object Int8Array]",q="[object Int16Array]",w="[object Int32Array]",E="[object Uint8Array]",C="[object Uint8ClampedArray]",S="[object Uint16Array]",x="[object Uint32Array]",I={};I[_]=I[b]=I[y]=I[q]=I[w]=I[E]=I[C]=I[S]=I[x]=!0,I[n]=I[r]=I[h]=I[i]=I[p]=I[s]=I[u]=I[o]=I[c]=I[f]=I[d]=I[l]=I[v]=I[m]=I[g]=!1;function k(M){return t(M)&&a(M.length)&&!!I[e(M)]}return gn=k,gn}var yn,no;function $e(){if(no)return yn;no=1;function e(a){return function(t){return a(t)}}return yn=e,yn}var Ne={exports:{}};Ne.exports;var to;function mn(){return to||(to=1,(function(e,a){var t=ss(),n=a&&!a.nodeType&&a,r=n&&!0&&e&&!e.nodeType&&e,i=r&&r.exports===n,s=i&&t.process,u=(function(){try{var o=r&&r.require&&r.require("util").types;return o||s&&s.binding&&s.binding("util")}catch{}})();e.exports=u})(Ne,Ne.exports)),Ne.exports}var qn,ao;function Le(){if(ao)return qn;ao=1;var e=iv(),a=$e(),t=mn(),n=t&&t.isTypedArray,r=n?a(n):e;return qn=r,qn}var wn,io;function uo(){if(io)return wn;io=1;var e=nv(),a=ke(),t=Y(),n=qe(),r=We(),i=Le(),s=Object.prototype,u=s.hasOwnProperty;function o(c,f){var d=t(c),l=!d&&a(c),v=!d&&!l&&n(c),m=!d&&!l&&!v&&i(c),g=d||l||v||m,h=g?e(c.length,String):[],p=h.length;for(var _ in c)(f||u.call(c,_))&&!(g&&(_=="length"||v&&(_=="offset"||_=="parent")||m&&(_=="buffer"||_=="byteLength"||_=="byteOffset")||r(_,p)))&&h.push(_);return h}return wn=o,wn}var Rn,so;function Xe(){if(so)return Rn;so=1;var e=Object.prototype;function a(t){var n=t&&t.constructor,r=typeof n=="function"&&n.prototype||e;return t===r}return Rn=a,Rn}var En,oo;function fo(){if(oo)return En;oo=1;function e(a,t){return function(n){return a(t(n))}}return En=e,En}var Tn,co;function uv(){if(co)return Tn;co=1;var e=fo(),a=e(Object.keys,Object);return Tn=a,Tn}var Sn,lo;function An(){if(lo)return Sn;lo=1;var e=Xe(),a=uv(),t=Object.prototype,n=t.hasOwnProperty;function r(i){if(!e(i))return a(i);var s=[];for(var u in Object(i))n.call(i,u)&&u!="constructor"&&s.push(u);return s}return Sn=r,Sn}var In,ho;function se(){if(ho)return In;ho=1;var e=Oe(),a=bn();function t(n){return n!=null&&a(n.length)&&!e(n)}return In=t,In}var Cn,vo;function ce(){if(vo)return Cn;vo=1;var e=uo(),a=An(),t=se();function n(r){return t(r)?e(r):a(r)}return Cn=n,Cn}var xn,po;function sv(){if(po)return xn;po=1;var e=Pe(),a=ce();function t(n,r){return n&&e(r,a(r),n)}return xn=t,xn}var On,_o;function ov(){if(_o)return On;_o=1;function e(a){var t=[];if(a!=null)for(var n in Object(a))t.push(n);return t}return On=e,On}var Pn,bo;function fv(){if(bo)return Pn;bo=1;var e=ee(),a=Xe(),t=ov(),n=Object.prototype,r=n.hasOwnProperty;function i(s){if(!e(s))return t(s);var u=a(s),o=[];for(var c in s)c=="constructor"&&(u||!r.call(s,c))||o.push(c);return o}return Pn=i,Pn}var kn,go;function pe(){if(go)return kn;go=1;var e=uo(),a=fv(),t=se();function n(r){return t(r)?e(r,!0):a(r)}return kn=n,kn}var Mn,yo;function cv(){if(yo)return Mn;yo=1;var e=Pe(),a=pe();function t(n,r){return n&&e(r,a(r),n)}return Mn=t,Mn}var je={exports:{}};je.exports;var mo;function qo(){return mo||(mo=1,(function(e,a){var t=ne(),n=a&&!a.nodeType&&a,r=n&&!0&&e&&!e.nodeType&&e,i=r&&r.exports===n,s=i?t.Buffer:void 0,u=s?s.allocUnsafe:void 0;function o(c,f){if(f)return c.slice();var d=c.length,l=u?u(d):new c.constructor(d);return c.copy(l),l}e.exports=o})(je,je.exports)),je.exports}var Nn,wo;function Ro(){if(wo)return Nn;wo=1;function e(a,t){var n=-1,r=a.length;for(t||(t=Array(r));++n<r;)t[n]=a[n];return t}return Nn=e,Nn}var Ln,Eo;function To(){if(Eo)return Ln;Eo=1;function e(a,t){for(var n=-1,r=a==null?0:a.length,i=0,s=[];++n<r;){var u=a[n];t(u,n,a)&&(s[i++]=u)}return s}return Ln=e,Ln}var jn,So;function Ao(){if(So)return jn;So=1;function e(){return[]}return jn=e,jn}var Fn,Io;function Dn(){if(Io)return Fn;Io=1;var e=To(),a=Ao(),t=Object.prototype,n=t.propertyIsEnumerable,r=Object.getOwnPropertySymbols,i=r?function(s){return s==null?[]:(s=Object(s),e(r(s),function(u){return n.call(s,u)}))}:a;return Fn=i,Fn}var Gn,Co;function dv(){if(Co)return Gn;Co=1;var e=Pe(),a=Dn();function t(n,r){return e(n,a(n),r)}return Gn=t,Gn}var Bn,xo;function Un(){if(xo)return Bn;xo=1;function e(a,t){for(var n=-1,r=t.length,i=a.length;++n<r;)a[i+n]=t[n];return a}return Bn=e,Bn}var Vn,Oo;function Je(){if(Oo)return Vn;Oo=1;var e=fo(),a=e(Object.getPrototypeOf,Object);return Vn=a,Vn}var zn,Po;function ko(){if(Po)return zn;Po=1;var e=Un(),a=Je(),t=Dn(),n=Ao(),r=Object.getOwnPropertySymbols,i=r?function(s){for(var u=[];s;)e(u,t(s)),s=a(s);return u}:n;return zn=i,zn}var Hn,Mo;function lv(){if(Mo)return Hn;Mo=1;var e=Pe(),a=ko();function t(n,r){return e(n,a(n),r)}return Hn=t,Hn}var Kn,No;function Lo(){if(No)return Kn;No=1;var e=Un(),a=Y();function t(n,r,i){var s=r(n);return a(n)?s:e(s,i(n))}return Kn=t,Kn}var Yn,jo;function Fo(){if(jo)return Yn;jo=1;var e=Lo(),a=Dn(),t=ce();function n(r){return e(r,t,a)}return Yn=n,Yn}var Wn,Do;function hv(){if(Do)return Wn;Do=1;var e=Lo(),a=ko(),t=pe();function n(r){return e(r,t,a)}return Wn=n,Wn}var $n,Go;function vv(){if(Go)return $n;Go=1;var e=ve(),a=ne(),t=e(a,"DataView");return $n=t,$n}var Xn,Bo;function pv(){if(Bo)return Xn;Bo=1;var e=ve(),a=ne(),t=e(a,"Promise");return Xn=t,Xn}var Jn,Uo;function Vo(){if(Uo)return Jn;Uo=1;var e=ve(),a=ne(),t=e(a,"Set");return Jn=t,Jn}var Zn,zo;function _v(){if(zo)return Zn;zo=1;var e=ve(),a=ne(),t=e(a,"WeakMap");return Zn=t,Zn}var Qn,Ho;function we(){if(Ho)return Qn;Ho=1;var e=vv(),a=jr(),t=pv(),n=Vo(),r=_v(),i=he(),s=gs(),u="[object Map]",o="[object Object]",c="[object Promise]",f="[object Set]",d="[object WeakMap]",l="[object DataView]",v=s(e),m=s(a),g=s(t),h=s(n),p=s(r),_=i;return(e&&_(new e(new ArrayBuffer(1)))!=l||a&&_(new a)!=u||t&&_(t.resolve())!=c||n&&_(new n)!=f||r&&_(new r)!=d)&&(_=function(b){var y=i(b),q=y==o?b.constructor:void 0,w=q?s(q):"";if(w)switch(w){case v:return l;case m:return u;case g:return c;case h:return f;case p:return d}return y}),Qn=_,Qn}var et,Ko;function bv(){if(Ko)return et;Ko=1;var e=Object.prototype,a=e.hasOwnProperty;function t(n){var r=n.length,i=new n.constructor(r);return r&&typeof n[0]=="string"&&a.call(n,"index")&&(i.index=n.index,i.input=n.input),i}return et=t,et}var rt,Yo;function Wo(){if(Yo)return rt;Yo=1;var e=ne(),a=e.Uint8Array;return rt=a,rt}var nt,$o;function tt(){if($o)return nt;$o=1;var e=Wo();function a(t){var n=new t.constructor(t.byteLength);return new e(n).set(new e(t)),n}return nt=a,nt}var at,Xo;function gv(){if(Xo)return at;Xo=1;var e=tt();function a(t,n){var r=n?e(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}return at=a,at}var it,Jo;function yv(){if(Jo)return it;Jo=1;var e=/\w*$/;function a(t){var n=new t.constructor(t.source,e.exec(t));return n.lastIndex=t.lastIndex,n}return it=a,it}var ut,Zo;function mv(){if(Zo)return ut;Zo=1;var e=me(),a=e?e.prototype:void 0,t=a?a.valueOf:void 0;function n(r){return t?Object(t.call(r)):{}}return ut=n,ut}var st,Qo;function ef(){if(Qo)return st;Qo=1;var e=tt();function a(t,n){var r=n?e(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}return st=a,st}var ot,rf;function qv(){if(rf)return ot;rf=1;var e=tt(),a=gv(),t=yv(),n=mv(),r=ef(),i="[object Boolean]",s="[object Date]",u="[object Map]",o="[object Number]",c="[object RegExp]",f="[object Set]",d="[object String]",l="[object Symbol]",v="[object ArrayBuffer]",m="[object DataView]",g="[object Float32Array]",h="[object Float64Array]",p="[object Int8Array]",_="[object Int16Array]",b="[object Int32Array]",y="[object Uint8Array]",q="[object Uint8ClampedArray]",w="[object Uint16Array]",E="[object Uint32Array]";function C(S,x,I){var k=S.constructor;switch(x){case v:return e(S);case i:case s:return new k(+S);case m:return a(S,I);case g:case h:case p:case _:case b:case y:case q:case w:case E:return r(S,I);case u:return new k;case o:case d:return new k(S);case c:return t(S);case f:return new k;case l:return n(S)}}return ot=C,ot}var ft,nf;function tf(){if(nf)return ft;nf=1;var e=ee(),a=Object.create,t=(function(){function n(){}return function(r){if(!e(r))return{};if(a)return a(r);n.prototype=r;var i=new n;return n.prototype=void 0,i}})();return ft=t,ft}var ct,af;function uf(){if(af)return ct;af=1;var e=tf(),a=Je(),t=Xe();function n(r){return typeof r.constructor=="function"&&!t(r)?e(a(r)):{}}return ct=n,ct}var dt,sf;function wv(){if(sf)return dt;sf=1;var e=we(),a=ae(),t="[object Map]";function n(r){return a(r)&&e(r)==t}return dt=n,dt}var lt,of;function Rv(){if(of)return lt;of=1;var e=wv(),a=$e(),t=mn(),n=t&&t.isMap,r=n?a(n):e;return lt=r,lt}var ht,ff;function Ev(){if(ff)return ht;ff=1;var e=we(),a=ae(),t="[object Set]";function n(r){return a(r)&&e(r)==t}return ht=n,ht}var vt,cf;function Tv(){if(cf)return vt;cf=1;var e=Ev(),a=$e(),t=mn(),n=t&&t.isSet,r=n?a(n):e;return vt=r,vt}var pt,df;function lf(){if(df)return pt;df=1;var e=He(),a=tn(),t=Ye(),n=sv(),r=cv(),i=qo(),s=Ro(),u=dv(),o=lv(),c=Fo(),f=hv(),d=we(),l=bv(),v=qv(),m=uf(),g=Y(),h=qe(),p=Rv(),_=ee(),b=Tv(),y=ce(),q=pe(),w=1,E=2,C=4,S="[object Arguments]",x="[object Array]",I="[object Boolean]",k="[object Date]",M="[object Error]",j="[object Function]",F="[object GeneratorFunction]",K="[object Map]",fe="[object Number]",ie="[object Object]",Ee="[object RegExp]",Te="[object Set]",T="[object String]",N="[object Symbol]",B="[object WeakMap]",R="[object ArrayBuffer]",A="[object DataView]",O="[object Float32Array]",P="[object Float64Array]",L="[object Int8Array]",U="[object Int16Array]",H="[object Int32Array]",J="[object Uint8Array]",ir="[object Uint8ClampedArray]",Z="[object Uint16Array]",$="[object Uint32Array]",D={};D[S]=D[x]=D[R]=D[A]=D[I]=D[k]=D[O]=D[P]=D[L]=D[U]=D[H]=D[K]=D[fe]=D[ie]=D[Ee]=D[Te]=D[T]=D[N]=D[J]=D[ir]=D[Z]=D[$]=!0,D[M]=D[j]=D[B]=!1;function be(G,Se,Ae,W_,ur,de){var Q,sr=Se&w,or=Se&E,$_=Se&C;if(Ae&&(Q=ur?Ae(G,W_,ur,de):Ae(G)),Q!==void 0)return Q;if(!_(G))return G;var bh=g(G);if(bh){if(Q=l(G),!sr)return s(G,Q)}else{var Ie=d(G),gh=Ie==j||Ie==F;if(h(G))return i(G,sr);if(Ie==ie||Ie==S||gh&&!ur){if(Q=or||gh?{}:m(G),!sr)return or?o(G,r(Q,G)):u(G,n(Q,G))}else{if(!D[Ie])return ur?G:{};Q=v(G,Ie,sr)}}de||(de=new e);var yh=de.get(G);if(yh)return yh;de.set(G,Q),b(G)?G.forEach(function(le){Q.add(be(le,Se,Ae,le,G,de))}):p(G)&&G.forEach(function(le,ge){Q.set(ge,be(le,Se,Ae,ge,G,de))});var X_=$_?or?f:c:or?q:y,mh=bh?void 0:X_(G);return a(mh||G,function(le,ge){mh&&(ge=le,le=G[ge]),t(Q,ge,be(le,Se,Ae,ge,G,de))}),Q}return pt=be,pt}var _t,hf;function Sv(){if(hf)return _t;hf=1;var e=lf(),a=4;function t(n){return e(n,a)}return _t=t,_t}var bt,vf;function gt(){if(vf)return bt;vf=1;function e(a){return function(){return a}}return bt=e,bt}var yt,pf;function Av(){if(pf)return yt;pf=1;function e(a){return function(t,n,r){for(var i=-1,s=Object(t),u=r(t),o=u.length;o--;){var c=u[a?o:++i];if(n(s[c],c,s)===!1)break}return t}}return yt=e,yt}var mt,_f;function qt(){if(_f)return mt;_f=1;var e=Av(),a=e();return mt=a,mt}var wt,bf;function Rt(){if(bf)return wt;bf=1;var e=qt(),a=ce();function t(n,r){return n&&e(n,r,a)}return wt=t,wt}var Et,gf;function Iv(){if(gf)return Et;gf=1;var e=se();function a(t,n){return function(r,i){if(r==null)return r;if(!e(r))return t(r,i);for(var s=r.length,u=n?s:-1,o=Object(r);(n?u--:++u<s)&&i(o[u],u,o)!==!1;);return r}}return Et=a,Et}var Tt,yf;function Ze(){if(yf)return Tt;yf=1;var e=Rt(),a=Iv(),t=a(e);return Tt=t,Tt}var St,mf;function _e(){if(mf)return St;mf=1;function e(a){return a}return St=e,St}var At,qf;function wf(){if(qf)return At;qf=1;var e=_e();function a(t){return typeof t=="function"?t:e}return At=a,At}var It,Rf;function Ef(){if(Rf)return It;Rf=1;var e=tn(),a=Ze(),t=wf(),n=Y();function r(i,s){var u=n(i)?e:a;return u(i,t(s))}return It=r,It}var Ct,Tf;function Sf(){return Tf||(Tf=1,Ct=Ef()),Ct}var xt,Af;function Cv(){if(Af)return xt;Af=1;var e=Ze();function a(t,n){var r=[];return e(t,function(i,s,u){n(i,s,u)&&r.push(i)}),r}return xt=a,xt}var Ot,If;function xv(){if(If)return Ot;If=1;var e="__lodash_hash_undefined__";function a(t){return this.__data__.set(t,e),this}return Ot=a,Ot}var Pt,Cf;function Ov(){if(Cf)return Pt;Cf=1;function e(a){return this.__data__.has(a)}return Pt=e,Pt}var kt,xf;function Of(){if(xf)return kt;xf=1;var e=Qr(),a=xv(),t=Ov();function n(r){var i=-1,s=r==null?0:r.length;for(this.__data__=new e;++i<s;)this.add(r[i])}return n.prototype.add=n.prototype.push=a,n.prototype.has=t,kt=n,kt}var Mt,Pf;function Pv(){if(Pf)return Mt;Pf=1;function e(a,t){for(var n=-1,r=a==null?0:a.length;++n<r;)if(t(a[n],n,a))return!0;return!1}return Mt=e,Mt}var Nt,kf;function Mf(){if(kf)return Nt;kf=1;function e(a,t){return a.has(t)}return Nt=e,Nt}var Lt,Nf;function Lf(){if(Nf)return Lt;Nf=1;var e=Of(),a=Pv(),t=Mf(),n=1,r=2;function i(s,u,o,c,f,d){var l=o&n,v=s.length,m=u.length;if(v!=m&&!(l&&m>v))return!1;var g=d.get(s),h=d.get(u);if(g&&h)return g==u&&h==s;var p=-1,_=!0,b=o&r?new e:void 0;for(d.set(s,u),d.set(u,s);++p<v;){var y=s[p],q=u[p];if(c)var w=l?c(q,y,p,u,s,d):c(y,q,p,s,u,d);if(w!==void 0){if(w)continue;_=!1;break}if(b){if(!a(u,function(E,C){if(!t(b,C)&&(y===E||f(y,E,o,c,d)))return b.push(C)})){_=!1;break}}else if(!(y===q||f(y,q,o,c,d))){_=!1;break}}return d.delete(s),d.delete(u),_}return Lt=i,Lt}var jt,jf;function kv(){if(jf)return jt;jf=1;function e(a){var t=-1,n=Array(a.size);return a.forEach(function(r,i){n[++t]=[i,r]}),n}return jt=e,jt}var Ft,Ff;function Dt(){if(Ff)return Ft;Ff=1;function e(a){var t=-1,n=Array(a.size);return a.forEach(function(r){n[++t]=r}),n}return Ft=e,Ft}var Gt,Df;function Mv(){if(Df)return Gt;Df=1;var e=me(),a=Wo(),t=ye(),n=Lf(),r=kv(),i=Dt(),s=1,u=2,o="[object Boolean]",c="[object Date]",f="[object Error]",d="[object Map]",l="[object Number]",v="[object RegExp]",m="[object Set]",g="[object String]",h="[object Symbol]",p="[object ArrayBuffer]",_="[object DataView]",b=e?e.prototype:void 0,y=b?b.valueOf:void 0;function q(w,E,C,S,x,I,k){switch(C){case _:if(w.byteLength!=E.byteLength||w.byteOffset!=E.byteOffset)return!1;w=w.buffer,E=E.buffer;case p:return!(w.byteLength!=E.byteLength||!I(new a(w),new a(E)));case o:case c:case l:return t(+w,+E);case f:return w.name==E.name&&w.message==E.message;case v:case g:return w==E+"";case d:var M=r;case m:var j=S&s;if(M||(M=i),w.size!=E.size&&!j)return!1;var F=k.get(w);if(F)return F==E;S|=u,k.set(w,E);var K=n(M(w),M(E),S,x,I,k);return k.delete(w),K;case h:if(y)return y.call(w)==y.call(E)}return!1}return Gt=q,Gt}var Bt,Gf;function Nv(){if(Gf)return Bt;Gf=1;var e=Fo(),a=1,t=Object.prototype,n=t.hasOwnProperty;function r(i,s,u,o,c,f){var d=u&a,l=e(i),v=l.length,m=e(s),g=m.length;if(v!=g&&!d)return!1;for(var h=v;h--;){var p=l[h];if(!(d?p in s:n.call(s,p)))return!1}var _=f.get(i),b=f.get(s);if(_&&b)return _==s&&b==i;var y=!0;f.set(i,s),f.set(s,i);for(var q=d;++h<v;){p=l[h];var w=i[p],E=s[p];if(o)var C=d?o(E,w,p,s,i,f):o(w,E,p,i,s,f);if(!(C===void 0?w===E||c(w,E,u,o,f):C)){y=!1;break}q||(q=p=="constructor")}if(y&&!q){var S=i.constructor,x=s.constructor;S!=x&&"constructor"in i&&"constructor"in s&&!(typeof S=="function"&&S instanceof S&&typeof x=="function"&&x instanceof x)&&(y=!1)}return f.delete(i),f.delete(s),y}return Bt=r,Bt}var Ut,Bf;function Lv(){if(Bf)return Ut;Bf=1;var e=He(),a=Lf(),t=Mv(),n=Nv(),r=we(),i=Y(),s=qe(),u=Le(),o=1,c="[object Arguments]",f="[object Array]",d="[object Object]",l=Object.prototype,v=l.hasOwnProperty;function m(g,h,p,_,b,y){var q=i(g),w=i(h),E=q?f:r(g),C=w?f:r(h);E=E==c?d:E,C=C==c?d:C;var S=E==d,x=C==d,I=E==C;if(I&&s(g)){if(!s(h))return!1;q=!0,S=!1}if(I&&!S)return y||(y=new e),q||u(g)?a(g,h,p,_,b,y):t(g,h,E,p,_,b,y);if(!(p&o)){var k=S&&v.call(g,"__wrapped__"),M=x&&v.call(h,"__wrapped__");if(k||M){var j=k?g.value():g,F=M?h.value():h;return y||(y=new e),b(j,F,p,_,y)}}return I?(y||(y=new e),n(g,h,p,_,b,y)):!1}return Ut=m,Ut}var Vt,Uf;function Vf(){if(Uf)return Vt;Uf=1;var e=Lv(),a=ae();function t(n,r,i,s,u){return n===r?!0:n==null||r==null||!a(n)&&!a(r)?n!==n&&r!==r:e(n,r,i,s,t,u)}return Vt=t,Vt}var zt,zf;function jv(){if(zf)return zt;zf=1;var e=He(),a=Vf(),t=1,n=2;function r(i,s,u,o){var c=u.length,f=c,d=!o;if(i==null)return!f;for(i=Object(i);c--;){var l=u[c];if(d&&l[2]?l[1]!==i[l[0]]:!(l[0]in i))return!1}for(;++c<f;){l=u[c];var v=l[0],m=i[v],g=l[1];if(d&&l[2]){if(m===void 0&&!(v in i))return!1}else{var h=new e;if(o)var p=o(m,g,v,i,s,h);if(!(p===void 0?a(g,m,t|n,o,h):p))return!1}}return!0}return zt=r,zt}var Ht,Hf;function Kf(){if(Hf)return Ht;Hf=1;var e=ee();function a(t){return t===t&&!e(t)}return Ht=a,Ht}var Kt,Yf;function Fv(){if(Yf)return Kt;Yf=1;var e=Kf(),a=ce();function t(n){for(var r=a(n),i=r.length;i--;){var s=r[i],u=n[s];r[i]=[s,u,e(u)]}return r}return Kt=t,Kt}var Yt,Wf;function $f(){if(Wf)return Yt;Wf=1;function e(a,t){return function(n){return n==null?!1:n[a]===t&&(t!==void 0||a in Object(n))}}return Yt=e,Yt}var Wt,Xf;function Dv(){if(Xf)return Wt;Xf=1;var e=jv(),a=Fv(),t=$f();function n(r){var i=a(r);return i.length==1&&i[0][2]?t(i[0][0],i[0][1]):function(s){return s===r||e(s,r,i)}}return Wt=n,Wt}var $t,Jf;function Re(){if(Jf)return $t;Jf=1;var e=he(),a=ae(),t="[object Symbol]";function n(r){return typeof r=="symbol"||a(r)&&e(r)==t}return $t=n,$t}var Xt,Zf;function Jt(){if(Zf)return Xt;Zf=1;var e=Y(),a=Re(),t=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,n=/^\w*$/;function r(i,s){if(e(i))return!1;var u=typeof i;return u=="number"||u=="symbol"||u=="boolean"||i==null||a(i)?!0:n.test(i)||!t.test(i)||s!=null&&i in Object(s)}return Xt=r,Xt}var Zt,Qf;function Gv(){if(Qf)return Zt;Qf=1;var e=Qr(),a="Expected a function";function t(n,r){if(typeof n!="function"||r!=null&&typeof r!="function")throw new TypeError(a);var i=function(){var s=arguments,u=r?r.apply(this,s):s[0],o=i.cache;if(o.has(u))return o.get(u);var c=n.apply(this,s);return i.cache=o.set(u,c)||o,c};return i.cache=new(t.Cache||e),i}return t.Cache=e,Zt=t,Zt}var Qt,ec;function Bv(){if(ec)return Qt;ec=1;var e=Gv(),a=500;function t(n){var r=e(n,function(s){return i.size===a&&i.clear(),s}),i=r.cache;return r}return Qt=t,Qt}var ea,rc;function Uv(){if(rc)return ea;rc=1;var e=Bv(),a=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,t=/\\(\\)?/g,n=e(function(r){var i=[];return r.charCodeAt(0)===46&&i.push(""),r.replace(a,function(s,u,o,c){i.push(o?c.replace(t,"$1"):u||s)}),i});return ea=n,ea}var ra,nc;function Qe(){if(nc)return ra;nc=1;function e(a,t){for(var n=-1,r=a==null?0:a.length,i=Array(r);++n<r;)i[n]=t(a[n],n,a);return i}return ra=e,ra}var na,tc;function Vv(){if(tc)return na;tc=1;var e=me(),a=Qe(),t=Y(),n=Re(),r=e?e.prototype:void 0,i=r?r.toString:void 0;function s(u){if(typeof u=="string")return u;if(t(u))return a(u,s)+"";if(n(u))return i?i.call(u):"";var o=u+"";return o=="0"&&1/u==-1/0?"-0":o}return na=s,na}var ta,ac;function ic(){if(ac)return ta;ac=1;var e=Vv();function a(t){return t==null?"":e(t)}return ta=a,ta}var aa,uc;function er(){if(uc)return aa;uc=1;var e=Y(),a=Jt(),t=Uv(),n=ic();function r(i,s){return e(i)?i:a(i,s)?[i]:t(n(i))}return aa=r,aa}var ia,sc;function Fe(){if(sc)return ia;sc=1;var e=Re();function a(t){if(typeof t=="string"||e(t))return t;var n=t+"";return n=="0"&&1/t==-1/0?"-0":n}return ia=a,ia}var ua,oc;function rr(){if(oc)return ua;oc=1;var e=er(),a=Fe();function t(n,r){r=e(r,n);for(var i=0,s=r.length;n!=null&&i<s;)n=n[a(r[i++])];return i&&i==s?n:void 0}return ua=t,ua}var sa,fc;function zv(){if(fc)return sa;fc=1;var e=rr();function a(t,n,r){var i=t==null?void 0:e(t,n);return i===void 0?r:i}return sa=a,sa}var oa,cc;function Hv(){if(cc)return oa;cc=1;function e(a,t){return a!=null&&t in Object(a)}return oa=e,oa}var fa,dc;function lc(){if(dc)return fa;dc=1;var e=er(),a=ke(),t=Y(),n=We(),r=bn(),i=Fe();function s(u,o,c){o=e(o,u);for(var f=-1,d=o.length,l=!1;++f<d;){var v=i(o[f]);if(!(l=u!=null&&c(u,v)))break;u=u[v]}return l||++f!=d?l:(d=u==null?0:u.length,!!d&&r(d)&&n(v,d)&&(t(u)||a(u)))}return fa=s,fa}var ca,hc;function vc(){if(hc)return ca;hc=1;var e=Hv(),a=lc();function t(n,r){return n!=null&&a(n,r,e)}return ca=t,ca}var da,pc;function Kv(){if(pc)return da;pc=1;var e=Vf(),a=zv(),t=vc(),n=Jt(),r=Kf(),i=$f(),s=Fe(),u=1,o=2;function c(f,d){return n(f)&&r(d)?i(s(f),d):function(l){var v=a(l,f);return v===void 0&&v===d?t(l,f):e(d,v,u|o)}}return da=c,da}var la,_c;function bc(){if(_c)return la;_c=1;function e(a){return function(t){return t?.[a]}}return la=e,la}var ha,gc;function Yv(){if(gc)return ha;gc=1;var e=rr();function a(t){return function(n){return e(n,t)}}return ha=a,ha}var va,yc;function Wv(){if(yc)return va;yc=1;var e=bc(),a=Yv(),t=Jt(),n=Fe();function r(i){return t(i)?e(n(i)):a(i)}return va=r,va}var pa,mc;function oe(){if(mc)return pa;mc=1;var e=Dv(),a=Kv(),t=_e(),n=Y(),r=Wv();function i(s){return typeof s=="function"?s:s==null?t:typeof s=="object"?n(s)?a(s[0],s[1]):e(s):r(s)}return pa=i,pa}var _a,qc;function wc(){if(qc)return _a;qc=1;var e=To(),a=Cv(),t=oe(),n=Y();function r(i,s){var u=n(i)?e:a;return u(i,t(s,3))}return _a=r,_a}var ba,Rc;function $v(){if(Rc)return ba;Rc=1;var e=Object.prototype,a=e.hasOwnProperty;function t(n,r){return n!=null&&a.call(n,r)}return ba=t,ba}var ga,Ec;function Tc(){if(Ec)return ga;Ec=1;var e=$v(),a=lc();function t(n,r){return n!=null&&a(n,r,e)}return ga=t,ga}var ya,Sc;function Xv(){if(Sc)return ya;Sc=1;var e=An(),a=we(),t=ke(),n=Y(),r=se(),i=qe(),s=Xe(),u=Le(),o="[object Map]",c="[object Set]",f=Object.prototype,d=f.hasOwnProperty;function l(v){if(v==null)return!0;if(r(v)&&(n(v)||typeof v=="string"||typeof v.splice=="function"||i(v)||u(v)||t(v)))return!v.length;var m=a(v);if(m==o||m==c)return!v.size;if(s(v))return!e(v).length;for(var g in v)if(d.call(v,g))return!1;return!0}return ya=l,ya}var ma,Ac;function Ic(){if(Ac)return ma;Ac=1;function e(a){return a===void 0}return ma=e,ma}var qa,Cc;function xc(){if(Cc)return qa;Cc=1;var e=Ze(),a=se();function t(n,r){var i=-1,s=a(n)?Array(n.length):[];return e(n,function(u,o,c){s[++i]=r(u,o,c)}),s}return qa=t,qa}var wa,Oc;function Pc(){if(Oc)return wa;Oc=1;var e=Qe(),a=oe(),t=xc(),n=Y();function r(i,s){var u=n(i)?e:t;return u(i,a(s,3))}return wa=r,wa}var Ra,kc;function Jv(){if(kc)return Ra;kc=1;function e(a,t,n,r){var i=-1,s=a==null?0:a.length;for(r&&s&&(n=a[++i]);++i<s;)n=t(n,a[i],i,a);return n}return Ra=e,Ra}var Ea,Mc;function Zv(){if(Mc)return Ea;Mc=1;function e(a,t,n,r,i){return i(a,function(s,u,o){n=r?(r=!1,s):t(n,s,u,o)}),n}return Ea=e,Ea}var Ta,Nc;function Lc(){if(Nc)return Ta;Nc=1;var e=Jv(),a=Ze(),t=oe(),n=Zv(),r=Y();function i(s,u,o){var c=r(s)?e:n,f=arguments.length<3;return c(s,t(u,4),o,f,a)}return Ta=i,Ta}var Sa,jc;function Qv(){if(jc)return Sa;jc=1;var e=he(),a=Y(),t=ae(),n="[object String]";function r(i){return typeof i=="string"||!a(i)&&t(i)&&e(i)==n}return Sa=r,Sa}var Aa,Fc;function ep(){if(Fc)return Aa;Fc=1;var e=bc(),a=e("length");return Aa=a,Aa}var Ia,Dc;function rp(){if(Dc)return Ia;Dc=1;var e="\\ud800-\\udfff",a="\\u0300-\\u036f",t="\\ufe20-\\ufe2f",n="\\u20d0-\\u20ff",r=a+t+n,i="\\ufe0e\\ufe0f",s="\\u200d",u=RegExp("["+s+e+r+i+"]");function o(c){return u.test(c)}return Ia=o,Ia}var Ca,Gc;function np(){if(Gc)return Ca;Gc=1;var e="\\ud800-\\udfff",a="\\u0300-\\u036f",t="\\ufe20-\\ufe2f",n="\\u20d0-\\u20ff",r=a+t+n,i="\\ufe0e\\ufe0f",s="["+e+"]",u="["+r+"]",o="\\ud83c[\\udffb-\\udfff]",c="(?:"+u+"|"+o+")",f="[^"+e+"]",d="(?:\\ud83c[\\udde6-\\uddff]){2}",l="[\\ud800-\\udbff][\\udc00-\\udfff]",v="\\u200d",m=c+"?",g="["+i+"]?",h="(?:"+v+"(?:"+[f,d,l].join("|")+")"+g+m+")*",p=g+m+h,_="(?:"+[f+u+"?",u,d,l,s].join("|")+")",b=RegExp(o+"(?="+o+")|"+_+p,"g");function y(q){for(var w=b.lastIndex=0;b.test(q);)++w;return w}return Ca=y,Ca}var xa,Bc;function tp(){if(Bc)return xa;Bc=1;var e=ep(),a=rp(),t=np();function n(r){return a(r)?t(r):e(r)}return xa=n,xa}var Oa,Uc;function ap(){if(Uc)return Oa;Uc=1;var e=An(),a=we(),t=se(),n=Qv(),r=tp(),i="[object Map]",s="[object Set]";function u(o){if(o==null)return 0;if(t(o))return n(o)?r(o):o.length;var c=a(o);return c==i||c==s?o.size:e(o).length}return Oa=u,Oa}var Pa,Vc;function ip(){if(Vc)return Pa;Vc=1;var e=tn(),a=tf(),t=Rt(),n=oe(),r=Je(),i=Y(),s=qe(),u=Oe(),o=ee(),c=Le();function f(d,l,v){var m=i(d),g=m||s(d)||c(d);if(l=n(l,4),v==null){var h=d&&d.constructor;g?v=m?new h:[]:o(d)?v=u(h)?a(r(d)):{}:v={}}return(g?e:t)(d,function(p,_,b){return l(v,p,_,b)}),v}return Pa=f,Pa}var ka,zc;function up(){if(zc)return ka;zc=1;var e=me(),a=ke(),t=Y(),n=e?e.isConcatSpreadable:void 0;function r(i){return t(i)||a(i)||!!(n&&i&&i[n])}return ka=r,ka}var Ma,Hc;function Na(){if(Hc)return Ma;Hc=1;var e=Un(),a=up();function t(n,r,i,s,u){var o=-1,c=n.length;for(i||(i=a),u||(u=[]);++o<c;){var f=n[o];r>0&&i(f)?r>1?t(f,r-1,i,s,u):e(u,f):s||(u[u.length]=f)}return u}return Ma=t,Ma}var La,Kc;function sp(){if(Kc)return La;Kc=1;function e(a,t,n){switch(n.length){case 0:return a.call(t);case 1:return a.call(t,n[0]);case 2:return a.call(t,n[0],n[1]);case 3:return a.call(t,n[0],n[1],n[2])}return a.apply(t,n)}return La=e,La}var ja,Yc;function Wc(){if(Yc)return ja;Yc=1;var e=sp(),a=Math.max;function t(n,r,i){return r=a(r===void 0?n.length-1:r,0),function(){for(var s=arguments,u=-1,o=a(s.length-r,0),c=Array(o);++u<o;)c[u]=s[r+u];u=-1;for(var f=Array(r+1);++u<r;)f[u]=s[u];return f[r]=i(c),e(n,this,f)}}return ja=t,ja}var Fa,$c;function op(){if($c)return Fa;$c=1;var e=gt(),a=Us(),t=_e(),n=a?function(r,i){return a(r,"toString",{configurable:!0,enumerable:!1,value:e(i),writable:!0})}:t;return Fa=n,Fa}var Da,Xc;function fp(){if(Xc)return Da;Xc=1;var e=800,a=16,t=Date.now;function n(r){var i=0,s=0;return function(){var u=t(),o=a-(u-s);if(s=u,o>0){if(++i>=e)return arguments[0]}else i=0;return r.apply(void 0,arguments)}}return Da=n,Da}var Ga,Jc;function Zc(){if(Jc)return Ga;Jc=1;var e=op(),a=fp(),t=a(e);return Ga=t,Ga}var Ba,Qc;function nr(){if(Qc)return Ba;Qc=1;var e=_e(),a=Wc(),t=Zc();function n(r,i){return t(a(r,i,e),r+"")}return Ba=n,Ba}var Ua,ed;function rd(){if(ed)return Ua;ed=1;function e(a,t,n,r){for(var i=a.length,s=n+(r?1:-1);r?s--:++s<i;)if(t(a[s],s,a))return s;return-1}return Ua=e,Ua}var Va,nd;function cp(){if(nd)return Va;nd=1;function e(a){return a!==a}return Va=e,Va}var za,td;function dp(){if(td)return za;td=1;function e(a,t,n){for(var r=n-1,i=a.length;++r<i;)if(a[r]===t)return r;return-1}return za=e,za}var Ha,ad;function lp(){if(ad)return Ha;ad=1;var e=rd(),a=cp(),t=dp();function n(r,i,s){return i===i?t(r,i,s):e(r,a,s)}return Ha=n,Ha}var Ka,id;function hp(){if(id)return Ka;id=1;var e=lp();function a(t,n){var r=t==null?0:t.length;return!!r&&e(t,n,0)>-1}return Ka=a,Ka}var Ya,ud;function vp(){if(ud)return Ya;ud=1;function e(a,t,n){for(var r=-1,i=a==null?0:a.length;++r<i;)if(n(t,a[r]))return!0;return!1}return Ya=e,Ya}var Wa,sd;function pp(){if(sd)return Wa;sd=1;function e(){}return Wa=e,Wa}var $a,od;function _p(){if(od)return $a;od=1;var e=Vo(),a=pp(),t=Dt(),n=1/0,r=e&&1/t(new e([,-0]))[1]==n?function(i){return new e(i)}:a;return $a=r,$a}var Xa,fd;function bp(){if(fd)return Xa;fd=1;var e=Of(),a=hp(),t=vp(),n=Mf(),r=_p(),i=Dt(),s=200;function u(o,c,f){var d=-1,l=a,v=o.length,m=!0,g=[],h=g;if(f)m=!1,l=t;else if(v>=s){var p=c?null:r(o);if(p)return i(p);m=!1,l=n,h=new e}else h=c?[]:g;e:for(;++d<v;){var _=o[d],b=c?c(_):_;if(_=f||_!==0?_:0,m&&b===b){for(var y=h.length;y--;)if(h[y]===b)continue e;c&&h.push(b),g.push(_)}else l(h,b,f)||(h!==g&&h.push(b),g.push(_))}return g}return Xa=u,Xa}var Ja,cd;function dd(){if(cd)return Ja;cd=1;var e=se(),a=ae();function t(n){return a(n)&&e(n)}return Ja=t,Ja}var Za,ld;function gp(){if(ld)return Za;ld=1;var e=Na(),a=nr(),t=bp(),n=dd(),r=a(function(i){return t(e(i,1,n,!0))});return Za=r,Za}var Qa,hd;function yp(){if(hd)return Qa;hd=1;var e=Qe();function a(t,n){return e(n,function(r){return t[r]})}return Qa=a,Qa}var ei,vd;function pd(){if(vd)return ei;vd=1;var e=yp(),a=ce();function t(n){return n==null?[]:e(n,a(n))}return ei=t,ei}var ri,_d;function re(){if(_d)return ri;_d=1;var e;if(typeof fr=="function")try{e={clone:Sv(),constant:gt(),each:Sf(),filter:wc(),has:Tc(),isArray:Y(),isEmpty:Xv(),isFunction:Oe(),isUndefined:Ic(),keys:ce(),map:Pc(),reduce:Lc(),size:ap(),transform:ip(),union:gp(),values:pd()}}catch{}return e||(e=window._),ri=e,ri}var ni,bd;function ti(){if(bd)return ni;bd=1;var e=re();ni=r;var a="\0",t="\0",n="";function r(f){this._isDirected=e.has(f,"directed")?f.directed:!0,this._isMultigraph=e.has(f,"multigraph")?f.multigraph:!1,this._isCompound=e.has(f,"compound")?f.compound:!1,this._label=void 0,this._defaultNodeLabelFn=e.constant(void 0),this._defaultEdgeLabelFn=e.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={}}r.prototype._nodeCount=0,r.prototype._edgeCount=0,r.prototype.isDirected=function(){return this._isDirected},r.prototype.isMultigraph=function(){return this._isMultigraph},r.prototype.isCompound=function(){return this._isCompound},r.prototype.setGraph=function(f){return this._label=f,this},r.prototype.graph=function(){return this._label},r.prototype.setDefaultNodeLabel=function(f){return e.isFunction(f)||(f=e.constant(f)),this._defaultNodeLabelFn=f,this},r.prototype.nodeCount=function(){return this._nodeCount},r.prototype.nodes=function(){return e.keys(this._nodes)},r.prototype.sources=function(){var f=this;return e.filter(this.nodes(),function(d){return e.isEmpty(f._in[d])})},r.prototype.sinks=function(){var f=this;return e.filter(this.nodes(),function(d){return e.isEmpty(f._out[d])})},r.prototype.setNodes=function(f,d){var l=arguments,v=this;return e.each(f,function(m){l.length>1?v.setNode(m,d):v.setNode(m)}),this},r.prototype.setNode=function(f,d){return e.has(this._nodes,f)?(arguments.length>1&&(this._nodes[f]=d),this):(this._nodes[f]=arguments.length>1?d:this._defaultNodeLabelFn(f),this._isCompound&&(this._parent[f]=t,this._children[f]={},this._children[t][f]=!0),this._in[f]={},this._preds[f]={},this._out[f]={},this._sucs[f]={},++this._nodeCount,this)},r.prototype.node=function(f){return this._nodes[f]},r.prototype.hasNode=function(f){return e.has(this._nodes,f)},r.prototype.removeNode=function(f){var d=this;if(e.has(this._nodes,f)){var l=function(v){d.removeEdge(d._edgeObjs[v])};delete this._nodes[f],this._isCompound&&(this._removeFromParentsChildList(f),delete this._parent[f],e.each(this.children(f),function(v){d.setParent(v)}),delete this._children[f]),e.each(e.keys(this._in[f]),l),delete this._in[f],delete this._preds[f],e.each(e.keys(this._out[f]),l),delete this._out[f],delete this._sucs[f],--this._nodeCount}return this},r.prototype.setParent=function(f,d){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(e.isUndefined(d))d=t;else{d+="";for(var l=d;!e.isUndefined(l);l=this.parent(l))if(l===f)throw new Error("Setting "+d+" as parent of "+f+" would create a cycle");this.setNode(d)}return this.setNode(f),this._removeFromParentsChildList(f),this._parent[f]=d,this._children[d][f]=!0,this},r.prototype._removeFromParentsChildList=function(f){delete this._children[this._parent[f]][f]},r.prototype.parent=function(f){if(this._isCompound){var d=this._parent[f];if(d!==t)return d}},r.prototype.children=function(f){if(e.isUndefined(f)&&(f=t),this._isCompound){var d=this._children[f];if(d)return e.keys(d)}else{if(f===t)return this.nodes();if(this.hasNode(f))return[]}},r.prototype.predecessors=function(f){var d=this._preds[f];if(d)return e.keys(d)},r.prototype.successors=function(f){var d=this._sucs[f];if(d)return e.keys(d)},r.prototype.neighbors=function(f){var d=this.predecessors(f);if(d)return e.union(d,this.successors(f))},r.prototype.isLeaf=function(f){var d;return this.isDirected()?d=this.successors(f):d=this.neighbors(f),d.length===0},r.prototype.filterNodes=function(f){var d=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});d.setGraph(this.graph());var l=this;e.each(this._nodes,function(g,h){f(h)&&d.setNode(h,g)}),e.each(this._edgeObjs,function(g){d.hasNode(g.v)&&d.hasNode(g.w)&&d.setEdge(g,l.edge(g))});var v={};function m(g){var h=l.parent(g);return h===void 0||d.hasNode(h)?(v[g]=h,h):h in v?v[h]:m(h)}return this._isCompound&&e.each(d.nodes(),function(g){d.setParent(g,m(g))}),d},r.prototype.setDefaultEdgeLabel=function(f){return e.isFunction(f)||(f=e.constant(f)),this._defaultEdgeLabelFn=f,this},r.prototype.edgeCount=function(){return this._edgeCount},r.prototype.edges=function(){return e.values(this._edgeObjs)},r.prototype.setPath=function(f,d){var l=this,v=arguments;return e.reduce(f,function(m,g){return v.length>1?l.setEdge(m,g,d):l.setEdge(m,g),g}),this},r.prototype.setEdge=function(){var f,d,l,v,m=!1,g=arguments[0];typeof g=="object"&&g!==null&&"v"in g?(f=g.v,d=g.w,l=g.name,arguments.length===2&&(v=arguments[1],m=!0)):(f=g,d=arguments[1],l=arguments[3],arguments.length>2&&(v=arguments[2],m=!0)),f=""+f,d=""+d,e.isUndefined(l)||(l=""+l);var h=u(this._isDirected,f,d,l);if(e.has(this._edgeLabels,h))return m&&(this._edgeLabels[h]=v),this;if(!e.isUndefined(l)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(f),this.setNode(d),this._edgeLabels[h]=m?v:this._defaultEdgeLabelFn(f,d,l);var p=o(this._isDirected,f,d,l);return f=p.v,d=p.w,Object.freeze(p),this._edgeObjs[h]=p,i(this._preds[d],f),i(this._sucs[f],d),this._in[d][h]=p,this._out[f][h]=p,this._edgeCount++,this},r.prototype.edge=function(f,d,l){var v=arguments.length===1?c(this._isDirected,arguments[0]):u(this._isDirected,f,d,l);return this._edgeLabels[v]},r.prototype.hasEdge=function(f,d,l){var v=arguments.length===1?c(this._isDirected,arguments[0]):u(this._isDirected,f,d,l);return e.has(this._edgeLabels,v)},r.prototype.removeEdge=function(f,d,l){var v=arguments.length===1?c(this._isDirected,arguments[0]):u(this._isDirected,f,d,l),m=this._edgeObjs[v];return m&&(f=m.v,d=m.w,delete this._edgeLabels[v],delete this._edgeObjs[v],s(this._preds[d],f),s(this._sucs[f],d),delete this._in[d][v],delete this._out[f][v],this._edgeCount--),this},r.prototype.inEdges=function(f,d){var l=this._in[f];if(l){var v=e.values(l);return d?e.filter(v,function(m){return m.v===d}):v}},r.prototype.outEdges=function(f,d){var l=this._out[f];if(l){var v=e.values(l);return d?e.filter(v,function(m){return m.w===d}):v}},r.prototype.nodeEdges=function(f,d){var l=this.inEdges(f,d);if(l)return l.concat(this.outEdges(f,d))};function i(f,d){f[d]?f[d]++:f[d]=1}function s(f,d){--f[d]||delete f[d]}function u(f,d,l,v){var m=""+d,g=""+l;if(!f&&m>g){var h=m;m=g,g=h}return m+n+g+n+(e.isUndefined(v)?a:v)}function o(f,d,l,v){var m=""+d,g=""+l;if(!f&&m>g){var h=m;m=g,g=h}var p={v:m,w:g};return v&&(p.name=v),p}function c(f,d){return u(f,d.v,d.w,d.name)}return ni}var ai,gd;function mp(){return gd||(gd=1,ai="2.1.8"),ai}var ii,yd;function qp(){return yd||(yd=1,ii={Graph:ti(),version:mp()}),ii}var ui,md;function wp(){if(md)return ui;md=1;var e=re(),a=ti();ui={write:t,read:i};function t(s){var u={options:{directed:s.isDirected(),multigraph:s.isMultigraph(),compound:s.isCompound()},nodes:n(s),edges:r(s)};return e.isUndefined(s.graph())||(u.value=e.clone(s.graph())),u}function n(s){return e.map(s.nodes(),function(u){var o=s.node(u),c=s.parent(u),f={v:u};return e.isUndefined(o)||(f.value=o),e.isUndefined(c)||(f.parent=c),f})}function r(s){return e.map(s.edges(),function(u){var o=s.edge(u),c={v:u.v,w:u.w};return e.isUndefined(u.name)||(c.name=u.name),e.isUndefined(o)||(c.value=o),c})}function i(s){var u=new a(s.options).setGraph(s.value);return e.each(s.nodes,function(o){u.setNode(o.v,o.value),o.parent&&u.setParent(o.v,o.parent)}),e.each(s.edges,function(o){u.setEdge({v:o.v,w:o.w,name:o.name},o.value)}),u}return ui}var si,qd;function Rp(){if(qd)return si;qd=1;var e=re();si=a;function a(t){var n={},r=[],i;function s(u){e.has(n,u)||(n[u]=!0,i.push(u),e.each(t.successors(u),s),e.each(t.predecessors(u),s))}return e.each(t.nodes(),function(u){i=[],s(u),i.length&&r.push(i)}),r}return si}var oi,wd;function Rd(){if(wd)return oi;wd=1;var e=re();oi=a;function a(){this._arr=[],this._keyIndices={}}return a.prototype.size=function(){return this._arr.length},a.prototype.keys=function(){return this._arr.map(function(t){return t.key})},a.prototype.has=function(t){return e.has(this._keyIndices,t)},a.prototype.priority=function(t){var n=this._keyIndices[t];if(n!==void 0)return this._arr[n].priority},a.prototype.min=function(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key},a.prototype.add=function(t,n){var r=this._keyIndices;if(t=String(t),!e.has(r,t)){var i=this._arr,s=i.length;return r[t]=s,i.push({key:t,priority:n}),this._decrease(s),!0}return!1},a.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},a.prototype.decrease=function(t,n){var r=this._keyIndices[t];if(n>this._arr[r].priority)throw new Error("New priority is greater than current priority. Key: "+t+" Old: "+this._arr[r].priority+" New: "+n);this._arr[r].priority=n,this._decrease(r)},a.prototype._heapify=function(t){var n=this._arr,r=2*t,i=r+1,s=t;r<n.length&&(s=n[r].priority<n[s].priority?r:s,i<n.length&&(s=n[i].priority<n[s].priority?i:s),s!==t&&(this._swap(t,s),this._heapify(s)))},a.prototype._decrease=function(t){for(var n=this._arr,r=n[t].priority,i;t!==0&&(i=t>>1,!(n[i].priority<r));)this._swap(t,i),t=i},a.prototype._swap=function(t,n){var r=this._arr,i=this._keyIndices,s=r[t],u=r[n];r[t]=u,r[n]=s,i[u.key]=t,i[s.key]=n},oi}var fi,Ed;function Td(){if(Ed)return fi;Ed=1;var e=re(),a=Rd();fi=n;var t=e.constant(1);function n(i,s,u,o){return r(i,String(s),u||t,o||function(c){return i.outEdges(c)})}function r(i,s,u,o){var c={},f=new a,d,l,v=function(m){var g=m.v!==d?m.v:m.w,h=c[g],p=u(m),_=l.distance+p;if(p<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+m+" Weight: "+p);_<h.distance&&(h.distance=_,h.predecessor=d,f.decrease(g,_))};for(i.nodes().forEach(function(m){var g=m===s?0:Number.POSITIVE_INFINITY;c[m]={distance:g},f.add(m,g)});f.size()>0&&(d=f.removeMin(),l=c[d],l.distance!==Number.POSITIVE_INFINITY);)o(d).forEach(v);return c}return fi}var ci,Sd;function Ep(){if(Sd)return ci;Sd=1;var e=Td(),a=re();ci=t;function t(n,r,i){return a.transform(n.nodes(),function(s,u){s[u]=e(n,u,r,i)},{})}return ci}var di,Ad;function Id(){if(Ad)return di;Ad=1;var e=re();di=a;function a(t){var n=0,r=[],i={},s=[];function u(o){var c=i[o]={onStack:!0,lowlink:n,index:n++};if(r.push(o),t.successors(o).forEach(function(l){e.has(i,l)?i[l].onStack&&(c.lowlink=Math.min(c.lowlink,i[l].index)):(u(l),c.lowlink=Math.min(c.lowlink,i[l].lowlink))}),c.lowlink===c.index){var f=[],d;do d=r.pop(),i[d].onStack=!1,f.push(d);while(o!==d);s.push(f)}}return t.nodes().forEach(function(o){e.has(i,o)||u(o)}),s}return di}var li,Cd;function Tp(){if(Cd)return li;Cd=1;var e=re(),a=Id();li=t;function t(n){return e.filter(a(n),function(r){return r.length>1||r.length===1&&n.hasEdge(r[0],r[0])})}return li}var hi,xd;function Sp(){if(xd)return hi;xd=1;var e=re();hi=t;var a=e.constant(1);function t(r,i,s){return n(r,i||a,s||function(u){return r.outEdges(u)})}function n(r,i,s){var u={},o=r.nodes();return o.forEach(function(c){u[c]={},u[c][c]={distance:0},o.forEach(function(f){c!==f&&(u[c][f]={distance:Number.POSITIVE_INFINITY})}),s(c).forEach(function(f){var d=f.v===c?f.w:f.v,l=i(f);u[c][d]={distance:l,predecessor:c}})}),o.forEach(function(c){var f=u[c];o.forEach(function(d){var l=u[d];o.forEach(function(v){var m=l[c],g=f[v],h=l[v],p=m.distance+g.distance;p<h.distance&&(h.distance=p,h.predecessor=g.predecessor)})})}),u}return hi}var vi,Od;function Pd(){if(Od)return vi;Od=1;var e=re();vi=a,a.CycleException=t;function a(n){var r={},i={},s=[];function u(o){if(e.has(i,o))throw new t;e.has(r,o)||(i[o]=!0,r[o]=!0,e.each(n.predecessors(o),u),delete i[o],s.push(o))}if(e.each(n.sinks(),u),e.size(r)!==n.nodeCount())throw new t;return s}function t(){}return t.prototype=new Error,vi}var pi,kd;function Ap(){if(kd)return pi;kd=1;var e=Pd();pi=a;function a(t){try{e(t)}catch(n){if(n instanceof e.CycleException)return!1;throw n}return!0}return pi}var _i,Md;function Nd(){if(Md)return _i;Md=1;var e=re();_i=a;function a(n,r,i){e.isArray(r)||(r=[r]);var s=(n.isDirected()?n.successors:n.neighbors).bind(n),u=[],o={};return e.each(r,function(c){if(!n.hasNode(c))throw new Error("Graph does not have node: "+c);t(n,c,i==="post",o,s,u)}),u}function t(n,r,i,s,u,o){e.has(s,r)||(s[r]=!0,i||o.push(r),e.each(u(r),function(c){t(n,c,i,s,u,o)}),i&&o.push(r))}return _i}var bi,Ld;function Ip(){if(Ld)return bi;Ld=1;var e=Nd();bi=a;function a(t,n){return e(t,n,"post")}return bi}var gi,jd;function Cp(){if(jd)return gi;jd=1;var e=Nd();gi=a;function a(t,n){return e(t,n,"pre")}return gi}var yi,Fd;function xp(){if(Fd)return yi;Fd=1;var e=re(),a=ti(),t=Rd();yi=n;function n(r,i){var s=new a,u={},o=new t,c;function f(l){var v=l.v===c?l.w:l.v,m=o.priority(v);if(m!==void 0){var g=i(l);g<m&&(u[v]=c,o.decrease(v,g))}}if(r.nodeCount()===0)return s;e.each(r.nodes(),function(l){o.add(l,Number.POSITIVE_INFINITY),s.setNode(l)}),o.decrease(r.nodes()[0],0);for(var d=!1;o.size()>0;){if(c=o.removeMin(),e.has(u,c))s.setEdge(c,u[c]);else{if(d)throw new Error("Input graph is not connected: "+r);d=!0}r.nodeEdges(c).forEach(f)}return s}return yi}var mi,Dd;function Op(){return Dd||(Dd=1,mi={components:Rp(),dijkstra:Td(),dijkstraAll:Ep(),findCycles:Tp(),floydWarshall:Sp(),isAcyclic:Ap(),postorder:Ip(),preorder:Cp(),prim:xp(),tarjan:Id(),topsort:Pd()}),mi}var qi,Gd;function Pp(){if(Gd)return qi;Gd=1;var e=qp();return qi={Graph:e.Graph,json:wp(),alg:Op(),version:e.version},qi}var wi,Bd;function te(){if(Bd)return wi;Bd=1;var e;if(typeof fr=="function")try{e=Pp()}catch{}return e||(e=window.graphlib),wi=e,wi}var Ri,Ud;function kp(){if(Ud)return Ri;Ud=1;var e=lf(),a=1,t=4;function n(r){return e(r,a|t)}return Ri=n,Ri}var Ei,Vd;function tr(){if(Vd)return Ei;Vd=1;var e=ye(),a=se(),t=We(),n=ee();function r(i,s,u){if(!n(u))return!1;var o=typeof s;return(o=="number"?a(u)&&t(s,u.length):o=="string"&&s in u)?e(u[s],i):!1}return Ei=r,Ei}var Ti,zd;function Mp(){if(zd)return Ti;zd=1;var e=nr(),a=ye(),t=tr(),n=pe(),r=Object.prototype,i=r.hasOwnProperty,s=e(function(u,o){u=Object(u);var c=-1,f=o.length,d=f>2?o[2]:void 0;for(d&&t(o[0],o[1],d)&&(f=1);++c<f;)for(var l=o[c],v=n(l),m=-1,g=v.length;++m<g;){var h=v[m],p=u[h];(p===void 0||a(p,r[h])&&!i.call(u,h))&&(u[h]=l[h])}return u});return Ti=s,Ti}var Si,Hd;function Np(){if(Hd)return Si;Hd=1;var e=oe(),a=se(),t=ce();function n(r){return function(i,s,u){var o=Object(i);if(!a(i)){var c=e(s,3);i=t(i),s=function(d){return c(o[d],d,o)}}var f=r(i,s,u);return f>-1?o[c?i[f]:f]:void 0}}return Si=n,Si}var Ai,Kd;function Lp(){if(Kd)return Ai;Kd=1;var e=/\s/;function a(t){for(var n=t.length;n--&&e.test(t.charAt(n)););return n}return Ai=a,Ai}var Ii,Yd;function jp(){if(Yd)return Ii;Yd=1;var e=Lp(),a=/^\s+/;function t(n){return n&&n.slice(0,e(n)+1).replace(a,"")}return Ii=t,Ii}var Ci,Wd;function Fp(){if(Wd)return Ci;Wd=1;var e=jp(),a=ee(),t=Re(),n=NaN,r=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,s=/^0o[0-7]+$/i,u=parseInt;function o(c){if(typeof c=="number")return c;if(t(c))return n;if(a(c)){var f=typeof c.valueOf=="function"?c.valueOf():c;c=a(f)?f+"":f}if(typeof c!="string")return c===0?c:+c;c=e(c);var d=i.test(c);return d||s.test(c)?u(c.slice(2),d?2:8):r.test(c)?n:+c}return Ci=o,Ci}var xi,$d;function Xd(){if($d)return xi;$d=1;var e=Fp(),a=1/0,t=17976931348623157e292;function n(r){if(!r)return r===0?r:0;if(r=e(r),r===a||r===-a){var i=r<0?-1:1;return i*t}return r===r?r:0}return xi=n,xi}var Oi,Jd;function Dp(){if(Jd)return Oi;Jd=1;var e=Xd();function a(t){var n=e(t),r=n%1;return n===n?r?n-r:n:0}return Oi=a,Oi}var Pi,Zd;function Gp(){if(Zd)return Pi;Zd=1;var e=rd(),a=oe(),t=Dp(),n=Math.max;function r(i,s,u){var o=i==null?0:i.length;if(!o)return-1;var c=u==null?0:t(u);return c<0&&(c=n(o+c,0)),e(i,a(s,3),c)}return Pi=r,Pi}var ki,Qd;function Bp(){if(Qd)return ki;Qd=1;var e=Np(),a=Gp(),t=e(a);return ki=t,ki}var Mi,el;function rl(){if(el)return Mi;el=1;var e=Na();function a(t){var n=t==null?0:t.length;return n?e(t,1):[]}return Mi=a,Mi}var Ni,nl;function Up(){if(nl)return Ni;nl=1;var e=qt(),a=wf(),t=pe();function n(r,i){return r==null?r:e(r,a(i),t)}return Ni=n,Ni}var Li,tl;function Vp(){if(tl)return Li;tl=1;function e(a){var t=a==null?0:a.length;return t?a[t-1]:void 0}return Li=e,Li}var ji,al;function zp(){if(al)return ji;al=1;var e=Ke(),a=Rt(),t=oe();function n(r,i){var s={};return i=t(i,3),a(r,function(u,o,c){e(s,o,i(u,o,c))}),s}return ji=n,ji}var Fi,il;function Di(){if(il)return Fi;il=1;var e=Re();function a(t,n,r){for(var i=-1,s=t.length;++i<s;){var u=t[i],o=n(u);if(o!=null&&(c===void 0?o===o&&!e(o):r(o,c)))var c=o,f=u}return f}return Fi=a,Fi}var Gi,ul;function Hp(){if(ul)return Gi;ul=1;function e(a,t){return a>t}return Gi=e,Gi}var Bi,sl;function Kp(){if(sl)return Bi;sl=1;var e=Di(),a=Hp(),t=_e();function n(r){return r&&r.length?e(r,t,a):void 0}return Bi=n,Bi}var Ui,ol;function fl(){if(ol)return Ui;ol=1;var e=Ke(),a=ye();function t(n,r,i){(i!==void 0&&!a(n[r],i)||i===void 0&&!(r in n))&&e(n,r,i)}return Ui=t,Ui}var Vi,cl;function Yp(){if(cl)return Vi;cl=1;var e=he(),a=Je(),t=ae(),n="[object Object]",r=Function.prototype,i=Object.prototype,s=r.toString,u=i.hasOwnProperty,o=s.call(Object);function c(f){if(!t(f)||e(f)!=n)return!1;var d=a(f);if(d===null)return!0;var l=u.call(d,"constructor")&&d.constructor;return typeof l=="function"&&l instanceof l&&s.call(l)==o}return Vi=c,Vi}var zi,dl;function ll(){if(dl)return zi;dl=1;function e(a,t){if(!(t==="constructor"&&typeof a[t]=="function")&&t!="__proto__")return a[t]}return zi=e,zi}var Hi,hl;function Wp(){if(hl)return Hi;hl=1;var e=Pe(),a=pe();function t(n){return e(n,a(n))}return Hi=t,Hi}var Ki,vl;function $p(){if(vl)return Ki;vl=1;var e=fl(),a=qo(),t=ef(),n=Ro(),r=uf(),i=ke(),s=Y(),u=dd(),o=qe(),c=Oe(),f=ee(),d=Yp(),l=Le(),v=ll(),m=Wp();function g(h,p,_,b,y,q,w){var E=v(h,_),C=v(p,_),S=w.get(C);if(S){e(h,_,S);return}var x=q?q(E,C,_+"",h,p,w):void 0,I=x===void 0;if(I){var k=s(C),M=!k&&o(C),j=!k&&!M&&l(C);x=C,k||M||j?s(E)?x=E:u(E)?x=n(E):M?(I=!1,x=a(C,!0)):j?(I=!1,x=t(C,!0)):x=[]:d(C)||i(C)?(x=E,i(E)?x=m(E):(!f(E)||c(E))&&(x=r(C))):I=!1}I&&(w.set(C,x),y(x,C,b,q,w),w.delete(C)),e(h,_,x)}return Ki=g,Ki}var Yi,pl;function Xp(){if(pl)return Yi;pl=1;var e=He(),a=fl(),t=qt(),n=$p(),r=ee(),i=pe(),s=ll();function u(o,c,f,d,l){o!==c&&t(c,function(v,m){if(l||(l=new e),r(v))n(o,c,m,f,u,d,l);else{var g=d?d(s(o,m),v,m+"",o,c,l):void 0;g===void 0&&(g=v),a(o,m,g)}},i)}return Yi=u,Yi}var Wi,_l;function Jp(){if(_l)return Wi;_l=1;var e=nr(),a=tr();function t(n){return e(function(r,i){var s=-1,u=i.length,o=u>1?i[u-1]:void 0,c=u>2?i[2]:void 0;for(o=n.length>3&&typeof o=="function"?(u--,o):void 0,c&&a(i[0],i[1],c)&&(o=u<3?void 0:o,u=1),r=Object(r);++s<u;){var f=i[s];f&&n(r,f,s,o)}return r})}return Wi=t,Wi}var $i,bl;function Zp(){if(bl)return $i;bl=1;var e=Xp(),a=Jp(),t=a(function(n,r,i){e(n,r,i)});return $i=t,$i}var Xi,gl;function yl(){if(gl)return Xi;gl=1;function e(a,t){return a<t}return Xi=e,Xi}var Ji,ml;function Qp(){if(ml)return Ji;ml=1;var e=Di(),a=yl(),t=_e();function n(r){return r&&r.length?e(r,t,a):void 0}return Ji=n,Ji}var Zi,ql;function e_(){if(ql)return Zi;ql=1;var e=Di(),a=oe(),t=yl();function n(r,i){return r&&r.length?e(r,a(i,2),t):void 0}return Zi=n,Zi}var Qi,wl;function r_(){if(wl)return Qi;wl=1;var e=ne(),a=function(){return e.Date.now()};return Qi=a,Qi}var eu,Rl;function n_(){if(Rl)return eu;Rl=1;var e=Ye(),a=er(),t=We(),n=ee(),r=Fe();function i(s,u,o,c){if(!n(s))return s;u=a(u,s);for(var f=-1,d=u.length,l=d-1,v=s;v!=null&&++f<d;){var m=r(u[f]),g=o;if(m==="__proto__"||m==="constructor"||m==="prototype")return s;if(f!=l){var h=v[m];g=c?c(h,m,v):void 0,g===void 0&&(g=n(h)?h:t(u[f+1])?[]:{})}e(v,m,g),v=v[m]}return s}return eu=i,eu}var ru,El;function t_(){if(El)return ru;El=1;var e=rr(),a=n_(),t=er();function n(r,i,s){for(var u=-1,o=i.length,c={};++u<o;){var f=i[u],d=e(r,f);s(d,f)&&a(c,t(f,r),d)}return c}return ru=n,ru}var nu,Tl;function a_(){if(Tl)return nu;Tl=1;var e=t_(),a=vc();function t(n,r){return e(n,r,function(i,s){return a(n,s)})}return nu=t,nu}var tu,Sl;function i_(){if(Sl)return tu;Sl=1;var e=rl(),a=Wc(),t=Zc();function n(r){return t(a(r,void 0,e),r+"")}return tu=n,tu}var au,Al;function u_(){if(Al)return au;Al=1;var e=a_(),a=i_(),t=a(function(n,r){return n==null?{}:e(n,r)});return au=t,au}var iu,Il;function s_(){if(Il)return iu;Il=1;var e=Math.ceil,a=Math.max;function t(n,r,i,s){for(var u=-1,o=a(e((r-n)/(i||1)),0),c=Array(o);o--;)c[s?o:++u]=n,n+=i;return c}return iu=t,iu}var uu,Cl;function o_(){if(Cl)return uu;Cl=1;var e=s_(),a=tr(),t=Xd();function n(r){return function(i,s,u){return u&&typeof u!="number"&&a(i,s,u)&&(s=u=void 0),i=t(i),s===void 0?(s=i,i=0):s=t(s),u=u===void 0?i<s?1:-1:t(u),e(i,s,u,r)}}return uu=n,uu}var su,xl;function f_(){if(xl)return su;xl=1;var e=o_(),a=e();return su=a,su}var ou,Ol;function c_(){if(Ol)return ou;Ol=1;function e(a,t){var n=a.length;for(a.sort(t);n--;)a[n]=a[n].value;return a}return ou=e,ou}var fu,Pl;function d_(){if(Pl)return fu;Pl=1;var e=Re();function a(t,n){if(t!==n){var r=t!==void 0,i=t===null,s=t===t,u=e(t),o=n!==void 0,c=n===null,f=n===n,d=e(n);if(!c&&!d&&!u&&t>n||u&&o&&f&&!c&&!d||i&&o&&f||!r&&f||!s)return 1;if(!i&&!u&&!d&&t<n||d&&r&&s&&!i&&!u||c&&r&&s||!o&&s||!f)return-1}return 0}return fu=a,fu}var cu,kl;function l_(){if(kl)return cu;kl=1;var e=d_();function a(t,n,r){for(var i=-1,s=t.criteria,u=n.criteria,o=s.length,c=r.length;++i<o;){var f=e(s[i],u[i]);if(f){if(i>=c)return f;var d=r[i];return f*(d=="desc"?-1:1)}}return t.index-n.index}return cu=a,cu}var du,Ml;function h_(){if(Ml)return du;Ml=1;var e=Qe(),a=rr(),t=oe(),n=xc(),r=c_(),i=$e(),s=l_(),u=_e(),o=Y();function c(f,d,l){d.length?d=e(d,function(g){return o(g)?function(h){return a(h,g.length===1?g[0]:g)}:g}):d=[u];var v=-1;d=e(d,i(t));var m=n(f,function(g,h,p){var _=e(d,function(b){return b(g)});return{criteria:_,index:++v,value:g}});return r(m,function(g,h){return s(g,h,l)})}return du=c,du}var lu,Nl;function v_(){if(Nl)return lu;Nl=1;var e=Na(),a=h_(),t=nr(),n=tr(),r=t(function(i,s){if(i==null)return[];var u=s.length;return u>1&&n(i,s[0],s[1])?s=[]:u>2&&n(s[0],s[1],s[2])&&(s=[s[0]]),a(i,e(s,1),[])});return lu=r,lu}var hu,Ll;function p_(){if(Ll)return hu;Ll=1;var e=ic(),a=0;function t(n){var r=++a;return e(n)+r}return hu=t,hu}var vu,jl;function __(){if(jl)return vu;jl=1;function e(a,t,n){for(var r=-1,i=a.length,s=t.length,u={};++r<i;){var o=r<s?t[r]:void 0;n(u,a[r],o)}return u}return vu=e,vu}var pu,Fl;function b_(){if(Fl)return pu;Fl=1;var e=Ye(),a=__();function t(n,r){return a(n||[],r||[],e)}return pu=t,pu}var _u,Dl;function z(){if(Dl)return _u;Dl=1;var e;if(typeof fr=="function")try{e={cloneDeep:kp(),constant:gt(),defaults:Mp(),each:Sf(),filter:wc(),find:Bp(),flatten:rl(),forEach:Ef(),forIn:Up(),has:Tc(),isUndefined:Ic(),last:Vp(),map:Pc(),mapValues:zp(),max:Kp(),merge:Zp(),min:Qp(),minBy:e_(),now:r_(),pick:u_(),range:f_(),reduce:Lc(),sortBy:v_(),uniqueId:p_(),values:pd(),zipObject:b_()}}catch{}return e||(e=window._),_u=e,_u}var bu,Gl;function g_(){if(Gl)return bu;Gl=1,bu=e;function e(){var n={};n._next=n._prev=n,this._sentinel=n}e.prototype.dequeue=function(){var n=this._sentinel,r=n._prev;if(r!==n)return a(r),r},e.prototype.enqueue=function(n){var r=this._sentinel;n._prev&&n._next&&a(n),n._next=r._next,r._next._prev=n,r._next=n,n._prev=r},e.prototype.toString=function(){for(var n=[],r=this._sentinel,i=r._prev;i!==r;)n.push(JSON.stringify(i,t)),i=i._prev;return"["+n.join(", ")+"]"};function a(n){n._prev._next=n._next,n._next._prev=n._prev,delete n._next,delete n._prev}function t(n,r){if(n!=="_next"&&n!=="_prev")return r}return bu}var gu,Bl;function y_(){if(Bl)return gu;Bl=1;var e=z(),a=te().Graph,t=g_();gu=r;var n=e.constant(1);function r(c,f){if(c.nodeCount()<=1)return[];var d=u(c,f||n),l=i(d.graph,d.buckets,d.zeroIdx);return e.flatten(e.map(l,function(v){return c.outEdges(v.v,v.w)}),!0)}function i(c,f,d){for(var l=[],v=f[f.length-1],m=f[0],g;c.nodeCount();){for(;g=m.dequeue();)s(c,f,d,g);for(;g=v.dequeue();)s(c,f,d,g);if(c.nodeCount()){for(var h=f.length-2;h>0;--h)if(g=f[h].dequeue(),g){l=l.concat(s(c,f,d,g,!0));break}}}return l}function s(c,f,d,l,v){var m=v?[]:void 0;return e.forEach(c.inEdges(l.v),function(g){var h=c.edge(g),p=c.node(g.v);v&&m.push({v:g.v,w:g.w}),p.out-=h,o(f,d,p)}),e.forEach(c.outEdges(l.v),function(g){var h=c.edge(g),p=g.w,_=c.node(p);_.in-=h,o(f,d,_)}),c.removeNode(l.v),m}function u(c,f){var d=new a,l=0,v=0;e.forEach(c.nodes(),function(h){d.setNode(h,{v:h,in:0,out:0})}),e.forEach(c.edges(),function(h){var p=d.edge(h.v,h.w)||0,_=f(h),b=p+_;d.setEdge(h.v,h.w,b),v=Math.max(v,d.node(h.v).out+=_),l=Math.max(l,d.node(h.w).in+=_)});var m=e.range(v+l+3).map(function(){return new t}),g=l+1;return e.forEach(d.nodes(),function(h){o(m,g,d.node(h))}),{graph:d,buckets:m,zeroIdx:g}}function o(c,f,d){d.out?d.in?c[d.out-d.in+f].enqueue(d):c[c.length-1].enqueue(d):c[0].enqueue(d)}return gu}var yu,Ul;function m_(){if(Ul)return yu;Ul=1;var e=z(),a=y_();yu={run:t,undo:r};function t(i){var s=i.graph().acyclicer==="greedy"?a(i,u(i)):n(i);e.forEach(s,function(o){var c=i.edge(o);i.removeEdge(o),c.forwardName=o.name,c.reversed=!0,i.setEdge(o.w,o.v,c,e.uniqueId("rev"))});function u(o){return function(c){return o.edge(c).weight}}}function n(i){var s=[],u={},o={};function c(f){e.has(o,f)||(o[f]=!0,u[f]=!0,e.forEach(i.outEdges(f),function(d){e.has(u,d.w)?s.push(d):c(d.w)}),delete u[f])}return e.forEach(i.nodes(),c),s}function r(i){e.forEach(i.edges(),function(s){var u=i.edge(s);if(u.reversed){i.removeEdge(s);var o=u.forwardName;delete u.reversed,delete u.forwardName,i.setEdge(s.w,s.v,u,o)}})}return yu}var mu,Vl;function X(){if(Vl)return mu;Vl=1;var e=z(),a=te().Graph;mu={addDummyNode:t,simplify:n,asNonCompoundGraph:r,successorWeights:i,predecessorWeights:s,intersectRect:u,buildLayerMatrix:o,normalizeRanks:c,removeEmptyRanks:f,addBorderNode:d,maxRank:l,partition:v,time:m,notime:g};function t(h,p,_,b){var y;do y=e.uniqueId(b);while(h.hasNode(y));return _.dummy=p,h.setNode(y,_),y}function n(h){var p=new a().setGraph(h.graph());return e.forEach(h.nodes(),function(_){p.setNode(_,h.node(_))}),e.forEach(h.edges(),function(_){var b=p.edge(_.v,_.w)||{weight:0,minlen:1},y=h.edge(_);p.setEdge(_.v,_.w,{weight:b.weight+y.weight,minlen:Math.max(b.minlen,y.minlen)})}),p}function r(h){var p=new a({multigraph:h.isMultigraph()}).setGraph(h.graph());return e.forEach(h.nodes(),function(_){h.children(_).length||p.setNode(_,h.node(_))}),e.forEach(h.edges(),function(_){p.setEdge(_,h.edge(_))}),p}function i(h){var p=e.map(h.nodes(),function(_){var b={};return e.forEach(h.outEdges(_),function(y){b[y.w]=(b[y.w]||0)+h.edge(y).weight}),b});return e.zipObject(h.nodes(),p)}function s(h){var p=e.map(h.nodes(),function(_){var b={};return e.forEach(h.inEdges(_),function(y){b[y.v]=(b[y.v]||0)+h.edge(y).weight}),b});return e.zipObject(h.nodes(),p)}function u(h,p){var _=h.x,b=h.y,y=p.x-_,q=p.y-b,w=h.width/2,E=h.height/2;if(!y&&!q)throw new Error("Not possible to find intersection inside of the rectangle");var C,S;return Math.abs(q)*w>Math.abs(y)*E?(q<0&&(E=-E),C=E*y/q,S=E):(y<0&&(w=-w),C=w,S=w*q/y),{x:_+C,y:b+S}}function o(h){var p=e.map(e.range(l(h)+1),function(){return[]});return e.forEach(h.nodes(),function(_){var b=h.node(_),y=b.rank;e.isUndefined(y)||(p[y][b.order]=_)}),p}function c(h){var p=e.min(e.map(h.nodes(),function(_){return h.node(_).rank}));e.forEach(h.nodes(),function(_){var b=h.node(_);e.has(b,"rank")&&(b.rank-=p)})}function f(h){var p=e.min(e.map(h.nodes(),function(q){return h.node(q).rank})),_=[];e.forEach(h.nodes(),function(q){var w=h.node(q).rank-p;_[w]||(_[w]=[]),_[w].push(q)});var b=0,y=h.graph().nodeRankFactor;e.forEach(_,function(q,w){e.isUndefined(q)&&w%y!==0?--b:b&&e.forEach(q,function(E){h.node(E).rank+=b})})}function d(h,p,_,b){var y={width:0,height:0};return arguments.length>=4&&(y.rank=_,y.order=b),t(h,"border",y,p)}function l(h){return e.max(e.map(h.nodes(),function(p){var _=h.node(p).rank;if(!e.isUndefined(_))return _}))}function v(h,p){var _={lhs:[],rhs:[]};return e.forEach(h,function(b){p(b)?_.lhs.push(b):_.rhs.push(b)}),_}function m(h,p){var _=e.now();try{return p()}finally{console.log(h+" time: "+(e.now()-_)+"ms")}}function g(h,p){return p()}return mu}var qu,zl;function q_(){if(zl)return qu;zl=1;var e=z(),a=X();qu={run:t,undo:r};function t(i){i.graph().dummyChains=[],e.forEach(i.edges(),function(s){n(i,s)})}function n(i,s){var u=s.v,o=i.node(u).rank,c=s.w,f=i.node(c).rank,d=s.name,l=i.edge(s),v=l.labelRank;if(f!==o+1){i.removeEdge(s);var m,g,h;for(h=0,++o;o<f;++h,++o)l.points=[],g={width:0,height:0,edgeLabel:l,edgeObj:s,rank:o},m=a.addDummyNode(i,"edge",g,"_d"),o===v&&(g.width=l.width,g.height=l.height,g.dummy="edge-label",g.labelpos=l.labelpos),i.setEdge(u,m,{weight:l.weight},d),h===0&&i.graph().dummyChains.push(m),u=m;i.setEdge(u,c,{weight:l.weight},d)}}function r(i){e.forEach(i.graph().dummyChains,function(s){var u=i.node(s),o=u.edgeLabel,c;for(i.setEdge(u.edgeObj,o);u.dummy;)c=i.successors(s)[0],i.removeNode(s),o.points.push({x:u.x,y:u.y}),u.dummy==="edge-label"&&(o.x=u.x,o.y=u.y,o.width=u.width,o.height=u.height),s=c,u=i.node(s)})}return qu}var wu,Hl;function ar(){if(Hl)return wu;Hl=1;var e=z();wu={longestPath:a,slack:t};function a(n){var r={};function i(s){var u=n.node(s);if(e.has(r,s))return u.rank;r[s]=!0;var o=e.min(e.map(n.outEdges(s),function(c){return i(c.w)-n.edge(c).minlen}));return(o===Number.POSITIVE_INFINITY||o===void 0||o===null)&&(o=0),u.rank=o}e.forEach(n.sources(),i)}function t(n,r){return n.node(r.w).rank-n.node(r.v).rank-n.edge(r).minlen}return wu}var Ru,Kl;function Yl(){if(Kl)return Ru;Kl=1;var e=z(),a=te().Graph,t=ar().slack;Ru=n;function n(u){var o=new a({directed:!1}),c=u.nodes()[0],f=u.nodeCount();o.setNode(c,{});for(var d,l;r(o,u)<f;)d=i(o,u),l=o.hasNode(d.v)?t(u,d):-t(u,d),s(o,u,l);return o}function r(u,o){function c(f){e.forEach(o.nodeEdges(f),function(d){var l=d.v,v=f===l?d.w:l;!u.hasNode(v)&&!t(o,d)&&(u.setNode(v,{}),u.setEdge(f,v,{}),c(v))})}return e.forEach(u.nodes(),c),u.nodeCount()}function i(u,o){return e.minBy(o.edges(),function(c){if(u.hasNode(c.v)!==u.hasNode(c.w))return t(o,c)})}function s(u,o,c){e.forEach(u.nodes(),function(f){o.node(f).rank+=c})}return Ru}var Eu,Wl;function w_(){if(Wl)return Eu;Wl=1;var e=z(),a=Yl(),t=ar().slack,n=ar().longestPath,r=te().alg.preorder,i=te().alg.postorder,s=X().simplify;Eu=u,u.initLowLimValues=d,u.initCutValues=o,u.calcCutValue=f,u.leaveEdge=v,u.enterEdge=m,u.exchangeEdges=g;function u(b){b=s(b),n(b);var y=a(b);d(y),o(y,b);for(var q,w;q=v(y);)w=m(y,b,q),g(y,b,q,w)}function o(b,y){var q=i(b,b.nodes());q=q.slice(0,q.length-1),e.forEach(q,function(w){c(b,y,w)})}function c(b,y,q){var w=b.node(q),E=w.parent;b.edge(q,E).cutvalue=f(b,y,q)}function f(b,y,q){var w=b.node(q),E=w.parent,C=!0,S=y.edge(q,E),x=0;return S||(C=!1,S=y.edge(E,q)),x=S.weight,e.forEach(y.nodeEdges(q),function(I){var k=I.v===q,M=k?I.w:I.v;if(M!==E){var j=k===C,F=y.edge(I).weight;if(x+=j?F:-F,p(b,q,M)){var K=b.edge(q,M).cutvalue;x+=j?-K:K}}}),x}function d(b,y){arguments.length<2&&(y=b.nodes()[0]),l(b,{},1,y)}function l(b,y,q,w,E){var C=q,S=b.node(w);return y[w]=!0,e.forEach(b.neighbors(w),function(x){e.has(y,x)||(q=l(b,y,q,x,w))}),S.low=C,S.lim=q++,E?S.parent=E:delete S.parent,q}function v(b){return e.find(b.edges(),function(y){return b.edge(y).cutvalue<0})}function m(b,y,q){var w=q.v,E=q.w;y.hasEdge(w,E)||(w=q.w,E=q.v);var C=b.node(w),S=b.node(E),x=C,I=!1;C.lim>S.lim&&(x=S,I=!0);var k=e.filter(y.edges(),function(M){return I===_(b,b.node(M.v),x)&&I!==_(b,b.node(M.w),x)});return e.minBy(k,function(M){return t(y,M)})}function g(b,y,q,w){var E=q.v,C=q.w;b.removeEdge(E,C),b.setEdge(w.v,w.w,{}),d(b),o(b,y),h(b,y)}function h(b,y){var q=e.find(b.nodes(),function(E){return!y.node(E).parent}),w=r(b,q);w=w.slice(1),e.forEach(w,function(E){var C=b.node(E).parent,S=y.edge(E,C),x=!1;S||(S=y.edge(C,E),x=!0),y.node(E).rank=y.node(C).rank+(x?S.minlen:-S.minlen)})}function p(b,y,q){return b.hasEdge(y,q)}function _(b,y,q){return q.low<=y.lim&&y.lim<=q.lim}return Eu}var Tu,$l;function R_(){if($l)return Tu;$l=1;var e=ar(),a=e.longestPath,t=Yl(),n=w_();Tu=r;function r(o){switch(o.graph().ranker){case"network-simplex":u(o);break;case"tight-tree":s(o);break;case"longest-path":i(o);break;default:u(o)}}var i=a;function s(o){a(o),t(o)}function u(o){n(o)}return Tu}var Su,Xl;function E_(){if(Xl)return Su;Xl=1;var e=z();Su=a;function a(r){var i=n(r);e.forEach(r.graph().dummyChains,function(s){for(var u=r.node(s),o=u.edgeObj,c=t(r,i,o.v,o.w),f=c.path,d=c.lca,l=0,v=f[l],m=!0;s!==o.w;){if(u=r.node(s),m){for(;(v=f[l])!==d&&r.node(v).maxRank<u.rank;)l++;v===d&&(m=!1)}if(!m){for(;l<f.length-1&&r.node(v=f[l+1]).minRank<=u.rank;)l++;v=f[l]}r.setParent(s,v),s=r.successors(s)[0]}})}function t(r,i,s,u){var o=[],c=[],f=Math.min(i[s].low,i[u].low),d=Math.max(i[s].lim,i[u].lim),l,v;l=s;do l=r.parent(l),o.push(l);while(l&&(i[l].low>f||d>i[l].lim));for(v=l,l=u;(l=r.parent(l))!==v;)c.push(l);return{path:o.concat(c.reverse()),lca:v}}function n(r){var i={},s=0;function u(o){var c=s;e.forEach(r.children(o),u),i[o]={low:c,lim:s++}}return e.forEach(r.children(),u),i}return Su}var Au,Jl;function T_(){if(Jl)return Au;Jl=1;var e=z(),a=X();Au={run:t,cleanup:s};function t(u){var o=a.addDummyNode(u,"root",{},"_root"),c=r(u),f=e.max(e.values(c))-1,d=2*f+1;u.graph().nestingRoot=o,e.forEach(u.edges(),function(v){u.edge(v).minlen*=d});var l=i(u)+1;e.forEach(u.children(),function(v){n(u,o,d,l,f,c,v)}),u.graph().nodeRankFactor=d}function n(u,o,c,f,d,l,v){var m=u.children(v);if(!m.length){v!==o&&u.setEdge(o,v,{weight:0,minlen:c});return}var g=a.addBorderNode(u,"_bt"),h=a.addBorderNode(u,"_bb"),p=u.node(v);u.setParent(g,v),p.borderTop=g,u.setParent(h,v),p.borderBottom=h,e.forEach(m,function(_){n(u,o,c,f,d,l,_);var b=u.node(_),y=b.borderTop?b.borderTop:_,q=b.borderBottom?b.borderBottom:_,w=b.borderTop?f:2*f,E=y!==q?1:d-l[v]+1;u.setEdge(g,y,{weight:w,minlen:E,nestingEdge:!0}),u.setEdge(q,h,{weight:w,minlen:E,nestingEdge:!0})}),u.parent(v)||u.setEdge(o,g,{weight:0,minlen:d+l[v]})}function r(u){var o={};function c(f,d){var l=u.children(f);l&&l.length&&e.forEach(l,function(v){c(v,d+1)}),o[f]=d}return e.forEach(u.children(),function(f){c(f,1)}),o}function i(u){return e.reduce(u.edges(),function(o,c){return o+u.edge(c).weight},0)}function s(u){var o=u.graph();u.removeNode(o.nestingRoot),delete o.nestingRoot,e.forEach(u.edges(),function(c){var f=u.edge(c);f.nestingEdge&&u.removeEdge(c)})}return Au}var Iu,Zl;function S_(){if(Zl)return Iu;Zl=1;var e=z(),a=X();Iu=t;function t(r){function i(s){var u=r.children(s),o=r.node(s);if(u.length&&e.forEach(u,i),e.has(o,"minRank")){o.borderLeft=[],o.borderRight=[];for(var c=o.minRank,f=o.maxRank+1;c<f;++c)n(r,"borderLeft","_bl",s,o,c),n(r,"borderRight","_br",s,o,c)}}e.forEach(r.children(),i)}function n(r,i,s,u,o,c){var f={width:0,height:0,rank:c,borderType:i},d=o[i][c-1],l=a.addDummyNode(r,"border",f,s);o[i][c]=l,r.setParent(l,u),d&&r.setEdge(d,l,{weight:1})}return Iu}var Cu,Ql;function A_(){if(Ql)return Cu;Ql=1;var e=z();Cu={adjust:a,undo:t};function a(c){var f=c.graph().rankdir.toLowerCase();(f==="lr"||f==="rl")&&n(c)}function t(c){var f=c.graph().rankdir.toLowerCase();(f==="bt"||f==="rl")&&i(c),(f==="lr"||f==="rl")&&(u(c),n(c))}function n(c){e.forEach(c.nodes(),function(f){r(c.node(f))}),e.forEach(c.edges(),function(f){r(c.edge(f))})}function r(c){var f=c.width;c.width=c.height,c.height=f}function i(c){e.forEach(c.nodes(),function(f){s(c.node(f))}),e.forEach(c.edges(),function(f){var d=c.edge(f);e.forEach(d.points,s),e.has(d,"y")&&s(d)})}function s(c){c.y=-c.y}function u(c){e.forEach(c.nodes(),function(f){o(c.node(f))}),e.forEach(c.edges(),function(f){var d=c.edge(f);e.forEach(d.points,o),e.has(d,"x")&&o(d)})}function o(c){var f=c.x;c.x=c.y,c.y=f}return Cu}var xu,eh;function I_(){if(eh)return xu;eh=1;var e=z();xu=a;function a(t){var n={},r=e.filter(t.nodes(),function(c){return!t.children(c).length}),i=e.max(e.map(r,function(c){return t.node(c).rank})),s=e.map(e.range(i+1),function(){return[]});function u(c){if(!e.has(n,c)){n[c]=!0;var f=t.node(c);s[f.rank].push(c),e.forEach(t.successors(c),u)}}var o=e.sortBy(r,function(c){return t.node(c).rank});return e.forEach(o,u),s}return xu}var Ou,rh;function C_(){if(rh)return Ou;rh=1;var e=z();Ou=a;function a(n,r){for(var i=0,s=1;s<r.length;++s)i+=t(n,r[s-1],r[s]);return i}function t(n,r,i){for(var s=e.zipObject(i,e.map(i,function(l,v){return v})),u=e.flatten(e.map(r,function(l){return e.sortBy(e.map(n.outEdges(l),function(v){return{pos:s[v.w],weight:n.edge(v).weight}}),"pos")}),!0),o=1;o<i.length;)o<<=1;var c=2*o-1;o-=1;var f=e.map(new Array(c),function(){return 0}),d=0;return e.forEach(u.forEach(function(l){var v=l.pos+o;f[v]+=l.weight;for(var m=0;v>0;)v%2&&(m+=f[v+1]),v=v-1>>1,f[v]+=l.weight;d+=l.weight*m})),d}return Ou}var Pu,nh;function x_(){if(nh)return Pu;nh=1;var e=z();Pu=a;function a(t,n){return e.map(n,function(r){var i=t.inEdges(r);if(i.length){var s=e.reduce(i,function(u,o){var c=t.edge(o),f=t.node(o.v);return{sum:u.sum+c.weight*f.order,weight:u.weight+c.weight}},{sum:0,weight:0});return{v:r,barycenter:s.sum/s.weight,weight:s.weight}}else return{v:r}})}return Pu}var ku,th;function O_(){if(th)return ku;th=1;var e=z();ku=a;function a(r,i){var s={};e.forEach(r,function(o,c){var f=s[o.v]={indegree:0,in:[],out:[],vs:[o.v],i:c};e.isUndefined(o.barycenter)||(f.barycenter=o.barycenter,f.weight=o.weight)}),e.forEach(i.edges(),function(o){var c=s[o.v],f=s[o.w];!e.isUndefined(c)&&!e.isUndefined(f)&&(f.indegree++,c.out.push(s[o.w]))});var u=e.filter(s,function(o){return!o.indegree});return t(u)}function t(r){var i=[];function s(c){return function(f){f.merged||(e.isUndefined(f.barycenter)||e.isUndefined(c.barycenter)||f.barycenter>=c.barycenter)&&n(c,f)}}function u(c){return function(f){f.in.push(c),--f.indegree===0&&r.push(f)}}for(;r.length;){var o=r.pop();i.push(o),e.forEach(o.in.reverse(),s(o)),e.forEach(o.out,u(o))}return e.map(e.filter(i,function(c){return!c.merged}),function(c){return e.pick(c,["vs","i","barycenter","weight"])})}function n(r,i){var s=0,u=0;r.weight&&(s+=r.barycenter*r.weight,u+=r.weight),i.weight&&(s+=i.barycenter*i.weight,u+=i.weight),r.vs=i.vs.concat(r.vs),r.barycenter=s/u,r.weight=u,r.i=Math.min(i.i,r.i),i.merged=!0}return ku}var Mu,ah;function P_(){if(ah)return Mu;ah=1;var e=z(),a=X();Mu=t;function t(i,s){var u=a.partition(i,function(g){return e.has(g,"barycenter")}),o=u.lhs,c=e.sortBy(u.rhs,function(g){return-g.i}),f=[],d=0,l=0,v=0;o.sort(r(!!s)),v=n(f,c,v),e.forEach(o,function(g){v+=g.vs.length,f.push(g.vs),d+=g.barycenter*g.weight,l+=g.weight,v=n(f,c,v)});var m={vs:e.flatten(f,!0)};return l&&(m.barycenter=d/l,m.weight=l),m}function n(i,s,u){for(var o;s.length&&(o=e.last(s)).i<=u;)s.pop(),i.push(o.vs),u++;return u}function r(i){return function(s,u){return s.barycenter<u.barycenter?-1:s.barycenter>u.barycenter?1:i?u.i-s.i:s.i-u.i}}return Mu}var Nu,ih;function k_(){if(ih)return Nu;ih=1;var e=z(),a=x_(),t=O_(),n=P_();Nu=r;function r(u,o,c,f){var d=u.children(o),l=u.node(o),v=l?l.borderLeft:void 0,m=l?l.borderRight:void 0,g={};v&&(d=e.filter(d,function(q){return q!==v&&q!==m}));var h=a(u,d);e.forEach(h,function(q){if(u.children(q.v).length){var w=r(u,q.v,c,f);g[q.v]=w,e.has(w,"barycenter")&&s(q,w)}});var p=t(h,c);i(p,g);var _=n(p,f);if(v&&(_.vs=e.flatten([v,_.vs,m],!0),u.predecessors(v).length)){var b=u.node(u.predecessors(v)[0]),y=u.node(u.predecessors(m)[0]);e.has(_,"barycenter")||(_.barycenter=0,_.weight=0),_.barycenter=(_.barycenter*_.weight+b.order+y.order)/(_.weight+2),_.weight+=2}return _}function i(u,o){e.forEach(u,function(c){c.vs=e.flatten(c.vs.map(function(f){return o[f]?o[f].vs:f}),!0)})}function s(u,o){e.isUndefined(u.barycenter)?(u.barycenter=o.barycenter,u.weight=o.weight):(u.barycenter=(u.barycenter*u.weight+o.barycenter*o.weight)/(u.weight+o.weight),u.weight+=o.weight)}return Nu}var Lu,uh;function M_(){if(uh)return Lu;uh=1;var e=z(),a=te().Graph;Lu=t;function t(r,i,s){var u=n(r),o=new a({compound:!0}).setGraph({root:u}).setDefaultNodeLabel(function(c){return r.node(c)});return e.forEach(r.nodes(),function(c){var f=r.node(c),d=r.parent(c);(f.rank===i||f.minRank<=i&&i<=f.maxRank)&&(o.setNode(c),o.setParent(c,d||u),e.forEach(r[s](c),function(l){var v=l.v===c?l.w:l.v,m=o.edge(v,c),g=e.isUndefined(m)?0:m.weight;o.setEdge(v,c,{weight:r.edge(l).weight+g})}),e.has(f,"minRank")&&o.setNode(c,{borderLeft:f.borderLeft[i],borderRight:f.borderRight[i]}))}),o}function n(r){for(var i;r.hasNode(i=e.uniqueId("_root")););return i}return Lu}var ju,sh;function N_(){if(sh)return ju;sh=1;var e=z();ju=a;function a(t,n,r){var i={},s;e.forEach(r,function(u){for(var o=t.parent(u),c,f;o;){if(c=t.parent(o),c?(f=i[c],i[c]=o):(f=s,s=o),f&&f!==o){n.setEdge(f,o);return}o=c}})}return ju}var Fu,oh;function L_(){if(oh)return Fu;oh=1;var e=z(),a=I_(),t=C_(),n=k_(),r=M_(),i=N_(),s=te().Graph,u=X();Fu=o;function o(l){var v=u.maxRank(l),m=c(l,e.range(1,v+1),"inEdges"),g=c(l,e.range(v-1,-1,-1),"outEdges"),h=a(l);d(l,h);for(var p=Number.POSITIVE_INFINITY,_,b=0,y=0;y<4;++b,++y){f(b%2?m:g,b%4>=2),h=u.buildLayerMatrix(l);var q=t(l,h);q<p&&(y=0,_=e.cloneDeep(h),p=q)}d(l,_)}function c(l,v,m){return e.map(v,function(g){return r(l,g,m)})}function f(l,v){var m=new s;e.forEach(l,function(g){var h=g.graph().root,p=n(g,h,m,v);e.forEach(p.vs,function(_,b){g.node(_).order=b}),i(g,m,p.vs)})}function d(l,v){e.forEach(v,function(m){e.forEach(m,function(g,h){l.node(g).order=h})})}return Fu}var Du,fh;function j_(){if(fh)return Du;fh=1;var e=z(),a=te().Graph,t=X();Du={positionX:m,findType1Conflicts:n,findType2Conflicts:r,addConflict:s,hasConflict:u,verticalAlignment:o,horizontalCompaction:c,alignCoordinates:l,findSmallestWidthAlignment:d,balance:v};function n(p,_){var b={};function y(q,w){var E=0,C=0,S=q.length,x=e.last(w);return e.forEach(w,function(I,k){var M=i(p,I),j=M?p.node(M).order:S;(M||I===x)&&(e.forEach(w.slice(C,k+1),function(F){e.forEach(p.predecessors(F),function(K){var fe=p.node(K),ie=fe.order;(ie<E||j<ie)&&!(fe.dummy&&p.node(F).dummy)&&s(b,K,F)})}),C=k+1,E=j)}),w}return e.reduce(_,y),b}function r(p,_){var b={};function y(w,E,C,S,x){var I;e.forEach(e.range(E,C),function(k){I=w[k],p.node(I).dummy&&e.forEach(p.predecessors(I),function(M){var j=p.node(M);j.dummy&&(j.order<S||j.order>x)&&s(b,M,I)})})}function q(w,E){var C=-1,S,x=0;return e.forEach(E,function(I,k){if(p.node(I).dummy==="border"){var M=p.predecessors(I);M.length&&(S=p.node(M[0]).order,y(E,x,k,C,S),x=k,C=S)}y(E,x,E.length,S,w.length)}),E}return e.reduce(_,q),b}function i(p,_){if(p.node(_).dummy)return e.find(p.predecessors(_),function(b){return p.node(b).dummy})}function s(p,_,b){if(_>b){var y=_;_=b,b=y}var q=p[_];q||(p[_]=q={}),q[b]=!0}function u(p,_,b){if(_>b){var y=_;_=b,b=y}return e.has(p[_],b)}function o(p,_,b,y){var q={},w={},E={};return e.forEach(_,function(C){e.forEach(C,function(S,x){q[S]=S,w[S]=S,E[S]=x})}),e.forEach(_,function(C){var S=-1;e.forEach(C,function(x){var I=y(x);if(I.length){I=e.sortBy(I,function(K){return E[K]});for(var k=(I.length-1)/2,M=Math.floor(k),j=Math.ceil(k);M<=j;++M){var F=I[M];w[x]===x&&S<E[F]&&!u(b,x,F)&&(w[F]=x,w[x]=q[x]=q[F],S=E[F])}}})}),{root:q,align:w}}function c(p,_,b,y,q){var w={},E=f(p,_,b,q),C=q?"borderLeft":"borderRight";function S(k,M){for(var j=E.nodes(),F=j.pop(),K={};F;)K[F]?k(F):(K[F]=!0,j.push(F),j=j.concat(M(F))),F=j.pop()}function x(k){w[k]=E.inEdges(k).reduce(function(M,j){return Math.max(M,w[j.v]+E.edge(j))},0)}function I(k){var M=E.outEdges(k).reduce(function(F,K){return Math.min(F,w[K.w]-E.edge(K))},Number.POSITIVE_INFINITY),j=p.node(k);M!==Number.POSITIVE_INFINITY&&j.borderType!==C&&(w[k]=Math.max(w[k],M))}return S(x,E.predecessors.bind(E)),S(I,E.successors.bind(E)),e.forEach(y,function(k){w[k]=w[b[k]]}),w}function f(p,_,b,y){var q=new a,w=p.graph(),E=g(w.nodesep,w.edgesep,y);return e.forEach(_,function(C){var S;e.forEach(C,function(x){var I=b[x];if(q.setNode(I),S){var k=b[S],M=q.edge(k,I);q.setEdge(k,I,Math.max(E(p,x,S),M||0))}S=x})}),q}function d(p,_){return e.minBy(e.values(_),function(b){var y=Number.NEGATIVE_INFINITY,q=Number.POSITIVE_INFINITY;return e.forIn(b,function(w,E){var C=h(p,E)/2;y=Math.max(w+C,y),q=Math.min(w-C,q)}),y-q})}function l(p,_){var b=e.values(_),y=e.min(b),q=e.max(b);e.forEach(["u","d"],function(w){e.forEach(["l","r"],function(E){var C=w+E,S=p[C],x;if(S!==_){var I=e.values(S);x=E==="l"?y-e.min(I):q-e.max(I),x&&(p[C]=e.mapValues(S,function(k){return k+x}))}})})}function v(p,_){return e.mapValues(p.ul,function(b,y){if(_)return p[_.toLowerCase()][y];var q=e.sortBy(e.map(p,y));return(q[1]+q[2])/2})}function m(p){var _=t.buildLayerMatrix(p),b=e.merge(n(p,_),r(p,_)),y={},q;e.forEach(["u","d"],function(E){q=E==="u"?_:e.values(_).reverse(),e.forEach(["l","r"],function(C){C==="r"&&(q=e.map(q,function(k){return e.values(k).reverse()}));var S=(E==="u"?p.predecessors:p.successors).bind(p),x=o(p,q,b,S),I=c(p,q,x.root,x.align,C==="r");C==="r"&&(I=e.mapValues(I,function(k){return-k})),y[E+C]=I})});var w=d(p,y);return l(y,w),v(y,p.graph().align)}function g(p,_,b){return function(y,q,w){var E=y.node(q),C=y.node(w),S=0,x;if(S+=E.width/2,e.has(E,"labelpos"))switch(E.labelpos.toLowerCase()){case"l":x=-E.width/2;break;case"r":x=E.width/2;break}if(x&&(S+=b?x:-x),x=0,S+=(E.dummy?_:p)/2,S+=(C.dummy?_:p)/2,S+=C.width/2,e.has(C,"labelpos"))switch(C.labelpos.toLowerCase()){case"l":x=C.width/2;break;case"r":x=-C.width/2;break}return x&&(S+=b?x:-x),x=0,S}}function h(p,_){return p.node(_).width}return Du}var Gu,ch;function F_(){if(ch)return Gu;ch=1;var e=z(),a=X(),t=j_().positionX;Gu=n;function n(i){i=a.asNonCompoundGraph(i),r(i),e.forEach(t(i),function(s,u){i.node(u).x=s})}function r(i){var s=a.buildLayerMatrix(i),u=i.graph().ranksep,o=0;e.forEach(s,function(c){var f=e.max(e.map(c,function(d){return i.node(d).height}));e.forEach(c,function(d){i.node(d).y=o+f/2}),o+=f+u})}return Gu}var Bu,dh;function D_(){if(dh)return Bu;dh=1;var e=z(),a=m_(),t=q_(),n=R_(),r=X().normalizeRanks,i=E_(),s=X().removeEmptyRanks,u=T_(),o=S_(),c=A_(),f=L_(),d=F_(),l=X(),v=te().Graph;Bu=m;function m(R,A){var O=A&&A.debugTiming?l.time:l.notime;O("layout",function(){var P=O(" buildLayoutGraph",function(){return S(R)});O(" runLayout",function(){g(P,O)}),O(" updateInputGraph",function(){h(R,P)})})}function g(R,A){A(" makeSpaceForEdgeLabels",function(){x(R)}),A(" removeSelfEdges",function(){Ee(R)}),A(" acyclic",function(){a.run(R)}),A(" nestingGraph.run",function(){u.run(R)}),A(" rank",function(){n(l.asNonCompoundGraph(R))}),A(" injectEdgeLabelProxies",function(){I(R)}),A(" removeEmptyRanks",function(){s(R)}),A(" nestingGraph.cleanup",function(){u.cleanup(R)}),A(" normalizeRanks",function(){r(R)}),A(" assignRankMinMax",function(){k(R)}),A(" removeEdgeLabelProxies",function(){M(R)}),A(" normalize.run",function(){t.run(R)}),A(" parentDummyChains",function(){i(R)}),A(" addBorderSegments",function(){o(R)}),A(" order",function(){f(R)}),A(" insertSelfEdges",function(){Te(R)}),A(" adjustCoordinateSystem",function(){c.adjust(R)}),A(" position",function(){d(R)}),A(" positionSelfEdges",function(){T(R)}),A(" removeBorderNodes",function(){ie(R)}),A(" normalize.undo",function(){t.undo(R)}),A(" fixupEdgeLabelCoords",function(){K(R)}),A(" undoCoordinateSystem",function(){c.undo(R)}),A(" translateGraph",function(){j(R)}),A(" assignNodeIntersects",function(){F(R)}),A(" reversePoints",function(){fe(R)}),A(" acyclic.undo",function(){a.undo(R)})}function h(R,A){e.forEach(R.nodes(),function(O){var P=R.node(O),L=A.node(O);P&&(P.x=L.x,P.y=L.y,A.children(O).length&&(P.width=L.width,P.height=L.height))}),e.forEach(R.edges(),function(O){var P=R.edge(O),L=A.edge(O);P.points=L.points,e.has(L,"x")&&(P.x=L.x,P.y=L.y)}),R.graph().width=A.graph().width,R.graph().height=A.graph().height}var p=["nodesep","edgesep","ranksep","marginx","marginy"],_={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},b=["acyclicer","ranker","rankdir","align"],y=["width","height"],q={width:0,height:0},w=["minlen","weight","width","height","labeloffset"],E={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},C=["labelpos"];function S(R){var A=new v({multigraph:!0,compound:!0}),O=B(R.graph());return A.setGraph(e.merge({},_,N(O,p),e.pick(O,b))),e.forEach(R.nodes(),function(P){var L=B(R.node(P));A.setNode(P,e.defaults(N(L,y),q)),A.setParent(P,R.parent(P))}),e.forEach(R.edges(),function(P){var L=B(R.edge(P));A.setEdge(P,e.merge({},E,N(L,w),e.pick(L,C)))}),A}function x(R){var A=R.graph();A.ranksep/=2,e.forEach(R.edges(),function(O){var P=R.edge(O);P.minlen*=2,P.labelpos.toLowerCase()!=="c"&&(A.rankdir==="TB"||A.rankdir==="BT"?P.width+=P.labeloffset:P.height+=P.labeloffset)})}function I(R){e.forEach(R.edges(),function(A){var O=R.edge(A);if(O.width&&O.height){var P=R.node(A.v),L=R.node(A.w),U={rank:(L.rank-P.rank)/2+P.rank,e:A};l.addDummyNode(R,"edge-proxy",U,"_ep")}})}function k(R){var A=0;e.forEach(R.nodes(),function(O){var P=R.node(O);P.borderTop&&(P.minRank=R.node(P.borderTop).rank,P.maxRank=R.node(P.borderBottom).rank,A=e.max(A,P.maxRank))}),R.graph().maxRank=A}function M(R){e.forEach(R.nodes(),function(A){var O=R.node(A);O.dummy==="edge-proxy"&&(R.edge(O.e).labelRank=O.rank,R.removeNode(A))})}function j(R){var A=Number.POSITIVE_INFINITY,O=0,P=Number.POSITIVE_INFINITY,L=0,U=R.graph(),H=U.marginx||0,J=U.marginy||0;function ir(Z){var $=Z.x,D=Z.y,be=Z.width,G=Z.height;A=Math.min(A,$-be/2),O=Math.max(O,$+be/2),P=Math.min(P,D-G/2),L=Math.max(L,D+G/2)}e.forEach(R.nodes(),function(Z){ir(R.node(Z))}),e.forEach(R.edges(),function(Z){var $=R.edge(Z);e.has($,"x")&&ir($)}),A-=H,P-=J,e.forEach(R.nodes(),function(Z){var $=R.node(Z);$.x-=A,$.y-=P}),e.forEach(R.edges(),function(Z){var $=R.edge(Z);e.forEach($.points,function(D){D.x-=A,D.y-=P}),e.has($,"x")&&($.x-=A),e.has($,"y")&&($.y-=P)}),U.width=O-A+H,U.height=L-P+J}function F(R){e.forEach(R.edges(),function(A){var O=R.edge(A),P=R.node(A.v),L=R.node(A.w),U,H;O.points?(U=O.points[0],H=O.points[O.points.length-1]):(O.points=[],U=L,H=P),O.points.unshift(l.intersectRect(P,U)),O.points.push(l.intersectRect(L,H))})}function K(R){e.forEach(R.edges(),function(A){var O=R.edge(A);if(e.has(O,"x"))switch((O.labelpos==="l"||O.labelpos==="r")&&(O.width-=O.labeloffset),O.labelpos){case"l":O.x-=O.width/2+O.labeloffset;break;case"r":O.x+=O.width/2+O.labeloffset;break}})}function fe(R){e.forEach(R.edges(),function(A){var O=R.edge(A);O.reversed&&O.points.reverse()})}function ie(R){e.forEach(R.nodes(),function(A){if(R.children(A).length){var O=R.node(A),P=R.node(O.borderTop),L=R.node(O.borderBottom),U=R.node(e.last(O.borderLeft)),H=R.node(e.last(O.borderRight));O.width=Math.abs(H.x-U.x),O.height=Math.abs(L.y-P.y),O.x=U.x+O.width/2,O.y=P.y+O.height/2}}),e.forEach(R.nodes(),function(A){R.node(A).dummy==="border"&&R.removeNode(A)})}function Ee(R){e.forEach(R.edges(),function(A){if(A.v===A.w){var O=R.node(A.v);O.selfEdges||(O.selfEdges=[]),O.selfEdges.push({e:A,label:R.edge(A)}),R.removeEdge(A)}})}function Te(R){var A=l.buildLayerMatrix(R);e.forEach(A,function(O){var P=0;e.forEach(O,function(L,U){var H=R.node(L);H.order=U+P,e.forEach(H.selfEdges,function(J){l.addDummyNode(R,"selfedge",{width:J.label.width,height:J.label.height,rank:H.rank,order:U+ ++P,e:J.e,label:J.label},"_se")}),delete H.selfEdges})})}function T(R){e.forEach(R.nodes(),function(A){var O=R.node(A);if(O.dummy==="selfedge"){var P=R.node(O.e.v),L=P.x+P.width/2,U=P.y,H=O.x-L,J=P.height/2;R.setEdge(O.e,O.label),R.removeNode(A),O.label.points=[{x:L+2*H/3,y:U-J},{x:L+5*H/6,y:U-J},{x:L+H,y:U},{x:L+5*H/6,y:U+J},{x:L+2*H/3,y:U+J}],O.label.x=O.x,O.label.y=O.y}})}function N(R,A){return e.mapValues(e.pick(R,A),Number)}function B(R){var A={};return e.forEach(R,function(O,P){A[P.toLowerCase()]=O}),A}return Bu}var Uu,lh;function G_(){if(lh)return Uu;lh=1;var e=z(),a=X(),t=te().Graph;Uu={debugOrdering:n};function n(r){var i=a.buildLayerMatrix(r),s=new t({compound:!0,multigraph:!0}).setGraph({});return e.forEach(r.nodes(),function(u){s.setNode(u,{label:u}),s.setParent(u,"layer"+r.node(u).rank)}),e.forEach(r.edges(),function(u){s.setEdge(u.v,u.w,{},u.name)}),e.forEach(i,function(u,o){var c="layer"+o;s.setNode(c,{rank:"same"}),e.reduce(u,function(f,d){return s.setEdge(f,d,{style:"invis"}),d})}),s}return Uu}var Vu,hh;function B_(){return hh||(hh=1,Vu="0.8.5"),Vu}var zu,vh;function U_(){return vh||(vh=1,zu={graphlib:te(),layout:D_(),debug:G_(),util:{time:X().time,notime:X().notime},version:B_()}),zu}var V_=U_();const ph=qh(V_),_h={direction:"TB",nodeSep:80,rankSep:120,nodeSize:{action:{width:140,height:50},decision:{width:120,height:60}}};function z_(e,a){const t={..._h,...a,nodeSize:{..._h.nodeSize,...a?.nodeSize}},n=new ph.graphlib.Graph({multigraph:!0});n.setGraph({rankdir:t.direction,nodesep:t.nodeSep,ranksep:t.rankSep,marginx:50,marginy:50}),n.setDefaultEdgeLabel(()=>({}));for(const r of e.nodes){const i=t.nodeSize[r.type];n.setNode(r.id,{width:i.width,height:i.height,label:r.label||r.id,type:r.type})}for(const r of e.edges)n.setEdge(r.from,r.to,{id:r.id,label:r.label},r.id);return ph.layout(n),{nodes:H_(n,e),edges:K_(n,e)}}function H_(e,a){return a.nodes.map(t=>{const n=e.node(t.id);return n?{id:t.id,label:t.label||t.id,type:t.type,x:n.x-n.width/2,y:n.y-n.height/2,width:n.width,height:n.height}:(console.warn(`Node ${t.id} not found in layout result`),null)}).filter(Boolean)}function K_(e,a){return a.edges.map(t=>{const n=e.edge(t.from,t.to,t.id);if(!n)return console.warn(`Edge ${t.id} not found`),null;const r=Y_(n.points),i=Math.floor(n.points.length/2),s=n.points[i]||{x:0,y:0};return{id:t.id,from:t.from,to:t.to,path:r,label:t.label,labelX:s.x,labelY:s.y}}).filter(Boolean)}function Y_(e){if(!e||e.length===0)return"";let a=`M${e[0].x},${e[0].y}`;for(let t=1;t<e.length;t++)a+=` L${e[t].x},${e[t].y}`;return a}ue.FlowVisualizer=Sh,ue.NodeDetailModal=Ah,ue.computeLayout=z_,Object.defineProperty(ue,Symbol.toStringTag,{value:"Module"})}));
|
package/dist/logo.svg
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<svg width="200" height="200" viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<style>
|
|
3
|
+
@media (prefers-color-scheme: dark) {
|
|
4
|
+
.flow-arc-1 { stroke: #3DBAA2; }
|
|
5
|
+
.flow-arc-2 { stroke: #E8F4F2; }
|
|
6
|
+
.flow-arc-3 { stroke: #5A9FBF; }
|
|
7
|
+
.center-icon { fill: #E8F4F2; }
|
|
8
|
+
}
|
|
9
|
+
@media (prefers-color-scheme: light) {
|
|
10
|
+
.flow-arc-1 { stroke: #2A9D8F; }
|
|
11
|
+
.flow-arc-2 { stroke: #264653; }
|
|
12
|
+
.flow-arc-3 { stroke: #457B9D; }
|
|
13
|
+
.center-icon { fill: #264653; }
|
|
14
|
+
}
|
|
15
|
+
</style>
|
|
16
|
+
|
|
17
|
+
<g fill="none" stroke-width="12" stroke-linecap="round">
|
|
18
|
+
<path d="M160,100 A60,60 0 0,1 100,160" class="flow-arc-1" opacity="0.8" />
|
|
19
|
+
<path d="M40,100 A60,60 0 0,1 100,40" class="flow-arc-2" />
|
|
20
|
+
<path d="M100,160 A60,60 0 0,1 40,100" class="flow-arc-3" opacity="0.6" />
|
|
21
|
+
</g>
|
|
22
|
+
|
|
23
|
+
<path d="M100,75 L125,100 L100,125 L75,100 Z" class="center-icon" />
|
|
24
|
+
</svg>
|
package/package.json
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@majdibo/flow-visualizer",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "React components for visualizing flow graphs and timelines",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./src/index.ts",
|
|
7
|
+
"types": "./src/index.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": "./src/index.ts",
|
|
10
|
+
"./src/*": "./src/*"
|
|
11
|
+
},
|
|
12
|
+
"files": [
|
|
13
|
+
"src",
|
|
14
|
+
"dist",
|
|
15
|
+
"README.md",
|
|
16
|
+
"public/logo.svg"
|
|
17
|
+
],
|
|
18
|
+
"author": "majdibo",
|
|
19
|
+
"license": "MIT",
|
|
20
|
+
"repository": {
|
|
21
|
+
"type": "git",
|
|
22
|
+
"url": "https://github.com/majdibo/flow-visualizer.git"
|
|
23
|
+
},
|
|
24
|
+
"homepage": "https://majdibo.github.io/flow-visualizer",
|
|
25
|
+
"keywords": [
|
|
26
|
+
"react",
|
|
27
|
+
"flow",
|
|
28
|
+
"graph",
|
|
29
|
+
"visualizer",
|
|
30
|
+
"timeline",
|
|
31
|
+
"components"
|
|
32
|
+
],
|
|
33
|
+
"scripts": {
|
|
34
|
+
"dev": "vite",
|
|
35
|
+
"build": "tsc && vite build",
|
|
36
|
+
"preview": "vite preview"
|
|
37
|
+
},
|
|
38
|
+
"peerDependencies": {
|
|
39
|
+
"react": "^19.2.3",
|
|
40
|
+
"react-dom": "^19.2.3"
|
|
41
|
+
},
|
|
42
|
+
"dependencies": {
|
|
43
|
+
"@majdibo/flow-engine": "^1.0.0",
|
|
44
|
+
"@types/dagre": "^0.7.53",
|
|
45
|
+
"dagre": "^0.8.5"
|
|
46
|
+
},
|
|
47
|
+
"devDependencies": {
|
|
48
|
+
"@tailwindcss/postcss": "^4.1.18",
|
|
49
|
+
"@types/react": "^19.2.8",
|
|
50
|
+
"@types/react-dom": "^19.2.3",
|
|
51
|
+
"@vitejs/plugin-react": "^5.1.2",
|
|
52
|
+
"autoprefixer": "^10.4.23",
|
|
53
|
+
"postcss": "^8.5.6",
|
|
54
|
+
"react": "^19.2.3",
|
|
55
|
+
"react-dom": "^19.2.3",
|
|
56
|
+
"tailwindcss": "^4.1.18",
|
|
57
|
+
"typescript": "^5.7.2",
|
|
58
|
+
"vite": "^7.3.1"
|
|
59
|
+
}
|
|
60
|
+
}
|
package/public/logo.svg
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<svg width="200" height="200" viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<style>
|
|
3
|
+
@media (prefers-color-scheme: dark) {
|
|
4
|
+
.flow-arc-1 { stroke: #3DBAA2; }
|
|
5
|
+
.flow-arc-2 { stroke: #E8F4F2; }
|
|
6
|
+
.flow-arc-3 { stroke: #5A9FBF; }
|
|
7
|
+
.center-icon { fill: #E8F4F2; }
|
|
8
|
+
}
|
|
9
|
+
@media (prefers-color-scheme: light) {
|
|
10
|
+
.flow-arc-1 { stroke: #2A9D8F; }
|
|
11
|
+
.flow-arc-2 { stroke: #264653; }
|
|
12
|
+
.flow-arc-3 { stroke: #457B9D; }
|
|
13
|
+
.center-icon { fill: #264653; }
|
|
14
|
+
}
|
|
15
|
+
</style>
|
|
16
|
+
|
|
17
|
+
<g fill="none" stroke-width="12" stroke-linecap="round">
|
|
18
|
+
<path d="M160,100 A60,60 0 0,1 100,160" class="flow-arc-1" opacity="0.8" />
|
|
19
|
+
<path d="M40,100 A60,60 0 0,1 100,40" class="flow-arc-2" />
|
|
20
|
+
<path d="M100,160 A60,60 0 0,1 40,100" class="flow-arc-3" opacity="0.6" />
|
|
21
|
+
</g>
|
|
22
|
+
|
|
23
|
+
<path d="M100,75 L125,100 L100,125 L75,100 Z" class="center-icon" />
|
|
24
|
+
</svg>
|
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
import { useRef, useState, useEffect, useCallback, useMemo } from 'react';
|
|
2
|
+
import type { VisualState } from '@majdibo/flow-engine';
|
|
3
|
+
import './theme.css';
|
|
4
|
+
|
|
5
|
+
export interface VisualNode {
|
|
6
|
+
id: string;
|
|
7
|
+
label: string;
|
|
8
|
+
type: 'action' | 'decision';
|
|
9
|
+
x: number;
|
|
10
|
+
y: number;
|
|
11
|
+
width: number;
|
|
12
|
+
height: number;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export interface VisualEdge {
|
|
16
|
+
id: string;
|
|
17
|
+
from: string;
|
|
18
|
+
to: string;
|
|
19
|
+
path: string;
|
|
20
|
+
label?: string;
|
|
21
|
+
labelX?: number;
|
|
22
|
+
labelY?: number;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
interface FlowVisualizerProps {
|
|
26
|
+
nodes: VisualNode[];
|
|
27
|
+
edges: VisualEdge[];
|
|
28
|
+
state: VisualState;
|
|
29
|
+
onNodeClick?: (nodeId: string) => void;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
interface ViewTransform {
|
|
33
|
+
x: number;
|
|
34
|
+
y: number;
|
|
35
|
+
scale: number;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function Node({ node, state, onClick }: { node: VisualNode; state: VisualState; onClick?: () => void }) {
|
|
39
|
+
const nodeState = state.nodeStates[node.id];
|
|
40
|
+
const isCurrent = nodeState === 'current';
|
|
41
|
+
const cx = node.x + node.width / 2;
|
|
42
|
+
const cy = node.y + node.height / 2;
|
|
43
|
+
const shape = node.type === 'decision' ? `M${cx},${cy - node.height / 2} L${cx + node.width / 2},${cy} L${cx},${cy + node.height / 2} L${cx - node.width / 2},${cy} Z` : undefined;
|
|
44
|
+
|
|
45
|
+
return (
|
|
46
|
+
<g
|
|
47
|
+
onClick={onClick}
|
|
48
|
+
className={`flow-node flow-node-${nodeState} ${onClick ? 'cursor-pointer' : ''}`}
|
|
49
|
+
style={{ filter: `var(--flow-node-${nodeState}-shadow)` }}
|
|
50
|
+
data-node={node.id}
|
|
51
|
+
>
|
|
52
|
+
{shape ? (
|
|
53
|
+
<path
|
|
54
|
+
d={shape}
|
|
55
|
+
fill={`var(--flow-node-${nodeState}-fill)`}
|
|
56
|
+
stroke={`var(--flow-node-${nodeState}-stroke)`}
|
|
57
|
+
strokeWidth={isCurrent ? 3 : 2}
|
|
58
|
+
/>
|
|
59
|
+
) : (
|
|
60
|
+
<rect
|
|
61
|
+
x={node.x}
|
|
62
|
+
y={node.y}
|
|
63
|
+
width={node.width}
|
|
64
|
+
height={node.height}
|
|
65
|
+
rx={16}
|
|
66
|
+
fill={`var(--flow-node-${nodeState}-fill)`}
|
|
67
|
+
stroke={`var(--flow-node-${nodeState}-stroke)`}
|
|
68
|
+
strokeWidth={isCurrent ? 3 : 2}
|
|
69
|
+
/>
|
|
70
|
+
)}
|
|
71
|
+
<text
|
|
72
|
+
x={cx}
|
|
73
|
+
y={cy + (node.type === 'decision' ? 4 : 0)}
|
|
74
|
+
textAnchor="middle"
|
|
75
|
+
fill={isCurrent ? 'var(--flow-text-current)' : nodeState === 'traversed' ? 'var(--flow-text-secondary)' : 'var(--flow-text-primary)'}
|
|
76
|
+
className="flow-node-label"
|
|
77
|
+
dominantBaseline="middle"
|
|
78
|
+
>
|
|
79
|
+
{node.label}
|
|
80
|
+
</text>
|
|
81
|
+
</g>
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export default function FlowVisualizer({ nodes, edges, state, onNodeClick }: FlowVisualizerProps) {
|
|
86
|
+
const svgRef = useRef<SVGSVGElement>(null);
|
|
87
|
+
const [transform, setTransform] = useState<ViewTransform>({ x: 0, y: 0, scale: 1 });
|
|
88
|
+
const [isPanning, setIsPanning] = useState(false);
|
|
89
|
+
const panStart = useRef({ x: 0, y: 0 });
|
|
90
|
+
|
|
91
|
+
// Calculate viewBox based on node positions
|
|
92
|
+
const viewBox = useMemo(() => {
|
|
93
|
+
if (nodes.length === 0) return "0 0 1200 800";
|
|
94
|
+
|
|
95
|
+
let minX = Infinity, minY = Infinity, maxX = -Infinity, maxY = -Infinity;
|
|
96
|
+
|
|
97
|
+
nodes.forEach(node => {
|
|
98
|
+
minX = Math.min(minX, node.x);
|
|
99
|
+
minY = Math.min(minY, node.y);
|
|
100
|
+
maxX = Math.max(maxX, node.x + node.width);
|
|
101
|
+
maxY = Math.max(maxY, node.y + node.height);
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
// Add padding
|
|
105
|
+
const padding = 100;
|
|
106
|
+
minX -= padding;
|
|
107
|
+
minY -= padding;
|
|
108
|
+
maxX += padding;
|
|
109
|
+
maxY += padding;
|
|
110
|
+
|
|
111
|
+
let width = maxX - minX;
|
|
112
|
+
let height = maxY - minY;
|
|
113
|
+
|
|
114
|
+
// Ensure minimum dimensions for good visibility
|
|
115
|
+
const minWidth = 1200;
|
|
116
|
+
const minHeight = 800;
|
|
117
|
+
|
|
118
|
+
if (width < minWidth) {
|
|
119
|
+
const diff = minWidth - width;
|
|
120
|
+
minX -= diff / 2;
|
|
121
|
+
width = minWidth;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
if (height < minHeight) {
|
|
125
|
+
const diff = minHeight - height;
|
|
126
|
+
minY -= diff / 2;
|
|
127
|
+
height = minHeight;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
// Maintain aspect ratio (roughly 3:2)
|
|
131
|
+
const targetRatio = 1.5;
|
|
132
|
+
const currentRatio = width / height;
|
|
133
|
+
|
|
134
|
+
if (currentRatio > targetRatio) {
|
|
135
|
+
// Too wide, increase height
|
|
136
|
+
const newHeight = width / targetRatio;
|
|
137
|
+
const diff = newHeight - height;
|
|
138
|
+
minY -= diff / 2;
|
|
139
|
+
height = newHeight;
|
|
140
|
+
} else if (currentRatio < targetRatio) {
|
|
141
|
+
// Too tall, increase width
|
|
142
|
+
const newWidth = height * targetRatio;
|
|
143
|
+
const diff = newWidth - width;
|
|
144
|
+
minX -= diff / 2;
|
|
145
|
+
width = newWidth;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
return `${minX} ${minY} ${width} ${height}`;
|
|
149
|
+
}, [nodes]);
|
|
150
|
+
|
|
151
|
+
useEffect(() => {
|
|
152
|
+
const svg = svgRef.current;
|
|
153
|
+
if (!svg) return;
|
|
154
|
+
|
|
155
|
+
const handleWheel = (e: WheelEvent) => {
|
|
156
|
+
e.preventDefault();
|
|
157
|
+
setTransform(prev => {
|
|
158
|
+
const rect = svg.getBoundingClientRect();
|
|
159
|
+
const mouseX = e.clientX - rect.left;
|
|
160
|
+
const mouseY = e.clientY - rect.top;
|
|
161
|
+
const delta = e.deltaY > 0 ? 0.9 : 1.1;
|
|
162
|
+
const newScale = Math.min(Math.max(prev.scale * delta, 0.1), 5);
|
|
163
|
+
const scaleDiff = newScale - prev.scale;
|
|
164
|
+
return {
|
|
165
|
+
x: prev.x - (mouseX / prev.scale) * scaleDiff,
|
|
166
|
+
y: prev.y - (mouseY / prev.scale) * scaleDiff,
|
|
167
|
+
scale: newScale,
|
|
168
|
+
};
|
|
169
|
+
});
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
svg.addEventListener('wheel', handleWheel, { passive: false });
|
|
173
|
+
return () => svg.removeEventListener('wheel', handleWheel);
|
|
174
|
+
}, []);
|
|
175
|
+
|
|
176
|
+
const isNodeTarget = useCallback((target: Element) => target.closest('g[data-node]'), []);
|
|
177
|
+
|
|
178
|
+
const handleMouseDown = useCallback((e: React.MouseEvent) => {
|
|
179
|
+
if (e.button !== 0 || isNodeTarget(e.target as Element)) return;
|
|
180
|
+
setIsPanning(true);
|
|
181
|
+
panStart.current = { x: e.clientX - transform.x, y: e.clientY - transform.y };
|
|
182
|
+
}, [transform.x, transform.y, isNodeTarget]);
|
|
183
|
+
|
|
184
|
+
const handleMouseMove = useCallback((e: React.MouseEvent) => {
|
|
185
|
+
if (!isPanning) return;
|
|
186
|
+
setTransform(prev => ({ ...prev, x: e.clientX - panStart.current.x, y: e.clientY - panStart.current.y }));
|
|
187
|
+
}, [isPanning]);
|
|
188
|
+
|
|
189
|
+
const handleMouseUp = useCallback(() => setIsPanning(false), []);
|
|
190
|
+
|
|
191
|
+
const handleDoubleClick = useCallback((e: React.MouseEvent) => {
|
|
192
|
+
if (!isNodeTarget(e.target as Element)) setTransform({ x: 0, y: 0, scale: 1 });
|
|
193
|
+
}, [isNodeTarget]);
|
|
194
|
+
|
|
195
|
+
return (
|
|
196
|
+
<svg
|
|
197
|
+
ref={svgRef}
|
|
198
|
+
viewBox={viewBox}
|
|
199
|
+
className="w-full h-full"
|
|
200
|
+
style={{ cursor: isPanning ? 'grabbing' : 'grab' }}
|
|
201
|
+
onMouseDown={handleMouseDown}
|
|
202
|
+
onMouseMove={handleMouseMove}
|
|
203
|
+
onMouseUp={handleMouseUp}
|
|
204
|
+
onMouseLeave={handleMouseUp}
|
|
205
|
+
onDoubleClick={handleDoubleClick}
|
|
206
|
+
>
|
|
207
|
+
<defs>
|
|
208
|
+
<linearGradient id="gradient-current" x1="0%" y1="0%" x2="100%" y2="100%">
|
|
209
|
+
<stop offset="0%" stopColor="var(--flow-gradient-start)" />
|
|
210
|
+
<stop offset="100%" stopColor="var(--flow-gradient-end)" />
|
|
211
|
+
</linearGradient>
|
|
212
|
+
<marker id="arrow-current" markerWidth="12" markerHeight="12" refX="10" refY="3" orient="auto">
|
|
213
|
+
<path d="M0,0 L0,6 L9,3 z" className="flow-arrow-current" fill="var(--flow-edge-current)" />
|
|
214
|
+
</marker>
|
|
215
|
+
<marker id="arrow-traversed" markerWidth="12" markerHeight="12" refX="10" refY="3" orient="auto">
|
|
216
|
+
<path d="M0,0 L0,6 L9,3 z" className="flow-arrow-traversed" fill="var(--flow-edge-traversed)" />
|
|
217
|
+
</marker>
|
|
218
|
+
<marker id="arrow-untraversed" markerWidth="12" markerHeight="12" refX="10" refY="3" orient="auto">
|
|
219
|
+
<path d="M0,0 L0,6 L9,3 z" className="flow-arrow-untraversed" fill="var(--flow-edge-untraversed)" />
|
|
220
|
+
</marker>
|
|
221
|
+
</defs>
|
|
222
|
+
<rect width="100%" height="100%" fill="var(--flow-bg)" />
|
|
223
|
+
|
|
224
|
+
<g transform={`translate(${transform.x}, ${transform.y}) scale(${transform.scale})`}>
|
|
225
|
+
{edges.map((edge) => {
|
|
226
|
+
const edgeState = state.edgeStates[edge.id];
|
|
227
|
+
return (
|
|
228
|
+
<g key={edge.id} className={`flow-edge-${edgeState}`}>
|
|
229
|
+
<path
|
|
230
|
+
d={edge.path}
|
|
231
|
+
stroke={`var(--flow-edge-${edgeState})`}
|
|
232
|
+
strokeWidth={edgeState === 'current' ? 2.5 : edgeState === 'traversed' ? 2 : 1.5}
|
|
233
|
+
fill="none"
|
|
234
|
+
markerEnd={`url(#arrow-${edgeState})`}
|
|
235
|
+
strokeDasharray={edgeState === 'untraversed' ? '5,5' : 'none'}
|
|
236
|
+
/>
|
|
237
|
+
{edge.label && edge.labelX && edge.labelY && (
|
|
238
|
+
<text
|
|
239
|
+
x={edge.labelX}
|
|
240
|
+
y={edge.labelY}
|
|
241
|
+
fill={edgeState === 'current' ? 'var(--flow-edge-current)' : 'var(--flow-text-secondary)'}
|
|
242
|
+
className="flow-node-sublabel"
|
|
243
|
+
>
|
|
244
|
+
{edge.label}
|
|
245
|
+
</text>
|
|
246
|
+
)}
|
|
247
|
+
</g>
|
|
248
|
+
);
|
|
249
|
+
})}
|
|
250
|
+
|
|
251
|
+
{nodes.map((node) => (
|
|
252
|
+
<Node key={node.id} node={node} state={state} onClick={onNodeClick ? () => onNodeClick(node.id) : undefined} />
|
|
253
|
+
))}
|
|
254
|
+
</g>
|
|
255
|
+
</svg>
|
|
256
|
+
);
|
|
257
|
+
}
|