rasa-pro 3.12.0.dev5__py3-none-any.whl → 3.12.0.dev7__py3-none-any.whl
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.
Potentially problematic release.
This version of rasa-pro might be problematic. Click here for more details.
- rasa/cli/dialogue_understanding_test.py +40 -5
- rasa/constants.py +0 -1
- rasa/core/actions/action.py +4 -2
- rasa/core/actions/custom_action_executor.py +1 -1
- rasa/core/channels/inspector/dist/assets/Tableau10-1b767f5e.js +1 -0
- rasa/core/channels/inspector/dist/assets/arc-f0f8bd46.js +1 -0
- rasa/core/channels/inspector/dist/assets/blockDiagram-38ab4fdb-7162c77d.js +118 -0
- rasa/core/channels/inspector/dist/assets/c4Diagram-3d4e48cf-b1d0d098.js +10 -0
- rasa/core/channels/inspector/dist/assets/channel-e265ea59.js +1 -0
- rasa/core/channels/inspector/dist/assets/classDiagram-70f12bd4-807a1b27.js +2 -0
- rasa/core/channels/inspector/dist/assets/classDiagram-v2-f2320105-5238dcdb.js +2 -0
- rasa/core/channels/inspector/dist/assets/clone-21f8a43d.js +1 -0
- rasa/core/channels/inspector/dist/assets/{createText-62fc7601-89c73b31.js → createText-2e5e7dd3-75dfaa67.js} +1 -1
- rasa/core/channels/inspector/dist/assets/edges-e0da2a9e-df20501d.js +4 -0
- rasa/core/channels/inspector/dist/assets/{erDiagram-9d236eb7-907e0440.js → erDiagram-9861fffd-13cf4797.js} +4 -4
- rasa/core/channels/inspector/dist/assets/flowDb-956e92f1-a4991264.js +10 -0
- rasa/core/channels/inspector/dist/assets/flowDiagram-66a62f08-ccecf773.js +4 -0
- rasa/core/channels/inspector/dist/assets/flowDiagram-v2-96b9c2cf-5c8ce12d.js +1 -0
- rasa/core/channels/inspector/dist/assets/flowchart-elk-definition-4a651766-b5801783.js +139 -0
- rasa/core/channels/inspector/dist/assets/ganttDiagram-c361ad54-161e079a.js +257 -0
- rasa/core/channels/inspector/dist/assets/gitGraphDiagram-72cf32ee-f38e86a4.js +70 -0
- rasa/core/channels/inspector/dist/assets/graph-be6ef5d8.js +1 -0
- rasa/core/channels/inspector/dist/assets/index-3862675e-d9ce8994.js +1 -0
- rasa/core/channels/inspector/dist/assets/{index-e793d777.js → index-7794b245.js} +200 -195
- rasa/core/channels/inspector/dist/assets/{infoDiagram-736b4530-8ceba4db.js → infoDiagram-f8f76790-5000a3dc.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{journeyDiagram-df861f2b-960d3809.js → journeyDiagram-49397b02-8ef0a17a.js} +4 -4
- rasa/core/channels/inspector/dist/assets/katex-498eb57e.js +261 -0
- rasa/core/channels/inspector/dist/assets/layout-d649bc98.js +1 -0
- rasa/core/channels/inspector/dist/assets/{line-eeccc4e2.js → line-95add810.js} +1 -1
- rasa/core/channels/inspector/dist/assets/linear-f6025094.js +1 -0
- rasa/core/channels/inspector/dist/assets/mindmap-definition-fc14e90a-2e8531c4.js +312 -0
- rasa/core/channels/inspector/dist/assets/{pieDiagram-dbbf0591-dc9b5e1b.js → pieDiagram-8a3498a8-918adfdb.js} +7 -7
- rasa/core/channels/inspector/dist/assets/{quadrantDiagram-4d7f4fd6-a08cba6d.js → quadrantDiagram-120e2f19-cbd01797.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{requirementDiagram-6fc4c22a-87242b9e.js → requirementDiagram-deff3bca-6a8b877b.js} +2 -2
- rasa/core/channels/inspector/dist/assets/sankeyDiagram-04a897e0-c377c3fe.js +8 -0
- rasa/core/channels/inspector/dist/assets/sequenceDiagram-704730f1-ab9e9b7f.js +122 -0
- rasa/core/channels/inspector/dist/assets/stateDiagram-587899a1-5e6ae67d.js +1 -0
- rasa/core/channels/inspector/dist/assets/stateDiagram-v2-d93cdb3a-40643476.js +1 -0
- rasa/core/channels/inspector/dist/assets/{styles-9c745c82-cef936a6.js → styles-6aaf32cf-afb8d108.js} +1 -1
- rasa/core/channels/inspector/dist/assets/styles-9a916d00-7edc9423.js +160 -0
- rasa/core/channels/inspector/dist/assets/styles-c10674c1-c1d8f7e9.js +116 -0
- rasa/core/channels/inspector/dist/assets/svgDrawCommon-08f97a94-f494b2ef.js +1 -0
- rasa/core/channels/inspector/dist/assets/{timeline-definition-5b62e21b-0d39bdb2.js → timeline-definition-85554ec2-11c7cdd0.js} +3 -3
- rasa/core/channels/inspector/dist/assets/{xychartDiagram-2b33534f-a03fa445.js → xychartDiagram-e933f94c-3f191ec1.js} +3 -3
- rasa/core/channels/inspector/dist/index.html +1 -1
- rasa/core/channels/inspector/package.json +10 -3
- rasa/core/channels/inspector/yarn.lock +89 -99
- rasa/core/channels/voice_stream/asr/azure.py +1 -1
- rasa/core/channels/voice_stream/tts/azure.py +1 -1
- rasa/core/nlg/contextual_response_rephraser.py +2 -1
- rasa/core/policies/enterprise_search_policy.py +2 -1
- rasa/dialogue_understanding/commands/can_not_handle_command.py +2 -2
- rasa/dialogue_understanding/commands/cancel_flow_command.py +2 -2
- rasa/dialogue_understanding/commands/change_flow_command.py +2 -2
- rasa/dialogue_understanding/commands/chit_chat_answer_command.py +2 -2
- rasa/dialogue_understanding/commands/clarify_command.py +2 -2
- rasa/dialogue_understanding/commands/human_handoff_command.py +2 -2
- rasa/dialogue_understanding/commands/knowledge_answer_command.py +2 -2
- rasa/dialogue_understanding/commands/repeat_bot_messages_command.py +2 -2
- rasa/dialogue_understanding/commands/set_slot_command.py +2 -2
- rasa/dialogue_understanding/commands/skip_question_command.py +2 -2
- rasa/dialogue_understanding/commands/start_flow_command.py +2 -2
- rasa/dialogue_understanding/commands/utils.py +1 -1
- rasa/dialogue_understanding/generator/command_parser.py +1 -1
- rasa/dialogue_understanding/generator/llm_based_command_generator.py +3 -3
- rasa/dialogue_understanding/generator/single_step/command_prompt_template.jinja2 +41 -39
- rasa/dialogue_understanding_test/command_metric_calculation.py +8 -4
- rasa/dialogue_understanding_test/du_test_result.py +9 -0
- rasa/e2e_test/assertions.py +203 -174
- rasa/e2e_test/assertions_schema.yml +6 -0
- rasa/e2e_test/constants.py +16 -1
- rasa/e2e_test/e2e_config.py +102 -41
- rasa/e2e_test/e2e_config_schema.yml +28 -10
- rasa/e2e_test/llm_judge_prompts/answer_relevance_prompt_template.jinja2 +89 -0
- rasa/e2e_test/llm_judge_prompts/groundedness_prompt_template.jinja2 +165 -0
- rasa/e2e_test/utils/generative_assertions.py +243 -0
- rasa/server.py +3 -1
- rasa/shared/nlu/constants.py +1 -0
- rasa/shared/providers/llm/llm_response.py +21 -1
- rasa/shared/utils/llm.py +1 -1
- rasa/tracing/instrumentation/attribute_extractors.py +23 -7
- rasa/utils/common.py +0 -14
- rasa/version.py +1 -1
- {rasa_pro-3.12.0.dev5.dist-info → rasa_pro-3.12.0.dev7.dist-info}/METADATA +2 -4
- {rasa_pro-3.12.0.dev5.dist-info → rasa_pro-3.12.0.dev7.dist-info}/RECORD +88 -79
- rasa/core/channels/inspector/dist/assets/arc-632a63ec.js +0 -1
- rasa/core/channels/inspector/dist/assets/c4Diagram-d0fbc5ce-081e0df4.js +0 -10
- rasa/core/channels/inspector/dist/assets/classDiagram-936ed81e-3df0afc2.js +0 -2
- rasa/core/channels/inspector/dist/assets/classDiagram-v2-c3cb15f1-8c5ed31e.js +0 -2
- rasa/core/channels/inspector/dist/assets/edges-f2ad444c-4fc48c3e.js +0 -4
- rasa/core/channels/inspector/dist/assets/flowDb-1972c806-9ec53a3c.js +0 -6
- rasa/core/channels/inspector/dist/assets/flowDiagram-7ea5b25a-41da787a.js +0 -4
- rasa/core/channels/inspector/dist/assets/flowDiagram-v2-855bc5b3-8bea338b.js +0 -1
- rasa/core/channels/inspector/dist/assets/flowchart-elk-definition-abe16c3d-ce370633.js +0 -139
- rasa/core/channels/inspector/dist/assets/ganttDiagram-9b5ea136-90a36523.js +0 -266
- rasa/core/channels/inspector/dist/assets/gitGraphDiagram-99d0ae7c-41e1aa3f.js +0 -70
- rasa/core/channels/inspector/dist/assets/index-2c4b9a3b-e6f2af62.js +0 -1
- rasa/core/channels/inspector/dist/assets/layout-498807d8.js +0 -1
- rasa/core/channels/inspector/dist/assets/linear-8a078617.js +0 -1
- rasa/core/channels/inspector/dist/assets/mindmap-definition-beec6740-396d17dd.js +0 -109
- rasa/core/channels/inspector/dist/assets/sankeyDiagram-8f13d901-53f6f391.js +0 -8
- rasa/core/channels/inspector/dist/assets/sequenceDiagram-b655622a-715c9c20.js +0 -122
- rasa/core/channels/inspector/dist/assets/stateDiagram-59f0c015-2e8fb31f.js +0 -1
- rasa/core/channels/inspector/dist/assets/stateDiagram-v2-2b26beab-7e2d2aa0.js +0 -1
- rasa/core/channels/inspector/dist/assets/styles-080da4f6-4420cea6.js +0 -110
- rasa/core/channels/inspector/dist/assets/styles-3dcbcfbf-28676cf4.js +0 -159
- rasa/core/channels/inspector/dist/assets/svgDrawCommon-4835440b-151251e9.js +0 -1
- {rasa_pro-3.12.0.dev5.dist-info → rasa_pro-3.12.0.dev7.dist-info}/NOTICE +0 -0
- {rasa_pro-3.12.0.dev5.dist-info → rasa_pro-3.12.0.dev7.dist-info}/WHEEL +0 -0
- {rasa_pro-3.12.0.dev5.dist-info → rasa_pro-3.12.0.dev7.dist-info}/entry_points.txt +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as F,b as xn,c as zn,d as L,k as Un,e as Hn,g as jn,j as P,l as En,m as kn,n as yn,t as Jn,o as Nn,p as Kn,q as Zn,f as s,G as x,h as w,i as g,r as M,v as y,s as V}from"./graph-be6ef5d8.js";import{a8 as A,a9 as Qn,aa as ne,ab as ee,ac as Ln,ad as B,ae as _n,af as re,ag as Cn,ah as J,ai as te,aj as ie,ak as K,al as ae,am as In,an as oe,ao as ue,ap as H}from"./index-7794b245.js";var de=/\s/;function fe(n){for(var e=n.length;e--&&de.test(n.charAt(e)););return e}var se=/^\s+/;function ce(n){return n&&n.slice(0,fe(n)+1).replace(se,"")}var un=0/0,he=/^[-+]0x[0-9a-f]+$/i,le=/^0b[01]+$/i,ve=/^0o[0-7]+$/i,pe=parseInt;function we(n){if(typeof n=="number")return n;if(F(n))return un;if(A(n)){var e=typeof n.valueOf=="function"?n.valueOf():n;n=A(e)?e+"":e}if(typeof n!="string")return n===0?n:+n;n=ce(n);var r=le.test(n);return r||ve.test(n)?pe(n.slice(2),r?2:8):he.test(n)?un:+n}var dn=1/0,me=17976931348623157e292;function S(n){if(!n)return n===0?n:0;if(n=we(n),n===dn||n===-dn){var e=n<0?-1:1;return e*me}return n===n?n:0}function be(n){var e=S(n),r=e%1;return e===e?r?e-r:e:0}function _(n){var e=n==null?0:n.length;return e?xn(n,1):[]}function ge(n){return Qn(ne(n,void 0,_),n+"")}var xe=1,Ee=4;function ke(n){return zn(n,xe|Ee)}var ye=function(){return ee.Date.now()};const fn=ye;var Rn=Object.prototype,Ne=Rn.hasOwnProperty,Le=Ln(function(n,e){n=Object(n);var r=-1,t=e.length,i=t>2?e[2]:void 0;for(i&&B(e[0],e[1],i)&&(t=1);++r<t;)for(var o=e[r],a=_n(o),u=-1,d=a.length;++u<d;){var f=a[u],c=n[f];(c===void 0||re(c,Rn[f])&&!Ne.call(n,f))&&(n[f]=o[f])}return n});const _e=Le;function $(n){var e=n==null?0:n.length;return e?n[e-1]:void 0}function Ce(n){return function(e,r,t){var i=Object(e);if(!Cn(e)){var o=L(r);e=Un(e),r=function(u){return o(i[u],u,i)}}var a=n(e,r,t);return a>-1?i[o?e[a]:a]:void 0}}var Ie=Math.max;function Re(n,e,r){var t=n==null?0:n.length;if(!t)return-1;var i=r==null?0:be(r);return i<0&&(i=Ie(t+i,0)),Hn(n,L(e),i)}var Te=Ce(Re);const Z=Te;function Tn(n,e){var r=-1,t=Cn(n)?Array(n.length):[];return jn(n,function(i,o,a){t[++r]=e(i,o,a)}),t}function m(n,e){var r=J(n)?P:Tn;return r(n,L(e))}function Me(n,e){return n==null?n:te(n,En(e),_n)}function Oe(n,e){return n&&kn(n,En(e))}function Pe(n,e){return n>e}function Mn(n,e){return n<e}function Y(n,e){var r={};return e=L(e),kn(n,function(t,i,o){ie(r,i,e(t,i,o))}),r}function Q(n,e,r){for(var t=-1,i=n.length;++t<i;){var o=n[t],a=e(o);if(a!=null&&(u===void 0?a===a&&!F(a):r(a,u)))var u=a,d=o}return d}function E(n){return n&&n.length?Q(n,K,Pe):void 0}function R(n){return n&&n.length?Q(n,K,Mn):void 0}function nn(n,e){return n&&n.length?Q(n,L(e),Mn):void 0}function Se(n,e,r,t){if(!A(n))return n;e=yn(e,n);for(var i=-1,o=e.length,a=o-1,u=n;u!=null&&++i<o;){var d=Jn(e[i]),f=r;if(d==="__proto__"||d==="constructor"||d==="prototype")return n;if(i!=a){var c=u[d];f=t?t(c,d,u):void 0,f===void 0&&(f=A(c)?c:ae(e[i+1])?[]:{})}In(u,d,f),u=u[d]}return n}function Fe(n,e,r){for(var t=-1,i=e.length,o={};++t<i;){var a=e[t],u=Nn(n,a);r(u,a)&&Se(o,yn(a,n),u)}return o}function Ae(n,e){var r=n.length;for(n.sort(e);r--;)n[r]=n[r].value;return n}function Be(n,e){if(n!==e){var r=n!==void 0,t=n===null,i=n===n,o=F(n),a=e!==void 0,u=e===null,d=e===e,f=F(e);if(!u&&!f&&!o&&n>e||o&&a&&d&&!u&&!f||t&&a&&d||!r&&d||!i)return 1;if(!t&&!o&&!f&&n<e||f&&r&&i&&!t&&!o||u&&r&&i||!a&&i||!d)return-1}return 0}function $e(n,e,r){for(var t=-1,i=n.criteria,o=e.criteria,a=i.length,u=r.length;++t<a;){var d=Be(i[t],o[t]);if(d){if(t>=u)return d;var f=r[t];return d*(f=="desc"?-1:1)}}return n.index-e.index}function Ge(n,e,r){e.length?e=P(e,function(o){return J(o)?function(a){return Nn(a,o.length===1?o[0]:o)}:o}):e=[K];var t=-1;e=P(e,oe(L));var i=Tn(n,function(o,a,u){var d=P(e,function(f){return f(o)});return{criteria:d,index:++t,value:o}});return Ae(i,function(o,a){return $e(o,a,r)})}function Ve(n,e){return Fe(n,e,function(r,t){return Kn(n,t)})}var Ye=ge(function(n,e){return n==null?{}:Ve(n,e)});const G=Ye;var De=Math.ceil,qe=Math.max;function We(n,e,r,t){for(var i=-1,o=qe(De((e-n)/(r||1)),0),a=Array(o);o--;)a[t?o:++i]=n,n+=r;return a}function Xe(n){return function(e,r,t){return t&&typeof t!="number"&&B(e,r,t)&&(r=t=void 0),e=S(e),r===void 0?(r=e,e=0):r=S(r),t=t===void 0?e<r?1:-1:S(t),We(e,r,t,n)}}var ze=Xe();const N=ze;var Ue=Ln(function(n,e){if(n==null)return[];var r=e.length;return r>1&&B(n,e[0],e[1])?e=[]:r>2&&B(e[0],e[1],e[2])&&(e=[e[0]]),Ge(n,xn(e,1),[])});const O=Ue;var He=0;function en(n){var e=++He;return Zn(n)+e}function je(n,e,r){for(var t=-1,i=n.length,o=e.length,a={};++t<i;){var u=t<o?e[t]:void 0;r(a,n[t],u)}return a}function Je(n,e){return je(n||[],e||[],In)}class Ke{constructor(){var e={};e._next=e._prev=e,this._sentinel=e}dequeue(){var e=this._sentinel,r=e._prev;if(r!==e)return sn(r),r}enqueue(e){var r=this._sentinel;e._prev&&e._next&&sn(e),e._next=r._next,r._next._prev=e,r._next=e,e._prev=r}toString(){for(var e=[],r=this._sentinel,t=r._prev;t!==r;)e.push(JSON.stringify(t,Ze)),t=t._prev;return"["+e.join(", ")+"]"}}function sn(n){n._prev._next=n._next,n._next._prev=n._prev,delete n._next,delete n._prev}function Ze(n,e){if(n!=="_next"&&n!=="_prev")return e}var Qe=ue(1);function nr(n,e){if(n.nodeCount()<=1)return[];var r=rr(n,e||Qe),t=er(r.graph,r.buckets,r.zeroIdx);return _(m(t,function(i){return n.outEdges(i.v,i.w)}))}function er(n,e,r){for(var t=[],i=e[e.length-1],o=e[0],a;n.nodeCount();){for(;a=o.dequeue();)q(n,e,r,a);for(;a=i.dequeue();)q(n,e,r,a);if(n.nodeCount()){for(var u=e.length-2;u>0;--u)if(a=e[u].dequeue(),a){t=t.concat(q(n,e,r,a,!0));break}}}return t}function q(n,e,r,t,i){var o=i?[]:void 0;return s(n.inEdges(t.v),function(a){var u=n.edge(a),d=n.node(a.v);i&&o.push({v:a.v,w:a.w}),d.out-=u,j(e,r,d)}),s(n.outEdges(t.v),function(a){var u=n.edge(a),d=a.w,f=n.node(d);f.in-=u,j(e,r,f)}),n.removeNode(t.v),o}function rr(n,e){var r=new x,t=0,i=0;s(n.nodes(),function(u){r.setNode(u,{v:u,in:0,out:0})}),s(n.edges(),function(u){var d=r.edge(u.v,u.w)||0,f=e(u),c=d+f;r.setEdge(u.v,u.w,c),i=Math.max(i,r.node(u.v).out+=f),t=Math.max(t,r.node(u.w).in+=f)});var o=N(i+t+3).map(function(){return new Ke}),a=t+1;return s(r.nodes(),function(u){j(o,a,r.node(u))}),{graph:r,buckets:o,zeroIdx:a}}function j(n,e,r){r.out?r.in?n[r.out-r.in+e].enqueue(r):n[n.length-1].enqueue(r):n[0].enqueue(r)}function tr(n){var e=n.graph().acyclicer==="greedy"?nr(n,r(n)):ir(n);s(e,function(t){var i=n.edge(t);n.removeEdge(t),i.forwardName=t.name,i.reversed=!0,n.setEdge(t.w,t.v,i,en("rev"))});function r(t){return function(i){return t.edge(i).weight}}}function ir(n){var e=[],r={},t={};function i(o){w(t,o)||(t[o]=!0,r[o]=!0,s(n.outEdges(o),function(a){w(r,a.w)?e.push(a):i(a.w)}),delete r[o])}return s(n.nodes(),i),e}function ar(n){s(n.edges(),function(e){var r=n.edge(e);if(r.reversed){n.removeEdge(e);var t=r.forwardName;delete r.reversed,delete r.forwardName,n.setEdge(e.w,e.v,r,t)}})}function C(n,e,r,t){var i;do i=en(t);while(n.hasNode(i));return r.dummy=e,n.setNode(i,r),i}function or(n){var e=new x().setGraph(n.graph());return s(n.nodes(),function(r){e.setNode(r,n.node(r))}),s(n.edges(),function(r){var t=e.edge(r.v,r.w)||{weight:0,minlen:1},i=n.edge(r);e.setEdge(r.v,r.w,{weight:t.weight+i.weight,minlen:Math.max(t.minlen,i.minlen)})}),e}function On(n){var e=new x({multigraph:n.isMultigraph()}).setGraph(n.graph());return s(n.nodes(),function(r){n.children(r).length||e.setNode(r,n.node(r))}),s(n.edges(),function(r){e.setEdge(r,n.edge(r))}),e}function cn(n,e){var r=n.x,t=n.y,i=e.x-r,o=e.y-t,a=n.width/2,u=n.height/2;if(!i&&!o)throw new Error("Not possible to find intersection inside of the rectangle");var d,f;return Math.abs(o)*a>Math.abs(i)*u?(o<0&&(u=-u),d=u*i/o,f=u):(i<0&&(a=-a),d=a,f=a*o/i),{x:r+d,y:t+f}}function D(n){var e=m(N(Pn(n)+1),function(){return[]});return s(n.nodes(),function(r){var t=n.node(r),i=t.rank;g(i)||(e[i][t.order]=r)}),e}function ur(n){var e=R(m(n.nodes(),function(r){return n.node(r).rank}));s(n.nodes(),function(r){var t=n.node(r);w(t,"rank")&&(t.rank-=e)})}function dr(n){var e=R(m(n.nodes(),function(o){return n.node(o).rank})),r=[];s(n.nodes(),function(o){var a=n.node(o).rank-e;r[a]||(r[a]=[]),r[a].push(o)});var t=0,i=n.graph().nodeRankFactor;s(r,function(o,a){g(o)&&a%i!==0?--t:t&&s(o,function(u){n.node(u).rank+=t})})}function hn(n,e,r,t){var i={width:0,height:0};return arguments.length>=4&&(i.rank=r,i.order=t),C(n,"border",i,e)}function Pn(n){return E(m(n.nodes(),function(e){var r=n.node(e).rank;if(!g(r))return r}))}function fr(n,e){var r={lhs:[],rhs:[]};return s(n,function(t){e(t)?r.lhs.push(t):r.rhs.push(t)}),r}function sr(n,e){var r=fn();try{return e()}finally{console.log(n+" time: "+(fn()-r)+"ms")}}function cr(n,e){return e()}function hr(n){function e(r){var t=n.children(r),i=n.node(r);if(t.length&&s(t,e),w(i,"minRank")){i.borderLeft=[],i.borderRight=[];for(var o=i.minRank,a=i.maxRank+1;o<a;++o)ln(n,"borderLeft","_bl",r,i,o),ln(n,"borderRight","_br",r,i,o)}}s(n.children(),e)}function ln(n,e,r,t,i,o){var a={width:0,height:0,rank:o,borderType:e},u=i[e][o-1],d=C(n,"border",a,r);i[e][o]=d,n.setParent(d,t),u&&n.setEdge(u,d,{weight:1})}function lr(n){var e=n.graph().rankdir.toLowerCase();(e==="lr"||e==="rl")&&Sn(n)}function vr(n){var e=n.graph().rankdir.toLowerCase();(e==="bt"||e==="rl")&&pr(n),(e==="lr"||e==="rl")&&(wr(n),Sn(n))}function Sn(n){s(n.nodes(),function(e){vn(n.node(e))}),s(n.edges(),function(e){vn(n.edge(e))})}function vn(n){var e=n.width;n.width=n.height,n.height=e}function pr(n){s(n.nodes(),function(e){W(n.node(e))}),s(n.edges(),function(e){var r=n.edge(e);s(r.points,W),w(r,"y")&&W(r)})}function W(n){n.y=-n.y}function wr(n){s(n.nodes(),function(e){X(n.node(e))}),s(n.edges(),function(e){var r=n.edge(e);s(r.points,X),w(r,"x")&&X(r)})}function X(n){var e=n.x;n.x=n.y,n.y=e}function mr(n){n.graph().dummyChains=[],s(n.edges(),function(e){br(n,e)})}function br(n,e){var r=e.v,t=n.node(r).rank,i=e.w,o=n.node(i).rank,a=e.name,u=n.edge(e),d=u.labelRank;if(o!==t+1){n.removeEdge(e);var f,c,h;for(h=0,++t;t<o;++h,++t)u.points=[],c={width:0,height:0,edgeLabel:u,edgeObj:e,rank:t},f=C(n,"edge",c,"_d"),t===d&&(c.width=u.width,c.height=u.height,c.dummy="edge-label",c.labelpos=u.labelpos),n.setEdge(r,f,{weight:u.weight},a),h===0&&n.graph().dummyChains.push(f),r=f;n.setEdge(r,i,{weight:u.weight},a)}}function gr(n){s(n.graph().dummyChains,function(e){var r=n.node(e),t=r.edgeLabel,i;for(n.setEdge(r.edgeObj,t);r.dummy;)i=n.successors(e)[0],n.removeNode(e),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),e=i,r=n.node(e)})}function rn(n){var e={};function r(t){var i=n.node(t);if(w(e,t))return i.rank;e[t]=!0;var o=R(m(n.outEdges(t),function(a){return r(a.w)-n.edge(a).minlen}));return(o===Number.POSITIVE_INFINITY||o===void 0||o===null)&&(o=0),i.rank=o}s(n.sources(),r)}function T(n,e){return n.node(e.w).rank-n.node(e.v).rank-n.edge(e).minlen}function Fn(n){var e=new x({directed:!1}),r=n.nodes()[0],t=n.nodeCount();e.setNode(r,{});for(var i,o;xr(e,n)<t;)i=Er(e,n),o=e.hasNode(i.v)?T(n,i):-T(n,i),kr(e,n,o);return e}function xr(n,e){function r(t){s(e.nodeEdges(t),function(i){var o=i.v,a=t===o?i.w:o;!n.hasNode(a)&&!T(e,i)&&(n.setNode(a,{}),n.setEdge(t,a,{}),r(a))})}return s(n.nodes(),r),n.nodeCount()}function Er(n,e){return nn(e.edges(),function(r){if(n.hasNode(r.v)!==n.hasNode(r.w))return T(e,r)})}function kr(n,e,r){s(n.nodes(),function(t){e.node(t).rank+=r})}function yr(){}yr.prototype=new Error;function An(n,e,r){J(e)||(e=[e]);var t=(n.isDirected()?n.successors:n.neighbors).bind(n),i=[],o={};return s(e,function(a){if(!n.hasNode(a))throw new Error("Graph does not have node: "+a);Bn(n,a,r==="post",o,t,i)}),i}function Bn(n,e,r,t,i,o){w(t,e)||(t[e]=!0,r||o.push(e),s(i(e),function(a){Bn(n,a,r,t,i,o)}),r&&o.push(e))}function Nr(n,e){return An(n,e,"post")}function Lr(n,e){return An(n,e,"pre")}k.initLowLimValues=an;k.initCutValues=tn;k.calcCutValue=$n;k.leaveEdge=Vn;k.enterEdge=Yn;k.exchangeEdges=Dn;function k(n){n=or(n),rn(n);var e=Fn(n);an(e),tn(e,n);for(var r,t;r=Vn(e);)t=Yn(e,n,r),Dn(e,n,r,t)}function tn(n,e){var r=Nr(n,n.nodes());r=r.slice(0,r.length-1),s(r,function(t){_r(n,e,t)})}function _r(n,e,r){var t=n.node(r),i=t.parent;n.edge(r,i).cutvalue=$n(n,e,r)}function $n(n,e,r){var t=n.node(r),i=t.parent,o=!0,a=e.edge(r,i),u=0;return a||(o=!1,a=e.edge(i,r)),u=a.weight,s(e.nodeEdges(r),function(d){var f=d.v===r,c=f?d.w:d.v;if(c!==i){var h=f===o,l=e.edge(d).weight;if(u+=h?l:-l,Ir(n,r,c)){var v=n.edge(r,c).cutvalue;u+=h?-v:v}}}),u}function an(n,e){arguments.length<2&&(e=n.nodes()[0]),Gn(n,{},1,e)}function Gn(n,e,r,t,i){var o=r,a=n.node(t);return e[t]=!0,s(n.neighbors(t),function(u){w(e,u)||(r=Gn(n,e,r,u,t))}),a.low=o,a.lim=r++,i?a.parent=i:delete a.parent,r}function Vn(n){return Z(n.edges(),function(e){return n.edge(e).cutvalue<0})}function Yn(n,e,r){var t=r.v,i=r.w;e.hasEdge(t,i)||(t=r.w,i=r.v);var o=n.node(t),a=n.node(i),u=o,d=!1;o.lim>a.lim&&(u=a,d=!0);var f=M(e.edges(),function(c){return d===pn(n,n.node(c.v),u)&&d!==pn(n,n.node(c.w),u)});return nn(f,function(c){return T(e,c)})}function Dn(n,e,r,t){var i=r.v,o=r.w;n.removeEdge(i,o),n.setEdge(t.v,t.w,{}),an(n),tn(n,e),Cr(n,e)}function Cr(n,e){var r=Z(n.nodes(),function(i){return!e.node(i).parent}),t=Lr(n,r);t=t.slice(1),s(t,function(i){var o=n.node(i).parent,a=e.edge(i,o),u=!1;a||(a=e.edge(o,i),u=!0),e.node(i).rank=e.node(o).rank+(u?a.minlen:-a.minlen)})}function Ir(n,e,r){return n.hasEdge(e,r)}function pn(n,e,r){return r.low<=e.lim&&e.lim<=r.lim}function Rr(n){switch(n.graph().ranker){case"network-simplex":wn(n);break;case"tight-tree":Mr(n);break;case"longest-path":Tr(n);break;default:wn(n)}}var Tr=rn;function Mr(n){rn(n),Fn(n)}function wn(n){k(n)}function Or(n){var e=C(n,"root",{},"_root"),r=Pr(n),t=E(y(r))-1,i=2*t+1;n.graph().nestingRoot=e,s(n.edges(),function(a){n.edge(a).minlen*=i});var o=Sr(n)+1;s(n.children(),function(a){qn(n,e,i,o,t,r,a)}),n.graph().nodeRankFactor=i}function qn(n,e,r,t,i,o,a){var u=n.children(a);if(!u.length){a!==e&&n.setEdge(e,a,{weight:0,minlen:r});return}var d=hn(n,"_bt"),f=hn(n,"_bb"),c=n.node(a);n.setParent(d,a),c.borderTop=d,n.setParent(f,a),c.borderBottom=f,s(u,function(h){qn(n,e,r,t,i,o,h);var l=n.node(h),v=l.borderTop?l.borderTop:h,p=l.borderBottom?l.borderBottom:h,b=l.borderTop?t:2*t,I=v!==p?1:i-o[a]+1;n.setEdge(d,v,{weight:b,minlen:I,nestingEdge:!0}),n.setEdge(p,f,{weight:b,minlen:I,nestingEdge:!0})}),n.parent(a)||n.setEdge(e,d,{weight:0,minlen:i+o[a]})}function Pr(n){var e={};function r(t,i){var o=n.children(t);o&&o.length&&s(o,function(a){r(a,i+1)}),e[t]=i}return s(n.children(),function(t){r(t,1)}),e}function Sr(n){return V(n.edges(),function(e,r){return e+n.edge(r).weight},0)}function Fr(n){var e=n.graph();n.removeNode(e.nestingRoot),delete e.nestingRoot,s(n.edges(),function(r){var t=n.edge(r);t.nestingEdge&&n.removeEdge(r)})}function Ar(n,e,r){var t={},i;s(r,function(o){for(var a=n.parent(o),u,d;a;){if(u=n.parent(a),u?(d=t[u],t[u]=a):(d=i,i=a),d&&d!==a){e.setEdge(d,a);return}a=u}})}function Br(n,e,r){var t=$r(n),i=new x({compound:!0}).setGraph({root:t}).setDefaultNodeLabel(function(o){return n.node(o)});return s(n.nodes(),function(o){var a=n.node(o),u=n.parent(o);(a.rank===e||a.minRank<=e&&e<=a.maxRank)&&(i.setNode(o),i.setParent(o,u||t),s(n[r](o),function(d){var f=d.v===o?d.w:d.v,c=i.edge(f,o),h=g(c)?0:c.weight;i.setEdge(f,o,{weight:n.edge(d).weight+h})}),w(a,"minRank")&&i.setNode(o,{borderLeft:a.borderLeft[e],borderRight:a.borderRight[e]}))}),i}function $r(n){for(var e;n.hasNode(e=en("_root")););return e}function Gr(n,e){for(var r=0,t=1;t<e.length;++t)r+=Vr(n,e[t-1],e[t]);return r}function Vr(n,e,r){for(var t=Je(r,m(r,function(f,c){return c})),i=_(m(e,function(f){return O(m(n.outEdges(f),function(c){return{pos:t[c.w],weight:n.edge(c).weight}}),"pos")})),o=1;o<r.length;)o<<=1;var a=2*o-1;o-=1;var u=m(new Array(a),function(){return 0}),d=0;return s(i.forEach(function(f){var c=f.pos+o;u[c]+=f.weight;for(var h=0;c>0;)c%2&&(h+=u[c+1]),c=c-1>>1,u[c]+=f.weight;d+=f.weight*h})),d}function Yr(n){var e={},r=M(n.nodes(),function(u){return!n.children(u).length}),t=E(m(r,function(u){return n.node(u).rank})),i=m(N(t+1),function(){return[]});function o(u){if(!w(e,u)){e[u]=!0;var d=n.node(u);i[d.rank].push(u),s(n.successors(u),o)}}var a=O(r,function(u){return n.node(u).rank});return s(a,o),i}function Dr(n,e){return m(e,function(r){var t=n.inEdges(r);if(t.length){var i=V(t,function(o,a){var u=n.edge(a),d=n.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 qr(n,e){var r={};s(n,function(i,o){var a=r[i.v]={indegree:0,in:[],out:[],vs:[i.v],i:o};g(i.barycenter)||(a.barycenter=i.barycenter,a.weight=i.weight)}),s(e.edges(),function(i){var o=r[i.v],a=r[i.w];!g(o)&&!g(a)&&(a.indegree++,o.out.push(r[i.w]))});var t=M(r,function(i){return!i.indegree});return Wr(t)}function Wr(n){var e=[];function r(o){return function(a){a.merged||(g(a.barycenter)||g(o.barycenter)||a.barycenter>=o.barycenter)&&Xr(o,a)}}function t(o){return function(a){a.in.push(o),--a.indegree===0&&n.push(a)}}for(;n.length;){var i=n.pop();e.push(i),s(i.in.reverse(),r(i)),s(i.out,t(i))}return m(M(e,function(o){return!o.merged}),function(o){return G(o,["vs","i","barycenter","weight"])})}function Xr(n,e){var r=0,t=0;n.weight&&(r+=n.barycenter*n.weight,t+=n.weight),e.weight&&(r+=e.barycenter*e.weight,t+=e.weight),n.vs=e.vs.concat(n.vs),n.barycenter=r/t,n.weight=t,n.i=Math.min(e.i,n.i),e.merged=!0}function zr(n,e){var r=fr(n,function(c){return w(c,"barycenter")}),t=r.lhs,i=O(r.rhs,function(c){return-c.i}),o=[],a=0,u=0,d=0;t.sort(Ur(!!e)),d=mn(o,i,d),s(t,function(c){d+=c.vs.length,o.push(c.vs),a+=c.barycenter*c.weight,u+=c.weight,d=mn(o,i,d)});var f={vs:_(o)};return u&&(f.barycenter=a/u,f.weight=u),f}function mn(n,e,r){for(var t;e.length&&(t=$(e)).i<=r;)e.pop(),n.push(t.vs),r++;return r}function Ur(n){return function(e,r){return e.barycenter<r.barycenter?-1:e.barycenter>r.barycenter?1:n?r.i-e.i:e.i-r.i}}function Wn(n,e,r,t){var i=n.children(e),o=n.node(e),a=o?o.borderLeft:void 0,u=o?o.borderRight:void 0,d={};a&&(i=M(i,function(p){return p!==a&&p!==u}));var f=Dr(n,i);s(f,function(p){if(n.children(p.v).length){var b=Wn(n,p.v,r,t);d[p.v]=b,w(b,"barycenter")&&jr(p,b)}});var c=qr(f,r);Hr(c,d);var h=zr(c,t);if(a&&(h.vs=_([a,h.vs,u]),n.predecessors(a).length)){var l=n.node(n.predecessors(a)[0]),v=n.node(n.predecessors(u)[0]);w(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 Hr(n,e){s(n,function(r){r.vs=_(r.vs.map(function(t){return e[t]?e[t].vs:t}))})}function jr(n,e){g(n.barycenter)?(n.barycenter=e.barycenter,n.weight=e.weight):(n.barycenter=(n.barycenter*n.weight+e.barycenter*e.weight)/(n.weight+e.weight),n.weight+=e.weight)}function Jr(n){var e=Pn(n),r=bn(n,N(1,e+1),"inEdges"),t=bn(n,N(e-1,-1,-1),"outEdges"),i=Yr(n);gn(n,i);for(var o=Number.POSITIVE_INFINITY,a,u=0,d=0;d<4;++u,++d){Kr(u%2?r:t,u%4>=2),i=D(n);var f=Gr(n,i);f<o&&(d=0,a=ke(i),o=f)}gn(n,a)}function bn(n,e,r){return m(e,function(t){return Br(n,t,r)})}function Kr(n,e){var r=new x;s(n,function(t){var i=t.graph().root,o=Wn(t,i,r,e);s(o.vs,function(a,u){t.node(a).order=u}),Ar(t,r,o.vs)})}function gn(n,e){s(e,function(r){s(r,function(t,i){n.node(t).order=i})})}function Zr(n){var e=nt(n);s(n.graph().dummyChains,function(r){for(var t=n.node(r),i=t.edgeObj,o=Qr(n,e,i.v,i.w),a=o.path,u=o.lca,d=0,f=a[d],c=!0;r!==i.w;){if(t=n.node(r),c){for(;(f=a[d])!==u&&n.node(f).maxRank<t.rank;)d++;f===u&&(c=!1)}if(!c){for(;d<a.length-1&&n.node(f=a[d+1]).minRank<=t.rank;)d++;f=a[d]}n.setParent(r,f),r=n.successors(r)[0]}})}function Qr(n,e,r,t){var i=[],o=[],a=Math.min(e[r].low,e[t].low),u=Math.max(e[r].lim,e[t].lim),d,f;d=r;do d=n.parent(d),i.push(d);while(d&&(e[d].low>a||u>e[d].lim));for(f=d,d=t;(d=n.parent(d))!==f;)o.push(d);return{path:i.concat(o.reverse()),lca:f}}function nt(n){var e={},r=0;function t(i){var o=r;s(n.children(i),t),e[i]={low:o,lim:r++}}return s(n.children(),t),e}function et(n,e){var r={};function t(i,o){var a=0,u=0,d=i.length,f=$(o);return s(o,function(c,h){var l=tt(n,c),v=l?n.node(l).order:d;(l||c===f)&&(s(o.slice(u,h+1),function(p){s(n.predecessors(p),function(b){var I=n.node(b),on=I.order;(on<a||v<on)&&!(I.dummy&&n.node(p).dummy)&&Xn(r,b,p)})}),u=h+1,a=v)}),o}return V(e,t),r}function rt(n,e){var r={};function t(o,a,u,d,f){var c;s(N(a,u),function(h){c=o[h],n.node(c).dummy&&s(n.predecessors(c),function(l){var v=n.node(l);v.dummy&&(v.order<d||v.order>f)&&Xn(r,l,c)})})}function i(o,a){var u=-1,d,f=0;return s(a,function(c,h){if(n.node(c).dummy==="border"){var l=n.predecessors(c);l.length&&(d=n.node(l[0]).order,t(a,f,h,u,d),f=h,u=d)}t(a,f,a.length,d,o.length)}),a}return V(e,i),r}function tt(n,e){if(n.node(e).dummy)return Z(n.predecessors(e),function(r){return n.node(r).dummy})}function Xn(n,e,r){if(e>r){var t=e;e=r,r=t}var i=n[e];i||(n[e]=i={}),i[r]=!0}function it(n,e,r){if(e>r){var t=e;e=r,r=t}return w(n[e],r)}function at(n,e,r,t){var i={},o={},a={};return s(e,function(u){s(u,function(d,f){i[d]=d,o[d]=d,a[d]=f})}),s(e,function(u){var d=-1;s(u,function(f){var c=t(f);if(c.length){c=O(c,function(b){return a[b]});for(var h=(c.length-1)/2,l=Math.floor(h),v=Math.ceil(h);l<=v;++l){var p=c[l];o[f]===f&&d<a[p]&&!it(r,f,p)&&(o[p]=f,o[f]=i[f]=i[p],d=a[p])}}})}),{root:i,align:o}}function ot(n,e,r,t,i){var o={},a=ut(n,e,r,i),u=i?"borderLeft":"borderRight";function d(h,l){for(var v=a.nodes(),p=v.pop(),b={};p;)b[p]?h(p):(b[p]=!0,v.push(p),v=v.concat(l(p))),p=v.pop()}function f(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,b){return Math.min(p,o[b.w]-a.edge(b))},Number.POSITIVE_INFINITY),v=n.node(h);l!==Number.POSITIVE_INFINITY&&v.borderType!==u&&(o[h]=Math.max(o[h],l))}return d(f,a.predecessors.bind(a)),d(c,a.successors.bind(a)),s(t,function(h){o[h]=o[r[h]]}),o}function ut(n,e,r,t){var i=new x,o=n.graph(),a=ht(o.nodesep,o.edgesep,t);return s(e,function(u){var d;s(u,function(f){var c=r[f];if(i.setNode(c),d){var h=r[d],l=i.edge(h,c);i.setEdge(h,c,Math.max(a(n,f,d),l||0))}d=f})}),i}function dt(n,e){return nn(y(e),function(r){var t=Number.NEGATIVE_INFINITY,i=Number.POSITIVE_INFINITY;return Me(r,function(o,a){var u=lt(n,a)/2;t=Math.max(o+u,t),i=Math.min(o-u,i)}),t-i})}function ft(n,e){var r=y(e),t=R(r),i=E(r);s(["u","d"],function(o){s(["l","r"],function(a){var u=o+a,d=n[u],f;if(d!==e){var c=y(d);f=a==="l"?t-R(c):i-E(c),f&&(n[u]=Y(d,function(h){return h+f}))}})})}function st(n,e){return Y(n.ul,function(r,t){if(e)return n[e.toLowerCase()][t];var i=O(m(n,t));return(i[1]+i[2])/2})}function ct(n){var e=D(n),r=H(et(n,e),rt(n,e)),t={},i;s(["u","d"],function(a){i=a==="u"?e:y(e).reverse(),s(["l","r"],function(u){u==="r"&&(i=m(i,function(h){return y(h).reverse()}));var d=(a==="u"?n.predecessors:n.successors).bind(n),f=at(n,i,r,d),c=ot(n,i,f.root,f.align,u==="r");u==="r"&&(c=Y(c,function(h){return-h})),t[a+u]=c})});var o=dt(n,t);return ft(t,o),st(t,n.graph().align)}function ht(n,e,r){return function(t,i,o){var a=t.node(i),u=t.node(o),d=0,f;if(d+=a.width/2,w(a,"labelpos"))switch(a.labelpos.toLowerCase()){case"l":f=-a.width/2;break;case"r":f=a.width/2;break}if(f&&(d+=r?f:-f),f=0,d+=(a.dummy?e:n)/2,d+=(u.dummy?e:n)/2,d+=u.width/2,w(u,"labelpos"))switch(u.labelpos.toLowerCase()){case"l":f=u.width/2;break;case"r":f=-u.width/2;break}return f&&(d+=r?f:-f),f=0,d}}function lt(n,e){return n.node(e).width}function vt(n){n=On(n),pt(n),Oe(ct(n),function(e,r){n.node(r).x=e})}function pt(n){var e=D(n),r=n.graph().ranksep,t=0;s(e,function(i){var o=E(m(i,function(a){return n.node(a).height}));s(i,function(a){n.node(a).y=t+o/2}),t+=o+r})}function Yt(n,e){var r=e&&e.debugTiming?sr:cr;r("layout",function(){var t=r(" buildLayoutGraph",function(){return _t(n)});r(" runLayout",function(){wt(t,r)}),r(" updateInputGraph",function(){mt(n,t)})})}function wt(n,e){e(" makeSpaceForEdgeLabels",function(){Ct(n)}),e(" removeSelfEdges",function(){At(n)}),e(" acyclic",function(){tr(n)}),e(" nestingGraph.run",function(){Or(n)}),e(" rank",function(){Rr(On(n))}),e(" injectEdgeLabelProxies",function(){It(n)}),e(" removeEmptyRanks",function(){dr(n)}),e(" nestingGraph.cleanup",function(){Fr(n)}),e(" normalizeRanks",function(){ur(n)}),e(" assignRankMinMax",function(){Rt(n)}),e(" removeEdgeLabelProxies",function(){Tt(n)}),e(" normalize.run",function(){mr(n)}),e(" parentDummyChains",function(){Zr(n)}),e(" addBorderSegments",function(){hr(n)}),e(" order",function(){Jr(n)}),e(" insertSelfEdges",function(){Bt(n)}),e(" adjustCoordinateSystem",function(){lr(n)}),e(" position",function(){vt(n)}),e(" positionSelfEdges",function(){$t(n)}),e(" removeBorderNodes",function(){Ft(n)}),e(" normalize.undo",function(){gr(n)}),e(" fixupEdgeLabelCoords",function(){Pt(n)}),e(" undoCoordinateSystem",function(){vr(n)}),e(" translateGraph",function(){Mt(n)}),e(" assignNodeIntersects",function(){Ot(n)}),e(" reversePoints",function(){St(n)}),e(" acyclic.undo",function(){ar(n)})}function mt(n,e){s(n.nodes(),function(r){var t=n.node(r),i=e.node(r);t&&(t.x=i.x,t.y=i.y,e.children(r).length&&(t.width=i.width,t.height=i.height))}),s(n.edges(),function(r){var t=n.edge(r),i=e.edge(r);t.points=i.points,w(i,"x")&&(t.x=i.x,t.y=i.y)}),n.graph().width=e.graph().width,n.graph().height=e.graph().height}var bt=["nodesep","edgesep","ranksep","marginx","marginy"],gt={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},xt=["acyclicer","ranker","rankdir","align"],Et=["width","height"],kt={width:0,height:0},yt=["minlen","weight","width","height","labeloffset"],Nt={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},Lt=["labelpos"];function _t(n){var e=new x({multigraph:!0,compound:!0}),r=U(n.graph());return e.setGraph(H({},gt,z(r,bt),G(r,xt))),s(n.nodes(),function(t){var i=U(n.node(t));e.setNode(t,_e(z(i,Et),kt)),e.setParent(t,n.parent(t))}),s(n.edges(),function(t){var i=U(n.edge(t));e.setEdge(t,H({},Nt,z(i,yt),G(i,Lt)))}),e}function Ct(n){var e=n.graph();e.ranksep/=2,s(n.edges(),function(r){var t=n.edge(r);t.minlen*=2,t.labelpos.toLowerCase()!=="c"&&(e.rankdir==="TB"||e.rankdir==="BT"?t.width+=t.labeloffset:t.height+=t.labeloffset)})}function It(n){s(n.edges(),function(e){var r=n.edge(e);if(r.width&&r.height){var t=n.node(e.v),i=n.node(e.w),o={rank:(i.rank-t.rank)/2+t.rank,e};C(n,"edge-proxy",o,"_ep")}})}function Rt(n){var e=0;s(n.nodes(),function(r){var t=n.node(r);t.borderTop&&(t.minRank=n.node(t.borderTop).rank,t.maxRank=n.node(t.borderBottom).rank,e=E(e,t.maxRank))}),n.graph().maxRank=e}function Tt(n){s(n.nodes(),function(e){var r=n.node(e);r.dummy==="edge-proxy"&&(n.edge(r.e).labelRank=r.rank,n.removeNode(e))})}function Mt(n){var e=Number.POSITIVE_INFINITY,r=0,t=Number.POSITIVE_INFINITY,i=0,o=n.graph(),a=o.marginx||0,u=o.marginy||0;function d(f){var c=f.x,h=f.y,l=f.width,v=f.height;e=Math.min(e,c-l/2),r=Math.max(r,c+l/2),t=Math.min(t,h-v/2),i=Math.max(i,h+v/2)}s(n.nodes(),function(f){d(n.node(f))}),s(n.edges(),function(f){var c=n.edge(f);w(c,"x")&&d(c)}),e-=a,t-=u,s(n.nodes(),function(f){var c=n.node(f);c.x-=e,c.y-=t}),s(n.edges(),function(f){var c=n.edge(f);s(c.points,function(h){h.x-=e,h.y-=t}),w(c,"x")&&(c.x-=e),w(c,"y")&&(c.y-=t)}),o.width=r-e+a,o.height=i-t+u}function Ot(n){s(n.edges(),function(e){var r=n.edge(e),t=n.node(e.v),i=n.node(e.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(cn(t,o)),r.points.push(cn(i,a))})}function Pt(n){s(n.edges(),function(e){var r=n.edge(e);if(w(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 St(n){s(n.edges(),function(e){var r=n.edge(e);r.reversed&&r.points.reverse()})}function Ft(n){s(n.nodes(),function(e){if(n.children(e).length){var r=n.node(e),t=n.node(r.borderTop),i=n.node(r.borderBottom),o=n.node($(r.borderLeft)),a=n.node($(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}}),s(n.nodes(),function(e){n.node(e).dummy==="border"&&n.removeNode(e)})}function At(n){s(n.edges(),function(e){if(e.v===e.w){var r=n.node(e.v);r.selfEdges||(r.selfEdges=[]),r.selfEdges.push({e,label:n.edge(e)}),n.removeEdge(e)}})}function Bt(n){var e=D(n);s(e,function(r){var t=0;s(r,function(i,o){var a=n.node(i);a.order=o+t,s(a.selfEdges,function(u){C(n,"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 $t(n){s(n.nodes(),function(e){var r=n.node(e);if(r.dummy==="selfedge"){var t=n.node(r.e.v),i=t.x+t.width/2,o=t.y,a=r.x-i,u=t.height/2;n.setEdge(r.e,r.label),n.removeNode(e),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 z(n,e){return Y(G(n,e),Number)}function U(n){var e={};return s(n,function(r,t){e[t.toLowerCase()]=r}),e}export{_e as d,Yt as l,m,G as p,N as r,en as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as h}from"./array-9f3ba611.js";import{w as d,c as o}from"./path-53f90ab3.js";import{n as v}from"./index-
|
|
1
|
+
import{a as h}from"./array-9f3ba611.js";import{w as d,c as o}from"./path-53f90ab3.js";import{n as v}from"./index-7794b245.js";function w(t){return t[0]}function b(t){return t[1]}function P(t,u){var s=o(!0),i=null,l=v,r=null,m=d(e);t=typeof t=="function"?t:t===void 0?w:o(t),u=typeof u=="function"?u:u===void 0?b:o(u);function e(n){var f,g=(n=h(n)).length,p,c=!1,a;for(i==null&&(r=l(a=m())),f=0;f<=g;++f)!(f<g&&s(p=n[f],f,n))===c&&((c=!c)?r.lineStart():r.lineEnd()),c&&r.point(+t(p,f,n),+u(p,f,n));if(a)return r=null,a+""||null}return e.x=function(n){return arguments.length?(t=typeof n=="function"?n:o(+n),e):t},e.y=function(n){return arguments.length?(u=typeof n=="function"?n:o(+n),e):u},e.defined=function(n){return arguments.length?(s=typeof n=="function"?n:o(!!n),e):s},e.curve=function(n){return arguments.length?(l=n,i!=null&&(r=l(i)),e):l},e.context=function(n){return arguments.length?(n==null?i=r=null:r=l(i=n),e):i},e}export{P as l};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{$ as un,a0 as I,a1 as U,a2 as Y,a3 as fn}from"./index-7794b245.js";import{i as cn}from"./init-77b53fdd.js";function F(n,t){return n==null||t==null?NaN:n<t?-1:n>t?1:n>=t?0:NaN}function hn(n,t){return n==null||t==null?NaN:t<n?-1:t>n?1:t>=n?0:NaN}function _(n){let t,e,r;n.length!==2?(t=F,e=(u,c)=>F(n(u),c),r=(u,c)=>n(u)-c):(t=n===F||n===hn?n:mn,e=n,r=n);function i(u,c,o=0,l=u.length){if(o<l){if(t(c,c)!==0)return l;do{const h=o+l>>>1;e(u[h],c)<0?o=h+1:l=h}while(o<l)}return o}function f(u,c,o=0,l=u.length){if(o<l){if(t(c,c)!==0)return l;do{const h=o+l>>>1;e(u[h],c)<=0?o=h+1:l=h}while(o<l)}return o}function a(u,c,o=0,l=u.length){const h=i(u,c,o,l-1);return h>o&&r(u[h-1],c)>-r(u[h],c)?h-1:h}return{left:i,center:a,right:f}}function mn(){return 0}function sn(n){return n===null?NaN:+n}const ln=_(F),dn=ln.right;_(sn).center;const gn=dn,yn=Math.sqrt(50),Mn=Math.sqrt(10),pn=Math.sqrt(2);function R(n,t,e){const r=(t-n)/Math.max(0,e),i=Math.floor(Math.log10(r)),f=r/Math.pow(10,i),a=f>=yn?10:f>=Mn?5:f>=pn?2:1;let u,c,o;return i<0?(o=Math.pow(10,-i)/a,u=Math.round(n*o),c=Math.round(t*o),u/o<n&&++u,c/o>t&&--c,o=-o):(o=Math.pow(10,i)*a,u=Math.round(n/o),c=Math.round(t/o),u*o<n&&++u,c*o>t&&--c),c<u&&.5<=e&&e<2?R(n,t,e*2):[u,c,o]}function wn(n,t,e){if(t=+t,n=+n,e=+e,!(e>0))return[];if(n===t)return[n];const r=t<n,[i,f,a]=r?R(t,n,e):R(n,t,e);if(!(f>=i))return[];const u=f-i+1,c=new Array(u);if(r)if(a<0)for(let o=0;o<u;++o)c[o]=(f-o)/-a;else for(let o=0;o<u;++o)c[o]=(f-o)*a;else if(a<0)for(let o=0;o<u;++o)c[o]=(i+o)/-a;else for(let o=0;o<u;++o)c[o]=(i+o)*a;return c}function L(n,t,e){return t=+t,n=+n,e=+e,R(n,t,e)[2]}function Nn(n,t,e){t=+t,n=+n,e=+e;const r=t<n,i=r?L(t,n,e):L(n,t,e);return(r?-1:1)*(i<0?1/-i:i)}function kn(n,t){t||(t=[]);var e=n?Math.min(t.length,n.length):0,r=t.slice(),i;return function(f){for(i=0;i<e;++i)r[i]=n[i]*(1-f)+t[i]*f;return r}}function xn(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}function An(n,t){var e=t?t.length:0,r=n?Math.min(e,n.length):0,i=new Array(r),f=new Array(e),a;for(a=0;a<r;++a)i[a]=C(n[a],t[a]);for(;a<e;++a)f[a]=t[a];return function(u){for(a=0;a<r;++a)f[a]=i[a](u);return f}}function vn(n,t){var e=new Date;return n=+n,t=+t,function(r){return e.setTime(n*(1-r)+t*r),e}}function Sn(n,t){var e={},r={},i;(n===null||typeof n!="object")&&(n={}),(t===null||typeof t!="object")&&(t={});for(i in t)i in n?e[i]=C(n[i],t[i]):r[i]=t[i];return function(f){for(i in e)r[i]=e[i](f);return r}}function C(n,t){var e=typeof t,r;return t==null||e==="boolean"?un(t):(e==="number"?I:e==="string"?(r=U(t))?(t=r,Y):fn:t instanceof U?Y:t instanceof Date?vn:xn(t)?kn:Array.isArray(t)?An:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?Sn:I)(n,t)}function bn(n,t){return n=+n,t=+t,function(e){return Math.round(n*(1-e)+t*e)}}function jn(n){return Math.abs(n=Math.round(n))>=1e21?n.toLocaleString("en").replace(/,/g,""):n.toString(10)}function E(n,t){if((e=(n=t?n.toExponential(t-1):n.toExponential()).indexOf("e"))<0)return null;var e,r=n.slice(0,e);return[r.length>1?r[0]+r.slice(2):r,+n.slice(e+1)]}function v(n){return n=E(Math.abs(n)),n?n[1]:NaN}function Pn(n,t){return function(e,r){for(var i=e.length,f=[],a=0,u=n[0],c=0;i>0&&u>0&&(c+u+1>r&&(u=Math.max(1,r-c)),f.push(e.substring(i-=u,i+u)),!((c+=u+1)>r));)u=n[a=(a+1)%n.length];return f.reverse().join(t)}}function zn(n){return function(t){return t.replace(/[0-9]/g,function(e){return n[+e]})}}var $n=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function D(n){if(!(t=$n.exec(n)))throw new Error("invalid format: "+n);var t;return new B({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}D.prototype=B.prototype;function B(n){this.fill=n.fill===void 0?" ":n.fill+"",this.align=n.align===void 0?">":n.align+"",this.sign=n.sign===void 0?"-":n.sign+"",this.symbol=n.symbol===void 0?"":n.symbol+"",this.zero=!!n.zero,this.width=n.width===void 0?void 0:+n.width,this.comma=!!n.comma,this.precision=n.precision===void 0?void 0:+n.precision,this.trim=!!n.trim,this.type=n.type===void 0?"":n.type+""}B.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function Fn(n){n:for(var t=n.length,e=1,r=-1,i;e<t;++e)switch(n[e]){case".":r=i=e;break;case"0":r===0&&(r=e),i=e;break;default:if(!+n[e])break n;r>0&&(r=0);break}return r>0?n.slice(0,r)+n.slice(i+1):n}var nn;function Rn(n,t){var e=E(n,t);if(!e)return n+"";var r=e[0],i=e[1],f=i-(nn=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,a=r.length;return f===a?r:f>a?r+new Array(f-a+1).join("0"):f>0?r.slice(0,f)+"."+r.slice(f):"0."+new Array(1-f).join("0")+E(n,Math.max(0,t+f-1))[0]}function Z(n,t){var e=E(n,t);if(!e)return n+"";var r=e[0],i=e[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}const H={"%":(n,t)=>(n*100).toFixed(t),b:n=>Math.round(n).toString(2),c:n=>n+"",d:jn,e:(n,t)=>n.toExponential(t),f:(n,t)=>n.toFixed(t),g:(n,t)=>n.toPrecision(t),o:n=>Math.round(n).toString(8),p:(n,t)=>Z(n*100,t),r:Z,s:Rn,X:n=>Math.round(n).toString(16).toUpperCase(),x:n=>Math.round(n).toString(16)};function J(n){return n}var K=Array.prototype.map,Q=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function En(n){var t=n.grouping===void 0||n.thousands===void 0?J:Pn(K.call(n.grouping,Number),n.thousands+""),e=n.currency===void 0?"":n.currency[0]+"",r=n.currency===void 0?"":n.currency[1]+"",i=n.decimal===void 0?".":n.decimal+"",f=n.numerals===void 0?J:zn(K.call(n.numerals,String)),a=n.percent===void 0?"%":n.percent+"",u=n.minus===void 0?"−":n.minus+"",c=n.nan===void 0?"NaN":n.nan+"";function o(h){h=D(h);var s=h.fill,p=h.align,y=h.sign,S=h.symbol,k=h.zero,b=h.width,T=h.comma,w=h.precision,G=h.trim,d=h.type;d==="n"?(T=!0,d="g"):H[d]||(w===void 0&&(w=12),G=!0,d="g"),(k||s==="0"&&p==="=")&&(k=!0,s="0",p="=");var en=S==="$"?e:S==="#"&&/[boxX]/.test(d)?"0"+d.toLowerCase():"",on=S==="$"?r:/[%p]/.test(d)?a:"",O=H[d],an=/[defgprs%]/.test(d);w=w===void 0?6:/[gprs]/.test(d)?Math.max(1,Math.min(21,w)):Math.max(0,Math.min(20,w));function V(m){var N=en,g=on,x,X,j;if(d==="c")g=O(m)+g,m="";else{m=+m;var P=m<0||1/m<0;if(m=isNaN(m)?c:O(Math.abs(m),w),G&&(m=Fn(m)),P&&+m==0&&y!=="+"&&(P=!1),N=(P?y==="("?y:u:y==="-"||y==="("?"":y)+N,g=(d==="s"?Q[8+nn/3]:"")+g+(P&&y==="("?")":""),an){for(x=-1,X=m.length;++x<X;)if(j=m.charCodeAt(x),48>j||j>57){g=(j===46?i+m.slice(x+1):m.slice(x))+g,m=m.slice(0,x);break}}}T&&!k&&(m=t(m,1/0));var z=N.length+m.length+g.length,M=z<b?new Array(b-z+1).join(s):"";switch(T&&k&&(m=t(M+m,M.length?b-g.length:1/0),M=""),p){case"<":m=N+m+g+M;break;case"=":m=N+M+m+g;break;case"^":m=M.slice(0,z=M.length>>1)+N+m+g+M.slice(z);break;default:m=M+N+m+g;break}return f(m)}return V.toString=function(){return h+""},V}function l(h,s){var p=o((h=D(h),h.type="f",h)),y=Math.max(-8,Math.min(8,Math.floor(v(s)/3)))*3,S=Math.pow(10,-y),k=Q[8+y/3];return function(b){return p(S*b)+k}}return{format:o,formatPrefix:l}}var $,tn,rn;Dn({thousands:",",grouping:[3],currency:["$",""]});function Dn(n){return $=En(n),tn=$.format,rn=$.formatPrefix,$}function Tn(n){return Math.max(0,-v(Math.abs(n)))}function In(n,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(v(t)/3)))*3-v(Math.abs(n)))}function Ln(n,t){return n=Math.abs(n),t=Math.abs(t)-n,Math.max(0,v(t)-v(n))+1}function qn(n){return function(){return n}}function Cn(n){return+n}var W=[0,1];function A(n){return n}function q(n,t){return(t-=n=+n)?function(e){return(e-n)/t}:qn(isNaN(t)?NaN:.5)}function Bn(n,t){var e;return n>t&&(e=n,n=t,t=e),function(r){return Math.max(n,Math.min(t,r))}}function Gn(n,t,e){var r=n[0],i=n[1],f=t[0],a=t[1];return i<r?(r=q(i,r),f=e(a,f)):(r=q(r,i),f=e(f,a)),function(u){return f(r(u))}}function On(n,t,e){var r=Math.min(n.length,t.length)-1,i=new Array(r),f=new Array(r),a=-1;for(n[r]<n[0]&&(n=n.slice().reverse(),t=t.slice().reverse());++a<r;)i[a]=q(n[a],n[a+1]),f[a]=e(t[a],t[a+1]);return function(u){var c=gn(n,u,1,r)-1;return f[c](i[c](u))}}function Vn(n,t){return t.domain(n.domain()).range(n.range()).interpolate(n.interpolate()).clamp(n.clamp()).unknown(n.unknown())}function Xn(){var n=W,t=W,e=C,r,i,f,a=A,u,c,o;function l(){var s=Math.min(n.length,t.length);return a!==A&&(a=Bn(n[0],n[s-1])),u=s>2?On:Gn,c=o=null,h}function h(s){return s==null||isNaN(s=+s)?f:(c||(c=u(n.map(r),t,e)))(r(a(s)))}return h.invert=function(s){return a(i((o||(o=u(t,n.map(r),I)))(s)))},h.domain=function(s){return arguments.length?(n=Array.from(s,Cn),l()):n.slice()},h.range=function(s){return arguments.length?(t=Array.from(s),l()):t.slice()},h.rangeRound=function(s){return t=Array.from(s),e=bn,l()},h.clamp=function(s){return arguments.length?(a=s?!0:A,l()):a!==A},h.interpolate=function(s){return arguments.length?(e=s,l()):e},h.unknown=function(s){return arguments.length?(f=s,h):f},function(s,p){return r=s,i=p,l()}}function Un(){return Xn()(A,A)}function Yn(n,t,e,r){var i=Nn(n,t,e),f;switch(r=D(r??",f"),r.type){case"s":{var a=Math.max(Math.abs(n),Math.abs(t));return r.precision==null&&!isNaN(f=In(i,a))&&(r.precision=f),rn(r,a)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(f=Ln(i,Math.max(Math.abs(n),Math.abs(t))))&&(r.precision=f-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(f=Tn(i))&&(r.precision=f-(r.type==="%")*2);break}}return tn(r)}function Zn(n){var t=n.domain;return n.ticks=function(e){var r=t();return wn(r[0],r[r.length-1],e??10)},n.tickFormat=function(e,r){var i=t();return Yn(i[0],i[i.length-1],e??10,r)},n.nice=function(e){e==null&&(e=10);var r=t(),i=0,f=r.length-1,a=r[i],u=r[f],c,o,l=10;for(u<a&&(o=a,a=u,u=o,o=i,i=f,f=o);l-- >0;){if(o=L(a,u,e),o===c)return r[i]=a,r[f]=u,t(r);if(o>0)a=Math.floor(a/o)*o,u=Math.ceil(u/o)*o;else if(o<0)a=Math.ceil(a*o)/o,u=Math.floor(u*o)/o;else break;c=o}return n},n}function Hn(){var n=Un();return n.copy=function(){return Vn(n,Hn())},cn.apply(n,arguments),Zn(n)}export{Vn as a,_ as b,Un as c,Hn as l,Nn as t};
|