cmcts-c-agent-embedding 1.0.65-vib → 1.1.2-cmcuni

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.
Files changed (127) hide show
  1. package/dist/_basePickBy-1057a1b4.js +1 -0
  2. package/dist/_basePickBy-cbf78fb3.js +1 -0
  3. package/dist/_baseUniq-38ea2195.js +1 -0
  4. package/dist/_baseUniq-52a47b7b.js +1 -0
  5. package/dist/arc-6b847bc0.js +1 -0
  6. package/dist/arc-8928af28.js +1 -0
  7. package/dist/architecture-O4VJ6CD3-42323263.js +1 -0
  8. package/dist/architecture-O4VJ6CD3-b506967f.js +1 -0
  9. package/dist/architectureDiagram-VXUJARFQ-1bd867b6.js +1 -0
  10. package/dist/architectureDiagram-VXUJARFQ-2b851c59.js +1 -0
  11. package/dist/blockDiagram-VD42YOAC-5cea96b0.js +1 -0
  12. package/dist/blockDiagram-VD42YOAC-a909b757.js +1 -0
  13. package/dist/c4Diagram-YG6GDRKO-24d24519.js +1 -0
  14. package/dist/c4Diagram-YG6GDRKO-54783ab3.js +1 -0
  15. package/dist/channel-2af69aa2.js +1 -0
  16. package/dist/channel-f240e622.js +1 -0
  17. package/dist/chunk-4BX2VUAB-7747ae72.js +1 -0
  18. package/dist/chunk-4BX2VUAB-d05d937e.js +1 -0
  19. package/dist/chunk-55IACEB6-5a7b1be3.js +1 -0
  20. package/dist/chunk-55IACEB6-78729976.js +1 -0
  21. package/dist/chunk-B4BG7PRW-a97e69ff.js +1 -0
  22. package/dist/chunk-B4BG7PRW-cbf800c4.js +1 -0
  23. package/dist/chunk-DI55MBZ5-5dc4f926.js +1 -0
  24. package/dist/chunk-DI55MBZ5-95d71f6f.js +1 -0
  25. package/dist/chunk-FMBD7UC4-2c653fda.js +1 -0
  26. package/dist/chunk-FMBD7UC4-d75ed695.js +1 -0
  27. package/dist/chunk-QN33PNHL-0bf10733.js +1 -0
  28. package/dist/chunk-QN33PNHL-b00655c9.js +1 -0
  29. package/dist/chunk-QZHKN3VN-a979a9fe.js +1 -0
  30. package/dist/chunk-QZHKN3VN-d57979be.js +1 -0
  31. package/dist/chunk-TZMSLE5B-6755c559.js +1 -0
  32. package/dist/chunk-TZMSLE5B-ed6d6d7e.js +1 -0
  33. package/dist/classDiagram-2ON5EDUG-8b5a2a93.js +1 -0
  34. package/dist/classDiagram-2ON5EDUG-fa9ecfbb.js +1 -0
  35. package/dist/classDiagram-v2-WZHVMYZB-8b5a2a93.js +1 -0
  36. package/dist/classDiagram-v2-WZHVMYZB-fa9ecfbb.js +1 -0
  37. package/dist/clone-6cd174cf.js +1 -0
  38. package/dist/clone-8494eb3f.js +1 -0
  39. package/dist/components/Bot.d.ts.map +1 -1
  40. package/dist/components/bubbles/BotBubble.d.ts +0 -1
  41. package/dist/components/bubbles/BotBubble.d.ts.map +1 -1
  42. package/dist/components/bubbles/StarterPromptBubble.d.ts.map +1 -1
  43. package/dist/components/buttons/ConsultationButton.d.ts.map +1 -1
  44. package/dist/components/icons/AddImageIcon.d.ts.map +1 -1
  45. package/dist/components/index.d.ts +2 -0
  46. package/dist/components/index.d.ts.map +1 -1
  47. package/dist/components/inputs/textInput/components/TextInput.d.ts +3 -0
  48. package/dist/components/inputs/textInput/components/TextInput.d.ts.map +1 -1
  49. package/dist/components/modals/ZaloQRModal.d.ts.map +1 -1
  50. package/dist/cose-bilkent-S5V4N54A-2f5eb275.js +1 -0
  51. package/dist/cose-bilkent-S5V4N54A-3cda82b5.js +1 -0
  52. package/dist/cytoscape.esm-9acb9bfe.js +1 -0
  53. package/dist/dagre-6UL2VRFP-9b648c54.js +1 -0
  54. package/dist/dagre-6UL2VRFP-e997588d.js +1 -0
  55. package/dist/defaultLocale-1fe70b7d.js +1 -0
  56. package/dist/diagram-PSM6KHXK-1234d08d.js +1 -0
  57. package/dist/diagram-PSM6KHXK-15013de5.js +1 -0
  58. package/dist/diagram-QEK2KX5R-489b9505.js +1 -0
  59. package/dist/diagram-QEK2KX5R-9e94df2a.js +1 -0
  60. package/dist/diagram-S2PKOQOG-6fef3823.js +1 -0
  61. package/dist/diagram-S2PKOQOG-c943ed25.js +1 -0
  62. package/dist/erDiagram-Q2GNP2WA-2b1823f2.js +1 -0
  63. package/dist/erDiagram-Q2GNP2WA-7e6c6a04.js +1 -0
  64. package/dist/features/bubble/components/BubbleButton.d.ts.map +1 -1
  65. package/dist/flowDiagram-NV44I4VS-709c6479.js +1 -0
  66. package/dist/flowDiagram-NV44I4VS-98a84da9.js +1 -0
  67. package/dist/ganttDiagram-LVOFAZNH-1d379d6a.js +1 -0
  68. package/dist/ganttDiagram-LVOFAZNH-d8342586.js +1 -0
  69. package/dist/gitGraph-ZV4HHKMB-788776f3.js +1 -0
  70. package/dist/gitGraph-ZV4HHKMB-ba420dcc.js +1 -0
  71. package/dist/gitGraphDiagram-NY62KEGX-804d1363.js +1 -0
  72. package/dist/gitGraphDiagram-NY62KEGX-919097ea.js +1 -0
  73. package/dist/graph-834f6046.js +1 -0
  74. package/dist/graph-db4953aa.js +1 -0
  75. package/dist/info-63CPKGFF-2dccc483.js +1 -0
  76. package/dist/info-63CPKGFF-ef40f1c4.js +1 -0
  77. package/dist/infoDiagram-F6ZHWCRC-579d50b4.js +1 -0
  78. package/dist/infoDiagram-F6ZHWCRC-c9877bad.js +1 -0
  79. package/dist/init-cf76ae07.js +1 -0
  80. package/dist/journeyDiagram-XKPGCS4Q-25d3c922.js +1 -0
  81. package/dist/journeyDiagram-XKPGCS4Q-2d2cda1c.js +1 -0
  82. package/dist/kanban-definition-3W4ZIXB7-c556bee0.js +1 -0
  83. package/dist/kanban-definition-3W4ZIXB7-cdb93ec0.js +1 -0
  84. package/dist/katex-0a18b0df.js +1 -0
  85. package/dist/layout-40652dba.js +1 -0
  86. package/dist/layout-54ffc604.js +1 -0
  87. package/dist/linear-2f639b72.js +1 -0
  88. package/dist/linear-ed2367ff.js +1 -0
  89. package/dist/mermaid-parser.core-0cfa7d2a.js +1 -0
  90. package/dist/mermaid-parser.core-10bed742.js +1 -0
  91. package/dist/mindmap-definition-VGOIOE7T-169f5fe5.js +1 -0
  92. package/dist/mindmap-definition-VGOIOE7T-dea1c792.js +1 -0
  93. package/dist/ordinal-221e41d7.js +1 -0
  94. package/dist/packet-HUATNLJX-6f2471ea.js +1 -0
  95. package/dist/packet-HUATNLJX-c69e28eb.js +1 -0
  96. package/dist/pie-WTHONI2E-4143e44b.js +1 -0
  97. package/dist/pie-WTHONI2E-82b1fe3f.js +1 -0
  98. package/dist/pieDiagram-ADFJNKIX-499eec78.js +1 -0
  99. package/dist/pieDiagram-ADFJNKIX-657effd5.js +1 -0
  100. package/dist/quadrantDiagram-AYHSOK5B-138a0c93.js +1 -0
  101. package/dist/quadrantDiagram-AYHSOK5B-91137c4d.js +1 -0
  102. package/dist/radar-NJJJXTRR-5e934a95.js +1 -0
  103. package/dist/radar-NJJJXTRR-94d77527.js +1 -0
  104. package/dist/requirementDiagram-UZGBJVZJ-a5d9fb39.js +1 -0
  105. package/dist/requirementDiagram-UZGBJVZJ-d7aeec99.js +1 -0
  106. package/dist/sankeyDiagram-TZEHDZUN-15053ae0.js +1 -0
  107. package/dist/sankeyDiagram-TZEHDZUN-aadd2125.js +1 -0
  108. package/dist/sequenceDiagram-WL72ISMW-12e778ef.js +1 -0
  109. package/dist/sequenceDiagram-WL72ISMW-9330a98a.js +1 -0
  110. package/dist/stateDiagram-FKZM4ZOC-01225f0f.js +1 -0
  111. package/dist/stateDiagram-FKZM4ZOC-af4836d7.js +1 -0
  112. package/dist/stateDiagram-v2-4FDKWEC3-4774cc10.js +1 -0
  113. package/dist/stateDiagram-v2-4FDKWEC3-5ef8e019.js +1 -0
  114. package/dist/timeline-definition-IT6M3QCI-9921f937.js +1 -0
  115. package/dist/timeline-definition-IT6M3QCI-a7a9bbec.js +1 -0
  116. package/dist/treemap-75Q7IDZK-100ddeb7.js +1 -0
  117. package/dist/treemap-75Q7IDZK-851117b4.js +1 -0
  118. package/dist/utils/index.d.ts +27 -5
  119. package/dist/utils/index.d.ts.map +1 -1
  120. package/dist/web-0016ac81.js +1 -0
  121. package/dist/web-4e6d8ea9.js +1 -0
  122. package/dist/web.js +1 -1
  123. package/dist/window.d.ts.map +1 -1
  124. package/dist/xychartDiagram-PRI3JC2R-003630a4.js +1 -0
  125. package/dist/xychartDiagram-PRI3JC2R-df869780.js +1 -0
  126. package/package.json +5 -3
  127. package/public/index.html +45 -32
