cognitune 0.3.1 → 0.3.3
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/CHANGELOG.md +19 -0
- package/dist/web/assets/Map-BrvreBEy.js +11 -0
- package/dist/web/assets/{Practice-DNf-tMjl.js → Practice-DISXSHVX.js} +3 -3
- package/dist/web/assets/{_baseUniq-7KLmbwxc.js → _baseUniq-COwRl6vV.js} +1 -1
- package/dist/web/assets/{architectureDiagram-UYN6MBPD-DFK-K3Yp.js → architectureDiagram-UYN6MBPD-_9Wfq1su.js} +1 -1
- package/dist/web/assets/{blockDiagram-ZHA2E4KO-D9jSBc-F.js → blockDiagram-ZHA2E4KO-CufQ8L2_.js} +1 -1
- package/dist/web/assets/{c4Diagram-6F5ED5ID-KAOALvx3.js → c4Diagram-6F5ED5ID-B40qb_UG.js} +1 -1
- package/dist/web/assets/channel-DVVniLQS.js +1 -0
- package/dist/web/assets/{chunk-5HRBRIJM-Btr12S8H.js → chunk-5HRBRIJM-D6bxTFIE.js} +1 -1
- package/dist/web/assets/{chunk-7U56Z5CX-NWMyaEQ0.js → chunk-7U56Z5CX-BoRg8r5Q.js} +1 -1
- package/dist/web/assets/{chunk-ASOPGD6M-DdvxpUSZ.js → chunk-ASOPGD6M-BtP71aab.js} +1 -1
- package/dist/web/assets/{chunk-KFBOBJHC-CLK5Qods.js → chunk-KFBOBJHC-T-v0Fw19.js} +1 -1
- package/dist/web/assets/{chunk-T2TOU4HS-B-nrzheR.js → chunk-T2TOU4HS-CV9j5mPR.js} +1 -1
- package/dist/web/assets/{chunk-TMUBEWPD-DCsdC8PC.js → chunk-TMUBEWPD-C5MuNi5X.js} +1 -1
- package/dist/web/assets/classDiagram-LNE6IOMH-BtGGSWnn.js +1 -0
- package/dist/web/assets/classDiagram-v2-MQ7JQ4JX-BtGGSWnn.js +1 -0
- package/dist/web/assets/clone-CHU5hDkS.js +1 -0
- package/dist/web/assets/{dagre-4EVJKHTY-D_09gC0H.js → dagre-4EVJKHTY-C88qC3Rn.js} +1 -1
- package/dist/web/assets/{diagram-QW4FP2JN-quH5WQny.js → diagram-QW4FP2JN-OyHbrzI4.js} +1 -1
- package/dist/web/assets/{erDiagram-6RL3IURR-BmJHLDew.js → erDiagram-6RL3IURR-CeZWTGfc.js} +1 -1
- package/dist/web/assets/{flowDiagram-7ASYPVHJ-DNzT7Cua.js → flowDiagram-7ASYPVHJ-uZ6FeujK.js} +1 -1
- package/dist/web/assets/{ganttDiagram-NTVNEXSI-6reJ1AIG.js → ganttDiagram-NTVNEXSI-y87xBPPC.js} +1 -1
- package/dist/web/assets/{gitGraph-YCYPL57B-BfipSUJ3.js → gitGraph-YCYPL57B-JbpUhCOb.js} +1 -1
- package/dist/web/assets/{gitGraphDiagram-NRZ2UAAF-BRb9bqzI.js → gitGraphDiagram-NRZ2UAAF-CBflcq4l.js} +1 -1
- package/dist/web/assets/{graph-BHXuL-RR.js → graph-BENdOhGY.js} +1 -1
- package/dist/web/assets/{index-B49g1XNF.js → index-2yyy2zDR.js} +1 -1
- package/dist/web/assets/{index-CyHGDhfc.js → index-4w6BhxJp.js} +1 -1
- package/dist/web/assets/{index-wnqHtEcu.js → index-B3zAKIsi.js} +1 -1
- package/dist/web/assets/{index-B5Tomqy6.js → index-BW-P1b2P.js} +1 -1
- package/dist/web/assets/{index-C5JoMvch.js → index-BvN75pDj.js} +1 -1
- package/dist/web/assets/{index-CNViI9C2.js → index-BwUlLYg9.js} +1 -1
- package/dist/web/assets/{index-dA5Y-R2D.js → index-CD0Svk5N.js} +5 -5
- package/dist/web/assets/{index-BCM7jSxq.js → index-CQkpDjjo.js} +1 -1
- package/dist/web/assets/{index-Dl6tJxzv.js → index-CS0KLfR9.js} +1 -1
- package/dist/web/assets/{index-DXji-ikE.js → index-Ci0OeEKD.js} +1 -1
- package/dist/web/assets/{index-7JDqNzz1.js → index-Cp_uy0cX.js} +1 -1
- package/dist/web/assets/{index-D-DY42g9.js → index-DA4eOekM.js} +1 -1
- package/dist/web/assets/{index-BiiiKqbq.js → index-DXd86_iZ.js} +1 -1
- package/dist/web/assets/{index-CQjof-kk.js → index-DsyF1mt_.js} +1 -1
- package/dist/web/assets/{index-DRri1mnd.js → index-NmiWGsYf.js} +1 -1
- package/dist/web/assets/{index-BM9KwSU5.js → index-Phd-KO8I.js} +1 -1
- package/dist/web/assets/{index-TI1LWXRL.js → index-VfqaEwv8.js} +1 -1
- package/dist/web/assets/{index-Bli4383n.js → index-cw4XuS89.js} +1 -1
- package/dist/web/assets/{index-C67RtHfG.js → index-ixUgJMrH.js} +1 -1
- package/dist/web/assets/{index-ysHMZpcw.js → index-l0x6IlG7.js} +1 -1
- package/dist/web/assets/{index-D_DIS1os.js → index-oIdJi7Q2.js} +1 -1
- package/dist/web/assets/index-oaBcbKx0.css +1 -0
- package/dist/web/assets/{index-BsH1Ca5H.js → index-ts3LSFgg.js} +1 -1
- package/dist/web/assets/{index-Bsf4UF_h.js → index-yvz8KzFj.js} +1 -1
- package/dist/web/assets/{infoDiagram-A4XQUW5V-CE9eDiRA.js → infoDiagram-A4XQUW5V-CsRrWifr.js} +1 -1
- package/dist/web/assets/{journeyDiagram-G5WM74LC-D_iPCzBK.js → journeyDiagram-G5WM74LC-DC7Hbsp0.js} +1 -1
- package/dist/web/assets/{kanban-definition-QRCXZQQD-Bxj-EOmZ.js → kanban-definition-QRCXZQQD-Bo5HNBfS.js} +1 -1
- package/dist/web/assets/{layout-CQ6J22ew.js → layout-d7TQ04W7.js} +1 -1
- package/dist/web/assets/{layout.worker-Bzrmqu8H.js → layout.worker-Dx5bqvNP.js} +1 -1
- package/dist/web/assets/{mermaid.core-27sLJoRM.js → mermaid.core-xu0G1s5D.js} +4 -4
- package/dist/web/assets/{min-h0zR_W4w.js → min-DPqoX6mH.js} +1 -1
- package/dist/web/assets/{mindmap-definition-GWI6TPTV-DiBTVWc8.js → mindmap-definition-GWI6TPTV-BkHsjDT1.js} +28 -28
- package/dist/web/assets/{pieDiagram-YF2LJOPJ-BE2VMHC3.js → pieDiagram-YF2LJOPJ-7r8Dzz2j.js} +1 -1
- package/dist/web/assets/{quadrantDiagram-OS5C2QUG-DkN-8Avj.js → quadrantDiagram-OS5C2QUG-p6-v0-FD.js} +1 -1
- package/dist/web/assets/{requirementDiagram-MIRIMTAZ-0OCRbKti.js → requirementDiagram-MIRIMTAZ-69i-6ive.js} +1 -1
- package/dist/web/assets/{sankeyDiagram-Y46BX6SQ-6v9qBJFv.js → sankeyDiagram-Y46BX6SQ-CT2tON08.js} +1 -1
- package/dist/web/assets/{sequenceDiagram-G6AWOVSC-CjH7axp-.js → sequenceDiagram-G6AWOVSC-B6t5TVF5.js} +1 -1
- package/dist/web/assets/{stateDiagram-MAYHULR4-Bbbno_Ix.js → stateDiagram-MAYHULR4-DdNGwnVQ.js} +1 -1
- package/dist/web/assets/stateDiagram-v2-4JROLMXI-kJAkVKtc.js +1 -0
- package/dist/web/assets/{timeline-definition-U7ZMHBDA-BSIsFSlr.js → timeline-definition-U7ZMHBDA-CgCCWNTr.js} +1 -1
- package/dist/web/assets/{xychartDiagram-6QU3TZC5-B12dxFiy.js → xychartDiagram-6QU3TZC5-_rQykDFm.js} +1 -1
- package/dist/web/index.html +2 -2
- package/package.json +1 -1
- package/dist/web/assets/Map-xBJDQ_Xn.js +0 -1
- package/dist/web/assets/channel-BW4MllLS.js +0 -1
- package/dist/web/assets/classDiagram-LNE6IOMH-D4kEJsvG.js +0 -1
- package/dist/web/assets/classDiagram-v2-MQ7JQ4JX-D4kEJsvG.js +0 -1
- package/dist/web/assets/clone-C8mTbP7R.js +0 -1
- package/dist/web/assets/index-CyhIx47s.css +0 -1
- package/dist/web/assets/stateDiagram-v2-4JROLMXI-CvrRdVH2.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as Ge,G as g,i as b,v as E}from"./graph-BHXuL-RR.js";import{i as X,c as C,k as Ye,o as $e,p as ve,q as pe,t as De,u as we,v as qe,w as me,d as G,x as We,b as Xe,y as ze,n as f,m as I,r as B}from"./_baseUniq-7KLmbwxc.js";import{f as O,b as be,a as Ue,c as He,m as w,d as P}from"./min-h0zR_W4w.js";import{aE as M,aQ as Ke,aR as Je,aL as ge,aS as S,av as ye,aT as Qe,an as Ze,aU as en,aV as nn,ap as xe,aW as rn,aK as Ee,ao as ke,aC as tn,aN as an,aX as z}from"./mermaid.core-27sLJoRM.js";var on=/\s/;function un(e){for(var n=e.length;n--&&on.test(e.charAt(n)););return n}var dn=/^\s+/;function sn(e){return e&&e.slice(0,un(e)+1).replace(dn,"")}var re=NaN,fn=/^[-+]0x[0-9a-f]+$/i,cn=/^0b[01]+$/i,hn=/^0o[0-7]+$/i,ln=parseInt;function vn(e){if(typeof e=="number")return e;if(X(e))return re;if(M(e)){var n=typeof e.valueOf=="function"?e.valueOf():e;e=M(n)?n+"":n}if(typeof e!="string")return e===0?e:+e;e=sn(e);var r=cn.test(e);return r||hn.test(e)?ln(e.slice(2),r?2:8):fn.test(e)?re:+e}var te=1/0,pn=17976931348623157e292;function T(e){if(!e)return e===0?e:0;if(e=vn(e),e===te||e===-te){var n=e<0?-1:1;return n*pn}return e===e?e:0}function wn(e){var n=T(e),r=n%1;return n===n?r?n-r:n:0}function mn(e){return Ke(Je(e,void 0,O),e+"")}var bn=1,gn=4;function yn(e){return Ge(e,bn|gn)}var Oe=Object.prototype,xn=Oe.hasOwnProperty,En=ge(function(e,n){e=Object(e);var r=-1,t=n.length,i=t>2?n[2]:void 0;for(i&&S(n[0],n[1],i)&&(t=1);++r<t;)for(var o=n[r],a=ye(o),u=-1,d=a.length;++u<d;){var s=a[u],c=e[s];(c===void 0||Qe(c,Oe[s])&&!xn.call(e,s))&&(e[s]=o[s])}return e});function F(e){var n=e==null?0:e.length;return n?e[n-1]:void 0}function kn(e){return function(n,r,t){var i=Object(n);if(!Ze(n)){var o=C(r);n=Ye(n),r=function(u){return o(i[u],u,i)}}var a=e(n,r,t);return a>-1?i[o?n[a]:a]:void 0}}var On=Math.max;function Nn(e,n,r){var t=e==null?0:e.length;if(!t)return-1;var i=r==null?0:wn(r);return i<0&&(i=On(t+i,0)),$e(e,C(n),i)}var H=kn(Nn);function Ln(e,n){return e==null?e:en(e,ve(n),ye)}function Pn(e,n){return e&&pe(e,ve(n))}function _n(e,n){return e>n}var Cn=Object.prototype,In=Cn.hasOwnProperty;function Rn(e,n){return e!=null&&In.call(e,n)}function Ne(e,n){return e!=null&&De(e,n,Rn)}function V(e,n){var r={};return n=C(n),pe(e,function(t,i,o){nn(r,i,n(t,i,o))}),r}function y(e){return e&&e.length?be(e,xe,_n):void 0}function K(e,n){return e&&e.length?be(e,C(n),Ue):void 0}function Tn(e,n,r,t){if(!M(e))return e;n=we(n,e);for(var i=-1,o=n.length,a=o-1,u=e;u!=null&&++i<o;){var d=qe(n[i]),s=r;if(d==="__proto__"||d==="constructor"||d==="prototype")return e;if(i!=a){var c=u[d];s=void 0,s===void 0&&(s=M(c)?c:rn(n[i+1])?[]:{})}Ee(u,d,s),u=u[d]}return e}function Mn(e,n,r){for(var t=-1,i=n.length,o={};++t<i;){var a=n[t],u=me(e,a);r(u,a)&&Tn(o,we(a,e),u)}return o}function Sn(e,n){var r=e.length;for(e.sort(n);r--;)e[r]=e[r].value;return e}function Fn(e,n){if(e!==n){var r=e!==void 0,t=e===null,i=e===e,o=X(e),a=n!==void 0,u=n===null,d=n===n,s=X(n);if(!u&&!s&&!o&&e>n||o&&a&&d&&!u&&!s||t&&a&&d||!r&&d||!i)return 1;if(!t&&!o&&!s&&e<n||s&&r&&i&&!t&&!o||u&&r&&i||!a&&i||!d)return-1}return 0}function An(e,n,r){for(var t=-1,i=e.criteria,o=n.criteria,a=i.length,u=r.length;++t<a;){var d=Fn(i[t],o[t]);if(d){if(t>=u)return d;var s=r[t];return d*(s=="desc"?-1:1)}}return e.index-n.index}function Bn(e,n,r){n.length?n=G(n,function(o){return ke(o)?function(a){return me(a,o.length===1?o[0]:o)}:o}):n=[xe];var t=-1;n=G(n,tn(C));var i=He(e,function(o,a,u){var d=G(n,function(s){return s(o)});return{criteria:d,index:++t,value:o}});return Sn(i,function(o,a){return An(o,a,r)})}function Vn(e,n){return Mn(e,n,function(r,t){return We(e,t)})}var A=mn(function(e,n){return e==null?{}:Vn(e,n)}),jn=Math.ceil,Gn=Math.max;function Yn(e,n,r,t){for(var i=-1,o=Gn(jn((n-e)/(r||1)),0),a=Array(o);o--;)a[++i]=e,e+=r;return a}function $n(e){return function(n,r,t){return t&&typeof t!="number"&&S(n,r,t)&&(r=t=void 0),n=T(n),r===void 0?(r=n,n=0):r=T(r),t=t===void 0?n<r?1:-1:T(t),Yn(n,r,t)}}var k=$n(),R=ge(function(e,n){if(e==null)return[];var r=n.length;return r>1&&S(e,n[0],n[1])?n=[]:r>2&&S(n[0],n[1],n[2])&&(n=[n[0]]),Bn(e,Xe(n),[])}),Dn=0;function J(e){var n=++Dn;return ze(e)+n}function qn(e,n,r){for(var t=-1,i=e.length,o=n.length,a={};++t<i;){var u=t<o?n[t]:void 0;r(a,e[t],u)}return a}function Wn(e,n){return qn(e||[],n||[],Ee)}class Xn{constructor(){var n={};n._next=n._prev=n,this._sentinel=n}dequeue(){var n=this._sentinel,r=n._prev;if(r!==n)return ie(r),r}enqueue(n){var r=this._sentinel;n._prev&&n._next&&ie(n),n._next=r._next,r._next._prev=n,r._next=n,n._prev=r}toString(){for(var n=[],r=this._sentinel,t=r._prev;t!==r;)n.push(JSON.stringify(t,zn)),t=t._prev;return"["+n.join(", ")+"]"}}function ie(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function zn(e,n){if(e!=="_next"&&e!=="_prev")return n}var Un=an(1);function Hn(e,n){if(e.nodeCount()<=1)return[];var r=Jn(e,n||Un),t=Kn(r.graph,r.buckets,r.zeroIdx);return O(w(t,function(i){return e.outEdges(i.v,i.w)}))}function Kn(e,n,r){for(var t=[],i=n[n.length-1],o=n[0],a;e.nodeCount();){for(;a=o.dequeue();)Y(e,n,r,a);for(;a=i.dequeue();)Y(e,n,r,a);if(e.nodeCount()){for(var u=n.length-2;u>0;--u)if(a=n[u].dequeue(),a){t=t.concat(Y(e,n,r,a,!0));break}}}return t}function Y(e,n,r,t,i){var o=i?[]:void 0;return f(e.inEdges(t.v),function(a){var u=e.edge(a),d=e.node(a.v);i&&o.push({v:a.v,w:a.w}),d.out-=u,U(n,r,d)}),f(e.outEdges(t.v),function(a){var u=e.edge(a),d=a.w,s=e.node(d);s.in-=u,U(n,r,s)}),e.removeNode(t.v),o}function Jn(e,n){var r=new g,t=0,i=0;f(e.nodes(),function(u){r.setNode(u,{v:u,in:0,out:0})}),f(e.edges(),function(u){var d=r.edge(u.v,u.w)||0,s=n(u),c=d+s;r.setEdge(u.v,u.w,c),i=Math.max(i,r.node(u.v).out+=s),t=Math.max(t,r.node(u.w).in+=s)});var o=k(i+t+3).map(function(){return new Xn}),a=t+1;return f(r.nodes(),function(u){U(o,a,r.node(u))}),{graph:r,buckets:o,zeroIdx:a}}function U(e,n,r){r.out?r.in?e[r.out-r.in+n].enqueue(r):e[e.length-1].enqueue(r):e[0].enqueue(r)}function Qn(e){var n=e.graph().acyclicer==="greedy"?Hn(e,r(e)):Zn(e);f(n,function(t){var i=e.edge(t);e.removeEdge(t),i.forwardName=t.name,i.reversed=!0,e.setEdge(t.w,t.v,i,J("rev"))});function r(t){return function(i){return t.edge(i).weight}}}function Zn(e){var n=[],r={},t={};function i(o){Object.prototype.hasOwnProperty.call(t,o)||(t[o]=!0,r[o]=!0,f(e.outEdges(o),function(a){Object.prototype.hasOwnProperty.call(r,a.w)?n.push(a):i(a.w)}),delete r[o])}return f(e.nodes(),i),n}function er(e){f(e.edges(),function(n){var r=e.edge(n);if(r.reversed){e.removeEdge(n);var t=r.forwardName;delete r.reversed,delete r.forwardName,e.setEdge(n.w,n.v,r,t)}})}function N(e,n,r,t){var i;do i=J(t);while(e.hasNode(i));return r.dummy=n,e.setNode(i,r),i}function nr(e){var n=new g().setGraph(e.graph());return f(e.nodes(),function(r){n.setNode(r,e.node(r))}),f(e.edges(),function(r){var t=n.edge(r.v,r.w)||{weight:0,minlen:1},i=e.edge(r);n.setEdge(r.v,r.w,{weight:t.weight+i.weight,minlen:Math.max(t.minlen,i.minlen)})}),n}function Le(e){var n=new g({multigraph:e.isMultigraph()}).setGraph(e.graph());return f(e.nodes(),function(r){e.children(r).length||n.setNode(r,e.node(r))}),f(e.edges(),function(r){n.setEdge(r,e.edge(r))}),n}function ae(e,n){var r=e.x,t=e.y,i=n.x-r,o=n.y-t,a=e.width/2,u=e.height/2;if(!i&&!o)throw new Error("Not possible to find intersection inside of the rectangle");var d,s;return Math.abs(o)*a>Math.abs(i)*u?(o<0&&(u=-u),d=u*i/o,s=u):(i<0&&(a=-a),d=a,s=a*o/i),{x:r+d,y:t+s}}function j(e){var n=w(k(Pe(e)+1),function(){return[]});return f(e.nodes(),function(r){var t=e.node(r),i=t.rank;b(i)||(n[i][t.order]=r)}),n}function rr(e){var n=P(w(e.nodes(),function(r){return e.node(r).rank}));f(e.nodes(),function(r){var t=e.node(r);Ne(t,"rank")&&(t.rank-=n)})}function tr(e){var n=P(w(e.nodes(),function(o){return e.node(o).rank})),r=[];f(e.nodes(),function(o){var a=e.node(o).rank-n;r[a]||(r[a]=[]),r[a].push(o)});var t=0,i=e.graph().nodeRankFactor;f(r,function(o,a){b(o)&&a%i!==0?--t:t&&f(o,function(u){e.node(u).rank+=t})})}function oe(e,n,r,t){var i={width:0,height:0};return arguments.length>=4&&(i.rank=r,i.order=t),N(e,"border",i,n)}function Pe(e){return y(w(e.nodes(),function(n){var r=e.node(n).rank;if(!b(r))return r}))}function ir(e,n){var r={lhs:[],rhs:[]};return f(e,function(t){n(t)?r.lhs.push(t):r.rhs.push(t)}),r}function ar(e,n){return n()}function or(e){function n(r){var t=e.children(r),i=e.node(r);if(t.length&&f(t,n),Object.prototype.hasOwnProperty.call(i,"minRank")){i.borderLeft=[],i.borderRight=[];for(var o=i.minRank,a=i.maxRank+1;o<a;++o)ue(e,"borderLeft","_bl",r,i,o),ue(e,"borderRight","_br",r,i,o)}}f(e.children(),n)}function ue(e,n,r,t,i,o){var a={width:0,height:0,rank:o,borderType:n},u=i[n][o-1],d=N(e,"border",a,r);i[n][o]=d,e.setParent(d,t),u&&e.setEdge(u,d,{weight:1})}function ur(e){var n=e.graph().rankdir.toLowerCase();(n==="lr"||n==="rl")&&_e(e)}function dr(e){var n=e.graph().rankdir.toLowerCase();(n==="bt"||n==="rl")&&sr(e),(n==="lr"||n==="rl")&&(fr(e),_e(e))}function _e(e){f(e.nodes(),function(n){de(e.node(n))}),f(e.edges(),function(n){de(e.edge(n))})}function de(e){var n=e.width;e.width=e.height,e.height=n}function sr(e){f(e.nodes(),function(n){$(e.node(n))}),f(e.edges(),function(n){var r=e.edge(n);f(r.points,$),Object.prototype.hasOwnProperty.call(r,"y")&&$(r)})}function $(e){e.y=-e.y}function fr(e){f(e.nodes(),function(n){D(e.node(n))}),f(e.edges(),function(n){var r=e.edge(n);f(r.points,D),Object.prototype.hasOwnProperty.call(r,"x")&&D(r)})}function D(e){var n=e.x;e.x=e.y,e.y=n}function cr(e){e.graph().dummyChains=[],f(e.edges(),function(n){hr(e,n)})}function hr(e,n){var r=n.v,t=e.node(r).rank,i=n.w,o=e.node(i).rank,a=n.name,u=e.edge(n),d=u.labelRank;if(o!==t+1){e.removeEdge(n);var s=void 0,c,h;for(h=0,++t;t<o;++h,++t)u.points=[],s={width:0,height:0,edgeLabel:u,edgeObj:n,rank:t},c=N(e,"edge",s,"_d"),t===d&&(s.width=u.width,s.height=u.height,s.dummy="edge-label",s.labelpos=u.labelpos),e.setEdge(r,c,{weight:u.weight},a),h===0&&e.graph().dummyChains.push(c),r=c;e.setEdge(r,i,{weight:u.weight},a)}}function lr(e){f(e.graph().dummyChains,function(n){var r=e.node(n),t=r.edgeLabel,i;for(e.setEdge(r.edgeObj,t);r.dummy;)i=e.successors(n)[0],e.removeNode(n),t.points.push({x:r.x,y:r.y}),r.dummy==="edge-label"&&(t.x=r.x,t.y=r.y,t.width=r.width,t.height=r.height),n=i,r=e.node(n)})}function Q(e){var n={};function r(t){var i=e.node(t);if(Object.prototype.hasOwnProperty.call(n,t))return i.rank;n[t]=!0;var o=P(w(e.outEdges(t),function(a){return r(a.w)-e.edge(a).minlen}));return(o===Number.POSITIVE_INFINITY||o===void 0||o===null)&&(o=0),i.rank=o}f(e.sources(),r)}function _(e,n){return e.node(n.w).rank-e.node(n.v).rank-e.edge(n).minlen}function Ce(e){var n=new g({directed:!1}),r=e.nodes()[0],t=e.nodeCount();n.setNode(r,{});for(var i,o;vr(n,e)<t;)i=pr(n,e),o=n.hasNode(i.v)?_(e,i):-_(e,i),wr(n,e,o);return n}function vr(e,n){function r(t){f(n.nodeEdges(t),function(i){var o=i.v,a=t===o?i.w:o;!e.hasNode(a)&&!_(n,i)&&(e.setNode(a,{}),e.setEdge(t,a,{}),r(a))})}return f(e.nodes(),r),e.nodeCount()}function pr(e,n){return K(n.edges(),function(r){if(e.hasNode(r.v)!==e.hasNode(r.w))return _(n,r)})}function wr(e,n,r){f(e.nodes(),function(t){n.node(t).rank+=r})}function mr(){}mr.prototype=new Error;function Ie(e,n,r){ke(n)||(n=[n]);var t=(e.isDirected()?e.successors:e.neighbors).bind(e),i=[],o={};return f(n,function(a){if(!e.hasNode(a))throw new Error("Graph does not have node: "+a);Re(e,a,r==="post",o,t,i)}),i}function Re(e,n,r,t,i,o){Object.prototype.hasOwnProperty.call(t,n)||(t[n]=!0,r||o.push(n),f(i(n),function(a){Re(e,a,r,t,i,o)}),r&&o.push(n))}function br(e,n){return Ie(e,n,"post")}function gr(e,n){return Ie(e,n,"pre")}x.initLowLimValues=ee;x.initCutValues=Z;x.calcCutValue=Te;x.leaveEdge=Se;x.enterEdge=Fe;x.exchangeEdges=Ae;function x(e){e=nr(e),Q(e);var n=Ce(e);ee(n),Z(n,e);for(var r,t;r=Se(n);)t=Fe(n,e,r),Ae(n,e,r,t)}function Z(e,n){var r=br(e,e.nodes());r=r.slice(0,r.length-1),f(r,function(t){yr(e,n,t)})}function yr(e,n,r){var t=e.node(r),i=t.parent;e.edge(r,i).cutvalue=Te(e,n,r)}function Te(e,n,r){var t=e.node(r),i=t.parent,o=!0,a=n.edge(r,i),u=0;return a||(o=!1,a=n.edge(i,r)),u=a.weight,f(n.nodeEdges(r),function(d){var s=d.v===r,c=s?d.w:d.v;if(c!==i){var h=s===o,l=n.edge(d).weight;if(u+=h?l:-l,Er(e,r,c)){var v=e.edge(r,c).cutvalue;u+=h?-v:v}}}),u}function ee(e,n){arguments.length<2&&(n=e.nodes()[0]),Me(e,{},1,n)}function Me(e,n,r,t,i){var o=r,a=e.node(t);return n[t]=!0,f(e.neighbors(t),function(u){Object.prototype.hasOwnProperty.call(n,u)||(r=Me(e,n,r,u,t))}),a.low=o,a.lim=r++,i?a.parent=i:delete a.parent,r}function Se(e){return H(e.edges(),function(n){return e.edge(n).cutvalue<0})}function Fe(e,n,r){var t=r.v,i=r.w;n.hasEdge(t,i)||(t=r.w,i=r.v);var o=e.node(t),a=e.node(i),u=o,d=!1;o.lim>a.lim&&(u=a,d=!0);var s=I(n.edges(),function(c){return d===se(e,e.node(c.v),u)&&d!==se(e,e.node(c.w),u)});return K(s,function(c){return _(n,c)})}function Ae(e,n,r,t){var i=r.v,o=r.w;e.removeEdge(i,o),e.setEdge(t.v,t.w,{}),ee(e),Z(e,n),xr(e,n)}function xr(e,n){var r=H(e.nodes(),function(i){return!n.node(i).parent}),t=gr(e,r);t=t.slice(1),f(t,function(i){var o=e.node(i).parent,a=n.edge(i,o),u=!1;a||(a=n.edge(o,i),u=!0),n.node(i).rank=n.node(o).rank+(u?a.minlen:-a.minlen)})}function Er(e,n,r){return e.hasEdge(n,r)}function se(e,n,r){return r.low<=n.lim&&n.lim<=r.lim}function kr(e){switch(e.graph().ranker){case"network-simplex":fe(e);break;case"tight-tree":Nr(e);break;case"longest-path":Or(e);break;default:fe(e)}}var Or=Q;function Nr(e){Q(e),Ce(e)}function fe(e){x(e)}function Lr(e){var n=N(e,"root",{},"_root"),r=Pr(e),t=y(E(r))-1,i=2*t+1;e.graph().nestingRoot=n,f(e.edges(),function(a){e.edge(a).minlen*=i});var o=_r(e)+1;f(e.children(),function(a){Be(e,n,i,o,t,r,a)}),e.graph().nodeRankFactor=i}function Be(e,n,r,t,i,o,a){var u=e.children(a);if(!u.length){a!==n&&e.setEdge(n,a,{weight:0,minlen:r});return}var d=oe(e,"_bt"),s=oe(e,"_bb"),c=e.node(a);e.setParent(d,a),c.borderTop=d,e.setParent(s,a),c.borderBottom=s,f(u,function(h){Be(e,n,r,t,i,o,h);var l=e.node(h),v=l.borderTop?l.borderTop:h,p=l.borderBottom?l.borderBottom:h,m=l.borderTop?t:2*t,L=v!==p?1:i-o[a]+1;e.setEdge(d,v,{weight:m,minlen:L,nestingEdge:!0}),e.setEdge(p,s,{weight:m,minlen:L,nestingEdge:!0})}),e.parent(a)||e.setEdge(n,d,{weight:0,minlen:i+o[a]})}function Pr(e){var n={};function r(t,i){var o=e.children(t);o&&o.length&&f(o,function(a){r(a,i+1)}),n[t]=i}return f(e.children(),function(t){r(t,1)}),n}function _r(e){return B(e.edges(),function(n,r){return n+e.edge(r).weight},0)}function Cr(e){var n=e.graph();e.removeNode(n.nestingRoot),delete n.nestingRoot,f(e.edges(),function(r){var t=e.edge(r);t.nestingEdge&&e.removeEdge(r)})}function Ir(e,n,r){var t={},i;f(r,function(o){for(var a=e.parent(o),u,d;a;){if(u=e.parent(a),u?(d=t[u],t[u]=a):(d=i,i=a),d&&d!==a){n.setEdge(d,a);return}a=u}})}function Rr(e,n,r){var t=Tr(e),i=new g({compound:!0}).setGraph({root:t}).setDefaultNodeLabel(function(o){return e.node(o)});return f(e.nodes(),function(o){var a=e.node(o),u=e.parent(o);(a.rank===n||a.minRank<=n&&n<=a.maxRank)&&(i.setNode(o),i.setParent(o,u||t),f(e[r](o),function(d){var s=d.v===o?d.w:d.v,c=i.edge(s,o),h=b(c)?0:c.weight;i.setEdge(s,o,{weight:e.edge(d).weight+h})}),Object.prototype.hasOwnProperty.call(a,"minRank")&&i.setNode(o,{borderLeft:a.borderLeft[n],borderRight:a.borderRight[n]}))}),i}function Tr(e){for(var n;e.hasNode(n=J("_root")););return n}function Mr(e,n){for(var r=0,t=1;t<n.length;++t)r+=Sr(e,n[t-1],n[t]);return r}function Sr(e,n,r){for(var t=Wn(r,w(r,function(s,c){return c})),i=O(w(n,function(s){return R(w(e.outEdges(s),function(c){return{pos:t[c.w],weight:e.edge(c).weight}}),"pos")})),o=1;o<r.length;)o<<=1;var a=2*o-1;o-=1;var u=w(new Array(a),function(){return 0}),d=0;return f(i.forEach(function(s){var c=s.pos+o;u[c]+=s.weight;for(var h=0;c>0;)c%2&&(h+=u[c+1]),c=c-1>>1,u[c]+=s.weight;d+=s.weight*h})),d}function Fr(e){var n={},r=I(e.nodes(),function(u){return!e.children(u).length}),t=y(w(r,function(u){return e.node(u).rank})),i=w(k(t+1),function(){return[]});function o(u){if(!Ne(n,u)){n[u]=!0;var d=e.node(u);i[d.rank].push(u),f(e.successors(u),o)}}var a=R(r,function(u){return e.node(u).rank});return f(a,o),i}function Ar(e,n){return w(n,function(r){var t=e.inEdges(r);if(t.length){var i=B(t,function(o,a){var u=e.edge(a),d=e.node(a.v);return{sum:o.sum+u.weight*d.order,weight:o.weight+u.weight}},{sum:0,weight:0});return{v:r,barycenter:i.sum/i.weight,weight:i.weight}}else return{v:r}})}function Br(e,n){var r={};f(e,function(i,o){var a=r[i.v]={indegree:0,in:[],out:[],vs:[i.v],i:o};b(i.barycenter)||(a.barycenter=i.barycenter,a.weight=i.weight)}),f(n.edges(),function(i){var o=r[i.v],a=r[i.w];!b(o)&&!b(a)&&(a.indegree++,o.out.push(r[i.w]))});var t=I(r,function(i){return!i.indegree});return Vr(t)}function Vr(e){var n=[];function r(o){return function(a){a.merged||(b(a.barycenter)||b(o.barycenter)||a.barycenter>=o.barycenter)&&jr(o,a)}}function t(o){return function(a){a.in.push(o),--a.indegree===0&&e.push(a)}}for(;e.length;){var i=e.pop();n.push(i),f(i.in.reverse(),r(i)),f(i.out,t(i))}return w(I(n,function(o){return!o.merged}),function(o){return A(o,["vs","i","barycenter","weight"])})}function jr(e,n){var r=0,t=0;e.weight&&(r+=e.barycenter*e.weight,t+=e.weight),n.weight&&(r+=n.barycenter*n.weight,t+=n.weight),e.vs=n.vs.concat(e.vs),e.barycenter=r/t,e.weight=t,e.i=Math.min(n.i,e.i),n.merged=!0}function Gr(e,n){var r=ir(e,function(c){return Object.prototype.hasOwnProperty.call(c,"barycenter")}),t=r.lhs,i=R(r.rhs,function(c){return-c.i}),o=[],a=0,u=0,d=0;t.sort(Yr(!!n)),d=ce(o,i,d),f(t,function(c){d+=c.vs.length,o.push(c.vs),a+=c.barycenter*c.weight,u+=c.weight,d=ce(o,i,d)});var s={vs:O(o)};return u&&(s.barycenter=a/u,s.weight=u),s}function ce(e,n,r){for(var t;n.length&&(t=F(n)).i<=r;)n.pop(),e.push(t.vs),r++;return r}function Yr(e){return function(n,r){return n.barycenter<r.barycenter?-1:n.barycenter>r.barycenter?1:e?r.i-n.i:n.i-r.i}}function Ve(e,n,r,t){var i=e.children(n),o=e.node(n),a=o?o.borderLeft:void 0,u=o?o.borderRight:void 0,d={};a&&(i=I(i,function(p){return p!==a&&p!==u}));var s=Ar(e,i);f(s,function(p){if(e.children(p.v).length){var m=Ve(e,p.v,r,t);d[p.v]=m,Object.prototype.hasOwnProperty.call(m,"barycenter")&&Dr(p,m)}});var c=Br(s,r);$r(c,d);var h=Gr(c,t);if(a&&(h.vs=O([a,h.vs,u]),e.predecessors(a).length)){var l=e.node(e.predecessors(a)[0]),v=e.node(e.predecessors(u)[0]);Object.prototype.hasOwnProperty.call(h,"barycenter")||(h.barycenter=0,h.weight=0),h.barycenter=(h.barycenter*h.weight+l.order+v.order)/(h.weight+2),h.weight+=2}return h}function $r(e,n){f(e,function(r){r.vs=O(r.vs.map(function(t){return n[t]?n[t].vs:t}))})}function Dr(e,n){b(e.barycenter)?(e.barycenter=n.barycenter,e.weight=n.weight):(e.barycenter=(e.barycenter*e.weight+n.barycenter*n.weight)/(e.weight+n.weight),e.weight+=n.weight)}function qr(e){var n=Pe(e),r=he(e,k(1,n+1),"inEdges"),t=he(e,k(n-1,-1,-1),"outEdges"),i=Fr(e);le(e,i);for(var o=Number.POSITIVE_INFINITY,a,u=0,d=0;d<4;++u,++d){Wr(u%2?r:t,u%4>=2),i=j(e);var s=Mr(e,i);s<o&&(d=0,a=yn(i),o=s)}le(e,a)}function he(e,n,r){return w(n,function(t){return Rr(e,t,r)})}function Wr(e,n){var r=new g;f(e,function(t){var i=t.graph().root,o=Ve(t,i,r,n);f(o.vs,function(a,u){t.node(a).order=u}),Ir(t,r,o.vs)})}function le(e,n){f(n,function(r){f(r,function(t,i){e.node(t).order=i})})}function Xr(e){var n=Ur(e);f(e.graph().dummyChains,function(r){for(var t=e.node(r),i=t.edgeObj,o=zr(e,n,i.v,i.w),a=o.path,u=o.lca,d=0,s=a[d],c=!0;r!==i.w;){if(t=e.node(r),c){for(;(s=a[d])!==u&&e.node(s).maxRank<t.rank;)d++;s===u&&(c=!1)}if(!c){for(;d<a.length-1&&e.node(s=a[d+1]).minRank<=t.rank;)d++;s=a[d]}e.setParent(r,s),r=e.successors(r)[0]}})}function zr(e,n,r,t){var i=[],o=[],a=Math.min(n[r].low,n[t].low),u=Math.max(n[r].lim,n[t].lim),d,s;d=r;do d=e.parent(d),i.push(d);while(d&&(n[d].low>a||u>n[d].lim));for(s=d,d=t;(d=e.parent(d))!==s;)o.push(d);return{path:i.concat(o.reverse()),lca:s}}function Ur(e){var n={},r=0;function t(i){var o=r;f(e.children(i),t),n[i]={low:o,lim:r++}}return f(e.children(),t),n}function Hr(e,n){var r={};function t(i,o){var a=0,u=0,d=i.length,s=F(o);return f(o,function(c,h){var l=Jr(e,c),v=l?e.node(l).order:d;(l||c===s)&&(f(o.slice(u,h+1),function(p){f(e.predecessors(p),function(m){var L=e.node(m),ne=L.order;(ne<a||v<ne)&&!(L.dummy&&e.node(p).dummy)&&je(r,m,p)})}),u=h+1,a=v)}),o}return B(n,t),r}function Kr(e,n){var r={};function t(o,a,u,d,s){var c;f(k(a,u),function(h){c=o[h],e.node(c).dummy&&f(e.predecessors(c),function(l){var v=e.node(l);v.dummy&&(v.order<d||v.order>s)&&je(r,l,c)})})}function i(o,a){var u=-1,d,s=0;return f(a,function(c,h){if(e.node(c).dummy==="border"){var l=e.predecessors(c);l.length&&(d=e.node(l[0]).order,t(a,s,h,u,d),s=h,u=d)}t(a,s,a.length,d,o.length)}),a}return B(n,i),r}function Jr(e,n){if(e.node(n).dummy)return H(e.predecessors(n),function(r){return e.node(r).dummy})}function je(e,n,r){if(n>r){var t=n;n=r,r=t}var i=e[n];i||(e[n]=i={}),i[r]=!0}function Qr(e,n,r){if(n>r){var t=n;n=r,r=t}return!!e[n]&&Object.prototype.hasOwnProperty.call(e[n],r)}function Zr(e,n,r,t){var i={},o={},a={};return f(n,function(u){f(u,function(d,s){i[d]=d,o[d]=d,a[d]=s})}),f(n,function(u){var d=-1;f(u,function(s){var c=t(s);if(c.length){c=R(c,function(m){return a[m]});for(var h=(c.length-1)/2,l=Math.floor(h),v=Math.ceil(h);l<=v;++l){var p=c[l];o[s]===s&&d<a[p]&&!Qr(r,s,p)&&(o[p]=s,o[s]=i[s]=i[p],d=a[p])}}})}),{root:i,align:o}}function et(e,n,r,t,i){var o={},a=nt(e,n,r,i),u=i?"borderLeft":"borderRight";function d(h,l){for(var v=a.nodes(),p=v.pop(),m={};p;)m[p]?h(p):(m[p]=!0,v.push(p),v=v.concat(l(p))),p=v.pop()}function s(h){o[h]=a.inEdges(h).reduce(function(l,v){return Math.max(l,o[v.v]+a.edge(v))},0)}function c(h){var l=a.outEdges(h).reduce(function(p,m){return Math.min(p,o[m.w]-a.edge(m))},Number.POSITIVE_INFINITY),v=e.node(h);l!==Number.POSITIVE_INFINITY&&v.borderType!==u&&(o[h]=Math.max(o[h],l))}return d(s,a.predecessors.bind(a)),d(c,a.successors.bind(a)),f(t,function(h){o[h]=o[r[h]]}),o}function nt(e,n,r,t){var i=new g,o=e.graph(),a=ot(o.nodesep,o.edgesep,t);return f(n,function(u){var d;f(u,function(s){var c=r[s];if(i.setNode(c),d){var h=r[d],l=i.edge(h,c);i.setEdge(h,c,Math.max(a(e,s,d),l||0))}d=s})}),i}function rt(e,n){return K(E(n),function(r){var t=Number.NEGATIVE_INFINITY,i=Number.POSITIVE_INFINITY;return Ln(r,function(o,a){var u=ut(e,a)/2;t=Math.max(o+u,t),i=Math.min(o-u,i)}),t-i})}function tt(e,n){var r=E(n),t=P(r),i=y(r);f(["u","d"],function(o){f(["l","r"],function(a){var u=o+a,d=e[u],s;if(d!==n){var c=E(d);s=a==="l"?t-P(c):i-y(c),s&&(e[u]=V(d,function(h){return h+s}))}})})}function it(e,n){return V(e.ul,function(r,t){if(n)return e[n.toLowerCase()][t];var i=R(w(e,t));return(i[1]+i[2])/2})}function at(e){var n=j(e),r=z(Hr(e,n),Kr(e,n)),t={},i;f(["u","d"],function(a){i=a==="u"?n:E(n).reverse(),f(["l","r"],function(u){u==="r"&&(i=w(i,function(h){return E(h).reverse()}));var d=(a==="u"?e.predecessors:e.successors).bind(e),s=Zr(e,i,r,d),c=et(e,i,s.root,s.align,u==="r");u==="r"&&(c=V(c,function(h){return-h})),t[a+u]=c})});var o=rt(e,t);return tt(t,o),it(t,e.graph().align)}function ot(e,n,r){return function(t,i,o){var a=t.node(i),u=t.node(o),d=0,s;if(d+=a.width/2,Object.prototype.hasOwnProperty.call(a,"labelpos"))switch(a.labelpos.toLowerCase()){case"l":s=-a.width/2;break;case"r":s=a.width/2;break}if(s&&(d+=r?s:-s),s=0,d+=(a.dummy?n:e)/2,d+=(u.dummy?n:e)/2,d+=u.width/2,Object.prototype.hasOwnProperty.call(u,"labelpos"))switch(u.labelpos.toLowerCase()){case"l":s=u.width/2;break;case"r":s=-u.width/2;break}return s&&(d+=r?s:-s),s=0,d}}function ut(e,n){return e.node(n).width}function dt(e){e=Le(e),st(e),Pn(at(e),function(n,r){e.node(r).x=n})}function st(e){var n=j(e),r=e.graph().ranksep,t=0;f(n,function(i){var o=y(w(i,function(a){return e.node(a).height}));f(i,function(a){e.node(a).y=t+o/2}),t+=o+r})}function Bt(e,n){var r=ar;r("layout",()=>{var t=r(" buildLayoutGraph",()=>yt(e));r(" runLayout",()=>ft(t,r)),r(" updateInputGraph",()=>ct(e,t))})}function ft(e,n){n(" makeSpaceForEdgeLabels",()=>xt(e)),n(" removeSelfEdges",()=>It(e)),n(" acyclic",()=>Qn(e)),n(" nestingGraph.run",()=>Lr(e)),n(" rank",()=>kr(Le(e))),n(" injectEdgeLabelProxies",()=>Et(e)),n(" removeEmptyRanks",()=>tr(e)),n(" nestingGraph.cleanup",()=>Cr(e)),n(" normalizeRanks",()=>rr(e)),n(" assignRankMinMax",()=>kt(e)),n(" removeEdgeLabelProxies",()=>Ot(e)),n(" normalize.run",()=>cr(e)),n(" parentDummyChains",()=>Xr(e)),n(" addBorderSegments",()=>or(e)),n(" order",()=>qr(e)),n(" insertSelfEdges",()=>Rt(e)),n(" adjustCoordinateSystem",()=>ur(e)),n(" position",()=>dt(e)),n(" positionSelfEdges",()=>Tt(e)),n(" removeBorderNodes",()=>Ct(e)),n(" normalize.undo",()=>lr(e)),n(" fixupEdgeLabelCoords",()=>Pt(e)),n(" undoCoordinateSystem",()=>dr(e)),n(" translateGraph",()=>Nt(e)),n(" assignNodeIntersects",()=>Lt(e)),n(" reversePoints",()=>_t(e)),n(" acyclic.undo",()=>er(e))}function ct(e,n){f(e.nodes(),function(r){var t=e.node(r),i=n.node(r);t&&(t.x=i.x,t.y=i.y,n.children(r).length&&(t.width=i.width,t.height=i.height))}),f(e.edges(),function(r){var t=e.edge(r),i=n.edge(r);t.points=i.points,Object.prototype.hasOwnProperty.call(i,"x")&&(t.x=i.x,t.y=i.y)}),e.graph().width=n.graph().width,e.graph().height=n.graph().height}var ht=["nodesep","edgesep","ranksep","marginx","marginy"],lt={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},vt=["acyclicer","ranker","rankdir","align"],pt=["width","height"],wt={width:0,height:0},mt=["minlen","weight","width","height","labeloffset"],bt={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},gt=["labelpos"];function yt(e){var n=new g({multigraph:!0,compound:!0}),r=W(e.graph());return n.setGraph(z({},lt,q(r,ht),A(r,vt))),f(e.nodes(),function(t){var i=W(e.node(t));n.setNode(t,En(q(i,pt),wt)),n.setParent(t,e.parent(t))}),f(e.edges(),function(t){var i=W(e.edge(t));n.setEdge(t,z({},bt,q(i,mt),A(i,gt)))}),n}function xt(e){var n=e.graph();n.ranksep/=2,f(e.edges(),function(r){var t=e.edge(r);t.minlen*=2,t.labelpos.toLowerCase()!=="c"&&(n.rankdir==="TB"||n.rankdir==="BT"?t.width+=t.labeloffset:t.height+=t.labeloffset)})}function Et(e){f(e.edges(),function(n){var r=e.edge(n);if(r.width&&r.height){var t=e.node(n.v),i=e.node(n.w),o={rank:(i.rank-t.rank)/2+t.rank,e:n};N(e,"edge-proxy",o,"_ep")}})}function kt(e){var n=0;f(e.nodes(),function(r){var t=e.node(r);t.borderTop&&(t.minRank=e.node(t.borderTop).rank,t.maxRank=e.node(t.borderBottom).rank,n=y(n,t.maxRank))}),e.graph().maxRank=n}function Ot(e){f(e.nodes(),function(n){var r=e.node(n);r.dummy==="edge-proxy"&&(e.edge(r.e).labelRank=r.rank,e.removeNode(n))})}function Nt(e){var n=Number.POSITIVE_INFINITY,r=0,t=Number.POSITIVE_INFINITY,i=0,o=e.graph(),a=o.marginx||0,u=o.marginy||0;function d(s){var c=s.x,h=s.y,l=s.width,v=s.height;n=Math.min(n,c-l/2),r=Math.max(r,c+l/2),t=Math.min(t,h-v/2),i=Math.max(i,h+v/2)}f(e.nodes(),function(s){d(e.node(s))}),f(e.edges(),function(s){var c=e.edge(s);Object.prototype.hasOwnProperty.call(c,"x")&&d(c)}),n-=a,t-=u,f(e.nodes(),function(s){var c=e.node(s);c.x-=n,c.y-=t}),f(e.edges(),function(s){var c=e.edge(s);f(c.points,function(h){h.x-=n,h.y-=t}),Object.prototype.hasOwnProperty.call(c,"x")&&(c.x-=n),Object.prototype.hasOwnProperty.call(c,"y")&&(c.y-=t)}),o.width=r-n+a,o.height=i-t+u}function Lt(e){f(e.edges(),function(n){var r=e.edge(n),t=e.node(n.v),i=e.node(n.w),o,a;r.points?(o=r.points[0],a=r.points[r.points.length-1]):(r.points=[],o=i,a=t),r.points.unshift(ae(t,o)),r.points.push(ae(i,a))})}function Pt(e){f(e.edges(),function(n){var r=e.edge(n);if(Object.prototype.hasOwnProperty.call(r,"x"))switch((r.labelpos==="l"||r.labelpos==="r")&&(r.width-=r.labeloffset),r.labelpos){case"l":r.x-=r.width/2+r.labeloffset;break;case"r":r.x+=r.width/2+r.labeloffset;break}})}function _t(e){f(e.edges(),function(n){var r=e.edge(n);r.reversed&&r.points.reverse()})}function Ct(e){f(e.nodes(),function(n){if(e.children(n).length){var r=e.node(n),t=e.node(r.borderTop),i=e.node(r.borderBottom),o=e.node(F(r.borderLeft)),a=e.node(F(r.borderRight));r.width=Math.abs(a.x-o.x),r.height=Math.abs(i.y-t.y),r.x=o.x+r.width/2,r.y=t.y+r.height/2}}),f(e.nodes(),function(n){e.node(n).dummy==="border"&&e.removeNode(n)})}function It(e){f(e.edges(),function(n){if(n.v===n.w){var r=e.node(n.v);r.selfEdges||(r.selfEdges=[]),r.selfEdges.push({e:n,label:e.edge(n)}),e.removeEdge(n)}})}function Rt(e){var n=j(e);f(n,function(r){var t=0;f(r,function(i,o){var a=e.node(i);a.order=o+t,f(a.selfEdges,function(u){N(e,"selfedge",{width:u.label.width,height:u.label.height,rank:a.rank,order:o+ ++t,e:u.e,label:u.label},"_se")}),delete a.selfEdges})})}function Tt(e){f(e.nodes(),function(n){var r=e.node(n);if(r.dummy==="selfedge"){var t=e.node(r.e.v),i=t.x+t.width/2,o=t.y,a=r.x-i,u=t.height/2;e.setEdge(r.e,r.label),e.removeNode(n),r.label.points=[{x:i+2*a/3,y:o-u},{x:i+5*a/6,y:o-u},{x:i+a,y:o},{x:i+5*a/6,y:o+u},{x:i+2*a/3,y:o+u}],r.label.x=r.x,r.label.y=r.y}})}function q(e,n){return V(A(e,n),Number)}function W(e){var n={};return f(e,function(r,t){n[t.toLowerCase()]=r}),n}export{Bt as l};
|
|
1
|
+
import{b as Ge,G as g,i as b,v as E}from"./graph-BENdOhGY.js";import{i as X,c as C,k as Ye,o as $e,p as ve,q as pe,t as De,u as we,v as qe,w as me,d as G,x as We,b as Xe,y as ze,n as f,m as I,r as B}from"./_baseUniq-COwRl6vV.js";import{f as O,b as be,a as Ue,c as He,m as w,d as P}from"./min-DPqoX6mH.js";import{aE as M,aQ as Ke,aR as Je,aL as ge,aS as S,av as ye,aT as Qe,an as Ze,aU as en,aV as nn,ap as xe,aW as rn,aK as Ee,ao as ke,aC as tn,aN as an,aX as z}from"./mermaid.core-xu0G1s5D.js";var on=/\s/;function un(e){for(var n=e.length;n--&&on.test(e.charAt(n)););return n}var dn=/^\s+/;function sn(e){return e&&e.slice(0,un(e)+1).replace(dn,"")}var re=NaN,fn=/^[-+]0x[0-9a-f]+$/i,cn=/^0b[01]+$/i,hn=/^0o[0-7]+$/i,ln=parseInt;function vn(e){if(typeof e=="number")return e;if(X(e))return re;if(M(e)){var n=typeof e.valueOf=="function"?e.valueOf():e;e=M(n)?n+"":n}if(typeof e!="string")return e===0?e:+e;e=sn(e);var r=cn.test(e);return r||hn.test(e)?ln(e.slice(2),r?2:8):fn.test(e)?re:+e}var te=1/0,pn=17976931348623157e292;function T(e){if(!e)return e===0?e:0;if(e=vn(e),e===te||e===-te){var n=e<0?-1:1;return n*pn}return e===e?e:0}function wn(e){var n=T(e),r=n%1;return n===n?r?n-r:n:0}function mn(e){return Ke(Je(e,void 0,O),e+"")}var bn=1,gn=4;function yn(e){return Ge(e,bn|gn)}var Oe=Object.prototype,xn=Oe.hasOwnProperty,En=ge(function(e,n){e=Object(e);var r=-1,t=n.length,i=t>2?n[2]:void 0;for(i&&S(n[0],n[1],i)&&(t=1);++r<t;)for(var o=n[r],a=ye(o),u=-1,d=a.length;++u<d;){var s=a[u],c=e[s];(c===void 0||Qe(c,Oe[s])&&!xn.call(e,s))&&(e[s]=o[s])}return e});function F(e){var n=e==null?0:e.length;return n?e[n-1]:void 0}function kn(e){return function(n,r,t){var i=Object(n);if(!Ze(n)){var o=C(r);n=Ye(n),r=function(u){return o(i[u],u,i)}}var a=e(n,r,t);return a>-1?i[o?n[a]:a]:void 0}}var On=Math.max;function Nn(e,n,r){var t=e==null?0:e.length;if(!t)return-1;var i=r==null?0:wn(r);return i<0&&(i=On(t+i,0)),$e(e,C(n),i)}var H=kn(Nn);function Ln(e,n){return e==null?e:en(e,ve(n),ye)}function Pn(e,n){return e&&pe(e,ve(n))}function _n(e,n){return e>n}var Cn=Object.prototype,In=Cn.hasOwnProperty;function Rn(e,n){return e!=null&&In.call(e,n)}function Ne(e,n){return e!=null&&De(e,n,Rn)}function V(e,n){var r={};return n=C(n),pe(e,function(t,i,o){nn(r,i,n(t,i,o))}),r}function y(e){return e&&e.length?be(e,xe,_n):void 0}function K(e,n){return e&&e.length?be(e,C(n),Ue):void 0}function Tn(e,n,r,t){if(!M(e))return e;n=we(n,e);for(var i=-1,o=n.length,a=o-1,u=e;u!=null&&++i<o;){var d=qe(n[i]),s=r;if(d==="__proto__"||d==="constructor"||d==="prototype")return e;if(i!=a){var c=u[d];s=void 0,s===void 0&&(s=M(c)?c:rn(n[i+1])?[]:{})}Ee(u,d,s),u=u[d]}return e}function Mn(e,n,r){for(var t=-1,i=n.length,o={};++t<i;){var a=n[t],u=me(e,a);r(u,a)&&Tn(o,we(a,e),u)}return o}function Sn(e,n){var r=e.length;for(e.sort(n);r--;)e[r]=e[r].value;return e}function Fn(e,n){if(e!==n){var r=e!==void 0,t=e===null,i=e===e,o=X(e),a=n!==void 0,u=n===null,d=n===n,s=X(n);if(!u&&!s&&!o&&e>n||o&&a&&d&&!u&&!s||t&&a&&d||!r&&d||!i)return 1;if(!t&&!o&&!s&&e<n||s&&r&&i&&!t&&!o||u&&r&&i||!a&&i||!d)return-1}return 0}function An(e,n,r){for(var t=-1,i=e.criteria,o=n.criteria,a=i.length,u=r.length;++t<a;){var d=Fn(i[t],o[t]);if(d){if(t>=u)return d;var s=r[t];return d*(s=="desc"?-1:1)}}return e.index-n.index}function Bn(e,n,r){n.length?n=G(n,function(o){return ke(o)?function(a){return me(a,o.length===1?o[0]:o)}:o}):n=[xe];var t=-1;n=G(n,tn(C));var i=He(e,function(o,a,u){var d=G(n,function(s){return s(o)});return{criteria:d,index:++t,value:o}});return Sn(i,function(o,a){return An(o,a,r)})}function Vn(e,n){return Mn(e,n,function(r,t){return We(e,t)})}var A=mn(function(e,n){return e==null?{}:Vn(e,n)}),jn=Math.ceil,Gn=Math.max;function Yn(e,n,r,t){for(var i=-1,o=Gn(jn((n-e)/(r||1)),0),a=Array(o);o--;)a[++i]=e,e+=r;return a}function $n(e){return function(n,r,t){return t&&typeof t!="number"&&S(n,r,t)&&(r=t=void 0),n=T(n),r===void 0?(r=n,n=0):r=T(r),t=t===void 0?n<r?1:-1:T(t),Yn(n,r,t)}}var k=$n(),R=ge(function(e,n){if(e==null)return[];var r=n.length;return r>1&&S(e,n[0],n[1])?n=[]:r>2&&S(n[0],n[1],n[2])&&(n=[n[0]]),Bn(e,Xe(n),[])}),Dn=0;function J(e){var n=++Dn;return ze(e)+n}function qn(e,n,r){for(var t=-1,i=e.length,o=n.length,a={};++t<i;){var u=t<o?n[t]:void 0;r(a,e[t],u)}return a}function Wn(e,n){return qn(e||[],n||[],Ee)}class Xn{constructor(){var n={};n._next=n._prev=n,this._sentinel=n}dequeue(){var n=this._sentinel,r=n._prev;if(r!==n)return ie(r),r}enqueue(n){var r=this._sentinel;n._prev&&n._next&&ie(n),n._next=r._next,r._next._prev=n,r._next=n,n._prev=r}toString(){for(var n=[],r=this._sentinel,t=r._prev;t!==r;)n.push(JSON.stringify(t,zn)),t=t._prev;return"["+n.join(", ")+"]"}}function ie(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function zn(e,n){if(e!=="_next"&&e!=="_prev")return n}var Un=an(1);function Hn(e,n){if(e.nodeCount()<=1)return[];var r=Jn(e,n||Un),t=Kn(r.graph,r.buckets,r.zeroIdx);return O(w(t,function(i){return e.outEdges(i.v,i.w)}))}function Kn(e,n,r){for(var t=[],i=n[n.length-1],o=n[0],a;e.nodeCount();){for(;a=o.dequeue();)Y(e,n,r,a);for(;a=i.dequeue();)Y(e,n,r,a);if(e.nodeCount()){for(var u=n.length-2;u>0;--u)if(a=n[u].dequeue(),a){t=t.concat(Y(e,n,r,a,!0));break}}}return t}function Y(e,n,r,t,i){var o=i?[]:void 0;return f(e.inEdges(t.v),function(a){var u=e.edge(a),d=e.node(a.v);i&&o.push({v:a.v,w:a.w}),d.out-=u,U(n,r,d)}),f(e.outEdges(t.v),function(a){var u=e.edge(a),d=a.w,s=e.node(d);s.in-=u,U(n,r,s)}),e.removeNode(t.v),o}function Jn(e,n){var r=new g,t=0,i=0;f(e.nodes(),function(u){r.setNode(u,{v:u,in:0,out:0})}),f(e.edges(),function(u){var d=r.edge(u.v,u.w)||0,s=n(u),c=d+s;r.setEdge(u.v,u.w,c),i=Math.max(i,r.node(u.v).out+=s),t=Math.max(t,r.node(u.w).in+=s)});var o=k(i+t+3).map(function(){return new Xn}),a=t+1;return f(r.nodes(),function(u){U(o,a,r.node(u))}),{graph:r,buckets:o,zeroIdx:a}}function U(e,n,r){r.out?r.in?e[r.out-r.in+n].enqueue(r):e[e.length-1].enqueue(r):e[0].enqueue(r)}function Qn(e){var n=e.graph().acyclicer==="greedy"?Hn(e,r(e)):Zn(e);f(n,function(t){var i=e.edge(t);e.removeEdge(t),i.forwardName=t.name,i.reversed=!0,e.setEdge(t.w,t.v,i,J("rev"))});function r(t){return function(i){return t.edge(i).weight}}}function Zn(e){var n=[],r={},t={};function i(o){Object.prototype.hasOwnProperty.call(t,o)||(t[o]=!0,r[o]=!0,f(e.outEdges(o),function(a){Object.prototype.hasOwnProperty.call(r,a.w)?n.push(a):i(a.w)}),delete r[o])}return f(e.nodes(),i),n}function er(e){f(e.edges(),function(n){var r=e.edge(n);if(r.reversed){e.removeEdge(n);var t=r.forwardName;delete r.reversed,delete r.forwardName,e.setEdge(n.w,n.v,r,t)}})}function N(e,n,r,t){var i;do i=J(t);while(e.hasNode(i));return r.dummy=n,e.setNode(i,r),i}function nr(e){var n=new g().setGraph(e.graph());return f(e.nodes(),function(r){n.setNode(r,e.node(r))}),f(e.edges(),function(r){var t=n.edge(r.v,r.w)||{weight:0,minlen:1},i=e.edge(r);n.setEdge(r.v,r.w,{weight:t.weight+i.weight,minlen:Math.max(t.minlen,i.minlen)})}),n}function Le(e){var n=new g({multigraph:e.isMultigraph()}).setGraph(e.graph());return f(e.nodes(),function(r){e.children(r).length||n.setNode(r,e.node(r))}),f(e.edges(),function(r){n.setEdge(r,e.edge(r))}),n}function ae(e,n){var r=e.x,t=e.y,i=n.x-r,o=n.y-t,a=e.width/2,u=e.height/2;if(!i&&!o)throw new Error("Not possible to find intersection inside of the rectangle");var d,s;return Math.abs(o)*a>Math.abs(i)*u?(o<0&&(u=-u),d=u*i/o,s=u):(i<0&&(a=-a),d=a,s=a*o/i),{x:r+d,y:t+s}}function j(e){var n=w(k(Pe(e)+1),function(){return[]});return f(e.nodes(),function(r){var t=e.node(r),i=t.rank;b(i)||(n[i][t.order]=r)}),n}function rr(e){var n=P(w(e.nodes(),function(r){return e.node(r).rank}));f(e.nodes(),function(r){var t=e.node(r);Ne(t,"rank")&&(t.rank-=n)})}function tr(e){var n=P(w(e.nodes(),function(o){return e.node(o).rank})),r=[];f(e.nodes(),function(o){var a=e.node(o).rank-n;r[a]||(r[a]=[]),r[a].push(o)});var t=0,i=e.graph().nodeRankFactor;f(r,function(o,a){b(o)&&a%i!==0?--t:t&&f(o,function(u){e.node(u).rank+=t})})}function oe(e,n,r,t){var i={width:0,height:0};return arguments.length>=4&&(i.rank=r,i.order=t),N(e,"border",i,n)}function Pe(e){return y(w(e.nodes(),function(n){var r=e.node(n).rank;if(!b(r))return r}))}function ir(e,n){var r={lhs:[],rhs:[]};return f(e,function(t){n(t)?r.lhs.push(t):r.rhs.push(t)}),r}function ar(e,n){return n()}function or(e){function n(r){var t=e.children(r),i=e.node(r);if(t.length&&f(t,n),Object.prototype.hasOwnProperty.call(i,"minRank")){i.borderLeft=[],i.borderRight=[];for(var o=i.minRank,a=i.maxRank+1;o<a;++o)ue(e,"borderLeft","_bl",r,i,o),ue(e,"borderRight","_br",r,i,o)}}f(e.children(),n)}function ue(e,n,r,t,i,o){var a={width:0,height:0,rank:o,borderType:n},u=i[n][o-1],d=N(e,"border",a,r);i[n][o]=d,e.setParent(d,t),u&&e.setEdge(u,d,{weight:1})}function ur(e){var n=e.graph().rankdir.toLowerCase();(n==="lr"||n==="rl")&&_e(e)}function dr(e){var n=e.graph().rankdir.toLowerCase();(n==="bt"||n==="rl")&&sr(e),(n==="lr"||n==="rl")&&(fr(e),_e(e))}function _e(e){f(e.nodes(),function(n){de(e.node(n))}),f(e.edges(),function(n){de(e.edge(n))})}function de(e){var n=e.width;e.width=e.height,e.height=n}function sr(e){f(e.nodes(),function(n){$(e.node(n))}),f(e.edges(),function(n){var r=e.edge(n);f(r.points,$),Object.prototype.hasOwnProperty.call(r,"y")&&$(r)})}function $(e){e.y=-e.y}function fr(e){f(e.nodes(),function(n){D(e.node(n))}),f(e.edges(),function(n){var r=e.edge(n);f(r.points,D),Object.prototype.hasOwnProperty.call(r,"x")&&D(r)})}function D(e){var n=e.x;e.x=e.y,e.y=n}function cr(e){e.graph().dummyChains=[],f(e.edges(),function(n){hr(e,n)})}function hr(e,n){var r=n.v,t=e.node(r).rank,i=n.w,o=e.node(i).rank,a=n.name,u=e.edge(n),d=u.labelRank;if(o!==t+1){e.removeEdge(n);var s=void 0,c,h;for(h=0,++t;t<o;++h,++t)u.points=[],s={width:0,height:0,edgeLabel:u,edgeObj:n,rank:t},c=N(e,"edge",s,"_d"),t===d&&(s.width=u.width,s.height=u.height,s.dummy="edge-label",s.labelpos=u.labelpos),e.setEdge(r,c,{weight:u.weight},a),h===0&&e.graph().dummyChains.push(c),r=c;e.setEdge(r,i,{weight:u.weight},a)}}function lr(e){f(e.graph().dummyChains,function(n){var r=e.node(n),t=r.edgeLabel,i;for(e.setEdge(r.edgeObj,t);r.dummy;)i=e.successors(n)[0],e.removeNode(n),t.points.push({x:r.x,y:r.y}),r.dummy==="edge-label"&&(t.x=r.x,t.y=r.y,t.width=r.width,t.height=r.height),n=i,r=e.node(n)})}function Q(e){var n={};function r(t){var i=e.node(t);if(Object.prototype.hasOwnProperty.call(n,t))return i.rank;n[t]=!0;var o=P(w(e.outEdges(t),function(a){return r(a.w)-e.edge(a).minlen}));return(o===Number.POSITIVE_INFINITY||o===void 0||o===null)&&(o=0),i.rank=o}f(e.sources(),r)}function _(e,n){return e.node(n.w).rank-e.node(n.v).rank-e.edge(n).minlen}function Ce(e){var n=new g({directed:!1}),r=e.nodes()[0],t=e.nodeCount();n.setNode(r,{});for(var i,o;vr(n,e)<t;)i=pr(n,e),o=n.hasNode(i.v)?_(e,i):-_(e,i),wr(n,e,o);return n}function vr(e,n){function r(t){f(n.nodeEdges(t),function(i){var o=i.v,a=t===o?i.w:o;!e.hasNode(a)&&!_(n,i)&&(e.setNode(a,{}),e.setEdge(t,a,{}),r(a))})}return f(e.nodes(),r),e.nodeCount()}function pr(e,n){return K(n.edges(),function(r){if(e.hasNode(r.v)!==e.hasNode(r.w))return _(n,r)})}function wr(e,n,r){f(e.nodes(),function(t){n.node(t).rank+=r})}function mr(){}mr.prototype=new Error;function Ie(e,n,r){ke(n)||(n=[n]);var t=(e.isDirected()?e.successors:e.neighbors).bind(e),i=[],o={};return f(n,function(a){if(!e.hasNode(a))throw new Error("Graph does not have node: "+a);Re(e,a,r==="post",o,t,i)}),i}function Re(e,n,r,t,i,o){Object.prototype.hasOwnProperty.call(t,n)||(t[n]=!0,r||o.push(n),f(i(n),function(a){Re(e,a,r,t,i,o)}),r&&o.push(n))}function br(e,n){return Ie(e,n,"post")}function gr(e,n){return Ie(e,n,"pre")}x.initLowLimValues=ee;x.initCutValues=Z;x.calcCutValue=Te;x.leaveEdge=Se;x.enterEdge=Fe;x.exchangeEdges=Ae;function x(e){e=nr(e),Q(e);var n=Ce(e);ee(n),Z(n,e);for(var r,t;r=Se(n);)t=Fe(n,e,r),Ae(n,e,r,t)}function Z(e,n){var r=br(e,e.nodes());r=r.slice(0,r.length-1),f(r,function(t){yr(e,n,t)})}function yr(e,n,r){var t=e.node(r),i=t.parent;e.edge(r,i).cutvalue=Te(e,n,r)}function Te(e,n,r){var t=e.node(r),i=t.parent,o=!0,a=n.edge(r,i),u=0;return a||(o=!1,a=n.edge(i,r)),u=a.weight,f(n.nodeEdges(r),function(d){var s=d.v===r,c=s?d.w:d.v;if(c!==i){var h=s===o,l=n.edge(d).weight;if(u+=h?l:-l,Er(e,r,c)){var v=e.edge(r,c).cutvalue;u+=h?-v:v}}}),u}function ee(e,n){arguments.length<2&&(n=e.nodes()[0]),Me(e,{},1,n)}function Me(e,n,r,t,i){var o=r,a=e.node(t);return n[t]=!0,f(e.neighbors(t),function(u){Object.prototype.hasOwnProperty.call(n,u)||(r=Me(e,n,r,u,t))}),a.low=o,a.lim=r++,i?a.parent=i:delete a.parent,r}function Se(e){return H(e.edges(),function(n){return e.edge(n).cutvalue<0})}function Fe(e,n,r){var t=r.v,i=r.w;n.hasEdge(t,i)||(t=r.w,i=r.v);var o=e.node(t),a=e.node(i),u=o,d=!1;o.lim>a.lim&&(u=a,d=!0);var s=I(n.edges(),function(c){return d===se(e,e.node(c.v),u)&&d!==se(e,e.node(c.w),u)});return K(s,function(c){return _(n,c)})}function Ae(e,n,r,t){var i=r.v,o=r.w;e.removeEdge(i,o),e.setEdge(t.v,t.w,{}),ee(e),Z(e,n),xr(e,n)}function xr(e,n){var r=H(e.nodes(),function(i){return!n.node(i).parent}),t=gr(e,r);t=t.slice(1),f(t,function(i){var o=e.node(i).parent,a=n.edge(i,o),u=!1;a||(a=n.edge(o,i),u=!0),n.node(i).rank=n.node(o).rank+(u?a.minlen:-a.minlen)})}function Er(e,n,r){return e.hasEdge(n,r)}function se(e,n,r){return r.low<=n.lim&&n.lim<=r.lim}function kr(e){switch(e.graph().ranker){case"network-simplex":fe(e);break;case"tight-tree":Nr(e);break;case"longest-path":Or(e);break;default:fe(e)}}var Or=Q;function Nr(e){Q(e),Ce(e)}function fe(e){x(e)}function Lr(e){var n=N(e,"root",{},"_root"),r=Pr(e),t=y(E(r))-1,i=2*t+1;e.graph().nestingRoot=n,f(e.edges(),function(a){e.edge(a).minlen*=i});var o=_r(e)+1;f(e.children(),function(a){Be(e,n,i,o,t,r,a)}),e.graph().nodeRankFactor=i}function Be(e,n,r,t,i,o,a){var u=e.children(a);if(!u.length){a!==n&&e.setEdge(n,a,{weight:0,minlen:r});return}var d=oe(e,"_bt"),s=oe(e,"_bb"),c=e.node(a);e.setParent(d,a),c.borderTop=d,e.setParent(s,a),c.borderBottom=s,f(u,function(h){Be(e,n,r,t,i,o,h);var l=e.node(h),v=l.borderTop?l.borderTop:h,p=l.borderBottom?l.borderBottom:h,m=l.borderTop?t:2*t,L=v!==p?1:i-o[a]+1;e.setEdge(d,v,{weight:m,minlen:L,nestingEdge:!0}),e.setEdge(p,s,{weight:m,minlen:L,nestingEdge:!0})}),e.parent(a)||e.setEdge(n,d,{weight:0,minlen:i+o[a]})}function Pr(e){var n={};function r(t,i){var o=e.children(t);o&&o.length&&f(o,function(a){r(a,i+1)}),n[t]=i}return f(e.children(),function(t){r(t,1)}),n}function _r(e){return B(e.edges(),function(n,r){return n+e.edge(r).weight},0)}function Cr(e){var n=e.graph();e.removeNode(n.nestingRoot),delete n.nestingRoot,f(e.edges(),function(r){var t=e.edge(r);t.nestingEdge&&e.removeEdge(r)})}function Ir(e,n,r){var t={},i;f(r,function(o){for(var a=e.parent(o),u,d;a;){if(u=e.parent(a),u?(d=t[u],t[u]=a):(d=i,i=a),d&&d!==a){n.setEdge(d,a);return}a=u}})}function Rr(e,n,r){var t=Tr(e),i=new g({compound:!0}).setGraph({root:t}).setDefaultNodeLabel(function(o){return e.node(o)});return f(e.nodes(),function(o){var a=e.node(o),u=e.parent(o);(a.rank===n||a.minRank<=n&&n<=a.maxRank)&&(i.setNode(o),i.setParent(o,u||t),f(e[r](o),function(d){var s=d.v===o?d.w:d.v,c=i.edge(s,o),h=b(c)?0:c.weight;i.setEdge(s,o,{weight:e.edge(d).weight+h})}),Object.prototype.hasOwnProperty.call(a,"minRank")&&i.setNode(o,{borderLeft:a.borderLeft[n],borderRight:a.borderRight[n]}))}),i}function Tr(e){for(var n;e.hasNode(n=J("_root")););return n}function Mr(e,n){for(var r=0,t=1;t<n.length;++t)r+=Sr(e,n[t-1],n[t]);return r}function Sr(e,n,r){for(var t=Wn(r,w(r,function(s,c){return c})),i=O(w(n,function(s){return R(w(e.outEdges(s),function(c){return{pos:t[c.w],weight:e.edge(c).weight}}),"pos")})),o=1;o<r.length;)o<<=1;var a=2*o-1;o-=1;var u=w(new Array(a),function(){return 0}),d=0;return f(i.forEach(function(s){var c=s.pos+o;u[c]+=s.weight;for(var h=0;c>0;)c%2&&(h+=u[c+1]),c=c-1>>1,u[c]+=s.weight;d+=s.weight*h})),d}function Fr(e){var n={},r=I(e.nodes(),function(u){return!e.children(u).length}),t=y(w(r,function(u){return e.node(u).rank})),i=w(k(t+1),function(){return[]});function o(u){if(!Ne(n,u)){n[u]=!0;var d=e.node(u);i[d.rank].push(u),f(e.successors(u),o)}}var a=R(r,function(u){return e.node(u).rank});return f(a,o),i}function Ar(e,n){return w(n,function(r){var t=e.inEdges(r);if(t.length){var i=B(t,function(o,a){var u=e.edge(a),d=e.node(a.v);return{sum:o.sum+u.weight*d.order,weight:o.weight+u.weight}},{sum:0,weight:0});return{v:r,barycenter:i.sum/i.weight,weight:i.weight}}else return{v:r}})}function Br(e,n){var r={};f(e,function(i,o){var a=r[i.v]={indegree:0,in:[],out:[],vs:[i.v],i:o};b(i.barycenter)||(a.barycenter=i.barycenter,a.weight=i.weight)}),f(n.edges(),function(i){var o=r[i.v],a=r[i.w];!b(o)&&!b(a)&&(a.indegree++,o.out.push(r[i.w]))});var t=I(r,function(i){return!i.indegree});return Vr(t)}function Vr(e){var n=[];function r(o){return function(a){a.merged||(b(a.barycenter)||b(o.barycenter)||a.barycenter>=o.barycenter)&&jr(o,a)}}function t(o){return function(a){a.in.push(o),--a.indegree===0&&e.push(a)}}for(;e.length;){var i=e.pop();n.push(i),f(i.in.reverse(),r(i)),f(i.out,t(i))}return w(I(n,function(o){return!o.merged}),function(o){return A(o,["vs","i","barycenter","weight"])})}function jr(e,n){var r=0,t=0;e.weight&&(r+=e.barycenter*e.weight,t+=e.weight),n.weight&&(r+=n.barycenter*n.weight,t+=n.weight),e.vs=n.vs.concat(e.vs),e.barycenter=r/t,e.weight=t,e.i=Math.min(n.i,e.i),n.merged=!0}function Gr(e,n){var r=ir(e,function(c){return Object.prototype.hasOwnProperty.call(c,"barycenter")}),t=r.lhs,i=R(r.rhs,function(c){return-c.i}),o=[],a=0,u=0,d=0;t.sort(Yr(!!n)),d=ce(o,i,d),f(t,function(c){d+=c.vs.length,o.push(c.vs),a+=c.barycenter*c.weight,u+=c.weight,d=ce(o,i,d)});var s={vs:O(o)};return u&&(s.barycenter=a/u,s.weight=u),s}function ce(e,n,r){for(var t;n.length&&(t=F(n)).i<=r;)n.pop(),e.push(t.vs),r++;return r}function Yr(e){return function(n,r){return n.barycenter<r.barycenter?-1:n.barycenter>r.barycenter?1:e?r.i-n.i:n.i-r.i}}function Ve(e,n,r,t){var i=e.children(n),o=e.node(n),a=o?o.borderLeft:void 0,u=o?o.borderRight:void 0,d={};a&&(i=I(i,function(p){return p!==a&&p!==u}));var s=Ar(e,i);f(s,function(p){if(e.children(p.v).length){var m=Ve(e,p.v,r,t);d[p.v]=m,Object.prototype.hasOwnProperty.call(m,"barycenter")&&Dr(p,m)}});var c=Br(s,r);$r(c,d);var h=Gr(c,t);if(a&&(h.vs=O([a,h.vs,u]),e.predecessors(a).length)){var l=e.node(e.predecessors(a)[0]),v=e.node(e.predecessors(u)[0]);Object.prototype.hasOwnProperty.call(h,"barycenter")||(h.barycenter=0,h.weight=0),h.barycenter=(h.barycenter*h.weight+l.order+v.order)/(h.weight+2),h.weight+=2}return h}function $r(e,n){f(e,function(r){r.vs=O(r.vs.map(function(t){return n[t]?n[t].vs:t}))})}function Dr(e,n){b(e.barycenter)?(e.barycenter=n.barycenter,e.weight=n.weight):(e.barycenter=(e.barycenter*e.weight+n.barycenter*n.weight)/(e.weight+n.weight),e.weight+=n.weight)}function qr(e){var n=Pe(e),r=he(e,k(1,n+1),"inEdges"),t=he(e,k(n-1,-1,-1),"outEdges"),i=Fr(e);le(e,i);for(var o=Number.POSITIVE_INFINITY,a,u=0,d=0;d<4;++u,++d){Wr(u%2?r:t,u%4>=2),i=j(e);var s=Mr(e,i);s<o&&(d=0,a=yn(i),o=s)}le(e,a)}function he(e,n,r){return w(n,function(t){return Rr(e,t,r)})}function Wr(e,n){var r=new g;f(e,function(t){var i=t.graph().root,o=Ve(t,i,r,n);f(o.vs,function(a,u){t.node(a).order=u}),Ir(t,r,o.vs)})}function le(e,n){f(n,function(r){f(r,function(t,i){e.node(t).order=i})})}function Xr(e){var n=Ur(e);f(e.graph().dummyChains,function(r){for(var t=e.node(r),i=t.edgeObj,o=zr(e,n,i.v,i.w),a=o.path,u=o.lca,d=0,s=a[d],c=!0;r!==i.w;){if(t=e.node(r),c){for(;(s=a[d])!==u&&e.node(s).maxRank<t.rank;)d++;s===u&&(c=!1)}if(!c){for(;d<a.length-1&&e.node(s=a[d+1]).minRank<=t.rank;)d++;s=a[d]}e.setParent(r,s),r=e.successors(r)[0]}})}function zr(e,n,r,t){var i=[],o=[],a=Math.min(n[r].low,n[t].low),u=Math.max(n[r].lim,n[t].lim),d,s;d=r;do d=e.parent(d),i.push(d);while(d&&(n[d].low>a||u>n[d].lim));for(s=d,d=t;(d=e.parent(d))!==s;)o.push(d);return{path:i.concat(o.reverse()),lca:s}}function Ur(e){var n={},r=0;function t(i){var o=r;f(e.children(i),t),n[i]={low:o,lim:r++}}return f(e.children(),t),n}function Hr(e,n){var r={};function t(i,o){var a=0,u=0,d=i.length,s=F(o);return f(o,function(c,h){var l=Jr(e,c),v=l?e.node(l).order:d;(l||c===s)&&(f(o.slice(u,h+1),function(p){f(e.predecessors(p),function(m){var L=e.node(m),ne=L.order;(ne<a||v<ne)&&!(L.dummy&&e.node(p).dummy)&&je(r,m,p)})}),u=h+1,a=v)}),o}return B(n,t),r}function Kr(e,n){var r={};function t(o,a,u,d,s){var c;f(k(a,u),function(h){c=o[h],e.node(c).dummy&&f(e.predecessors(c),function(l){var v=e.node(l);v.dummy&&(v.order<d||v.order>s)&&je(r,l,c)})})}function i(o,a){var u=-1,d,s=0;return f(a,function(c,h){if(e.node(c).dummy==="border"){var l=e.predecessors(c);l.length&&(d=e.node(l[0]).order,t(a,s,h,u,d),s=h,u=d)}t(a,s,a.length,d,o.length)}),a}return B(n,i),r}function Jr(e,n){if(e.node(n).dummy)return H(e.predecessors(n),function(r){return e.node(r).dummy})}function je(e,n,r){if(n>r){var t=n;n=r,r=t}var i=e[n];i||(e[n]=i={}),i[r]=!0}function Qr(e,n,r){if(n>r){var t=n;n=r,r=t}return!!e[n]&&Object.prototype.hasOwnProperty.call(e[n],r)}function Zr(e,n,r,t){var i={},o={},a={};return f(n,function(u){f(u,function(d,s){i[d]=d,o[d]=d,a[d]=s})}),f(n,function(u){var d=-1;f(u,function(s){var c=t(s);if(c.length){c=R(c,function(m){return a[m]});for(var h=(c.length-1)/2,l=Math.floor(h),v=Math.ceil(h);l<=v;++l){var p=c[l];o[s]===s&&d<a[p]&&!Qr(r,s,p)&&(o[p]=s,o[s]=i[s]=i[p],d=a[p])}}})}),{root:i,align:o}}function et(e,n,r,t,i){var o={},a=nt(e,n,r,i),u=i?"borderLeft":"borderRight";function d(h,l){for(var v=a.nodes(),p=v.pop(),m={};p;)m[p]?h(p):(m[p]=!0,v.push(p),v=v.concat(l(p))),p=v.pop()}function s(h){o[h]=a.inEdges(h).reduce(function(l,v){return Math.max(l,o[v.v]+a.edge(v))},0)}function c(h){var l=a.outEdges(h).reduce(function(p,m){return Math.min(p,o[m.w]-a.edge(m))},Number.POSITIVE_INFINITY),v=e.node(h);l!==Number.POSITIVE_INFINITY&&v.borderType!==u&&(o[h]=Math.max(o[h],l))}return d(s,a.predecessors.bind(a)),d(c,a.successors.bind(a)),f(t,function(h){o[h]=o[r[h]]}),o}function nt(e,n,r,t){var i=new g,o=e.graph(),a=ot(o.nodesep,o.edgesep,t);return f(n,function(u){var d;f(u,function(s){var c=r[s];if(i.setNode(c),d){var h=r[d],l=i.edge(h,c);i.setEdge(h,c,Math.max(a(e,s,d),l||0))}d=s})}),i}function rt(e,n){return K(E(n),function(r){var t=Number.NEGATIVE_INFINITY,i=Number.POSITIVE_INFINITY;return Ln(r,function(o,a){var u=ut(e,a)/2;t=Math.max(o+u,t),i=Math.min(o-u,i)}),t-i})}function tt(e,n){var r=E(n),t=P(r),i=y(r);f(["u","d"],function(o){f(["l","r"],function(a){var u=o+a,d=e[u],s;if(d!==n){var c=E(d);s=a==="l"?t-P(c):i-y(c),s&&(e[u]=V(d,function(h){return h+s}))}})})}function it(e,n){return V(e.ul,function(r,t){if(n)return e[n.toLowerCase()][t];var i=R(w(e,t));return(i[1]+i[2])/2})}function at(e){var n=j(e),r=z(Hr(e,n),Kr(e,n)),t={},i;f(["u","d"],function(a){i=a==="u"?n:E(n).reverse(),f(["l","r"],function(u){u==="r"&&(i=w(i,function(h){return E(h).reverse()}));var d=(a==="u"?e.predecessors:e.successors).bind(e),s=Zr(e,i,r,d),c=et(e,i,s.root,s.align,u==="r");u==="r"&&(c=V(c,function(h){return-h})),t[a+u]=c})});var o=rt(e,t);return tt(t,o),it(t,e.graph().align)}function ot(e,n,r){return function(t,i,o){var a=t.node(i),u=t.node(o),d=0,s;if(d+=a.width/2,Object.prototype.hasOwnProperty.call(a,"labelpos"))switch(a.labelpos.toLowerCase()){case"l":s=-a.width/2;break;case"r":s=a.width/2;break}if(s&&(d+=r?s:-s),s=0,d+=(a.dummy?n:e)/2,d+=(u.dummy?n:e)/2,d+=u.width/2,Object.prototype.hasOwnProperty.call(u,"labelpos"))switch(u.labelpos.toLowerCase()){case"l":s=u.width/2;break;case"r":s=-u.width/2;break}return s&&(d+=r?s:-s),s=0,d}}function ut(e,n){return e.node(n).width}function dt(e){e=Le(e),st(e),Pn(at(e),function(n,r){e.node(r).x=n})}function st(e){var n=j(e),r=e.graph().ranksep,t=0;f(n,function(i){var o=y(w(i,function(a){return e.node(a).height}));f(i,function(a){e.node(a).y=t+o/2}),t+=o+r})}function Bt(e,n){var r=ar;r("layout",()=>{var t=r(" buildLayoutGraph",()=>yt(e));r(" runLayout",()=>ft(t,r)),r(" updateInputGraph",()=>ct(e,t))})}function ft(e,n){n(" makeSpaceForEdgeLabels",()=>xt(e)),n(" removeSelfEdges",()=>It(e)),n(" acyclic",()=>Qn(e)),n(" nestingGraph.run",()=>Lr(e)),n(" rank",()=>kr(Le(e))),n(" injectEdgeLabelProxies",()=>Et(e)),n(" removeEmptyRanks",()=>tr(e)),n(" nestingGraph.cleanup",()=>Cr(e)),n(" normalizeRanks",()=>rr(e)),n(" assignRankMinMax",()=>kt(e)),n(" removeEdgeLabelProxies",()=>Ot(e)),n(" normalize.run",()=>cr(e)),n(" parentDummyChains",()=>Xr(e)),n(" addBorderSegments",()=>or(e)),n(" order",()=>qr(e)),n(" insertSelfEdges",()=>Rt(e)),n(" adjustCoordinateSystem",()=>ur(e)),n(" position",()=>dt(e)),n(" positionSelfEdges",()=>Tt(e)),n(" removeBorderNodes",()=>Ct(e)),n(" normalize.undo",()=>lr(e)),n(" fixupEdgeLabelCoords",()=>Pt(e)),n(" undoCoordinateSystem",()=>dr(e)),n(" translateGraph",()=>Nt(e)),n(" assignNodeIntersects",()=>Lt(e)),n(" reversePoints",()=>_t(e)),n(" acyclic.undo",()=>er(e))}function ct(e,n){f(e.nodes(),function(r){var t=e.node(r),i=n.node(r);t&&(t.x=i.x,t.y=i.y,n.children(r).length&&(t.width=i.width,t.height=i.height))}),f(e.edges(),function(r){var t=e.edge(r),i=n.edge(r);t.points=i.points,Object.prototype.hasOwnProperty.call(i,"x")&&(t.x=i.x,t.y=i.y)}),e.graph().width=n.graph().width,e.graph().height=n.graph().height}var ht=["nodesep","edgesep","ranksep","marginx","marginy"],lt={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},vt=["acyclicer","ranker","rankdir","align"],pt=["width","height"],wt={width:0,height:0},mt=["minlen","weight","width","height","labeloffset"],bt={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},gt=["labelpos"];function yt(e){var n=new g({multigraph:!0,compound:!0}),r=W(e.graph());return n.setGraph(z({},lt,q(r,ht),A(r,vt))),f(e.nodes(),function(t){var i=W(e.node(t));n.setNode(t,En(q(i,pt),wt)),n.setParent(t,e.parent(t))}),f(e.edges(),function(t){var i=W(e.edge(t));n.setEdge(t,z({},bt,q(i,mt),A(i,gt)))}),n}function xt(e){var n=e.graph();n.ranksep/=2,f(e.edges(),function(r){var t=e.edge(r);t.minlen*=2,t.labelpos.toLowerCase()!=="c"&&(n.rankdir==="TB"||n.rankdir==="BT"?t.width+=t.labeloffset:t.height+=t.labeloffset)})}function Et(e){f(e.edges(),function(n){var r=e.edge(n);if(r.width&&r.height){var t=e.node(n.v),i=e.node(n.w),o={rank:(i.rank-t.rank)/2+t.rank,e:n};N(e,"edge-proxy",o,"_ep")}})}function kt(e){var n=0;f(e.nodes(),function(r){var t=e.node(r);t.borderTop&&(t.minRank=e.node(t.borderTop).rank,t.maxRank=e.node(t.borderBottom).rank,n=y(n,t.maxRank))}),e.graph().maxRank=n}function Ot(e){f(e.nodes(),function(n){var r=e.node(n);r.dummy==="edge-proxy"&&(e.edge(r.e).labelRank=r.rank,e.removeNode(n))})}function Nt(e){var n=Number.POSITIVE_INFINITY,r=0,t=Number.POSITIVE_INFINITY,i=0,o=e.graph(),a=o.marginx||0,u=o.marginy||0;function d(s){var c=s.x,h=s.y,l=s.width,v=s.height;n=Math.min(n,c-l/2),r=Math.max(r,c+l/2),t=Math.min(t,h-v/2),i=Math.max(i,h+v/2)}f(e.nodes(),function(s){d(e.node(s))}),f(e.edges(),function(s){var c=e.edge(s);Object.prototype.hasOwnProperty.call(c,"x")&&d(c)}),n-=a,t-=u,f(e.nodes(),function(s){var c=e.node(s);c.x-=n,c.y-=t}),f(e.edges(),function(s){var c=e.edge(s);f(c.points,function(h){h.x-=n,h.y-=t}),Object.prototype.hasOwnProperty.call(c,"x")&&(c.x-=n),Object.prototype.hasOwnProperty.call(c,"y")&&(c.y-=t)}),o.width=r-n+a,o.height=i-t+u}function Lt(e){f(e.edges(),function(n){var r=e.edge(n),t=e.node(n.v),i=e.node(n.w),o,a;r.points?(o=r.points[0],a=r.points[r.points.length-1]):(r.points=[],o=i,a=t),r.points.unshift(ae(t,o)),r.points.push(ae(i,a))})}function Pt(e){f(e.edges(),function(n){var r=e.edge(n);if(Object.prototype.hasOwnProperty.call(r,"x"))switch((r.labelpos==="l"||r.labelpos==="r")&&(r.width-=r.labeloffset),r.labelpos){case"l":r.x-=r.width/2+r.labeloffset;break;case"r":r.x+=r.width/2+r.labeloffset;break}})}function _t(e){f(e.edges(),function(n){var r=e.edge(n);r.reversed&&r.points.reverse()})}function Ct(e){f(e.nodes(),function(n){if(e.children(n).length){var r=e.node(n),t=e.node(r.borderTop),i=e.node(r.borderBottom),o=e.node(F(r.borderLeft)),a=e.node(F(r.borderRight));r.width=Math.abs(a.x-o.x),r.height=Math.abs(i.y-t.y),r.x=o.x+r.width/2,r.y=t.y+r.height/2}}),f(e.nodes(),function(n){e.node(n).dummy==="border"&&e.removeNode(n)})}function It(e){f(e.edges(),function(n){if(n.v===n.w){var r=e.node(n.v);r.selfEdges||(r.selfEdges=[]),r.selfEdges.push({e:n,label:e.edge(n)}),e.removeEdge(n)}})}function Rt(e){var n=j(e);f(n,function(r){var t=0;f(r,function(i,o){var a=e.node(i);a.order=o+t,f(a.selfEdges,function(u){N(e,"selfedge",{width:u.label.width,height:u.label.height,rank:a.rank,order:o+ ++t,e:u.e,label:u.label},"_se")}),delete a.selfEdges})})}function Tt(e){f(e.nodes(),function(n){var r=e.node(n);if(r.dummy==="selfedge"){var t=e.node(r.e.v),i=t.x+t.width/2,o=t.y,a=r.x-i,u=t.height/2;e.setEdge(r.e,r.label),e.removeNode(n),r.label.points=[{x:i+2*a/3,y:o-u},{x:i+5*a/6,y:o-u},{x:i+a,y:o},{x:i+5*a/6,y:o+u},{x:i+2*a/3,y:o+u}],r.label.x=r.x,r.label.y=r.y}})}function q(e,n){return V(A(e,n),Number)}function W(e){var n={};return f(e,function(r,t){n[t.toLowerCase()]=r}),n}export{Bt as l};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(){"use strict";function ot(t,n){var e,r=1;t==null&&(t=0),n==null&&(n=0);function i(){var o,h=e.length,f,a=0,u=0;for(o=0;o<h;++o)f=e[o],a+=f.x,u+=f.y;for(a=(a/h-t)*r,u=(u/h-n)*r,o=0;o<h;++o)f=e[o],f.x-=a,f.y-=u}return i.initialize=function(o){e=o},i.x=function(o){return arguments.length?(t=+o,i):t},i.y=function(o){return arguments.length?(n=+o,i):n},i.strength=function(o){return arguments.length?(r=+o,i):r},i}function ft(t){const n=+this._x.call(null,t),e=+this._y.call(null,t);return J(this.cover(n,e),n,e,t)}function J(t,n,e,r){if(isNaN(n)||isNaN(e))return t;var i,o=t._root,h={data:r},f=t._x0,a=t._y0,u=t._x1,v=t._y1,_,p,c,w,l,s,g,y;if(!o)return t._root=h,t;for(;o.length;)if((l=n>=(_=(f+u)/2))?f=_:u=_,(s=e>=(p=(a+v)/2))?a=p:v=p,i=o,!(o=o[g=s<<1|l]))return i[g]=h,t;if(c=+t._x.call(null,o.data),w=+t._y.call(null,o.data),n===c&&e===w)return h.next=o,i?i[g]=h:t._root=h,t;do i=i?i[g]=new Array(4):t._root=new Array(4),(l=n>=(_=(f+u)/2))?f=_:u=_,(s=e>=(p=(a+v)/2))?a=p:v=p;while((g=s<<1|l)===(y=(w>=p)<<1|c>=_));return i[y]=o,i[g]=h,t}function at(t){Array.isArray(t)||(t=Array.from(t));const n=t.length,e=new Float64Array(n),r=new Float64Array(n);let i=1/0,o=i,h=-i,f=h;for(let a=0,u,v,_;a<n;++a){if(isNaN(v=+this._x.call(null,u=t[a]))||isNaN(_=+this._y.call(null,u))){e[a]=NaN;continue}e[a]=v,r[a]=_,v<i&&(i=v),v>h&&(h=v),_<o&&(o=_),_>f&&(f=_)}if(i>h||o>f)return this;this.cover(i,o).cover(h,f);for(let a=0;a<n;++a)J(this,e[a],r[a],t[a]);return this}function ut(t,n){if(isNaN(t=+t)||isNaN(n=+n))return this;var e=this._x0,r=this._y0,i=this._x1,o=this._y1;if(isNaN(e))i=(e=Math.floor(t))+1,o=(r=Math.floor(n))+1;else{for(var h=i-e||1,f=this._root,a,u;e>t||t>=i||r>n||n>=o;)switch(u=(n<r)<<1|t<e,a=new Array(4),a[u]=f,f=a,h*=2,u){case 0:i=e+h,o=r+h;break;case 1:e=i-h,o=r+h;break;case 2:i=e+h,r=o-h;break;case 3:e=i-h,r=o-h;break}this._root&&this._root.length&&(this._root=f)}return this._x0=e,this._y0=r,this._x1=i,this._y1=o,this}function st(){var t=[];return this.visit(function(n){if(!n.length)do t.push(n.data);while(n=n.next)}),t}function ht(t){return arguments.length?this.cover(+t[0][0],+t[0][1]).cover(+t[1][0],+t[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}function M(t,n,e,r,i){this.node=t,this.x0=n,this.y0=e,this.x1=r,this.y1=i}function lt(t,n,e){var r,i=this._x0,o=this._y0,h,f,a,u,v=this._x1,_=this._y1,p=[],c=this._root,w,l;for(c&&p.push(new M(c,i,o,v,_)),e==null?e=1/0:(i=t-e,o=n-e,v=t+e,_=n+e,e*=e);w=p.pop();)if(!(!(c=w.node)||(h=w.x0)>v||(f=w.y0)>_||(a=w.x1)<i||(u=w.y1)<o))if(c.length){var s=(h+a)/2,g=(f+u)/2;p.push(new M(c[3],s,g,a,u),new M(c[2],h,g,s,u),new M(c[1],s,f,a,g),new M(c[0],h,f,s,g)),(l=(n>=g)<<1|t>=s)&&(w=p[p.length-1],p[p.length-1]=p[p.length-1-l],p[p.length-1-l]=w)}else{var y=t-+this._x.call(null,c.data),m=n-+this._y.call(null,c.data),x=y*y+m*m;if(x<e){var d=Math.sqrt(e=x);i=t-d,o=n-d,v=t+d,_=n+d,r=c.data}}return r}function ct(t){if(isNaN(v=+this._x.call(null,t))||isNaN(_=+this._y.call(null,t)))return this;var n,e=this._root,r,i,o,h=this._x0,f=this._y0,a=this._x1,u=this._y1,v,_,p,c,w,l,s,g;if(!e)return this;if(e.length)for(;;){if((w=v>=(p=(h+a)/2))?h=p:a=p,(l=_>=(c=(f+u)/2))?f=c:u=c,n=e,!(e=e[s=l<<1|w]))return this;if(!e.length)break;(n[s+1&3]||n[s+2&3]||n[s+3&3])&&(r=n,g=s)}for(;e.data!==t;)if(i=e,!(e=e.next))return this;return(o=e.next)&&delete e.next,i?(o?i.next=o:delete i.next,this):n?(o?n[s]=o:delete n[s],(e=n[0]||n[1]||n[2]||n[3])&&e===(n[3]||n[2]||n[1]||n[0])&&!e.length&&(r?r[g]=e:this._root=e),this):(this._root=o,this)}function gt(t){for(var n=0,e=t.length;n<e;++n)this.remove(t[n]);return this}function vt(){return this._root}function yt(){var t=0;return this.visit(function(n){if(!n.length)do++t;while(n=n.next)}),t}function xt(t){var n=[],e,r=this._root,i,o,h,f,a;for(r&&n.push(new M(r,this._x0,this._y0,this._x1,this._y1));e=n.pop();)if(!t(r=e.node,o=e.x0,h=e.y0,f=e.x1,a=e.y1)&&r.length){var u=(o+f)/2,v=(h+a)/2;(i=r[3])&&n.push(new M(i,u,v,f,a)),(i=r[2])&&n.push(new M(i,o,v,u,a)),(i=r[1])&&n.push(new M(i,u,h,f,v)),(i=r[0])&&n.push(new M(i,o,h,u,v))}return this}function pt(t){var n=[],e=[],r;for(this._root&&n.push(new M(this._root,this._x0,this._y0,this._x1,this._y1));r=n.pop();){var i=r.node;if(i.length){var o,h=r.x0,f=r.y0,a=r.x1,u=r.y1,v=(h+a)/2,_=(f+u)/2;(o=i[0])&&n.push(new M(o,h,f,v,_)),(o=i[1])&&n.push(new M(o,v,f,a,_)),(o=i[2])&&n.push(new M(o,h,_,v,u)),(o=i[3])&&n.push(new M(o,v,_,a,u))}e.push(r)}for(;r=e.pop();)t(r.node,r.x0,r.y0,r.x1,r.y1);return this}function wt(t){return t[0]}function _t(t){return arguments.length?(this._x=t,this):this._x}function mt(t){return t[1]}function dt(t){return arguments.length?(this._y=t,this):this._y}function H(t,n,e){var r=new R(n??wt,e??mt,NaN,NaN,NaN,NaN);return t==null?r:r.addAll(t)}function R(t,n,e,r,i,o){this._x=t,this._y=n,this._x0=e,this._y0=r,this._x1=i,this._y1=o,this._root=void 0}function K(t){for(var n={data:t.data},e=n;t=t.next;)e=e.next={data:t.data};return n}var z=H.prototype=R.prototype;z.copy=function(){var t=new R(this._x,this._y,this._x0,this._y0,this._x1,this._y1),n=this._root,e,r;if(!n)return t;if(!n.length)return t._root=K(n),t;for(e=[{source:n,target:t._root=new Array(4)}];n=e.pop();)for(var i=0;i<4;++i)(r=n.source[i])&&(r.length?e.push({source:r,target:n.target[i]=new Array(4)}):n.target[i]=K(r));return t},z.add=ft,z.addAll=at,z.cover=ut,z.data=st,z.extent=ht,z.find=lt,z.remove=ct,z.removeAll=gt,z.root=vt,z.size=yt,z.visit=xt,z.visitAfter=pt,z.x=_t,z.y=dt;function E(t){return function(){return t}}function b(t){return(t()-.5)*1e-6}function Nt(t){return t.x+t.vx}function At(t){return t.y+t.vy}function Mt(t){var n,e,r,i=1,o=1;typeof t!="function"&&(t=E(t==null?1:+t));function h(){for(var u,v=n.length,_,p,c,w,l,s,g=0;g<o;++g)for(_=H(n,Nt,At).visitAfter(f),u=0;u<v;++u)p=n[u],l=e[p.index],s=l*l,c=p.x+p.vx,w=p.y+p.vy,_.visit(y);function y(m,x,d,I,T){var N=m.data,j=m.r,A=l+j;if(N){if(N.index>p.index){var F=c-N.x-N.vx,k=w-N.y-N.vy,D=F*F+k*k;D<A*A&&(F===0&&(F=b(r),D+=F*F),k===0&&(k=b(r),D+=k*k),D=(A-(D=Math.sqrt(D)))/D*i,p.vx+=(F*=D)*(A=(j*=j)/(s+j)),p.vy+=(k*=D)*A,N.vx-=F*(A=1-A),N.vy-=k*A)}return}return x>c+A||I<c-A||d>w+A||T<w-A}}function f(u){if(u.data)return u.r=e[u.data.index];for(var v=u.r=0;v<4;++v)u[v]&&u[v].r>u.r&&(u.r=u[v].r)}function a(){if(n){var u,v=n.length,_;for(e=new Array(v),u=0;u<v;++u)_=n[u],e[_.index]=+t(_,u,n)}}return h.initialize=function(u,v){n=u,r=v,a()},h.iterations=function(u){return arguments.length?(o=+u,h):o},h.strength=function(u){return arguments.length?(i=+u,h):i},h.radius=function(u){return arguments.length?(t=typeof u=="function"?u:E(+u),a(),h):t},h}function zt(t){return t.index}function U(t,n){var e=t.get(n);if(!e)throw new Error("node not found: "+n);return e}function Et(t){var n=zt,e=_,r,i=E(30),o,h,f,a,u,v=1;t==null&&(t=[]);function _(s){return 1/Math.min(f[s.source.index],f[s.target.index])}function p(s){for(var g=0,y=t.length;g<v;++g)for(var m=0,x,d,I,T,N,j,A;m<y;++m)x=t[m],d=x.source,I=x.target,T=I.x+I.vx-d.x-d.vx||b(u),N=I.y+I.vy-d.y-d.vy||b(u),j=Math.sqrt(T*T+N*N),j=(j-o[m])/j*s*r[m],T*=j,N*=j,I.vx-=T*(A=a[m]),I.vy-=N*A,d.vx+=T*(A=1-A),d.vy+=N*A}function c(){if(h){var s,g=h.length,y=t.length,m=new Map(h.map((d,I)=>[n(d,I,h),d])),x;for(s=0,f=new Array(g);s<y;++s)x=t[s],x.index=s,typeof x.source!="object"&&(x.source=U(m,x.source)),typeof x.target!="object"&&(x.target=U(m,x.target)),f[x.source.index]=(f[x.source.index]||0)+1,f[x.target.index]=(f[x.target.index]||0)+1;for(s=0,a=new Array(y);s<y;++s)x=t[s],a[s]=f[x.source.index]/(f[x.source.index]+f[x.target.index]);r=new Array(y),w(),o=new Array(y),l()}}function w(){if(h)for(var s=0,g=t.length;s<g;++s)r[s]=+e(t[s],s,t)}function l(){if(h)for(var s=0,g=t.length;s<g;++s)o[s]=+i(t[s],s,t)}return p.initialize=function(s,g){h=s,u=g,c()},p.links=function(s){return arguments.length?(t=s,c(),p):t},p.id=function(s){return arguments.length?(n=s,p):n},p.iterations=function(s){return arguments.length?(v=+s,p):v},p.strength=function(s){return arguments.length?(e=typeof s=="function"?s:E(+s),w(),p):e},p.distance=function(s){return arguments.length?(i=typeof s=="function"?s:E(+s),l(),p):i},p}var It={value:()=>{}};function V(){for(var t=0,n=arguments.length,e={},r;t<n;++t){if(!(r=arguments[t]+"")||r in e||/[\s.]/.test(r))throw new Error("illegal type: "+r);e[r]=[]}return new L(e)}function L(t){this._=t}function Tt(t,n){return t.trim().split(/^|\s+/).map(function(e){var r="",i=e.indexOf(".");if(i>=0&&(r=e.slice(i+1),e=e.slice(0,i)),e&&!n.hasOwnProperty(e))throw new Error("unknown type: "+e);return{type:e,name:r}})}L.prototype=V.prototype={constructor:L,on:function(t,n){var e=this._,r=Tt(t+"",e),i,o=-1,h=r.length;if(arguments.length<2){for(;++o<h;)if((i=(t=r[o]).type)&&(i=jt(e[i],t.name)))return i;return}if(n!=null&&typeof n!="function")throw new Error("invalid callback: "+n);for(;++o<h;)if(i=(t=r[o]).type)e[i]=Z(e[i],t.name,n);else if(n==null)for(i in e)e[i]=Z(e[i],t.name,null);return this},copy:function(){var t={},n=this._;for(var e in n)t[e]=n[e].slice();return new L(t)},call:function(t,n){if((i=arguments.length-2)>0)for(var e=new Array(i),r=0,i,o;r<i;++r)e[r]=arguments[r+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(o=this._[t],r=0,i=o.length;r<i;++r)o[r].value.apply(n,e)},apply:function(t,n,e){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,o=r.length;i<o;++i)r[i].value.apply(n,e)}};function jt(t,n){for(var e=0,r=t.length,i;e<r;++e)if((i=t[e]).name===n)return i.value}function Z(t,n,e){for(var r=0,i=t.length;r<i;++r)if(t[r].name===n){t[r]=It,t=t.slice(0,r).concat(t.slice(r+1));break}return e!=null&&t.push({name:n,value:e}),t}var S=0,O=0,$=0,q=1e3,Q,B,X=0,P=0,Y=0,C=typeof performance=="object"&&performance.now?performance:Date,tt=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function nt(){return P||(tt(Dt),P=C.now()+Y)}function Dt(){P=0}function W(){this._call=this._time=this._next=null}W.prototype=et.prototype={constructor:W,restart:function(t,n,e){if(typeof t!="function")throw new TypeError("callback is not a function");e=(e==null?nt():+e)+(n==null?0:+n),!this._next&&B!==this&&(B?B._next=this:Q=this,B=this),this._call=t,this._time=e,G()},stop:function(){this._call&&(this._call=null,this._time=1/0,G())}};function et(t,n,e){var r=new W;return r.restart(t,n,e),r}function bt(){nt(),++S;for(var t=Q,n;t;)(n=P-t._time)>=0&&t._call.call(void 0,n),t=t._next;--S}function rt(){P=(X=C.now())+Y,S=O=0;try{bt()}finally{S=0,kt(),P=0}}function Ft(){var t=C.now(),n=t-X;n>q&&(Y-=n,X=t)}function kt(){for(var t,n=Q,e,r=1/0;n;)n._call?(r>n._time&&(r=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:Q=e);B=t,G(r)}function G(t){if(!S){O&&(O=clearTimeout(O));var n=t-P;n>24?(t<1/0&&(O=setTimeout(rt,Math.ceil(t-C.now()-Y)+1)),$&&($=clearInterval($))):($||(X=C.now(),$=setInterval(Ft,q)),S=1,tt(rt))}}const Pt=1664525,St=1013904223,it=4294967296;function Ot(){let t=1;return()=>(t=(Pt*t+St)%it)/it}function $t(t){return t.x}function Bt(t){return t.y}var Ct=10,Lt=Math.PI*(3-Math.sqrt(5));function Qt(t){var n,e=1,r=.001,i=1-Math.pow(r,1/300),o=0,h=.6,f=new Map,a=et(_),u=V("tick","end"),v=Ot();t==null&&(t=[]);function _(){p(),u.call("tick",n),e<r&&(a.stop(),u.call("end",n))}function p(l){var s,g=t.length,y;l===void 0&&(l=1);for(var m=0;m<l;++m)for(e+=(o-e)*i,f.forEach(function(x){x(e)}),s=0;s<g;++s)y=t[s],y.fx==null?y.x+=y.vx*=h:(y.x=y.fx,y.vx=0),y.fy==null?y.y+=y.vy*=h:(y.y=y.fy,y.vy=0);return n}function c(){for(var l=0,s=t.length,g;l<s;++l){if(g=t[l],g.index=l,g.fx!=null&&(g.x=g.fx),g.fy!=null&&(g.y=g.fy),isNaN(g.x)||isNaN(g.y)){var y=Ct*Math.sqrt(.5+l),m=l*Lt;g.x=y*Math.cos(m),g.y=y*Math.sin(m)}(isNaN(g.vx)||isNaN(g.vy))&&(g.vx=g.vy=0)}}function w(l){return l.initialize&&l.initialize(t,v),l}return c(),n={tick:p,restart:function(){return a.restart(_),n},stop:function(){return a.stop(),n},nodes:function(l){return arguments.length?(t=l,c(),f.forEach(w),n):t},alpha:function(l){return arguments.length?(e=+l,n):e},alphaMin:function(l){return arguments.length?(r=+l,n):r},alphaDecay:function(l){return arguments.length?(i=+l,n):+i},alphaTarget:function(l){return arguments.length?(o=+l,n):o},velocityDecay:function(l){return arguments.length?(h=1-l,n):1-h},randomSource:function(l){return arguments.length?(v=l,f.forEach(w),n):v},force:function(l,s){return arguments.length>1?(s==null?f.delete(l):f.set(l,w(s)),n):f.get(l)},find:function(l,s,g){var y=0,m=t.length,x,d,I,T,N;for(g==null?g=1/0:g*=g,y=0;y<m;++y)T=t[y],x=l-T.x,d=s-T.y,I=x*x+d*d,I<g&&(N=T,g=I);return N},on:function(l,s){return arguments.length>1?(u.on(l,s),n):u.on(l)}}}function Xt(){var t,n,e,r,i=E(-30),o,h=1,f=1/0,a=.81;function u(c){var w,l=t.length,s=H(t,$t,Bt).visitAfter(_);for(r=c,w=0;w<l;++w)n=t[w],s.visit(p)}function v(){if(t){var c,w=t.length,l;for(o=new Array(w),c=0;c<w;++c)l=t[c],o[l.index]=+i(l,c,t)}}function _(c){var w=0,l,s,g=0,y,m,x;if(c.length){for(y=m=x=0;x<4;++x)(l=c[x])&&(s=Math.abs(l.value))&&(w+=l.value,g+=s,y+=s*l.x,m+=s*l.y);c.x=y/g,c.y=m/g}else{l=c,l.x=l.data.x,l.y=l.data.y;do w+=o[l.data.index];while(l=l.next)}c.value=w}function p(c,w,l,s){if(!c.value)return!0;var g=c.x-n.x,y=c.y-n.y,m=s-w,x=g*g+y*y;if(m*m/a<x)return x<f&&(g===0&&(g=b(e),x+=g*g),y===0&&(y=b(e),x+=y*y),x<h&&(x=Math.sqrt(h*x)),n.vx+=g*c.value*r/x,n.vy+=y*c.value*r/x),!0;if(c.length||x>=f)return;(c.data!==n||c.next)&&(g===0&&(g=b(e),x+=g*g),y===0&&(y=b(e),x+=y*y),x<h&&(x=Math.sqrt(h*x)));do c.data!==n&&(m=o[c.data.index]*r/x,n.vx+=g*m,n.vy+=y*m);while(c=c.next)}return u.initialize=function(c,w){t=c,e=w,v()},u.strength=function(c){return arguments.length?(i=typeof c=="function"?c:E(+c),v(),u):i},u.distanceMin=function(c){return arguments.length?(h=c*c,u):Math.sqrt(h)},u.distanceMax=function(c){return arguments.length?(f=c*c,u):Math.sqrt(f)},u.theta=function(c){return arguments.length?(a=c*c,u):Math.sqrt(a)},u}function Yt(t){var n=E(.1),e,r,i;typeof t!="function"&&(t=E(t==null?0:+t));function o(f){for(var a=0,u=e.length,v;a<u;++a)v=e[a],v.vx+=(i[a]-v.x)*r[a]*f}function h(){if(e){var f,a=e.length;for(r=new Array(a),i=new Array(a),f=0;f<a;++f)r[f]=isNaN(i[f]=+t(e[f],f,e))?0:+n(e[f],f,e)}}return o.initialize=function(f){e=f,h()},o.strength=function(f){return arguments.length?(n=typeof f=="function"?f:E(+f),h(),o):n},o.x=function(f){return arguments.length?(t=typeof f=="function"?f:E(+f),h(),o):t},o}function Ht(t){var n=E(.1),e,r,i;typeof t!="function"&&(t=E(t==null?0:+t));function o(f){for(var a=0,u=e.length,v;a<u;++a)v=e[a],v.vy+=(i[a]-v.y)*r[a]*f}function h(){if(e){var f,a=e.length;for(r=new Array(a),i=new Array(a),f=0;f<a;++f)r[f]=isNaN(i[f]=+t(e[f],f,e))?0:+n(e[f],f,e)}}return o.initialize=function(f){e=f,h()},o.strength=function(f){return arguments.length?(n=typeof f=="function"?f:E(+f),h(),o):n},o.y=function(f){return arguments.length?(t=typeof f=="function"?f:E(+f),h(),o):t},o}self.onmessage=t=>{const{id:n,nodes:e,links:r}=t.data,i=e.map(a=>({...a})),o=Math.max(1,...r.map(a=>a.weight)),h=r.map(a=>({...a}));Qt(i).force("link",Et(h).id(a=>a.id).distance(a=>70+a.source.r+a.target.r).strength(a=>.15+.35*(a.weight/o))).force("charge",Xt().strength(a=>-180-a.r*12)).force("center",ot(0,0)).force("x",Yt(0).strength(.07)).force("y",Ht(0).strength(.07)).force("collide",Mt().radius(a=>a.r+8)).stop().tick(300);const f={};for(const a of i)f[a.id]=[a.x??0,a.y??0];self.postMessage({id:n,pos:f})}})();
|
|
1
|
+
(function(){"use strict";function ot(t,n){var e,r=1;t==null&&(t=0),n==null&&(n=0);function i(){var o,h=e.length,f,a=0,u=0;for(o=0;o<h;++o)f=e[o],a+=f.x,u+=f.y;for(a=(a/h-t)*r,u=(u/h-n)*r,o=0;o<h;++o)f=e[o],f.x-=a,f.y-=u}return i.initialize=function(o){e=o},i.x=function(o){return arguments.length?(t=+o,i):t},i.y=function(o){return arguments.length?(n=+o,i):n},i.strength=function(o){return arguments.length?(r=+o,i):r},i}function ft(t){const n=+this._x.call(null,t),e=+this._y.call(null,t);return J(this.cover(n,e),n,e,t)}function J(t,n,e,r){if(isNaN(n)||isNaN(e))return t;var i,o=t._root,h={data:r},f=t._x0,a=t._y0,u=t._x1,v=t._y1,_,p,c,w,l,s,g,y;if(!o)return t._root=h,t;for(;o.length;)if((l=n>=(_=(f+u)/2))?f=_:u=_,(s=e>=(p=(a+v)/2))?a=p:v=p,i=o,!(o=o[g=s<<1|l]))return i[g]=h,t;if(c=+t._x.call(null,o.data),w=+t._y.call(null,o.data),n===c&&e===w)return h.next=o,i?i[g]=h:t._root=h,t;do i=i?i[g]=new Array(4):t._root=new Array(4),(l=n>=(_=(f+u)/2))?f=_:u=_,(s=e>=(p=(a+v)/2))?a=p:v=p;while((g=s<<1|l)===(y=(w>=p)<<1|c>=_));return i[y]=o,i[g]=h,t}function at(t){Array.isArray(t)||(t=Array.from(t));const n=t.length,e=new Float64Array(n),r=new Float64Array(n);let i=1/0,o=i,h=-i,f=h;for(let a=0,u,v,_;a<n;++a){if(isNaN(v=+this._x.call(null,u=t[a]))||isNaN(_=+this._y.call(null,u))){e[a]=NaN;continue}e[a]=v,r[a]=_,v<i&&(i=v),v>h&&(h=v),_<o&&(o=_),_>f&&(f=_)}if(i>h||o>f)return this;this.cover(i,o).cover(h,f);for(let a=0;a<n;++a)J(this,e[a],r[a],t[a]);return this}function ut(t,n){if(isNaN(t=+t)||isNaN(n=+n))return this;var e=this._x0,r=this._y0,i=this._x1,o=this._y1;if(isNaN(e))i=(e=Math.floor(t))+1,o=(r=Math.floor(n))+1;else{for(var h=i-e||1,f=this._root,a,u;e>t||t>=i||r>n||n>=o;)switch(u=(n<r)<<1|t<e,a=new Array(4),a[u]=f,f=a,h*=2,u){case 0:i=e+h,o=r+h;break;case 1:e=i-h,o=r+h;break;case 2:i=e+h,r=o-h;break;case 3:e=i-h,r=o-h;break}this._root&&this._root.length&&(this._root=f)}return this._x0=e,this._y0=r,this._x1=i,this._y1=o,this}function st(){var t=[];return this.visit(function(n){if(!n.length)do t.push(n.data);while(n=n.next)}),t}function ht(t){return arguments.length?this.cover(+t[0][0],+t[0][1]).cover(+t[1][0],+t[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}function M(t,n,e,r,i){this.node=t,this.x0=n,this.y0=e,this.x1=r,this.y1=i}function lt(t,n,e){var r,i=this._x0,o=this._y0,h,f,a,u,v=this._x1,_=this._y1,p=[],c=this._root,w,l;for(c&&p.push(new M(c,i,o,v,_)),e==null?e=1/0:(i=t-e,o=n-e,v=t+e,_=n+e,e*=e);w=p.pop();)if(!(!(c=w.node)||(h=w.x0)>v||(f=w.y0)>_||(a=w.x1)<i||(u=w.y1)<o))if(c.length){var s=(h+a)/2,g=(f+u)/2;p.push(new M(c[3],s,g,a,u),new M(c[2],h,g,s,u),new M(c[1],s,f,a,g),new M(c[0],h,f,s,g)),(l=(n>=g)<<1|t>=s)&&(w=p[p.length-1],p[p.length-1]=p[p.length-1-l],p[p.length-1-l]=w)}else{var y=t-+this._x.call(null,c.data),m=n-+this._y.call(null,c.data),x=y*y+m*m;if(x<e){var d=Math.sqrt(e=x);i=t-d,o=n-d,v=t+d,_=n+d,r=c.data}}return r}function ct(t){if(isNaN(v=+this._x.call(null,t))||isNaN(_=+this._y.call(null,t)))return this;var n,e=this._root,r,i,o,h=this._x0,f=this._y0,a=this._x1,u=this._y1,v,_,p,c,w,l,s,g;if(!e)return this;if(e.length)for(;;){if((w=v>=(p=(h+a)/2))?h=p:a=p,(l=_>=(c=(f+u)/2))?f=c:u=c,n=e,!(e=e[s=l<<1|w]))return this;if(!e.length)break;(n[s+1&3]||n[s+2&3]||n[s+3&3])&&(r=n,g=s)}for(;e.data!==t;)if(i=e,!(e=e.next))return this;return(o=e.next)&&delete e.next,i?(o?i.next=o:delete i.next,this):n?(o?n[s]=o:delete n[s],(e=n[0]||n[1]||n[2]||n[3])&&e===(n[3]||n[2]||n[1]||n[0])&&!e.length&&(r?r[g]=e:this._root=e),this):(this._root=o,this)}function gt(t){for(var n=0,e=t.length;n<e;++n)this.remove(t[n]);return this}function vt(){return this._root}function yt(){var t=0;return this.visit(function(n){if(!n.length)do++t;while(n=n.next)}),t}function xt(t){var n=[],e,r=this._root,i,o,h,f,a;for(r&&n.push(new M(r,this._x0,this._y0,this._x1,this._y1));e=n.pop();)if(!t(r=e.node,o=e.x0,h=e.y0,f=e.x1,a=e.y1)&&r.length){var u=(o+f)/2,v=(h+a)/2;(i=r[3])&&n.push(new M(i,u,v,f,a)),(i=r[2])&&n.push(new M(i,o,v,u,a)),(i=r[1])&&n.push(new M(i,u,h,f,v)),(i=r[0])&&n.push(new M(i,o,h,u,v))}return this}function pt(t){var n=[],e=[],r;for(this._root&&n.push(new M(this._root,this._x0,this._y0,this._x1,this._y1));r=n.pop();){var i=r.node;if(i.length){var o,h=r.x0,f=r.y0,a=r.x1,u=r.y1,v=(h+a)/2,_=(f+u)/2;(o=i[0])&&n.push(new M(o,h,f,v,_)),(o=i[1])&&n.push(new M(o,v,f,a,_)),(o=i[2])&&n.push(new M(o,h,_,v,u)),(o=i[3])&&n.push(new M(o,v,_,a,u))}e.push(r)}for(;r=e.pop();)t(r.node,r.x0,r.y0,r.x1,r.y1);return this}function wt(t){return t[0]}function _t(t){return arguments.length?(this._x=t,this):this._x}function mt(t){return t[1]}function dt(t){return arguments.length?(this._y=t,this):this._y}function H(t,n,e){var r=new R(n??wt,e??mt,NaN,NaN,NaN,NaN);return t==null?r:r.addAll(t)}function R(t,n,e,r,i,o){this._x=t,this._y=n,this._x0=e,this._y0=r,this._x1=i,this._y1=o,this._root=void 0}function K(t){for(var n={data:t.data},e=n;t=t.next;)e=e.next={data:t.data};return n}var z=H.prototype=R.prototype;z.copy=function(){var t=new R(this._x,this._y,this._x0,this._y0,this._x1,this._y1),n=this._root,e,r;if(!n)return t;if(!n.length)return t._root=K(n),t;for(e=[{source:n,target:t._root=new Array(4)}];n=e.pop();)for(var i=0;i<4;++i)(r=n.source[i])&&(r.length?e.push({source:r,target:n.target[i]=new Array(4)}):n.target[i]=K(r));return t},z.add=ft,z.addAll=at,z.cover=ut,z.data=st,z.extent=ht,z.find=lt,z.remove=ct,z.removeAll=gt,z.root=vt,z.size=yt,z.visit=xt,z.visitAfter=pt,z.x=_t,z.y=dt;function E(t){return function(){return t}}function b(t){return(t()-.5)*1e-6}function Nt(t){return t.x+t.vx}function At(t){return t.y+t.vy}function Mt(t){var n,e,r,i=1,o=1;typeof t!="function"&&(t=E(t==null?1:+t));function h(){for(var u,v=n.length,_,p,c,w,l,s,g=0;g<o;++g)for(_=H(n,Nt,At).visitAfter(f),u=0;u<v;++u)p=n[u],l=e[p.index],s=l*l,c=p.x+p.vx,w=p.y+p.vy,_.visit(y);function y(m,x,d,I,T){var N=m.data,j=m.r,A=l+j;if(N){if(N.index>p.index){var F=c-N.x-N.vx,k=w-N.y-N.vy,D=F*F+k*k;D<A*A&&(F===0&&(F=b(r),D+=F*F),k===0&&(k=b(r),D+=k*k),D=(A-(D=Math.sqrt(D)))/D*i,p.vx+=(F*=D)*(A=(j*=j)/(s+j)),p.vy+=(k*=D)*A,N.vx-=F*(A=1-A),N.vy-=k*A)}return}return x>c+A||I<c-A||d>w+A||T<w-A}}function f(u){if(u.data)return u.r=e[u.data.index];for(var v=u.r=0;v<4;++v)u[v]&&u[v].r>u.r&&(u.r=u[v].r)}function a(){if(n){var u,v=n.length,_;for(e=new Array(v),u=0;u<v;++u)_=n[u],e[_.index]=+t(_,u,n)}}return h.initialize=function(u,v){n=u,r=v,a()},h.iterations=function(u){return arguments.length?(o=+u,h):o},h.strength=function(u){return arguments.length?(i=+u,h):i},h.radius=function(u){return arguments.length?(t=typeof u=="function"?u:E(+u),a(),h):t},h}function zt(t){return t.index}function U(t,n){var e=t.get(n);if(!e)throw new Error("node not found: "+n);return e}function Et(t){var n=zt,e=_,r,i=E(30),o,h,f,a,u,v=1;t==null&&(t=[]);function _(s){return 1/Math.min(f[s.source.index],f[s.target.index])}function p(s){for(var g=0,y=t.length;g<v;++g)for(var m=0,x,d,I,T,N,j,A;m<y;++m)x=t[m],d=x.source,I=x.target,T=I.x+I.vx-d.x-d.vx||b(u),N=I.y+I.vy-d.y-d.vy||b(u),j=Math.sqrt(T*T+N*N),j=(j-o[m])/j*s*r[m],T*=j,N*=j,I.vx-=T*(A=a[m]),I.vy-=N*A,d.vx+=T*(A=1-A),d.vy+=N*A}function c(){if(h){var s,g=h.length,y=t.length,m=new Map(h.map((d,I)=>[n(d,I,h),d])),x;for(s=0,f=new Array(g);s<y;++s)x=t[s],x.index=s,typeof x.source!="object"&&(x.source=U(m,x.source)),typeof x.target!="object"&&(x.target=U(m,x.target)),f[x.source.index]=(f[x.source.index]||0)+1,f[x.target.index]=(f[x.target.index]||0)+1;for(s=0,a=new Array(y);s<y;++s)x=t[s],a[s]=f[x.source.index]/(f[x.source.index]+f[x.target.index]);r=new Array(y),w(),o=new Array(y),l()}}function w(){if(h)for(var s=0,g=t.length;s<g;++s)r[s]=+e(t[s],s,t)}function l(){if(h)for(var s=0,g=t.length;s<g;++s)o[s]=+i(t[s],s,t)}return p.initialize=function(s,g){h=s,u=g,c()},p.links=function(s){return arguments.length?(t=s,c(),p):t},p.id=function(s){return arguments.length?(n=s,p):n},p.iterations=function(s){return arguments.length?(v=+s,p):v},p.strength=function(s){return arguments.length?(e=typeof s=="function"?s:E(+s),w(),p):e},p.distance=function(s){return arguments.length?(i=typeof s=="function"?s:E(+s),l(),p):i},p}var It={value:()=>{}};function V(){for(var t=0,n=arguments.length,e={},r;t<n;++t){if(!(r=arguments[t]+"")||r in e||/[\s.]/.test(r))throw new Error("illegal type: "+r);e[r]=[]}return new L(e)}function L(t){this._=t}function Tt(t,n){return t.trim().split(/^|\s+/).map(function(e){var r="",i=e.indexOf(".");if(i>=0&&(r=e.slice(i+1),e=e.slice(0,i)),e&&!n.hasOwnProperty(e))throw new Error("unknown type: "+e);return{type:e,name:r}})}L.prototype=V.prototype={constructor:L,on:function(t,n){var e=this._,r=Tt(t+"",e),i,o=-1,h=r.length;if(arguments.length<2){for(;++o<h;)if((i=(t=r[o]).type)&&(i=jt(e[i],t.name)))return i;return}if(n!=null&&typeof n!="function")throw new Error("invalid callback: "+n);for(;++o<h;)if(i=(t=r[o]).type)e[i]=Z(e[i],t.name,n);else if(n==null)for(i in e)e[i]=Z(e[i],t.name,null);return this},copy:function(){var t={},n=this._;for(var e in n)t[e]=n[e].slice();return new L(t)},call:function(t,n){if((i=arguments.length-2)>0)for(var e=new Array(i),r=0,i,o;r<i;++r)e[r]=arguments[r+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(o=this._[t],r=0,i=o.length;r<i;++r)o[r].value.apply(n,e)},apply:function(t,n,e){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,o=r.length;i<o;++i)r[i].value.apply(n,e)}};function jt(t,n){for(var e=0,r=t.length,i;e<r;++e)if((i=t[e]).name===n)return i.value}function Z(t,n,e){for(var r=0,i=t.length;r<i;++r)if(t[r].name===n){t[r]=It,t=t.slice(0,r).concat(t.slice(r+1));break}return e!=null&&t.push({name:n,value:e}),t}var S=0,O=0,$=0,q=1e3,Q,B,X=0,P=0,Y=0,C=typeof performance=="object"&&performance.now?performance:Date,tt=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function nt(){return P||(tt(Dt),P=C.now()+Y)}function Dt(){P=0}function W(){this._call=this._time=this._next=null}W.prototype=et.prototype={constructor:W,restart:function(t,n,e){if(typeof t!="function")throw new TypeError("callback is not a function");e=(e==null?nt():+e)+(n==null?0:+n),!this._next&&B!==this&&(B?B._next=this:Q=this,B=this),this._call=t,this._time=e,G()},stop:function(){this._call&&(this._call=null,this._time=1/0,G())}};function et(t,n,e){var r=new W;return r.restart(t,n,e),r}function bt(){nt(),++S;for(var t=Q,n;t;)(n=P-t._time)>=0&&t._call.call(void 0,n),t=t._next;--S}function rt(){P=(X=C.now())+Y,S=O=0;try{bt()}finally{S=0,kt(),P=0}}function Ft(){var t=C.now(),n=t-X;n>q&&(Y-=n,X=t)}function kt(){for(var t,n=Q,e,r=1/0;n;)n._call?(r>n._time&&(r=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:Q=e);B=t,G(r)}function G(t){if(!S){O&&(O=clearTimeout(O));var n=t-P;n>24?(t<1/0&&(O=setTimeout(rt,Math.ceil(t-C.now()-Y)+1)),$&&($=clearInterval($))):($||(X=C.now(),$=setInterval(Ft,q)),S=1,tt(rt))}}const Pt=1664525,St=1013904223,it=4294967296;function Ot(){let t=1;return()=>(t=(Pt*t+St)%it)/it}function $t(t){return t.x}function Bt(t){return t.y}var Ct=10,Lt=Math.PI*(3-Math.sqrt(5));function Qt(t){var n,e=1,r=.001,i=1-Math.pow(r,1/300),o=0,h=.6,f=new Map,a=et(_),u=V("tick","end"),v=Ot();t==null&&(t=[]);function _(){p(),u.call("tick",n),e<r&&(a.stop(),u.call("end",n))}function p(l){var s,g=t.length,y;l===void 0&&(l=1);for(var m=0;m<l;++m)for(e+=(o-e)*i,f.forEach(function(x){x(e)}),s=0;s<g;++s)y=t[s],y.fx==null?y.x+=y.vx*=h:(y.x=y.fx,y.vx=0),y.fy==null?y.y+=y.vy*=h:(y.y=y.fy,y.vy=0);return n}function c(){for(var l=0,s=t.length,g;l<s;++l){if(g=t[l],g.index=l,g.fx!=null&&(g.x=g.fx),g.fy!=null&&(g.y=g.fy),isNaN(g.x)||isNaN(g.y)){var y=Ct*Math.sqrt(.5+l),m=l*Lt;g.x=y*Math.cos(m),g.y=y*Math.sin(m)}(isNaN(g.vx)||isNaN(g.vy))&&(g.vx=g.vy=0)}}function w(l){return l.initialize&&l.initialize(t,v),l}return c(),n={tick:p,restart:function(){return a.restart(_),n},stop:function(){return a.stop(),n},nodes:function(l){return arguments.length?(t=l,c(),f.forEach(w),n):t},alpha:function(l){return arguments.length?(e=+l,n):e},alphaMin:function(l){return arguments.length?(r=+l,n):r},alphaDecay:function(l){return arguments.length?(i=+l,n):+i},alphaTarget:function(l){return arguments.length?(o=+l,n):o},velocityDecay:function(l){return arguments.length?(h=1-l,n):1-h},randomSource:function(l){return arguments.length?(v=l,f.forEach(w),n):v},force:function(l,s){return arguments.length>1?(s==null?f.delete(l):f.set(l,w(s)),n):f.get(l)},find:function(l,s,g){var y=0,m=t.length,x,d,I,T,N;for(g==null?g=1/0:g*=g,y=0;y<m;++y)T=t[y],x=l-T.x,d=s-T.y,I=x*x+d*d,I<g&&(N=T,g=I);return N},on:function(l,s){return arguments.length>1?(u.on(l,s),n):u.on(l)}}}function Xt(){var t,n,e,r,i=E(-30),o,h=1,f=1/0,a=.81;function u(c){var w,l=t.length,s=H(t,$t,Bt).visitAfter(_);for(r=c,w=0;w<l;++w)n=t[w],s.visit(p)}function v(){if(t){var c,w=t.length,l;for(o=new Array(w),c=0;c<w;++c)l=t[c],o[l.index]=+i(l,c,t)}}function _(c){var w=0,l,s,g=0,y,m,x;if(c.length){for(y=m=x=0;x<4;++x)(l=c[x])&&(s=Math.abs(l.value))&&(w+=l.value,g+=s,y+=s*l.x,m+=s*l.y);c.x=y/g,c.y=m/g}else{l=c,l.x=l.data.x,l.y=l.data.y;do w+=o[l.data.index];while(l=l.next)}c.value=w}function p(c,w,l,s){if(!c.value)return!0;var g=c.x-n.x,y=c.y-n.y,m=s-w,x=g*g+y*y;if(m*m/a<x)return x<f&&(g===0&&(g=b(e),x+=g*g),y===0&&(y=b(e),x+=y*y),x<h&&(x=Math.sqrt(h*x)),n.vx+=g*c.value*r/x,n.vy+=y*c.value*r/x),!0;if(c.length||x>=f)return;(c.data!==n||c.next)&&(g===0&&(g=b(e),x+=g*g),y===0&&(y=b(e),x+=y*y),x<h&&(x=Math.sqrt(h*x)));do c.data!==n&&(m=o[c.data.index]*r/x,n.vx+=g*m,n.vy+=y*m);while(c=c.next)}return u.initialize=function(c,w){t=c,e=w,v()},u.strength=function(c){return arguments.length?(i=typeof c=="function"?c:E(+c),v(),u):i},u.distanceMin=function(c){return arguments.length?(h=c*c,u):Math.sqrt(h)},u.distanceMax=function(c){return arguments.length?(f=c*c,u):Math.sqrt(f)},u.theta=function(c){return arguments.length?(a=c*c,u):Math.sqrt(a)},u}function Yt(t){var n=E(.1),e,r,i;typeof t!="function"&&(t=E(t==null?0:+t));function o(f){for(var a=0,u=e.length,v;a<u;++a)v=e[a],v.vx+=(i[a]-v.x)*r[a]*f}function h(){if(e){var f,a=e.length;for(r=new Array(a),i=new Array(a),f=0;f<a;++f)r[f]=isNaN(i[f]=+t(e[f],f,e))?0:+n(e[f],f,e)}}return o.initialize=function(f){e=f,h()},o.strength=function(f){return arguments.length?(n=typeof f=="function"?f:E(+f),h(),o):n},o.x=function(f){return arguments.length?(t=typeof f=="function"?f:E(+f),h(),o):t},o}function Ht(t){var n=E(.1),e,r,i;typeof t!="function"&&(t=E(t==null?0:+t));function o(f){for(var a=0,u=e.length,v;a<u;++a)v=e[a],v.vy+=(i[a]-v.y)*r[a]*f}function h(){if(e){var f,a=e.length;for(r=new Array(a),i=new Array(a),f=0;f<a;++f)r[f]=isNaN(i[f]=+t(e[f],f,e))?0:+n(e[f],f,e)}}return o.initialize=function(f){e=f,h()},o.strength=function(f){return arguments.length?(n=typeof f=="function"?f:E(+f),h(),o):n},o.y=function(f){return arguments.length?(t=typeof f=="function"?f:E(+f),h(),o):t},o}self.onmessage=t=>{const{id:n,nodes:e,links:r}=t.data,i=e.map(a=>({...a})),o=Math.max(1,...r.map(a=>a.weight)),h=r.map(a=>({...a}));Qt(i).force("link",Et(h).id(a=>a.id).distance(a=>110+a.source.r+a.target.r).strength(a=>.06+.24*(a.weight/o))).force("charge",Xt().strength(a=>-360-a.r*12)).force("center",ot(0,0)).force("x",Yt(0).strength(.06)).force("y",Ht(0).strength(.06)).force("collide",Mt().radius(a=>Math.max(a.r+24,a.w+8)).strength(.9)).stop().tick(300);const f={};for(const a of i)f[a.id]=[a.x??0,a.y??0];self.postMessage({id:n,pos:f})}})();
|