@@ -0,0 +1 @@
1
+ import{G as e}from"./graph-db4953aa.js";import{f as n,b as r,a as t,c as o,d as i,t as a,m as u,e as d,h as c,g as s,l as f,i as h}from"./_basePickBy-cbf78fb3.js";import{b9 as g,ba as l,bb as v,bc as p,aU as w,bd as b,aY as m,aX as y,be as x,aT as k,aA as E,a_ as N,aC as O,bf as _}from"./web-0016ac81.js";import{b as I,p as P,q as j,g as R,e as T,l as M,o as L,s as C,c as S,u as G,d as F,i as V,f as B,v as Y,r as q}from"./_baseUniq-38ea2195.js";var z=1,A=4;function D(e){return I(e,z|A)}var U=function(){return v.Date.now()};function J(e,n){return n<e}function X(e,n){var r={};return n=R(n),j(e,(function(e,t,o){b(r,t,n(e,t,o))})),r}function H(e){return e&&e.length?r(e,m,J):void 0}function K(e,n){return e&&e.length?r(e,R(n),t):void 0}function Q(e,n){if(e!==n){var r=void 0!==e,t=null===e,o=e==e,i=T(e),a=void 0!==n,u=null===n,d=n==n,c=T(n);if(!u&&!c&&!i&&n<e||i&&a&&d&&!u&&!c||t&&a&&d||!r&&d||!o)return 1;if(!t&&!i&&!c&&e<n||c&&r&&o&&!t&&!i||u&&r&&o||!a&&o||!d)return-1}return 0}function W(e,n,r){n=n.length?M(n,(function(e){return y(e)?function(n){return L(n,1===e.length?e[0]:e)}:e})):[m];var t=-1;return n=M(n,x(R)),function(e,n){var r=e.length;for(e.sort(n);r--;)e[r]=e[r].value;return e}(o(e,(function(e,r,o){return{criteria:M(n,(function(n){return n(e)})),index:++t,value:e}})),(function(e,n){return function(e,n,r){for(var t=-1,o=e.criteria,i=n.criteria,a=o.length,u=r.length;++t<a;){var d=Q(o[t],i[t]);if(d)return u<=t?d:d*("desc"==r[t]?-1:1)}return e.index-n.index}(e,n,r)}))}var Z,$=g(l(Z=function(e,n){return null==e?{}:function(e,n){return i(e,n,(function(n,r){return C(e,r)}))}(e,n)},void 0,n),Z+""),ee=Math.ceil,ne=Math.max;var re,te=function(e,n,r){return r&&"number"!=typeof r&&k(e,n,r)&&(n=r=void 0),e=a(e),void 0===n?(n=e,e=0):n=a(n),function(e,n,r,t){for(var o=-1,i=ne(ee((n-e)/(r||1)),0),a=Array(i);i--;)a[t?i:++o]=e,e+=r;return a}(e,n,r=void 0===r?e<n?1:-1:a(r),re)},oe=te,ie=E((function(e,n){var r;return null==e?[]:(1<(r=n.length)&&k(e,n[0],n[1])?n=[]:2<r&&k(n[0],n[1],n[2])&&(n=[n[0]]),W(e,S(n,1),[]))})),ae=ie,ue=0;function de(e){var n=++ue;return G(e)+n}class ce{constructor(){var e={};e._next=e._prev=e,this._sentinel=e}dequeue(){var e=this._sentinel,n=e._prev;if(n!==e)return se(n),n}enqueue(e){var n=this._sentinel;e._prev&&e._next&&se(e),e._next=n._next,n._next._prev=e,(n._next=e)._prev=n}toString(){for(var e=[],n=this._sentinel,r=n._prev;r!==n;)e.push(JSON.stringify(r,fe)),r=r._prev;return"["+e.join(", ")+"]"}}function se(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function fe(e,n){if("_next"!==e&&"_prev"!==e)return n}var he=O(1);function ge(r,t){return r.nodeCount()<=1?[]:(t=function(e,n,r){for(var t,o=[],i=n[n.length-1],a=n[0];e.nodeCount();){for(;t=a.dequeue();)le(e,n,r,t);for(;t=i.dequeue();)le(e,n,r,t);if(e.nodeCount())for(var u=n.length-2;0<u;--u)if(t=n[u].dequeue()){o=o.concat(le(e,n,r,t,!0));break}}return o}((t=function(n,r){var t=new e,o=0,i=0,a=(F(n.nodes(),(function(e){t.setNode(e,{v:e,in:0,out:0})})),F(n.edges(),(function(e){var n=t.edge(e.v,e.w)||0,a=r(e);t.setEdge(e.v,e.w,n+a),i=Math.max(i,t.node(e.v).out+=a),o=Math.max(o,t.node(e.w).in+=a)})),oe(i+o+3).map((function(){return new ce}))),u=o+1;return F(t.nodes(),(function(e){ve(a,u,t.node(e))})),{graph:t,buckets:a,zeroIdx:u}}(r,t||he)).graph,t.buckets,t.zeroIdx),n(u(t,(function(e){return r.outEdges(e.v,e.w)}))))}function le(e,n,r,t,o){var i=o?[]:void 0;return F(e.inEdges(t.v),(function(t){var a=e.edge(t),u=e.node(t.v);o&&i.push({v:t.v,w:t.w}),u.out-=a,ve(n,r,u)})),F(e.outEdges(t.v),(function(t){var o=e.edge(t);t=t.w;(t=e.node(t)).in-=o,ve(n,r,t)})),e.removeNode(t.v),i}function ve(e,n,r){(r.out?r.in?e[r.out-r.in+n]:e[e.length-1]:e[0]).enqueue(r)}function pe(e){var n,r="greedy"===e.graph().acyclicer?ge(e,(n=e,function(e){return n.edge(e).weight})):function(e){var n=[],r={},t={};return F(e.nodes(),(function o(i){Object.prototype.hasOwnProperty.call(t,i)||(t[i]=!0,r[i]=!0,F(e.outEdges(i),(function(e){Object.prototype.hasOwnProperty.call(r,e.w)?n.push(e):o(e.w)})),delete r[i])})),n}(e);F(r,(function(n){var r=e.edge(n);e.removeEdge(n),r.forwardName=n.name,r.reversed=!0,e.setEdge(n.w,n.v,r,de("rev"))}))}function we(e,n,r,t){for(var o;o=de(t),e.hasNode(o););return r.dummy=n,e.setNode(o,r),o}function be(n){var r=new e({multigraph:n.isMultigraph()}).setGraph(n.graph());return F(n.nodes(),(function(e){n.children(e).length||r.setNode(e,n.node(e))})),F(n.edges(),(function(e){r.setEdge(e,n.edge(e))})),r}function me(e,n){var r,t=e.x,o=e.y,i=n.x-t,a=(n=n.y-o,e.width/2);e=e.height/2;if(i||n)return e=Math.abs(n)*a>Math.abs(i)*e?(r=(e=n<0?-e:e)*i/n,e):(r=a=i<0?-a:a)*n/i,{x:t+r,y:o+e};throw new Error("Not possible to find intersection inside of the rectangle")}function ye(e){var n=u(oe(ke(e)+1),(function(){return[]}));return F(e.nodes(),(function(r){var t=e.node(r),o=t.rank;V(o)||(n[o][t.order]=r)})),n}function xe(e,n,r,t){var o={width:0,height:0};return 4<=arguments.length&&(o.rank=r,o.order=t),we(e,"border",o,n)}function ke(e){return H(u(e.nodes(),(function(n){if(n=e.node(n).rank,!V(n))return n})))}function Ee(e,n){var r=U();try{return n()}finally{console.log(e+" time: "+(U()-r)+"ms")}}function Ne(e,n){return n()}function Oe(e,n,r,t,o,i){var a=o[n][i-1];r=we(e,"border",{width:0,height:0,rank:i,borderType:n},r);o[n][i]=r,e.setParent(r,t),a&&e.setEdge(a,r,{weight:1})}function _e(e){var n=e.graph().rankdir.toLowerCase();"bt"!==n&&"rl"!==n||function(e){F(e.nodes(),(function(n){je(e.node(n))})),F(e.edges(),(function(n){n=e.edge(n),F(n.points,je),Object.prototype.hasOwnProperty.call(n,"y")&&je(n)}))}(e),"lr"!==n&&"rl"!==n||(function(e){F(e.nodes(),(function(n){Re(e.node(n))})),F(e.edges(),(function(n){n=e.edge(n),F(n.points,Re),Object.prototype.hasOwnProperty.call(n,"x")&&Re(n)}))}(e),Ie(e))}function Ie(e){F(e.nodes(),(function(n){Pe(e.node(n))})),F(e.edges(),(function(n){Pe(e.edge(n))}))}function Pe(e){var n=e.width;e.width=e.height,e.height=n}function je(e){e.y=-e.y}function Re(e){var n=e.x;e.x=e.y,e.y=n}function Te(e){e.graph().dummyChains=[],F(e.edges(),(function(n){!function(e,n){var r=n.v,t=e.node(r).rank,o=n.w,i=e.node(o).rank,a=n.name,u=e.edge(n),d=u.labelRank;if(i!==t+1){e.removeEdge(n);var c,s=void 0,f=0;for(++t;t<i;++f,++t)u.points=[],c=we(e,"edge",s={width:0,height:0,edgeLabel:u,edgeObj:n,rank:t},"_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),0===f&&e.graph().dummyChains.push(c),r=c;e.setEdge(r,o,{weight:u.weight},a)}}(e,n)}))}function Me(e){var n={};F(e.sources(),(function r(t){var o=e.node(t);return Object.prototype.hasOwnProperty.call(n,t)?o.rank:(n[t]=!0,(t=d(u(e.outEdges(t),(function(n){return r(n.w)-e.edge(n).minlen}))))!==Number.POSITIVE_INFINITY&&null!=t||(t=0),o.rank=t)}))}function Le(e,n){return e.node(n.w).rank-e.node(n.v).rank-e.edge(n).minlen}function Ce(n){var r,t=new e({directed:!1}),o=n.nodes()[0],i=n.nodeCount();for(t.setNode(o,{});Se(t,n)<i;)r=Ge(t,n),r=t.hasNode(r.v)?Le(n,r):-Le(n,r),Fe(t,n,r);return t}function Se(e,n){return F(e.nodes(),(function r(t){F(n.nodeEdges(t),(function(o){var i=o.v;i=t===i?o.w:i;e.hasNode(i)||Le(n,o)||(e.setNode(i,{}),e.setEdge(t,i,{}),r(i))}))})),e.nodeCount()}function Ge(e,n){return K(n.edges(),(function(r){if(e.hasNode(r.v)!==e.hasNode(r.w))return Le(n,r)}))}function Fe(e,n,r){F(e.nodes(),(function(e){n.node(e).rank+=r}))}function Ve(e,n,r){y(n)||(n=[n]);var t=(e.isDirected()?e.successors:e.neighbors).bind(e),o=[],i={};return F(n,(function(n){if(!e.hasNode(n))throw new Error("Graph does not have node: "+n);Be(e,n,"post"===r,i,t,o)})),o}function Be(e,n,r,t,o,i){Object.prototype.hasOwnProperty.call(t,n)||(t[n]=!0,r||i.push(n),F(o(n),(function(n){Be(e,n,r,t,o,i)})),r&&i.push(n))}function Ye(n){Me(n=function(n){var r=(new e).setGraph(n.graph());return F(n.nodes(),(function(e){r.setNode(e,n.node(e))})),F(n.edges(),(function(e){var t=r.edge(e.v,e.w)||{weight:0,minlen:1},o=n.edge(e);r.setEdge(e.v,e.w,{weight:t.weight+o.weight,minlen:Math.max(t.minlen,o.minlen)})})),r}(n));var r,t=Ce(n);for(Ae(t),qe(t,n);r=Ue(t);)Xe(t,n,r,Je(t,n,r))}function qe(e,n){var r=(r=function(e,n){return Ve(e,n,"post")}(e,e.nodes())).slice(0,r.length-1);F(r,(function(r){!function(e,n,r){var t=e.node(r).parent;e.edge(r,t).cutvalue=ze(e,n,r)}(e,n,r)}))}function ze(e,n,r){var t=e.node(r).parent,o=!0,i=n.edge(r,t),a=0;return i||(o=!1,i=n.edge(t,r)),a=i.weight,F(n.nodeEdges(r),(function(i){var u=i.v===r,d=u?i.w:i.v;d!==t&&(u=u===o,i=n.edge(i).weight,a+=u?i:-i,function(e,n,r){return e.hasEdge(n,r)}(e,r,d))&&(i=e.edge(r,d).cutvalue,a+=u?-i:i)})),a}function Ae(e,n){arguments.length<2&&(n=e.nodes()[0]),De(e,{},1,n)}function De(e,n,r,t,o){var i=r,a=e.node(t);return n[t]=!0,F(e.neighbors(t),(function(o){Object.prototype.hasOwnProperty.call(n,o)||(r=De(e,n,r,o,t))})),a.low=i,a.lim=r++,o?a.parent=o:delete a.parent,r}function Ue(e){return s(e.edges(),(function(n){return e.edge(n).cutvalue<0}))}function Je(e,n,r){var t=r.v,o=r.w,i=(r=(n.hasEdge(t,o)||(t=r.w,o=r.v),e.node(t)),t=e.node(o),r),a=!1;return r.lim>t.lim&&(i=t,a=!0),K(B(n.edges(),(function(n){return a===He(e,e.node(n.v),i)&&a!==He(e,e.node(n.w),i)})),(function(e){return Le(n,e)}))}function Xe(e,n,r,t){var o=r.v;r=r.w;e.removeEdge(o,r),e.setEdge(t.v,t.w,{}),Ae(e),qe(e,n),function(e,n){var r=s(e.nodes(),(function(e){return!n.node(e).parent}));r=(r=function(e,n){return Ve(e,n,"pre")}(e,r)).slice(1);F(r,(function(r){var t=e.node(r).parent,o=n.edge(r,t),i=!1;o||(o=n.edge(t,r),i=!0),n.node(r).rank=n.node(t).rank+(i?o.minlen:-o.minlen)}))}(e,n)}function He(e,n,r){return r.low<=n.lim&&n.lim<=r.lim}function Ke(e){switch(e.graph().ranker){case"network-simplex":default:We(e);break;case"tight-tree":!function(e){Me(e),Ce(e)}(e);break;case"longest-path":Qe(e)}}new Error,Ye.initLowLimValues=Ae,Ye.initCutValues=qe,Ye.calcCutValue=ze,Ye.leaveEdge=Ue,Ye.enterEdge=Je,Ye.exchangeEdges=Xe;var Qe=Me;function We(e){Ye(e)}function Ze(e){var n=we(e,"root",{},"_root"),r=function(e){var n={};return F(e.children(),(function(r){!function r(t,o){var i=e.children(t);i&&i.length&&F(i,(function(e){r(e,o+1)})),n[t]=o}(r,1)})),n}(e),t=H(Y(r))-1,o=2*t+1,i=(e.graph().nestingRoot=n,F(e.edges(),(function(n){e.edge(n).minlen*=o})),function(e){return q(e.edges(),(function(n,r){return n+e.edge(r).weight}),0)}(e)+1);F(e.children(),(function(a){$e(e,n,o,i,t,r,a)})),e.graph().nodeRankFactor=o}function $e(e,n,r,t,o,i,a){var u,d,c,s=e.children(a);s.length?(u=xe(e,"_bt"),d=xe(e,"_bb"),c=e.node(a),e.setParent(u,a),c.borderTop=u,e.setParent(d,a),c.borderBottom=d,F(s,(function(c){$e(e,n,r,t,o,i,c);var s=(f=e.node(c)).borderTop||c,f=(c=f.borderBottom||c,f.borderTop?t:2*t),h=s!==c?1:o-i[a]+1;e.setEdge(u,s,{weight:f,minlen:h,nestingEdge:!0}),e.setEdge(c,d,{weight:f,minlen:h,nestingEdge:!0})})),e.parent(a)||e.setEdge(n,u,{weight:0,minlen:o+i[a]})):a!==n&&e.setEdge(n,a,{weight:0,minlen:r})}function en(n,r,t){var o=function(e){for(var n;e.hasNode(n=de("_root")););return n}(n),i=new e({compound:!0}).setGraph({root:o}).setDefaultNodeLabel((function(e){return n.node(e)}));return F(n.nodes(),(function(e){var a=n.node(e),u=n.parent(e);(a.rank===r||a.minRank<=r&&r<=a.maxRank)&&(i.setNode(e),i.setParent(e,u||o),F(n[t](e),(function(r){var t=r.v===e?r.w:r.v,o=i.edge(t,e);o=V(o)?0:o.weight;i.setEdge(t,e,{weight:n.edge(r).weight+o})})),Object.prototype.hasOwnProperty.call(a,"minRank"))&&i.setNode(e,{borderLeft:a.borderLeft[r],borderRight:a.borderRight[r]})})),i}function nn(e,n){for(var r=0,t=1;t<n.length;++t)r+=rn(e,n[t-1],n[t]);return r}function rn(e,r,t){for(var o=function(e,n){return function(e,n,r){for(var t=-1,o=e.length,i=n.length,a={};++t<o;){var u=t<i?n[t]:void 0;r(a,e[t],u)}return a}(e||[],n||[],N)}(t,u(t,(function(e,n){return n}))),i=(r=n(u(r,(function(n){return ae(u(e.outEdges(n),(function(n){return{pos:o[n.w],weight:e.edge(n).weight}})),"pos")}))),1);i<t.length;)i<<=1;var a=2*i-1,d=(--i,u(new Array(a),(function(){return 0}))),c=0;return F(r.forEach((function(e){for(var n=e.pos+i,r=(d[n]+=e.weight,0);0<n;)n%2&&(r+=d[n+1]),d[n=n-1>>1]+=e.weight;c+=e.weight*r}))),c}function tn(e,n){var r={};return F(e,(function(e,n){n=r[e.v]={indegree:0,in:[],out:[],vs:[e.v],i:n},V(e.barycenter)||(n.barycenter=e.barycenter,n.weight=e.weight)})),F(n.edges(),(function(e){var n=r[e.v],t=r[e.w];V(n)||V(t)||(t.indegree++,n.out.push(r[e.w]))})),function(e){for(var n=[];e.length;){var r=e.pop();n.push(r),F(r.in.reverse(),function(e){return function(n){n.merged||(V(n.barycenter)||V(e.barycenter)||n.barycenter>=e.barycenter)&&on(e,n)}}(r)),F(r.out,function(n){return function(r){r.in.push(n),0==--r.indegree&&e.push(r)}}(r))}return u(B(n,(function(e){return!e.merged})),(function(e){return $(e,["vs","i","barycenter","weight"])}))}(B(r,(function(e){return!e.indegree})))}function on(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 an(e,r){e=function(e,n){var r={lhs:[],rhs:[]};return F(e,(function(e){(n(e)?r.lhs:r.rhs).push(e)})),r}(e,(function(e){return Object.prototype.hasOwnProperty.call(e,"barycenter")}));var t=e.lhs,o=ae(e.rhs,(function(e){return-e.i})),i=[],a=0,u=0,d=0;t.sort(function(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}}(!!r)),d=un(i,o,d),F(t,(function(e){d+=e.vs.length,i.push(e.vs),a+=e.barycenter*e.weight,u+=e.weight,d=un(i,o,d)})),e={vs:n(i)};return u&&(e.barycenter=a/u,e.weight=u),e}function un(e,n,r){for(var t;n.length&&(t=f(n)).i<=r;)n.pop(),e.push(t.vs),r++;return r}function dn(e,r,t,o){var i,a=e.children(r),d=(r=e.node(r))?r.borderLeft:void 0,c=r?r.borderRight:void 0,s={};d&&(a=B(a,(function(e){return e!==d&&e!==c}))),r=function(e,n){return u(n,(function(n){var r=e.inEdges(n);return r.length?{v:n,barycenter:(r=q(r,(function(n,r){var t=e.edge(r);return r=e.node(r.v),{sum:n.sum+t.weight*r.order,weight:n.weight+t.weight}}),{sum:0,weight:0})).sum/r.weight,weight:r.weight}:{v:n}}))}(e,a),F(r,(function(n){var r;e.children(n.v).length&&(r=dn(e,n.v,t,o),s[n.v]=r,Object.prototype.hasOwnProperty.call(r,"barycenter"))&&function(e,n){V(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)}(n,r)})),a=tn(r,t),function(e,r){F(e,(function(e){e.vs=n(e.vs.map((function(e){return r[e]?r[e].vs:e})))}))}(a,s),r=an(a,o);return d&&(r.vs=n([d,r.vs,c]),e.predecessors(d).length)&&(a=e.node(e.predecessors(d)[0]),i=e.node(e.predecessors(c)[0]),Object.prototype.hasOwnProperty.call(r,"barycenter")||(r.barycenter=0,r.weight=0),r.barycenter=(r.barycenter*r.weight+a.order+i.order)/(r.weight+2),r.weight+=2),r}function cn(e){for(var n,r=ke(e),t=sn(e,oe(1,r+1),"inEdges"),o=sn(e,oe(r-1,-1,-1),"outEdges"),i=(hn(e,function(e){var n={},r=B(e.nodes(),(function(n){return!e.children(n).length})),t=H(u(r,(function(n){return e.node(n).rank}))),o=u(oe(t+1),(function(){return[]}));return t=ae(r,(function(n){return e.node(n).rank})),F(t,(function r(t){var i;c(n,t)||(n[t]=!0,i=e.node(t),o[i.rank].push(t),F(e.successors(t),r))})),o}(e)),Number.POSITIVE_INFINITY),a=0,d=0;d<4;++a,++d){fn(a%2?t:o,2<=a%4);var s,f=nn(e,s=ye(e));f<i&&(d=0,n=D(s),i=f)}hn(e,n)}function sn(e,n,r){return u(n,(function(n){return en(e,n,r)}))}function fn(n,r){var t=new e;F(n,(function(e){var n=e.graph().root;n=dn(e,n,t,r);F(n.vs,(function(n,r){e.node(n).order=r})),function(e,n,r){var t,o={};F(r,(function(r){for(var i,a,u=e.parent(r);u;){if((i=e.parent(u))?(a=o[i],o[i]=u):(a=t,t=u),a&&a!==u)return void n.setEdge(a,u);u=i}}))}(e,t,n.vs)}))}function hn(e,n){F(n,(function(n){F(n,(function(n,r){e.node(n).order=r}))}))}function gn(e){var n=function(e){var n={},r=0;return F(e.children(),(function t(o){var i=r;F(e.children(o),t),n[o]={low:i,lim:r++}})),n}(e);F(e.graph().dummyChains,(function(r){for(var t,o=e.node(r).edgeObj,i=function(e,n,r,t){for(var o,i=[],a=[],u=Math.min(n[r].low,n[t].low),d=Math.max(n[r].lim,n[t].lim),c=r;c=e.parent(c),i.push(c),c&&(n[c].low>u||d>n[c].lim););for(o=c,c=t;(c=e.parent(c))!==o;)a.push(c);return{path:i.concat(a.reverse()),lca:o}}(e,n,o.v,o.w),a=i.path,u=i.lca,d=0,c=a[d],s=!0;r!==o.w;){if(t=e.node(r),s){for(;(c=a[d])!==u&&e.node(c).maxRank<t.rank;)d++;c===u&&(s=!1)}if(!s){for(;d<a.length-1&&e.node(c=a[d+1]).minRank<=t.rank;)d++;c=a[d]}e.setParent(r,c),r=e.successors(r)[0]}}))}function ln(e,n){var r={};return q(n,(function(n,t){var o=0,i=0,a=n.length,u=f(t);return F(t,(function(n,d){var c=function(e,n){if(e.node(n).dummy)return s(e.predecessors(n),(function(n){return e.node(n).dummy}))}(e,n),f=c?e.node(c).order:a;!c&&n!==u||(F(t.slice(i,d+1),(function(n){F(e.predecessors(n),(function(t){var i=e.node(t),a=i.order;!(a<o||f<a)||i.dummy&&e.node(n).dummy||vn(r,t,n)}))})),i=d+1,o=f)})),t})),r}function vn(e,n,r){r<n&&(t=n,n=r,r=t);var t=e[n];t||(e[n]=t={}),t[r]=!0}function pn(e,n,r){var t;return r<n&&(t=n,n=r,r=t),!!e[n]&&Object.prototype.hasOwnProperty.call(e[n],r)}function wn(n,r,t,o,i){var a={},u=function(n,r,t,o){var i=new e,a=n.graph(),u=function(e,n,r){return function(t,o,i){var a,u=t.node(o),d=t.node(i);o=0;if(o+=u.width/2,Object.prototype.hasOwnProperty.call(u,"labelpos"))switch(u.labelpos.toLowerCase()){case"l":a=-u.width/2;break;case"r":a=u.width/2}if(a&&(o+=r?a:-a),a=0,o=(o=(o+=(u.dummy?n:e)/2)+(d.dummy?n:e)/2)+d.width/2,Object.prototype.hasOwnProperty.call(d,"labelpos"))switch(d.labelpos.toLowerCase()){case"l":a=d.width/2;break;case"r":a=-d.width/2}return a&&(o+=r?a:-a),a=0,o}}(a.nodesep,a.edgesep,o);return F(r,(function(e){var r;F(e,(function(e){var o,a,d=t[e];i.setNode(d),r&&(o=t[r],a=i.edge(o,d),i.setEdge(o,d,Math.max(u(n,e,r),a||0))),r=e}))})),i}(n,r,t,i),d=i?"borderLeft":"borderRight";function c(e,n){for(var r=u.nodes(),t=r.pop(),o={};t;)o[t]?e(t):(o[t]=!0,r.push(t),r=r.concat(n(t))),t=r.pop()}return c((function(e){a[e]=u.inEdges(e).reduce((function(e,n){return Math.max(e,a[n.v]+u.edge(n))}),0)}),u.predecessors.bind(u)),c((function(e){var r=u.outEdges(e).reduce((function(e,n){return Math.min(e,a[n.w]-u.edge(n))}),Number.POSITIVE_INFINITY),t=n.node(e);r!==Number.POSITIVE_INFINITY&&t.borderType!==d&&(a[e]=Math.max(a[e],r))}),u.successors.bind(u)),F(o,(function(e){a[e]=a[t[e]]})),a}function bn(e,n){return K(Y(n),(function(n){var r=Number.NEGATIVE_INFINITY,t=Number.POSITIVE_INFINITY;return function(e,n){null==e||p(e,P(n),w)}(n,(function(n,o){o=function(e,n){return e.node(n).width}(e,o)/2,r=Math.max(n+o,r),t=Math.min(n-o,t)})),r-t}))}function mn(e){var n,r=ye(e),t=_(ln(e,r),function(e,n){var r={};function t(n,t,o,i,a){var u;F(oe(t,o),(function(t){u=n[t],e.node(u).dummy&&F(e.predecessors(u),(function(n){var t=e.node(n);t.dummy&&(t.order<i||t.order>a)&&vn(r,n,u)}))}))}return q(n,(function(n,r){var o,i=-1,a=0;return F(r,(function(u,d){"border"===e.node(u).dummy&&(u=e.predecessors(u)).length&&(o=e.node(u[0]).order,t(r,a,d,i,o),a=d,i=o),t(r,a,r.length,o,n.length)})),r})),r}(e,r)),o={},i=(F(["u","d"],(function(i){n="u"===i?r:Y(r).reverse(),F(["l","r"],(function(r){"r"===r&&(n=u(n,(function(e){return Y(e).reverse()})));var a=("u"===i?e.predecessors:e.successors).bind(e);a=function(e,n,r,t){var o={},i={},a={};return F(n,(function(e){F(e,(function(e,n){a[i[o[e]=e]=e]=n}))})),F(n,(function(e){var n=-1;F(e,(function(e){var u=t(e);if(u.length)for(var d=((u=ae(u,(function(e){return a[e]}))).length-1)/2,c=Math.floor(d),s=Math.ceil(d);c<=s;++c){var f=u[c];i[e]===e&&n<a[f]&&!pn(r,e,f)&&(i[f]=e,i[e]=o[e]=o[f],n=a[f])}}))})),{root:o,align:i}}(0,n,t,a),a=wn(e,n,a.root,a.align,"r"===r);"r"===r&&(a=X(a,(function(e){return-e}))),o[i+r]=a}))})),bn(e,o));return function(e,n){var r=Y(n),t=d(r),o=H(r);F(["u","d"],(function(r){F(["l","r"],(function(i){var a,u,c=r+i,s=e[c];s!==n&&(a=Y(s),u="l"===i?t-d(a):o-H(a))&&(e[c]=X(s,(function(e){return e+u})))}))}))}(o,i),function(e,n){return X(e.ul,(function(r,t){return n?e[n.toLowerCase()][t]:((t=ae(u(e,t)))[1]+t[2])/2}))}(o,e.graph().align)}function yn(e){(function(e){var n=ye(e),r=e.graph().ranksep,t=0;F(n,(function(n){var o=H(u(n,(function(n){return e.node(n).height})));F(n,(function(n){e.node(n).y=t+o/2})),t+=o+r}))})(e=be(e)),function(e,n){e&&j(e,P(n))}(mn(e),(function(n,r){e.node(r).x=n}))}function xn(n,r){var t=r&&r.debugTiming?Ee:Ne;t("layout",(()=>{var r=t(" buildLayoutGraph",(()=>function(n){var r=new e({multigraph:!0,compound:!0}),t=Tn(n.graph());return r.setGraph(_({},En,Rn(t,kn),$(t,Nn))),F(n.nodes(),(function(e){var t=Tn(n.node(e));r.setNode(e,h(Rn(t,On),_n)),r.setParent(e,n.parent(e))})),F(n.edges(),(function(e){var t=Tn(n.edge(e));r.setEdge(e,_({},Pn,Rn(t,In),$(t,jn)))})),r}(n)));t(" runLayout",(()=>function(e,n){n(" makeSpaceForEdgeLabels",(()=>function(e){var n=e.graph();n.ranksep/=2,F(e.edges(),(function(r){(r=e.edge(r)).minlen*=2,"c"!==r.labelpos.toLowerCase()&&("TB"===n.rankdir||"BT"===n.rankdir?r.width+=r.labeloffset:r.height+=r.labeloffset)}))}(e))),n(" removeSelfEdges",(()=>function(e){F(e.edges(),(function(n){var r;n.v===n.w&&((r=e.node(n.v)).selfEdges||(r.selfEdges=[]),r.selfEdges.push({e:n,label:e.edge(n)}),e.removeEdge(n))}))}(e))),n(" acyclic",(()=>pe(e))),n(" nestingGraph.run",(()=>Ze(e))),n(" rank",(()=>Ke(be(e)))),n(" injectEdgeLabelProxies",(()=>function(e){F(e.edges(),(function(n){var r=e.edge(n);r.width&&r.height&&(r=e.node(n.v),r={rank:(e.node(n.w).rank-r.rank)/2+r.rank,e:n},we(e,"edge-proxy",r,"_ep"))}))}(e))),n(" removeEmptyRanks",(()=>function(e){var n=d(u(e.nodes(),(function(n){return e.node(n).rank}))),r=[],t=(F(e.nodes(),(function(t){var o=e.node(t).rank-n;r[o]||(r[o]=[]),r[o].push(t)})),0),o=e.graph().nodeRankFactor;F(r,(function(n,r){V(n)&&r%o!=0?--t:t&&F(n,(function(n){e.node(n).rank+=t}))}))}(e))),n(" nestingGraph.cleanup",(()=>function(e){var n=e.graph();e.removeNode(n.nestingRoot),delete n.nestingRoot,F(e.edges(),(function(n){e.edge(n).nestingEdge&&e.removeEdge(n)}))}(e))),n(" normalizeRanks",(()=>function(e){var n=d(u(e.nodes(),(function(n){return e.node(n).rank})));F(e.nodes(),(function(r){r=e.node(r),c(r,"rank")&&(r.rank-=n)}))}(e))),n(" assignRankMinMax",(()=>function(e){var n=0;F(e.nodes(),(function(r){(r=e.node(r)).borderTop&&(r.minRank=e.node(r.borderTop).rank,r.maxRank=e.node(r.borderBottom).rank,n=H(n,r.maxRank))})),e.graph().maxRank=n}(e))),n(" removeEdgeLabelProxies",(()=>function(e){F(e.nodes(),(function(n){var r=e.node(n);"edge-proxy"===r.dummy&&(e.edge(r.e).labelRank=r.rank,e.removeNode(n))}))}(e))),n(" normalize.run",(()=>Te(e))),n(" parentDummyChains",(()=>gn(e))),n(" addBorderSegments",(()=>{var n;F((n=e).children(),(function e(r){var t=n.children(r),o=n.node(r);if(t.length&&F(t,e),Object.prototype.hasOwnProperty.call(o,"minRank")){o.borderLeft=[],o.borderRight=[];for(var i=o.minRank,a=o.maxRank+1;i<a;++i)Oe(n,"borderLeft","_bl",r,o,i),Oe(n,"borderRight","_br",r,o,i)}}))})),n(" order",(()=>cn(e))),n(" insertSelfEdges",(()=>function(e){var n=ye(e);F(n,(function(n){var r=0;F(n,(function(n,t){var o=e.node(n);o.order=t+r,F(o.selfEdges,(function(n){we(e,"selfedge",{width:n.label.width,height:n.label.height,rank:o.rank,order:t+ ++r,e:n.e,label:n.label},"_se")})),delete o.selfEdges}))}))}(e))),n(" adjustCoordinateSystem",(()=>function(e){var n=e.graph().rankdir.toLowerCase();"lr"!==n&&"rl"!==n||Ie(e)}(e))),n(" position",(()=>yn(e))),n(" positionSelfEdges",(()=>{var n;F((n=e).nodes(),(function(e){var r,t,o,i,a=n.node(e);"selfedge"===a.dummy&&(r=(i=n.node(a.e.v)).x+i.width/2,t=i.y,o=a.x-r,i=i.height/2,n.setEdge(a.e,a.label),n.removeNode(e),a.label.points=[{x:r+2*o/3,y:t-i},{x:r+5*o/6,y:t-i},{x:r+o,y:t},{x:r+5*o/6,y:t+i},{x:r+2*o/3,y:t+i}],a.label.x=a.x,a.label.y=a.y)}))})),n(" removeBorderNodes",(()=>{return F((n=e).nodes(),(function(e){var r,t,o,i;n.children(e).length&&(e=n.node(e),r=n.node(e.borderTop),t=n.node(e.borderBottom),o=n.node(f(e.borderLeft)),i=n.node(f(e.borderRight)),e.width=Math.abs(i.x-o.x),e.height=Math.abs(t.y-r.y),e.x=o.x+e.width/2,e.y=r.y+e.height/2)})),void F(n.nodes(),(function(e){"border"===n.node(e).dummy&&n.removeNode(e)}));var n})),n(" normalize.undo",(()=>{var n;F((n=e).graph().dummyChains,(function(e){var r,t=n.node(e),o=t.edgeLabel;for(n.setEdge(t.edgeObj,o);t.dummy;)r=n.successors(e)[0],n.removeNode(e),o.points.push({x:t.x,y:t.y}),"edge-label"===t.dummy&&(o.x=t.x,o.y=t.y,o.width=t.width,o.height=t.height),t=n.node(e=r)}))})),n(" fixupEdgeLabelCoords",(()=>function(e){F(e.edges(),(function(n){var r=e.edge(n);if(Object.prototype.hasOwnProperty.call(r,"x"))switch("l"!==r.labelpos&&"r"!==r.labelpos||(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}}))}(e))),n(" undoCoordinateSystem",(()=>_e(e))),n(" translateGraph",(()=>function(e){var n=Number.POSITIVE_INFINITY,r=0,t=Number.POSITIVE_INFINITY,o=0,i=e.graph(),a=i.marginx||0,u=i.marginy||0;function d(e){var i=e.x,a=e.y,u=e.width;e=e.height;n=Math.min(n,i-u/2),r=Math.max(r,i+u/2),t=Math.min(t,a-e/2),o=Math.max(o,a+e/2)}F(e.nodes(),(function(n){d(e.node(n))})),F(e.edges(),(function(n){n=e.edge(n),Object.prototype.hasOwnProperty.call(n,"x")&&d(n)})),n-=a,t-=u,F(e.nodes(),(function(r){(r=e.node(r)).x-=n,r.y-=t})),F(e.edges(),(function(r){r=e.edge(r),F(r.points,(function(e){e.x-=n,e.y-=t})),Object.prototype.hasOwnProperty.call(r,"x")&&(r.x-=n),Object.prototype.hasOwnProperty.call(r,"y")&&(r.y-=t)})),i.width=r-n+a,i.height=o-t+u}(e))),n(" assignNodeIntersects",(()=>{var n;F((n=e).edges(),(function(e){var r,t=n.edge(e),o=n.node(e.v),i=(e=n.node(e.w),t.points?(r=t.points[0],t.points[t.points.length-1]):(t.points=[],r=e,o));t.points.unshift(me(o,r)),t.points.push(me(e,i))}))})),n(" reversePoints",(()=>function(e){F(e.edges(),(function(n){(n=e.edge(n)).reversed&&n.points.reverse()}))}(e))),n(" acyclic.undo",(()=>function(e){F(e.edges(),(function(n){var r,t=e.edge(n);t.reversed&&(e.removeEdge(n),r=t.forwardName,delete t.reversed,delete t.forwardName,e.setEdge(n.w,n.v,t,r))}))}(e)))}(r,t))),t(" updateInputGraph",(()=>function(e,n){F(e.nodes(),(function(r){var t=e.node(r),o=n.node(r);t&&(t.x=o.x,t.y=o.y,n.children(r).length)&&(t.width=o.width,t.height=o.height)})),F(e.edges(),(function(r){var t=e.edge(r);r=n.edge(r);t.points=r.points,Object.prototype.hasOwnProperty.call(r,"x")&&(t.x=r.x,t.y=r.y)})),e.graph().width=n.graph().width,e.graph().height=n.graph().height}(n,r)))}))}var kn=["nodesep","edgesep","ranksep","marginx","marginy"],En={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},Nn=["acyclicer","ranker","rankdir","align"],On=["width","height"],_n={width:0,height:0},In=["minlen","weight","width","height","labeloffset"],Pn={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},jn=["labelpos"];function Rn(e,n){return X($(e,n),Number)}function Tn(e){var n={};return F(e,(function(e,r){n[r.toLowerCase()]=e})),n}export{xn as l};
@@ -0,0 +1 @@
1
+ import{G as e}from"./graph-834f6046.js";import{f as n,b as r,a as t,c as o,d as i,t as a,m as u,e as d,h as c,g as s,l as f,i as h}from"./_basePickBy-1057a1b4.js";import{b9 as g,ba as l,bb as v,bc as p,aU as w,bd as b,aY as m,aX as y,be as x,aT as k,aA as E,a_ as N,aC as O,bf as _}from"./web-4e6d8ea9.js";import{b as I,p as P,q as j,g as R,e as T,l as M,o as L,s as C,c as S,u as G,d as F,i as V,f as B,v as Y,r as q}from"./_baseUniq-52a47b7b.js";var z=1,A=4;function D(e){return I(e,z|A)}var U=function(){return v.Date.now()};function J(e,n){return n<e}function X(e,n){var r={};return n=R(n),j(e,(function(e,t,o){b(r,t,n(e,t,o))})),r}function H(e){return e&&e.length?r(e,m,J):void 0}function K(e,n){return e&&e.length?r(e,R(n),t):void 0}function Q(e,n){if(e!==n){var r=void 0!==e,t=null===e,o=e==e,i=T(e),a=void 0!==n,u=null===n,d=n==n,c=T(n);if(!u&&!c&&!i&&n<e||i&&a&&d&&!u&&!c||t&&a&&d||!r&&d||!o)return 1;if(!t&&!i&&!c&&e<n||c&&r&&o&&!t&&!i||u&&r&&o||!a&&o||!d)return-1}return 0}function W(e,n,r){n=n.length?M(n,(function(e){return y(e)?function(n){return L(n,1===e.length?e[0]:e)}:e})):[m];var t=-1;return n=M(n,x(R)),function(e,n){var r=e.length;for(e.sort(n);r--;)e[r]=e[r].value;return e}(o(e,(function(e,r,o){return{criteria:M(n,(function(n){return n(e)})),index:++t,value:e}})),(function(e,n){return function(e,n,r){for(var t=-1,o=e.criteria,i=n.criteria,a=o.length,u=r.length;++t<a;){var d=Q(o[t],i[t]);if(d)return u<=t?d:d*("desc"==r[t]?-1:1)}return e.index-n.index}(e,n,r)}))}var Z,$=g(l(Z=function(e,n){return null==e?{}:function(e,n){return i(e,n,(function(n,r){return C(e,r)}))}(e,n)},void 0,n),Z+""),ee=Math.ceil,ne=Math.max;var re,te=function(e,n,r){return r&&"number"!=typeof r&&k(e,n,r)&&(n=r=void 0),e=a(e),void 0===n?(n=e,e=0):n=a(n),function(e,n,r,t){for(var o=-1,i=ne(ee((n-e)/(r||1)),0),a=Array(i);i--;)a[t?i:++o]=e,e+=r;return a}(e,n,r=void 0===r?e<n?1:-1:a(r),re)},oe=te,ie=E((function(e,n){var r;return null==e?[]:(1<(r=n.length)&&k(e,n[0],n[1])?n=[]:2<r&&k(n[0],n[1],n[2])&&(n=[n[0]]),W(e,S(n,1),[]))})),ae=ie,ue=0;function de(e){var n=++ue;return G(e)+n}class ce{constructor(){var e={};e._next=e._prev=e,this._sentinel=e}dequeue(){var e=this._sentinel,n=e._prev;if(n!==e)return se(n),n}enqueue(e){var n=this._sentinel;e._prev&&e._next&&se(e),e._next=n._next,n._next._prev=e,(n._next=e)._prev=n}toString(){for(var e=[],n=this._sentinel,r=n._prev;r!==n;)e.push(JSON.stringify(r,fe)),r=r._prev;return"["+e.join(", ")+"]"}}function se(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function fe(e,n){if("_next"!==e&&"_prev"!==e)return n}var he=O(1);function ge(r,t){return r.nodeCount()<=1?[]:(t=function(e,n,r){for(var t,o=[],i=n[n.length-1],a=n[0];e.nodeCount();){for(;t=a.dequeue();)le(e,n,r,t);for(;t=i.dequeue();)le(e,n,r,t);if(e.nodeCount())for(var u=n.length-2;0<u;--u)if(t=n[u].dequeue()){o=o.concat(le(e,n,r,t,!0));break}}return o}((t=function(n,r){var t=new e,o=0,i=0,a=(F(n.nodes(),(function(e){t.setNode(e,{v:e,in:0,out:0})})),F(n.edges(),(function(e){var n=t.edge(e.v,e.w)||0,a=r(e);t.setEdge(e.v,e.w,n+a),i=Math.max(i,t.node(e.v).out+=a),o=Math.max(o,t.node(e.w).in+=a)})),oe(i+o+3).map((function(){return new ce}))),u=o+1;return F(t.nodes(),(function(e){ve(a,u,t.node(e))})),{graph:t,buckets:a,zeroIdx:u}}(r,t||he)).graph,t.buckets,t.zeroIdx),n(u(t,(function(e){return r.outEdges(e.v,e.w)}))))}function le(e,n,r,t,o){var i=o?[]:void 0;return F(e.inEdges(t.v),(function(t){var a=e.edge(t),u=e.node(t.v);o&&i.push({v:t.v,w:t.w}),u.out-=a,ve(n,r,u)})),F(e.outEdges(t.v),(function(t){var o=e.edge(t);t=t.w;(t=e.node(t)).in-=o,ve(n,r,t)})),e.removeNode(t.v),i}function ve(e,n,r){(r.out?r.in?e[r.out-r.in+n]:e[e.length-1]:e[0]).enqueue(r)}function pe(e){var n,r="greedy"===e.graph().acyclicer?ge(e,(n=e,function(e){return n.edge(e).weight})):function(e){var n=[],r={},t={};return F(e.nodes(),(function o(i){Object.prototype.hasOwnProperty.call(t,i)||(t[i]=!0,r[i]=!0,F(e.outEdges(i),(function(e){Object.prototype.hasOwnProperty.call(r,e.w)?n.push(e):o(e.w)})),delete r[i])})),n}(e);F(r,(function(n){var r=e.edge(n);e.removeEdge(n),r.forwardName=n.name,r.reversed=!0,e.setEdge(n.w,n.v,r,de("rev"))}))}function we(e,n,r,t){for(var o;o=de(t),e.hasNode(o););return r.dummy=n,e.setNode(o,r),o}function be(n){var r=new e({multigraph:n.isMultigraph()}).setGraph(n.graph());return F(n.nodes(),(function(e){n.children(e).length||r.setNode(e,n.node(e))})),F(n.edges(),(function(e){r.setEdge(e,n.edge(e))})),r}function me(e,n){var r,t=e.x,o=e.y,i=n.x-t,a=(n=n.y-o,e.width/2);e=e.height/2;if(i||n)return e=Math.abs(n)*a>Math.abs(i)*e?(r=(e=n<0?-e:e)*i/n,e):(r=a=i<0?-a:a)*n/i,{x:t+r,y:o+e};throw new Error("Not possible to find intersection inside of the rectangle")}function ye(e){var n=u(oe(ke(e)+1),(function(){return[]}));return F(e.nodes(),(function(r){var t=e.node(r),o=t.rank;V(o)||(n[o][t.order]=r)})),n}function xe(e,n,r,t){var o={width:0,height:0};return 4<=arguments.length&&(o.rank=r,o.order=t),we(e,"border",o,n)}function ke(e){return H(u(e.nodes(),(function(n){if(n=e.node(n).rank,!V(n))return n})))}function Ee(e,n){var r=U();try{return n()}finally{console.log(e+" time: "+(U()-r)+"ms")}}function Ne(e,n){return n()}function Oe(e,n,r,t,o,i){var a=o[n][i-1];r=we(e,"border",{width:0,height:0,rank:i,borderType:n},r);o[n][i]=r,e.setParent(r,t),a&&e.setEdge(a,r,{weight:1})}function _e(e){var n=e.graph().rankdir.toLowerCase();"bt"!==n&&"rl"!==n||function(e){F(e.nodes(),(function(n){je(e.node(n))})),F(e.edges(),(function(n){n=e.edge(n),F(n.points,je),Object.prototype.hasOwnProperty.call(n,"y")&&je(n)}))}(e),"lr"!==n&&"rl"!==n||(function(e){F(e.nodes(),(function(n){Re(e.node(n))})),F(e.edges(),(function(n){n=e.edge(n),F(n.points,Re),Object.prototype.hasOwnProperty.call(n,"x")&&Re(n)}))}(e),Ie(e))}function Ie(e){F(e.nodes(),(function(n){Pe(e.node(n))})),F(e.edges(),(function(n){Pe(e.edge(n))}))}function Pe(e){var n=e.width;e.width=e.height,e.height=n}function je(e){e.y=-e.y}function Re(e){var n=e.x;e.x=e.y,e.y=n}function Te(e){e.graph().dummyChains=[],F(e.edges(),(function(n){!function(e,n){var r=n.v,t=e.node(r).rank,o=n.w,i=e.node(o).rank,a=n.name,u=e.edge(n),d=u.labelRank;if(i!==t+1){e.removeEdge(n);var c,s=void 0,f=0;for(++t;t<i;++f,++t)u.points=[],c=we(e,"edge",s={width:0,height:0,edgeLabel:u,edgeObj:n,rank:t},"_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),0===f&&e.graph().dummyChains.push(c),r=c;e.setEdge(r,o,{weight:u.weight},a)}}(e,n)}))}function Me(e){var n={};F(e.sources(),(function r(t){var o=e.node(t);return Object.prototype.hasOwnProperty.call(n,t)?o.rank:(n[t]=!0,(t=d(u(e.outEdges(t),(function(n){return r(n.w)-e.edge(n).minlen}))))!==Number.POSITIVE_INFINITY&&null!=t||(t=0),o.rank=t)}))}function Le(e,n){return e.node(n.w).rank-e.node(n.v).rank-e.edge(n).minlen}function Ce(n){var r,t=new e({directed:!1}),o=n.nodes()[0],i=n.nodeCount();for(t.setNode(o,{});Se(t,n)<i;)r=Ge(t,n),r=t.hasNode(r.v)?Le(n,r):-Le(n,r),Fe(t,n,r);return t}function Se(e,n){return F(e.nodes(),(function r(t){F(n.nodeEdges(t),(function(o){var i=o.v;i=t===i?o.w:i;e.hasNode(i)||Le(n,o)||(e.setNode(i,{}),e.setEdge(t,i,{}),r(i))}))})),e.nodeCount()}function Ge(e,n){return K(n.edges(),(function(r){if(e.hasNode(r.v)!==e.hasNode(r.w))return Le(n,r)}))}function Fe(e,n,r){F(e.nodes(),(function(e){n.node(e).rank+=r}))}function Ve(e,n,r){y(n)||(n=[n]);var t=(e.isDirected()?e.successors:e.neighbors).bind(e),o=[],i={};return F(n,(function(n){if(!e.hasNode(n))throw new Error("Graph does not have node: "+n);Be(e,n,"post"===r,i,t,o)})),o}function Be(e,n,r,t,o,i){Object.prototype.hasOwnProperty.call(t,n)||(t[n]=!0,r||i.push(n),F(o(n),(function(n){Be(e,n,r,t,o,i)})),r&&i.push(n))}function Ye(n){Me(n=function(n){var r=(new e).setGraph(n.graph());return F(n.nodes(),(function(e){r.setNode(e,n.node(e))})),F(n.edges(),(function(e){var t=r.edge(e.v,e.w)||{weight:0,minlen:1},o=n.edge(e);r.setEdge(e.v,e.w,{weight:t.weight+o.weight,minlen:Math.max(t.minlen,o.minlen)})})),r}(n));var r,t=Ce(n);for(Ae(t),qe(t,n);r=Ue(t);)Xe(t,n,r,Je(t,n,r))}function qe(e,n){var r=(r=function(e,n){return Ve(e,n,"post")}(e,e.nodes())).slice(0,r.length-1);F(r,(function(r){!function(e,n,r){var t=e.node(r).parent;e.edge(r,t).cutvalue=ze(e,n,r)}(e,n,r)}))}function ze(e,n,r){var t=e.node(r).parent,o=!0,i=n.edge(r,t),a=0;return i||(o=!1,i=n.edge(t,r)),a=i.weight,F(n.nodeEdges(r),(function(i){var u=i.v===r,d=u?i.w:i.v;d!==t&&(u=u===o,i=n.edge(i).weight,a+=u?i:-i,function(e,n,r){return e.hasEdge(n,r)}(e,r,d))&&(i=e.edge(r,d).cutvalue,a+=u?-i:i)})),a}function Ae(e,n){arguments.length<2&&(n=e.nodes()[0]),De(e,{},1,n)}function De(e,n,r,t,o){var i=r,a=e.node(t);return n[t]=!0,F(e.neighbors(t),(function(o){Object.prototype.hasOwnProperty.call(n,o)||(r=De(e,n,r,o,t))})),a.low=i,a.lim=r++,o?a.parent=o:delete a.parent,r}function Ue(e){return s(e.edges(),(function(n){return e.edge(n).cutvalue<0}))}function Je(e,n,r){var t=r.v,o=r.w,i=(r=(n.hasEdge(t,o)||(t=r.w,o=r.v),e.node(t)),t=e.node(o),r),a=!1;return r.lim>t.lim&&(i=t,a=!0),K(B(n.edges(),(function(n){return a===He(e,e.node(n.v),i)&&a!==He(e,e.node(n.w),i)})),(function(e){return Le(n,e)}))}function Xe(e,n,r,t){var o=r.v;r=r.w;e.removeEdge(o,r),e.setEdge(t.v,t.w,{}),Ae(e),qe(e,n),function(e,n){var r=s(e.nodes(),(function(e){return!n.node(e).parent}));r=(r=function(e,n){return Ve(e,n,"pre")}(e,r)).slice(1);F(r,(function(r){var t=e.node(r).parent,o=n.edge(r,t),i=!1;o||(o=n.edge(t,r),i=!0),n.node(r).rank=n.node(t).rank+(i?o.minlen:-o.minlen)}))}(e,n)}function He(e,n,r){return r.low<=n.lim&&n.lim<=r.lim}function Ke(e){switch(e.graph().ranker){case"network-simplex":default:We(e);break;case"tight-tree":!function(e){Me(e),Ce(e)}(e);break;case"longest-path":Qe(e)}}new Error,Ye.initLowLimValues=Ae,Ye.initCutValues=qe,Ye.calcCutValue=ze,Ye.leaveEdge=Ue,Ye.enterEdge=Je,Ye.exchangeEdges=Xe;var Qe=Me;function We(e){Ye(e)}function Ze(e){var n=we(e,"root",{},"_root"),r=function(e){var n={};return F(e.children(),(function(r){!function r(t,o){var i=e.children(t);i&&i.length&&F(i,(function(e){r(e,o+1)})),n[t]=o}(r,1)})),n}(e),t=H(Y(r))-1,o=2*t+1,i=(e.graph().nestingRoot=n,F(e.edges(),(function(n){e.edge(n).minlen*=o})),function(e){return q(e.edges(),(function(n,r){return n+e.edge(r).weight}),0)}(e)+1);F(e.children(),(function(a){$e(e,n,o,i,t,r,a)})),e.graph().nodeRankFactor=o}function $e(e,n,r,t,o,i,a){var u,d,c,s=e.children(a);s.length?(u=xe(e,"_bt"),d=xe(e,"_bb"),c=e.node(a),e.setParent(u,a),c.borderTop=u,e.setParent(d,a),c.borderBottom=d,F(s,(function(c){$e(e,n,r,t,o,i,c);var s=(f=e.node(c)).borderTop||c,f=(c=f.borderBottom||c,f.borderTop?t:2*t),h=s!==c?1:o-i[a]+1;e.setEdge(u,s,{weight:f,minlen:h,nestingEdge:!0}),e.setEdge(c,d,{weight:f,minlen:h,nestingEdge:!0})})),e.parent(a)||e.setEdge(n,u,{weight:0,minlen:o+i[a]})):a!==n&&e.setEdge(n,a,{weight:0,minlen:r})}function en(n,r,t){var o=function(e){for(var n;e.hasNode(n=de("_root")););return n}(n),i=new e({compound:!0}).setGraph({root:o}).setDefaultNodeLabel((function(e){return n.node(e)}));return F(n.nodes(),(function(e){var a=n.node(e),u=n.parent(e);(a.rank===r||a.minRank<=r&&r<=a.maxRank)&&(i.setNode(e),i.setParent(e,u||o),F(n[t](e),(function(r){var t=r.v===e?r.w:r.v,o=i.edge(t,e);o=V(o)?0:o.weight;i.setEdge(t,e,{weight:n.edge(r).weight+o})})),Object.prototype.hasOwnProperty.call(a,"minRank"))&&i.setNode(e,{borderLeft:a.borderLeft[r],borderRight:a.borderRight[r]})})),i}function nn(e,n){for(var r=0,t=1;t<n.length;++t)r+=rn(e,n[t-1],n[t]);return r}function rn(e,r,t){for(var o=function(e,n){return function(e,n,r){for(var t=-1,o=e.length,i=n.length,a={};++t<o;){var u=t<i?n[t]:void 0;r(a,e[t],u)}return a}(e||[],n||[],N)}(t,u(t,(function(e,n){return n}))),i=(r=n(u(r,(function(n){return ae(u(e.outEdges(n),(function(n){return{pos:o[n.w],weight:e.edge(n).weight}})),"pos")}))),1);i<t.length;)i<<=1;var a=2*i-1,d=(--i,u(new Array(a),(function(){return 0}))),c=0;return F(r.forEach((function(e){for(var n=e.pos+i,r=(d[n]+=e.weight,0);0<n;)n%2&&(r+=d[n+1]),d[n=n-1>>1]+=e.weight;c+=e.weight*r}))),c}function tn(e,n){var r={};return F(e,(function(e,n){n=r[e.v]={indegree:0,in:[],out:[],vs:[e.v],i:n},V(e.barycenter)||(n.barycenter=e.barycenter,n.weight=e.weight)})),F(n.edges(),(function(e){var n=r[e.v],t=r[e.w];V(n)||V(t)||(t.indegree++,n.out.push(r[e.w]))})),function(e){for(var n=[];e.length;){var r=e.pop();n.push(r),F(r.in.reverse(),function(e){return function(n){n.merged||(V(n.barycenter)||V(e.barycenter)||n.barycenter>=e.barycenter)&&on(e,n)}}(r)),F(r.out,function(n){return function(r){r.in.push(n),0==--r.indegree&&e.push(r)}}(r))}return u(B(n,(function(e){return!e.merged})),(function(e){return $(e,["vs","i","barycenter","weight"])}))}(B(r,(function(e){return!e.indegree})))}function on(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 an(e,r){e=function(e,n){var r={lhs:[],rhs:[]};return F(e,(function(e){(n(e)?r.lhs:r.rhs).push(e)})),r}(e,(function(e){return Object.prototype.hasOwnProperty.call(e,"barycenter")}));var t=e.lhs,o=ae(e.rhs,(function(e){return-e.i})),i=[],a=0,u=0,d=0;t.sort(function(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}}(!!r)),d=un(i,o,d),F(t,(function(e){d+=e.vs.length,i.push(e.vs),a+=e.barycenter*e.weight,u+=e.weight,d=un(i,o,d)})),e={vs:n(i)};return u&&(e.barycenter=a/u,e.weight=u),e}function un(e,n,r){for(var t;n.length&&(t=f(n)).i<=r;)n.pop(),e.push(t.vs),r++;return r}function dn(e,r,t,o){var i,a=e.children(r),d=(r=e.node(r))?r.borderLeft:void 0,c=r?r.borderRight:void 0,s={};d&&(a=B(a,(function(e){return e!==d&&e!==c}))),r=function(e,n){return u(n,(function(n){var r=e.inEdges(n);return r.length?{v:n,barycenter:(r=q(r,(function(n,r){var t=e.edge(r);return r=e.node(r.v),{sum:n.sum+t.weight*r.order,weight:n.weight+t.weight}}),{sum:0,weight:0})).sum/r.weight,weight:r.weight}:{v:n}}))}(e,a),F(r,(function(n){var r;e.children(n.v).length&&(r=dn(e,n.v,t,o),s[n.v]=r,Object.prototype.hasOwnProperty.call(r,"barycenter"))&&function(e,n){V(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)}(n,r)})),a=tn(r,t),function(e,r){F(e,(function(e){e.vs=n(e.vs.map((function(e){return r[e]?r[e].vs:e})))}))}(a,s),r=an(a,o);return d&&(r.vs=n([d,r.vs,c]),e.predecessors(d).length)&&(a=e.node(e.predecessors(d)[0]),i=e.node(e.predecessors(c)[0]),Object.prototype.hasOwnProperty.call(r,"barycenter")||(r.barycenter=0,r.weight=0),r.barycenter=(r.barycenter*r.weight+a.order+i.order)/(r.weight+2),r.weight+=2),r}function cn(e){for(var n,r=ke(e),t=sn(e,oe(1,r+1),"inEdges"),o=sn(e,oe(r-1,-1,-1),"outEdges"),i=(hn(e,function(e){var n={},r=B(e.nodes(),(function(n){return!e.children(n).length})),t=H(u(r,(function(n){return e.node(n).rank}))),o=u(oe(t+1),(function(){return[]}));return t=ae(r,(function(n){return e.node(n).rank})),F(t,(function r(t){var i;c(n,t)||(n[t]=!0,i=e.node(t),o[i.rank].push(t),F(e.successors(t),r))})),o}(e)),Number.POSITIVE_INFINITY),a=0,d=0;d<4;++a,++d){fn(a%2?t:o,2<=a%4);var s,f=nn(e,s=ye(e));f<i&&(d=0,n=D(s),i=f)}hn(e,n)}function sn(e,n,r){return u(n,(function(n){return en(e,n,r)}))}function fn(n,r){var t=new e;F(n,(function(e){var n=e.graph().root;n=dn(e,n,t,r);F(n.vs,(function(n,r){e.node(n).order=r})),function(e,n,r){var t,o={};F(r,(function(r){for(var i,a,u=e.parent(r);u;){if((i=e.parent(u))?(a=o[i],o[i]=u):(a=t,t=u),a&&a!==u)return void n.setEdge(a,u);u=i}}))}(e,t,n.vs)}))}function hn(e,n){F(n,(function(n){F(n,(function(n,r){e.node(n).order=r}))}))}function gn(e){var n=function(e){var n={},r=0;return F(e.children(),(function t(o){var i=r;F(e.children(o),t),n[o]={low:i,lim:r++}})),n}(e);F(e.graph().dummyChains,(function(r){for(var t,o=e.node(r).edgeObj,i=function(e,n,r,t){for(var o,i=[],a=[],u=Math.min(n[r].low,n[t].low),d=Math.max(n[r].lim,n[t].lim),c=r;c=e.parent(c),i.push(c),c&&(n[c].low>u||d>n[c].lim););for(o=c,c=t;(c=e.parent(c))!==o;)a.push(c);return{path:i.concat(a.reverse()),lca:o}}(e,n,o.v,o.w),a=i.path,u=i.lca,d=0,c=a[d],s=!0;r!==o.w;){if(t=e.node(r),s){for(;(c=a[d])!==u&&e.node(c).maxRank<t.rank;)d++;c===u&&(s=!1)}if(!s){for(;d<a.length-1&&e.node(c=a[d+1]).minRank<=t.rank;)d++;c=a[d]}e.setParent(r,c),r=e.successors(r)[0]}}))}function ln(e,n){var r={};return q(n,(function(n,t){var o=0,i=0,a=n.length,u=f(t);return F(t,(function(n,d){var c=function(e,n){if(e.node(n).dummy)return s(e.predecessors(n),(function(n){return e.node(n).dummy}))}(e,n),f=c?e.node(c).order:a;!c&&n!==u||(F(t.slice(i,d+1),(function(n){F(e.predecessors(n),(function(t){var i=e.node(t),a=i.order;!(a<o||f<a)||i.dummy&&e.node(n).dummy||vn(r,t,n)}))})),i=d+1,o=f)})),t})),r}function vn(e,n,r){r<n&&(t=n,n=r,r=t);var t=e[n];t||(e[n]=t={}),t[r]=!0}function pn(e,n,r){var t;return r<n&&(t=n,n=r,r=t),!!e[n]&&Object.prototype.hasOwnProperty.call(e[n],r)}function wn(n,r,t,o,i){var a={},u=function(n,r,t,o){var i=new e,a=n.graph(),u=function(e,n,r){return function(t,o,i){var a,u=t.node(o),d=t.node(i);o=0;if(o+=u.width/2,Object.prototype.hasOwnProperty.call(u,"labelpos"))switch(u.labelpos.toLowerCase()){case"l":a=-u.width/2;break;case"r":a=u.width/2}if(a&&(o+=r?a:-a),a=0,o=(o=(o+=(u.dummy?n:e)/2)+(d.dummy?n:e)/2)+d.width/2,Object.prototype.hasOwnProperty.call(d,"labelpos"))switch(d.labelpos.toLowerCase()){case"l":a=d.width/2;break;case"r":a=-d.width/2}return a&&(o+=r?a:-a),a=0,o}}(a.nodesep,a.edgesep,o);return F(r,(function(e){var r;F(e,(function(e){var o,a,d=t[e];i.setNode(d),r&&(o=t[r],a=i.edge(o,d),i.setEdge(o,d,Math.max(u(n,e,r),a||0))),r=e}))})),i}(n,r,t,i),d=i?"borderLeft":"borderRight";function c(e,n){for(var r=u.nodes(),t=r.pop(),o={};t;)o[t]?e(t):(o[t]=!0,r.push(t),r=r.concat(n(t))),t=r.pop()}return c((function(e){a[e]=u.inEdges(e).reduce((function(e,n){return Math.max(e,a[n.v]+u.edge(n))}),0)}),u.predecessors.bind(u)),c((function(e){var r=u.outEdges(e).reduce((function(e,n){return Math.min(e,a[n.w]-u.edge(n))}),Number.POSITIVE_INFINITY),t=n.node(e);r!==Number.POSITIVE_INFINITY&&t.borderType!==d&&(a[e]=Math.max(a[e],r))}),u.successors.bind(u)),F(o,(function(e){a[e]=a[t[e]]})),a}function bn(e,n){return K(Y(n),(function(n){var r=Number.NEGATIVE_INFINITY,t=Number.POSITIVE_INFINITY;return function(e,n){null==e||p(e,P(n),w)}(n,(function(n,o){o=function(e,n){return e.node(n).width}(e,o)/2,r=Math.max(n+o,r),t=Math.min(n-o,t)})),r-t}))}function mn(e){var n,r=ye(e),t=_(ln(e,r),function(e,n){var r={};function t(n,t,o,i,a){var u;F(oe(t,o),(function(t){u=n[t],e.node(u).dummy&&F(e.predecessors(u),(function(n){var t=e.node(n);t.dummy&&(t.order<i||t.order>a)&&vn(r,n,u)}))}))}return q(n,(function(n,r){var o,i=-1,a=0;return F(r,(function(u,d){"border"===e.node(u).dummy&&(u=e.predecessors(u)).length&&(o=e.node(u[0]).order,t(r,a,d,i,o),a=d,i=o),t(r,a,r.length,o,n.length)})),r})),r}(e,r)),o={},i=(F(["u","d"],(function(i){n="u"===i?r:Y(r).reverse(),F(["l","r"],(function(r){"r"===r&&(n=u(n,(function(e){return Y(e).reverse()})));var a=("u"===i?e.predecessors:e.successors).bind(e);a=function(e,n,r,t){var o={},i={},a={};return F(n,(function(e){F(e,(function(e,n){a[i[o[e]=e]=e]=n}))})),F(n,(function(e){var n=-1;F(e,(function(e){var u=t(e);if(u.length)for(var d=((u=ae(u,(function(e){return a[e]}))).length-1)/2,c=Math.floor(d),s=Math.ceil(d);c<=s;++c){var f=u[c];i[e]===e&&n<a[f]&&!pn(r,e,f)&&(i[f]=e,i[e]=o[e]=o[f],n=a[f])}}))})),{root:o,align:i}}(0,n,t,a),a=wn(e,n,a.root,a.align,"r"===r);"r"===r&&(a=X(a,(function(e){return-e}))),o[i+r]=a}))})),bn(e,o));return function(e,n){var r=Y(n),t=d(r),o=H(r);F(["u","d"],(function(r){F(["l","r"],(function(i){var a,u,c=r+i,s=e[c];s!==n&&(a=Y(s),u="l"===i?t-d(a):o-H(a))&&(e[c]=X(s,(function(e){return e+u})))}))}))}(o,i),function(e,n){return X(e.ul,(function(r,t){return n?e[n.toLowerCase()][t]:((t=ae(u(e,t)))[1]+t[2])/2}))}(o,e.graph().align)}function yn(e){(function(e){var n=ye(e),r=e.graph().ranksep,t=0;F(n,(function(n){var o=H(u(n,(function(n){return e.node(n).height})));F(n,(function(n){e.node(n).y=t+o/2})),t+=o+r}))})(e=be(e)),function(e,n){e&&j(e,P(n))}(mn(e),(function(n,r){e.node(r).x=n}))}function xn(n,r){var t=r&&r.debugTiming?Ee:Ne;t("layout",(()=>{var r=t(" buildLayoutGraph",(()=>function(n){var r=new e({multigraph:!0,compound:!0}),t=Tn(n.graph());return r.setGraph(_({},En,Rn(t,kn),$(t,Nn))),F(n.nodes(),(function(e){var t=Tn(n.node(e));r.setNode(e,h(Rn(t,On),_n)),r.setParent(e,n.parent(e))})),F(n.edges(),(function(e){var t=Tn(n.edge(e));r.setEdge(e,_({},Pn,Rn(t,In),$(t,jn)))})),r}(n)));t(" runLayout",(()=>function(e,n){n(" makeSpaceForEdgeLabels",(()=>function(e){var n=e.graph();n.ranksep/=2,F(e.edges(),(function(r){(r=e.edge(r)).minlen*=2,"c"!==r.labelpos.toLowerCase()&&("TB"===n.rankdir||"BT"===n.rankdir?r.width+=r.labeloffset:r.height+=r.labeloffset)}))}(e))),n(" removeSelfEdges",(()=>function(e){F(e.edges(),(function(n){var r;n.v===n.w&&((r=e.node(n.v)).selfEdges||(r.selfEdges=[]),r.selfEdges.push({e:n,label:e.edge(n)}),e.removeEdge(n))}))}(e))),n(" acyclic",(()=>pe(e))),n(" nestingGraph.run",(()=>Ze(e))),n(" rank",(()=>Ke(be(e)))),n(" injectEdgeLabelProxies",(()=>function(e){F(e.edges(),(function(n){var r=e.edge(n);r.width&&r.height&&(r=e.node(n.v),r={rank:(e.node(n.w).rank-r.rank)/2+r.rank,e:n},we(e,"edge-proxy",r,"_ep"))}))}(e))),n(" removeEmptyRanks",(()=>function(e){var n=d(u(e.nodes(),(function(n){return e.node(n).rank}))),r=[],t=(F(e.nodes(),(function(t){var o=e.node(t).rank-n;r[o]||(r[o]=[]),r[o].push(t)})),0),o=e.graph().nodeRankFactor;F(r,(function(n,r){V(n)&&r%o!=0?--t:t&&F(n,(function(n){e.node(n).rank+=t}))}))}(e))),n(" nestingGraph.cleanup",(()=>function(e){var n=e.graph();e.removeNode(n.nestingRoot),delete n.nestingRoot,F(e.edges(),(function(n){e.edge(n).nestingEdge&&e.removeEdge(n)}))}(e))),n(" normalizeRanks",(()=>function(e){var n=d(u(e.nodes(),(function(n){return e.node(n).rank})));F(e.nodes(),(function(r){r=e.node(r),c(r,"rank")&&(r.rank-=n)}))}(e))),n(" assignRankMinMax",(()=>function(e){var n=0;F(e.nodes(),(function(r){(r=e.node(r)).borderTop&&(r.minRank=e.node(r.borderTop).rank,r.maxRank=e.node(r.borderBottom).rank,n=H(n,r.maxRank))})),e.graph().maxRank=n}(e))),n(" removeEdgeLabelProxies",(()=>function(e){F(e.nodes(),(function(n){var r=e.node(n);"edge-proxy"===r.dummy&&(e.edge(r.e).labelRank=r.rank,e.removeNode(n))}))}(e))),n(" normalize.run",(()=>Te(e))),n(" parentDummyChains",(()=>gn(e))),n(" addBorderSegments",(()=>{var n;F((n=e).children(),(function e(r){var t=n.children(r),o=n.node(r);if(t.length&&F(t,e),Object.prototype.hasOwnProperty.call(o,"minRank")){o.borderLeft=[],o.borderRight=[];for(var i=o.minRank,a=o.maxRank+1;i<a;++i)Oe(n,"borderLeft","_bl",r,o,i),Oe(n,"borderRight","_br",r,o,i)}}))})),n(" order",(()=>cn(e))),n(" insertSelfEdges",(()=>function(e){var n=ye(e);F(n,(function(n){var r=0;F(n,(function(n,t){var o=e.node(n);o.order=t+r,F(o.selfEdges,(function(n){we(e,"selfedge",{width:n.label.width,height:n.label.height,rank:o.rank,order:t+ ++r,e:n.e,label:n.label},"_se")})),delete o.selfEdges}))}))}(e))),n(" adjustCoordinateSystem",(()=>function(e){var n=e.graph().rankdir.toLowerCase();"lr"!==n&&"rl"!==n||Ie(e)}(e))),n(" position",(()=>yn(e))),n(" positionSelfEdges",(()=>{var n;F((n=e).nodes(),(function(e){var r,t,o,i,a=n.node(e);"selfedge"===a.dummy&&(r=(i=n.node(a.e.v)).x+i.width/2,t=i.y,o=a.x-r,i=i.height/2,n.setEdge(a.e,a.label),n.removeNode(e),a.label.points=[{x:r+2*o/3,y:t-i},{x:r+5*o/6,y:t-i},{x:r+o,y:t},{x:r+5*o/6,y:t+i},{x:r+2*o/3,y:t+i}],a.label.x=a.x,a.label.y=a.y)}))})),n(" removeBorderNodes",(()=>{return F((n=e).nodes(),(function(e){var r,t,o,i;n.children(e).length&&(e=n.node(e),r=n.node(e.borderTop),t=n.node(e.borderBottom),o=n.node(f(e.borderLeft)),i=n.node(f(e.borderRight)),e.width=Math.abs(i.x-o.x),e.height=Math.abs(t.y-r.y),e.x=o.x+e.width/2,e.y=r.y+e.height/2)})),void F(n.nodes(),(function(e){"border"===n.node(e).dummy&&n.removeNode(e)}));var n})),n(" normalize.undo",(()=>{var n;F((n=e).graph().dummyChains,(function(e){var r,t=n.node(e),o=t.edgeLabel;for(n.setEdge(t.edgeObj,o);t.dummy;)r=n.successors(e)[0],n.removeNode(e),o.points.push({x:t.x,y:t.y}),"edge-label"===t.dummy&&(o.x=t.x,o.y=t.y,o.width=t.width,o.height=t.height),t=n.node(e=r)}))})),n(" fixupEdgeLabelCoords",(()=>function(e){F(e.edges(),(function(n){var r=e.edge(n);if(Object.prototype.hasOwnProperty.call(r,"x"))switch("l"!==r.labelpos&&"r"!==r.labelpos||(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}}))}(e))),n(" undoCoordinateSystem",(()=>_e(e))),n(" translateGraph",(()=>function(e){var n=Number.POSITIVE_INFINITY,r=0,t=Number.POSITIVE_INFINITY,o=0,i=e.graph(),a=i.marginx||0,u=i.marginy||0;function d(e){var i=e.x,a=e.y,u=e.width;e=e.height;n=Math.min(n,i-u/2),r=Math.max(r,i+u/2),t=Math.min(t,a-e/2),o=Math.max(o,a+e/2)}F(e.nodes(),(function(n){d(e.node(n))})),F(e.edges(),(function(n){n=e.edge(n),Object.prototype.hasOwnProperty.call(n,"x")&&d(n)})),n-=a,t-=u,F(e.nodes(),(function(r){(r=e.node(r)).x-=n,r.y-=t})),F(e.edges(),(function(r){r=e.edge(r),F(r.points,(function(e){e.x-=n,e.y-=t})),Object.prototype.hasOwnProperty.call(r,"x")&&(r.x-=n),Object.prototype.hasOwnProperty.call(r,"y")&&(r.y-=t)})),i.width=r-n+a,i.height=o-t+u}(e))),n(" assignNodeIntersects",(()=>{var n;F((n=e).edges(),(function(e){var r,t=n.edge(e),o=n.node(e.v),i=(e=n.node(e.w),t.points?(r=t.points[0],t.points[t.points.length-1]):(t.points=[],r=e,o));t.points.unshift(me(o,r)),t.points.push(me(e,i))}))})),n(" reversePoints",(()=>function(e){F(e.edges(),(function(n){(n=e.edge(n)).reversed&&n.points.reverse()}))}(e))),n(" acyclic.undo",(()=>function(e){F(e.edges(),(function(n){var r,t=e.edge(n);t.reversed&&(e.removeEdge(n),r=t.forwardName,delete t.reversed,delete t.forwardName,e.setEdge(n.w,n.v,t,r))}))}(e)))}(r,t))),t(" updateInputGraph",(()=>function(e,n){F(e.nodes(),(function(r){var t=e.node(r),o=n.node(r);t&&(t.x=o.x,t.y=o.y,n.children(r).length)&&(t.width=o.width,t.height=o.height)})),F(e.edges(),(function(r){var t=e.edge(r);r=n.edge(r);t.points=r.points,Object.prototype.hasOwnProperty.call(r,"x")&&(t.x=r.x,t.y=r.y)})),e.graph().width=n.graph().width,e.graph().height=n.graph().height}(n,r)))}))}var kn=["nodesep","edgesep","ranksep","marginx","marginy"],En={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},Nn=["acyclicer","ranker","rankdir","align"],On=["width","height"],_n={width:0,height:0},In=["minlen","weight","width","height","labeloffset"],Pn={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},jn=["labelpos"];function Rn(e,n){return X($(e,n),Number)}function Tn(e){var n={};return F(e,(function(e,r){n[r.toLowerCase()]=e})),n}export{xn as l};
@@ -0,0 +1 @@
1
+ import{aN as n,aO as r,aP as t,aQ as e,aR as a}from"./web-0016ac81.js";import{i as u}from"./init-cf76ae07.js";import{e as i,f as o,a as f,b as c}from"./defaultLocale-1fe70b7d.js";function l(n,r){return null==n||null==r?NaN:n<r?-1:r<n?1:r<=n?0:NaN}function s(n,r){return null==n||null==r?NaN:r<n?-1:n<r?1:n<=r?0:NaN}function h(n){let r,t,e;function a(n,e,a=0,u=n.length){if(a<u){if(0!==r(e,e))return u;do{var i=a+u>>>1;t(n[i],e)<0?a=1+i:u=i}while(a<u)}return a}return e=2!==n.length?(r=l,t=(r,t)=>l(n(r),t),(r,t)=>n(r)-t):(r=n===l||n===s?n:M,t=n),{left:a,center:function(n,r,t=0,u=n.length){return t<(u=a(n,r,t,u-1))&&e(n[u-1],r)>-e(n[u],r)?u-1:u},right:function(n,e,a=0,u=n.length){if(a<u){if(0!==r(e,e))return u;do{var i=a+u>>>1;t(n[i],e)<=0?a=1+i:u=i}while(a<u)}return a}}}function M(){return 0}const m=h(l).right;h((function(n){return null===n?NaN:+n})).center;var p=m;const v=Math.sqrt(50),g=Math.sqrt(10),N=Math.sqrt(2);function y(n,r,t){var e=(r-n)/Math.max(0,t),a=Math.floor(Math.log10(e));e=(e=e/Math.pow(10,a))>=v?10:e>=g?5:e>=N?2:1;let u,i,o;return a<0?(o=Math.pow(10,-a)/e,u=Math.round(n*o),i=Math.round(r*o),u/o<n&&++u,i/o>r&&--i,o=-o):(o=Math.pow(10,a)*e,u=Math.round(n/o),i=Math.round(r/o),u*o<n&&++u,i*o>r&&--i),i<u&&.5<=t&&t<2?y(n,r,2*t):[u,i,o]}function w(n,r,t){return y(n=+n,r=+r,t=+t)[2]}function b(n,r,t){t=+t;var e=(r=+r)<(n=+n);return(e?-1:1)*((n=e?w(r,n,t):w(n,r,t))<0?1/-n:n)}function d(n,r){r=r||[];var t,e=n?Math.min(r.length,n.length):0,a=r.slice();return function(u){for(t=0;t<e;++t)a[t]=n[t]*(1-u)+r[t]*u;return a}}function A(n,r){for(var t=r?r.length:0,e=n?Math.min(t,n.length):0,a=new Array(e),u=new Array(t),i=0;i<e;++i)a[i]=j(n[i],r[i]);for(;i<t;++i)u[i]=r[i];return function(n){for(i=0;i<e;++i)u[i]=a[i](n);return u}}function x(n,r){var t=new Date;return n=+n,r=+r,function(e){return t.setTime(n*(1-e)+r*e),t}}function k(n,r){var t,e={},a={};for(t in null!==n&&"object"==typeof n||(n={}),r=null!==r&&"object"==typeof r?r:{})t in n?e[t]=j(n[t],r[t]):a[t]=r[t];return function(n){for(t in e)a[t]=e[t](n);return a}}function j(u,i){var o=typeof i;return null==i||"boolean"==o?n(i):("number"==o?r:"string"==o?(o=t(i))?(i=o,e):a:i instanceof t?e:i instanceof Date?x:function(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}(i)?d:Array.isArray(i)?A:"function"!=typeof i.valueOf&&"function"!=typeof i.toString||isNaN(i)?k:r)(u,i)}function q(n,r){return n=+n,r=+r,function(t){return Math.round(n*(1-t)+r*t)}}function D(n){return+n}var O=[0,1];function R(n){return n}function V(n,r){return(r-=n=+n)?function(t){return(t-n)/r}:(t=isNaN(r)?NaN:.5,function(){return t});var t}function B(n,r,t){var e=n[0],a=(n=n[1],r[0]);r=r[1],a=n<e?(e=V(n,e),t(r,a)):(e=V(e,n),t(a,r));return function(n){return a(e(n))}}function F(n,r,t){var e=Math.min(n.length,r.length)-1,a=new Array(e),u=new Array(e),i=-1;for(n[e]<n[0]&&(n=n.slice().reverse(),r=r.slice().reverse());++i<e;)a[i]=V(n[i],n[i+1]),u[i]=t(r[i],r[i+1]);return function(r){var t=p(n,r,1,e)-1;return u[t](a[t](r))}}function L(n,r){return r.domain(n.domain()).range(n.range()).interpolate(n.interpolate()).clamp(n.clamp()).unknown(n.unknown())}function P(){var n,t,e,a,u,i,o=O,f=O,c=j,l=R;function s(){var n=Math.min(o.length,f.length);return l!==R&&(l=function(n,r){var t;return r<n&&(t=n,n=r,r=t),function(t){return Math.max(n,Math.min(r,t))}}(o[0],o[n-1])),a=2<n?F:B,u=i=null,h}function h(r){return null==r||isNaN(r=+r)?e:(u=u||a(o.map(n),f,c))(n(l(r)))}return h.invert=function(e){return l(t((i=i||a(f,o.map(n),r))(e)))},h.domain=function(n){return arguments.length?(o=Array.from(n,D),s()):o.slice()},h.range=function(n){return arguments.length?(f=Array.from(n),s()):f.slice()},h.rangeRound=function(n){return f=Array.from(n),c=q,s()},h.clamp=function(n){return arguments.length?(l=!!n||R,s()):l!==R},h.interpolate=function(n){return arguments.length?(c=n,s()):c},h.unknown=function(n){return arguments.length?(e=n,h):e},function(r,e){return n=r,t=e,s()}}function Q(){return P()(R,R)}function S(n,r,t,e){var a,u=b(n,r,t);switch((e=o(null==e?",f":e)).type){case"s":var l=Math.max(Math.abs(n),Math.abs(r));return null!=e.precision||isNaN(a=function(n,r){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(i(r)/3)))-i(Math.abs(n)))}(u,l))||(e.precision=a),f(e,l);case"":case"e":case"g":case"p":case"r":null!=e.precision||isNaN(a=function(n,r){return n=Math.abs(n),r=Math.abs(r)-n,Math.max(0,i(r)-i(n))+1}(u,Math.max(Math.abs(n),Math.abs(r))))||(e.precision=a-("e"===e.type));break;case"f":case"%":null!=e.precision||isNaN(a=function(n){return Math.max(0,-i(Math.abs(n)))}(u))||(e.precision=a-2*("%"===e.type))}return c(e)}function T(n){var r=n.domain;return n.ticks=function(n){var t=r();return function(n,r,t){if(!(0<(t=+t)))return[];if((n=+n)==(r=+r))return[n];var e=r<n,[a,u,i]=e?y(r,n,t):y(n,r,t);if(!(a<=u))return[];var o=u-a+1,f=new Array(o);if(e)if(i<0)for(let n=0;n<o;++n)f[n]=(u-n)/-i;else for(let n=0;n<o;++n)f[n]=(u-n)*i;else if(i<0)for(let n=0;n<o;++n)f[n]=(a+n)/-i;else for(let n=0;n<o;++n)f[n]=(a+n)*i;return f}(t[0],t[t.length-1],null==n?10:n)},n.tickFormat=function(n,t){var e=r();return S(e[0],e[e.length-1],null==n?10:n,t)},n.nice=function(t){null==t&&(t=10);var e,a,u=r(),i=0,o=u.length-1,f=u[i],c=u[o],l=10;for(c<f&&(a=f,f=c,c=a,a=i,i=o,o=a);0<l--;){if((a=w(f,c,t))===e)return u[i]=f,u[o]=c,r(u);if(0<a)f=Math.floor(f/a)*a,c=Math.ceil(c/a)*a;else{if(!(a<0))break;f=Math.ceil(f*a)/a,c=Math.floor(c*a)/a}e=a}return n},n}function z(){var n=Q();return n.copy=function(){return L(n,z())},u.apply(n,arguments),T(n)}export{L as a,h as b,Q as c,z as l,b as t};
@@ -0,0 +1 @@
1
+ import{aN as n,aO as r,aP as t,aQ as e,aR as a}from"./web-4e6d8ea9.js";import{i as u}from"./init-cf76ae07.js";import{e as i,f as o,a as f,b as c}from"./defaultLocale-1fe70b7d.js";function l(n,r){return null==n||null==r?NaN:n<r?-1:r<n?1:r<=n?0:NaN}function s(n,r){return null==n||null==r?NaN:r<n?-1:n<r?1:n<=r?0:NaN}function h(n){let r,t,e;function a(n,e,a=0,u=n.length){if(a<u){if(0!==r(e,e))return u;do{var i=a+u>>>1;t(n[i],e)<0?a=1+i:u=i}while(a<u)}return a}return e=2!==n.length?(r=l,t=(r,t)=>l(n(r),t),(r,t)=>n(r)-t):(r=n===l||n===s?n:M,t=n),{left:a,center:function(n,r,t=0,u=n.length){return t<(u=a(n,r,t,u-1))&&e(n[u-1],r)>-e(n[u],r)?u-1:u},right:function(n,e,a=0,u=n.length){if(a<u){if(0!==r(e,e))return u;do{var i=a+u>>>1;t(n[i],e)<=0?a=1+i:u=i}while(a<u)}return a}}}function M(){return 0}const m=h(l).right;h((function(n){return null===n?NaN:+n})).center;var p=m;const v=Math.sqrt(50),g=Math.sqrt(10),N=Math.sqrt(2);function y(n,r,t){var e=(r-n)/Math.max(0,t),a=Math.floor(Math.log10(e));e=(e=e/Math.pow(10,a))>=v?10:e>=g?5:e>=N?2:1;let u,i,o;return a<0?(o=Math.pow(10,-a)/e,u=Math.round(n*o),i=Math.round(r*o),u/o<n&&++u,i/o>r&&--i,o=-o):(o=Math.pow(10,a)*e,u=Math.round(n/o),i=Math.round(r/o),u*o<n&&++u,i*o>r&&--i),i<u&&.5<=t&&t<2?y(n,r,2*t):[u,i,o]}function w(n,r,t){return y(n=+n,r=+r,t=+t)[2]}function b(n,r,t){t=+t;var e=(r=+r)<(n=+n);return(e?-1:1)*((n=e?w(r,n,t):w(n,r,t))<0?1/-n:n)}function d(n,r){r=r||[];var t,e=n?Math.min(r.length,n.length):0,a=r.slice();return function(u){for(t=0;t<e;++t)a[t]=n[t]*(1-u)+r[t]*u;return a}}function A(n,r){for(var t=r?r.length:0,e=n?Math.min(t,n.length):0,a=new Array(e),u=new Array(t),i=0;i<e;++i)a[i]=j(n[i],r[i]);for(;i<t;++i)u[i]=r[i];return function(n){for(i=0;i<e;++i)u[i]=a[i](n);return u}}function x(n,r){var t=new Date;return n=+n,r=+r,function(e){return t.setTime(n*(1-e)+r*e),t}}function k(n,r){var t,e={},a={};for(t in null!==n&&"object"==typeof n||(n={}),r=null!==r&&"object"==typeof r?r:{})t in n?e[t]=j(n[t],r[t]):a[t]=r[t];return function(n){for(t in e)a[t]=e[t](n);return a}}function j(u,i){var o=typeof i;return null==i||"boolean"==o?n(i):("number"==o?r:"string"==o?(o=t(i))?(i=o,e):a:i instanceof t?e:i instanceof Date?x:function(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}(i)?d:Array.isArray(i)?A:"function"!=typeof i.valueOf&&"function"!=typeof i.toString||isNaN(i)?k:r)(u,i)}function q(n,r){return n=+n,r=+r,function(t){return Math.round(n*(1-t)+r*t)}}function D(n){return+n}var O=[0,1];function R(n){return n}function V(n,r){return(r-=n=+n)?function(t){return(t-n)/r}:(t=isNaN(r)?NaN:.5,function(){return t});var t}function B(n,r,t){var e=n[0],a=(n=n[1],r[0]);r=r[1],a=n<e?(e=V(n,e),t(r,a)):(e=V(e,n),t(a,r));return function(n){return a(e(n))}}function F(n,r,t){var e=Math.min(n.length,r.length)-1,a=new Array(e),u=new Array(e),i=-1;for(n[e]<n[0]&&(n=n.slice().reverse(),r=r.slice().reverse());++i<e;)a[i]=V(n[i],n[i+1]),u[i]=t(r[i],r[i+1]);return function(r){var t=p(n,r,1,e)-1;return u[t](a[t](r))}}function L(n,r){return r.domain(n.domain()).range(n.range()).interpolate(n.interpolate()).clamp(n.clamp()).unknown(n.unknown())}function P(){var n,t,e,a,u,i,o=O,f=O,c=j,l=R;function s(){var n=Math.min(o.length,f.length);return l!==R&&(l=function(n,r){var t;return r<n&&(t=n,n=r,r=t),function(t){return Math.max(n,Math.min(r,t))}}(o[0],o[n-1])),a=2<n?F:B,u=i=null,h}function h(r){return null==r||isNaN(r=+r)?e:(u=u||a(o.map(n),f,c))(n(l(r)))}return h.invert=function(e){return l(t((i=i||a(f,o.map(n),r))(e)))},h.domain=function(n){return arguments.length?(o=Array.from(n,D),s()):o.slice()},h.range=function(n){return arguments.length?(f=Array.from(n),s()):f.slice()},h.rangeRound=function(n){return f=Array.from(n),c=q,s()},h.clamp=function(n){return arguments.length?(l=!!n||R,s()):l!==R},h.interpolate=function(n){return arguments.length?(c=n,s()):c},h.unknown=function(n){return arguments.length?(e=n,h):e},function(r,e){return n=r,t=e,s()}}function Q(){return P()(R,R)}function S(n,r,t,e){var a,u=b(n,r,t);switch((e=o(null==e?",f":e)).type){case"s":var l=Math.max(Math.abs(n),Math.abs(r));return null!=e.precision||isNaN(a=function(n,r){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(i(r)/3)))-i(Math.abs(n)))}(u,l))||(e.precision=a),f(e,l);case"":case"e":case"g":case"p":case"r":null!=e.precision||isNaN(a=function(n,r){return n=Math.abs(n),r=Math.abs(r)-n,Math.max(0,i(r)-i(n))+1}(u,Math.max(Math.abs(n),Math.abs(r))))||(e.precision=a-("e"===e.type));break;case"f":case"%":null!=e.precision||isNaN(a=function(n){return Math.max(0,-i(Math.abs(n)))}(u))||(e.precision=a-2*("%"===e.type))}return c(e)}function T(n){var r=n.domain;return n.ticks=function(n){var t=r();return function(n,r,t){if(!(0<(t=+t)))return[];if((n=+n)==(r=+r))return[n];var e=r<n,[a,u,i]=e?y(r,n,t):y(n,r,t);if(!(a<=u))return[];var o=u-a+1,f=new Array(o);if(e)if(i<0)for(let n=0;n<o;++n)f[n]=(u-n)/-i;else for(let n=0;n<o;++n)f[n]=(u-n)*i;else if(i<0)for(let n=0;n<o;++n)f[n]=(a+n)/-i;else for(let n=0;n<o;++n)f[n]=(a+n)*i;return f}(t[0],t[t.length-1],null==n?10:n)},n.tickFormat=function(n,t){var e=r();return S(e[0],e[e.length-1],null==n?10:n,t)},n.nice=function(t){null==t&&(t=10);var e,a,u=r(),i=0,o=u.length-1,f=u[i],c=u[o],l=10;for(c<f&&(a=f,f=c,c=a,a=i,i=o,o=a);0<l--;){if((a=w(f,c,t))===e)return u[i]=f,u[o]=c,r(u);if(0<a)f=Math.floor(f/a)*a,c=Math.ceil(c/a)*a;else{if(!(a<0))break;f=Math.ceil(f*a)/a,c=Math.floor(c*a)/a}e=a}return n},n}function z(){var n=Q();return n.copy=function(){return L(n,z())},u.apply(n,arguments),T(n)}export{L as a,h as b,Q as c,z as l,b as t};