openc3-cosmos-tool-cmdtlmserver 7.2.0 → 7.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (125) hide show
  1. checksums.yaml +4 -4
  2. data/tools/cmdtlmserver/{ArrayWidget-D1PArcGr-1cb78ca7cb83e47908ee.js → ArrayWidget-5XQXgMtp-a1cacc906ac370efa514.js} +2 -2
  3. data/tools/cmdtlmserver/{ArrayplotWidget-DPUPy0qM-9c5325ed3b6e0c89df8f.js → ArrayplotWidget-pk7OINvA-33210225b3c4431d6f33.js} +1 -1
  4. data/tools/cmdtlmserver/{BarColumn-BpdscDQf-2d19bc70f89b83debf2b.js → BarColumn-JQ552zb0-e17d595e7ac2fedab92d.js} +1 -1
  5. data/tools/cmdtlmserver/{BlockWidget-_VUsK5T9-87cecde84ec9eee53d78.js → BlockWidget-B_5TnoG_-4917a3006731d930dcdd.js} +2 -2
  6. data/tools/cmdtlmserver/ButtonWidget-CiZGNEls-dd9c48d4c0e919b0c57c.js +1 -0
  7. data/tools/cmdtlmserver/CanvasWidget-CzLQAoHY-4af75346e21d0d3331bc.js +1 -0
  8. data/tools/cmdtlmserver/CanvasdotWidget-CcI1HwAp-f0e921fbede93d96bb17.js +1 -0
  9. data/tools/cmdtlmserver/{CanvasimageWidget-COv_Qnc8-53c8b97c1eff0cb369be.js → CanvasimageWidget-CYg1rKr_-39afd3add27b4d447626.js} +1 -1
  10. data/tools/cmdtlmserver/{CanvasimagevalueWidget-BhuUqLOo-388fa33a3da2d971b05b.js → CanvasimagevalueWidget-e0p2honY-57cf09c62360d64ff9c1.js} +1 -1
  11. data/tools/cmdtlmserver/CanvaslabelWidget-CgECf4wH-fef8dafccaa229773720.js +1 -0
  12. data/tools/cmdtlmserver/CanvaslabelvalueWidget-bCIPWE4c-08b3d8971b85e410007d.js +1 -0
  13. data/tools/cmdtlmserver/CanvaslineWidget-Tw1B6RTA-4182a23eb3b4901d5006.js +1 -0
  14. data/tools/cmdtlmserver/{CanvaslinevalueWidget-D4eaxWhR-488c1eb347eb93f3db22.js → CanvaslinevalueWidget-GvTic9rq-b0f032ce88445cb0c895.js} +1 -1
  15. data/tools/cmdtlmserver/CheckbuttonWidget-DV6xeneq-86726035ada344b7e26c.js +1 -0
  16. data/tools/cmdtlmserver/{CmdPacketsTab-5213fff88faeff8c2bf0.js → CmdPacketsTab-0e324d15546779b36cbe.js} +1 -1
  17. data/tools/cmdtlmserver/CmdTlmServer-be4dac6eeb7a6b184fd0.js +2 -0
  18. data/tools/cmdtlmserver/ComboboxWidget-BO31bWzg-a8f50b8d6656deb1ce0a.js +1 -0
  19. data/tools/cmdtlmserver/DataFlowsTab-88fea14a23c13f784f4e.js +1 -0
  20. data/tools/cmdtlmserver/{DateWidget-DkNWx28s-7f519b2f30faeb9fe3fd.js → DateWidget-DYviZFhJ-ed0e06de6fb4dc83dade.js} +1 -1
  21. data/tools/cmdtlmserver/{DetailsDialog-F4KgYM6m-df810d02cfb5e0198172.js → DetailsDialog-DHi4t3xd-4dbbbe18b115be58dea3.js} +1 -1
  22. data/tools/cmdtlmserver/{DynamicWidget-BuSbQVhf-18179cf5a61cbc723d72.js → DynamicWidget-BuSbQVhf-50da98367e5f44445d64.js} +1 -1
  23. data/tools/cmdtlmserver/{FilechecksumWidget-DSfNEnDJ-b6d7f28b678c6b571db9.js → FilechecksumWidget-rJe1KvzY-705def22db12f6e1158f.js} +1 -1
  24. data/tools/cmdtlmserver/{FiledisplayWidget-D2cxMmrP-91c627968612f56bef53.js → FiledisplayWidget-CbTWgtBy-e893d89bca5e32862cca.js} +1 -1
  25. data/tools/cmdtlmserver/{FormatvalueWidget-6-bj_PJO-5621420fe3506d1932e4.js → FormatvalueWidget-B9Giwzaz-e5b15c689305bbdc6138.js} +1 -1
  26. data/tools/cmdtlmserver/Graph-xc7TNnsk-fba27e65875cd99573f3.js +1 -0
  27. data/tools/cmdtlmserver/{GraphWidget-COXK3Dab-3f26903e4d5da289ab20.js → GraphWidget-COvVOlEn-a0d704d0f01317149056.js} +1 -1
  28. data/tools/cmdtlmserver/{HorizontalWidget-C9UFBPsk-84c81a59fc34282ffe71.js → HorizontalWidget-BfdjRLGe-c62ae940f92c44a7eadb.js} +1 -1
  29. data/tools/cmdtlmserver/{HorizontalboxWidget-CWLfmRtr-09493eb27796c1b12919.js → HorizontalboxWidget-B1b9uNaB-283855166e8f6be80aa3.js} +1 -1
  30. data/tools/cmdtlmserver/HorizontallineWidget-CHz4o6Gi-144da9f65a08a273e22c.js +1 -0
  31. data/tools/cmdtlmserver/{IframeWidget-Bn9eGzrq-fdd10b58ac32de3de437.js → IframeWidget-BCtrIgD1-2cc07ddcb93de83d426b.js} +1 -1
  32. data/tools/cmdtlmserver/{ImageLoader-_gAudhVo-003969d31d1c3d9e5b32.js → ImageLoader-BzE4VsHW-b822713b7f721dd17a29.js} +1 -1
  33. data/tools/cmdtlmserver/{ImageviewerWidget-BUWhF32Z-751c45f6392ccbe675d5.js → ImageviewerWidget-DKMBE3tQ-0b274f194175b3f6f708.js} +1 -1
  34. data/tools/cmdtlmserver/InterfaceFlowChart-2293ad5a69524f8faaad.js +27 -0
  35. data/tools/cmdtlmserver/{InterfacesTab-dca6d7668848c4078e8d.js → InterfacesTab-0950a7dc993d1ae87cf5.js} +1 -1
  36. data/tools/cmdtlmserver/{LabelWidget-BhzkN06D-4209a141ff664143bb0f.js → LabelWidget-B0nE0ImW-999c37cd748bfc5ca350.js} +1 -1
  37. data/tools/cmdtlmserver/LabelledWidget-DrZHj_lR-c3f0ca0f29f8d1826cfa.js +1 -0
  38. data/tools/cmdtlmserver/LabelprogressbarWidget-K9NphQp0-005aa442ae92ec5e6195.js +1 -0
  39. data/tools/cmdtlmserver/LabelsparklineWidget-cn1OJvL3-9ad770dac6482cfe7084.js +1 -0
  40. data/tools/cmdtlmserver/LabelvalueWidget-DxJbd9nR-94970a1cc88b1da754d2.js +1 -0
  41. data/tools/cmdtlmserver/LabelvaluedescWidget-B-RiUnpl-fcb69cfc6baf57e6d2c8.js +1 -0
  42. data/tools/cmdtlmserver/LabelvaluelimitsbarWidget-BF94rtl8-c4fd4c7721f15451d97a.js +1 -0
  43. data/tools/cmdtlmserver/LabelvaluelimitscolumnWidget-UOfPu8D1-dafe079eee8d7fbe6259.js +1 -0
  44. data/tools/cmdtlmserver/LabelvaluerangebarWidget-EVON-Tv8-cd0b204f545690c17be8.js +1 -0
  45. data/tools/cmdtlmserver/{Layout-CKmC50QZ-85f8ef7d9d4b778fc3f8.js → Layout-BLS4Yi3m-463747ca904cd4ff6c37.js} +1 -1
  46. data/tools/cmdtlmserver/{LedWidget-D1lmNXpi-3a5b364ce2a97685e9dd.js → LedWidget-DqVfh3zJ-78303742fb462fb51a83.js} +1 -1
  47. data/tools/cmdtlmserver/{LimitsBar-D5IZu7eX-07cdd7c4da705a5b2cac.js → LimitsBar-BqpvMpXM-88386f80850feaa6b865.js} +1 -1
  48. data/tools/cmdtlmserver/{LimitsbarWidget-VpxQXE-e-a756975fa42f4776712f.js → LimitsbarWidget-rEJIGKCx-2261d23989cc84a8d6f7.js} +1 -1
  49. data/tools/cmdtlmserver/{LimitscolorWidget-79P41CX7-ad179ada10464166cfb2.js → LimitscolorWidget-DVXho9Mm-16a9b9e86dda203630c7.js} +1 -1
  50. data/tools/cmdtlmserver/{LimitscolumnWidget-BFDXhJeZ-ded4fac25cb92257eb32.js → LimitscolumnWidget-DSQAdlZS-f7be960c2a12ab481f6d.js} +1 -1
  51. data/tools/cmdtlmserver/LinegraphWidget-CQRwZ0N6-e14cfd73c7976088c1f1.js +1 -0
  52. data/tools/cmdtlmserver/{MatrixbycolumnsWidget--ihvirDP-13588dfd9e05a20284cf.js → MatrixbycolumnsWidget-CJJ7SugT-cdb25088226a82895af3.js} +1 -1
  53. data/tools/cmdtlmserver/{OpenC3TimePicker-B0lAIU91-1d7cb9e69fdb3e2d19db.js → OpenC3TimePicker-Cww9L2Ij-002972617330ac39b4db.js} +1 -1
  54. data/tools/cmdtlmserver/{ProgressbarWidget-BIB3r9SL-89623753647970ec01f0.js → ProgressbarWidget-VTd49uhi-4de5cacfe2dc76b2ab1c.js} +1 -1
  55. data/tools/cmdtlmserver/RadiobuttonWidget-DqsantxO-2112f35825b3072a7b0a.js +1 -0
  56. data/tools/cmdtlmserver/{RadiogroupWidget-CciTCv1U-ebc68de8edecb013d87d.js → RadiogroupWidget-Bht6RZPH-8f7c530485bd7760772e.js} +1 -1
  57. data/tools/cmdtlmserver/{RangebarWidget-MPQYi2Km-6b2b3f2e820d4e5ce633.js → RangebarWidget-CN11Oqws-2c2edef9a9eb9ef4892c.js} +1 -1
  58. data/tools/cmdtlmserver/{RawBuffer-ebb6aadc11fa84048a7f.js → RawBuffer-90a2abdee24debc5b537.js} +1 -1
  59. data/tools/cmdtlmserver/{RawDialog-4383b630959e2310610e.js → RawDialog-3b36f1e5ab5cdf44f650.js} +1 -1
  60. data/tools/cmdtlmserver/{RollupWidget-CfjGAhzg-6b1de39f95e298a21e0f.js → RollupWidget-cgl9Ghle-e2934ddfe4117fb13a53.js} +1 -1
  61. data/tools/cmdtlmserver/{RoutersTab-7438fce73b7c2c45c9c7.js → RoutersTab-542302486cd961ede002.js} +1 -1
  62. data/tools/cmdtlmserver/ScrollwindowWidget-BFK-ihvZ-90c8fb32873df4b31339.js +1 -0
  63. data/tools/cmdtlmserver/{SignalWidget-C-qecoTO-b31583be1fe1a7a01769.js → SignalWidget-Be7Z5pJD-10eb7a0ca46a327184f3.js} +1 -1
  64. data/tools/cmdtlmserver/SpacerWidget-uKPA-f_0-18ddf6aff97bc3aa2eed.js +1 -0
  65. data/tools/cmdtlmserver/SparklineWidget-Wu5iFbly-9336eea1201b5e702e22.js +1 -0
  66. data/tools/cmdtlmserver/{StatusTab-7f111deb77c4a2bc05b0.js → StatusTab-0dbcf0b1411d44f21f50.js} +1 -1
  67. data/tools/cmdtlmserver/TabbookWidget-D3FrIoV4-e06adf708de31869bff4.js +1 -0
  68. data/tools/cmdtlmserver/TargetsTab-8def00628316dacb10b9.js +1 -0
  69. data/tools/cmdtlmserver/TextboxWidget-f6wEcoI0-40e18e2c50ee31ccd381.js +1 -0
  70. data/tools/cmdtlmserver/TextfieldWidget-D72Sey-h-91a2aac704f5a971cb37.js +1 -0
  71. data/tools/cmdtlmserver/TimeWidget-BBuxr7Db-4478ed91a6bda559bcd5.js +1 -0
  72. data/tools/cmdtlmserver/TitleWidget-Dfp5mPH2-cbf4ea6dbac6faf880ca.js +1 -0
  73. data/tools/cmdtlmserver/{TlmPacketsTab-6453f72e7567b78bb979.js → TlmPacketsTab-348ca696bec8218d392e.js} +1 -1
  74. data/tools/cmdtlmserver/{Updater-d97ddec520bea4a73d3f.js → Updater-ddbf71ef8b261678632b.js} +1 -1
  75. data/tools/cmdtlmserver/{VWidget-oMbywhLA-03a02aaf028be7a3c9c0.js → VWidget-5FjwlURU-ccd0da88597b1fe24b9f.js} +1 -1
  76. data/tools/cmdtlmserver/ValueWidget-CpptSOvJ-c79b03e200fceaed3b72.js +1 -0
  77. data/tools/cmdtlmserver/ValuelimitsbarWidget-AgeOlPAV-5ecbdfb993465212a981.js +1 -0
  78. data/tools/cmdtlmserver/ValuelimitscolumnWidget-CfTt7Q8a-5f88ad7096c065616966.js +1 -0
  79. data/tools/cmdtlmserver/ValuerangebarWidget-E3CtttJk-e1f7f4f4d4deb9b59e1d.js +1 -0
  80. data/tools/cmdtlmserver/VerticalWidget-B_eheXmK-caf636d80032bd7d00de.js +1 -0
  81. data/tools/cmdtlmserver/{VerticalboxWidget-C7RrkfY0-f0cc6f904b80b09e5ba7.js → VerticalboxWidget-Bf8XJiY9-482c288cf9bc399495ad.js} +1 -1
  82. data/tools/cmdtlmserver/{Widget-D_HaosJK-e286c8e7e2106d81e87c.js → Widget-CSgnvwEG-342dae6e23faa53d97f8.js} +1 -1
  83. data/tools/cmdtlmserver/main-1e301797925648810014.js +1493 -0
  84. data/tools/cmdtlmserver/main.js +1 -1
  85. data/tools/cmdtlmserver/services-57f41ec24ff307cc14a2.js +10 -0
  86. metadata +84 -84
  87. data/tools/cmdtlmserver/ButtonWidget-DE41o-cg-c5cd6e74dbabd0420d0e.js +0 -2
  88. data/tools/cmdtlmserver/CanvasWidget-BEi8h3Mq-e35c5a9baa7ecd914bcf.js +0 -1
  89. data/tools/cmdtlmserver/CanvasdotWidget-eZuMgkhL-fda5d43523fafb058839.js +0 -1
  90. data/tools/cmdtlmserver/CanvaslabelWidget-DtvbgeYH-6e001a64a4a18263f0ee.js +0 -1
  91. data/tools/cmdtlmserver/CanvaslabelvalueWidget-C_FRIeNb-4134766817f8dcab10e9.js +0 -1
  92. data/tools/cmdtlmserver/CanvaslineWidget-D1K_6mAY-957ef26c77ffcf3c26aa.js +0 -1
  93. data/tools/cmdtlmserver/CheckbuttonWidget-ByxMDkiS-6e069bf3ea2500374efe.js +0 -1
  94. data/tools/cmdtlmserver/CmdTlmServer-db96cc7a37046fc23e08.js +0 -2
  95. data/tools/cmdtlmserver/ComboboxWidget-CAGxGv2r-d17c3e9aaa2b1b02ab46.js +0 -1
  96. data/tools/cmdtlmserver/DataFlowsTab-324bc5957f403e4d2794.js +0 -1
  97. data/tools/cmdtlmserver/Graph-Cz0Ns1FD-0efdbbd522a909650069.js +0 -1
  98. data/tools/cmdtlmserver/HorizontallineWidget-DeFkOaYO-257ec3426ecc547ca94f.js +0 -1
  99. data/tools/cmdtlmserver/InterfaceFlowChart-cfadd36d819b485a73ef.js +0 -27
  100. data/tools/cmdtlmserver/LabelledWidget-vx8NvW1b-a9879fd6ddfc57fa36b9.js +0 -1
  101. data/tools/cmdtlmserver/LabelprogressbarWidget-t5PvKuS4-feb53cc1f8715b39f864.js +0 -1
  102. data/tools/cmdtlmserver/LabelsparklineWidget-CebbEH-j-f503f09d02fa4f3918c1.js +0 -1
  103. data/tools/cmdtlmserver/LabelvalueWidget-Cbs1DBK2-ce888769e60d2e4aad2c.js +0 -1
  104. data/tools/cmdtlmserver/LabelvaluedescWidget-B7OIOGc0-878e5a0b12c95f9dc732.js +0 -1
  105. data/tools/cmdtlmserver/LabelvaluelimitsbarWidget-C57kf-oQ-0be9055fc642dd213441.js +0 -1
  106. data/tools/cmdtlmserver/LabelvaluelimitscolumnWidget-BRlNDEqp-e812057ca64792e7caed.js +0 -1
  107. data/tools/cmdtlmserver/LabelvaluerangebarWidget-Pt_evm3v-77436cdf1233d55bfb62.js +0 -1
  108. data/tools/cmdtlmserver/LinegraphWidget-VqkpOlws-fdf5639852f6b641d75f.js +0 -1
  109. data/tools/cmdtlmserver/RadiobuttonWidget-C5rxLM7K-572c4d7c32c43b82c96b.js +0 -1
  110. data/tools/cmdtlmserver/ScrollwindowWidget-CupaygNN-1554ccfbbfa2766e4301.js +0 -1
  111. data/tools/cmdtlmserver/SpacerWidget-VVkOCb6N-dbdf2c2f889a818d027b.js +0 -1
  112. data/tools/cmdtlmserver/SparklineWidget-Dsmn38z_-1d9eba2ef6ba778585cd.js +0 -1
  113. data/tools/cmdtlmserver/TabbookWidget-CXklff-l-8ad144458fb01c903478.js +0 -1
  114. data/tools/cmdtlmserver/TargetsTab-29f400440b894771ad34.js +0 -1
  115. data/tools/cmdtlmserver/TextboxWidget-CHs2VYIv-939d75e16d4590c1f1f8.js +0 -1
  116. data/tools/cmdtlmserver/TextfieldWidget-CdANAW-6-6a6919e7eb62ef86954f.js +0 -1
  117. data/tools/cmdtlmserver/TimeWidget-D0xT1wXR-19f76febd2f5779fae7a.js +0 -1
  118. data/tools/cmdtlmserver/TitleWidget-68NWCcXB-7507be046b0a9b3c127c.js +0 -1
  119. data/tools/cmdtlmserver/ValueWidget-B1aGUBP7-af6d1d1a57943374ee79.js +0 -1
  120. data/tools/cmdtlmserver/ValuelimitsbarWidget-B7KcRjLS-de09e4004f70b97b84bc.js +0 -1
  121. data/tools/cmdtlmserver/ValuelimitscolumnWidget-BVt6nLXq-ca32b86e6abfcdcca7df.js +0 -1
  122. data/tools/cmdtlmserver/ValuerangebarWidget-uVZEI32U-d5bd219c6bc362dc1229.js +0 -1
  123. data/tools/cmdtlmserver/VerticalWidget-DlftYBjH-7f2f1e45111c6a438cd3.js +0 -1
  124. data/tools/cmdtlmserver/main-ae88870307d629b1ce0e.js +0 -1499
  125. data/tools/cmdtlmserver/services-a7fe7e9b036652e7b4b1.js +0 -10
@@ -0,0 +1,27 @@
1
+ System.register(["vue","./Updater-ddbf71ef8b261678632b.js","./RawBuffer-90a2abdee24debc5b537.js","./main-1e301797925648810014.js","./services-57f41ec24ff307cc14a2.js"],(function(oa,Bv){"use strict";var Kn,ot,qn,_e,ft,Ne,Qo,er,ee,de,q,le,me,ke,tr,be,xe,he,Ke,ht,gt,nr,zt,Ae,or,qe,ce,Be,sn,Te,Jn,rr,Ie,Me,De,un,ir,lr,pe,Se,ye,ar,Qn,pt,Ve,Rt,sr,ur,cr,dr,fr,rt,hr;return{setters:[ne=>{Kn=ne.getCurrentScope,ot=ne.inject,qn=ne.effectScope,_e=ne.watch,ft=ne.provide,Ne=ne.defineComponent,Qo=ne.useSlots,er=ne.onUnmounted,ee=ne.openBlock,de=ne.createElementBlock,q=ne.unref,le=ne.createVNode,me=ne.withCtx,ke=ne.renderSlot,tr=ne.createPropsRestProxy,be=ne.toRef,xe=ne.ref,he=ne.computed,Ke=ne.onMounted,ht=ne.normalizeClass,gt=ne.getCurrentInstance,nr=ne.reactive,zt=ne.onScopeDispose,Ae=ne.nextTick,or=ne.onBeforeMount,qe=ne.shallowRef,ce=ne.createElementVNode,Be=ne.Fragment,sn=ne.renderList,Te=ne.normalizeStyle,Jn=ne.onBeforeUnmount,rr=ne.isMemoSame,Ie=ne.createBlock,Me=ne.createCommentVNode,De=ne.toDisplayString,un=ne.isRef,ir=ne.toRefs,lr=ne.customRef,pe=ne.toValue,Se=ne.resolveComponent,ye=ne.h,ar=ne.useAttrs,Qn=ne.mergeProps,pt=ne.resolveDynamicComponent,Ve=ne.createTextVNode,Rt=ne.markRaw,sr=ne.readonly,ur=ne.normalizeProps,cr=ne.guardReactiveProps},ne=>{dr=ne.U},ne=>{fr=ne.R},ne=>{rt=ne._},ne=>{hr=ne.N}],execute:(function(){var ne=document.createElement("style");ne.textContent=`.details-table[data-v-06ee5ec0]{width:100%;overflow-x:hidden;overflow-y:hidden}.interface-node[data-v-31945a3b]{position:relative;background:#fff;border:2px solid #1d85e1;border-radius:8px;text-align:center;padding:10px;box-shadow:0 2px 8px #0000001a;cursor:pointer}.node-label[data-v-31945a3b]{font-weight:500;margin:4px 0;font-size:14px;color:#1f2937}.router-node[data-v-b1fbfb62]{position:relative;background:#fff;border:2px solid #ba1de1;border-radius:8px;text-align:center;padding:10px;box-shadow:0 2px 8px #0000001a;cursor:pointer}.node-label[data-v-b1fbfb62]{font-weight:500;margin:4px 0;font-size:14px;color:#1f2937}.cosmos-node[data-v-c2b5368b]{background:#fff;border:2px solid #10b981;border-radius:8px;padding:10px;text-align:center;box-shadow:0 2px 8px #0000001a;height:200px;width:200px}.node-label[data-v-c2b5368b]{font-weight:500;margin:4px 0;font-size:14px;color:#1f2937}.target-node[data-v-125c8608]{background:#fff;border:2px solid #10b981;border-radius:8px;padding:10px;text-align:center;box-shadow:0 2px 8px #0000001a;height:200px;width:200px}.node-label[data-v-125c8608]{font-weight:500;margin:4px 0;font-size:14px;color:#1f2937}.write-protocol-node[data-v-1bec9d38]{background:#fff7ed;border:2px solid #f97316;border-radius:4px;box-sizing:border-box;padding:4px 6px;text-align:center;font-size:10px;box-shadow:0 2px 4px #0003;position:absolute;z-index:10;display:flex;align-items:center;justify-content:center;visibility:visible!important;cursor:pointer}.protocol-label[data-v-1bec9d38]{font-weight:500;font-size:10px;margin:2px 0;color:#374151;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.read-protocol-node[data-v-c903bd6c]{background:#ecfeff;border:2px solid #06b6d4;border-radius:4px;box-sizing:border-box;padding:4px 6px;text-align:center;font-size:10px;box-shadow:0 2px 4px #0003;position:absolute;z-index:10;display:flex;align-items:center;justify-content:center;visibility:visible!important;cursor:pointer}.protocol-label[data-v-c903bd6c]{font-weight:500;font-size:10px;margin:2px 0;color:#374151;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.vue-flow{position:relative;width:100%;height:100%;overflow:hidden;z-index:0;direction:ltr}.vue-flow__container{position:absolute;height:100%;width:100%;left:0;top:0}.vue-flow__pane{z-index:1}.vue-flow__pane.draggable{cursor:grab}.vue-flow__pane.selection{cursor:pointer}.vue-flow__pane.dragging{cursor:grabbing}.vue-flow__transformationpane{transform-origin:0 0;z-index:2;pointer-events:none}.vue-flow__viewport{z-index:4;overflow:clip}.vue-flow__selection{z-index:6}.vue-flow__edge-labels{position:absolute;width:100%;height:100%;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.vue-flow__nodesselection-rect:focus,.vue-flow__nodesselection-rect:focus-visible{outline:none}.vue-flow .vue-flow__edges{pointer-events:none;overflow:visible}.vue-flow__edge-path,.vue-flow__connection-path{stroke:#b1b1b7;stroke-width:1;fill:none}.vue-flow__edge{pointer-events:visibleStroke;cursor:pointer}.vue-flow__edge.animated path{stroke-dasharray:5;animation:dashdraw .5s linear infinite}.vue-flow__edge.animated path.vue-flow__edge-interaction{stroke-dasharray:none;animation:none}.vue-flow__edge.inactive{pointer-events:none}.vue-flow__edge.selected,.vue-flow__edge:focus,.vue-flow__edge:focus-visible{outline:none}.vue-flow__edge.selected .vue-flow__edge-path,.vue-flow__edge:focus .vue-flow__edge-path,.vue-flow__edge:focus-visible .vue-flow__edge-path{stroke:#555}.vue-flow__edge-textwrapper{pointer-events:all}.vue-flow__edge-text{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.vue-flow__connection{pointer-events:none}.vue-flow__connection .animated{stroke-dasharray:5;animation:dashdraw .5s linear infinite}.vue-flow__connectionline{z-index:1001}.vue-flow__nodes{pointer-events:none;transform-origin:0 0}.vue-flow__node{position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:all;transform-origin:0 0;box-sizing:border-box;cursor:default}.vue-flow__node.draggable{cursor:grab;pointer-events:all}.vue-flow__node.draggable.dragging{cursor:grabbing}.vue-flow__nodesselection{z-index:3;transform-origin:left top;pointer-events:none}.vue-flow__nodesselection-rect{position:absolute;pointer-events:all;cursor:grab}.vue-flow__nodesselection-rect.dragging{cursor:grabbing}.vue-flow__handle{position:absolute;pointer-events:none;min-width:5px;min-height:5px}.vue-flow__handle.connectable{pointer-events:all;cursor:crosshair}.vue-flow__handle-bottom{left:50%;bottom:0;transform:translate(-50%,50%)}.vue-flow__handle-top{left:50%;top:0;transform:translate(-50%,-50%)}.vue-flow__handle-left{top:50%;left:0;transform:translate(-50%,-50%)}.vue-flow__handle-right{top:50%;right:0;transform:translate(50%,-50%)}.vue-flow__edgeupdater{cursor:move;pointer-events:all}.vue-flow__panel{position:absolute;z-index:5;margin:15px}.vue-flow__panel.top{top:0}.vue-flow__panel.bottom{bottom:0}.vue-flow__panel.left{left:0}.vue-flow__panel.right{right:0}.vue-flow__panel.center{left:50%;transform:translate(-50%)}@keyframes dashdraw{0%{stroke-dashoffset:10}}.vue-flow__controls{box-shadow:0 0 2px 1px #00000014}.vue-flow__controls-button{background:#fefefe;border:none;border-bottom:1px solid #eee;box-sizing:content-box;display:flex;justify-content:center;align-items:center;width:16px;height:16px;cursor:pointer;-webkit-user-select:none;user-select:none;padding:5px}.vue-flow__controls-button svg{width:100%;max-width:12px;max-height:12px}.vue-flow__controls-button:hover{background:#f4f4f4}.vue-flow__controls-button:disabled{pointer-events:none}.vue-flow__controls-button:disabled svg{fill-opacity:.4}:root{--vf-node-bg: #fff;--vf-node-text: #222;--vf-connection-path: #b1b1b7;--vf-handle: #555}.vue-flow__edge.updating .vue-flow__edge-path{stroke:#777}.vue-flow__edge-text{font-size:10px}.vue-flow__edge-textbg{fill:#fff}.vue-flow__connection-path{stroke:var(--vf-connection-path)}.vue-flow__node{cursor:grab}.vue-flow__node.selectable:focus,.vue-flow__node.selectable:focus-visible{outline:none}.vue-flow__node-default,.vue-flow__node-input,.vue-flow__node-output{padding:10px;border-radius:3px;width:150px;font-size:12px;text-align:center;border-width:1px;border-style:solid;color:var(--vf-node-text);background-color:var(--vf-node-bg);border-color:var(--vf-node-color)}.vue-flow__node-default.selected,.vue-flow__node-default.selected:hover,.vue-flow__node-input.selected,.vue-flow__node-input.selected:hover,.vue-flow__node-output.selected,.vue-flow__node-output.selected:hover{box-shadow:0 0 0 .5px var(--vf-box-shadow)}.vue-flow__node-default.selected,.vue-flow__node-default:focus,.vue-flow__node-default:focus-visible,.vue-flow__node-input.selected,.vue-flow__node-input:focus,.vue-flow__node-input:focus-visible,.vue-flow__node-output.selected,.vue-flow__node-output:focus,.vue-flow__node-output:focus-visible{outline:none;border:1px solid #555}.vue-flow__node-default .vue-flow__handle,.vue-flow__node-input .vue-flow__handle,.vue-flow__node-output .vue-flow__handle{background:var(--vf-handle)}.vue-flow__node-default.selectable:hover,.vue-flow__node-input.selectable:hover,.vue-flow__node-output.selectable:hover{box-shadow:0 1px 4px 1px #00000014}.vue-flow__node-input{--vf-node-color: var(--vf-node-color, #0041d0);--vf-handle: var(--vf-node-color, #0041d0);--vf-box-shadow: var(--vf-node-color, #0041d0);background:var(--vf-node-bg);border-color:var(--vf-node-color, #0041d0)}.vue-flow__node-input.selected,.vue-flow__node-input:focus,.vue-flow__node-input:focus-visible{outline:none;border:1px solid var(--vf-node-color, #0041d0)}.vue-flow__node-default{--vf-handle: var(--vf-node-color, #1a192b);--vf-box-shadow: var(--vf-node-color, #1a192b);background:var(--vf-node-bg);border-color:var(--vf-node-color, #1a192b)}.vue-flow__node-default.selected,.vue-flow__node-default:focus,.vue-flow__node-default:focus-visible{outline:none;border:1px solid var(--vf-node-color, #1a192b)}.vue-flow__node-output{--vf-handle: var(--vf-node-color, #ff0072);--vf-box-shadow: var(--vf-node-color, #ff0072);background:var(--vf-node-bg);border-color:var(--vf-node-color, #ff0072)}.vue-flow__node-output.selected,.vue-flow__node-output:focus,.vue-flow__node-output:focus-visible{outline:none;border:1px solid var(--vf-node-color, #ff0072)}.vue-flow__nodesselection-rect,.vue-flow__selection{background:#0059dc14;border:1px dotted rgba(0,89,220,.8)}.vue-flow__nodesselection-rect:focus,.vue-flow__nodesselection-rect:focus-visible,.vue-flow__selection:focus,.vue-flow__selection:focus-visible{outline:none}.vue-flow__handle{width:6px;height:6px;background:var(--vf-handle);border:1px solid #fff;border-radius:100%}.interface-flow-chart{height:100%;width:100%}.vue-flow-container{height:100%;width:100%;background-color:#172635;border-radius:4px}.empty-state{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;color:#6b7280}.vue-flow__handle{height:24px;width:10px;background:#aaa;border-radius:4px}.vue-flow__node{background-color:#172635}.vue-flow__edges path{stroke-width:2}.docs-overlay{position:absolute;top:10px;left:10px;z-index:5}.docs-link{display:inline-flex;align-items:center;padding:4px 10px;background-color:#1e3246d9;border:1px solid rgba(255,255,255,.2);border-radius:4px;color:#fffc;text-decoration:none;font-size:13px;transition:background-color .2s,color .2s}.docs-link:hover{background-color:#284664f2;color:#fff}
2
+ /*$vite$:1*/`,document.head.appendChild(ne);function Bt(e){return Kn()?(zt(e),!0):!1}function Je(e){return typeof e=="function"?e():q(e)}const ra=typeof window<"u"&&typeof document<"u",ia=e=>typeof e<"u",la=Object.prototype.toString,aa=e=>la.call(e)==="[object Object]",sa=()=>{};function ua(e,t){function n(...o){return new Promise((r,i)=>{Promise.resolve(e(()=>t.apply(this,o),{fn:t,thisArg:this,args:o})).then(r).catch(i)})}return n}const gr=e=>e();function ca(e=gr){const t=xe(!0);function n(){t.value=!1}function o(){t.value=!0}const r=(...i)=>{t.value&&e(...i)};return{isActive:sr(t),pause:n,resume:o,eventFilter:r}}function pr(e,t=!1,n="Timeout"){return new Promise((o,r)=>{setTimeout(t?()=>r(n):o,e)})}function da(e,t,n={}){const{eventFilter:o=gr,...r}=n;return _e(e,ua(o,t),r)}function St(e,t,n={}){const{eventFilter:o,...r}=n,{eventFilter:i,pause:l,resume:a,isActive:u}=ca(o);return{stop:da(e,t,{...r,eventFilter:i}),pause:l,resume:a,isActive:u}}function fa(e,t={}){if(!un(e))return ir(e);const n=Array.isArray(e.value)?Array.from({length:e.value.length}):{};for(const o in e.value)n[o]=lr(()=>({get(){return e.value[o]},set(r){var i;if((i=Je(t.replaceRef))!=null?i:!0)if(Array.isArray(e.value)){const a=[...e.value];a[o]=r,e.value=a}else{const a={...e.value,[o]:r};Object.setPrototypeOf(a,Object.getPrototypeOf(e.value)),e.value=a}else e.value[o]=r}}));return n}function eo(e,t=!1){function n(d,{flush:f="sync",deep:h=!1,timeout:m,throwOnTimeout:y}={}){let g=null;const S=[new Promise(p=>{g=_e(e,C=>{d(C)!==t&&(g?.(),p(C))},{flush:f,deep:h,immediate:!0})})];return m!=null&&S.push(pr(m,y).then(()=>Je(e)).finally(()=>g?.())),Promise.race(S)}function o(d,f){if(!un(d))return n(C=>C===d,f);const{flush:h="sync",deep:m=!1,timeout:y,throwOnTimeout:g}=f??{};let _=null;const p=[new Promise(C=>{_=_e([e,d],([z,V])=>{t!==(z===V)&&(_?.(),C(z))},{flush:h,deep:m,immediate:!0})})];return y!=null&&p.push(pr(y,g).then(()=>Je(e)).finally(()=>(_?.(),Je(e)))),Promise.race(p)}function r(d){return n(f=>!!f,d)}function i(d){return o(null,d)}function l(d){return o(void 0,d)}function a(d){return n(Number.isNaN,d)}function u(d,f){return n(h=>{const m=Array.from(h);return m.includes(d)||m.includes(Je(d))},f)}function s(d){return c(1,d)}function c(d=1,f){let h=-1;return n(()=>(h+=1,h>=d),f)}return Array.isArray(Je(e))?{toMatch:n,toContains:u,changed:s,changedTimes:c,get not(){return eo(e,!t)}}:{toMatch:n,toBe:o,toBeTruthy:r,toBeNull:i,toBeNaN:a,toBeUndefined:l,changed:s,changedTimes:c,get not(){return eo(e,!t)}}}function to(e){return eo(e)}function ha(e){var t;const n=Je(e);return(t=n?.$el)!=null?t:n}const vr=ra?window:void 0;function mr(...e){let t,n,o,r;if(typeof e[0]=="string"||Array.isArray(e[0])?([n,o,r]=e,t=vr):[t,n,o,r]=e,!t)return sa;Array.isArray(n)||(n=[n]),Array.isArray(o)||(o=[o]);const i=[],l=()=>{i.forEach(c=>c()),i.length=0},a=(c,d,f,h)=>(c.addEventListener(d,f,h),()=>c.removeEventListener(d,f,h)),u=_e(()=>[ha(t),Je(r)],([c,d])=>{if(l(),!c)return;const f=aa(d)?{...d}:d;i.push(...n.flatMap(h=>o.map(m=>a(c,h,m,f))))},{immediate:!0,flush:"post"}),s=()=>{u(),l()};return Bt(s),s}function ga(e){return typeof e=="function"?e:typeof e=="string"?t=>t.key===e:Array.isArray(e)?t=>e.includes(t.key):()=>!0}function _r(...e){let t,n,o={};e.length===3?(t=e[0],n=e[1],o=e[2]):e.length===2?typeof e[1]=="object"?(t=!0,n=e[0],o=e[1]):(t=e[0],n=e[1]):(t=!0,n=e[0]);const{target:r=vr,eventName:i="keydown",passive:l=!1,dedupe:a=!1}=o,u=ga(t);return mr(r,i,c=>{c.repeat&&Je(a)||u(c)&&n(c)},l)}function pa(e){return JSON.parse(JSON.stringify(e))}function no(e,t,n,o={}){var r,i,l;const{clone:a=!1,passive:u=!1,eventName:s,deep:c=!1,defaultValue:d,shouldEmit:f}=o,h=gt(),m=n||h?.emit||((r=h?.$emit)==null?void 0:r.bind(h))||((l=(i=h?.proxy)==null?void 0:i.$emit)==null?void 0:l.bind(h?.proxy));let y=s;t||(t="modelValue"),y=y||`update:${t.toString()}`;const g=p=>a?typeof a=="function"?a(p):pa(p):p,_=()=>ia(e[t])?g(e[t]):d,S=p=>{f?f(p)&&m(y,p):m(y,p)};if(u){const p=_(),C=xe(p);let z=!1;return _e(()=>e[t],V=>{z||(z=!0,C.value=g(V),Ae(()=>z=!1))}),_e(C,V=>{!z&&(V!==e[t]||c)&&S(V)},{deep:c}),C}else return he({get(){return _()},set(p){S(p)}})}var va={value:()=>{}};function cn(){for(var e=0,t=arguments.length,n={},o;e<t;++e){if(!(o=arguments[e]+"")||o in n||/[\s.]/.test(o))throw new Error("illegal type: "+o);n[o]=[]}return new dn(n)}function dn(e){this._=e}function ma(e,t){return e.trim().split(/^|\s+/).map(function(n){var o="",r=n.indexOf(".");if(r>=0&&(o=n.slice(r+1),n=n.slice(0,r)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:o}})}dn.prototype=cn.prototype={constructor:dn,on:function(e,t){var n=this._,o=ma(e+"",n),r,i=-1,l=o.length;if(arguments.length<2){for(;++i<l;)if((r=(e=o[i]).type)&&(r=_a(n[r],e.name)))return r;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++i<l;)if(r=(e=o[i]).type)n[r]=yr(n[r],e.name,t);else if(t==null)for(r in n)n[r]=yr(n[r],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new dn(e)},call:function(e,t){if((r=arguments.length-2)>0)for(var n=new Array(r),o=0,r,i;o<r;++o)n[o]=arguments[o+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(i=this._[e],o=0,r=i.length;o<r;++o)i[o].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var o=this._[e],r=0,i=o.length;r<i;++r)o[r].value.apply(t,n)}};function _a(e,t){for(var n=0,o=e.length,r;n<o;++n)if((r=e[n]).name===t)return r.value}function yr(e,t,n){for(var o=0,r=e.length;o<r;++o)if(e[o].name===t){e[o]=va,e=e.slice(0,o).concat(e.slice(o+1));break}return n!=null&&e.push({name:t,value:n}),e}var oo="http://www.w3.org/1999/xhtml";const wr={svg:"http://www.w3.org/2000/svg",xhtml:oo,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function fn(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),wr.hasOwnProperty(t)?{space:wr[t],local:e}:e}function ya(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===oo&&t.documentElement.namespaceURI===oo?t.createElement(e):t.createElementNS(n,e)}}function wa(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function br(e){var t=fn(e);return(t.local?wa:ya)(t)}function ba(){}function ro(e){return e==null?ba:function(){return this.querySelector(e)}}function xa(e){typeof e!="function"&&(e=ro(e));for(var t=this._groups,n=t.length,o=new Array(n),r=0;r<n;++r)for(var i=t[r],l=i.length,a=o[r]=new Array(l),u,s,c=0;c<l;++c)(u=i[c])&&(s=e.call(u,u.__data__,c,i))&&("__data__"in u&&(s.__data__=u.__data__),a[c]=s);return new ze(o,this._parents)}function Ea(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function Na(){return[]}function xr(e){return e==null?Na:function(){return this.querySelectorAll(e)}}function Sa(e){return function(){return Ea(e.apply(this,arguments))}}function ka(e){typeof e=="function"?e=Sa(e):e=xr(e);for(var t=this._groups,n=t.length,o=[],r=[],i=0;i<n;++i)for(var l=t[i],a=l.length,u,s=0;s<a;++s)(u=l[s])&&(o.push(e.call(u,u.__data__,s,l)),r.push(u));return new ze(o,r)}function Er(e){return function(){return this.matches(e)}}function Nr(e){return function(t){return t.matches(e)}}var Ca=Array.prototype.find;function $a(e){return function(){return Ca.call(this.children,e)}}function Ia(){return this.firstElementChild}function Ma(e){return this.select(e==null?Ia:$a(typeof e=="function"?e:Nr(e)))}var Oa=Array.prototype.filter;function Da(){return Array.from(this.children)}function Ta(e){return function(){return Oa.call(this.children,e)}}function Pa(e){return this.selectAll(e==null?Da:Ta(typeof e=="function"?e:Nr(e)))}function Aa(e){typeof e!="function"&&(e=Er(e));for(var t=this._groups,n=t.length,o=new Array(n),r=0;r<n;++r)for(var i=t[r],l=i.length,a=o[r]=[],u,s=0;s<l;++s)(u=i[s])&&e.call(u,u.__data__,s,i)&&a.push(u);return new ze(o,this._parents)}function Sr(e){return new Array(e.length)}function za(){return new ze(this._enter||this._groups.map(Sr),this._parents)}function hn(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}hn.prototype={constructor:hn,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function Ra(e){return function(){return e}}function Ba(e,t,n,o,r,i){for(var l=0,a,u=t.length,s=i.length;l<s;++l)(a=t[l])?(a.__data__=i[l],o[l]=a):n[l]=new hn(e,i[l]);for(;l<u;++l)(a=t[l])&&(r[l]=a)}function Va(e,t,n,o,r,i,l){var a,u,s=new Map,c=t.length,d=i.length,f=new Array(c),h;for(a=0;a<c;++a)(u=t[a])&&(f[a]=h=l.call(u,u.__data__,a,t)+"",s.has(h)?r[a]=u:s.set(h,u));for(a=0;a<d;++a)h=l.call(e,i[a],a,i)+"",(u=s.get(h))?(o[a]=u,u.__data__=i[a],s.delete(h)):n[a]=new hn(e,i[a]);for(a=0;a<c;++a)(u=t[a])&&s.get(f[a])===u&&(r[a]=u)}function La(e){return e.__data__}function Ha(e,t){if(!arguments.length)return Array.from(this,La);var n=t?Va:Ba,o=this._parents,r=this._groups;typeof e!="function"&&(e=Ra(e));for(var i=r.length,l=new Array(i),a=new Array(i),u=new Array(i),s=0;s<i;++s){var c=o[s],d=r[s],f=d.length,h=Fa(e.call(c,c&&c.__data__,s,o)),m=h.length,y=a[s]=new Array(m),g=l[s]=new Array(m),_=u[s]=new Array(f);n(c,d,y,g,_,h,t);for(var S=0,p=0,C,z;S<m;++S)if(C=y[S]){for(S>=p&&(p=S+1);!(z=g[p])&&++p<m;);C._next=z||null}}return l=new ze(l,o),l._enter=a,l._exit=u,l}function Fa(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Ya(){return new ze(this._exit||this._groups.map(Sr),this._parents)}function Ga(e,t,n){var o=this.enter(),r=this,i=this.exit();return typeof e=="function"?(o=e(o),o&&(o=o.selection())):o=o.append(e+""),t!=null&&(r=t(r),r&&(r=r.selection())),n==null?i.remove():n(i),o&&r?o.merge(r).order():r}function Xa(e){for(var t=e.selection?e.selection():e,n=this._groups,o=t._groups,r=n.length,i=o.length,l=Math.min(r,i),a=new Array(r),u=0;u<l;++u)for(var s=n[u],c=o[u],d=s.length,f=a[u]=new Array(d),h,m=0;m<d;++m)(h=s[m]||c[m])&&(f[m]=h);for(;u<r;++u)a[u]=n[u];return new ze(a,this._parents)}function ja(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var o=e[t],r=o.length-1,i=o[r],l;--r>=0;)(l=o[r])&&(i&&l.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(l,i),i=l);return this}function Ua(e){e||(e=Wa);function t(d,f){return d&&f?e(d.__data__,f.__data__):!d-!f}for(var n=this._groups,o=n.length,r=new Array(o),i=0;i<o;++i){for(var l=n[i],a=l.length,u=r[i]=new Array(a),s,c=0;c<a;++c)(s=l[c])&&(u[c]=s);u.sort(t)}return new ze(r,this._parents).order()}function Wa(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function Za(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function Ka(){return Array.from(this)}function qa(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var o=e[t],r=0,i=o.length;r<i;++r){var l=o[r];if(l)return l}return null}function Ja(){let e=0;for(const t of this)++e;return e}function Qa(){return!this.node()}function es(e){for(var t=this._groups,n=0,o=t.length;n<o;++n)for(var r=t[n],i=0,l=r.length,a;i<l;++i)(a=r[i])&&e.call(a,a.__data__,i,r);return this}function ts(e){return function(){this.removeAttribute(e)}}function ns(e){return function(){this.removeAttributeNS(e.space,e.local)}}function os(e,t){return function(){this.setAttribute(e,t)}}function rs(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function is(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function ls(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function as(e,t){var n=fn(e);if(arguments.length<2){var o=this.node();return n.local?o.getAttributeNS(n.space,n.local):o.getAttribute(n)}return this.each((t==null?n.local?ns:ts:typeof t=="function"?n.local?ls:is:n.local?rs:os)(n,t))}function kr(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function ss(e){return function(){this.style.removeProperty(e)}}function us(e,t,n){return function(){this.style.setProperty(e,t,n)}}function cs(e,t,n){return function(){var o=t.apply(this,arguments);o==null?this.style.removeProperty(e):this.style.setProperty(e,o,n)}}function ds(e,t,n){return arguments.length>1?this.each((t==null?ss:typeof t=="function"?cs:us)(e,t,n??"")):kt(this.node(),e)}function kt(e,t){return e.style.getPropertyValue(t)||kr(e).getComputedStyle(e,null).getPropertyValue(t)}function fs(e){return function(){delete this[e]}}function hs(e,t){return function(){this[e]=t}}function gs(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function ps(e,t){return arguments.length>1?this.each((t==null?fs:typeof t=="function"?gs:hs)(e,t)):this.node()[e]}function Cr(e){return e.trim().split(/^|\s+/)}function io(e){return e.classList||new $r(e)}function $r(e){this._node=e,this._names=Cr(e.getAttribute("class")||"")}$r.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function Ir(e,t){for(var n=io(e),o=-1,r=t.length;++o<r;)n.add(t[o])}function Mr(e,t){for(var n=io(e),o=-1,r=t.length;++o<r;)n.remove(t[o])}function vs(e){return function(){Ir(this,e)}}function ms(e){return function(){Mr(this,e)}}function _s(e,t){return function(){(t.apply(this,arguments)?Ir:Mr)(this,e)}}function ys(e,t){var n=Cr(e+"");if(arguments.length<2){for(var o=io(this.node()),r=-1,i=n.length;++r<i;)if(!o.contains(n[r]))return!1;return!0}return this.each((typeof t=="function"?_s:t?vs:ms)(n,t))}function ws(){this.textContent=""}function bs(e){return function(){this.textContent=e}}function xs(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function Es(e){return arguments.length?this.each(e==null?ws:(typeof e=="function"?xs:bs)(e)):this.node().textContent}function Ns(){this.innerHTML=""}function Ss(e){return function(){this.innerHTML=e}}function ks(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function Cs(e){return arguments.length?this.each(e==null?Ns:(typeof e=="function"?ks:Ss)(e)):this.node().innerHTML}function $s(){this.nextSibling&&this.parentNode.appendChild(this)}function Is(){return this.each($s)}function Ms(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Os(){return this.each(Ms)}function Ds(e){var t=typeof e=="function"?e:br(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function Ts(){return null}function Ps(e,t){var n=typeof e=="function"?e:br(e),o=t==null?Ts:typeof t=="function"?t:ro(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),o.apply(this,arguments)||null)})}function As(){var e=this.parentNode;e&&e.removeChild(this)}function zs(){return this.each(As)}function Rs(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Bs(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Vs(e){return this.select(e?Bs:Rs)}function Ls(e){return arguments.length?this.property("__data__",e):this.node().__data__}function Hs(e){return function(t){e.call(this,t,this.__data__)}}function Fs(e){return e.trim().split(/^|\s+/).map(function(t){var n="",o=t.indexOf(".");return o>=0&&(n=t.slice(o+1),t=t.slice(0,o)),{type:t,name:n}})}function Ys(e){return function(){var t=this.__on;if(t){for(var n=0,o=-1,r=t.length,i;n<r;++n)i=t[n],(!e.type||i.type===e.type)&&i.name===e.name?this.removeEventListener(i.type,i.listener,i.options):t[++o]=i;++o?t.length=o:delete this.__on}}}function Gs(e,t,n){return function(){var o=this.__on,r,i=Hs(t);if(o){for(var l=0,a=o.length;l<a;++l)if((r=o[l]).type===e.type&&r.name===e.name){this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=i,r.options=n),r.value=t;return}}this.addEventListener(e.type,i,n),r={type:e.type,name:e.name,value:t,listener:i,options:n},o?o.push(r):this.__on=[r]}}function Xs(e,t,n){var o=Fs(e+""),r,i=o.length,l;if(arguments.length<2){var a=this.node().__on;if(a){for(var u=0,s=a.length,c;u<s;++u)for(r=0,c=a[u];r<i;++r)if((l=o[r]).type===c.type&&l.name===c.name)return c.value}return}for(a=t?Gs:Ys,r=0;r<i;++r)this.each(a(o[r],t,n));return this}function Or(e,t,n){var o=kr(e),r=o.CustomEvent;typeof r=="function"?r=new r(t,n):(r=o.document.createEvent("Event"),n?(r.initEvent(t,n.bubbles,n.cancelable),r.detail=n.detail):r.initEvent(t,!1,!1)),e.dispatchEvent(r)}function js(e,t){return function(){return Or(this,e,t)}}function Us(e,t){return function(){return Or(this,e,t.apply(this,arguments))}}function Ws(e,t){return this.each((typeof t=="function"?Us:js)(e,t))}function*Zs(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var o=e[t],r=0,i=o.length,l;r<i;++r)(l=o[r])&&(yield l)}var Dr=[null];function ze(e,t){this._groups=e,this._parents=t}function Vt(){return new ze([[document.documentElement]],Dr)}function Ks(){return this}ze.prototype=Vt.prototype={constructor:ze,select:xa,selectAll:ka,selectChild:Ma,selectChildren:Pa,filter:Aa,data:Ha,enter:za,exit:Ya,join:Ga,merge:Xa,selection:Ks,order:ja,sort:Ua,call:Za,nodes:Ka,node:qa,size:Ja,empty:Qa,each:es,attr:as,style:ds,property:ps,classed:ys,text:Es,html:Cs,raise:Is,lower:Os,append:Ds,insert:Ps,remove:zs,clone:Vs,datum:Ls,on:Xs,dispatch:Ws,[Symbol.iterator]:Zs};function Le(e){return typeof e=="string"?new ze([[document.querySelector(e)]],[document.documentElement]):new ze([[e]],Dr)}function qs(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Ye(e,t){if(e=qs(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var o=n.createSVGPoint();return o.x=e.clientX,o.y=e.clientY,o=o.matrixTransform(t.getScreenCTM().inverse()),[o.x,o.y]}if(t.getBoundingClientRect){var r=t.getBoundingClientRect();return[e.clientX-r.left-t.clientLeft,e.clientY-r.top-t.clientTop]}}return[e.pageX,e.pageY]}const Js={passive:!1},Lt={capture:!0,passive:!1};function lo(e){e.stopImmediatePropagation()}function Ct(e){e.preventDefault(),e.stopImmediatePropagation()}function Tr(e){var t=e.document.documentElement,n=Le(e).on("dragstart.drag",Ct,Lt);"onselectstart"in t?n.on("selectstart.drag",Ct,Lt):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function Pr(e,t){var n=e.document.documentElement,o=Le(e).on("dragstart.drag",null);t&&(o.on("click.drag",Ct,Lt),setTimeout(function(){o.on("click.drag",null)},0)),"onselectstart"in n?o.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const gn=e=>()=>e;function ao(e,{sourceEvent:t,subject:n,target:o,identifier:r,active:i,x:l,y:a,dx:u,dy:s,dispatch:c}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:o,enumerable:!0,configurable:!0},identifier:{value:r,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:l,enumerable:!0,configurable:!0},y:{value:a,enumerable:!0,configurable:!0},dx:{value:u,enumerable:!0,configurable:!0},dy:{value:s,enumerable:!0,configurable:!0},_:{value:c}})}ao.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function Qs(e){return!e.ctrlKey&&!e.button}function eu(){return this.parentNode}function tu(e,t){return t??{x:e.x,y:e.y}}function nu(){return navigator.maxTouchPoints||"ontouchstart"in this}function ou(){var e=Qs,t=eu,n=tu,o=nu,r={},i=cn("start","drag","end"),l=0,a,u,s,c,d=0;function f(C){C.on("mousedown.drag",h).filter(o).on("touchstart.drag",g).on("touchmove.drag",_,Js).on("touchend.drag touchcancel.drag",S).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function h(C,z){if(!(c||!e.call(this,C,z))){var V=p(this,t.call(this,C,z),C,z,"mouse");V&&(Le(C.view).on("mousemove.drag",m,Lt).on("mouseup.drag",y,Lt),Tr(C.view),lo(C),s=!1,a=C.clientX,u=C.clientY,V("start",C))}}function m(C){if(Ct(C),!s){var z=C.clientX-a,V=C.clientY-u;s=z*z+V*V>d}r.mouse("drag",C)}function y(C){Le(C.view).on("mousemove.drag mouseup.drag",null),Pr(C.view,s),Ct(C),r.mouse("end",C)}function g(C,z){if(e.call(this,C,z)){var V=C.changedTouches,L=t.call(this,C,z),B=V.length,U,X;for(U=0;U<B;++U)(X=p(this,L,C,z,V[U].identifier,V[U]))&&(lo(C),X("start",C,V[U]))}}function _(C){var z=C.changedTouches,V=z.length,L,B;for(L=0;L<V;++L)(B=r[z[L].identifier])&&(Ct(C),B("drag",C,z[L]))}function S(C){var z=C.changedTouches,V=z.length,L,B;for(c&&clearTimeout(c),c=setTimeout(function(){c=null},500),L=0;L<V;++L)(B=r[z[L].identifier])&&(lo(C),B("end",C,z[L]))}function p(C,z,V,L,B,U){var X=i.copy(),A=Ye(U||V,z),w,P,b;if((b=n.call(C,new ao("beforestart",{sourceEvent:V,target:f,identifier:B,active:l,x:A[0],y:A[1],dx:0,dy:0,dispatch:X}),L))!=null)return w=b.x-A[0]||0,P=b.y-A[1]||0,function N(E,O,T){var R=A,H;switch(E){case"start":r[B]=N,H=l++;break;case"end":delete r[B],--l;case"drag":A=Ye(T||O,z),H=l;break}X.call(E,C,new ao(E,{sourceEvent:O,subject:b,target:f,identifier:B,active:H,x:A[0]+w,y:A[1]+P,dx:A[0]-R[0],dy:A[1]-R[1],dispatch:X}),L)}}return f.filter=function(C){return arguments.length?(e=typeof C=="function"?C:gn(!!C),f):e},f.container=function(C){return arguments.length?(t=typeof C=="function"?C:gn(C),f):t},f.subject=function(C){return arguments.length?(n=typeof C=="function"?C:gn(C),f):n},f.touchable=function(C){return arguments.length?(o=typeof C=="function"?C:gn(!!C),f):o},f.on=function(){var C=i.on.apply(i,arguments);return C===i?f:C},f.clickDistance=function(C){return arguments.length?(d=(C=+C)*C,f):Math.sqrt(d)},f}function so(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Ar(e,t){var n=Object.create(e.prototype);for(var o in t)n[o]=t[o];return n}function Ht(){}var Ft=.7,pn=1/Ft,$t="\\s*([+-]?\\d+)\\s*",Yt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ge="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",ru=/^#([0-9a-f]{3,8})$/,iu=new RegExp(`^rgb\\(${$t},${$t},${$t}\\)$`),lu=new RegExp(`^rgb\\(${Ge},${Ge},${Ge}\\)$`),au=new RegExp(`^rgba\\(${$t},${$t},${$t},${Yt}\\)$`),su=new RegExp(`^rgba\\(${Ge},${Ge},${Ge},${Yt}\\)$`),uu=new RegExp(`^hsl\\(${Yt},${Ge},${Ge}\\)$`),cu=new RegExp(`^hsla\\(${Yt},${Ge},${Ge},${Yt}\\)$`),zr={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};so(Ht,vt,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Rr,formatHex:Rr,formatHex8:du,formatHsl:fu,formatRgb:Br,toString:Br});function Rr(){return this.rgb().formatHex()}function du(){return this.rgb().formatHex8()}function fu(){return Yr(this).formatHsl()}function Br(){return this.rgb().formatRgb()}function vt(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=ru.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?Vr(t):n===3?new Pe(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?vn(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?vn(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=iu.exec(e))?new Pe(t[1],t[2],t[3],1):(t=lu.exec(e))?new Pe(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=au.exec(e))?vn(t[1],t[2],t[3],t[4]):(t=su.exec(e))?vn(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=uu.exec(e))?Fr(t[1],t[2]/100,t[3]/100,1):(t=cu.exec(e))?Fr(t[1],t[2]/100,t[3]/100,t[4]):zr.hasOwnProperty(e)?Vr(zr[e]):e==="transparent"?new Pe(NaN,NaN,NaN,0):null}function Vr(e){return new Pe(e>>16&255,e>>8&255,e&255,1)}function vn(e,t,n,o){return o<=0&&(e=t=n=NaN),new Pe(e,t,n,o)}function hu(e){return e instanceof Ht||(e=vt(e)),e?(e=e.rgb(),new Pe(e.r,e.g,e.b,e.opacity)):new Pe}function uo(e,t,n,o){return arguments.length===1?hu(e):new Pe(e,t,n,o??1)}function Pe(e,t,n,o){this.r=+e,this.g=+t,this.b=+n,this.opacity=+o}so(Pe,uo,Ar(Ht,{brighter(e){return e=e==null?pn:Math.pow(pn,e),new Pe(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Ft:Math.pow(Ft,e),new Pe(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Pe(mt(this.r),mt(this.g),mt(this.b),mn(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Lr,formatHex:Lr,formatHex8:gu,formatRgb:Hr,toString:Hr}));function Lr(){return`#${_t(this.r)}${_t(this.g)}${_t(this.b)}`}function gu(){return`#${_t(this.r)}${_t(this.g)}${_t(this.b)}${_t((isNaN(this.opacity)?1:this.opacity)*255)}`}function Hr(){const e=mn(this.opacity);return`${e===1?"rgb(":"rgba("}${mt(this.r)}, ${mt(this.g)}, ${mt(this.b)}${e===1?")":`, ${e})`}`}function mn(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function mt(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function _t(e){return e=mt(e),(e<16?"0":"")+e.toString(16)}function Fr(e,t,n,o){return o<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new He(e,t,n,o)}function Yr(e){if(e instanceof He)return new He(e.h,e.s,e.l,e.opacity);if(e instanceof Ht||(e=vt(e)),!e)return new He;if(e instanceof He)return e;e=e.rgb();var t=e.r/255,n=e.g/255,o=e.b/255,r=Math.min(t,n,o),i=Math.max(t,n,o),l=NaN,a=i-r,u=(i+r)/2;return a?(t===i?l=(n-o)/a+(n<o)*6:n===i?l=(o-t)/a+2:l=(t-n)/a+4,a/=u<.5?i+r:2-i-r,l*=60):a=u>0&&u<1?0:l,new He(l,a,u,e.opacity)}function pu(e,t,n,o){return arguments.length===1?Yr(e):new He(e,t,n,o??1)}function He(e,t,n,o){this.h=+e,this.s=+t,this.l=+n,this.opacity=+o}so(He,pu,Ar(Ht,{brighter(e){return e=e==null?pn:Math.pow(pn,e),new He(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Ft:Math.pow(Ft,e),new He(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,o=n+(n<.5?n:1-n)*t,r=2*n-o;return new Pe(co(e>=240?e-240:e+120,r,o),co(e,r,o),co(e<120?e+240:e-120,r,o),this.opacity)},clamp(){return new He(Gr(this.h),_n(this.s),_n(this.l),mn(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=mn(this.opacity);return`${e===1?"hsl(":"hsla("}${Gr(this.h)}, ${_n(this.s)*100}%, ${_n(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Gr(e){return e=(e||0)%360,e<0?e+360:e}function _n(e){return Math.max(0,Math.min(1,e||0))}function co(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const fo=e=>()=>e;function vu(e,t){return function(n){return e+n*t}}function mu(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(o){return Math.pow(e+o*t,n)}}function _u(e){return(e=+e)==1?Xr:function(t,n){return n-t?mu(t,n,e):fo(isNaN(t)?n:t)}}function Xr(e,t){var n=t-e;return n?vu(e,n):fo(isNaN(e)?t:e)}const yn=(function e(t){var n=_u(t);function o(r,i){var l=n((r=uo(r)).r,(i=uo(i)).r),a=n(r.g,i.g),u=n(r.b,i.b),s=Xr(r.opacity,i.opacity);return function(c){return r.r=l(c),r.g=a(c),r.b=u(c),r.opacity=s(c),r+""}}return o.gamma=e,o})(1);function yu(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,o=t.slice(),r;return function(i){for(r=0;r<n;++r)o[r]=e[r]*(1-i)+t[r]*i;return o}}function wu(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function bu(e,t){var n=t?t.length:0,o=e?Math.min(n,e.length):0,r=new Array(o),i=new Array(n),l;for(l=0;l<o;++l)r[l]=Gt(e[l],t[l]);for(;l<n;++l)i[l]=t[l];return function(a){for(l=0;l<o;++l)i[l]=r[l](a);return i}}function xu(e,t){var n=new Date;return e=+e,t=+t,function(o){return n.setTime(e*(1-o)+t*o),n}}function Xe(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function Eu(e,t){var n={},o={},r;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(r in t)r in e?n[r]=Gt(e[r],t[r]):o[r]=t[r];return function(i){for(r in n)o[r]=n[r](i);return o}}var ho=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,go=new RegExp(ho.source,"g");function Nu(e){return function(){return e}}function Su(e){return function(t){return e(t)+""}}function jr(e,t){var n=ho.lastIndex=go.lastIndex=0,o,r,i,l=-1,a=[],u=[];for(e=e+"",t=t+"";(o=ho.exec(e))&&(r=go.exec(t));)(i=r.index)>n&&(i=t.slice(n,i),a[l]?a[l]+=i:a[++l]=i),(o=o[0])===(r=r[0])?a[l]?a[l]+=r:a[++l]=r:(a[++l]=null,u.push({i:l,x:Xe(o,r)})),n=go.lastIndex;return n<t.length&&(i=t.slice(n),a[l]?a[l]+=i:a[++l]=i),a.length<2?u[0]?Su(u[0].x):Nu(t):(t=u.length,function(s){for(var c=0,d;c<t;++c)a[(d=u[c]).i]=d.x(s);return a.join("")})}function Gt(e,t){var n=typeof t,o;return t==null||n==="boolean"?fo(t):(n==="number"?Xe:n==="string"?(o=vt(t))?(t=o,yn):jr:t instanceof vt?yn:t instanceof Date?xu:wu(t)?yu:Array.isArray(t)?bu:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?Eu:Xe)(e,t)}var Ur=180/Math.PI,po={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Wr(e,t,n,o,r,i){var l,a,u;return(l=Math.sqrt(e*e+t*t))&&(e/=l,t/=l),(u=e*n+t*o)&&(n-=e*u,o-=t*u),(a=Math.sqrt(n*n+o*o))&&(n/=a,o/=a,u/=a),e*o<t*n&&(e=-e,t=-t,u=-u,l=-l),{translateX:r,translateY:i,rotate:Math.atan2(t,e)*Ur,skewX:Math.atan(u)*Ur,scaleX:l,scaleY:a}}var wn;function ku(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?po:Wr(t.a,t.b,t.c,t.d,t.e,t.f)}function Cu(e){return e==null||(wn||(wn=document.createElementNS("http://www.w3.org/2000/svg","g")),wn.setAttribute("transform",e),!(e=wn.transform.baseVal.consolidate()))?po:(e=e.matrix,Wr(e.a,e.b,e.c,e.d,e.e,e.f))}function Zr(e,t,n,o){function r(s){return s.length?s.pop()+" ":""}function i(s,c,d,f,h,m){if(s!==d||c!==f){var y=h.push("translate(",null,t,null,n);m.push({i:y-4,x:Xe(s,d)},{i:y-2,x:Xe(c,f)})}else(d||f)&&h.push("translate("+d+t+f+n)}function l(s,c,d,f){s!==c?(s-c>180?c+=360:c-s>180&&(s+=360),f.push({i:d.push(r(d)+"rotate(",null,o)-2,x:Xe(s,c)})):c&&d.push(r(d)+"rotate("+c+o)}function a(s,c,d,f){s!==c?f.push({i:d.push(r(d)+"skewX(",null,o)-2,x:Xe(s,c)}):c&&d.push(r(d)+"skewX("+c+o)}function u(s,c,d,f,h,m){if(s!==d||c!==f){var y=h.push(r(h)+"scale(",null,",",null,")");m.push({i:y-4,x:Xe(s,d)},{i:y-2,x:Xe(c,f)})}else(d!==1||f!==1)&&h.push(r(h)+"scale("+d+","+f+")")}return function(s,c){var d=[],f=[];return s=e(s),c=e(c),i(s.translateX,s.translateY,c.translateX,c.translateY,d,f),l(s.rotate,c.rotate,d,f),a(s.skewX,c.skewX,d,f),u(s.scaleX,s.scaleY,c.scaleX,c.scaleY,d,f),s=c=null,function(h){for(var m=-1,y=f.length,g;++m<y;)d[(g=f[m]).i]=g.x(h);return d.join("")}}}var $u=Zr(ku,"px, ","px)","deg)"),Iu=Zr(Cu,", ",")",")"),Mu=1e-12;function Kr(e){return((e=Math.exp(e))+1/e)/2}function Ou(e){return((e=Math.exp(e))-1/e)/2}function Du(e){return((e=Math.exp(2*e))-1)/(e+1)}const bn=(function e(t,n,o){function r(i,l){var a=i[0],u=i[1],s=i[2],c=l[0],d=l[1],f=l[2],h=c-a,m=d-u,y=h*h+m*m,g,_;if(y<Mu)_=Math.log(f/s)/t,g=function(L){return[a+L*h,u+L*m,s*Math.exp(t*L*_)]};else{var S=Math.sqrt(y),p=(f*f-s*s+o*y)/(2*s*n*S),C=(f*f-s*s-o*y)/(2*f*n*S),z=Math.log(Math.sqrt(p*p+1)-p),V=Math.log(Math.sqrt(C*C+1)-C);_=(V-z)/t,g=function(L){var B=L*_,U=Kr(z),X=s/(n*S)*(U*Du(t*B+z)-Ou(z));return[a+X*h,u+X*m,s*U/Kr(t*B+z)]}}return g.duration=_*1e3*t/Math.SQRT2,g}return r.rho=function(i){var l=Math.max(.001,+i),a=l*l,u=a*a;return e(l,a,u)},r})(Math.SQRT2,2,4);var It=0,Xt=0,jt=0,qr=1e3,xn,Ut,En=0,yt=0,Nn=0,Wt=typeof performance=="object"&&performance.now?performance:Date,Jr=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function vo(){return yt||(Jr(Tu),yt=Wt.now()+Nn)}function Tu(){yt=0}function Sn(){this._call=this._time=this._next=null}Sn.prototype=Qr.prototype={constructor:Sn,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?vo():+n)+(t==null?0:+t),!this._next&&Ut!==this&&(Ut?Ut._next=this:xn=this,Ut=this),this._call=e,this._time=n,mo()},stop:function(){this._call&&(this._call=null,this._time=1/0,mo())}};function Qr(e,t,n){var o=new Sn;return o.restart(e,t,n),o}function Pu(){vo(),++It;for(var e=xn,t;e;)(t=yt-e._time)>=0&&e._call.call(void 0,t),e=e._next;--It}function ei(){yt=(En=Wt.now())+Nn,It=Xt=0;try{Pu()}finally{It=0,zu(),yt=0}}function Au(){var e=Wt.now(),t=e-En;t>qr&&(Nn-=t,En=e)}function zu(){for(var e,t=xn,n,o=1/0;t;)t._call?(o>t._time&&(o=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:xn=n);Ut=e,mo(o)}function mo(e){if(!It){Xt&&(Xt=clearTimeout(Xt));var t=e-yt;t>24?(e<1/0&&(Xt=setTimeout(ei,e-Wt.now()-Nn)),jt&&(jt=clearInterval(jt))):(jt||(En=Wt.now(),jt=setInterval(Au,qr)),It=1,Jr(ei))}}function ti(e,t,n){var o=new Sn;return t=t==null?0:+t,o.restart(r=>{o.stop(),e(r+t)},t,n),o}var Ru=cn("start","end","cancel","interrupt"),Bu=[],ni=0,oi=1,_o=2,kn=3,ri=4,yo=5,Cn=6;function $n(e,t,n,o,r,i){var l=e.__transition;if(!l)e.__transition={};else if(n in l)return;Vu(e,n,{name:t,index:o,group:r,on:Ru,tween:Bu,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:ni})}function wo(e,t){var n=Fe(e,t);if(n.state>ni)throw new Error("too late; already scheduled");return n}function je(e,t){var n=Fe(e,t);if(n.state>kn)throw new Error("too late; already running");return n}function Fe(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function Vu(e,t,n){var o=e.__transition,r;o[t]=n,n.timer=Qr(i,0,n.time);function i(s){n.state=oi,n.timer.restart(l,n.delay,n.time),n.delay<=s&&l(s-n.delay)}function l(s){var c,d,f,h;if(n.state!==oi)return u();for(c in o)if(h=o[c],h.name===n.name){if(h.state===kn)return ti(l);h.state===ri?(h.state=Cn,h.timer.stop(),h.on.call("interrupt",e,e.__data__,h.index,h.group),delete o[c]):+c<t&&(h.state=Cn,h.timer.stop(),h.on.call("cancel",e,e.__data__,h.index,h.group),delete o[c])}if(ti(function(){n.state===kn&&(n.state=ri,n.timer.restart(a,n.delay,n.time),a(s))}),n.state=_o,n.on.call("start",e,e.__data__,n.index,n.group),n.state===_o){for(n.state=kn,r=new Array(f=n.tween.length),c=0,d=-1;c<f;++c)(h=n.tween[c].value.call(e,e.__data__,n.index,n.group))&&(r[++d]=h);r.length=d+1}}function a(s){for(var c=s<n.duration?n.ease.call(null,s/n.duration):(n.timer.restart(u),n.state=yo,1),d=-1,f=r.length;++d<f;)r[d].call(e,c);n.state===yo&&(n.on.call("end",e,e.__data__,n.index,n.group),u())}function u(){n.state=Cn,n.timer.stop(),delete o[t];for(var s in o)return;delete e.__transition}}function In(e,t){var n=e.__transition,o,r,i=!0,l;if(n){t=t==null?null:t+"";for(l in n){if((o=n[l]).name!==t){i=!1;continue}r=o.state>_o&&o.state<yo,o.state=Cn,o.timer.stop(),o.on.call(r?"interrupt":"cancel",e,e.__data__,o.index,o.group),delete n[l]}i&&delete e.__transition}}function Lu(e){return this.each(function(){In(this,e)})}function Hu(e,t){var n,o;return function(){var r=je(this,e),i=r.tween;if(i!==n){o=n=i;for(var l=0,a=o.length;l<a;++l)if(o[l].name===t){o=o.slice(),o.splice(l,1);break}}r.tween=o}}function Fu(e,t,n){var o,r;if(typeof n!="function")throw new Error;return function(){var i=je(this,e),l=i.tween;if(l!==o){r=(o=l).slice();for(var a={name:t,value:n},u=0,s=r.length;u<s;++u)if(r[u].name===t){r[u]=a;break}u===s&&r.push(a)}i.tween=r}}function Yu(e,t){var n=this._id;if(e+="",arguments.length<2){for(var o=Fe(this.node(),n).tween,r=0,i=o.length,l;r<i;++r)if((l=o[r]).name===e)return l.value;return null}return this.each((t==null?Hu:Fu)(n,e,t))}function bo(e,t,n){var o=e._id;return e.each(function(){var r=je(this,o);(r.value||(r.value={}))[t]=n.apply(this,arguments)}),function(r){return Fe(r,o).value[t]}}function ii(e,t){var n;return(typeof t=="number"?Xe:t instanceof vt?yn:(n=vt(t))?(t=n,yn):jr)(e,t)}function Gu(e){return function(){this.removeAttribute(e)}}function Xu(e){return function(){this.removeAttributeNS(e.space,e.local)}}function ju(e,t,n){var o,r=n+"",i;return function(){var l=this.getAttribute(e);return l===r?null:l===o?i:i=t(o=l,n)}}function Uu(e,t,n){var o,r=n+"",i;return function(){var l=this.getAttributeNS(e.space,e.local);return l===r?null:l===o?i:i=t(o=l,n)}}function Wu(e,t,n){var o,r,i;return function(){var l,a=n(this),u;return a==null?void this.removeAttribute(e):(l=this.getAttribute(e),u=a+"",l===u?null:l===o&&u===r?i:(r=u,i=t(o=l,a)))}}function Zu(e,t,n){var o,r,i;return function(){var l,a=n(this),u;return a==null?void this.removeAttributeNS(e.space,e.local):(l=this.getAttributeNS(e.space,e.local),u=a+"",l===u?null:l===o&&u===r?i:(r=u,i=t(o=l,a)))}}function Ku(e,t){var n=fn(e),o=n==="transform"?Iu:ii;return this.attrTween(e,typeof t=="function"?(n.local?Zu:Wu)(n,o,bo(this,"attr."+e,t)):t==null?(n.local?Xu:Gu)(n):(n.local?Uu:ju)(n,o,t))}function qu(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function Ju(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function Qu(e,t){var n,o;function r(){var i=t.apply(this,arguments);return i!==o&&(n=(o=i)&&Ju(e,i)),n}return r._value=t,r}function ec(e,t){var n,o;function r(){var i=t.apply(this,arguments);return i!==o&&(n=(o=i)&&qu(e,i)),n}return r._value=t,r}function tc(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var o=fn(e);return this.tween(n,(o.local?Qu:ec)(o,t))}function nc(e,t){return function(){wo(this,e).delay=+t.apply(this,arguments)}}function oc(e,t){return t=+t,function(){wo(this,e).delay=t}}function rc(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?nc:oc)(t,e)):Fe(this.node(),t).delay}function ic(e,t){return function(){je(this,e).duration=+t.apply(this,arguments)}}function lc(e,t){return t=+t,function(){je(this,e).duration=t}}function ac(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?ic:lc)(t,e)):Fe(this.node(),t).duration}function sc(e,t){if(typeof t!="function")throw new Error;return function(){je(this,e).ease=t}}function uc(e){var t=this._id;return arguments.length?this.each(sc(t,e)):Fe(this.node(),t).ease}function cc(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;je(this,e).ease=n}}function dc(e){if(typeof e!="function")throw new Error;return this.each(cc(this._id,e))}function fc(e){typeof e!="function"&&(e=Er(e));for(var t=this._groups,n=t.length,o=new Array(n),r=0;r<n;++r)for(var i=t[r],l=i.length,a=o[r]=[],u,s=0;s<l;++s)(u=i[s])&&e.call(u,u.__data__,s,i)&&a.push(u);return new Qe(o,this._parents,this._name,this._id)}function hc(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,o=t.length,r=n.length,i=Math.min(o,r),l=new Array(o),a=0;a<i;++a)for(var u=t[a],s=n[a],c=u.length,d=l[a]=new Array(c),f,h=0;h<c;++h)(f=u[h]||s[h])&&(d[h]=f);for(;a<o;++a)l[a]=t[a];return new Qe(l,this._parents,this._name,this._id)}function gc(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function pc(e,t,n){var o,r,i=gc(t)?wo:je;return function(){var l=i(this,e),a=l.on;a!==o&&(r=(o=a).copy()).on(t,n),l.on=r}}function vc(e,t){var n=this._id;return arguments.length<2?Fe(this.node(),n).on.on(e):this.each(pc(n,e,t))}function mc(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function _c(){return this.on("end.remove",mc(this._id))}function yc(e){var t=this._name,n=this._id;typeof e!="function"&&(e=ro(e));for(var o=this._groups,r=o.length,i=new Array(r),l=0;l<r;++l)for(var a=o[l],u=a.length,s=i[l]=new Array(u),c,d,f=0;f<u;++f)(c=a[f])&&(d=e.call(c,c.__data__,f,a))&&("__data__"in c&&(d.__data__=c.__data__),s[f]=d,$n(s[f],t,n,f,s,Fe(c,n)));return new Qe(i,this._parents,t,n)}function wc(e){var t=this._name,n=this._id;typeof e!="function"&&(e=xr(e));for(var o=this._groups,r=o.length,i=[],l=[],a=0;a<r;++a)for(var u=o[a],s=u.length,c,d=0;d<s;++d)if(c=u[d]){for(var f=e.call(c,c.__data__,d,u),h,m=Fe(c,n),y=0,g=f.length;y<g;++y)(h=f[y])&&$n(h,t,n,y,f,m);i.push(f),l.push(c)}return new Qe(i,l,t,n)}var bc=Vt.prototype.constructor;function xc(){return new bc(this._groups,this._parents)}function Ec(e,t){var n,o,r;return function(){var i=kt(this,e),l=(this.style.removeProperty(e),kt(this,e));return i===l?null:i===n&&l===o?r:r=t(n=i,o=l)}}function li(e){return function(){this.style.removeProperty(e)}}function Nc(e,t,n){var o,r=n+"",i;return function(){var l=kt(this,e);return l===r?null:l===o?i:i=t(o=l,n)}}function Sc(e,t,n){var o,r,i;return function(){var l=kt(this,e),a=n(this),u=a+"";return a==null&&(u=a=(this.style.removeProperty(e),kt(this,e))),l===u?null:l===o&&u===r?i:(r=u,i=t(o=l,a))}}function kc(e,t){var n,o,r,i="style."+t,l="end."+i,a;return function(){var u=je(this,e),s=u.on,c=u.value[i]==null?a||(a=li(t)):void 0;(s!==n||r!==c)&&(o=(n=s).copy()).on(l,r=c),u.on=o}}function Cc(e,t,n){var o=(e+="")=="transform"?$u:ii;return t==null?this.styleTween(e,Ec(e,o)).on("end.style."+e,li(e)):typeof t=="function"?this.styleTween(e,Sc(e,o,bo(this,"style."+e,t))).each(kc(this._id,e)):this.styleTween(e,Nc(e,o,t),n).on("end.style."+e,null)}function $c(e,t,n){return function(o){this.style.setProperty(e,t.call(this,o),n)}}function Ic(e,t,n){var o,r;function i(){var l=t.apply(this,arguments);return l!==r&&(o=(r=l)&&$c(e,l,n)),o}return i._value=t,i}function Mc(e,t,n){var o="style."+(e+="");if(arguments.length<2)return(o=this.tween(o))&&o._value;if(t==null)return this.tween(o,null);if(typeof t!="function")throw new Error;return this.tween(o,Ic(e,t,n??""))}function Oc(e){return function(){this.textContent=e}}function Dc(e){return function(){var t=e(this);this.textContent=t??""}}function Tc(e){return this.tween("text",typeof e=="function"?Dc(bo(this,"text",e)):Oc(e==null?"":e+""))}function Pc(e){return function(t){this.textContent=e.call(this,t)}}function Ac(e){var t,n;function o(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&Pc(r)),t}return o._value=e,o}function zc(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,Ac(e))}function Rc(){for(var e=this._name,t=this._id,n=ai(),o=this._groups,r=o.length,i=0;i<r;++i)for(var l=o[i],a=l.length,u,s=0;s<a;++s)if(u=l[s]){var c=Fe(u,t);$n(u,e,n,s,l,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new Qe(o,this._parents,e,n)}function Bc(){var e,t,n=this,o=n._id,r=n.size();return new Promise(function(i,l){var a={value:l},u={value:function(){--r===0&&i()}};n.each(function(){var s=je(this,o),c=s.on;c!==e&&(t=(e=c).copy(),t._.cancel.push(a),t._.interrupt.push(a),t._.end.push(u)),s.on=t}),r===0&&i()})}var Vc=0;function Qe(e,t,n,o){this._groups=e,this._parents=t,this._name=n,this._id=o}function ai(){return++Vc}var et=Vt.prototype;Qe.prototype={constructor:Qe,select:yc,selectAll:wc,selectChild:et.selectChild,selectChildren:et.selectChildren,filter:fc,merge:hc,selection:xc,transition:Rc,call:et.call,nodes:et.nodes,node:et.node,size:et.size,empty:et.empty,each:et.each,on:vc,attr:Ku,attrTween:tc,style:Cc,styleTween:Mc,text:Tc,textTween:zc,remove:_c,tween:Yu,delay:rc,duration:ac,ease:uc,easeVarying:dc,end:Bc,[Symbol.iterator]:et[Symbol.iterator]};function Lc(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var Hc={time:null,delay:0,duration:250,ease:Lc};function Fc(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function Yc(e){var t,n;e instanceof Qe?(t=e._id,e=e._name):(t=ai(),(n=Hc).time=vo(),e=e==null?null:e+"");for(var o=this._groups,r=o.length,i=0;i<r;++i)for(var l=o[i],a=l.length,u,s=0;s<a;++s)(u=l[s])&&$n(u,e,t,s,l,n||Fc(u,t));return new Qe(o,this._parents,e,t)}Vt.prototype.interrupt=Lu,Vt.prototype.transition=Yc;const Mn=e=>()=>e;function Gc(e,{sourceEvent:t,target:n,transform:o,dispatch:r}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:o,enumerable:!0,configurable:!0},_:{value:r}})}function tt(e,t,n){this.k=e,this.x=t,this.y=n}tt.prototype={constructor:tt,scale:function(e){return e===1?this:new tt(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new tt(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Mt=new tt(1,0,0);tt.prototype;function xo(e){e.stopImmediatePropagation()}function Zt(e){e.preventDefault(),e.stopImmediatePropagation()}function Xc(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function jc(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function si(){return this.__zoom||Mt}function Uc(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function Wc(){return navigator.maxTouchPoints||"ontouchstart"in this}function Zc(e,t,n){var o=e.invertX(t[0][0])-n[0][0],r=e.invertX(t[1][0])-n[1][0],i=e.invertY(t[0][1])-n[0][1],l=e.invertY(t[1][1])-n[1][1];return e.translate(r>o?(o+r)/2:Math.min(0,o)||Math.max(0,r),l>i?(i+l)/2:Math.min(0,i)||Math.max(0,l))}function Kc(){var e=Xc,t=jc,n=Zc,o=Uc,r=Wc,i=[0,1/0],l=[[-1/0,-1/0],[1/0,1/0]],a=250,u=bn,s=cn("start","zoom","end"),c,d,f,h=500,m=150,y=0,g=10;function _(b){b.property("__zoom",si).on("wheel.zoom",B,{passive:!1}).on("mousedown.zoom",U).on("dblclick.zoom",X).filter(r).on("touchstart.zoom",A).on("touchmove.zoom",w).on("touchend.zoom touchcancel.zoom",P).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}_.transform=function(b,N,E,O){var T=b.selection?b.selection():b;T.property("__zoom",si),b!==T?z(b,N,E,O):T.interrupt().each(function(){V(this,arguments).event(O).start().zoom(null,typeof N=="function"?N.apply(this,arguments):N).end()})},_.scaleBy=function(b,N,E,O){_.scaleTo(b,function(){var T=this.__zoom.k,R=typeof N=="function"?N.apply(this,arguments):N;return T*R},E,O)},_.scaleTo=function(b,N,E,O){_.transform(b,function(){var T=t.apply(this,arguments),R=this.__zoom,H=E==null?C(T):typeof E=="function"?E.apply(this,arguments):E,Y=R.invert(H),j=typeof N=="function"?N.apply(this,arguments):N;return n(p(S(R,j),H,Y),T,l)},E,O)},_.translateBy=function(b,N,E,O){_.transform(b,function(){return n(this.__zoom.translate(typeof N=="function"?N.apply(this,arguments):N,typeof E=="function"?E.apply(this,arguments):E),t.apply(this,arguments),l)},null,O)},_.translateTo=function(b,N,E,O,T){_.transform(b,function(){var R=t.apply(this,arguments),H=this.__zoom,Y=O==null?C(R):typeof O=="function"?O.apply(this,arguments):O;return n(Mt.translate(Y[0],Y[1]).scale(H.k).translate(typeof N=="function"?-N.apply(this,arguments):-N,typeof E=="function"?-E.apply(this,arguments):-E),R,l)},O,T)};function S(b,N){return N=Math.max(i[0],Math.min(i[1],N)),N===b.k?b:new tt(N,b.x,b.y)}function p(b,N,E){var O=N[0]-E[0]*b.k,T=N[1]-E[1]*b.k;return O===b.x&&T===b.y?b:new tt(b.k,O,T)}function C(b){return[(+b[0][0]+ +b[1][0])/2,(+b[0][1]+ +b[1][1])/2]}function z(b,N,E,O){b.on("start.zoom",function(){V(this,arguments).event(O).start()}).on("interrupt.zoom end.zoom",function(){V(this,arguments).event(O).end()}).tween("zoom",function(){var T=this,R=arguments,H=V(T,R).event(O),Y=t.apply(T,R),j=E==null?C(Y):typeof E=="function"?E.apply(T,R):E,Q=Math.max(Y[1][0]-Y[0][0],Y[1][1]-Y[0][1]),fe=T.__zoom,M=typeof N=="function"?N.apply(T,R):N,D=u(fe.invert(j).concat(Q/fe.k),M.invert(j).concat(Q/M.k));return function(G){if(G===1)G=M;else{var F=D(G),oe=Q/F[2];G=new tt(oe,j[0]-F[0]*oe,j[1]-F[1]*oe)}H.zoom(null,G)}})}function V(b,N,E){return!E&&b.__zooming||new L(b,N)}function L(b,N){this.that=b,this.args=N,this.active=0,this.sourceEvent=null,this.extent=t.apply(b,N),this.taps=0}L.prototype={event:function(b){return b&&(this.sourceEvent=b),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(b,N){return this.mouse&&b!=="mouse"&&(this.mouse[1]=N.invert(this.mouse[0])),this.touch0&&b!=="touch"&&(this.touch0[1]=N.invert(this.touch0[0])),this.touch1&&b!=="touch"&&(this.touch1[1]=N.invert(this.touch1[0])),this.that.__zoom=N,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(b){var N=Le(this.that).datum();s.call(b,this.that,new Gc(b,{sourceEvent:this.sourceEvent,target:_,transform:this.that.__zoom,dispatch:s}),N)}};function B(b,...N){if(!e.apply(this,arguments))return;var E=V(this,N).event(b),O=this.__zoom,T=Math.max(i[0],Math.min(i[1],O.k*Math.pow(2,o.apply(this,arguments)))),R=Ye(b);if(E.wheel)(E.mouse[0][0]!==R[0]||E.mouse[0][1]!==R[1])&&(E.mouse[1]=O.invert(E.mouse[0]=R)),clearTimeout(E.wheel);else{if(O.k===T)return;E.mouse=[R,O.invert(R)],In(this),E.start()}Zt(b),E.wheel=setTimeout(H,m),E.zoom("mouse",n(p(S(O,T),E.mouse[0],E.mouse[1]),E.extent,l));function H(){E.wheel=null,E.end()}}function U(b,...N){if(f||!e.apply(this,arguments))return;var E=b.currentTarget,O=V(this,N,!0).event(b),T=Le(b.view).on("mousemove.zoom",j,!0).on("mouseup.zoom",Q,!0),R=Ye(b,E),H=b.clientX,Y=b.clientY;Tr(b.view),xo(b),O.mouse=[R,this.__zoom.invert(R)],In(this),O.start();function j(fe){if(Zt(fe),!O.moved){var M=fe.clientX-H,D=fe.clientY-Y;O.moved=M*M+D*D>y}O.event(fe).zoom("mouse",n(p(O.that.__zoom,O.mouse[0]=Ye(fe,E),O.mouse[1]),O.extent,l))}function Q(fe){T.on("mousemove.zoom mouseup.zoom",null),Pr(fe.view,O.moved),Zt(fe),O.event(fe).end()}}function X(b,...N){if(e.apply(this,arguments)){var E=this.__zoom,O=Ye(b.changedTouches?b.changedTouches[0]:b,this),T=E.invert(O),R=E.k*(b.shiftKey?.5:2),H=n(p(S(E,R),O,T),t.apply(this,N),l);Zt(b),a>0?Le(this).transition().duration(a).call(z,H,O,b):Le(this).call(_.transform,H,O,b)}}function A(b,...N){if(e.apply(this,arguments)){var E=b.touches,O=E.length,T=V(this,N,b.changedTouches.length===O).event(b),R,H,Y,j;for(xo(b),H=0;H<O;++H)Y=E[H],j=Ye(Y,this),j=[j,this.__zoom.invert(j),Y.identifier],T.touch0?!T.touch1&&T.touch0[2]!==j[2]&&(T.touch1=j,T.taps=0):(T.touch0=j,R=!0,T.taps=1+!!c);c&&(c=clearTimeout(c)),R&&(T.taps<2&&(d=j[0],c=setTimeout(function(){c=null},h)),In(this),T.start())}}function w(b,...N){if(this.__zooming){var E=V(this,N).event(b),O=b.changedTouches,T=O.length,R,H,Y,j;for(Zt(b),R=0;R<T;++R)H=O[R],Y=Ye(H,this),E.touch0&&E.touch0[2]===H.identifier?E.touch0[0]=Y:E.touch1&&E.touch1[2]===H.identifier&&(E.touch1[0]=Y);if(H=E.that.__zoom,E.touch1){var Q=E.touch0[0],fe=E.touch0[1],M=E.touch1[0],D=E.touch1[1],G=(G=M[0]-Q[0])*G+(G=M[1]-Q[1])*G,F=(F=D[0]-fe[0])*F+(F=D[1]-fe[1])*F;H=S(H,Math.sqrt(G/F)),Y=[(Q[0]+M[0])/2,(Q[1]+M[1])/2],j=[(fe[0]+D[0])/2,(fe[1]+D[1])/2]}else if(E.touch0)Y=E.touch0[0],j=E.touch0[1];else return;E.zoom("touch",n(p(H,Y,j),E.extent,l))}}function P(b,...N){if(this.__zooming){var E=V(this,N).event(b),O=b.changedTouches,T=O.length,R,H;for(xo(b),f&&clearTimeout(f),f=setTimeout(function(){f=null},h),R=0;R<T;++R)H=O[R],E.touch0&&E.touch0[2]===H.identifier?delete E.touch0:E.touch1&&E.touch1[2]===H.identifier&&delete E.touch1;if(E.touch1&&!E.touch0&&(E.touch0=E.touch1,delete E.touch1),E.touch0)E.touch0[1]=this.__zoom.invert(E.touch0[0]);else if(E.end(),E.taps===2&&(H=Ye(H,this),Math.hypot(d[0]-H[0],d[1]-H[1])<g)){var Y=Le(this).on("dblclick.zoom");Y&&Y.apply(this,arguments)}}}return _.wheelDelta=function(b){return arguments.length?(o=typeof b=="function"?b:Mn(+b),_):o},_.filter=function(b){return arguments.length?(e=typeof b=="function"?b:Mn(!!b),_):e},_.touchable=function(b){return arguments.length?(r=typeof b=="function"?b:Mn(!!b),_):r},_.extent=function(b){return arguments.length?(t=typeof b=="function"?b:Mn([[+b[0][0],+b[0][1]],[+b[1][0],+b[1][1]]]),_):t},_.scaleExtent=function(b){return arguments.length?(i[0]=+b[0],i[1]=+b[1],_):[i[0],i[1]]},_.translateExtent=function(b){return arguments.length?(l[0][0]=+b[0][0],l[1][0]=+b[1][0],l[0][1]=+b[0][1],l[1][1]=+b[1][1],_):[[l[0][0],l[0][1]],[l[1][0],l[1][1]]]},_.constrain=function(b){return arguments.length?(n=b,_):n},_.duration=function(b){return arguments.length?(a=+b,_):a},_.interpolate=function(b){return arguments.length?(u=b,_):u},_.on=function(){var b=s.on.apply(s,arguments);return b===s?_:b},_.clickDistance=function(b){return arguments.length?(y=(b=+b)*b,_):Math.sqrt(y)},_.tapDistance=function(b){return arguments.length?(g=+b,_):g},_}var J=(e=>(e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom",e))(J||{}),Eo=(e=>(e.Partial="partial",e.Full="full",e))(Eo||{}),wt=(e=>(e.Bezier="default",e.SimpleBezier="simple-bezier",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e))(wt||{}),it=(e=>(e.Strict="strict",e.Loose="loose",e))(it||{}),No=(e=>(e.Arrow="arrow",e.ArrowClosed="arrowclosed",e))(No||{}),Kt=(e=>(e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal",e))(Kt||{}),ui=(e=>(e.TopLeft="top-left",e.TopCenter="top-center",e.TopRight="top-right",e.BottomLeft="bottom-left",e.BottomCenter="bottom-center",e.BottomRight="bottom-right",e))(ui||{});const qc=["INPUT","SELECT","TEXTAREA"],Jc=typeof document<"u"?document:null;function So(e){var t,n;const o=((n=(t=e.composedPath)==null?void 0:t.call(e))==null?void 0:n[0])||e.target,r=typeof o?.hasAttribute=="function"?o.hasAttribute("contenteditable"):!1,i=typeof o?.closest=="function"?o.closest(".nokey"):null;return qc.includes(o?.nodeName)||r||!!i}function Qc(e){return e.ctrlKey||e.metaKey||e.shiftKey||e.altKey}function ci(e,t,n,o){const r=t.replace("+",`
3
+ `).replace(`
4
+
5
+ `,`
6
+ +`).split(`
7
+ `).map(l=>l.trim().toLowerCase());if(r.length===1)return e.toLowerCase()===t.toLowerCase();o||n.add(e.toLowerCase());const i=r.every((l,a)=>n.has(l)&&Array.from(n.values())[a]===r[a]);return o&&n.delete(e.toLowerCase()),i}function ed(e,t){return n=>{if(!n.code&&!n.key)return!1;const o=td(n.code,e);return Array.isArray(e)?e.some(r=>ci(n[o],r,t,n.type==="keyup")):ci(n[o],e,t,n.type==="keyup")}}function td(e,t){return t.includes(e)?"code":"key"}function qt(e,t){const n=he(()=>pe(t?.target)??Jc),o=qe(pe(e)===!0);let r=!1;const i=new Set;let l=u(pe(e));_e(()=>pe(e),(s,c)=>{typeof c=="boolean"&&typeof s!="boolean"&&a(),l=u(s)},{immediate:!0}),mr(["blur","contextmenu"],a),_r((...s)=>l(...s),s=>{var c,d;const f=pe(t?.actInsideInputWithModifier)??!0,h=pe(t?.preventDefault)??!1;if(r=Qc(s),(!r||r&&!f)&&So(s))return;const y=((d=(c=s.composedPath)==null?void 0:c.call(s))==null?void 0:d[0])||s.target,g=y?.nodeName==="BUTTON"||y?.nodeName==="A";!h&&(r||!g)&&s.preventDefault(),o.value=!0},{eventName:"keydown",target:n}),_r((...s)=>l(...s),s=>{const c=pe(t?.actInsideInputWithModifier)??!0;if(o.value){if((!r||r&&!c)&&So(s))return;r=!1,o.value=!1}},{eventName:"keyup",target:n});function a(){r=!1,i.clear(),o.value=pe(e)===!0}function u(s){return s===null?(a(),()=>!1):typeof s=="boolean"?(a(),o.value=s,()=>!1):Array.isArray(s)||typeof s=="string"?ed(s,i):s}return o}const di="vue-flow__node-desc",fi="vue-flow__edge-desc",nd="vue-flow__aria-live",hi=["Enter"," ","Escape"],Ot={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};function On(e){return{...e.computedPosition||{x:0,y:0},width:e.dimensions.width||0,height:e.dimensions.height||0}}function Dn(e,t){const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),o=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*o)}function Tn(e){return{width:e.offsetWidth,height:e.offsetHeight}}function bt(e,t=0,n=1){return Math.min(Math.max(e,t),n)}function gi(e,t){return{x:bt(e.x,t[0][0],t[1][0]),y:bt(e.y,t[0][1],t[1][1])}}function pi(e){const t=e.getRootNode();return"elementFromPoint"in t?t:window.document}function lt(e){return e&&typeof e=="object"&&"id"in e&&"source"in e&&"target"in e}function xt(e){return e&&typeof e=="object"&&"id"in e&&"position"in e&&!lt(e)}function Jt(e){return xt(e)&&"computedPosition"in e}function Pn(e){return!Number.isNaN(e)&&Number.isFinite(e)}function od(e){return Pn(e.width)&&Pn(e.height)&&Pn(e.x)&&Pn(e.y)}function rd(e,t,n){const o={id:e.id.toString(),type:e.type??"default",dimensions:Rt({width:0,height:0}),computedPosition:Rt({z:0,...e.position}),handleBounds:{source:[],target:[]},draggable:void 0,selectable:void 0,connectable:void 0,focusable:void 0,selected:!1,dragging:!1,resizing:!1,initialized:!1,isParent:!1,position:{x:0,y:0},data:$e(e.data)?e.data:{},events:Rt($e(e.events)?e.events:{})};return Object.assign(t??o,e,{id:e.id.toString(),parentNode:n})}function vi(e,t,n){var o,r;const i={id:e.id.toString(),type:e.type??t?.type??"default",source:e.source.toString(),target:e.target.toString(),sourceHandle:(o=e.sourceHandle)==null?void 0:o.toString(),targetHandle:(r=e.targetHandle)==null?void 0:r.toString(),updatable:e.updatable??n?.updatable,selectable:e.selectable??n?.selectable,focusable:e.focusable??n?.focusable,data:$e(e.data)?e.data:{},events:Rt($e(e.events)?e.events:{}),label:e.label??"",interactionWidth:e.interactionWidth??n?.interactionWidth,...n??{}};return Object.assign(t??i,e,{id:e.id.toString()})}function mi(e,t,n,o){const r=typeof e=="string"?e:e.id,i=new Set,l=o==="source"?"target":"source";for(const a of n)a[l]===r&&i.add(a[o]);return t.filter(a=>i.has(a.id))}function id(...e){if(e.length===3){const[i,l,a]=e;return mi(i,l,a,"target")}const[t,n]=e,o=typeof t=="string"?t:t.id;return n.filter(i=>lt(i)&&i.source===o).map(i=>n.find(l=>xt(l)&&l.id===i.target))}function ld(...e){if(e.length===3){const[i,l,a]=e;return mi(i,l,a,"source")}const[t,n]=e,o=typeof t=="string"?t:t.id;return n.filter(i=>lt(i)&&i.target===o).map(i=>n.find(l=>xt(l)&&l.id===i.source))}function _i({source:e,sourceHandle:t,target:n,targetHandle:o}){return`vueflow__edge-${e}${t??""}-${n}${o??""}`}function ad(e,t){return t.some(n=>lt(n)&&n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle))}function Qt({x:e,y:t},{x:n,y:o,zoom:r}){return{x:e*r+n,y:t*r+o}}function en({x:e,y:t},{x:n,y:o,zoom:r},i=!1,l=[1,1]){const a={x:(e-n)/r,y:(t-o)/r};return i?zn(a,l):a}function sd(e,t){return{x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}}function yi({x:e,y:t,width:n,height:o}){return{x:e,y:t,x2:e+n,y2:t+o}}function ud({x:e,y:t,x2:n,y2:o}){return{x:e,y:t,width:n-e,height:o-t}}function wi(e){let t={x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY,x2:Number.NEGATIVE_INFINITY,y2:Number.NEGATIVE_INFINITY};for(let n=0;n<e.length;n++){const o=e[n];t=sd(t,yi({...o.computedPosition,...o.dimensions}))}return ud(t)}function bi(e,t,n={x:0,y:0,zoom:1},o=!1,r=!1){const i={...en(t,n),width:t.width/n.zoom,height:t.height/n.zoom},l=[];for(const a of e){const{dimensions:u,selectable:s=!0,hidden:c=!1}=a,d=u.width??a.width??null,f=u.height??a.height??null;if(r&&!s||c)continue;const h=Dn(i,On(a)),m=d===null||f===null,y=o&&h>0,g=(d??0)*(f??0);(m||y||h>=g||a.dragging)&&l.push(a)}return l}function xi(e,t){const n=new Set;if(typeof e=="string")n.add(e);else if(e.length>=1)for(const o of e)n.add(o.id);return t.filter(o=>n.has(o.source)||n.has(o.target))}function Dt(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const n=Number.parseFloat(e);if(!Number.isNaN(n))return Math.floor(n)}if(typeof e=="string"&&e.endsWith("%")){const n=Number.parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return nn(`The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function cd(e,t,n){if(typeof e=="string"||typeof e=="number"){const o=Dt(e,n),r=Dt(e,t);return{top:o,right:r,bottom:o,left:r,x:r*2,y:o*2}}if(typeof e=="object"){const o=Dt(e.top??e.y??0,n),r=Dt(e.bottom??e.y??0,n),i=Dt(e.left??e.x??0,t),l=Dt(e.right??e.x??0,t);return{top:o,right:l,bottom:r,left:i,x:i+l,y:o+r}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function dd(e,t,n,o,r,i){const{x:l,y:a}=Qt(e,{x:t,y:n,zoom:o}),{x:u,y:s}=Qt({x:e.x+e.width,y:e.y+e.height},{x:t,y:n,zoom:o}),c=r-u,d=i-s;return{left:Math.floor(l),top:Math.floor(a),right:Math.floor(c),bottom:Math.floor(d)}}function Ei(e,t,n,o,r,i=.1){const l=cd(i,t,n),a=(t-l.x)/e.width,u=(n-l.y)/e.height,s=Math.min(a,u),c=bt(s,o,r),d=e.x+e.width/2,f=e.y+e.height/2,h=t/2-d*c,m=n/2-f*c,y=dd(e,h,m,c,t,n),g={left:Math.min(y.left-l.left,0),top:Math.min(y.top-l.top,0),right:Math.min(y.right-l.right,0),bottom:Math.min(y.bottom-l.bottom,0)};return{x:h-g.left+g.right,y:m-g.top+g.bottom,zoom:c}}function fd(e,t){return{x:t.x+e.x,y:t.y+e.y,z:(e.z>t.z?e.z:t.z)+1}}function Ni(e,t){if(!e.parentNode)return!1;const n=t.get(e.parentNode);return n?n.selected?!0:Ni(n,t):!1}function tn(e,t){return typeof e>"u"?"":typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(o=>`${o}=${e[o]}`).join("&")}`}function Si(e){const t=e.ctrlKey&&An()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t}function ki(e,t,n){return e<t?bt(Math.abs(e-t),1,t)/t:e>n?-bt(Math.abs(e-n),1,t)/t:0}function Ci(e,t,n=15,o=40){const r=ki(e.x,o,t.width-o)*n,i=ki(e.y,o,t.height-o)*n;return[r,i]}function ko(e,t){if(t){const n=e.position.x+e.dimensions.width-t.dimensions.width,o=e.position.y+e.dimensions.height-t.dimensions.height;if(n>0||o>0||e.position.x<0||e.position.y<0){let r={};if(typeof t.style=="function"?r={...t.style(t)}:t.style&&(r={...t.style}),r.width=r.width??`${t.dimensions.width}px`,r.height=r.height??`${t.dimensions.height}px`,n>0)if(typeof r.width=="string"){const i=Number(r.width.replace("px",""));r.width=`${i+n}px`}else r.width+=n;if(o>0)if(typeof r.height=="string"){const i=Number(r.height.replace("px",""));r.height=`${i+o}px`}else r.height+=o;if(e.position.x<0){const i=Math.abs(e.position.x);if(t.position.x=t.position.x-i,typeof r.width=="string"){const l=Number(r.width.replace("px",""));r.width=`${l+i}px`}else r.width+=i;e.position.x=0}if(e.position.y<0){const i=Math.abs(e.position.y);if(t.position.y=t.position.y-i,typeof r.height=="string"){const l=Number(r.height.replace("px",""));r.height=`${l+i}px`}else r.height+=i;e.position.y=0}t.dimensions.width=Number(r.width.toString().replace("px","")),t.dimensions.height=Number(r.height.toString().replace("px","")),typeof t.style=="function"?t.style=i=>{const l=t.style;return{...l(i),...r}}:t.style={...t.style,...r}}}}function $i(e,t){var n,o;const r=e.filter(l=>l.type==="add"||l.type==="remove");for(const l of r)if(l.type==="add")t.findIndex(u=>u.id===l.item.id)===-1&&t.push(l.item);else if(l.type==="remove"){const a=t.findIndex(u=>u.id===l.id);a!==-1&&t.splice(a,1)}const i=t.map(l=>l.id);for(const l of t)for(const a of e)if(a.id===l.id)switch(a.type){case"select":l.selected=a.selected;break;case"position":if(Jt(l)&&(typeof a.position<"u"&&(l.position=a.position),typeof a.dragging<"u"&&(l.dragging=a.dragging),l.expandParent&&l.parentNode)){const u=t[i.indexOf(l.parentNode)];u&&Jt(u)&&ko(l,u)}break;case"dimensions":if(Jt(l)&&(typeof a.dimensions<"u"&&(l.dimensions=a.dimensions),typeof a.updateStyle<"u"&&a.updateStyle&&(l.style={...l.style||{},width:`${(n=a.dimensions)==null?void 0:n.width}px`,height:`${(o=a.dimensions)==null?void 0:o.height}px`}),typeof a.resizing<"u"&&(l.resizing=a.resizing),l.expandParent&&l.parentNode)){const u=t[i.indexOf(l.parentNode)];u&&Jt(u)&&(!!u.dimensions.width&&!!u.dimensions.height?ko(l,u):Ae(()=>{ko(l,u)}))}break}return t}function at(e,t){return{id:e,type:"select",selected:t}}function Ii(e){return{item:e,type:"add"}}function Mi(e){return{id:e,type:"remove"}}function Oi(e,t,n,o,r){return{id:e,source:t,target:n,sourceHandle:o||null,targetHandle:r||null,type:"remove"}}function st(e,t=new Set,n=!1){const o=[];for(const[r,i]of e){const l=t.has(r);!(i.selected===void 0&&!l)&&i.selected!==l&&(n&&(i.selected=l),o.push(at(i.id,l)))}return o}const Di=()=>{};function W(e){const t=new Set;let n=Di,o=()=>!1;const r=()=>t.size>0||o(),i=f=>{n=f},l=()=>{n=Di},a=f=>{o=f},u=()=>{o=()=>!1},s=f=>{t.delete(f)};return{on:f=>{t.add(f);const h=()=>s(f);return Bt(h),{off:h}},off:s,trigger:f=>{const h=[n];return r()?h.push(...t):e&&h.push(e),Promise.allSettled(h.map(m=>m(f)))},hasListeners:r,listeners:t,setEmitter:i,removeEmitter:l,setHasEmitListeners:a,removeHasEmitListeners:u}}function Ti(e,t,n){let o=e;do{if(o&&o.matches(t))return!0;if(o===n)return!1;o=o.parentElement}while(o);return!1}function hd(e,t,n,o){var r,i;const l=new Map;for(const[a,u]of e)(u.selected||u.id===o)&&(!u.parentNode||!Ni(u,e))&&(u.draggable||t&&typeof u.draggable>"u")&&e.get(a)&&l.set(a,{id:u.id,position:u.position||{x:0,y:0},distance:{x:n.x-((r=u.computedPosition)==null?void 0:r.x)||0,y:n.y-((i=u.computedPosition)==null?void 0:i.y)||0},from:{x:u.computedPosition.x,y:u.computedPosition.y},extent:u.extent,parentNode:u.parentNode,dimensions:{...u.dimensions},expandParent:u.expandParent});return Array.from(l.values())}function Co({id:e,dragItems:t,findNode:n}){const o=[];for(const r of t){const i=n(r.id);i&&o.push(i)}return[e?o.find(r=>r.id===e):o[0],o]}function Pi(e){if(Array.isArray(e))switch(e.length){case 1:return[e[0],e[0],e[0],e[0]];case 2:return[e[0],e[1],e[0],e[1]];case 3:return[e[0],e[1],e[2],e[1]];case 4:return e;default:return[0,0,0,0]}return[e,e,e,e]}function gd(e,t,n){const[o,r,i,l]=typeof e!="string"?Pi(e.padding):[0,0,0,0];return n&&typeof n.computedPosition.x<"u"&&typeof n.computedPosition.y<"u"&&typeof n.dimensions.width<"u"&&typeof n.dimensions.height<"u"?[[n.computedPosition.x+l,n.computedPosition.y+o],[n.computedPosition.x+n.dimensions.width-r,n.computedPosition.y+n.dimensions.height-i]]:!1}function pd(e,t,n,o){let r=e.extent||n;if((r==="parent"||!Array.isArray(r)&&r?.range==="parent")&&!e.expandParent)if(e.parentNode&&o&&e.dimensions.width&&e.dimensions.height){const i=gd(r,e,o);i&&(r=i)}else t(new Oe(Ce.NODE_EXTENT_INVALID,e.id)),r=n;else if(Array.isArray(r)){const i=o?.computedPosition.x||0,l=o?.computedPosition.y||0;r=[[r[0][0]+i,r[0][1]+l],[r[1][0]+i,r[1][1]+l]]}else if(r!=="parent"&&r?.range&&Array.isArray(r.range)){const[i,l,a,u]=Pi(r.padding),s=o?.computedPosition.x||0,c=o?.computedPosition.y||0;r=[[r.range[0][0]+s+u,r.range[0][1]+c+i],[r.range[1][0]+s-l,r.range[1][1]+c-a]]}return r==="parent"?[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]]:r}function vd({width:e,height:t},n){return[n[0],[n[1][0]-(e||0),n[1][1]-(t||0)]]}function $o(e,t,n,o,r){const i=vd(e.dimensions,pd(e,n,o,r)),l=gi(t,i);return{position:{x:l.x-(r?.computedPosition.x||0),y:l.y-(r?.computedPosition.y||0)},computedPosition:l}}function Tt(e,t,n=J.Left,o=!1){const r=(t?.x??0)+e.computedPosition.x,i=(t?.y??0)+e.computedPosition.y,{width:l,height:a}=t??wd(e);if(o)return{x:r+l/2,y:i+a/2};switch(t?.position??n){case J.Top:return{x:r+l/2,y:i};case J.Right:return{x:r+l,y:i+a/2};case J.Bottom:return{x:r+l/2,y:i+a};case J.Left:return{x:r,y:i+a/2}}}function Ai(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function md({sourcePos:e,targetPos:t,sourceWidth:n,sourceHeight:o,targetWidth:r,targetHeight:i,width:l,height:a,viewport:u}){const s={x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x+n,t.x+r),y2:Math.max(e.y+o,t.y+i)};s.x===s.x2&&(s.x2+=1),s.y===s.y2&&(s.y2+=1);const c=yi({x:(0-u.x)/u.zoom,y:(0-u.y)/u.zoom,width:l/u.zoom,height:a/u.zoom}),d=Math.max(0,Math.min(c.x2,s.x2)-Math.max(c.x,s.x)),f=Math.max(0,Math.min(c.y2,s.y2)-Math.max(c.y,s.y));return Math.ceil(d*f)>0}function _d(e,t,n=!1){const o=typeof e.zIndex=="number";let r=o?e.zIndex:0;const i=t(e.source),l=t(e.target);return!i||!l?0:(n&&(r=o?e.zIndex:Math.max(i.computedPosition.z||0,l.computedPosition.z||0)),r)}var Ce=(e=>(e.MISSING_STYLES="MISSING_STYLES",e.MISSING_VIEWPORT_DIMENSIONS="MISSING_VIEWPORT_DIMENSIONS",e.NODE_INVALID="NODE_INVALID",e.NODE_NOT_FOUND="NODE_NOT_FOUND",e.NODE_MISSING_PARENT="NODE_MISSING_PARENT",e.NODE_TYPE_MISSING="NODE_TYPE_MISSING",e.NODE_EXTENT_INVALID="NODE_EXTENT_INVALID",e.EDGE_INVALID="EDGE_INVALID",e.EDGE_NOT_FOUND="EDGE_NOT_FOUND",e.EDGE_SOURCE_MISSING="EDGE_SOURCE_MISSING",e.EDGE_TARGET_MISSING="EDGE_TARGET_MISSING",e.EDGE_TYPE_MISSING="EDGE_TYPE_MISSING",e.EDGE_SOURCE_TARGET_SAME="EDGE_SOURCE_TARGET_SAME",e.EDGE_SOURCE_TARGET_MISSING="EDGE_SOURCE_TARGET_MISSING",e.EDGE_ORPHANED="EDGE_ORPHANED",e.USEVUEFLOW_OPTIONS="USEVUEFLOW_OPTIONS",e))(Ce||{});const zi={MISSING_STYLES:()=>"It seems that you haven't loaded the necessary styles. Please import '@vue-flow/core/dist/style.css' to ensure that the graph is rendered correctly",MISSING_VIEWPORT_DIMENSIONS:()=>"The Vue Flow parent container needs a width and a height to render the graph",NODE_INVALID:e=>`Node is invalid
8
+ Node: ${e}`,NODE_NOT_FOUND:e=>`Node not found
9
+ Node: ${e}`,NODE_MISSING_PARENT:(e,t)=>`Node is missing a parent
10
+ Node: ${e}
11
+ Parent: ${t}`,NODE_TYPE_MISSING:e=>`Node type is missing
12
+ Type: ${e}`,NODE_EXTENT_INVALID:e=>`Only child nodes can use a parent extent
13
+ Node: ${e}`,EDGE_INVALID:e=>`An edge needs a source and a target
14
+ Edge: ${e}`,EDGE_SOURCE_MISSING:(e,t)=>`Edge source is missing
15
+ Edge: ${e}
16
+ Source: ${t}`,EDGE_TARGET_MISSING:(e,t)=>`Edge target is missing
17
+ Edge: ${e}
18
+ Target: ${t}`,EDGE_TYPE_MISSING:e=>`Edge type is missing
19
+ Type: ${e}`,EDGE_SOURCE_TARGET_SAME:(e,t,n)=>`Edge source and target are the same
20
+ Edge: ${e}
21
+ Source: ${t}
22
+ Target: ${n}`,EDGE_SOURCE_TARGET_MISSING:(e,t,n)=>`Edge source or target is missing
23
+ Edge: ${e}
24
+ Source: ${t}
25
+ Target: ${n}`,EDGE_ORPHANED:e=>`Edge was orphaned (suddenly missing source or target) and has been removed
26
+ Edge: ${e}`,EDGE_NOT_FOUND:e=>`Edge not found
27
+ Edge: ${e}`,USEVUEFLOW_OPTIONS:()=>"The options parameter is deprecated and will be removed in the next major version. Please use the id parameter instead"};class Oe extends Error{constructor(t,...n){var o;super((o=zi[t])==null?void 0:o.call(zi,...n)),this.name="VueFlowError",this.code=t,this.args=n}}function Io(e){return"clientX"in e}function yd(e){return"sourceEvent"in e}function Ue(e,t){const n=Io(e);let o,r;return n?(o=e.clientX,r=e.clientY):"touches"in e&&e.touches.length>0?(o=e.touches[0].clientX,r=e.touches[0].clientY):"changedTouches"in e&&e.changedTouches.length>0?(o=e.changedTouches[0].clientX,r=e.changedTouches[0].clientY):(o=0,r=0),{x:o-(t?.left??0),y:r-(t?.top??0)}}const An=()=>{var e;return typeof navigator<"u"&&((e=navigator?.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function wd(e){var t,n;return{width:((t=e.dimensions)==null?void 0:t.width)??e.width??0,height:((n=e.dimensions)==null?void 0:n.height)??e.height??0}}function zn(e,t=[1,1]){return{x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}}const bd=()=>!0;function Mo(e){e?.classList.remove("valid","connecting","vue-flow__handle-valid","vue-flow__handle-connecting")}function xd(e,t,n){const o=[],r={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const i of t.values())Dn(r,On(i))>0&&o.push(i);return o}const Ed=250;function Nd(e,t,n,o){var r,i;let l=[],a=Number.POSITIVE_INFINITY;const u=xd(e,n,t+Ed);for(const s of u){const c=[...((r=s.handleBounds)==null?void 0:r.source)??[],...((i=s.handleBounds)==null?void 0:i.target)??[]];for(const d of c){if(o.nodeId===d.nodeId&&o.type===d.type&&o.id===d.id)continue;const{x:f,y:h}=Tt(s,d,d.position,!0),m=Math.sqrt((f-e.x)**2+(h-e.y)**2);m>t||(m<a?(l=[{...d,x:f,y:h}],a=m):m===a&&l.push({...d,x:f,y:h}))}}if(!l.length)return null;if(l.length>1){const s=o.type==="source"?"target":"source";return l.find(c=>c.type===s)??l[0]}return l[0]}function Ri(e,{handle:t,connectionMode:n,fromNodeId:o,fromHandleId:r,fromType:i,doc:l,lib:a,flowId:u,isValidConnection:s=bd},c,d,f,h){const m=i==="target",y=t?l.querySelector(`.${a}-flow__handle[data-id="${u}-${t?.nodeId}-${t?.id}-${t?.type}"]`):null,{x:g,y:_}=Ue(e),S=l.elementFromPoint(g,_),p=S?.classList.contains(`${a}-flow__handle`)?S:y,C={handleDomNode:p,isValid:!1,connection:null,toHandle:null};if(p){const z=Bi(void 0,p),V=p.getAttribute("data-nodeid"),L=p.getAttribute("data-handleid"),B=p.classList.contains("connectable"),U=p.classList.contains("connectableend");if(!V||!z)return C;const X={source:m?V:o,sourceHandle:m?L:r,target:m?o:V,targetHandle:m?r:L};C.connection=X;const w=B&&U&&(n===it.Strict?m&&z==="source"||!m&&z==="target":V!==o||L!==r);C.isValid=w&&s(X,{nodes:d,edges:c,sourceNode:f(X.source),targetNode:f(X.target)}),C.toHandle=Vi(V,z,L,h,n,!0)}return C}function Bi(e,t){return e||(t?.classList.contains("target")?"target":t?.classList.contains("source")?"source":null)}function Sd(e,t){let n=null;return t?n="valid":e&&!t&&(n="invalid"),n}function kd(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}function Vi(e,t,n,o,r,i=!1){var l,a,u;const s=o.get(e);if(!s)return null;const c=r===it.Strict?(l=s.handleBounds)==null?void 0:l[t]:[...((a=s.handleBounds)==null?void 0:a.source)??[],...((u=s.handleBounds)==null?void 0:u.target)??[]],d=(n?c?.find(f=>f.id===n):c?.[0])??null;return d&&i?{...d,...Tt(s,d,d.position,!0)}:d}const Oo={[J.Left]:J.Right,[J.Right]:J.Left,[J.Top]:J.Bottom,[J.Bottom]:J.Top},Cd=["production","prod"];function nn(e,...t){Li()&&console.warn(`[Vue Flow]: ${e}`,...t)}function Li(){return!Cd.includes("production")}function Hi(e,t,n,o,r){const i=t.querySelectorAll(`.vue-flow__handle.${e}`);return i?.length?Array.from(i).map(l=>{const a=l.getBoundingClientRect();return{id:l.getAttribute("data-handleid"),type:e,nodeId:r,position:l.getAttribute("data-handlepos"),x:(a.left-n.left)/o,y:(a.top-n.top)/o,...Tn(l)}}):null}function Do(e,t,n,o,r,i=!1,l){r.value=!1,e.selected?(i||e.selected&&t)&&(o([e]),Ae(()=>{l.blur()})):n([e])}function $e(e){return typeof q(e)<"u"}function $d(e,t,n,o){if(!e||!e.source||!e.target)return n(new Oe(Ce.EDGE_INVALID,e?.id??"[ID UNKNOWN]")),!1;let r;return lt(e)?r=e:r={...e,id:_i(e)},r=vi(r,void 0,o),ad(r,t)?!1:r}function Id(e,t,n,o,r){if(!t.source||!t.target)return r(new Oe(Ce.EDGE_INVALID,e.id)),!1;if(!n)return r(new Oe(Ce.EDGE_NOT_FOUND,e.id)),!1;const{id:i,...l}=e;return{...l,id:o?_i(t):i,source:t.source,target:t.target,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle}}function Fi(e,t,n){const o={},r=[];for(let i=0;i<e.length;++i){const l=e[i];if(!xt(l)){n(new Oe(Ce.NODE_INVALID,l?.id)||`[ID UNKNOWN|INDEX ${i}]`);continue}const a=rd(l,t(l.id),l.parentNode);l.parentNode&&(o[l.parentNode]=!0),r[i]=a}for(const i of r){const l=t(i.parentNode)||r.find(a=>a.id===i.parentNode);i.parentNode&&!l&&n(new Oe(Ce.NODE_MISSING_PARENT,i.id,i.parentNode)),(i.parentNode||o[i.id])&&(o[i.id]&&(i.isParent=!0),l&&(l.isParent=!0))}return r}function Yi(e,t,n,o,r,i){let l=r;const a=o.get(l)||new Map;o.set(l,a.set(n,t)),l=`${r}-${e}`;const u=o.get(l)||new Map;if(o.set(l,u.set(n,t)),i){l=`${r}-${e}-${i}`;const s=o.get(l)||new Map;o.set(l,s.set(n,t))}}function To(e,t,n){e.clear();for(const o of n){const{source:r,target:i,sourceHandle:l=null,targetHandle:a=null}=o,u={edgeId:o.id,source:r,target:i,sourceHandle:l,targetHandle:a},s=`${r}-${l}--${i}-${a}`,c=`${i}-${a}--${r}-${l}`;Yi("source",u,c,e,r,l),Yi("target",u,s,e,i,a)}}function Gi(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function Po(e,t,n,o,r,i,l,a){const u=[];for(const s of e){const c=lt(s)?s:$d(s,a,r,i);if(!c)continue;const d=n(c.source),f=n(c.target);if(!d||!f){r(new Oe(Ce.EDGE_SOURCE_TARGET_MISSING,c.id,c.source,c.target));continue}if(!d){r(new Oe(Ce.EDGE_SOURCE_MISSING,c.id,c.source));continue}if(!f){r(new Oe(Ce.EDGE_TARGET_MISSING,c.id,c.target));continue}if(t&&!t(c,{edges:a,nodes:l,sourceNode:d,targetNode:f})){r(new Oe(Ce.EDGE_INVALID,c.id));continue}const h=o(c.id);u.push({...vi(c,h,i),sourceNode:d,targetNode:f})}return u}const Xi=Symbol("vueFlow"),ji=Symbol("nodeId"),Ui=Symbol("nodeRef"),Md=Symbol("edgeId"),Od=Symbol("edgeRef"),Rn=Symbol("slots");function Wi(e){const{vueFlowRef:t,snapToGrid:n,snapGrid:o,noDragClassName:r,nodeLookup:i,nodeExtent:l,nodeDragThreshold:a,viewport:u,autoPanOnNodeDrag:s,autoPanSpeed:c,nodesDraggable:d,panBy:f,findNode:h,multiSelectionActive:m,nodesSelectionActive:y,selectNodesOnDrag:g,removeSelectedElements:_,addSelectedNodes:S,updateNodePositions:p,emits:C}=Ee(),{onStart:z,onDrag:V,onStop:L,onClick:B,el:U,disabled:X,id:A,selectable:w,dragHandle:P}=e,b=qe(!1);let N=[],E,O=null,T={x:void 0,y:void 0},R={x:0,y:0},H=null,Y=!1,j=!1,Q=0,fe=!1;const M=Pd(),D=({x:se,y:ae})=>{T={x:se,y:ae};let x=!1;if(N=N.map(v=>{const k={x:se-v.distance.x,y:ae-v.distance.y},{computedPosition:I}=$o(v,n.value?zn(k,o.value):k,C.error,l.value,v.parentNode?h(v.parentNode):void 0);return x=x||v.position.x!==I.x||v.position.y!==I.y,v.position=I,v}),j=j||x,!!x&&(p(N,!0,!0),b.value=!0,H)){const[v,k]=Co({id:A,dragItems:N,findNode:h});V({event:H,node:v,nodes:k})}},G=()=>{if(!O)return;const[se,ae]=Ci(R,O,c.value);if(se!==0||ae!==0){const x={x:(T.x??0)-se/u.value.zoom,y:(T.y??0)-ae/u.value.zoom};f({x:se,y:ae})&&D(x)}Q=requestAnimationFrame(G)},F=(se,ae)=>{Y=!0;const x=h(A);!g.value&&!m.value&&x&&(x.selected||_()),x&&pe(w)&&g.value&&Do(x,m.value,S,_,y,!1,ae);const v=M(se.sourceEvent);if(T=v,N=hd(i.value,d.value,v,A),N.length){const[k,I]=Co({id:A,dragItems:N,findNode:h});z({event:se.sourceEvent,node:k,nodes:I})}},oe=(se,ae)=>{var x;se.sourceEvent.type==="touchmove"&&se.sourceEvent.touches.length>1||(j=!1,a.value===0&&F(se,ae),T=M(se.sourceEvent),O=((x=t.value)==null?void 0:x.getBoundingClientRect())||null,R=Ue(se.sourceEvent,O))},re=(se,ae)=>{const x=M(se.sourceEvent);if(!fe&&Y&&s.value&&(fe=!0,G()),!Y){const v=x.xSnapped-(T.x??0),k=x.ySnapped-(T.y??0);Math.sqrt(v*v+k*k)>a.value&&F(se,ae)}(T.x!==x.xSnapped||T.y!==x.ySnapped)&&N.length&&Y&&(H=se.sourceEvent,R=Ue(se.sourceEvent,O),D(x))},ge=se=>{let ae=!1;if(!Y&&!b.value&&!m.value){const x=se.sourceEvent,v=M(x),k=v.xSnapped-(T.x??0),I=v.ySnapped-(T.y??0),$=Math.sqrt(k*k+I*I);$!==0&&$<=a.value&&(B?.(x),ae=!0)}if(N.length&&!ae){j&&(p(N,!1,!1),j=!1);const[x,v]=Co({id:A,dragItems:N,findNode:h});L({event:se.sourceEvent,node:x,nodes:v})}N=[],b.value=!1,fe=!1,Y=!1,T={x:void 0,y:void 0},cancelAnimationFrame(Q)};return _e([()=>pe(X),U],([se,ae],x,v)=>{if(ae){const k=Le(ae);se||(E=ou().on("start",I=>oe(I,ae)).on("drag",I=>re(I,ae)).on("end",I=>ge(I)).filter(I=>{const $=I.target,Z=pe(P);return!I.button&&(!r.value||!Ti($,`.${r.value}`,ae)&&(!Z||Ti($,Z,ae)))}),k.call(E)),v(()=>{k.on(".drag",null),E&&(E.on("start",null),E.on("drag",null),E.on("end",null))})}}),b}function Dd(){return{doubleClick:W(),click:W(),mouseEnter:W(),mouseMove:W(),mouseLeave:W(),contextMenu:W(),updateStart:W(),update:W(),updateEnd:W()}}function Td(e,t){const n=Dd();return n.doubleClick.on(o=>{var r,i;t.edgeDoubleClick(o),(i=(r=e.events)==null?void 0:r.doubleClick)==null||i.call(r,o)}),n.click.on(o=>{var r,i;t.edgeClick(o),(i=(r=e.events)==null?void 0:r.click)==null||i.call(r,o)}),n.mouseEnter.on(o=>{var r,i;t.edgeMouseEnter(o),(i=(r=e.events)==null?void 0:r.mouseEnter)==null||i.call(r,o)}),n.mouseMove.on(o=>{var r,i;t.edgeMouseMove(o),(i=(r=e.events)==null?void 0:r.mouseMove)==null||i.call(r,o)}),n.mouseLeave.on(o=>{var r,i;t.edgeMouseLeave(o),(i=(r=e.events)==null?void 0:r.mouseLeave)==null||i.call(r,o)}),n.contextMenu.on(o=>{var r,i;t.edgeContextMenu(o),(i=(r=e.events)==null?void 0:r.contextMenu)==null||i.call(r,o)}),n.updateStart.on(o=>{var r,i;t.edgeUpdateStart(o),(i=(r=e.events)==null?void 0:r.updateStart)==null||i.call(r,o)}),n.update.on(o=>{var r,i;t.edgeUpdate(o),(i=(r=e.events)==null?void 0:r.update)==null||i.call(r,o)}),n.updateEnd.on(o=>{var r,i;t.edgeUpdateEnd(o),(i=(r=e.events)==null?void 0:r.updateEnd)==null||i.call(r,o)}),Object.entries(n).reduce((o,[r,i])=>(o.emit[r]=i.trigger,o.on[r]=i.on,o),{emit:{},on:{}})}function Pd(){const{viewport:e,snapGrid:t,snapToGrid:n,vueFlowRef:o}=Ee();return r=>{var i;const l=((i=o.value)==null?void 0:i.getBoundingClientRect())??{left:0,top:0},a=yd(r)?r.sourceEvent:r,{x:u,y:s}=Ue(a,l),c=en({x:u,y:s},e.value),{x:d,y:f}=n.value?zn(c,t.value):c;return{xSnapped:d,ySnapped:f,...c}}}function Bn(){return!0}function Zi({handleId:e,nodeId:t,type:n,isValidConnection:o,edgeUpdaterType:r,onEdgeUpdate:i,onEdgeUpdateEnd:l}){const{id:a,vueFlowRef:u,connectionMode:s,connectionRadius:c,connectOnClick:d,connectionClickStartHandle:f,nodesConnectable:h,autoPanOnConnect:m,autoPanSpeed:y,findNode:g,panBy:_,startConnection:S,updateConnection:p,endConnection:C,emits:z,viewport:V,edges:L,nodes:B,isValidConnection:U,nodeLookup:X}=Ee();let A=null,w=!1,P=null;function b(E){var O;const T=pe(n)==="target",R=Io(E),H=pi(E.target),Y=E.currentTarget;if(Y&&(R&&E.button===0||!R)){let j=function(te){x=Ue(te,ge),D=Nd(en(x,V.value,!1,[1,1]),c.value,X.value,I),v||(k(),v=!0);const ue=Ri(te,{handle:D,connectionMode:s.value,fromNodeId:pe(t),fromHandleId:pe(e),fromType:T?"target":"source",isValidConnection:M,doc:H,lib:"vue",flowId:a,nodeLookup:X.value},L.value,B.value,g,X.value);P=ue.handleDomNode,A=ue.connection,w=kd(!!D,ue.isValid);const ve={...ie,isValid:w,to:ue.toHandle&&w?Qt({x:ue.toHandle.x,y:ue.toHandle.y},V.value):x,toHandle:ue.toHandle,toPosition:w&&ue.toHandle?ue.toHandle.position:Oo[I.position],toNode:ue.toHandle?X.value.get(ue.toHandle.nodeId):null};if(w&&D&&ie?.toHandle&&ve.toHandle&&ie.toHandle.type===ve.toHandle.type&&ie.toHandle.nodeId===ve.toHandle.nodeId&&ie.toHandle.id===ve.toHandle.id&&ie.to.x===ve.to.x&&ie.to.y===ve.to.y)return;const we=D??ue.toHandle;if(p(we&&w?Qt({x:we.x,y:we.y},V.value):x,we,Sd(!!we,w)),ie=ve,!D&&!w&&!P)return Mo(ae);A&&A.source!==A.target&&P&&(Mo(ae),ae=P,P.classList.add("connecting","vue-flow__handle-connecting"),P.classList.toggle("valid",!!w),P.classList.toggle("vue-flow__handle-valid",!!w))},Q=function(te){"touches"in te&&te.touches.length>0||((D||P)&&A&&w&&(i?i(te,A):z.connect(A)),z.connectEnd(te),r&&l?.(te),Mo(ae),cancelAnimationFrame(G),C(te),v=!1,w=!1,A=null,P=null,H.removeEventListener("mousemove",j),H.removeEventListener("mouseup",Q),H.removeEventListener("touchmove",j),H.removeEventListener("touchend",Q))};const fe=g(pe(t));let M=pe(o)||U.value||Bn;!M&&fe&&(M=(T?fe.isValidSourcePos:fe.isValidTargetPos)||Bn);let D,G=0;const{x:F,y:oe}=Ue(E),re=Bi(pe(r),Y),ge=(O=u.value)==null?void 0:O.getBoundingClientRect();if(!ge||!re)return;const se=Vi(pe(t),re,pe(e),X.value,s.value);if(!se)return;let ae,x=Ue(E,ge),v=!1;const k=()=>{if(!m.value)return;const[te,ue]=Ci(x,ge,y.value);_({x:te,y:ue}),G=requestAnimationFrame(k)},I={...se,nodeId:pe(t),type:re,position:se.position},$=X.value.get(pe(t)),K={inProgress:!0,isValid:null,from:Tt($,I,J.Left,!0),fromHandle:I,fromPosition:I.position,fromNode:$,to:x,toHandle:null,toPosition:Oo[I.position],toNode:null};S({nodeId:pe(t),id:pe(e),type:re,position:Y?.getAttribute("data-handlepos")||J.Top,...x},{x:F-ge.left,y:oe-ge.top}),z.connectStart({event:E,nodeId:pe(t),handleId:pe(e),handleType:re});let ie=K;H.addEventListener("mousemove",j),H.addEventListener("mouseup",Q),H.addEventListener("touchmove",j),H.addEventListener("touchend",Q)}}function N(E){var O,T;if(!d.value)return;const R=pe(n)==="target";if(!f.value){z.clickConnectStart({event:E,nodeId:pe(t),handleId:pe(e)}),S({nodeId:pe(t),type:pe(n),id:pe(e),position:J.Top,...Ue(E)},void 0,!0);return}let H=pe(o)||U.value||Bn;const Y=g(pe(t));if(!H&&Y&&(H=(R?Y.isValidSourcePos:Y.isValidTargetPos)||Bn),Y&&(typeof Y.connectable>"u"?h.value:Y.connectable)===!1)return;const j=pi(E.target),Q=Ri(E,{handle:{nodeId:pe(t),id:pe(e),type:pe(n),position:J.Top,...Ue(E)},connectionMode:s.value,fromNodeId:f.value.nodeId,fromHandleId:f.value.id??null,fromType:f.value.type,isValidConnection:H,doc:j,lib:"vue",flowId:a,nodeLookup:X.value},L.value,B.value,g,X.value),fe=((O=Q.connection)==null?void 0:O.source)===((T=Q.connection)==null?void 0:T.target);Q.isValid&&Q.connection&&!fe&&z.connect(Q.connection),z.clickConnectEnd(E),C(E,!0)}return{handlePointerDown:b,handleClick:N}}function Ad(){return ot(ji,"")}function Ki(e){const t=e??Ad()??"",n=ot(Ui,xe(null)),{findNode:o,edges:r,emits:i}=Ee(),l=o(t);return l||i.error(new Oe(Ce.NODE_NOT_FOUND,t)),{id:t,nodeEl:n,node:l,parentNode:he(()=>o(l.parentNode)),connectedEdges:he(()=>xi([l],r.value))}}function zd(){return{doubleClick:W(),click:W(),mouseEnter:W(),mouseMove:W(),mouseLeave:W(),contextMenu:W(),dragStart:W(),drag:W(),dragStop:W()}}function Rd(e,t){const n=zd();return n.doubleClick.on(o=>{var r,i;t.nodeDoubleClick(o),(i=(r=e.events)==null?void 0:r.doubleClick)==null||i.call(r,o)}),n.click.on(o=>{var r,i;t.nodeClick(o),(i=(r=e.events)==null?void 0:r.click)==null||i.call(r,o)}),n.mouseEnter.on(o=>{var r,i;t.nodeMouseEnter(o),(i=(r=e.events)==null?void 0:r.mouseEnter)==null||i.call(r,o)}),n.mouseMove.on(o=>{var r,i;t.nodeMouseMove(o),(i=(r=e.events)==null?void 0:r.mouseMove)==null||i.call(r,o)}),n.mouseLeave.on(o=>{var r,i;t.nodeMouseLeave(o),(i=(r=e.events)==null?void 0:r.mouseLeave)==null||i.call(r,o)}),n.contextMenu.on(o=>{var r,i;t.nodeContextMenu(o),(i=(r=e.events)==null?void 0:r.contextMenu)==null||i.call(r,o)}),n.dragStart.on(o=>{var r,i;t.nodeDragStart(o),(i=(r=e.events)==null?void 0:r.dragStart)==null||i.call(r,o)}),n.drag.on(o=>{var r,i;t.nodeDrag(o),(i=(r=e.events)==null?void 0:r.drag)==null||i.call(r,o)}),n.dragStop.on(o=>{var r,i;t.nodeDragStop(o),(i=(r=e.events)==null?void 0:r.dragStop)==null||i.call(r,o)}),Object.entries(n).reduce((o,[r,i])=>(o.emit[r]=i.trigger,o.on[r]=i.on,o),{emit:{},on:{}})}function qi(){const{getSelectedNodes:e,nodeExtent:t,updateNodePositions:n,findNode:o,snapGrid:r,snapToGrid:i,nodesDraggable:l,emits:a}=Ee();return(u,s=!1)=>{const c=i.value?r.value[0]:5,d=i.value?r.value[1]:5,f=s?4:1,h=u.x*c*f,m=u.y*d*f,y=[];for(const g of e.value)if(g.draggable||l&&typeof g.draggable>"u"){const _={x:g.computedPosition.x+h,y:g.computedPosition.y+m},{position:S}=$o(g,_,a.error,t.value,g.parentNode?o(g.parentNode):void 0);y.push({id:g.id,position:S,from:g.position,distance:{x:u.x,y:u.y},dimensions:g.dimensions})}n(y,!0,!1)}}const Vn=.1,Bd=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2;function ut(){return nn("Viewport not initialized yet."),Promise.resolve(!1)}const Vd={zoomIn:ut,zoomOut:ut,zoomTo:ut,fitView:ut,setCenter:ut,fitBounds:ut,project:e=>e,screenToFlowCoordinate:e=>e,flowToScreenCoordinate:e=>e,setViewport:ut,setTransform:ut,getViewport:()=>({x:0,y:0,zoom:1}),getTransform:()=>({x:0,y:0,zoom:1}),viewportInitialized:!1};function Ld(e){function t(o,r){return new Promise(i=>{e.d3Selection&&e.d3Zoom?e.d3Zoom.interpolate(r?.interpolate==="linear"?Gt:bn).scaleBy(Ao(e.d3Selection,r?.duration,r?.ease,()=>{i(!0)}),o):i(!1)})}function n(o,r,i,l){return new Promise(a=>{var u;const{x:s,y:c}=gi({x:-o,y:-r},e.translateExtent),d=Mt.translate(-s,-c).scale(i);e.d3Selection&&e.d3Zoom?(u=e.d3Zoom)==null||u.interpolate(l?.interpolate==="linear"?Gt:bn).transform(Ao(e.d3Selection,l?.duration,l?.ease,()=>{a(!0)}),d):a(!1)})}return he(()=>e.d3Zoom&&e.d3Selection&&e.dimensions.width&&e.dimensions.height?{viewportInitialized:!0,zoomIn:r=>t(1.2,r),zoomOut:r=>t(1/1.2,r),zoomTo:(r,i)=>new Promise(l=>{e.d3Selection&&e.d3Zoom?e.d3Zoom.interpolate(i?.interpolate==="linear"?Gt:bn).scaleTo(Ao(e.d3Selection,i?.duration,i?.ease,()=>{l(!0)}),r):l(!1)}),setViewport:(r,i)=>n(r.x,r.y,r.zoom,i),setTransform:(r,i)=>n(r.x,r.y,r.zoom,i),getViewport:()=>({x:e.viewport.x,y:e.viewport.y,zoom:e.viewport.zoom}),getTransform:()=>({x:e.viewport.x,y:e.viewport.y,zoom:e.viewport.zoom}),fitView:(r={padding:Vn,includeHiddenNodes:!1,duration:0})=>{var i,l;const a=[];for(const f of e.nodes)f.dimensions.width&&f.dimensions.height&&(r?.includeHiddenNodes||!f.hidden)&&(!((i=r.nodes)!=null&&i.length)||(l=r.nodes)!=null&&l.length&&r.nodes.includes(f.id))&&a.push(f);if(!a.length)return Promise.resolve(!1);const u=wi(a),{x:s,y:c,zoom:d}=Ei(u,e.dimensions.width,e.dimensions.height,r.minZoom??e.minZoom,r.maxZoom??e.maxZoom,r.padding??Vn);return n(s,c,d,r)},setCenter:(r,i,l)=>{const a=typeof l?.zoom<"u"?l.zoom:e.maxZoom,u=e.dimensions.width/2-r*a,s=e.dimensions.height/2-i*a;return n(u,s,a,l)},fitBounds:(r,i={padding:Vn})=>{const{x:l,y:a,zoom:u}=Ei(r,e.dimensions.width,e.dimensions.height,e.minZoom,e.maxZoom,i.padding??Vn);return n(l,a,u,i)},project:r=>en(r,e.viewport,e.snapToGrid,e.snapGrid),screenToFlowCoordinate:r=>{if(e.vueFlowRef){const{x:i,y:l}=e.vueFlowRef.getBoundingClientRect(),a={x:r.x-i,y:r.y-l};return en(a,e.viewport,e.snapToGrid,e.snapGrid)}return{x:0,y:0}},flowToScreenCoordinate:r=>{if(e.vueFlowRef){const{x:i,y:l}=e.vueFlowRef.getBoundingClientRect(),a={x:r.x+i,y:r.y+l};return Qt(a,e.viewport)}return{x:0,y:0}}}:Vd)}function Ao(e,t=0,n=Bd,o=()=>{}){const r=typeof t=="number"&&t>0;return r||o(),r?e.transition().duration(t).ease(n).on("end",o):e}function Hd(e,t,n){const o=qn(!0);return o.run(()=>{const r=()=>{o.run(()=>{let y,g,_=!!(n.nodes.value.length||n.edges.value.length);y=St([e.modelValue,()=>{var S,p;return(p=(S=e.modelValue)==null?void 0:S.value)==null?void 0:p.length}],([S])=>{S&&Array.isArray(S)&&(g?.pause(),n.setElements(S),!g&&!_&&S.length?_=!0:g?.resume())}),g=St([n.nodes,n.edges,()=>n.edges.value.length,()=>n.nodes.value.length],([S,p])=>{var C;(C=e.modelValue)!=null&&C.value&&Array.isArray(e.modelValue.value)&&(y?.pause(),e.modelValue.value=[...S,...p],Ae(()=>{y?.resume()}))},{immediate:_}),zt(()=>{y?.stop(),g?.stop()})})},i=()=>{o.run(()=>{let y,g,_=!!n.nodes.value.length;y=St([e.nodes,()=>{var S,p;return(p=(S=e.nodes)==null?void 0:S.value)==null?void 0:p.length}],([S])=>{S&&Array.isArray(S)&&(g?.pause(),n.setNodes(S),!g&&!_&&S.length?_=!0:g?.resume())}),g=St([n.nodes,()=>n.nodes.value.length],([S])=>{var p;(p=e.nodes)!=null&&p.value&&Array.isArray(e.nodes.value)&&(y?.pause(),e.nodes.value=[...S],Ae(()=>{y?.resume()}))},{immediate:_}),zt(()=>{y?.stop(),g?.stop()})})},l=()=>{o.run(()=>{let y,g,_=!!n.edges.value.length;y=St([e.edges,()=>{var S,p;return(p=(S=e.edges)==null?void 0:S.value)==null?void 0:p.length}],([S])=>{S&&Array.isArray(S)&&(g?.pause(),n.setEdges(S),!g&&!_&&S.length?_=!0:g?.resume())}),g=St([n.edges,()=>n.edges.value.length],([S])=>{var p;(p=e.edges)!=null&&p.value&&Array.isArray(e.edges.value)&&(y?.pause(),e.edges.value=[...S],Ae(()=>{y?.resume()}))},{immediate:_}),zt(()=>{y?.stop(),g?.stop()})})},a=()=>{o.run(()=>{_e(()=>t.maxZoom,()=>{t.maxZoom&&$e(t.maxZoom)&&n.setMaxZoom(t.maxZoom)},{immediate:!0})})},u=()=>{o.run(()=>{_e(()=>t.minZoom,()=>{t.minZoom&&$e(t.minZoom)&&n.setMinZoom(t.minZoom)},{immediate:!0})})},s=()=>{o.run(()=>{_e(()=>t.translateExtent,()=>{t.translateExtent&&$e(t.translateExtent)&&n.setTranslateExtent(t.translateExtent)},{immediate:!0})})},c=()=>{o.run(()=>{_e(()=>t.nodeExtent,()=>{t.nodeExtent&&$e(t.nodeExtent)&&n.setNodeExtent(t.nodeExtent)},{immediate:!0})})},d=()=>{o.run(()=>{_e(()=>t.applyDefault,()=>{$e(t.applyDefault)&&(n.applyDefault.value=t.applyDefault)},{immediate:!0})})},f=()=>{o.run(()=>{const y=async g=>{let _=g;typeof t.autoConnect=="function"&&(_=await t.autoConnect(g)),_!==!1&&n.addEdges([_])};_e(()=>t.autoConnect,()=>{$e(t.autoConnect)&&(n.autoConnect.value=t.autoConnect)},{immediate:!0}),_e(n.autoConnect,(g,_,S)=>{g?n.onConnect(y):n.hooks.value.connect.off(y),S(()=>{n.hooks.value.connect.off(y)})},{immediate:!0})})},h=()=>{const y=["id","modelValue","translateExtent","nodeExtent","edges","nodes","maxZoom","minZoom","applyDefault","autoConnect"];for(const g of Object.keys(t)){const _=g;if(!y.includes(_)){const S=be(()=>t[_]),p=n[_];un(p)&&o.run(()=>{_e(S,C=>{$e(C)&&(p.value=C)},{immediate:!0})})}}};r(),i(),l(),u(),a(),s(),c(),d(),f(),h()}),()=>o.stop()}function Fd(){return{edgesChange:W(),nodesChange:W(),nodeDoubleClick:W(),nodeClick:W(),nodeMouseEnter:W(),nodeMouseMove:W(),nodeMouseLeave:W(),nodeContextMenu:W(),nodeDragStart:W(),nodeDrag:W(),nodeDragStop:W(),nodesInitialized:W(),miniMapNodeClick:W(),miniMapNodeDoubleClick:W(),miniMapNodeMouseEnter:W(),miniMapNodeMouseMove:W(),miniMapNodeMouseLeave:W(),connect:W(),connectStart:W(),connectEnd:W(),clickConnectStart:W(),clickConnectEnd:W(),paneReady:W(),init:W(),move:W(),moveStart:W(),moveEnd:W(),selectionDragStart:W(),selectionDrag:W(),selectionDragStop:W(),selectionContextMenu:W(),selectionStart:W(),selectionEnd:W(),viewportChangeStart:W(),viewportChange:W(),viewportChangeEnd:W(),paneScroll:W(),paneClick:W(),paneContextMenu:W(),paneMouseEnter:W(),paneMouseMove:W(),paneMouseLeave:W(),edgeContextMenu:W(),edgeMouseEnter:W(),edgeMouseMove:W(),edgeMouseLeave:W(),edgeDoubleClick:W(),edgeClick:W(),edgeUpdateStart:W(),edgeUpdate:W(),edgeUpdateEnd:W(),updateNodeInternals:W(),error:W(e=>nn(e.message))}}function Yd(e,t){const n=gt();or(()=>{for(const[r,i]of Object.entries(t.value)){const l=a=>{e(r,a)};i.setEmitter(l),Bt(i.removeEmitter),i.setHasEmitListeners(()=>o(r)),Bt(i.removeHasEmitListeners)}});function o(r){var i;const l=Gd(r);return!!((i=n?.vnode.props)==null?void 0:i[l])}}function Gd(e){const[t,...n]=e.split(":");return`on${t.replace(/(?:^|-)(\w)/g,(r,i)=>i.toUpperCase())}${n.length?`:${n.join(":")}`:""}`}function Ji(){return{vueFlowRef:null,viewportRef:null,nodes:[],edges:[],connectionLookup:new Map,nodeTypes:{},edgeTypes:{},initialized:!1,dimensions:{width:0,height:0},viewport:{x:0,y:0,zoom:1},d3Zoom:null,d3Selection:null,d3ZoomHandler:null,minZoom:.5,maxZoom:2,translateExtent:[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],nodeExtent:[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],selectionMode:Eo.Full,paneDragging:!1,preventScrolling:!0,zoomOnScroll:!0,zoomOnPinch:!0,zoomOnDoubleClick:!0,panOnScroll:!1,panOnScrollSpeed:.5,panOnScrollMode:Kt.Free,paneClickDistance:0,panOnDrag:!0,edgeUpdaterRadius:10,onlyRenderVisibleElements:!1,defaultViewport:{x:0,y:0,zoom:1},nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,defaultMarkerColor:"#b1b1b7",connectionLineStyle:{},connectionLineType:null,connectionLineOptions:{type:wt.Bezier,style:{}},connectionMode:it.Loose,connectionStartHandle:null,connectionEndHandle:null,connectionClickStartHandle:null,connectionPosition:{x:Number.NaN,y:Number.NaN},connectionRadius:20,connectOnClick:!0,connectionStatus:null,isValidConnection:null,snapGrid:[15,15],snapToGrid:!1,edgesUpdatable:!1,edgesFocusable:!0,nodesFocusable:!0,nodesConnectable:!0,nodesDraggable:!0,nodeDragThreshold:1,elementsSelectable:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,selectionKeyCode:"Shift",multiSelectionKeyCode:An()?"Meta":"Control",zoomActivationKeyCode:An()?"Meta":"Control",deleteKeyCode:"Backspace",panActivationKeyCode:"Space",hooks:Fd(),applyDefault:!0,autoConnect:!1,fitViewOnInit:!1,fitViewOnInitDone:!1,noDragClassName:"nodrag",noWheelClassName:"nowheel",noPanClassName:"nopan",defaultEdgeOptions:void 0,elevateEdgesOnSelect:!1,elevateNodesOnSelect:!0,autoPanOnNodeDrag:!0,autoPanOnConnect:!0,autoPanSpeed:15,disableKeyboardA11y:!1,ariaLiveMessage:""}}const Xd=["id","vueFlowRef","viewportRef","initialized","modelValue","nodes","edges","maxZoom","minZoom","translateExtent","hooks","defaultEdgeOptions"];function jd(e,t,n){const o=Ld(e),r=x=>{const v=x??[];e.hooks.updateNodeInternals.trigger(v)},i=x=>ld(x,e.nodes,e.edges),l=x=>id(x,e.nodes,e.edges),a=x=>xi(x,e.edges),u=({id:x,type:v,nodeId:k})=>{var I;const $=x?`-${v}-${x}`:`-${v}`;return Array.from(((I=e.connectionLookup.get(`${k}${$}`))==null?void 0:I.values())??[])},s=x=>{if(x)return t.value.get(x)},c=x=>{if(x)return n.value.get(x)},d=(x,v,k)=>{var I,$;const Z=[];for(const K of x){const ie={id:K.id,type:"position",dragging:k,from:K.from};if(v&&(ie.position=K.position,K.parentNode)){const te=s(K.parentNode);ie.position={x:ie.position.x-(((I=te?.computedPosition)==null?void 0:I.x)??0),y:ie.position.y-((($=te?.computedPosition)==null?void 0:$.y)??0)}}Z.push(ie)}Z?.length&&e.hooks.nodesChange.trigger(Z)},f=x=>{if(!e.vueFlowRef)return;const v=e.vueFlowRef.querySelector(".vue-flow__transformationpane");if(!v)return;const k=window.getComputedStyle(v),{m22:I}=new window.DOMMatrixReadOnly(k.transform),$=[];for(const Z of x){const K=Z,ie=s(K.id);if(ie){const te=Tn(K.nodeElement);if(!!(te.width&&te.height&&(ie.dimensions.width!==te.width||ie.dimensions.height!==te.height||K.forceUpdate))){const ve=K.nodeElement.getBoundingClientRect();ie.dimensions=te,ie.handleBounds.source=Hi("source",K.nodeElement,ve,I,ie.id),ie.handleBounds.target=Hi("target",K.nodeElement,ve,I,ie.id),$.push({id:ie.id,type:"dimensions",dimensions:te})}}}!e.fitViewOnInitDone&&e.fitViewOnInit&&o.value.fitView().then(()=>{e.fitViewOnInitDone=!0}),$.length&&e.hooks.nodesChange.trigger($)},h=(x,v)=>{const k=new Set,I=new Set;for(const K of x)xt(K)?k.add(K.id):lt(K)&&I.add(K.id);const $=st(t.value,k,!0),Z=st(n.value,I);if(e.multiSelectionActive){for(const K of k)$.push(at(K,v));for(const K of I)Z.push(at(K,v))}$.length&&e.hooks.nodesChange.trigger($),Z.length&&e.hooks.edgesChange.trigger(Z)},m=x=>{if(e.multiSelectionActive){const v=x.map(k=>at(k.id,!0));e.hooks.nodesChange.trigger(v);return}e.hooks.nodesChange.trigger(st(t.value,new Set(x.map(v=>v.id)),!0)),e.hooks.edgesChange.trigger(st(n.value))},y=x=>{if(e.multiSelectionActive){const v=x.map(k=>at(k.id,!0));e.hooks.edgesChange.trigger(v);return}e.hooks.edgesChange.trigger(st(n.value,new Set(x.map(v=>v.id)))),e.hooks.nodesChange.trigger(st(t.value,new Set,!0))},g=x=>{h(x,!0)},_=x=>{const k=(x||e.nodes).map(I=>(I.selected=!1,at(I.id,!1)));e.hooks.nodesChange.trigger(k)},S=x=>{const k=(x||e.edges).map(I=>(I.selected=!1,at(I.id,!1)));e.hooks.edgesChange.trigger(k)},p=x=>{if(!x||!x.length)return h([],!1);const v=x.reduce((k,I)=>{const $=at(I.id,!1);return xt(I)?k.nodes.push($):k.edges.push($),k},{nodes:[],edges:[]});v.nodes.length&&e.hooks.nodesChange.trigger(v.nodes),v.edges.length&&e.hooks.edgesChange.trigger(v.edges)},C=x=>{var v;(v=e.d3Zoom)==null||v.scaleExtent([x,e.maxZoom]),e.minZoom=x},z=x=>{var v;(v=e.d3Zoom)==null||v.scaleExtent([e.minZoom,x]),e.maxZoom=x},V=x=>{var v;(v=e.d3Zoom)==null||v.translateExtent(x),e.translateExtent=x},L=x=>{e.nodeExtent=x,r()},B=x=>{var v;(v=e.d3Zoom)==null||v.clickDistance(x)},U=x=>{e.nodesDraggable=x,e.nodesConnectable=x,e.elementsSelectable=x},X=x=>{const v=x instanceof Function?x(e.nodes):x;!e.initialized&&!v.length||(e.nodes=Fi(v,s,e.hooks.error.trigger))},A=x=>{const v=x instanceof Function?x(e.edges):x;if(!e.initialized&&!v.length)return;const k=Po(v,e.isValidConnection,s,c,e.hooks.error.trigger,e.defaultEdgeOptions,e.nodes,e.edges);To(e.connectionLookup,n.value,k),e.edges=k},w=x=>{const v=x instanceof Function?x([...e.nodes,...e.edges]):x;!e.initialized&&!v.length||(X(v.filter(xt)),A(v.filter(lt)))},P=x=>{let v=x instanceof Function?x(e.nodes):x;v=Array.isArray(v)?v:[v];const k=Fi(v,s,e.hooks.error.trigger),I=[];for(const $ of k)I.push(Ii($));I.length&&e.hooks.nodesChange.trigger(I)},b=x=>{let v=x instanceof Function?x(e.edges):x;v=Array.isArray(v)?v:[v];const k=Po(v,e.isValidConnection,s,c,e.hooks.error.trigger,e.defaultEdgeOptions,e.nodes,e.edges),I=[];for(const $ of k)I.push(Ii($));I.length&&e.hooks.edgesChange.trigger(I)},N=(x,v=!0,k=!1)=>{const I=x instanceof Function?x(e.nodes):x,$=Array.isArray(I)?I:[I],Z=[],K=[];function ie(ue){const ve=a(ue);for(const we of ve)(!$e(we.deletable)||we.deletable)&&K.push(Oi(we.id,we.source,we.target,we.sourceHandle,we.targetHandle))}function te(ue){const ve=[];for(const we of e.nodes)we.parentNode===ue&&ve.push(we);if(ve.length){for(const we of ve)Z.push(Mi(we.id));v&&ie(ve);for(const we of ve)te(we.id)}}for(const ue of $){const ve=typeof ue=="string"?s(ue):ue;ve&&($e(ve.deletable)&&!ve.deletable||(Z.push(Mi(ve.id)),v&&ie([ve]),k&&te(ve.id)))}K.length&&e.hooks.edgesChange.trigger(K),Z.length&&e.hooks.nodesChange.trigger(Z)},E=x=>{const v=x instanceof Function?x(e.edges):x,k=Array.isArray(v)?v:[v],I=[];for(const $ of k){const Z=typeof $=="string"?c($):$;Z&&($e(Z.deletable)&&!Z.deletable||I.push(Oi(typeof $=="string"?$:$.id,Z.source,Z.target,Z.sourceHandle,Z.targetHandle)))}e.hooks.edgesChange.trigger(I)},O=(x,v,k=!0)=>{const I=c(x.id);if(!I)return!1;const $=e.edges.indexOf(I),Z=Id(x,v,I,k,e.hooks.error.trigger);if(Z){const[K]=Po([Z],e.isValidConnection,s,c,e.hooks.error.trigger,e.defaultEdgeOptions,e.nodes,e.edges);return e.edges=e.edges.map((ie,te)=>te===$?K:ie),To(e.connectionLookup,n.value,[K]),K}return!1},T=(x,v,k={replace:!1})=>{const I=c(x);if(!I)return;const $=typeof v=="function"?v(I):v;I.data=k.replace?$:{...I.data,...$}},R=x=>$i(x,e.nodes),H=x=>{const v=$i(x,e.edges);return To(e.connectionLookup,n.value,v),v},Y=(x,v,k={replace:!1})=>{const I=s(x);if(!I)return;const $=typeof v=="function"?v(I):v;k.replace?e.nodes.splice(e.nodes.indexOf(I),1,$):Object.assign(I,$)},j=(x,v,k={replace:!1})=>{const I=s(x);if(!I)return;const $=typeof v=="function"?v(I):v;I.data=k.replace?$:{...I.data,...$}},Q=(x,v,k=!1)=>{k?e.connectionClickStartHandle=x:e.connectionStartHandle=x,e.connectionEndHandle=null,e.connectionStatus=null,v&&(e.connectionPosition=v)},fe=(x,v=null,k=null)=>{e.connectionStartHandle&&(e.connectionPosition=x,e.connectionEndHandle=v,e.connectionStatus=k)},M=(x,v)=>{e.connectionPosition={x:Number.NaN,y:Number.NaN},e.connectionEndHandle=null,e.connectionStatus=null,v?e.connectionClickStartHandle=null:e.connectionStartHandle=null},D=x=>{const v=od(x),k=v?null:Jt(x)?x:s(x.id);return!v&&!k?[null,null,v]:[v?x:On(k),k,v]},G=(x,v=!0,k=e.nodes)=>{const[I,$,Z]=D(x);if(!I)return[];const K=[];for(const ie of k||e.nodes){if(!Z&&(ie.id===$.id||!ie.computedPosition))continue;const te=On(ie),ue=Dn(te,I);(v&&ue>0||ue>=te.width*te.height||ue>=Number(I.width)*Number(I.height))&&K.push(ie)}return K},F=(x,v,k=!0)=>{const[I]=D(x);if(!I)return!1;const $=Dn(I,v);return k&&$>0||$>=Number(I.width)*Number(I.height)},oe=x=>{const{viewport:v,dimensions:k,d3Zoom:I,d3Selection:$,translateExtent:Z}=e;if(!I||!$||!x.x&&!x.y)return!1;const K=Mt.translate(v.x+x.x,v.y+x.y).scale(v.zoom),ie=[[0,0],[k.width,k.height]],te=I.constrain()(K,ie,Z),ue=e.viewport.x!==te.x||e.viewport.y!==te.y||e.viewport.zoom!==te.k;return I.transform($,te),ue},re=x=>{const v=x instanceof Function?x(e):x,k=["d3Zoom","d3Selection","d3ZoomHandler","viewportRef","vueFlowRef","dimensions","hooks"];$e(v.defaultEdgeOptions)&&(e.defaultEdgeOptions=v.defaultEdgeOptions);const I=v.modelValue||v.nodes||v.edges?[]:void 0;I&&(v.modelValue&&I.push(...v.modelValue),v.nodes&&I.push(...v.nodes),v.edges&&I.push(...v.edges),w(I));const $=()=>{$e(v.maxZoom)&&z(v.maxZoom),$e(v.minZoom)&&C(v.minZoom),$e(v.translateExtent)&&V(v.translateExtent)};for(const Z of Object.keys(v)){const K=Z,ie=v[K];![...Xd,...k].includes(K)&&$e(ie)&&(e[K]=ie)}to(()=>e.d3Zoom).not.toBeNull().then($),e.initialized||(e.initialized=!0)};return{updateNodePositions:d,updateNodeDimensions:f,setElements:w,setNodes:X,setEdges:A,addNodes:P,addEdges:b,removeNodes:N,removeEdges:E,findNode:s,findEdge:c,updateEdge:O,updateEdgeData:T,updateNode:Y,updateNodeData:j,applyEdgeChanges:H,applyNodeChanges:R,addSelectedElements:g,addSelectedNodes:m,addSelectedEdges:y,setMinZoom:C,setMaxZoom:z,setTranslateExtent:V,setNodeExtent:L,setPaneClickDistance:B,removeSelectedElements:p,removeSelectedNodes:_,removeSelectedEdges:S,startConnection:Q,updateConnection:fe,endConnection:M,setInteractive:U,setState:re,getIntersectingNodes:G,getIncomers:i,getOutgoers:l,getConnectedEdges:a,getHandleConnections:u,isNodeIntersecting:F,panBy:oe,fitView:x=>o.value.fitView(x),zoomIn:x=>o.value.zoomIn(x),zoomOut:x=>o.value.zoomOut(x),zoomTo:(x,v)=>o.value.zoomTo(x,v),setViewport:(x,v)=>o.value.setViewport(x,v),setTransform:(x,v)=>o.value.setTransform(x,v),getViewport:()=>o.value.getViewport(),getTransform:()=>o.value.getTransform(),setCenter:(x,v,k)=>o.value.setCenter(x,v,k),fitBounds:(x,v)=>o.value.fitBounds(x,v),project:x=>o.value.project(x),screenToFlowCoordinate:x=>o.value.screenToFlowCoordinate(x),flowToScreenCoordinate:x=>o.value.flowToScreenCoordinate(x),toObject:()=>{const x=[],v=[];for(const k of e.nodes){const{computedPosition:I,handleBounds:$,selected:Z,dimensions:K,isParent:ie,resizing:te,dragging:ue,events:ve,...we}=k;x.push(we)}for(const k of e.edges){const{selected:I,sourceNode:$,targetNode:Z,events:K,...ie}=k;v.push(ie)}return JSON.parse(JSON.stringify({nodes:x,edges:v,position:[e.viewport.x,e.viewport.y],zoom:e.viewport.zoom,viewport:e.viewport}))},fromObject:x=>new Promise(v=>{const{nodes:k,edges:I,position:$,zoom:Z,viewport:K}=x;k&&X(k),I&&A(I);const[ie,te]=K?.x&&K?.y?[K.x,K.y]:$??[null,null];if(ie&&te){const ue=K?.zoom||Z||e.viewport.zoom;return to(()=>o.value.viewportInitialized).toBe(!0).then(()=>{o.value.setViewport({x:ie,y:te,zoom:ue}).then(()=>{v(!0)})})}else v(!0)}),updateNodeInternals:r,viewportHelper:o,$reset:()=>{const x=Ji();if(e.edges=[],e.nodes=[],e.d3Zoom&&e.d3Selection){const v=Mt.translate(x.defaultViewport.x??0,x.defaultViewport.y??0).scale(bt(x.defaultViewport.zoom??1,x.minZoom,x.maxZoom)),k=e.viewportRef.getBoundingClientRect(),I=[[0,0],[k.width,k.height]],$=e.d3Zoom.constrain()(v,I,x.translateExtent);e.d3Zoom.transform(e.d3Selection,$)}re(x)},$destroy:()=>{}}}const Ud=["data-id","data-handleid","data-nodeid","data-handlepos"],ct=Ne({...{name:"Handle",compatConfig:{MODE:3}},props:{id:{default:null},type:{},position:{default:()=>J.Top},isValidConnection:{type:Function},connectable:{type:[Boolean,Number,String,Function],default:void 0},connectableStart:{type:Boolean,default:!0},connectableEnd:{type:Boolean,default:!0}},setup(e,{expose:t}){const n=tr(e,["position","connectable","connectableStart","connectableEnd","id"]),o=be(()=>n.type??"source"),r=be(()=>n.isValidConnection??null),{id:i,connectionStartHandle:l,connectionClickStartHandle:a,connectionEndHandle:u,vueFlowRef:s,nodesConnectable:c,noDragClassName:d,noPanClassName:f}=Ee(),{id:h,node:m,nodeEl:y,connectedEdges:g}=Ki(),_=xe(),S=be(()=>typeof e.connectableStart<"u"?e.connectableStart:!0),p=be(()=>typeof e.connectableEnd<"u"?e.connectableEnd:!0),C=be(()=>{var A,w,P,b,N,E;return((A=l.value)==null?void 0:A.nodeId)===h&&((w=l.value)==null?void 0:w.id)===e.id&&((P=l.value)==null?void 0:P.type)===o.value||((b=u.value)==null?void 0:b.nodeId)===h&&((N=u.value)==null?void 0:N.id)===e.id&&((E=u.value)==null?void 0:E.type)===o.value}),z=be(()=>{var A,w,P;return((A=a.value)==null?void 0:A.nodeId)===h&&((w=a.value)==null?void 0:w.id)===e.id&&((P=a.value)==null?void 0:P.type)===o.value}),{handlePointerDown:V,handleClick:L}=Zi({nodeId:h,handleId:e.id,isValidConnection:r,type:o}),B=he(()=>typeof e.connectable=="string"&&e.connectable==="single"?!g.value.some(A=>{const w=A[`${o.value}Handle`];return A[o.value]!==h?!1:w?w===e.id:!0}):typeof e.connectable=="number"?g.value.filter(A=>{const w=A[`${o.value}Handle`];return A[o.value]!==h?!1:w?w===e.id:!0}).length<e.connectable:typeof e.connectable=="function"?e.connectable(m,g.value):$e(e.connectable)?e.connectable:c.value);Ke(()=>{var A;if(!m.dimensions.width||!m.dimensions.height)return;const w=(A=m.handleBounds[o.value])==null?void 0:A.find(R=>R.id===e.id);if(!s.value||w)return;const P=s.value.querySelector(".vue-flow__transformationpane");if(!y.value||!_.value||!P||!e.id)return;const b=y.value.getBoundingClientRect(),N=_.value.getBoundingClientRect(),E=window.getComputedStyle(P),{m22:O}=new window.DOMMatrixReadOnly(E.transform),T={id:e.id,position:e.position,x:(N.left-b.left)/O,y:(N.top-b.top)/O,type:o.value,nodeId:h,...Tn(_.value)};m.handleBounds[o.value]=[...m.handleBounds[o.value]??[],T]});function U(A){const w=Io(A);B.value&&S.value&&(w&&A.button===0||!w)&&V(A)}function X(A){!h||!a.value&&!S.value||B.value&&L(A)}return t({handleClick:L,handlePointerDown:V,onClick:X,onPointerDown:U}),(A,w)=>(ee(),de("div",{ref_key:"handle",ref:_,"data-id":`${q(i)}-${q(h)}-${e.id}-${o.value}`,"data-handleid":e.id,"data-nodeid":q(h),"data-handlepos":A.position,class:ht(["vue-flow__handle",[`vue-flow__handle-${A.position}`,`vue-flow__handle-${e.id}`,q(d),q(f),o.value,{connectable:B.value,connecting:z.value,connectablestart:S.value,connectableend:p.value,connectionindicator:B.value&&(S.value&&!C.value||p.value&&C.value)}]]),onMousedown:U,onTouchstartPassive:U,onClick:X},[ke(A.$slots,"default",{id:A.id})],42,Ud))}}),Ln=function({sourcePosition:e=J.Bottom,targetPosition:t=J.Top,label:n,connectable:o=!0,isValidTargetPos:r,isValidSourcePos:i,data:l}){const a=l.label??n;return[ye(ct,{type:"target",position:t,connectable:o,isValidConnection:r}),typeof a!="string"&&a?ye(a):ye(Be,[a]),ye(ct,{type:"source",position:e,connectable:o,isValidConnection:i})]};Ln.props=["sourcePosition","targetPosition","label","isValidTargetPos","isValidSourcePos","connectable","data"],Ln.inheritAttrs=!1,Ln.compatConfig={MODE:3};const Wd=Ln,Hn=function({targetPosition:e=J.Top,label:t,connectable:n=!0,isValidTargetPos:o,data:r}){const i=r.label??t;return[ye(ct,{type:"target",position:e,connectable:n,isValidConnection:o}),typeof i!="string"&&i?ye(i):ye(Be,[i])]};Hn.props=["targetPosition","label","isValidTargetPos","connectable","data"],Hn.inheritAttrs=!1,Hn.compatConfig={MODE:3};const Zd=Hn,Fn=function({sourcePosition:e=J.Bottom,label:t,connectable:n=!0,isValidSourcePos:o,data:r}){const i=r.label??t;return[typeof i!="string"&&i?ye(i):ye(Be,[i]),ye(ct,{type:"source",position:e,connectable:n,isValidConnection:o})]};Fn.props=["sourcePosition","label","isValidSourcePos","connectable","data"],Fn.inheritAttrs=!1,Fn.compatConfig={MODE:3};const Kd=Fn,qd=["transform"],Jd=["width","height","x","y","rx","ry"],Qd=["y"],ef=Ne({...{name:"EdgeText",compatConfig:{MODE:3}},props:{x:{},y:{},label:{},labelStyle:{default:()=>({})},labelShowBg:{type:Boolean,default:!0},labelBgStyle:{default:()=>({})},labelBgPadding:{default:()=>[2,4]},labelBgBorderRadius:{default:2}},setup(e){const t=xe({x:0,y:0,width:0,height:0}),n=xe(null),o=he(()=>`translate(${e.x-t.value.width/2} ${e.y-t.value.height/2})`);Ke(r),_e([()=>e.x,()=>e.y,n,()=>e.label],r);function r(){if(!n.value)return;const i=n.value.getBBox();(i.width!==t.value.width||i.height!==t.value.height)&&(t.value=i)}return(i,l)=>(ee(),de("g",{transform:o.value,class:"vue-flow__edge-textwrapper"},[i.labelShowBg?(ee(),de("rect",{key:0,class:"vue-flow__edge-textbg",width:`${t.value.width+2*i.labelBgPadding[0]}px`,height:`${t.value.height+2*i.labelBgPadding[1]}px`,x:-i.labelBgPadding[0],y:-i.labelBgPadding[1],style:Te(i.labelBgStyle),rx:i.labelBgBorderRadius,ry:i.labelBgBorderRadius},null,12,Jd)):Me("",!0),ce("text",Qn(i.$attrs,{ref_key:"el",ref:n,class:"vue-flow__edge-text",y:t.value.height/2,dy:"0.3em",style:i.labelStyle}),[ke(i.$slots,"default",{},()=>[typeof i.label!="string"?(ee(),Ie(pt(i.label),{key:0})):(ee(),de(Be,{key:1},[Ve(De(i.label),1)],64))])],16,Qd)],8,qd))}}),tf=["id","d","marker-end","marker-start"],nf=["d","stroke-width"],Yn=Ne({...{name:"BaseEdge",inheritAttrs:!1,compatConfig:{MODE:3}},props:{id:{},labelX:{},labelY:{},path:{},label:{},markerStart:{},markerEnd:{},interactionWidth:{default:20},labelStyle:{},labelShowBg:{type:Boolean},labelBgStyle:{},labelBgPadding:{},labelBgBorderRadius:{}},setup(e,{expose:t}){const n=xe(null),o=xe(null),r=xe(null),i=ar();return t({pathEl:n,interactionEl:o,labelEl:r}),(l,a)=>(ee(),de(Be,null,[ce("path",Qn(q(i),{id:l.id,ref_key:"pathEl",ref:n,d:l.path,class:"vue-flow__edge-path","marker-end":l.markerEnd,"marker-start":l.markerStart}),null,16,tf),l.interactionWidth?(ee(),de("path",{key:0,ref_key:"interactionEl",ref:o,fill:"none",d:l.path,"stroke-width":l.interactionWidth,"stroke-opacity":0,class:"vue-flow__edge-interaction"},null,8,nf)):Me("",!0),l.label&&l.labelX&&l.labelY?(ee(),Ie(ef,{key:1,ref_key:"labelEl",ref:r,x:l.labelX,y:l.labelY,label:l.label,"label-show-bg":l.labelShowBg,"label-bg-style":l.labelBgStyle,"label-bg-padding":l.labelBgPadding,"label-bg-border-radius":l.labelBgBorderRadius,"label-style":l.labelStyle},null,8,["x","y","label","label-show-bg","label-bg-style","label-bg-padding","label-bg-border-radius","label-style"])):Me("",!0)],64))}});function Qi({sourceX:e,sourceY:t,targetX:n,targetY:o}){const r=Math.abs(n-e)/2,i=n<e?n+r:n-r,l=Math.abs(o-t)/2,a=o<t?o+l:o-l;return[i,a,r,l]}function el({sourceX:e,sourceY:t,targetX:n,targetY:o,sourceControlX:r,sourceControlY:i,targetControlX:l,targetControlY:a}){const u=e*.125+r*.375+l*.375+n*.125,s=t*.125+i*.375+a*.375+o*.125,c=Math.abs(u-e),d=Math.abs(s-t);return[u,s,c,d]}function Gn(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function tl({pos:e,x1:t,y1:n,x2:o,y2:r,c:i}){let l,a;switch(e){case J.Left:l=t-Gn(t-o,i),a=n;break;case J.Right:l=t+Gn(o-t,i),a=n;break;case J.Top:l=t,a=n-Gn(n-r,i);break;case J.Bottom:l=t,a=n+Gn(r-n,i);break}return[l,a]}function nl(e){const{sourceX:t,sourceY:n,sourcePosition:o=J.Bottom,targetX:r,targetY:i,targetPosition:l=J.Top,curvature:a=.25}=e,[u,s]=tl({pos:o,x1:t,y1:n,x2:r,y2:i,c:a}),[c,d]=tl({pos:l,x1:r,y1:i,x2:t,y2:n,c:a}),[f,h,m,y]=el({sourceX:t,sourceY:n,targetX:r,targetY:i,sourceControlX:u,sourceControlY:s,targetControlX:c,targetControlY:d});return[`M${t},${n} C${u},${s} ${c},${d} ${r},${i}`,f,h,m,y]}function ol({pos:e,x1:t,y1:n,x2:o,y2:r}){let i,l;switch(e){case J.Left:case J.Right:i=.5*(t+o),l=n;break;case J.Top:case J.Bottom:i=t,l=.5*(n+r);break}return[i,l]}function rl(e){const{sourceX:t,sourceY:n,sourcePosition:o=J.Bottom,targetX:r,targetY:i,targetPosition:l=J.Top}=e,[a,u]=ol({pos:o,x1:t,y1:n,x2:r,y2:i}),[s,c]=ol({pos:l,x1:r,y1:i,x2:t,y2:n}),[d,f,h,m]=el({sourceX:t,sourceY:n,targetX:r,targetY:i,sourceControlX:a,sourceControlY:u,targetControlX:s,targetControlY:c});return[`M${t},${n} C${a},${u} ${s},${c} ${r},${i}`,d,f,h,m]}const il={[J.Left]:{x:-1,y:0},[J.Right]:{x:1,y:0},[J.Top]:{x:0,y:-1},[J.Bottom]:{x:0,y:1}};function of({source:e,sourcePosition:t=J.Bottom,target:n}){return t===J.Left||t===J.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1}}function ll(e,t){return Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2)}function rf({source:e,sourcePosition:t=J.Bottom,target:n,targetPosition:o=J.Top,center:r,offset:i}){const l=il[t],a=il[o],u={x:e.x+l.x*i,y:e.y+l.y*i},s={x:n.x+a.x*i,y:n.y+a.y*i},c=of({source:u,sourcePosition:t,target:s}),d=c.x!==0?"x":"y",f=c[d];let h,m,y;const g={x:0,y:0},_={x:0,y:0},[S,p,C,z]=Qi({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(l[d]*a[d]===-1){m=r.x??S,y=r.y??p;const L=[{x:m,y:u.y},{x:m,y:s.y}],B=[{x:u.x,y},{x:s.x,y}];l[d]===f?h=d==="x"?L:B:h=d==="x"?B:L}else{const L=[{x:u.x,y:s.y}],B=[{x:s.x,y:u.y}];if(d==="x"?h=l.x===f?B:L:h=l.y===f?L:B,t===o){const P=Math.abs(e[d]-n[d]);if(P<=i){const b=Math.min(i-1,i-P);l[d]===f?g[d]=(u[d]>e[d]?-1:1)*b:_[d]=(s[d]>n[d]?-1:1)*b}}if(t!==o){const P=d==="x"?"y":"x",b=l[d]===a[P],N=u[P]>s[P],E=u[P]<s[P];(l[d]===1&&(!b&&N||b&&E)||l[d]!==1&&(!b&&E||b&&N))&&(h=d==="x"?L:B)}const U={x:u.x+g.x,y:u.y+g.y},X={x:s.x+_.x,y:s.y+_.y},A=Math.max(Math.abs(U.x-h[0].x),Math.abs(X.x-h[0].x)),w=Math.max(Math.abs(U.y-h[0].y),Math.abs(X.y-h[0].y));A>=w?(m=(U.x+X.x)/2,y=h[0].y):(m=h[0].x,y=(U.y+X.y)/2)}return[[e,{x:u.x+g.x,y:u.y+g.y},...h,{x:s.x+_.x,y:s.y+_.y},n],m,y,C,z]}function lf(e,t,n,o){const r=Math.min(ll(e,t)/2,ll(t,n)/2,o),{x:i,y:l}=t;if(e.x===i&&i===n.x||e.y===l&&l===n.y)return`L${i} ${l}`;if(e.y===l){const s=e.x<n.x?-1:1,c=e.y<n.y?1:-1;return`L ${i+r*s},${l}Q ${i},${l} ${i},${l+r*c}`}const a=e.x<n.x?1:-1,u=e.y<n.y?-1:1;return`L ${i},${l+r*u}Q ${i},${l} ${i+r*a},${l}`}function zo(e){const{sourceX:t,sourceY:n,sourcePosition:o=J.Bottom,targetX:r,targetY:i,targetPosition:l=J.Top,borderRadius:a=5,centerX:u,centerY:s,offset:c=20}=e,[d,f,h,m,y]=rf({source:{x:t,y:n},sourcePosition:o,target:{x:r,y:i},targetPosition:l,center:{x:u,y:s},offset:c});return[d.reduce((_,S,p)=>{let C;return p>0&&p<d.length-1?C=lf(d[p-1],S,d[p+1],a):C=`${p===0?"M":"L"}${S.x} ${S.y}`,_+=C,_},""),f,h,m,y]}function af(e){const{sourceX:t,sourceY:n,targetX:o,targetY:r}=e,[i,l,a,u]=Qi({sourceX:t,sourceY:n,targetX:o,targetY:r});return[`M ${t},${n}L ${o},${r}`,i,l,a,u]}const sf=Ne({name:"StraightEdge",props:["label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","markerEnd","markerStart","interactionWidth"],compatConfig:{MODE:3},setup(e,{attrs:t}){return()=>{const[n,o,r]=af(e);return ye(Yn,{path:n,labelX:o,labelY:r,...t,...e})}}}),al=Ne({name:"SmoothStepEdge",props:["sourcePosition","targetPosition","label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","borderRadius","markerEnd","markerStart","interactionWidth","offset"],compatConfig:{MODE:3},setup(e,{attrs:t}){return()=>{const[n,o,r]=zo({...e,sourcePosition:e.sourcePosition??J.Bottom,targetPosition:e.targetPosition??J.Top});return ye(Yn,{path:n,labelX:o,labelY:r,...t,...e})}}}),uf=Ne({name:"StepEdge",props:["sourcePosition","targetPosition","label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","markerEnd","markerStart","interactionWidth"],setup(e,{attrs:t}){return()=>ye(al,{...e,...t,borderRadius:0})}}),cf=Ne({name:"BezierEdge",props:["sourcePosition","targetPosition","label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","curvature","markerEnd","markerStart","interactionWidth"],compatConfig:{MODE:3},setup(e,{attrs:t}){return()=>{const[n,o,r]=nl({...e,sourcePosition:e.sourcePosition??J.Bottom,targetPosition:e.targetPosition??J.Top});return ye(Yn,{path:n,labelX:o,labelY:r,...t,...e})}}}),df=Ne({name:"SimpleBezierEdge",props:["sourcePosition","targetPosition","label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","markerEnd","markerStart","interactionWidth"],compatConfig:{MODE:3},setup(e,{attrs:t}){return()=>{const[n,o,r]=rl({...e,sourcePosition:e.sourcePosition??J.Bottom,targetPosition:e.targetPosition??J.Top});return ye(Yn,{path:n,labelX:o,labelY:r,...t,...e})}}}),ff={input:Kd,default:Wd,output:Zd},hf={default:cf,straight:sf,step:uf,smoothstep:al,simplebezier:df};function gf(e,t,n){const o=he(()=>y=>t.value.get(y)),r=he(()=>y=>n.value.get(y)),i=he(()=>{const y={...hf,...e.edgeTypes},g=Object.keys(y);for(const _ of e.edges)_.type&&!g.includes(_.type)&&(y[_.type]=_.type);return y}),l=he(()=>{const y={...ff,...e.nodeTypes},g=Object.keys(y);for(const _ of e.nodes)_.type&&!g.includes(_.type)&&(y[_.type]=_.type);return y}),a=he(()=>e.onlyRenderVisibleElements?bi(e.nodes,{x:0,y:0,width:e.dimensions.width,height:e.dimensions.height},e.viewport,!0):e.nodes),u=he(()=>{if(e.onlyRenderVisibleElements){const y=[];for(const g of e.edges){const _=t.value.get(g.source),S=t.value.get(g.target);md({sourcePos:_.computedPosition||{x:0,y:0},targetPos:S.computedPosition||{x:0,y:0},sourceWidth:_.dimensions.width,sourceHeight:_.dimensions.height,targetWidth:S.dimensions.width,targetHeight:S.dimensions.height,width:e.dimensions.width,height:e.dimensions.height,viewport:e.viewport})&&y.push(g)}return y}return e.edges}),s=he(()=>[...a.value,...u.value]),c=he(()=>{const y=[];for(const g of e.nodes)g.selected&&y.push(g);return y}),d=he(()=>{const y=[];for(const g of e.edges)g.selected&&y.push(g);return y}),f=he(()=>[...c.value,...d.value]),h=he(()=>{const y=[];for(const g of e.nodes)g.dimensions.width&&g.dimensions.height&&g.handleBounds!==void 0&&y.push(g);return y}),m=he(()=>a.value.length>0&&h.value.length===a.value.length);return{getNode:o,getEdge:r,getElements:s,getEdgeTypes:i,getNodeTypes:l,getEdges:u,getNodes:a,getSelectedElements:f,getSelectedNodes:c,getSelectedEdges:d,getNodesInitialized:h,areNodesInitialized:m}}class Et{constructor(){this.currentId=0,this.flows=new Map}static getInstance(){var t;const n=(t=gt())==null?void 0:t.appContext.app,o=n?.config.globalProperties.$vueFlowStorage??Et.instance;return Et.instance=o??new Et,n&&(n.config.globalProperties.$vueFlowStorage=Et.instance),Et.instance}set(t,n){return this.flows.set(t,n)}get(t){return this.flows.get(t)}remove(t){return this.flows.delete(t)}create(t,n){const o=Ji(),r=nr(o),i={};for(const[f,h]of Object.entries(r.hooks)){const m=`on${f.charAt(0).toUpperCase()+f.slice(1)}`;i[m]=h.on}const l={};for(const[f,h]of Object.entries(r.hooks))l[f]=h.trigger;const a=he(()=>{const f=new Map;for(const h of r.nodes)f.set(h.id,h);return f}),u=he(()=>{const f=new Map;for(const h of r.edges)f.set(h.id,h);return f}),s=gf(r,a,u),c=jd(r,a,u);c.setState({...r,...n});const d={...i,...s,...c,...fa(r),nodeLookup:a,edgeLookup:u,emits:l,id:t,vueFlowVersion:"1.48.2",$destroy:()=>{this.remove(t)}};return this.set(t,d),d}getId(){return`vue-flow-${this.currentId++}`}}function Ee(e){const t=Et.getInstance(),n=Kn(),o=typeof e=="object",r=o?e:{id:e},i=r.id,l=i??n?.vueFlowId;let a;if(n){const u=ot(Xi,null);typeof u<"u"&&u!==null&&(!l||u.id===l)&&(a=u)}if(a||l&&(a=t.get(l)),!a||l&&a.id!==l){const u=i??t.getId(),s=t.create(u,r);a=s,(n??qn(!0)).run(()=>{_e(s.applyDefault,(d,f,h)=>{const m=g=>{s.applyNodeChanges(g)},y=g=>{s.applyEdgeChanges(g)};d?(s.onNodesChange(m),s.onEdgesChange(y)):(s.hooks.value.nodesChange.off(m),s.hooks.value.edgesChange.off(y)),h(()=>{s.hooks.value.nodesChange.off(m),s.hooks.value.edgesChange.off(y)})},{immediate:!0}),Bt(()=>{if(a){const d=t.get(a.id);d?d.$destroy():nn(`No store instance found for id ${a.id} in storage.`)}})})}else o&&a.setState(r);if(n&&(ft(Xi,a),n.vueFlowId=a.id),o){const u=gt();u?.type.name!=="VueFlow"&&a.emits.error(new Oe(Ce.USEVUEFLOW_OPTIONS))}return a}function pf(e){const{emits:t,dimensions:n}=Ee();let o;Ke(()=>{const r=()=>{var i,l;if(!e.value||!(((l=(i=e.value).checkVisibility)==null?void 0:l.call(i))??!0))return;const a=Tn(e.value);(a.width===0||a.height===0)&&t.error(new Oe(Ce.MISSING_VIEWPORT_DIMENSIONS)),n.value={width:a.width||500,height:a.height||500}};r(),window.addEventListener("resize",r),e.value&&(o=new ResizeObserver(()=>r()),o.observe(e.value)),Jn(()=>{window.removeEventListener("resize",r),o&&e.value&&o.unobserve(e.value)})})}const vf=Ne({...{name:"UserSelection",compatConfig:{MODE:3}},props:{userSelectionRect:{}},setup(e){return(t,n)=>(ee(),de("div",{class:"vue-flow__selection vue-flow__container",style:Te({width:`${t.userSelectionRect.width}px`,height:`${t.userSelectionRect.height}px`,transform:`translate(${t.userSelectionRect.x}px, ${t.userSelectionRect.y}px)`})},null,4))}}),mf=["tabIndex"],_f=Ne({...{name:"NodesSelection",compatConfig:{MODE:3}},setup(e){const{emits:t,viewport:n,getSelectedNodes:o,noPanClassName:r,disableKeyboardA11y:i,userSelectionActive:l}=Ee(),a=qi(),u=xe(null),s=Wi({el:u,onStart(m){t.selectionDragStart(m),t.nodeDragStart(m)},onDrag(m){t.selectionDrag(m),t.nodeDrag(m)},onStop(m){t.selectionDragStop(m),t.nodeDragStop(m)}});Ke(()=>{var m;i.value||(m=u.value)==null||m.focus({preventScroll:!0})});const c=he(()=>wi(o.value)),d=he(()=>({width:`${c.value.width}px`,height:`${c.value.height}px`,top:`${c.value.y}px`,left:`${c.value.x}px`}));function f(m){t.selectionContextMenu({event:m,nodes:o.value})}function h(m){i.value||Ot[m.key]&&(m.preventDefault(),a({x:Ot[m.key].x,y:Ot[m.key].y},m.shiftKey))}return(m,y)=>!q(l)&&c.value.width&&c.value.height?(ee(),de("div",{key:0,class:ht(["vue-flow__nodesselection vue-flow__container",q(r)]),style:Te({transform:`translate(${q(n).x}px,${q(n).y}px) scale(${q(n).zoom})`})},[ce("div",{ref_key:"el",ref:u,class:ht([{dragging:q(s)},"vue-flow__nodesselection-rect"]),style:Te(d.value),tabIndex:q(i)?void 0:-1,onContextmenu:f,onKeydown:h},null,46,mf)],6)):Me("",!0)}});function yf(e,t){return{x:e.clientX-t.left,y:e.clientY-t.top}}const wf=Ne({...{name:"Pane",compatConfig:{MODE:3}},props:{isSelecting:{type:Boolean},selectionKeyPressed:{type:Boolean}},setup(e){const{vueFlowRef:t,nodes:n,viewport:o,emits:r,userSelectionActive:i,removeSelectedElements:l,userSelectionRect:a,elementsSelectable:u,nodesSelectionActive:s,getSelectedEdges:c,getSelectedNodes:d,removeNodes:f,removeEdges:h,selectionMode:m,deleteKeyCode:y,multiSelectionKeyCode:g,multiSelectionActive:_,edgeLookup:S,nodeLookup:p,connectionLookup:C,defaultEdgeOptions:z,connectionStartHandle:V,panOnDrag:L}=Ee(),B=qe(null),U=qe(new Set),X=qe(new Set),A=qe(null),w=be(()=>u.value&&(e.isSelecting||i.value)),P=be(()=>V.value!==null);let b=!1,N=!1;const E=qt(y,{actInsideInputWithModifier:!1}),O=qt(g);_e(E,M=>{M&&(f(d.value),h(c.value),s.value=!1)}),_e(O,M=>{_.value=M});function T(M,D){return G=>{G.target===D&&M?.(G)}}function R(M){if(b||P.value){b=!1;return}r.paneClick(M),l(),s.value=!1}function H(M){var D;if(Array.isArray(L.value)&&((D=L.value)!=null&&D.includes(2))){M.preventDefault();return}r.paneContextMenu(M)}function Y(M){r.paneScroll(M)}function j(M){var D,G,F;if(A.value=((D=t.value)==null?void 0:D.getBoundingClientRect())??null,!u.value||!e.isSelecting||M.button!==0||M.target!==B.value||!A.value)return;(F=(G=M.target)==null?void 0:G.setPointerCapture)==null||F.call(G,M.pointerId);const{x:oe,y:re}=yf(M,A.value);N=!0,b=!1,l(),a.value={width:0,height:0,startX:oe,startY:re,x:oe,y:re},r.selectionStart(M)}function Q(M){var D;if(!A.value||!a.value)return;b=!0;const{x:G,y:F}=Ue(M,A.value),{startX:oe=0,startY:re=0}=a.value,ge={startX:oe,startY:re,x:G<oe?G:oe,y:F<re?F:re,width:Math.abs(G-oe),height:Math.abs(F-re)},se=U.value,ae=X.value;U.value=new Set(bi(n.value,ge,o.value,m.value===Eo.Partial,!0).map(v=>v.id)),X.value=new Set;const x=((D=z.value)==null?void 0:D.selectable)??!0;for(const v of U.value){const k=C.value.get(v);if(k)for(const{edgeId:I}of k.values()){const $=S.value.get(I);$&&($.selectable??x)&&X.value.add(I)}}if(!Gi(se,U.value)){const v=st(p.value,U.value,!0);r.nodesChange(v)}if(!Gi(ae,X.value)){const v=st(S.value,X.value);r.edgesChange(v)}a.value=ge,i.value=!0,s.value=!1}function fe(M){var D;M.button!==0||!N||((D=M.target)==null||D.releasePointerCapture(M.pointerId),!i.value&&a.value&&M.target===B.value&&R(M),i.value=!1,a.value=null,s.value=U.value.size>0,r.selectionEnd(M),e.selectionKeyPressed&&(b=!1),N=!1)}return(M,D)=>(ee(),de("div",{ref_key:"container",ref:B,class:ht(["vue-flow__pane vue-flow__container",{selection:M.isSelecting}]),onClick:D[0]||(D[0]=G=>w.value?void 0:T(R,B.value)(G)),onContextmenu:D[1]||(D[1]=G=>T(H,B.value)(G)),onWheelPassive:D[2]||(D[2]=G=>T(Y,B.value)(G)),onPointerenter:D[3]||(D[3]=G=>w.value?void 0:q(r).paneMouseEnter(G)),onPointerdown:D[4]||(D[4]=G=>w.value?j(G):q(r).paneMouseMove(G)),onPointermove:D[5]||(D[5]=G=>w.value?Q(G):q(r).paneMouseMove(G)),onPointerup:D[6]||(D[6]=G=>w.value?fe(G):void 0),onPointerleave:D[7]||(D[7]=G=>q(r).paneMouseLeave(G))},[ke(M.$slots,"default"),q(i)&&q(a)?(ee(),Ie(vf,{key:0,"user-selection-rect":q(a)},null,8,["user-selection-rect"])):Me("",!0),q(s)&&q(d).length?(ee(),Ie(_f,{key:1})):Me("",!0)],34))}}),bf=Ne({...{name:"Transform",compatConfig:{MODE:3}},setup(e){const{viewport:t,fitViewOnInit:n,fitViewOnInitDone:o}=Ee(),r=he(()=>n.value?!o.value:!1),i=he(()=>`translate(${t.value.x}px,${t.value.y}px) scale(${t.value.zoom})`);return(l,a)=>(ee(),de("div",{class:"vue-flow__transformationpane vue-flow__container",style:Te({transform:i.value,opacity:r.value?0:void 0})},[ke(l.$slots,"default")],4))}}),xf=Ne({...{name:"Viewport",compatConfig:{MODE:3}},setup(e){const{minZoom:t,maxZoom:n,defaultViewport:o,translateExtent:r,zoomActivationKeyCode:i,selectionKeyCode:l,panActivationKeyCode:a,panOnScroll:u,panOnScrollMode:s,panOnScrollSpeed:c,panOnDrag:d,zoomOnDoubleClick:f,zoomOnPinch:h,zoomOnScroll:m,preventScrolling:y,noWheelClassName:g,noPanClassName:_,emits:S,connectionStartHandle:p,userSelectionActive:C,paneDragging:z,d3Zoom:V,d3Selection:L,d3ZoomHandler:B,viewport:U,viewportRef:X,paneClickDistance:A}=Ee();pf(X);const w=qe(!1),P=qe(!1);let b=null,N=!1,E=0,O={x:0,y:0,zoom:0};const T=qt(a),R=qt(l),H=qt(i),Y=be(()=>(!R.value||R.value&&l.value===!0)&&(T.value||d.value)),j=be(()=>T.value||u.value),Q=be(()=>l.value===!0&&Y.value!==!0),fe=be(()=>R.value&&l.value!==!0||C.value||Q.value),M=be(()=>p.value!==null);Ke(()=>{if(!X.value){nn("Viewport element is missing");return}const re=X.value,ge=re.getBoundingClientRect(),se=Kc().clickDistance(A.value).scaleExtent([t.value,n.value]).translateExtent(r.value),ae=Le(re).call(se),x=ae.on("wheel.zoom"),v=Mt.translate(o.value.x??0,o.value.y??0).scale(bt(o.value.zoom??1,t.value,n.value)),k=[[0,0],[ge.width,ge.height]],I=se.constrain()(v,k,r.value);se.transform(ae,I),se.wheelDelta(Si),V.value=se,L.value=ae,B.value=x,U.value={x:I.x,y:I.y,zoom:I.k},se.on("start",$=>{var Z;if(!$.sourceEvent)return null;E=$.sourceEvent.button,w.value=!0;const K=F($.transform);((Z=$.sourceEvent)==null?void 0:Z.type)==="mousedown"&&(z.value=!0),O=K,S.viewportChangeStart(K),S.moveStart({event:$,flowTransform:K})}),se.on("end",$=>{if(!$.sourceEvent)return null;if(w.value=!1,z.value=!1,D(Y.value,E??0)&&!N&&S.paneContextMenu($.sourceEvent),N=!1,G(O,$.transform)){const Z=F($.transform);O=Z,S.viewportChangeEnd(Z),S.moveEnd({event:$,flowTransform:Z})}}),se.filter($=>{var Z;const K=H.value||m.value,ie=h.value&&$.ctrlKey,te=$.button,ue=$.type==="wheel";if(te===1&&$.type==="mousedown"&&(oe($,"vue-flow__node")||oe($,"vue-flow__edge")))return!0;if(!Y.value&&!K&&!j.value&&!f.value&&!h.value||C.value||M.value&&!ue||!f.value&&$.type==="dblclick"||oe($,g.value)&&ue||oe($,_.value)&&(!ue||j.value&&ue&&!H.value)||!h.value&&$.ctrlKey&&ue||!K&&!j.value&&!ie&&ue)return!1;if(!h&&$.type==="touchstart"&&((Z=$.touches)==null?void 0:Z.length)>1)return $.preventDefault(),!1;if(!Y.value&&($.type==="mousedown"||$.type==="touchstart")||Q.value&&Array.isArray(d.value)&&d.value.includes(0)&&te===0||Array.isArray(d.value)&&!d.value.includes(te)&&($.type==="mousedown"||$.type==="touchstart"))return!1;const ve=Array.isArray(d.value)&&d.value.includes(te)||l.value===!0&&Array.isArray(d.value)&&!d.value.includes(0)||!te||te<=1;return(!$.ctrlKey||T.value||ue)&&ve}),_e([C,Y],()=>{C.value&&!w.value?se.on("zoom",null):C.value||se.on("zoom",$=>{U.value={x:$.transform.x,y:$.transform.y,zoom:$.transform.k};const Z=F($.transform);N=D(Y.value,E??0),S.viewportChange(Z),S.move({event:$,flowTransform:Z})})},{immediate:!0}),_e([C,j,s,H,h,y,g],()=>{j.value&&!H.value&&!C.value?ae.on("wheel.zoom",$=>{if(oe($,g.value))return!1;const Z=H.value||m.value,K=h.value&&$.ctrlKey;if(!(!y.value||j.value||Z||K))return!1;$.preventDefault(),$.stopImmediatePropagation();const te=ae.property("__zoom").k||1,ue=An();if(!T.value&&$.ctrlKey&&h.value&&ue){const Av=Ye($),zv=Si($),Rv=te*2**zv;se.scaleTo(ae,Rv,Av,$);return}const ve=$.deltaMode===1?20:1;let we=s.value===Kt.Vertical?0:$.deltaX*ve,dt=s.value===Kt.Horizontal?0:$.deltaY*ve;!ue&&$.shiftKey&&s.value!==Kt.Vertical&&!we&&dt&&(we=dt,dt=0),se.translateBy(ae,-(we/te)*c.value,-(dt/te)*c.value);const Ze=F(ae.property("__zoom"));b&&clearTimeout(b),P.value?(S.move({event:$,flowTransform:Ze}),S.viewportChange(Ze),b=setTimeout(()=>{S.moveEnd({event:$,flowTransform:Ze}),S.viewportChangeEnd(Ze),P.value=!1},150)):(P.value=!0,S.moveStart({event:$,flowTransform:Ze}),S.viewportChangeStart(Ze))},{passive:!1}):typeof x<"u"&&ae.on("wheel.zoom",function($,Z){const K=!y.value&&$.type==="wheel"&&!$.ctrlKey,ie=H.value||m.value,te=h.value&&$.ctrlKey;if(!ie&&!u.value&&!te&&$.type==="wheel"||K||oe($,g.value))return null;$.preventDefault(),x.call(this,$,Z)},{passive:!1})},{immediate:!0})});function D(re,ge){return ge===2&&Array.isArray(re)&&re.includes(2)}function G(re,ge){return re.x!==ge.x&&!Number.isNaN(ge.x)||re.y!==ge.y&&!Number.isNaN(ge.y)||re.zoom!==ge.k&&!Number.isNaN(ge.k)}function F(re){return{x:re.x,y:re.y,zoom:re.k}}function oe(re,ge){return re.target.closest(`.${ge}`)}return(re,ge)=>(ee(),de("div",{ref_key:"viewportRef",ref:X,class:"vue-flow__viewport vue-flow__container"},[le(wf,{"is-selecting":fe.value,"selection-key-pressed":q(R),class:ht({connecting:M.value,dragging:q(z),draggable:q(d)===!0||Array.isArray(q(d))&&q(d).includes(0)})},{default:me(()=>[le(bf,null,{default:me(()=>[ke(re.$slots,"default")]),_:3})]),_:3},8,["is-selecting","selection-key-pressed","class"])],512))}}),Ef=["id"],Nf=["id"],Sf=["id"],kf=Ne({...{name:"A11yDescriptions",compatConfig:{MODE:3}},setup(e){const{id:t,disableKeyboardA11y:n,ariaLiveMessage:o}=Ee();return(r,i)=>(ee(),de(Be,null,[ce("div",{id:`${q(di)}-${q(t)}`,style:{display:"none"}}," Press enter or space to select a node. "+De(q(n)?"":"You can then use the arrow keys to move the node around.")+" You can then use the arrow keys to move the node around, press delete to remove it and press escape to cancel. ",9,Ef),ce("div",{id:`${q(fi)}-${q(t)}`,style:{display:"none"}}," Press enter or space to select an edge. You can then press delete to remove it or press escape to cancel. ",8,Nf),q(n)?Me("",!0):(ee(),de("div",{key:0,id:`${q(nd)}-${q(t)}`,"aria-live":"assertive","aria-atomic":"true",style:{position:"absolute",width:"1px",height:"1px",margin:"-1px",border:"0",padding:"0",overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)","clip-path":"inset(100%)"}},De(q(o)),9,Sf))],64))}});function Cf(){const e=Ee();_e(()=>e.viewportHelper.value.viewportInitialized,t=>{t&&setTimeout(()=>{e.emits.init(e),e.emits.paneReady(e)},1)})}function $f(e,t,n){return n===J.Left?e-t:n===J.Right?e+t:e}function If(e,t,n){return n===J.Top?e-t:n===J.Bottom?e+t:e}const Ro=function({radius:e=10,centerX:t=0,centerY:n=0,position:o=J.Top,type:r}){return ye("circle",{class:`vue-flow__edgeupdater vue-flow__edgeupdater-${r}`,cx:$f(t,e,o),cy:If(n,e,o),r:e,stroke:"transparent",fill:"transparent"})};Ro.props=["radius","centerX","centerY","position","type"],Ro.compatConfig={MODE:3};const sl=Ro,Mf=Ne({name:"Edge",compatConfig:{MODE:3},props:["id"],setup(e){const{id:t,addSelectedEdges:n,connectionMode:o,edgeUpdaterRadius:r,emits:i,nodesSelectionActive:l,noPanClassName:a,getEdgeTypes:u,removeSelectedEdges:s,findEdge:c,findNode:d,isValidConnection:f,multiSelectionActive:h,disableKeyboardA11y:m,elementsSelectable:y,edgesUpdatable:g,edgesFocusable:_,hooks:S}=Ee(),p=he(()=>c(e.id)),{emit:C,on:z}=Td(p.value,i),V=ot(Rn),L=gt(),B=xe(!1),U=xe(!1),X=xe(""),A=xe(null),w=xe("source"),P=xe(null),b=be(()=>typeof p.value.selectable>"u"?y.value:p.value.selectable),N=be(()=>typeof p.value.updatable>"u"?g.value:p.value.updatable),E=be(()=>typeof p.value.focusable>"u"?_.value:p.value.focusable);ft(Md,e.id),ft(Od,P);const O=he(()=>p.value.class instanceof Function?p.value.class(p.value):p.value.class),T=he(()=>p.value.style instanceof Function?p.value.style(p.value):p.value.style),R=he(()=>{const v=p.value.type||"default",k=V?.[`edge-${v}`];if(k)return k;let I=p.value.template??u.value[v];if(typeof I=="string"&&L){const $=Object.keys(L.appContext.components);$&&$.includes(v)&&(I=Se(v,!1))}return I&&typeof I!="string"?I:(i.error(new Oe(Ce.EDGE_TYPE_MISSING,I)),!1)}),{handlePointerDown:H}=Zi({nodeId:X,handleId:A,type:w,isValidConnection:f,edgeUpdaterType:w,onEdgeUpdate:Q,onEdgeUpdateEnd:fe});return()=>{const v=d(p.value.source),k=d(p.value.target),I="pathOptions"in p.value?p.value.pathOptions:{};if(!v&&!k)return i.error(new Oe(Ce.EDGE_SOURCE_TARGET_MISSING,p.value.id,p.value.source,p.value.target)),null;if(!v)return i.error(new Oe(Ce.EDGE_SOURCE_MISSING,p.value.id,p.value.source)),null;if(!k)return i.error(new Oe(Ce.EDGE_TARGET_MISSING,p.value.id,p.value.target)),null;if(!p.value||p.value.hidden||v.hidden||k.hidden)return null;let $;o.value===it.Strict?$=v.handleBounds.source:$=[...v.handleBounds.source||[],...v.handleBounds.target||[]];const Z=Ai($,p.value.sourceHandle);let K;o.value===it.Strict?K=k.handleBounds.target:K=[...k.handleBounds.target||[],...k.handleBounds.source||[]];const ie=Ai(K,p.value.targetHandle),te=Z?.position||J.Bottom,ue=ie?.position||J.Top,{x:ve,y:we}=Tt(v,Z,te),{x:dt,y:Ze}=Tt(k,ie,ue);return p.value.sourceX=ve,p.value.sourceY=we,p.value.targetX=dt,p.value.targetY=Ze,ye("g",{ref:P,key:e.id,"data-id":e.id,class:["vue-flow__edge",`vue-flow__edge-${R.value===!1?"default":p.value.type||"default"}`,a.value,O.value,{updating:B.value,selected:p.value.selected,animated:p.value.animated,inactive:!b.value&&!S.value.edgeClick.hasListeners()}],tabIndex:E.value?0:void 0,"aria-label":p.value.ariaLabel===null?void 0:p.value.ariaLabel??`Edge from ${p.value.source} to ${p.value.target}`,"aria-describedby":E.value?`${fi}-${t}`:void 0,"aria-roledescription":"edge",role:E.value?"group":"img",...p.value.domAttributes,onClick:D,onContextmenu:G,onDblclick:F,onMouseenter:oe,onMousemove:re,onMouseleave:ge,onKeyDown:E.value?x:void 0},[U.value?null:ye(R.value===!1?u.value.default:R.value,{id:e.id,sourceNode:v,targetNode:k,source:p.value.source,target:p.value.target,type:p.value.type,updatable:N.value,selected:p.value.selected,animated:p.value.animated,label:p.value.label,labelStyle:p.value.labelStyle,labelShowBg:p.value.labelShowBg,labelBgStyle:p.value.labelBgStyle,labelBgPadding:p.value.labelBgPadding,labelBgBorderRadius:p.value.labelBgBorderRadius,data:p.value.data,events:{...p.value.events,...z},style:T.value,markerStart:`url('#${tn(p.value.markerStart,t)}')`,markerEnd:`url('#${tn(p.value.markerEnd,t)}')`,sourcePosition:te,targetPosition:ue,sourceX:ve,sourceY:we,targetX:dt,targetY:Ze,sourceHandleId:p.value.sourceHandle,targetHandleId:p.value.targetHandle,interactionWidth:p.value.interactionWidth,...I}),[N.value==="source"||N.value===!0?[ye("g",{onMousedown:se,onMouseenter:Y,onMouseout:j},ye(sl,{position:te,centerX:ve,centerY:we,radius:r.value,type:"source","data-type":"source"}))]:null,N.value==="target"||N.value===!0?[ye("g",{onMousedown:ae,onMouseenter:Y,onMouseout:j},ye(sl,{position:ue,centerX:dt,centerY:Ze,radius:r.value,type:"target","data-type":"target"}))]:null]])};function Y(){B.value=!0}function j(){B.value=!1}function Q(v,k){C.update({event:v,edge:p.value,connection:k})}function fe(v){C.updateEnd({event:v,edge:p.value}),U.value=!1}function M(v,k){v.button===0&&(U.value=!0,X.value=k?p.value.target:p.value.source,A.value=(k?p.value.targetHandle:p.value.sourceHandle)??null,w.value=k?"target":"source",C.updateStart({event:v,edge:p.value}),H(v))}function D(v){var k;const I={event:v,edge:p.value};b.value&&(l.value=!1,p.value.selected&&h.value?(s([p.value]),(k=P.value)==null||k.blur()):n([p.value])),C.click(I)}function G(v){C.contextMenu({event:v,edge:p.value})}function F(v){C.doubleClick({event:v,edge:p.value})}function oe(v){C.mouseEnter({event:v,edge:p.value})}function re(v){C.mouseMove({event:v,edge:p.value})}function ge(v){C.mouseLeave({event:v,edge:p.value})}function se(v){M(v,!0)}function ae(v){M(v,!1)}function x(v){var k;!m.value&&hi.includes(v.key)&&b.value&&(v.key==="Escape"?((k=P.value)==null||k.blur(),s([c(e.id)])):n([c(e.id)]))}}}),Of=Ne({name:"ConnectionLine",compatConfig:{MODE:3},setup(){var e;const{id:t,connectionMode:n,connectionStartHandle:o,connectionEndHandle:r,connectionPosition:i,connectionLineType:l,connectionLineStyle:a,connectionLineOptions:u,connectionStatus:s,viewport:c,findNode:d}=Ee(),f=(e=ot(Rn))==null?void 0:e["connection-line"],h=he(()=>{var S;return d((S=o.value)==null?void 0:S.nodeId)}),m=he(()=>{var S;return d((S=r.value)==null?void 0:S.nodeId)??null}),y=he(()=>({x:(i.value.x-c.value.x)/c.value.zoom,y:(i.value.y-c.value.y)/c.value.zoom})),g=he(()=>u.value.markerStart?`url(#${tn(u.value.markerStart,t)})`:""),_=he(()=>u.value.markerEnd?`url(#${tn(u.value.markerEnd,t)})`:"");return()=>{var S,p,C;if(!h.value||!o.value)return null;const z=o.value.id,V=o.value.type,L=h.value.handleBounds;let B=L?.[V]??[];if(n.value===it.Loose){const T=L?.[V==="source"?"target":"source"]??[];B=[...B,...T]}if(!B)return null;const U=(z?B.find(T=>T.id===z):B[0])??null,X=U?.position??J.Top,{x:A,y:w}=Tt(h.value,U,X);let P=null;m.value&&(n.value===it.Strict?P=((S=m.value.handleBounds[V==="source"?"target":"source"])==null?void 0:S.find(T=>{var R;return T.id===((R=r.value)==null?void 0:R.id)}))||null:P=((p=[...m.value.handleBounds.source??[],...m.value.handleBounds.target??[]])==null?void 0:p.find(T=>{var R;return T.id===((R=r.value)==null?void 0:R.id)}))||null);const b=((C=r.value)==null?void 0:C.position)??(X?Oo[X]:null);if(!X||!b)return null;const N=l.value??u.value.type??wt.Bezier;let E="";const O={sourceX:A,sourceY:w,sourcePosition:X,targetX:y.value.x,targetY:y.value.y,targetPosition:b};return N===wt.Bezier?[E]=nl(O):N===wt.Step?[E]=zo({...O,borderRadius:0}):N===wt.SmoothStep?[E]=zo(O):N===wt.SimpleBezier?[E]=rl(O):E=`M${A},${w} ${y.value.x},${y.value.y}`,ye("svg",{class:"vue-flow__edges vue-flow__connectionline vue-flow__container"},ye("g",{class:"vue-flow__connection"},f?ye(f,{sourceX:A,sourceY:w,sourcePosition:X,targetX:y.value.x,targetY:y.value.y,targetPosition:b,sourceNode:h.value,sourceHandle:U,targetNode:m.value,targetHandle:P,markerEnd:_.value,markerStart:g.value,connectionStatus:s.value}):ye("path",{d:E,class:[u.value.class,s.value,"vue-flow__connection-path"],style:{...a.value,...u.value.style},"marker-end":_.value,"marker-start":g.value})))}}}),Df=["id","markerWidth","markerHeight","markerUnits","orient"],Tf=Ne({...{name:"MarkerType",compatConfig:{MODE:3}},props:{id:{},type:{},color:{default:"none"},width:{default:12.5},height:{default:12.5},markerUnits:{default:"strokeWidth"},orient:{default:"auto-start-reverse"},strokeWidth:{default:1}},setup(e){return(t,n)=>(ee(),de("marker",{id:t.id,class:"vue-flow__arrowhead",viewBox:"-10 -10 20 20",refX:"0",refY:"0",markerWidth:`${t.width}`,markerHeight:`${t.height}`,markerUnits:t.markerUnits,orient:t.orient},[t.type===q(No).ArrowClosed?(ee(),de("polyline",{key:0,style:Te({stroke:t.color,fill:t.color,strokeWidth:t.strokeWidth}),"stroke-linecap":"round","stroke-linejoin":"round",points:"-5,-4 0,0 -5,4 -5,-4"},null,4)):Me("",!0),t.type===q(No).Arrow?(ee(),de("polyline",{key:1,style:Te({stroke:t.color,strokeWidth:t.strokeWidth}),"stroke-linecap":"round","stroke-linejoin":"round",fill:"none",points:"-5,-4 0,0 -5,4"},null,4)):Me("",!0)],8,Df))}}),Pf={class:"vue-flow__marker vue-flow__container","aria-hidden":"true"},Af=Ne({...{name:"MarkerDefinitions",compatConfig:{MODE:3}},setup(e){const{id:t,edges:n,connectionLineOptions:o,defaultMarkerColor:r}=Ee(),i=he(()=>{const l=new Set,a=[],u=s=>{if(s){const c=tn(s,t);l.has(c)||(typeof s=="object"?a.push({...s,id:c,color:s.color||r.value}):a.push({id:c,color:r.value,type:s}),l.add(c))}};for(const s of[o.value.markerEnd,o.value.markerStart])u(s);for(const s of n.value)for(const c of[s.markerStart,s.markerEnd])u(c);return a.sort((s,c)=>s.id.localeCompare(c.id))});return(l,a)=>(ee(),de("svg",Pf,[ce("defs",null,[(ee(!0),de(Be,null,sn(i.value,u=>(ee(),Ie(Tf,{id:u.id,key:u.id,type:u.type,color:u.color,width:u.width,height:u.height,markerUnits:u.markerUnits,"stroke-width":u.strokeWidth,orient:u.orient},null,8,["id","type","color","width","height","markerUnits","stroke-width","orient"]))),128))])]))}}),zf=Ne({...{name:"Edges",compatConfig:{MODE:3}},setup(e){const{findNode:t,getEdges:n,elevateEdgesOnSelect:o}=Ee();return(r,i)=>(ee(),de(Be,null,[le(Af),(ee(!0),de(Be,null,sn(q(n),l=>(ee(),de("svg",{key:l.id,class:"vue-flow__edges vue-flow__container",style:Te({zIndex:q(_d)(l,q(t),q(o))})},[le(q(Mf),{id:l.id},null,8,["id"])],4))),128)),le(q(Of))],64))}}),Rf=Ne({name:"Node",compatConfig:{MODE:3},props:["id","resizeObserver"],setup(e){const{id:t,noPanClassName:n,selectNodesOnDrag:o,nodesSelectionActive:r,multiSelectionActive:i,emits:l,removeSelectedNodes:a,addSelectedNodes:u,updateNodeDimensions:s,onUpdateNodeInternals:c,getNodeTypes:d,nodeExtent:f,elevateNodesOnSelect:h,disableKeyboardA11y:m,ariaLiveMessage:y,snapToGrid:g,snapGrid:_,nodeDragThreshold:S,nodesDraggable:p,elementsSelectable:C,nodesConnectable:z,nodesFocusable:V,hooks:L}=Ee(),B=xe(null);ft(Ui,B),ft(ji,e.id);const U=ot(Rn),X=gt(),A=qi(),{node:w,parentNode:P}=Ki(e.id),{emit:b,on:N}=Rd(w,l),E=be(()=>typeof w.draggable>"u"?p.value:w.draggable),O=be(()=>typeof w.selectable>"u"?C.value:w.selectable),T=be(()=>typeof w.connectable>"u"?z.value:w.connectable),R=be(()=>typeof w.focusable>"u"?V.value:w.focusable),H=he(()=>O.value||E.value||L.value.nodeClick.hasListeners()||L.value.nodeDoubleClick.hasListeners()||L.value.nodeMouseEnter.hasListeners()||L.value.nodeMouseMove.hasListeners()||L.value.nodeMouseLeave.hasListeners()),Y=be(()=>!!w.dimensions.width&&!!w.dimensions.height),j=he(()=>{const k=w.type||"default",I=U?.[`node-${k}`];if(I)return I;let $=w.template||d.value[k];if(typeof $=="string"&&X){const Z=Object.keys(X.appContext.components);Z&&Z.includes(k)&&($=Se(k,!1))}return $&&typeof $!="string"?$:(l.error(new Oe(Ce.NODE_TYPE_MISSING,$)),!1)}),Q=Wi({id:e.id,el:B,disabled:()=>!E.value,selectable:O,dragHandle:()=>w.dragHandle,onStart(k){b.dragStart(k)},onDrag(k){b.drag(k)},onStop(k){b.dragStop(k)},onClick(k){x(k)}}),fe=he(()=>w.class instanceof Function?w.class(w):w.class),M=he(()=>{const k=(w.style instanceof Function?w.style(w):w.style)||{},I=w.width instanceof Function?w.width(w):w.width,$=w.height instanceof Function?w.height(w):w.height;return!k.width&&I&&(k.width=typeof I=="string"?I:`${I}px`),!k.height&&$&&(k.height=typeof $=="string"?$:`${$}px`),k}),D=be(()=>Number(w.zIndex??M.value.zIndex??0));return c(k=>{(k.includes(e.id)||!k.length)&&F()}),Ke(()=>{_e(()=>w.hidden,(k=!1,I,$)=>{!k&&B.value&&(e.resizeObserver.observe(B.value),$(()=>{B.value&&e.resizeObserver.unobserve(B.value)}))},{immediate:!0,flush:"post"})}),_e([()=>w.type,()=>w.sourcePosition,()=>w.targetPosition],()=>{Ae(()=>{s([{id:e.id,nodeElement:B.value,forceUpdate:!0}])})}),_e([()=>w.position.x,()=>w.position.y,()=>{var k;return(k=P.value)==null?void 0:k.computedPosition.x},()=>{var k;return(k=P.value)==null?void 0:k.computedPosition.y},()=>{var k;return(k=P.value)==null?void 0:k.computedPosition.z},D,()=>w.selected,()=>w.dimensions.height,()=>w.dimensions.width,()=>{var k;return(k=P.value)==null?void 0:k.dimensions.height},()=>{var k;return(k=P.value)==null?void 0:k.dimensions.width}],([k,I,$,Z,K,ie])=>{const te={x:k,y:I,z:ie+(h.value&&w.selected?1e3:0)};typeof $<"u"&&typeof Z<"u"?w.computedPosition=fd({x:$,y:Z,z:K},te):w.computedPosition=te},{flush:"post",immediate:!0}),_e([()=>w.extent,f],([k,I],[$,Z])=>{(k!==$||I!==Z)&&G()}),w.extent==="parent"||typeof w.extent=="object"&&"range"in w.extent&&w.extent.range==="parent"?to(()=>Y).toBe(!0).then(G):G(),()=>w.hidden?null:ye("div",{ref:B,"data-id":w.id,class:["vue-flow__node",`vue-flow__node-${j.value===!1?"default":w.type||"default"}`,{[n.value]:E.value,dragging:Q?.value,draggable:E.value,selected:w.selected,selectable:O.value,parent:w.isParent},fe.value],style:{visibility:Y.value?"visible":"hidden",zIndex:w.computedPosition.z??D.value,transform:`translate(${w.computedPosition.x}px,${w.computedPosition.y}px)`,pointerEvents:H.value?"all":"none",...M.value},tabIndex:R.value?0:void 0,role:R.value?"group":void 0,"aria-describedby":m.value?void 0:`${di}-${t}`,"aria-label":w.ariaLabel,"aria-roledescription":"node",...w.domAttributes,onMouseenter:oe,onMousemove:re,onMouseleave:ge,onContextmenu:se,onClick:x,onDblclick:ae,onKeydown:v},[ye(j.value===!1?d.value.default:j.value,{id:w.id,type:w.type,data:w.data,events:{...w.events,...N},selected:w.selected,resizing:w.resizing,dragging:Q.value,connectable:T.value,position:w.computedPosition,dimensions:w.dimensions,isValidTargetPos:w.isValidTargetPos,isValidSourcePos:w.isValidSourcePos,parent:w.parentNode,parentNodeId:w.parentNode,zIndex:w.computedPosition.z??D.value,targetPosition:w.targetPosition,sourcePosition:w.sourcePosition,label:w.label,dragHandle:w.dragHandle,onUpdateNodeInternals:F})]);function G(){const k=w.computedPosition,{computedPosition:I,position:$}=$o(w,g.value?zn(k,_.value):k,l.error,f.value,P.value);(w.computedPosition.x!==I.x||w.computedPosition.y!==I.y)&&(w.computedPosition={...w.computedPosition,...I}),(w.position.x!==$.x||w.position.y!==$.y)&&(w.position=$)}function F(){B.value&&s([{id:e.id,nodeElement:B.value,forceUpdate:!0}])}function oe(k){Q?.value||b.mouseEnter({event:k,node:w})}function re(k){Q?.value||b.mouseMove({event:k,node:w})}function ge(k){Q?.value||b.mouseLeave({event:k,node:w})}function se(k){return b.contextMenu({event:k,node:w})}function ae(k){return b.doubleClick({event:k,node:w})}function x(k){O.value&&(!o.value||!E.value||S.value>0)&&Do(w,i.value,u,a,r,!1,B.value),b.click({event:k,node:w})}function v(k){if(!(So(k)||m.value))if(hi.includes(k.key)&&O.value){const I=k.key==="Escape";Do(w,i.value,u,a,r,I,B.value)}else E.value&&w.selected&&Ot[k.key]&&(k.preventDefault(),y.value=`Moved selected node ${k.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~w.position.x}, y: ${~~w.position.y}`,A({x:Ot[k.key].x,y:Ot[k.key].y},k.shiftKey))}}});function Bf(e={includeHiddenNodes:!1}){const{nodes:t}=Ee();return he(()=>{if(t.value.length===0)return!1;for(const n of t.value)if((e.includeHiddenNodes||!n.hidden)&&(n?.handleBounds===void 0||n.dimensions.width===0||n.dimensions.height===0))return!1;return!0})}const Vf={class:"vue-flow__nodes vue-flow__container"},Lf=Ne({...{name:"Nodes",compatConfig:{MODE:3}},setup(e){const{getNodes:t,updateNodeDimensions:n,emits:o}=Ee(),r=Bf(),i=xe();return _e(r,l=>{l&&Ae(()=>{o.nodesInitialized(t.value)})},{immediate:!0}),Ke(()=>{i.value=new ResizeObserver(l=>{const a=l.map(u=>({id:u.target.getAttribute("data-id"),nodeElement:u.target,forceUpdate:!0}));Ae(()=>n(a))})}),Jn(()=>{var l;return(l=i.value)==null?void 0:l.disconnect()}),(l,a)=>(ee(),de("div",Vf,[i.value?(ee(!0),de(Be,{key:0},sn(q(t),(u,s,c,d)=>{const f=[u.id];if(d&&d.key===u.id&&rr(d,f))return d;const h=(ee(),Ie(q(Rf),{id:u.id,key:u.id,"resize-observer":i.value},null,8,["id","resize-observer"]));return h.memo=f,h},a,0),128)):Me("",!0)]))}});function Hf(){const{emits:e}=Ee();Ke(()=>{if(Li()){const t=document.querySelector(".vue-flow__pane");t&&window.getComputedStyle(t).zIndex!=="1"&&e.error(new Oe(Ce.MISSING_STYLES))}})}const Ff=ce("div",{class:"vue-flow__edge-labels"},null,-1),Yf=Ne({...{name:"VueFlow",compatConfig:{MODE:3}},props:{id:{},modelValue:{},nodes:{},edges:{},edgeTypes:{},nodeTypes:{},connectionMode:{},connectionLineType:{},connectionLineStyle:{default:void 0},connectionLineOptions:{default:void 0},connectionRadius:{},isValidConnection:{type:[Function,null],default:void 0},deleteKeyCode:{default:void 0},selectionKeyCode:{type:[Boolean,null],default:void 0},multiSelectionKeyCode:{default:void 0},zoomActivationKeyCode:{default:void 0},panActivationKeyCode:{default:void 0},snapToGrid:{type:Boolean,default:void 0},snapGrid:{},onlyRenderVisibleElements:{type:Boolean,default:void 0},edgesUpdatable:{type:[Boolean,String],default:void 0},nodesDraggable:{type:Boolean,default:void 0},nodesConnectable:{type:Boolean,default:void 0},nodeDragThreshold:{},elementsSelectable:{type:Boolean,default:void 0},selectNodesOnDrag:{type:Boolean,default:void 0},panOnDrag:{type:[Boolean,Array],default:void 0},minZoom:{},maxZoom:{},defaultViewport:{},translateExtent:{},nodeExtent:{},defaultMarkerColor:{},zoomOnScroll:{type:Boolean,default:void 0},zoomOnPinch:{type:Boolean,default:void 0},panOnScroll:{type:Boolean,default:void 0},panOnScrollSpeed:{},panOnScrollMode:{},paneClickDistance:{},zoomOnDoubleClick:{type:Boolean,default:void 0},preventScrolling:{type:Boolean,default:void 0},selectionMode:{},edgeUpdaterRadius:{},fitViewOnInit:{type:Boolean,default:void 0},connectOnClick:{type:Boolean,default:void 0},applyDefault:{type:Boolean,default:void 0},autoConnect:{type:[Boolean,Function],default:void 0},noDragClassName:{},noWheelClassName:{},noPanClassName:{},defaultEdgeOptions:{},elevateEdgesOnSelect:{type:Boolean,default:void 0},elevateNodesOnSelect:{type:Boolean,default:void 0},disableKeyboardA11y:{type:Boolean,default:void 0},edgesFocusable:{type:Boolean,default:void 0},nodesFocusable:{type:Boolean,default:void 0},autoPanOnConnect:{type:Boolean,default:void 0},autoPanOnNodeDrag:{type:Boolean,default:void 0},autoPanSpeed:{}},emits:["nodesChange","edgesChange","nodesInitialized","paneReady","init","updateNodeInternals","error","connect","connectStart","connectEnd","clickConnectStart","clickConnectEnd","moveStart","move","moveEnd","selectionDragStart","selectionDrag","selectionDragStop","selectionContextMenu","selectionStart","selectionEnd","viewportChangeStart","viewportChange","viewportChangeEnd","paneScroll","paneClick","paneContextMenu","paneMouseEnter","paneMouseMove","paneMouseLeave","edgeUpdate","edgeContextMenu","edgeMouseEnter","edgeMouseMove","edgeMouseLeave","edgeDoubleClick","edgeClick","edgeUpdateStart","edgeUpdateEnd","nodeContextMenu","nodeMouseEnter","nodeMouseMove","nodeMouseLeave","nodeDoubleClick","nodeClick","nodeDragStart","nodeDrag","nodeDragStop","miniMapNodeClick","miniMapNodeDoubleClick","miniMapNodeMouseEnter","miniMapNodeMouseMove","miniMapNodeMouseLeave","update:modelValue","update:nodes","update:edges"],setup(e,{expose:t,emit:n}){const o=e,r=Qo(),i=no(o,"modelValue",n),l=no(o,"nodes",n),a=no(o,"edges",n),u=Ee(o),s=Hd({modelValue:i,nodes:l,edges:a},o,u);return Yd(n,u.hooks),Cf(),Hf(),ft(Rn,r),er(s),t(u),(c,d)=>(ee(),de("div",{ref:q(u).vueFlowRef,class:"vue-flow"},[le(xf,null,{default:me(()=>[le(zf),Ff,le(Lf),ke(c.$slots,"zoom-pane")]),_:3}),ke(c.$slots,"default"),le(kf)],512))}}),Gf=Ne({...{name:"Panel",compatConfig:{MODE:3}},props:{position:{}},setup(e){const t=e,{userSelectionActive:n}=Ee(),o=he(()=>`${t.position}`.split("-"));return(r,i)=>(ee(),de("div",{class:ht(["vue-flow__panel",o.value]),style:Te({pointerEvents:q(n)?"none":"all"})},[ke(r.$slots,"default")],6))}}),Xf={name:"ControlButton",compatConfig:{MODE:3}},jf=(e,t)=>{const n=e.__vccOpts||e;for(const[o,r]of t)n[o]=r;return n},Uf={type:"button",class:"vue-flow__controls-button"};function Wf(e,t,n,o,r,i){return ee(),de("button",Uf,[ke(e.$slots,"default")])}const on=jf(Xf,[["render",Wf]]),Zf={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32"},Kf=[ce("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"},null,-1)];function qf(e,t){return ee(),de("svg",Zf,Kf)}const Jf={render:qf},Qf={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5"},eh=[ce("path",{d:"M0 0h32v4.2H0z"},null,-1)];function th(e,t){return ee(),de("svg",Qf,eh)}const nh={render:th},oh={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30"},rh=[ce("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0 0 27.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94a.919.919 0 0 1-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"},null,-1)];function ih(e,t){return ee(),de("svg",oh,rh)}const lh={render:ih},ah={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},sh=[ce("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 0 0 0 13.714v15.238A3.056 3.056 0 0 0 3.048 32h18.285a3.056 3.056 0 0 0 3.048-3.048V13.714a3.056 3.056 0 0 0-3.048-3.047zM12.19 24.533a3.056 3.056 0 0 1-3.047-3.047 3.056 3.056 0 0 1 3.047-3.048 3.056 3.056 0 0 1 3.048 3.048 3.056 3.056 0 0 1-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"},null,-1)];function uh(e,t){return ee(),de("svg",ah,sh)}const ch={render:uh},dh={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},fh=[ce("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 0 0 0 13.714v15.238A3.056 3.056 0 0 0 3.048 32h18.285a3.056 3.056 0 0 0 3.048-3.048V13.714a3.056 3.056 0 0 0-3.048-3.047zM12.19 24.533a3.056 3.056 0 0 1-3.047-3.047 3.056 3.056 0 0 1 3.047-3.048 3.056 3.056 0 0 1 3.048 3.048 3.056 3.056 0 0 1-3.048 3.047z"},null,-1)];function hh(e,t){return ee(),de("svg",dh,fh)}const gh={render:hh},ph=Ne({...{name:"Controls",compatConfig:{MODE:3}},props:{showZoom:{type:Boolean,default:!0},showFitView:{type:Boolean,default:!0},showInteractive:{type:Boolean,default:!0},fitViewParams:{},position:{default:()=>ui.BottomLeft}},emits:["zoomIn","zoomOut","fitView","interactionChange"],setup(e,{emit:t}){const{nodesDraggable:n,nodesConnectable:o,elementsSelectable:r,setInteractive:i,zoomIn:l,zoomOut:a,fitView:u,viewport:s,minZoom:c,maxZoom:d}=Ee(),f=be(()=>n.value||o.value||r.value),h=be(()=>s.value.zoom<=c.value),m=be(()=>s.value.zoom>=d.value);function y(){l(),t("zoomIn")}function g(){a(),t("zoomOut")}function _(){u(e.fitViewParams),t("fitView")}function S(){i(!f.value),t("interactionChange",!f.value)}return(p,C)=>(ee(),Ie(q(Gf),{class:"vue-flow__controls",position:p.position},{default:me(()=>[ke(p.$slots,"top"),p.showZoom?(ee(),de(Be,{key:0},[ke(p.$slots,"control-zoom-in",{},()=>[le(on,{class:"vue-flow__controls-zoomin",disabled:m.value,onClick:y},{default:me(()=>[ke(p.$slots,"icon-zoom-in",{},()=>[(ee(),Ie(pt(q(Jf))))])]),_:3},8,["disabled"])]),ke(p.$slots,"control-zoom-out",{},()=>[le(on,{class:"vue-flow__controls-zoomout",disabled:h.value,onClick:g},{default:me(()=>[ke(p.$slots,"icon-zoom-out",{},()=>[(ee(),Ie(pt(q(nh))))])]),_:3},8,["disabled"])])],64)):Me("",!0),p.showFitView?ke(p.$slots,"control-fit-view",{key:1},()=>[le(on,{class:"vue-flow__controls-fitview",onClick:_},{default:me(()=>[ke(p.$slots,"icon-fit-view",{},()=>[(ee(),Ie(pt(q(lh))))])]),_:3})]):Me("",!0),p.showInteractive?ke(p.$slots,"control-interactive",{key:2},()=>[p.showInteractive?(ee(),Ie(on,{key:0,class:"vue-flow__controls-interactive",onClick:S},{default:me(()=>[f.value?ke(p.$slots,"icon-unlock",{key:0},()=>[(ee(),Ie(pt(q(gh))))]):Me("",!0),f.value?Me("",!0):ke(p.$slots,"icon-lock",{key:1},()=>[(ee(),Ie(pt(q(ch))))])]),_:3})):Me("",!0)]):Me("",!0),ke(p.$slots,"default")]),_:3},8,["position"]))}});var nt=(e=>(e.Lines="lines",e.Dots="dots",e))(nt||{});const ul=function({dimensions:e,size:t,color:n}){return ye("path",{stroke:n,"stroke-width":t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`})},cl=function({radius:e,color:t}){return ye("circle",{cx:e,cy:e,r:e,fill:t})};nt.Lines+"",nt.Dots+"";const vh={[nt.Dots]:"#81818a",[nt.Lines]:"#eee"},mh=["id","x","y","width","height","patternTransform"],_h={key:2,height:"100",width:"100"},yh=["fill"],wh=["x","y","fill"],bh=Ne({...{name:"Background",compatConfig:{MODE:3}},props:{id:{},variant:{default:()=>nt.Dots},gap:{default:20},size:{default:1},lineWidth:{default:1},patternColor:{},color:{},bgColor:{},height:{default:100},width:{default:100},x:{default:0},y:{default:0},offset:{default:0}},setup(e){const{id:t,viewport:n}=Ee(),o=he(()=>{const l=n.value.zoom,[a,u]=Array.isArray(e.gap)?e.gap:[e.gap,e.gap],s=[a*l||1,u*l||1],c=e.size*l,[d,f]=Array.isArray(e.offset)?e.offset:[e.offset,e.offset],h=[d*l||1+s[0]/2,f*l||1+s[1]/2];return{scaledGap:s,offset:h,size:c}}),r=be(()=>`pattern-${t}${e.id?`-${e.id}`:""}`),i=be(()=>e.color||e.patternColor||vh[e.variant||nt.Dots]);return(l,a)=>(ee(),de("svg",{class:"vue-flow__background vue-flow__container",style:Te({height:`${l.height>100?100:l.height}%`,width:`${l.width>100?100:l.width}%`})},[ke(l.$slots,"pattern-container",{id:r.value},()=>[ce("pattern",{id:r.value,x:q(n).x%o.value.scaledGap[0],y:q(n).y%o.value.scaledGap[1],width:o.value.scaledGap[0],height:o.value.scaledGap[1],patternTransform:`translate(-${o.value.offset[0]},-${o.value.offset[1]})`,patternUnits:"userSpaceOnUse"},[ke(l.$slots,"pattern",{},()=>[l.variant===q(nt).Lines?(ee(),Ie(q(ul),{key:0,size:l.lineWidth,color:i.value,dimensions:o.value.scaledGap},null,8,["size","color","dimensions"])):l.variant===q(nt).Dots?(ee(),Ie(q(cl),{key:1,color:i.value,radius:o.value.size/2},null,8,["color","radius"])):Me("",!0),l.bgColor?(ee(),de("svg",_h,[ce("rect",{width:"100%",height:"100%",fill:l.bgColor},null,8,yh)])):Me("",!0)])],8,mh)]),ce("rect",{x:l.x,y:l.y,width:"100%",height:"100%",fill:`url(#${r.value})`},null,8,wh),ke(l.$slots,"default",{id:r.value})],4))}}),xh={name:"DetailsTable",components:{RawBuffer:fr},mixins:[dr],props:{mode:{type:String,default:"Interface"},details:{type:Object,default:null},readProtocolIndex:{type:Number,default:null},writeProtocolIndex:{type:Number,default:null}},emits:["close"],data(){return{api:null,headers:[{title:"Property",key:"key",width:"30%"},{title:"Value",key:"value",width:"70%"}],paused:!1,updatedDetails:null}},computed:{shownDetails(){return this.updatedDetails?this.updatedDetails:this.details},upperData(){let e={};if(!this.shownDetails)return e;if(this.readProtocolIndex!==null){let t=this.shownDetails.read_protocols[this.readProtocolIndex];e.data=t.read_data_input,e.label="Read Data Input",e.time=t.read_data_input_time}else if(this.writeProtocolIndex!==null){let t=this.shownDetails.write_protocols[this.writeProtocolIndex];e.data=t.write_data_input,e.label="Write Data Input",e.time=t.write_data_input_time}else{let t=this.shownDetails;e.data=t.written_raw_data,e.label="Written Raw Data",e.time=t.written_raw_data_time}return e},lowerData(){let e={};if(!this.shownDetails)return e;if(this.readProtocolIndex!==null){let t=this.shownDetails.read_protocols[this.readProtocolIndex];e.data=t.read_data_output,e.label="Read Data Output",e.time=t.read_data_output_time}else if(this.writeProtocolIndex!==null){let t=this.shownDetails.write_protocols[this.writeProtocolIndex];e.data=t.write_data_output,e.label="Write Data Output",e.time=t.write_data_output_time}else{let t=this.shownDetails;e.data=t.read_raw_data,e.label="Read Raw Data",e.time=t.read_raw_data_time}return e},detailsItems(){if(!this.shownDetails)return[];const e=["written_raw_data","read_raw_data","written_raw_data_time","read_raw_data_time","read_protocols","write_protocols","read_data_input","read_data_output","write_data_input","write_data_output","read_data_input_time","read_data_output_time","write_data_input_time","write_data_output_time"];let t=null;return this.readProtocolIndex!==null?t=this.shownDetails.read_protocols[this.readProtocolIndex]:this.writeProtocolIndex!==null?t=this.shownDetails.write_protocols[this.writeProtocolIndex]:t=this.shownDetails,Object.entries(t).filter(([n,o])=>!e.includes(n)).map(([n,o])=>({key:this.formatKey(n),value:this.formatValue(o)}))},buttonIcon:function(){return this.paused?"mdi-play":"mdi-pause"}},methods:{pause:function(){this.paused=!this.paused},closeClick:function(){this.$emit("close")},update:function(){this.paused||this.details&&this.updateDetails(this.details.name)},updateDetails(e){this.mode=="Interface"?this.api.interface_details(e).then(t=>{this.updatedDetails=t}):this.api.router_details(e).then(t=>{this.updatedDetails=t})},formatKey(e){return e.replace(/_/g," ").replace(/\b\w/g,t=>t.toUpperCase())},formatValue(e){return e==null?"null":typeof e=="object"?JSON.stringify(e,null,2):String(e)}}},Eh={class:"details-table"},Nh={class:"text-wrap"},Sh={key:1,class:"d-flex justify-center align-center pa-4"};function kh(e,t,n,o,r,i){const l=Se("v-btn"),a=Se("v-spacer"),u=Se("v-card-title"),s=Se("v-data-table"),c=Se("v-progress-circular"),d=Se("v-col"),f=Se("raw-buffer"),h=Se("v-row"),m=Se("v-card-text"),y=Se("v-card");return ee(),Ie(y,{"max-height":"80vh",class:"d-flex flex-column"},{default:me(()=>[le(u,{class:"d-flex align-center flex-shrink-0"},{default:me(()=>[Ve(De(n.mode)+" Properties: "+De(i.shownDetails.name)+" ",1),le(l,{icon:i.buttonIcon,variant:"text","data-test":"pause",onClick:i.pause},null,8,["icon","onClick"]),le(a),le(l,{icon:"mdi-close",variant:"text","data-test":"close",onClick:i.closeClick},null,8,["onClick"])]),_:1}),le(m,{class:"overflow-y-auto flex-grow-1 pa-0"},{default:me(()=>[ce("div",Eh,[le(h,null,{default:me(()=>[le(d,{cols:"4"},{default:me(()=>[i.shownDetails?(ee(),Ie(s,{key:0,headers:r.headers,items:i.detailsItems,"items-per-page":-1,"hide-default-footer":"",density:"compact",class:"details-table"},{"item.value":me(({item:g})=>[ce("span",Nh,De(g.value),1)]),_:1},8,["headers","items"])):(ee(),de("div",Sh,[le(c,{indeterminate:"",color:"primary"})]))]),_:1}),le(d,{cols:"8"},{default:me(()=>[ce("div",null,De(i.upperData.label)+": "+De(i.upperData.time),1),le(f,{modelValue:i.upperData.data,"onUpdate:modelValue":t[0]||(t[0]=g=>i.upperData.data=g)},null,8,["modelValue"]),ce("div",null,De(i.lowerData.label)+": "+De(i.lowerData.time),1),le(f,{modelValue:i.lowerData.data,"onUpdate:modelValue":t[1]||(t[1]=g=>i.lowerData.data=g)},null,8,["modelValue"])]),_:1})]),_:1})])]),_:1})]),_:1})}const Ch=rt(xh,[["render",kh],["__scopeId","data-v-06ee5ec0"]]),$h={name:"InterfaceNode",components:{Handle:ct},props:{data:{type:Object,required:!0}},data(){return{}},computed:{interfaceStyle(){return{width:`${this.data.width}px`,height:`${this.data.height}px`}}}},Ih={class:"node-label"};function Mh(e,t,n,o,r,i){const l=Se("v-icon"),a=Se("Handle");return ee(),de("div",{class:"interface-node",style:Te(i.interfaceStyle)},[le(l,{color:"#1d85e1"},{default:me(()=>[...t[0]||(t[0]=[Ve("mdi-swap-horizontal-bold",-1)])]),_:1}),ce("div",Ih,De(n.data.label),1),t[1]||(t[1]=ce("div",{class:"node-label"},"Interface",-1)),le(a,{id:"interface__cmd__input",type:"target",position:"left",style:{top:"112px"}}),le(a,{id:"interface__tlm__input",type:"target",position:"left",style:{top:"162px"}}),le(a,{id:"interface__cmd__output",type:"source",position:"right",style:{top:"112px"}}),le(a,{id:"interface__tlm__output",type:"source",position:"right",style:{top:"162px"}}),t[2]||(t[2]=ce("div",{style:{position:"absolute",top:"102px",left:"8px",color:"black"}}," CMD ",-1)),t[3]||(t[3]=ce("div",{style:{position:"absolute",top:"152px",left:"8px",color:"black"}}," TLM ",-1)),t[4]||(t[4]=ce("div",{style:{position:"absolute",top:"102px",right:"8px",color:"black"}}," CMD ",-1)),t[5]||(t[5]=ce("div",{style:{position:"absolute",top:"152px",right:"8px",color:"black"}}," TLM ",-1))],4)}const Oh=rt($h,[["render",Mh],["__scopeId","data-v-31945a3b"]]),Dh={name:"RouterNode",components:{Handle:ct},props:{data:{type:Object,required:!0}},data(){return{}},computed:{routerStyle(){return{width:`${this.data.width}px`,height:`${this.data.height}px`}}}},Th={class:"node-label"};function Ph(e,t,n,o,r,i){const l=Se("v-icon"),a=Se("Handle");return ee(),de("div",{class:"router-node",style:Te(i.routerStyle)},[le(l,{color:"#ba1de1"},{default:me(()=>[...t[0]||(t[0]=[Ve("mdi-call-split",-1)])]),_:1}),ce("div",Th,De(n.data.label),1),t[1]||(t[1]=ce("div",{class:"node-label"},"Router",-1)),le(a,{id:"router__cmd__input",type:"target",position:"left",style:{top:"112px"}}),le(a,{id:"router__tlm__input",type:"target",position:"left",style:{top:"162px"}}),le(a,{id:"router__cmd__output",type:"source",position:"right",style:{top:"112px"}}),le(a,{id:"router__tlm__output",type:"source",position:"right",style:{top:"162px"}}),t[2]||(t[2]=ce("div",{style:{position:"absolute",top:"102px",left:"8px",color:"black"}}," CMD ",-1)),t[3]||(t[3]=ce("div",{style:{position:"absolute",top:"152px",left:"8px",color:"black"}}," TLM ",-1)),t[4]||(t[4]=ce("div",{style:{position:"absolute",top:"102px",right:"8px",color:"black"}}," CMD ",-1)),t[5]||(t[5]=ce("div",{style:{position:"absolute",top:"152px",right:"8px",color:"black"}}," TLM ",-1))],4)}const Ah=rt(Dh,[["render",Ph],["__scopeId","data-v-b1fbfb62"]]),zh={name:"TargetNode",components:{Handle:ct},props:{data:{type:Object,required:!0}}},Rh={class:"cosmos-node"},Bh={class:"node-label"};function Vh(e,t,n,o,r,i){const l=Se("Handle"),a=Se("v-icon");return ee(),de("div",Rh,[le(l,{id:"cosmos__cmd",type:"target",position:"right",style:{top:"114px"}}),le(l,{id:"cosmos__tlm",type:"target",position:"right",style:{top:"164px"}}),t[1]||(t[1]=ce("div",{style:{position:"absolute",top:"104px",right:"8px",color:"black"}}," CMD ",-1)),t[2]||(t[2]=ce("div",{style:{position:"absolute",top:"154px",right:"8px",color:"black"}}," TLM ",-1)),le(a,{color:"#10b981"},{default:me(()=>[...t[0]||(t[0]=[Ve("mdi-rocket-launch",-1)])]),_:1}),ce("div",Bh,De(n.data.label),1),t[3]||(t[3]=ce("div",{class:"node-label"},"Processing",-1))])}const Lh=rt(zh,[["render",Vh],["__scopeId","data-v-c2b5368b"]]),Hh={name:"TargetNode",components:{Handle:ct},props:{data:{type:Object,required:!0}}},Fh={class:"target-node"},Yh={class:"node-label"};function Gh(e,t,n,o,r,i){const l=Se("Handle"),a=Se("v-icon");return ee(),de("div",Fh,[le(l,{id:"target__cmd",type:"target",position:"left",style:{top:"114px"}}),le(l,{id:"target__tlm",type:"target",position:"left",style:{top:"164px"}}),t[1]||(t[1]=ce("div",{style:{position:"absolute",top:"104px",left:"8px",color:"black"}}," CMD ",-1)),t[2]||(t[2]=ce("div",{style:{position:"absolute",top:"154px",left:"8px",color:"black"}}," TLM ",-1)),le(a,{color:"#10b981"},{default:me(()=>[...t[0]||(t[0]=[Ve("mdi-target",-1)])]),_:1}),ce("div",Yh,De(n.data.label),1),t[3]||(t[3]=ce("div",{class:"node-label"},"Target",-1))])}const Xh=rt(Hh,[["render",Gh],["__scopeId","data-v-125c8608"]]),jh={name:"WriteProtocolNode",props:{data:{type:Object,required:!0}},computed:{protocolStyle(){return this.data.width?{width:`${this.data.width}px`}:{}}}},Uh={class:"protocol-label"};function Wh(e,t,n,o,r,i){const l=Se("v-icon");return ee(),de("div",{class:"write-protocol-node",style:Te(i.protocolStyle)},[le(l,{color:"#f97316",size:"small"},{default:me(()=>[...t[0]||(t[0]=[Ve("mdi-arrow-right-bold",-1)])]),_:1}),ce("div",Uh,De(n.data.label),1)],4)}const Zh=rt(jh,[["render",Wh],["__scopeId","data-v-1bec9d38"]]),Kh={name:"ReadProtocolNode",props:{data:{type:Object,required:!0}},computed:{protocolStyle(){return this.data.width?{width:`${this.data.width}px`}:{}}}},qh={class:"protocol-label"};function Jh(e,t,n,o,r,i){const l=Se("v-icon");return ee(),de("div",{class:"read-protocol-node",style:Te(i.protocolStyle)},[le(l,{color:"#06b6d4",size:"small"},{default:me(()=>[...t[0]||(t[0]=[Ve("mdi-arrow-left-bold",-1)])]),_:1}),ce("div",qh,De(n.data.label),1)],4)}const Qh=rt(Kh,[["render",Jh],["__scopeId","data-v-c903bd6c"]]);var dl=Object.defineProperty,eg=(e,t,n)=>t in e?dl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,tg=(e,t)=>{for(var n in t)dl(e,n,{get:t[n],enumerable:!0})},ng=(e,t,n)=>eg(e,t+"",n),fl={};tg(fl,{Graph:()=>Re,alg:()=>Vo,json:()=>vl,version:()=>ig});var og=Object.defineProperty,hl=(e,t)=>{for(var n in t)og(e,n,{get:t[n],enumerable:!0})},Re=class{constructor(e){this._isDirected=!0,this._isMultigraph=!1,this._isCompound=!1,this._nodes={},this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={},this._nodeCount=0,this._edgeCount=0,this._defaultNodeLabelFn=()=>{},this._defaultEdgeLabelFn=()=>{},e&&(this._isDirected="directed"in e?e.directed:!0,this._isMultigraph="multigraph"in e?e.multigraph:!1,this._isCompound="compound"in e?e.compound:!1),this._isCompound&&(this._parent={},this._children={},this._children["\0"]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(e){return this._label=e,this}graph(){return this._label}setDefaultNodeLabel(e){return typeof e!="function"?this._defaultNodeLabelFn=()=>e:this._defaultNodeLabelFn=e,this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){return this.nodes().filter(e=>Object.keys(this._in[e]).length===0)}sinks(){return this.nodes().filter(e=>Object.keys(this._out[e]).length===0)}setNodes(e,t){return e.forEach(n=>{t!==void 0?this.setNode(n,t):this.setNode(n)}),this}setNode(e,t){return e in this._nodes?(arguments.length>1&&(this._nodes[e]=t),this):(this._nodes[e]=arguments.length>1?t:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]="\0",this._children[e]={},this._children["\0"][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)}node(e){return this._nodes[e]}hasNode(e){return e in this._nodes}removeNode(e){if(e in this._nodes){let t=n=>this.removeEdge(this._edgeObjs[n]);delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],this.children(e).forEach(n=>{this.setParent(n)}),delete this._children[e]),Object.keys(this._in[e]).forEach(t),delete this._in[e],delete this._preds[e],Object.keys(this._out[e]).forEach(t),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this}setParent(e,t){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(t===void 0)t="\0";else{t+="";for(let n=t;n!==void 0;n=this.parent(n))if(n===e)throw new Error("Setting "+t+" as parent of "+e+" would create a cycle");this.setNode(t)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=t,this._children[t][e]=!0,this}parent(e){if(this._isCompound){let t=this._parent[e];if(t!=="\0")return t}}children(e="\0"){if(this._isCompound){let t=this._children[e];if(t)return Object.keys(t)}else{if(e==="\0")return this.nodes();if(this.hasNode(e))return[]}return[]}predecessors(e){let t=this._preds[e];if(t)return Object.keys(t)}successors(e){let t=this._sucs[e];if(t)return Object.keys(t)}neighbors(e){let t=this.predecessors(e);if(t){let n=new Set(t);for(let o of this.successors(e))n.add(o);return Array.from(n.values())}}isLeaf(e){let t;return this.isDirected()?t=this.successors(e):t=this.neighbors(e),t.length===0}filterNodes(e){let t=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});t.setGraph(this.graph()),Object.entries(this._nodes).forEach(([r,i])=>{e(r)&&t.setNode(r,i)}),Object.values(this._edgeObjs).forEach(r=>{t.hasNode(r.v)&&t.hasNode(r.w)&&t.setEdge(r,this.edge(r))});let n={},o=r=>{let i=this.parent(r);return!i||t.hasNode(i)?(n[r]=i??void 0,i??void 0):i in n?n[i]:o(i)};return this._isCompound&&t.nodes().forEach(r=>t.setParent(r,o(r))),t}setDefaultEdgeLabel(e){return typeof e!="function"?this._defaultEdgeLabelFn=()=>e:this._defaultEdgeLabelFn=e,this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(e,t){return e.reduce((n,o)=>(t!==void 0?this.setEdge(n,o,t):this.setEdge(n,o),o)),this}setEdge(e,t,n,o){let r,i,l,a,u=!1;typeof e=="object"&&e!==null&&"v"in e?(r=e.v,i=e.w,l=e.name,arguments.length===2&&(a=t,u=!0)):(r=e,i=t,l=o,arguments.length>2&&(a=n,u=!0)),r=""+r,i=""+i,l!==void 0&&(l=""+l);let s=rn(this._isDirected,r,i,l);if(s in this._edgeLabels)return u&&(this._edgeLabels[s]=a),this;if(l!==void 0&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(r),this.setNode(i),this._edgeLabels[s]=u?a:this._defaultEdgeLabelFn(r,i,l);let c=rg(this._isDirected,r,i,l);return r=c.v,i=c.w,Object.freeze(c),this._edgeObjs[s]=c,gl(this._preds[i],r),gl(this._sucs[r],i),this._in[i][s]=c,this._out[r][s]=c,this._edgeCount++,this}edge(e,t,n){let o=arguments.length===1?Bo(this._isDirected,e):rn(this._isDirected,e,t,n);return this._edgeLabels[o]}edgeAsObj(e,t,n){let o=arguments.length===1?this.edge(e):this.edge(e,t,n);return typeof o!="object"?{label:o}:o}hasEdge(e,t,n){return(arguments.length===1?Bo(this._isDirected,e):rn(this._isDirected,e,t,n))in this._edgeLabels}removeEdge(e,t,n){let o=arguments.length===1?Bo(this._isDirected,e):rn(this._isDirected,e,t,n),r=this._edgeObjs[o];if(r){let i=r.v,l=r.w;delete this._edgeLabels[o],delete this._edgeObjs[o],pl(this._preds[l],i),pl(this._sucs[i],l),delete this._in[l][o],delete this._out[i][o],this._edgeCount--}return this}inEdges(e,t){return this.isDirected()?this.filterEdges(this._in[e],e,t):this.nodeEdges(e,t)}outEdges(e,t){return this.isDirected()?this.filterEdges(this._out[e],e,t):this.nodeEdges(e,t)}nodeEdges(e,t){if(e in this._nodes)return this.filterEdges({...this._in[e],...this._out[e]},e,t)}_removeFromParentsChildList(e){delete this._children[this._parent[e]][e]}filterEdges(e,t,n){if(!e)return;let o=Object.values(e);return n?o.filter(r=>r.v===t&&r.w===n||r.v===n&&r.w===t):o}};function gl(e,t){e[t]?e[t]++:e[t]=1}function pl(e,t){e[t]!==void 0&&!--e[t]&&delete e[t]}function rn(e,t,n,o){let r=""+t,i=""+n;if(!e&&r>i){let l=r;r=i,i=l}return r+""+i+""+(o===void 0?"\0":o)}function rg(e,t,n,o){let r=""+t,i=""+n;if(!e&&r>i){let a=r;r=i,i=a}let l={v:r,w:i};return o&&(l.name=o),l}function Bo(e,t){return rn(e,t.v,t.w,t.name)}var ig="4.0.1",vl={};hl(vl,{read:()=>ug,write:()=>lg});function lg(e){let t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:ag(e),edges:sg(e)},n=e.graph();return n!==void 0&&(t.value=structuredClone(n)),t}function ag(e){return e.nodes().map(t=>{let n=e.node(t),o=e.parent(t),r={v:t};return n!==void 0&&(r.value=n),o!==void 0&&(r.parent=o),r})}function sg(e){return e.edges().map(t=>{let n=e.edge(t),o={v:t.v,w:t.w};return t.name!==void 0&&(o.name=t.name),n!==void 0&&(o.value=n),o})}function ug(e){let t=new Re(e.options);return e.value!==void 0&&t.setGraph(e.value),e.nodes.forEach(n=>{t.setNode(n.v,n.value),n.parent&&t.setParent(n.v,n.parent)}),e.edges.forEach(n=>{t.setEdge({v:n.v,w:n.w,name:n.name},n.value)}),t}var Vo={};hl(Vo,{CycleException:()=>jn,bellmanFord:()=>ml,components:()=>fg,dijkstra:()=>Xn,dijkstraAll:()=>pg,findCycles:()=>vg,floydWarshall:()=>_g,isAcyclic:()=>wg,postorder:()=>xg,preorder:()=>Eg,prim:()=>Ng,shortestPaths:()=>Sg,tarjan:()=>yl,topsort:()=>wl});var cg=()=>1;function ml(e,t,n,o){return dg(e,String(t),n||cg,o||function(r){return e.outEdges(r)})}function dg(e,t,n,o){let r={},i,l=0,a=e.nodes(),u=function(d){let f=n(d);r[d.v].distance+f<r[d.w].distance&&(r[d.w]={distance:r[d.v].distance+f,predecessor:d.v},i=!0)},s=function(){a.forEach(function(d){o(d).forEach(function(f){let h=f.v===d?f.v:f.w,m=h===f.v?f.w:f.v;u({v:h,w:m})})})};a.forEach(function(d){let f=d===t?0:Number.POSITIVE_INFINITY;r[d]={distance:f,predecessor:""}});let c=a.length;for(let d=1;d<c&&(i=!1,l++,s(),!!i);d++);if(l===c-1&&(i=!1,s(),i))throw new Error("The graph contains a negative weight cycle");return r}function fg(e){let t={},n=[],o;function r(i){i in t||(t[i]=!0,o.push(i),e.successors(i).forEach(r),e.predecessors(i).forEach(r))}return e.nodes().forEach(function(i){o=[],r(i),o.length&&n.push(o)}),n}var _l=class{constructor(){this._arr=[],this._keyIndices={}}size(){return this._arr.length}keys(){return this._arr.map(e=>e.key)}has(e){return e in this._keyIndices}priority(e){let t=this._keyIndices[e];if(t!==void 0)return this._arr[t].priority}min(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key}add(e,t){let n=this._keyIndices,o=String(e);if(!(o in n)){let r=this._arr,i=r.length;return n[o]=i,r.push({key:o,priority:t}),this._decrease(i),!0}return!1}removeMin(){this._swap(0,this._arr.length-1);let e=this._arr.pop();return delete this._keyIndices[e.key],this._heapify(0),e.key}decrease(e,t){let n=this._keyIndices[e];if(n===void 0)throw new Error(`Key not found: ${e}`);let o=this._arr[n].priority;if(t>o)throw new Error(`New priority is greater than current priority. Key: ${e} Old: ${o} New: ${t}`);this._arr[n].priority=t,this._decrease(n)}_heapify(e){let t=this._arr,n=2*e,o=n+1,r=e;n<t.length&&(r=t[n].priority<t[r].priority?n:r,o<t.length&&(r=t[o].priority<t[r].priority?o:r),r!==e&&(this._swap(e,r),this._heapify(r)))}_decrease(e){let t=this._arr,n=t[e].priority,o;for(;e!==0&&(o=e>>1,!(t[o].priority<n));)this._swap(e,o),e=o}_swap(e,t){let n=this._arr,o=this._keyIndices,r=n[e],i=n[t];n[e]=i,n[t]=r,o[i.key]=e,o[r.key]=t}},hg=()=>1;function Xn(e,t,n,o){let r=function(i){return e.outEdges(i)};return gg(e,String(t),n||hg,o||r)}function gg(e,t,n,o){let r={},i=new _l,l,a,u=function(s){let c=s.v!==l?s.v:s.w,d=r[c],f=n(s),h=a.distance+f;if(f<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+s+" Weight: "+f);h<d.distance&&(d.distance=h,d.predecessor=l,i.decrease(c,h))};for(e.nodes().forEach(function(s){let c=s===t?0:Number.POSITIVE_INFINITY;r[s]={distance:c,predecessor:""},i.add(s,c)});i.size()>0&&(l=i.removeMin(),a=r[l],a.distance!==Number.POSITIVE_INFINITY);)o(l).forEach(u);return r}function pg(e,t,n){return e.nodes().reduce(function(o,r){return o[r]=Xn(e,r,t,n),o},{})}function yl(e){let t=0,n=[],o={},r=[];function i(l){let a=o[l]={onStack:!0,lowlink:t,index:t++};if(n.push(l),e.successors(l).forEach(function(u){u in o?o[u].onStack&&(a.lowlink=Math.min(a.lowlink,o[u].index)):(i(u),a.lowlink=Math.min(a.lowlink,o[u].lowlink))}),a.lowlink===a.index){let u=[],s;do s=n.pop(),o[s].onStack=!1,u.push(s);while(l!==s);r.push(u)}}return e.nodes().forEach(function(l){l in o||i(l)}),r}function vg(e){return yl(e).filter(function(t){return t.length>1||t.length===1&&e.hasEdge(t[0],t[0])})}var mg=()=>1;function _g(e,t,n){return yg(e,t||mg,n||function(o){return e.outEdges(o)})}function yg(e,t,n){let o={},r=e.nodes();return r.forEach(function(i){o[i]={},o[i][i]={distance:0,predecessor:""},r.forEach(function(l){i!==l&&(o[i][l]={distance:Number.POSITIVE_INFINITY,predecessor:""})}),n(i).forEach(function(l){let a=l.v===i?l.w:l.v,u=t(l);o[i][a]={distance:u,predecessor:i}})}),r.forEach(function(i){let l=o[i];r.forEach(function(a){let u=o[a];r.forEach(function(s){let c=u[i],d=l[s],f=u[s],h=c.distance+d.distance;h<f.distance&&(f.distance=h,f.predecessor=d.predecessor)})})}),o}var jn=class extends Error{constructor(...e){super(...e)}};function wl(e){let t={},n={},o=[];function r(i){if(i in n)throw new jn;i in t||(n[i]=!0,t[i]=!0,e.predecessors(i).forEach(r),delete n[i],o.push(i))}if(e.sinks().forEach(r),Object.keys(t).length!==e.nodeCount())throw new jn;return o}function wg(e){try{wl(e)}catch(t){if(t instanceof jn)return!1;throw t}return!0}function bg(e,t,n,o,r){Array.isArray(t)||(t=[t]);let i=(a=>{var u;return(u=e.isDirected()?e.successors(a):e.neighbors(a))!=null?u:[]}),l={};return t.forEach(function(a){if(!e.hasNode(a))throw new Error("Graph does not have node: "+a);r=bl(e,a,n==="post",l,i,o,r)}),r}function bl(e,t,n,o,r,i,l){return t in o||(o[t]=!0,n||(l=i(l,t)),r(t).forEach(function(a){l=bl(e,a,n,o,r,i,l)}),n&&(l=i(l,t))),l}function xl(e,t,n){return bg(e,t,n,function(o,r){return o.push(r),o},[])}function xg(e,t){return xl(e,t,"post")}function Eg(e,t){return xl(e,t,"pre")}function Ng(e,t){let n=new Re,o={},r=new _l,i;function l(u){let s=u.v===i?u.w:u.v,c=r.priority(s);if(c!==void 0){let d=t(u);d<c&&(o[s]=i,r.decrease(s,d))}}if(e.nodeCount()===0)return n;e.nodes().forEach(function(u){r.add(u,Number.POSITIVE_INFINITY),n.setNode(u)}),r.decrease(e.nodes()[0],0);let a=!1;for(;r.size()>0;){if(i=r.removeMin(),i in o)n.setEdge(i,o[i]);else{if(a)throw new Error("Input graph is not connected: "+e);a=!0}e.nodeEdges(i).forEach(l)}return n}function Sg(e,t,n,o){return kg(e,t,n,o??(r=>{let i=e.outEdges(r);return i??[]}))}function kg(e,t,n,o){if(n===void 0)return Xn(e,t,n,o);let r=!1,i=e.nodes();for(let l=0;l<i.length;l++){let a=o(i[l]);for(let u=0;u<a.length;u++){let s=a[u],c=s.v===i[l]?s.v:s.w,d=c===s.v?s.w:s.v;n({v:c,w:d})<0&&(r=!0)}if(r)return ml(e,t,n,o)}return Xn(e,t,n,o)}function Pt(e,t,n,o){let r=o;for(;e.hasNode(r);)r=Lo(o);return n.dummy=t,e.setNode(r,n),r}function Cg(e){let t=new Re().setGraph(e.graph());return e.nodes().forEach(n=>t.setNode(n,e.node(n))),e.edges().forEach(n=>{let o=t.edge(n.v,n.w)||{weight:0,minlen:1},r=e.edge(n);t.setEdge(n.v,n.w,{weight:o.weight+r.weight,minlen:Math.max(o.minlen,r.minlen)})}),t}function El(e){let t=new Re({multigraph:e.isMultigraph()}).setGraph(e.graph());return e.nodes().forEach(n=>{e.children(n).length||t.setNode(n,e.node(n))}),e.edges().forEach(n=>{t.setEdge(n,e.edge(n))}),t}function Nl(e,t){let n=e.x,o=e.y,r=t.x-n,i=t.y-o,l=e.width/2,a=e.height/2;if(!r&&!i)throw new Error("Not possible to find intersection inside of the rectangle");let u,s;return Math.abs(i)*l>Math.abs(r)*a?(i<0&&(a=-a),u=a*r/i,s=a):(r<0&&(l=-l),u=l,s=l*i/r),{x:n+u,y:o+s}}function ln(e){let t=an(Cl(e)+1).map(()=>[]);return e.nodes().forEach(n=>{let o=e.node(n),r=o.rank;r!==void 0&&(t[r]||(t[r]=[]),t[r][o.order]=n)}),t}function $g(e){let t=e.nodes().map(o=>{let r=e.node(o).rank;return r===void 0?Number.MAX_VALUE:r}),n=We(Math.min,t);e.nodes().forEach(o=>{let r=e.node(o);Object.hasOwn(r,"rank")&&(r.rank-=n)})}function Ig(e){let t=e.nodes().map(l=>e.node(l).rank).filter(l=>l!==void 0),n=We(Math.min,t),o=[];e.nodes().forEach(l=>{let a=e.node(l).rank-n;o[a]||(o[a]=[]),o[a].push(l)});let r=0,i=e.graph().nodeRankFactor;Array.from(o).forEach((l,a)=>{l===void 0&&a%i!==0?--r:l!==void 0&&r&&l.forEach(u=>e.node(u).rank+=r)})}function Sl(e,t,n,o){let r={width:0,height:0};return arguments.length>=4&&(r.rank=n,r.order=o),Pt(e,"border",r,t)}function Mg(e,t=kl){let n=[];for(let o=0;o<e.length;o+=t){let r=e.slice(o,o+t);n.push(r)}return n}var kl=65535;function We(e,t){if(t.length>kl){let n=Mg(t);return e(...n.map(o=>e(...o)))}else return e(...t)}function Cl(e){let t=e.nodes().map(n=>{let o=e.node(n).rank;return o===void 0?Number.MIN_VALUE:o});return We(Math.max,t)}function Og(e,t){let n={lhs:[],rhs:[]};return e.forEach(o=>{t(o)?n.lhs.push(o):n.rhs.push(o)}),n}function Dg(e,t){let n=Date.now();try{return t()}finally{console.log(e+" time: "+(Date.now()-n)+"ms")}}function $l(e,t){return t()}var Tg=0;function Lo(e){let t=++Tg;return e+(""+t)}function an(e,t,n=1){t==null&&(t=e,e=0);let o=i=>i<t;n<0&&(o=i=>t<i);let r=[];for(let i=e;o(i);i+=n)r.push(i);return r}function Un(e,t){let n={};for(let o of t)e[o]!==void 0&&(n[o]=e[o]);return n}function Wn(e,t){let n;return typeof t=="string"?n=o=>o[t]:n=t,Object.entries(e).reduce((o,[r,i])=>(o[r]=n(i,r),o),{})}function Pg(e,t){return e.reduce((n,o,r)=>(n[o]=t[r],n),{})}var Zn="\0";function Il(e,t,n){var o,r,i,l,a,u;if(!(e&&t&&n&&t.dummy==="edge"&&n.dummy==="edge"&&t.edgeObj&&n.edgeObj&&e[t.edgeObj.v]&&e[n.edgeObj.v]&&e[t.edgeObj.w]&&e[n.edgeObj.w]))return 0;let s=!0;t.edgeObj.w===n.edgeObj.w&&(s=!1);let c=s?(r=(o=e[t.edgeObj.v])==null?void 0:o.rank)!=null?r:NaN+1:(l=(i=e[t.edgeObj.w])==null?void 0:i.rank)!=null?l:NaN-1,d=Object.entries(e).find(y=>{var g,_;return((g=y[1].edgeObj)==null?void 0:g.v)===t.edgeObj.v&&((_=y[1].edgeObj)==null?void 0:_.w)===t.edgeObj.w&&y[1].rank===c}),f=Object.entries(e).find(y=>{var g,_;return((g=y[1].edgeObj)==null?void 0:g.v)===n.edgeObj.v&&((_=y[1].edgeObj)==null?void 0:_.w)===n.edgeObj.w&&y[1].rank===c});if(!d||!f)return 0;let h=(a=d[1].order)!=null?a:NaN,m=(u=f[1].order)!=null?u:NaN;return isNaN(h-m)?0:h-m}var Ag="3.1.0",zg=class{constructor(){ng(this,"_sentinel");let e={};e._next=e._prev=e,this._sentinel=e}dequeue(){let e=this._sentinel,t=e._prev;if(t!==e)return Ml(t),t}enqueue(e){let t=this._sentinel;e._prev&&e._next&&Ml(e),e._next=t._next,t._next._prev=e,t._next=e,e._prev=t}toString(){let e=[],t=this._sentinel,n=t._prev;for(;n!==t;)e.push(JSON.stringify(n,Rg)),n=n._prev;return"["+e.join(", ")+"]"}};function Ml(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function Rg(e,t){if(e!=="_next"&&e!=="_prev")return t}var Bg=zg,Vg=()=>1;function Lg(e,t){if(e.nodeCount()<=1)return[];let n=Fg(e,t||Vg);return Hg(n.graph,n.buckets,n.zeroIdx).flatMap(o=>e.outEdges(o.v,o.w)||[])}function Hg(e,t,n){var o;let r=[],i=t[t.length-1],l=t[0],a;for(;e.nodeCount();){for(;a=l.dequeue();)Ho(e,t,n,a);for(;a=i.dequeue();)Ho(e,t,n,a);if(e.nodeCount()){for(let u=t.length-2;u>0;--u)if(a=(o=t[u])==null?void 0:o.dequeue(),a){r=r.concat(Ho(e,t,n,a,!0)||[]);break}}}return r}function Ho(e,t,n,o,r){let i=[],l=r?i:void 0;return(e.inEdges(o.v)||[]).forEach(a=>{let u=e.edge(a),s=e.node(a.v);r&&i.push({v:a.v,w:a.w}),s.out-=u,Fo(t,n,s)}),(e.outEdges(o.v)||[]).forEach(a=>{let u=e.edge(a),s=a.w,c=e.node(s);c.in-=u,Fo(t,n,c)}),e.removeNode(o.v),l}function Fg(e,t){let n=new Re,o=0,r=0;e.nodes().forEach(a=>{n.setNode(a,{v:a,in:0,out:0})}),e.edges().forEach(a=>{let u=n.edge(a.v,a.w)||0,s=t(a),c=u+s;n.setEdge(a.v,a.w,c);let d=n.node(a.v),f=n.node(a.w);r=Math.max(r,d.out+=s),o=Math.max(o,f.in+=s)});let i=Yg(r+o+3).map(()=>new Bg),l=o+1;return n.nodes().forEach(a=>{Fo(i,l,n.node(a))}),{graph:n,buckets:i,zeroIdx:l}}function Fo(e,t,n){var o,r,i;n.out?n.in?(i=e[n.out-n.in+t])==null||i.enqueue(n):(r=e[e.length-1])==null||r.enqueue(n):(o=e[0])==null||o.enqueue(n)}function Yg(e){let t=[];for(let n=0;n<e;n++)t.push(n);return t}function Gg(e,t){(e.graph().acyclicer==="greedy"?Lg(e,n(e)):Xg(e,t??null)).forEach(o=>{let r=e.edge(o);e.removeEdge(o),r.forwardName=o.name,r.reversed=!0,e.setEdge(o.w,o.v,r,Lo("rev"))});function n(o){return r=>o.edge(r).weight}}function Xg(e,t){let n=[],o={},r={};function i(u){Object.hasOwn(r,u)||(r[u]=!0,o[u]=!0,e.outEdges(u).forEach(s=>{Object.hasOwn(o,s.w)?n.push(s):i(s.w)}),delete o[u])}function l(u){var s;Object.hasOwn(r,u)||(r[u]=!0,o[u]=!0,(s=e.outEdges(u))==null||s.forEach(c=>{var d,f;Object.hasOwn(o,c.w)||((d=t.node(u))==null?void 0:d.rank)>((f=t.node(c.w))==null?void 0:f.rank)&&Ug(e,c.w,c)?n.push(c):l(c.w)}),delete o[u])}let a=i;return t&&typeof t.node=="function"&&(a=l),e.sources().forEach(a),e.nodes().forEach(a),n}function jg(e){e.edges().forEach(t=>{let n=e.edge(t);if(n.reversed){e.removeEdge(t);let o=n.forwardName;delete n.reversed,delete n.forwardName,e.setEdge(t.w,t.v,n,o)}})}function Ug(e,t,n){let o=new Set;function r(i){var l;if(e.sources().includes(i))return!0;o.add(i);for(let a of(l=e.inEdges(i))!=null?l:[])if(!(a.v===n.v&&a.w===n.w)&&!o.has(a.v)&&r(a.v))return!0;return!1}return r(t)}function Wg(e){e.graph().dummyChains=[],e.edges().forEach(t=>Zg(e,t))}function Zg(e,t){let n=t.v,o=e.node(n).rank,r=t.w,i=e.node(r).rank,l=t.name,a=e.edge(t),u=a.labelRank;if(i===o+1)return;e.removeEdge(t);let s,c,d;for(d=0,++o;o<i;++d,++o)a.points=[],c={width:0,height:0,edgeLabel:a,edgeObj:t,rank:o},s=Pt(e,"edge",c,"_d"),o===u&&(c.width=a.width,c.height=a.height,c.dummy="edge-label",c.labelpos=a.labelpos),e.setEdge(n,s,{weight:a.weight},l),d===0&&e.graph().dummyChains.push(s),n=s;e.setEdge(n,r,{weight:a.weight},l)}function Kg(e){e.graph().dummyChains.forEach(t=>{let n=e.node(t),o=n.edgeLabel,r;for(e.setEdge(n.edgeObj,o);n.dummy;)r=e.successors(t)[0],e.removeNode(t),o.points.push({x:n.x,y:n.y}),n.dummy==="edge-label"&&(o.x=n.x,o.y=n.y,o.width=n.width,o.height=n.height),t=r,n=e.node(t)})}function Yo(e){let t={};function n(o){let r=e.node(o);if(Object.hasOwn(t,o))return r.rank;t[o]=!0;let i=e.outEdges(o),l=i?i.map(u=>u==null?Number.POSITIVE_INFINITY:n(u.w)-e.edge(u).minlen):[],a=We(Math.min,l);return a===Number.POSITIVE_INFINITY&&(a=0),r.rank=a}e.sources().forEach(n)}function At(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}var Ol=qg;function qg(e){let t=new Re({directed:!1}),n=e.nodes();if(n.length===0)throw new Error("Graph must have at least one node");let o=n[0],r=e.nodeCount();t.setNode(o,{});let i,l;for(;Jg(t,e)<r&&(i=Qg(t,e),!!i);)l=t.hasNode(i.v)?At(e,i):-At(e,i),ep(t,e,l);return t}function Jg(e,t){function n(o){let r=t.nodeEdges(o);r&&r.forEach(i=>{let l=i.v,a=o===l?i.w:l;!e.hasNode(a)&&!At(t,i)&&(e.setNode(a,{}),e.setEdge(o,a,{}),n(a))})}return e.nodes().forEach(n),e.nodeCount()}function Qg(e,t){return t.edges().reduce((n,o)=>{let r=Number.POSITIVE_INFINITY;return e.hasNode(o.v)!==e.hasNode(o.w)&&(r=At(t,o)),r<n[0]?[r,o]:n},[Number.POSITIVE_INFINITY,null])[1]}function ep(e,t,n){e.nodes().forEach(o=>t.node(o).rank+=n)}var{preorder:tp,postorder:np}=Vo,op=Nt;Nt.initLowLimValues=Xo,Nt.initCutValues=Go,Nt.calcCutValue=Dl,Nt.leaveEdge=Pl,Nt.enterEdge=Al,Nt.exchangeEdges=zl;function Nt(e){e=Cg(e),Yo(e);let t=Ol(e);Xo(t),Go(t,e);let n,o;for(;n=Pl(t);)o=Al(t,e,n),zl(t,e,n,o)}function Go(e,t){let n=np(e,e.nodes());n=n.slice(0,n.length-1),n.forEach(o=>rp(e,t,o))}function rp(e,t,n){let o=e.node(n).parent,r=e.edge(n,o);r.cutvalue=Dl(e,t,n)}function Dl(e,t,n){let o=e.node(n).parent,r=!0,i=t.edge(n,o),l=0;i||(r=!1,i=t.edge(o,n)),l=i.weight;let a=t.nodeEdges(n);return a&&a.forEach(u=>{let s=u.v===n,c=s?u.w:u.v;if(c!==o){let d=s===r,f=t.edge(u).weight;if(l+=d?f:-f,lp(e,n,c)){let h=e.edge(n,c).cutvalue;l+=d?-h:h}}}),l}function Xo(e,t){arguments.length<2&&(t=e.nodes()[0]),Tl(e,{},1,t)}function Tl(e,t,n,o,r){let i=n,l=e.node(o);t[o]=!0;let a=e.neighbors(o);return a&&a.forEach(u=>{Object.hasOwn(t,u)||(n=Tl(e,t,n,u,o))}),l.low=i,l.lim=n++,r?l.parent=r:delete l.parent,n}function Pl(e){return e.edges().find(t=>e.edge(t).cutvalue<0)}function Al(e,t,n){let o=n.v,r=n.w;t.hasEdge(o,r)||(o=n.w,r=n.v);let i=e.node(o),l=e.node(r),a=i,u=!1;return i.lim>l.lim&&(a=l,u=!0),t.edges().filter(s=>u===Rl(e,e.node(s.v),a)&&u!==Rl(e,e.node(s.w),a)).reduce((s,c)=>At(t,c)<At(t,s)?c:s)}function zl(e,t,n,o){let r=n.v,i=n.w;e.removeEdge(r,i),e.setEdge(o.v,o.w,{}),Xo(e),Go(e,t),ip(e,t)}function ip(e,t){let n=e.nodes().find(r=>!e.node(r).parent);if(!n)return;let o=tp(e,[n]);o=o.slice(1),o.forEach(r=>{let i=e.node(r).parent,l=t.edge(r,i),a=!1;l||(l=t.edge(i,r),a=!0),t.node(r).rank=t.node(i).rank+(a?l.minlen:-l.minlen)})}function lp(e,t,n){return e.hasEdge(t,n)}function Rl(e,t,n){return n.low<=t.lim&&t.lim<=n.lim}var ap=sp;function sp(e){let t=e.graph().ranker;if(typeof t=="function")return t(e);switch(t){case"network-simplex":Bl(e);break;case"tight-tree":cp(e);break;case"longest-path":up(e);break;case"none":break;default:Bl(e)}}var up=Yo;function cp(e){Yo(e),Ol(e)}function Bl(e){op(e)}var dp=fp;function fp(e){let t=gp(e),n=e.graph();Array.isArray(n.dummyChains)&&n.dummyChains.forEach(o=>{let r=e.node(o),i=r.edgeObj,l=hp(e,t,i.v,i.w),a=l.path,u=l.lca,s=0,c=a[s],d=!0;for(;o!==i.w;){if(r=e.node(o),d){for(;(c=a[s])!==u&&e.node(c).maxRank<r.rank;)s++;c===u&&(d=!1)}if(!d){for(;s<a.length-1&&e.node(a[s+1]).minRank<=r.rank;)s++;c=a[s]}c!==void 0&&e.setParent(o,c),o=e.successors(o)[0]}})}function hp(e,t,n,o){let r=[],i=[],l=Math.min(t[n].low,t[o].low),a=Math.max(t[n].lim,t[o].lim),u;u=n;do u=e.parent(u),r.push(u);while(u&&(t[u].low>l||a>t[u].lim));let s=u,c=o;for(;(c=e.parent(c))!==s;)i.push(c);return{path:r.concat(i.reverse()),lca:s}}function gp(e){let t={},n=0;function o(r){let i=n;e.children(r).forEach(o),t[r]={low:i,lim:n++}}return e.children(Zn).forEach(o),t}function pp(e){let t=Pt(e,"root",{},"_root"),n=vp(e),o=Object.values(n),r=We(Math.max,o)-1,i=2*r+1;e.graph().nestingRoot=t,e.edges().forEach(a=>e.edge(a).minlen*=i);let l=mp(e)+1;e.children(Zn).forEach(a=>{Vl(e,t,i,l,r,n,a)}),e.graph().nodeRankFactor=i}function Vl(e,t,n,o,r,i,l){var a;let u=e.children(l);if(!u.length){l!==t&&e.setEdge(t,l,{weight:0,minlen:n});return}let s=Sl(e,"_bt"),c=Sl(e,"_bb"),d=e.node(l);e.setParent(s,l),d.borderTop=s,e.setParent(c,l),d.borderBottom=c,u.forEach(f=>{var h;Vl(e,t,n,o,r,i,f);let m=e.node(f),y=m.borderTop?m.borderTop:f,g=m.borderBottom?m.borderBottom:f,_=m.borderTop?o:2*o,S=y!==g?1:r-((h=i[l])!=null?h:0)+1;e.setEdge(s,y,{weight:_,minlen:S,nestingEdge:!0}),e.setEdge(g,c,{weight:_,minlen:S,nestingEdge:!0})}),e.parent(l)||e.setEdge(t,s,{weight:0,minlen:r+((a=i[l])!=null?a:0)})}function vp(e){let t={};function n(o,r){let i=e.children(o);i&&i.length&&i.forEach(l=>n(l,r+1)),t[o]=r}return e.children(Zn).forEach(o=>n(o,1)),t}function mp(e){return e.edges().reduce((t,n)=>t+e.edge(n).weight,0)}function _p(e){let t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,e.edges().forEach(n=>{e.edge(n).nestingEdge&&e.removeEdge(n)})}var yp=wp;function wp(e){function t(n){let o=e.children(n),r=e.node(n);if(o.length&&o.forEach(t),r&&Object.hasOwn(r,"minRank")){r.borderLeft=[],r.borderRight=[];for(let i=r.minRank,l=r.maxRank+1;i<l;++i)Ll(e,"borderLeft","_bl",n,r,i),Ll(e,"borderRight","_br",n,r,i)}}e.children(Zn).forEach(t)}function Ll(e,t,n,o,r,i){let l={width:0,height:0,rank:i,borderType:t},a=r[t][i-1],u=Pt(e,"border",l,n);r[t][i]=u,e.setParent(u,o),a&&e.setEdge(a,u,{weight:1})}function bp(e){var t;let n=(t=e.graph().rankdir)==null?void 0:t.toLowerCase();(n==="lr"||n==="rl")&&Hl(e)}function xp(e){var t;let n=(t=e.graph().rankdir)==null?void 0:t.toLowerCase();(n==="bt"||n==="rl")&&Ep(e),(n==="lr"||n==="rl")&&(Np(e),Hl(e))}function Hl(e){e.nodes().forEach(t=>Fl(e.node(t))),e.edges().forEach(t=>Fl(e.edge(t)))}function Fl(e){let t=e.width;e.width=e.height,e.height=t}function Ep(e){e.nodes().forEach(t=>jo(e.node(t))),e.edges().forEach(t=>{var n;let o=e.edge(t);(n=o.points)==null||n.forEach(jo),Object.hasOwn(o,"y")&&jo(o)})}function jo(e){e.y=-e.y}function Np(e){e.nodes().forEach(t=>Uo(e.node(t))),e.edges().forEach(t=>{var n;let o=e.edge(t);(n=o.points)==null||n.forEach(Uo),Object.hasOwn(o,"x")&&Uo(o)})}function Uo(e){let t=e.x;e.x=e.y,e.y=t}function Sp(e,t=null){let n={},o=e.nodes().filter(s=>!e.children(s).length),r=o.map(s=>e.node(s).rank),i=We(Math.max,r),l=an(i+1).map(()=>[]);function a(s){if(n[s])return;n[s]=!0;let c=e.node(s);l[c.rank].push(s);let d=e.successors(s);d&&[...d].sort((f,h)=>u(f,h)).forEach(a)}o.sort((s,c)=>e.node(s).rank-e.node(c).rank).forEach(a);function u(s,c){let d=e.node(s),f=e.node(c);return Il(t,d,f)}return l}function kp(e,t){let n=0;for(let o=1;o<t.length;++o)n+=Cp(e,t[o-1],t[o]);return n}function Cp(e,t,n){let o=Pg(n,n.map((s,c)=>c)),r=t.flatMap(s=>{let c=e.outEdges(s);return c?c.map(d=>({pos:o[d.w],weight:e.edge(d).weight})).sort((d,f)=>d.pos-f.pos):[]}),i=1;for(;i<n.length;)i<<=1;let l=2*i-1;i-=1;let a=new Array(l).fill(0),u=0;return r.forEach(s=>{let c=s.pos+i;a[c]+=s.weight;let d=0;for(;c>0;)c%2&&(d+=a[c+1]),c=c-1>>1,a[c]+=s.weight;u+=s.weight*d}),u}function $p(e,t=[]){return t.map(n=>{let o=e.inEdges(n);if(!o||!o.length)return{v:n};{let r=o.reduce((i,l)=>{let a=e.edge(l),u=e.node(l.v);return{sum:i.sum+a.weight*u.order,weight:i.weight+a.weight}},{sum:0,weight:0});return{v:n,barycenter:r.sum/r.weight,weight:r.weight}}})}function Ip(e,t){let n={};e.forEach((r,i)=>{let l={indegree:0,in:[],out:[],vs:[r.v],i};r.barycenter!==void 0&&(l.barycenter=r.barycenter,l.weight=r.weight),n[r.v]=l}),t.edges().forEach(r=>{let i=n[r.v],l=n[r.w];i!==void 0&&l!==void 0&&(l.indegree++,i.out.push(l))});let o=Object.values(n).filter(r=>!r.indegree);return Mp(o)}function Mp(e){let t=[];function n(r){return i=>{i.merged||(i.barycenter===void 0||r.barycenter===void 0||i.barycenter>=r.barycenter)&&Op(r,i)}}function o(r){return i=>{i.in.push(r),--i.indegree===0&&e.push(i)}}for(;e.length;){let r=e.pop();t.push(r),r.in.reverse().forEach(n(r)),r.out.forEach(o(r))}return t.filter(r=>!r.merged).map(r=>Un(r,["vs","i","barycenter","weight"]))}function Op(e,t){let n=0,o=0;e.weight&&(n+=e.barycenter*e.weight,o+=e.weight),t.weight&&(n+=t.barycenter*t.weight,o+=t.weight),e.vs=t.vs.concat(e.vs),e.barycenter=n/o,e.weight=o,e.i=Math.min(t.i,e.i),t.merged=!0}function Dp(e,t,n,o,r){let i={},l=null,a=null,u=r;typeof t=="boolean"?(u=t,i={}):t&&(i=t,l=n??null,a=o??null);let s=Og(e,_=>Object.hasOwn(_,"barycenter")),c=s.lhs,d=s.rhs.sort((_,S)=>S.i-_.i),f=[],h=0,m=0,y=0;c.sort(Tp(a,l,!!u));for(let[_,S]of Object.entries(i)){let p=c.findIndex(C=>C.vs[0]===_);c.splice(p+1,0,S)}y=Yl(f,d,y),c.forEach(_=>{y+=_.vs.length,f.push(_.vs),h+=_.barycenter*_.weight,m+=_.weight,y=Yl(f,d,y)});let g={vs:f.flat(1)};return m&&(g.barycenter=h/m,g.weight=m),g}function Yl(e,t,n){let o;for(;t.length&&(o=t[t.length-1]).i<=n;)t.pop(),e.push(o.vs),n++;return n}function Tp(e,t,n){return(o,r)=>{if(o.barycenter<r.barycenter)return-1;if(o.barycenter>r.barycenter)return 1;if(e&&(typeof o.vs[0]=="string"||typeof r.vs[0]=="string")){let i=e.node(o.vs[0]),l=e.node(r.vs[0]),a=Il(t,i,l);if(a!==0)return a}return n?r.i-o.i:o.i-r.i}}function Gl(e,t,n,o,r){var i,l,a,u,s,c,d,f,h,m,y;let g=null,_=r;typeof o=="boolean"?(_=o,g=null):o!==void 0&&(g=o);let S=e.children(t),p=e.node(t),C=p?p.borderLeft:void 0,z=p?p.borderRight:void 0,V={};C&&(S=S.filter(w=>w!==C&&w!==z));let L=$p(e,S);L.forEach(w=>{if(e.children(w.v).length){let{result:P}=Gl(e,w.v,n,g,_);V[w.v]=P,Object.hasOwn(P,"barycenter")&&Ap(w,P)}});let B=Ip(L,n);Pp(B,V);let U={},X=!1;for(let w=0;w<B.length;w++)for(let P=w+1;P<B.length;P++)if(!(!B[w]||!B[P]||!((i=B[w])!=null&&i.barycenter)||!((l=B[P])!=null&&l.barycenter))&&((a=B[w])==null?void 0:a.barycenter)===B[P].barycenter){let b=(s=(u=B[w])==null?void 0:u.vs[0])!=null?s:"",N=(d=(c=B[P])==null?void 0:c.vs[0])!=null?d:"",E=e.node(b),O=e.node(N);if(E.dummy==="edge"&&O.dummy==="edge"&&((f=E.edgeObj)==null?void 0:f.v)===((h=O.edgeObj)==null?void 0:h.v)&&((m=E.edgeObj)==null?void 0:m.w)===((y=O.edgeObj)==null?void 0:y.w))if(E.edgeLabel.reversed){U[N]=B[w],B.splice(w,1),w--;break}else U[b]=B[P],B.splice(P,1),P--;else X=!0}let A=Dp(B,U,g,e,_);if(C&&z){A.vs=[C,A.vs,z].flat(1);let w=e.predecessors(C);if(w&&w.length){let P=e.node(w[0]),b=e.predecessors(z),N=e.node(b[0]);Object.hasOwn(A,"barycenter")||(A.barycenter=0,A.weight=0),A.barycenter=(A.barycenter*A.weight+P.order+N.order)/(A.weight+2),A.weight+=2}}return Object.defineProperty(A,"result",{value:A,enumerable:!1,configurable:!0,writable:!0}),Object.defineProperty(A,"usedBias",{value:X,enumerable:!1,configurable:!0,writable:!0}),A}function Pp(e,t){e.forEach(n=>{n.vs=n.vs.flatMap(o=>t[o]?t[o].vs:o)})}function Ap(e,t){e.barycenter!==void 0?(e.barycenter=(e.barycenter*e.weight+t.barycenter*t.weight)/(e.weight+t.weight),e.weight+=t.weight):(e.barycenter=t.barycenter,e.weight=t.weight)}function zp(e,t,n,o){o||(o=e.nodes());let r=Rp(e),i=new Re({compound:!0}).setGraph({root:r}).setDefaultNodeLabel(l=>e.node(l));return o.forEach(l=>{let a=e.node(l),u=e.parent(l);if(a.rank===t||a.minRank<=t&&t<=a.maxRank){i.setNode(l),i.setParent(l,u||r);let s=e[n](l);s&&s.forEach(c=>{let d=c.v===l?c.w:c.v,f=i.edge(d,l),h=f!==void 0?f.weight:0;i.setEdge(d,l,{weight:e.edge(c).weight+h})}),Object.hasOwn(a,"minRank")&&i.setNode(l,{borderLeft:a.borderLeft[t],borderRight:a.borderRight[t]})}}),i}function Rp(e){let t;for(;e.hasNode(t=Lo("_root")););return t}function Bp(e,t,n){let o={},r;n.forEach(i=>{let l=e.parent(i),a,u;for(;l;){if(a=e.parent(l),a?(u=o[a],o[a]=l):(u=r,r=l),u&&u!==l){t.setEdge(u,l);return}l=a}})}function Xl(e,t={},n=null){if(typeof t.customOrder=="function"){t.customOrder(e,Xl);return}let o=Cl(e),r=jl(e,an(1,o+1),"inEdges"),i=jl(e,an(o-1,-1,-1),"outEdges"),l=Sp(e,n);if(Ul(e,l),t.disableOptimalOrderHeuristic)return;let a=Number.POSITIVE_INFINITY,u,s=t.constraints||[];for(let c=0,d=0;d<4;++c,++d){Vp(c%2?r:i,c%4>=2,s,n),l=ln(e);let f=kp(e,l);f<a?(d=0,u=Object.assign({},l),a=f):f===a&&(u=structuredClone(l))}Ul(e,u)}function jl(e,t,n){let o=new Map,r=(i,l)=>{o.has(i)||o.set(i,[]),o.get(i).push(l)};for(let i of e.nodes()){let l=e.node(i);if(typeof l.rank=="number"&&r(l.rank,i),typeof l.minRank=="number"&&typeof l.maxRank=="number")for(let a=l.minRank;a<=l.maxRank;a++)a!==l.rank&&r(a,i)}return t.map(function(i){return zp(e,i,n,o.get(i)||[])})}function Vp(e,t,n,o){let r=!0,i=new Re;e.forEach(function(l){n.forEach(c=>i.setEdge(c.left,c.right));let a=l.graph().root,{result:u,usedBias:s}=Gl(l,a,i,o,r);t&&s&&(r=!r),u.vs.forEach((c,d)=>l.node(c).order=d),Bp(l,i,u.vs)})}function Ul(e,t){Object.values(t).forEach(n=>n.forEach((o,r)=>e.node(o).order=r))}function Lp(e,t){let n={};function o(r,i){let l=0,a=0,u=r.length,s=i[i.length-1];return i.forEach((c,d)=>{let f=Fp(e,c),h=f?e.node(f).order:u;(f||c===s)&&(i.slice(a,d+1).forEach(m=>{let y=e.predecessors(m);y&&y.forEach(g=>{let _=e.node(g),S=_.order;(S<l||h<S)&&!(_.dummy&&e.node(m).dummy)&&Wl(n,g,m)})}),a=d+1,l=h)}),i}return t.length&&t.reduce(o),n}function Hp(e,t){let n={};function o(i,l,a,u,s){an(l,a).forEach(c=>{let d=i[c];if(d!==void 0&&e.node(d).dummy){let f=e.predecessors(d);f&&f.forEach(h=>{if(h===void 0)return;let m=e.node(h);m.dummy&&(m.order<u||m.order>s)&&Wl(n,h,d)})}})}function r(i,l){let a=-1,u=-1,s=0;return l.forEach((c,d)=>{if(e.node(c).dummy==="border"){let f=e.predecessors(c);if(f&&f.length){let h=f[0];if(h===void 0)return;u=e.node(h).order,o(l,s,d,a,u),s=d,a=u}}o(l,s,l.length,u,i.length)}),l}return t.length&&t.reduce(r),n}function Fp(e,t){if(e.node(t).dummy){let n=e.predecessors(t);if(n)return n.find(o=>e.node(o).dummy)}}function Wl(e,t,n){if(t>n){let r=t;t=n,n=r}let o=e[t];o||(e[t]=o={}),o[n]=!0}function Yp(e,t,n){if(t>n){let r=t;t=n,n=r}let o=e[t];return o!==void 0&&Object.hasOwn(o,n)}function Gp(e,t,n,o,r){let i={},l={},a={};return t.forEach(u=>{u.forEach((s,c)=>{i[s]=s,l[s]=s,a[s]=c})}),t.forEach(u=>{let s=-1,c=-1,d=!1,f=u,h=u.findIndex(m=>r?.includes(m)||Zl(m,e,r));h>0&&(f=[u[h],...u.slice(0,h),...u.slice(h+1)],d=!0),f.forEach(m=>{var y;let g=o(m);if(g&&g.length){r!=null&&r.includes(m)&&(g=g.filter(p=>Zl(p,e,r)));let _=g.sort((p,C)=>{let z=a[p],V=a[C];return(z!==void 0?z:0)-(V!==void 0?V:0)}),S=(_.length-1)/2;for(let p=Math.floor(S),C=Math.ceil(S);p<=C;++p){let z=_[p];if(z===void 0)continue;let V=a[z];if(V!==void 0&&l[m]===m&&s<V&&a[z]!==c&&!Yp(n,m,z)){let L=i[z];L!==void 0&&(l[z]=m,l[m]=i[m]=L,s=V,d&&(s=-1,c=(y=a[z])!=null?y:-1,d=!1))}}}})}),{root:i,align:l}}function Xp(e,t,n,o,r=!1){let i={},l=jp(e,t,n,r),a=r?"borderLeft":"borderRight";function u(h,m){let y=l.nodes().slice(),g={},_=y.pop();for(;_;){if(g[_])h(_);else{g[_]=!0,y.push(_);for(let S of m(_))y.push(S)}_=y.pop()}}function s(h){let m=l.inEdges(h);m?i[h]=m.reduce((y,g)=>{var _;let S=(_=i[g.v])!=null?_:0,p=l.edge(g);return Math.max(y,S+(p!==void 0?p:0))},0):i[h]=0}function c(h){let m=l.outEdges(h),y=Number.POSITIVE_INFINITY;m&&(y=m.reduce((_,S)=>{let p=i[S.w],C=l.edge(S);return Math.min(_,(p!==void 0?p:0)-(C!==void 0?C:0))},Number.POSITIVE_INFINITY));let g=e.node(h);y!==Number.POSITIVE_INFINITY&&g.borderType!==a&&(i[h]=Math.max(i[h]!==void 0?i[h]:0,y))}function d(h){return l.predecessors(h)||[]}function f(h){return l.successors(h)||[]}return u(s,d),u(c,f),Object.keys(o).forEach(h=>{var m;let y=n[h];y!==void 0&&(i[h]=(m=i[y])!=null?m:0)}),i}function jp(e,t,n,o){let r=new Re,i=e.graph(),l=qp(i.nodesep,i.edgesep,o);return t.forEach(a=>{let u;a.forEach(s=>{let c=n[s];if(c!==void 0){if(r.setNode(c),u!==void 0){let d=n[u];if(d!==void 0){let f=r.edge(d,c);r.setEdge(d,c,Math.max(l(e,s,u),f||0))}}u=s}})}),r}function Up(e,t){return Object.values(t).reduce((n,o)=>{let r=Number.NEGATIVE_INFINITY,i=Number.POSITIVE_INFINITY;Object.entries(o).forEach(([a,u])=>{let s=Jp(e,a)/2;r=Math.max(u+s,r),i=Math.min(u-s,i)});let l=r-i;return l<n[0]&&(n=[l,o]),n},[Number.POSITIVE_INFINITY,null])[1]}function Wp(e,t){let n=Object.values(t),o=We(Math.min,n),r=We(Math.max,n);["u","d"].forEach(i=>{["l","r"].forEach(l=>{let a=i+l,u=e[a];if(!u||u===t)return;let s=Object.values(u),c=o-We(Math.min,s);l!=="l"&&(c=r-We(Math.max,s)),c&&(e[a]=Wn(u,d=>d+c))})})}function Zp(e,t=void 0){let n=e.ul;return n?Wn(n,(o,r)=>{var i,l;if(t){let u=t.toLowerCase(),s=e[u];if(s&&s[r]!==void 0)return s[r]}let a=Object.values(e).map(u=>{let s=u[r];return s!==void 0?s:0}).sort((u,s)=>u-s);return(((i=a[1])!=null?i:0)+((l=a[2])!=null?l:0))/2}):{}}function Kp(e,t){let n=ln(e),o=Object.assign(Lp(e,n),Hp(e,n)),r={},i;["u","d"].forEach(a=>{i=a==="u"?n:Object.values(n).reverse(),["l","r"].forEach(u=>{u==="r"&&(i=i.map(d=>Object.values(d).reverse()));let s=Gp(e,i,o,d=>(a==="u"?e.predecessors(d):e.successors(d))||[],t),c=Xp(e,i,s.root,s.align,u==="r");u==="r"&&(c=Wn(c,d=>-d)),r[a+u]=c})});let l=Up(e,r);return Wp(r,l),Zp(r,e.graph().align)}function qp(e,t,n){return(o,r,i)=>{let l=o.node(r),a=o.node(i),u=0,s;if(u+=l.width/2,Object.hasOwn(l,"labelpos"))switch(l.labelpos.toLowerCase()){case"l":s=-l.width/2;break;case"r":s=l.width/2;break}if(s&&(u+=n?s:-s),s=void 0,u+=(l.dummy?t:e)/2,u+=(a.dummy?t:e)/2,u+=a.width/2,Object.hasOwn(a,"labelpos"))switch(a.labelpos.toLowerCase()){case"l":s=a.width/2;break;case"r":s=-a.width/2;break}return s&&(u+=n?s:-s),u}}function Jp(e,t){return e.node(t).width}function Zl(e,t,n){var o;if(!n)return!1;let r=(o=t.node(e))==null?void 0:o.edgeObj;if(!r||t.node(e).edgeLabel.reversed)return!1;let i=n.indexOf(r?.v),l=n.indexOf(r?.w);return i!==-1&&l!==-1&&i===(l+1)%n.length||i===(l-1)%n.length}function Qp(e,t){e=El(e),ev(e),Object.entries(Kp(e,t)).forEach(([n,o])=>e.node(n).x=o)}function ev(e){let t=ln(e),n=e.graph(),o=n.ranksep,r=n.rankalign,i=0;t.forEach(l=>{let a=l.reduce((u,s)=>{var c;let d=(c=e.node(s).height)!=null?c:0;return u>d?u:d},0);l.forEach(u=>{let s=e.node(u);r==="top"?s.y=i+s.height/2:r==="bottom"?s.y=i+a-s.height/2:s.y=i+a/2}),i+=a+o})}var Wo=null,Zo=null;function tv(e,t={}){return ql(e,$l,t),e}function Kl(e,t,n){let o=t;for(;o!==void 0;){let r=e.parent(o);if(r===n)return o;o=r}}function ql(e,t,n){let o=e.nodes().filter(g=>e.children(g).length),r={};o.forEach(g=>{let _=e.node(g);if(_&&_.rankdir){let S=new Re({multigraph:!0,compound:!0});S.setGraph({rankdir:_.rankdir});let p=e.children(g);p.forEach(w=>{let P={...e.node(w)};S.setNode(w,P);let b=e.parent(w);b&&b!==g&&p.includes(b)&&S.setParent(w,b)});let C=new Set;e.edges().forEach(w=>{let P=Kl(e,w.v,g),b=Kl(e,w.w,g);if(P&&b&&P!==b){let N=`${P}\0${b}`;C.has(N)||(C.add(N),S.setEdge(P,b,{...e.edge(w)}))}}),ql(S,t,n);let z=ta(S);Jl(z,t,n),Ql(S,z);let V=1/0,L=1/0,B=-1/0,U=-1/0;S.nodes().forEach(w=>{if(w===g)return;let P=S.node(w);P&&typeof P.x=="number"&&typeof P.y=="number"&&typeof P.width=="number"&&typeof P.height=="number"&&(V=Math.min(V,P.x-P.width/2),B=Math.max(B,P.x+P.width/2),L=Math.min(L,P.y-P.height/2),U=Math.max(U,P.y+P.height/2))}),(!isFinite(V)||!isFinite(L)||!isFinite(B)||!isFinite(U))&&(V=L=0,B=U=0);let X=B-V,A=U-L;r[g]={minX:V,minY:L,maxX:B,maxY:U,width:X,height:A,offsetX:V,offsetY:L},_._dagreClusterSubgraph=S}});let i=[],l=g=>{let _=[],S=(e.children(g)||[]).filter(p=>p!==g);for(;S.length>0;){let p=S.shift();_.push(p),(e.children(p)||[]).filter(C=>C!==p).forEach(C=>S.push(C))}return _},a=new Map;o.forEach(g=>{let _=e.node(g);_&&_.rankdir&&r[g]&&a.set(g,(e.children(g)||[]).filter(S=>S!==g))});let u=new Set([...a.values()].flat()),s=new Map;a.forEach((g,_)=>{u.has(_)||s.set(_,l(_))});let c=new Set([...s.values()].flat()),d=g=>{for(let[_,S]of s)if(S.includes(g))return _;return g},f=[];e.edges().forEach(g=>{(c.has(g.v)||c.has(g.w))&&f.push({edge:g,label:e.edge(g)})});let h=new Map;c.forEach(g=>{let _=e.parent(g);h.set(g,typeof _=="string"?_:void 0)}),s.forEach((g,_)=>{let S=e.node(_),p=[];g.forEach(V=>{let L=e.node(V);L&&(p.push({id:V,node:L,parent:h.get(V)}),e.removeNode(V))});let C=f.filter(({edge:V})=>g.includes(V.v)||g.includes(V.w)),z=r[_];S&&(i.push({clusterId:_,subgraph:S._dagreClusterSubgraph,bounds:z,children:g,removedNodes:p,removedEdges:C}),S.width=z.width,S.height=z.height)});let m=new Set;f.forEach(({edge:g,label:_})=>{let S=d(g.v),p=d(g.w);if(S!==p&&e.hasNode(S)&&e.hasNode(p)){let C=`${S}\0${p}`;m.has(C)||(m.add(C),e.setEdge(S,p,{..._,width:0,height:0}))}});let y=ta(e);Jl(y,t,n),Ql(e,y),m.forEach(g=>{let _=g.indexOf("\0"),S=g.slice(0,_),p=g.slice(_+1);e.hasEdge(S,p)&&e.removeEdge(S,p)}),i.forEach(({clusterId:g,subgraph:_,bounds:S,removedNodes:p,removedEdges:C})=>{var z,V;let L=e.node(g),B=(z=L?.x)!=null?z:0,U=(V=L?.y)!=null?V:0,X=(S.minX+S.maxX)/2,A=(S.minY+S.maxY)/2;p.forEach(({id:w,node:P,parent:b})=>{e.setNode(w,P),b!==void 0&&e.setParent(w,b)}),C.forEach(({edge:w,label:P})=>{e.setEdge(w,P)}),_.nodes().forEach(w=>{if(w===g)return;let P=_.node(w),b=e.node(w);b&&P&&typeof P.x=="number"&&typeof P.y=="number"&&(b.x=B+(P.x-X),b.y=U+(P.y-A))}),delete L._dagreClusterSubgraph}),o.forEach(g=>{var _,S;let p=e.node(g),C=r[g];if(p&&p.rankdir&&p._dagreClusterSubgraph&&C){let z=p._dagreClusterSubgraph,V=(_=p.x)!=null?_:0,L=(S=p.y)!=null?S:0,B=(C.minX+C.maxX)/2,U=(C.minY+C.maxY)/2;z.nodes().forEach(X=>{if(X===g)return;let A=z.node(X),w=e.node(X);if(w&&A&&typeof A.x=="number"&&typeof A.y=="number"){let P=A.x-B,b=A.y-U;w.x=V+P,w.y=L+b}}),delete p._dagreClusterSubgraph}})}function Jl(e,t,n){n?.useDynamic===!1&&(Wo=null,Zo=null),t(" makeSpaceForEdgeLabels",()=>uv(e)),t(" removeSelfEdges",()=>_v(e)),t(" acyclic",()=>Gg(e,Wo)),t(" nestingGraph.run",()=>pp(e)),t(" rank",()=>ap(El(e))),t(" injectEdgeLabelProxies",()=>cv(e)),t(" removeEmptyRanks",()=>Ig(e)),t(" nestingGraph.cleanup",()=>_p(e)),t(" normalizeRanks",()=>$g(e)),t(" assignRankMinMax",()=>dv(e)),t(" removeEdgeLabelProxies",()=>fv(e)),t(" normalize.run",()=>Wg(e)),t(" parentDummyChains",()=>dp(e)),t(" addBorderSegments",()=>yp(e)),t(" order",()=>Xl(e,n,Zo)),t(" insertSelfEdges",()=>yv(e)),t(" adjustCoordinateSystem",()=>bp(e)),t(" position",()=>Qp(e,n.corePath)),t(" positionSelfEdges",()=>wv(e)),Zo=JSON.parse(JSON.stringify(e._nodes)),t(" removeBorderNodes",()=>mv(e)),t(" normalize.undo",()=>Kg(e)),t(" fixupEdgeLabelCoords",()=>pv(e)),t(" undoCoordinateSystem",()=>xp(e)),t(" translateGraph",()=>hv(e)),t(" assignNodeIntersects",()=>gv(e)),t(" reversePoints",()=>vv(e)),t(" acyclic.undo",()=>jg(e)),Wo=e}function Ql(e,t){e.nodes().forEach(n=>{let o=e.node(n),r=t.node(n);o&&(o.x=r.x,o.y=r.y,o.order=r.order,o.rank=r.rank,t.children(n).length&&(o.width=r.width,o.height=r.height))}),e.edges().forEach(n=>{let o=e.edge(n),r=t.edge(n);o.points=r.points,Object.hasOwn(r,"x")&&(o.x=r.x,o.y=r.y)}),e.graph().width=t.graph().width,e.graph().height=t.graph().height}var nv=["nodesep","edgesep","ranksep","marginx","marginy"],ov={ranksep:50,edgesep:20,nodesep:50,rankdir:"TB",rankalign:"center"},rv=["acyclicer","ranker","rankdir","align","rankalign"],iv=["width","height","rank"],ea={width:0,height:0},lv=["minlen","weight","width","height","labeloffset"],av={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},sv=["labelpos"];function ta(e){let t=new Re({multigraph:!0,compound:!0}),n=qo(e.graph());return t.setGraph(Object.assign({},ov,Ko(n,nv),Un(n,rv))),e.nodes().forEach(o=>{let r=qo(e.node(o)),i=Ko(r,iv);Object.keys(ea).forEach(a=>{i[a]===void 0&&(i[a]=ea[a])}),t.setNode(o,i);let l=e.parent(o);l!==void 0&&t.setParent(o,l)}),e.edges().forEach(o=>{let r=qo(e.edge(o));t.setEdge(o,Object.assign({},av,Ko(r,lv),Un(r,sv)))}),t}function uv(e){let t=e.graph();t.ranksep/=2,e.edges().forEach(n=>{var o;let r=e.edge(n);r.minlen*=2,((o=r.labelpos)!=null?o:"r").toLowerCase()!=="c"&&(t.rankdir==="TB"||t.rankdir==="BT"?r.width+=r.labeloffset:r.height+=r.labeloffset)})}function cv(e){e.edges().forEach(t=>{let n=e.edge(t);if(n.width&&n.height){let o=e.node(t.v),r={rank:(e.node(t.w).rank-o.rank)/2+o.rank,e:t};Pt(e,"edge-proxy",r,"_ep")}})}function dv(e){let t=0;e.nodes().forEach(n=>{let o=e.node(n);o.borderTop&&(o.minRank=e.node(o.borderTop).rank,o.maxRank=e.node(o.borderBottom).rank,t=Math.max(t,o.maxRank))}),e.graph().maxRank=t}function fv(e){e.nodes().forEach(t=>{let n=e.node(t);if(n.dummy==="edge-proxy"){let o=n;e.edge(o.e).labelRank=n.rank,e.removeNode(t)}})}function hv(e){let t=Number.POSITIVE_INFINITY,n=0,o=Number.POSITIVE_INFINITY,r=0,i=e.graph(),l=i.marginx||0,a=i.marginy||0;function u(s){let c=s.x,d=s.y,f=s.width,h=s.height;t=Math.min(t,c-f/2),n=Math.max(n,c+f/2),o=Math.min(o,d-h/2),r=Math.max(r,d+h/2)}e.nodes().forEach(s=>u(e.node(s))),e.edges().forEach(s=>{let c=e.edge(s);Object.hasOwn(c,"x")&&u(c)}),t-=l,o-=a,e.nodes().forEach(s=>{let c=e.node(s);c.x-=t,c.y-=o}),e.edges().forEach(s=>{let c=e.edge(s);c.points.forEach(d=>{d.x-=t,d.y-=o}),Object.hasOwn(c,"x")&&(c.x-=t),Object.hasOwn(c,"y")&&(c.y-=o)}),i.width=n-t+l,i.height=r-o+a}function gv(e){e.edges().forEach(t=>{if(t.v===t.w)return;let n=e.edge(t),o=e.node(t.v),r=e.node(t.w),i,l;n.points?(i=n.points[0],l=n.points[n.points.length-1]):(n.points=[],i=r,l=o),n.points.unshift(Nl(o,i)),n.points.push(Nl(r,l))})}function pv(e){e.edges().forEach(t=>{let n=e.edge(t);if(Object.hasOwn(n,"x"))switch((n.labelpos==="l"||n.labelpos==="r")&&(n.width-=n.labeloffset),n.labelpos){case"l":n.x-=n.width/2+n.labeloffset;break;case"r":n.x+=n.width/2+n.labeloffset;break}})}function vv(e){e.edges().forEach(t=>{let n=e.edge(t);n.reversed&&n.points.reverse()})}function mv(e){e.nodes().forEach(t=>{if(e.children(t).length){let n=e.node(t),o=e.node(n.borderTop),r=e.node(n.borderBottom),i=e.node(n.borderLeft[n.borderLeft.length-1]),l=e.node(n.borderRight[n.borderRight.length-1]);n.width=Math.abs(l.x-i.x),n.height=Math.abs(r.y-o.y),n.x=i.x+n.width/2,n.y=o.y+n.height/2}}),e.nodes().forEach(t=>{e.node(t).dummy==="border"&&e.removeNode(t)})}function _v(e){e.edges().forEach(t=>{if(t.v===t.w){let n=e.node(t.v);n.selfEdges||(n.selfEdges=[]),n.selfEdges.push({e:t,label:e.edge(t)}),e.removeEdge(t)}})}function yv(e){ln(e).forEach(t=>{let n=0;t.forEach((o,r)=>{let i=e.node(o);typeof i.rank!="number"&&(i.rank=0),i.order=r+n,(i.selfEdges||[]).forEach(l=>{Pt(e,"selfedge",{width:l.label.width,height:l.label.height,rank:i.rank,order:r+ ++n,e:l.e,edgeLabel:l.label},"_se"),(!Array.isArray(l.label.points)||l.label.points.length!==7)&&(l.label.points=[{x:0,y:-10},{x:0,y:-10},{x:0,y:0},{x:0,y:10},{x:0,y:10},{x:0,y:0},{x:0,y:0}])}),delete i.selfEdges})})}function wv(e){e.nodes().forEach(t=>{let n=e.node(t),o=r=>typeof r=="number"&&isFinite(r);if(n.dummy==="selfedge"){let r=n,i=e.node(r.e.v),l=o(i?.x)?i.x:0,a=o(i?.y)?i.y:0,u=o(i?.width)?i.width:0,s=o(i?.height)?i.height:0,c=o(n.x)?n.x:l,d=o(n.y)?n.y:a,f=u/2,h=s/2;r.edgeLabel.points=[{x:c+f,y:d-h},{x:c+f,y:d-h},{x:c,y:d},{x:c-f,y:d+h},{x:c-f,y:d+h},{x:c,y:d},{x:c,y:d}],r.edgeLabel.x=c,r.edgeLabel.y=d,e.setEdge(r.e,r.edgeLabel),e.removeNode(t)}else n&&Array.isArray(n.selfEdges)&&n.selfEdges.forEach(r=>{if(!Array.isArray(r.label.points)||r.label.points.length!==7){let i=o(n.x)?n.x:0,l=o(n.y)?n.y:0,a=o(n.width)?n.width:0,u=o(n.height)?n.height:0,s=a/2,c=u/2;r.label.points=[{x:i+s,y:l-c},{x:i+s,y:l-c},{x:i,y:l},{x:i-s,y:l+c},{x:i-s,y:l+c},{x:i,y:l},{x:i,y:l}]}})})}function Ko(e,t){return Wn(Un(e,t),Number)}function qo(e){let t={};return e&&Object.entries(e).forEach(([n,o])=>{typeof n=="string"&&(n=n.toLowerCase()),t[n]=o}),t}function bv(e){let t=ln(e),n=new Re({compound:!0,multigraph:!0}).setGraph({});return e.nodes().forEach(o=>{n.setNode(o,{label:o}),n.setParent(o,"layer"+e.node(o).rank)}),e.edges().forEach(o=>n.setEdge(o.v,o.w,{},o.name)),t.forEach((o,r)=>{let i="layer"+r;n.setNode(i,{rank:"same"}),o.reduce((l,a)=>(n.setEdge(l,a,{style:"invis"}),a))}),n}var xv={graphlib:fl,version:Ag,layout:tv,debug:bv,util:{time:Dg,notime:$l}},Jo=xv;function Ev(){const{findNode:e}=Ee(),t=xe(new Jo.graphlib.Graph),n=xe("LR");function o(r,i,l){const a=new Jo.graphlib.Graph;t.value=a,a.setDefaultEdgeLabel(()=>({}));const u=l==="LR";a.setGraph({rankdir:l}),n.value=l;for(const s of r){if(s.parentNode)continue;const c=e(s.id);c&&a.setNode(s.id,{width:c.dimensions.width,height:c.dimensions.height})}for(const s of i)a.setEdge(s.source,s.target);return a.graph().ranksep=200,Jo.layout(a),r.map(s=>{const c=a.node(s.id);return c?{...s,targetPosition:u?J.Left:J.Top,sourcePosition:u?J.Right:J.Bottom,position:{x:c.x-c.width/2,y:c.y-c.height/2}}:s})}return{graph:t,layout:o,previousDirection:n}}const Nv={class:"interface-flow-chart"},Sv={class:"docs-overlay"},kv={href:"/tools/staticdocs/docs/tools/cmd-tlm-server#data-flows-tab",target:"_blank",class:"docs-link"},Cv={key:1,class:"empty-state"},$v=50,na=50,Iv=10,Mv=6.5,Ov=40,Dv=60,Tv=98,Pv=148,pm=oa("_",{__name:"InterfaceFlowChart",props:{interfaceDetails:{type:Array,default:()=>[]},routerDetails:{type:Array,default:()=>[]}},setup(e){const{layout:t}=Ev(),{onConnect:n,addEdges:o,onNodesChange:r,applyNodeChanges:i,onEdgesChange:l,applyEdgeChanges:a,fitView:u,findNode:s,getViewport:c,setViewport:d}=Ee(),f=ot("dialog"),h=new hr,m=e,y=xe([]),g=xe([]);let _=!1,S=!1;async function p(N,E=!1){(_||E)&&(y.value=t(y.value,g.value,N),_=!1,S=!1,Ae(()=>{u()}))}n(N=>{let E=N.source.startsWith("interface__"),O=N.target.startsWith("interface__"),T=N.source.startsWith("router__"),R=N.target.startsWith("router__"),H=N.source.startsWith("cosmos__"),Y=N.target.startsWith("cosmos__"),j=N.source.startsWith("target__"),Q=N.target.startsWith("target__"),fe=N.sourceHandle.split("__")[1],M=N.targetHandle.split("__")[1];if(fe!==M||E&&O||T&&R||T&&O||E&&R||H&&Y||j&&Q||H&&Q||j&&Y)return;let D="";H&&(D=D+`cosmos__${N.source.split("__")[1]}`),Y&&(D=D+`cosmos__${N.target.split("__")[1]}`),D.length==0&&(E&&(D=D+`interface__${N.source.split("__")[1]}`),O&&(D=D+`interface__${N.target.split("__")[1]}`),T&&(D=D+`router__${N.source.split("__")[1]}`),R&&(D=D+`router__${N.target.split("__")[1]}`)),D.startsWith("cosmos__")&&(E&&(D=D+`__interface__${N.source.split("__")[1]}`),O&&(D=D+`__interface__${N.target.split("__")[1]}`),T&&(D=D+`__router__${N.source.split("__")[1]}`),R&&(D=D+`__router__${N.target.split("__")[1]}`)),j&&(D=D+`__target__${N.source.split("__")[1]}`),Q&&(D=D+`__target__${N.target.split("__")[1]}`),D=D+`__${fe}`,N.id=D;let G=!1;if(g.value.forEach(x=>{if(x.id===D){G=!0;return}}),G)return;let F="",oe="",re="",ge=D.split("__"),se=ge[0],ae=ge[4];se==="cosmos"?(oe=ge[1],F=ge[2],re=ge[3],ae=="cmd"?(N.type="default",N.label="CMD Enable",N.markerStart={type:"arrowclosed"}):(N.type="default",N.label="Tlm Enable",N.markerEnd={type:"arrowclosed"}),F==="interface"?h.interface_target_enable(re,oe,ae==="cmd",ae==="tlm").then(x=>{o(N),g.value.push(N)}):h.router_target_enable(re,oe,ae==="cmd",ae==="tlm").then(x=>{o(N),g.value.push(N)})):(F=ge[0],re=ge[1],oe=ge[3],ae=="cmd"?(N.type="default",N.label="CMD Map",N.markerStart={type:"arrowclosed"}):(N.type="default",N.label="Tlm Map",N.markerEnd={type:"arrowclosed"}),F==="interface"?f.confirm(`${N.label} target ${oe} to interface ${re}? Note this will cause the interface to restart.`,{okText:"Map",cancelText:"Cancel"}).then(()=>{h.map_target_to_interface(oe,re,ae==="cmd",ae==="tlm",!1).then(x=>{o(N),g.value.push(N)})}):f.confirm(`${N.label} target ${oe} to router ${re}? Note this will cause the router to restart.`,{okText:"Map",cancelText:"Cancel"}).then(()=>{h.map_target_to_router(oe,re,ae==="cmd",ae==="tlm",!1).then(x=>{o(N),g.value.push(N)})}))}),r(async N=>{const E=[];for(const O of N)O.type!=="remove"&&E.push(O),O.type==="dimensions"&&S&&(_=!0,Ae(()=>{p("LR")}));i(E)}),l(async N=>{const E=[];for(const O of N)if(O.type!=="remove")E.push(O);else{let T="",R="",H="",Y="",j="",Q=O.id.split("__"),fe=Q[0],M=Q[4];fe==="cosmos"?(H=Q[1],Y=Q[2],j=Q[3],T=`Disable ${H} ${M} with ${Y} ${j}?`,R="Disable"):(Y=Q[0],j=Q[1],H=Q[3],T=`Unmap ${H} ${M} with ${Y} ${j}? Note this will cause the ${Y} to restart.`,R="Unmap"),f.confirm(T,{okText:R,cancelText:"Cancel"}).then(()=>{fe=="cosmos"?Y=="interface"?h.interface_target_disable(j,H,M==="cmd",M==="tlm").then(D=>{a([O]),g.value.forEach((G,F)=>{if(G.id===O.id){g.value.splice(F,1);return}})}):h.router_target_disable(j,H,M==="cmd",M==="tlm").then(D=>{a([O]),g.value.forEach((G,F)=>{if(G.id===O.id){g.value.splice(F,1);return}})}):Y=="interface"?h.unmap_target_from_interface(H,j,M==="cmd",M==="tlm").then(D=>{a([O]),g.value.forEach((G,F)=>{if(G.id===O.id){g.value.splice(F,1);return}})}):h.unmap_target_from_router(H,j,M==="cmd",M==="tlm").then(D=>{a([O]),g.value.forEach((G,F)=>{if(G.id===O.id){g.value.splice(F,1);return}})})})}a(E)});function C(N){let E=$v;return N.map(O=>{let T=O.name;T.slice(-8)==="Protocol"&&(T=T.slice(0,-8));const R=Math.ceil(Math.max(Dv,Ov+T.length*Mv)),H={label:T,width:R,x:E};return E+=R+Iv,H})}function z(N){if(N.length===0)return 0;const E=N[N.length-1];return E.x+E.width}function V(N){const E=C(N.write_protocols||[]),O=C(N.read_protocols||[]),T=Math.max(200,z(E)+na,z(O)+na);return{writeRow:E,readRow:O,width:T}}function L(N,E,O){[{type:"write-protocol",row:O.writeRow,y:Tv},{type:"read-protocol",row:O.readRow,y:Pv}].forEach(({type:R,row:H,y:Y})=>{H.forEach((j,Q)=>{y.value.push({id:`${R}__${N}__${E}__${Q}`,type:R,position:{x:j.x,y:Y},data:{index:Q,[N]:E,label:j.label,width:j.width},draggable:!1,parentNode:`${N}__${E}`,extent:"parent"})})})}const B=xe(!1),U=xe(null),X=xe(null),A=xe(null),w=xe(null);function P(N){N.node.type==="interface"?(U.value="Interface",X.value=m.interfaceDetails[N.node.data.label],A.value=null,w.value=null,B.value=!0):N.node.type=="router"?(U.value="Router",X.value=m.routerDetails[N.node.data.label],A.value=null,w.value=null,B.value=!0):(N.node.type==="read-protocol"||N.node.type=="write-protocol")&&(N.node.data.interface?(U.value="Interface",X.value=m.interfaceDetails[N.node.data.interface]):(U.value="Router",X.value=m.routerDetails[N.node.data.router]),N.node.type==="write-protocol"?(A.value=N.node.data.index,w.value=null):(A.value=null,w.value=N.node.data.index),B.value=!0)}function b(){const N=new Set(y.value.map(M=>M.id)),E=new Map,O=N.size>0?c():null;y.value.forEach(M=>{const D=s(M.id);D&&E.set(M.id,{x:D.position.x,y:D.position.y})}),y.value=[],g.value=[];const T=[];let R=m.interfaceDetails||{};for(const M in R){(m.interfaceDetails[M].cmd_target_names||[]).forEach(F=>{T.includes(F)||T.push(F);const oe={id:`interface__${M}__target__${F}__cmd`,source:`interface__${M}`,target:`target__${F}`,sourceHandle:"interface__cmd__output",targetHandle:"target__cmd",type:"default",label:"CMD Map",markerEnd:{type:"arrowclosed"}};g.value.push(oe)});for(const[F,oe]of Object.entries(m.interfaceDetails[M].cmd_target_enabled)){if(F==="UNKNOWN"||!oe)continue;const re={id:`cosmos__${F}__interface__${M}__cmd`,target:`interface__${M}`,source:`cosmos__${F}`,sourceHandle:"cosmos__cmd",targetHandle:"interface__cmd__input",type:"default",label:"CMD Enable",markerEnd:{type:"arrowclosed"}};g.value.push(re)}(m.interfaceDetails[M].tlm_target_names||[]).forEach(F=>{T.includes(F)||T.push(F);const oe={id:`interface__${M}__target__${F}__tlm`,source:`interface__${M}`,target:`target__${F}`,sourceHandle:"interface__tlm__output",targetHandle:"target__tlm",type:"default",label:"TLM Map",markerStart:{type:"arrowclosed"}};g.value.push(oe)});for(const[F,oe]of Object.entries(m.interfaceDetails[M].tlm_target_enabled)){if(F==="UNKNOWN"||!oe)continue;const re={id:`cosmos__${F}__interface__${M}__tlm`,target:`interface__${M}`,source:`cosmos__${F}`,sourceHandle:"cosmos__tlm",targetHandle:"interface__tlm__input",type:"default",label:"TLM Enable",markerStart:{type:"arrowclosed"}};g.value.push(re)}}let H=m.routerDetails||{};for(const M in H){(m.routerDetails[M].cmd_target_names||[]).forEach(F=>{T.includes(F)||T.push(F);const oe={id:`router__${M}__target__${F}__cmd`,source:`router__${M}`,target:`target__${F}`,sourceHandle:"router__cmd__output",targetHandle:"target__cmd",type:"default",label:"CMD Map",markerEnd:{type:"arrowclosed"}};g.value.push(oe)});for(const[F,oe]of Object.entries(m.routerDetails[M].cmd_target_enabled)){if(F==="UNKNOWN"||!oe)continue;const re={id:`cosmos__${F}__router__${M}__cmd`,target:`router__${M}`,source:`cosmos__${F}`,sourceHandle:"cosmos__cmd",targetHandle:"router__cmd__input",type:"default",label:"CMD Enable",markerEnd:{type:"arrowclosed"}};g.value.push(re)}(m.routerDetails[M].tlm_target_names||[]).forEach(F=>{T.includes(F)||T.push(F);const oe={id:`router__${M}__target__${F}__tlm`,source:`router__${M}`,target:`target__${F}`,sourceHandle:"router__tlm__output",targetHandle:"target__tlm",type:"default",label:"TLM Map",markerStart:{type:"arrowclosed"}};g.value.push(oe)});for(const[F,oe]of Object.entries(m.routerDetails[M].tlm_target_enabled)){if(F==="UNKNOWN"||!oe)continue;const re={id:`cosmos__${F}__router__${M}__tlm`,target:`router__${M}`,source:`cosmos__${F}`,sourceHandle:"cosmos__tlm",targetHandle:"router__tlm__input",type:"default",label:"TLM Enable",markerStart:{type:"arrowclosed"}};g.value.push(re)}}T.forEach((M,D)=>{let G,F;G=0,F=D*250;const oe={id:`cosmos__${M}`,type:"cosmos",position:{x:G,y:F},data:{label:M},draggable:!0};y.value.push(oe)});let Y=0,j=200;for(const M in R){const D=V(m.interfaceDetails[M]);D.width>j&&(j=D.width);const G=200,F={id:`interface__${M}`,type:"interface",position:{x:400,y:(G+50)*Y},data:{label:M,width:D.width,height:G},draggable:!0};y.value.push(F),Y+=1,L("interface",M,D)}for(const M in H){const D=V(m.routerDetails[M]);D.width>j&&(j=D.width);const G=200,F={id:`router__${M}`,type:"router",position:{x:400,y:(G+50)*Y},data:{label:M,width:D.width,height:G},draggable:!0};y.value.push(F),Y+=1,L("router",M,D)}T.forEach((M,D)=>{let G,F;G=400+j+200,F=D*250;const oe={id:`target__${M}`,type:"target",position:{x:G,y:F},data:{label:M},draggable:!0};y.value.push(oe)});const Q=new Set(y.value.map(M=>M.id));N.size===0||N.size!==Q.size||[...Q].some(M=>!N.has(M))||[...N].some(M=>!Q.has(M))?(S=!0,_=!0):S||(y.value=y.value.map(M=>{const D=E.get(M.id);return D?{...M,position:D}:M}),O&&Ae(()=>{d(O)}))}return _e(()=>m.interfaceDetails,async()=>{m.interfaceDetails!==null&&b()},{immediate:!0}),_e(()=>m.routerDetails,async()=>{m.routerDetails!==null&&b()},{immediate:!0}),(N,E)=>{const O=Se("v-icon"),T=Se("v-dialog");return ee(),de("div",Nv,[y.value.length>0?(ee(),Ie(q(Yf),{key:0,nodes:y.value,edges:g.value,"max-zoom":4,"min-zoom":.01,class:"vue-flow-container","elevate-edges-on-select":"","apply-default":!1,onNodeClick:P},{"node-interface":me(({data:R})=>[le(Oh,{data:R},null,8,["data"])]),"node-router":me(({data:R})=>[le(Ah,{data:R},null,8,["data"])]),"node-target":me(({data:R})=>[le(Xh,{data:R},null,8,["data"])]),"node-cosmos":me(R=>[le(Lh,ur(cr(R)),null,16)]),"node-write-protocol":me(({data:R})=>[le(Zh,{data:R},null,8,["data"])]),"node-read-protocol":me(({data:R})=>[le(Qh,{data:R},null,8,["data"])]),default:me(()=>[le(q(bh),{"pattern-color":"#aaa",gap:16}),ce("div",Sv,[ce("a",kv,[le(O,{size:"small",class:"mr-1"},{default:me(()=>[...E[3]||(E[3]=[Ve("mdi-file-document-outline",-1)])]),_:1}),E[4]||(E[4]=Ve(" Docs ",-1))])]),le(q(ph),null,{default:me(()=>[le(q(on),{title:"Reset",onClick:E[0]||(E[0]=R=>p("LR",!0))},{default:me(()=>[...E[5]||(E[5]=[ce("svg",{width:"16",height:"16",viewBox:"0 0 32 32"},[ce("path",{d:"M18 28A12 12 0 1 0 6 16v6.2l-3.6-3.6L1 20l6 6l6-6l-1.4-1.4L8 22.2V16a10 10 0 1 1 10 10Z"})],-1)])]),_:1})]),_:1})]),_:1},8,["nodes","edges"])):(ee(),de("div",Cv,[le(O,{size:"large",color:"grey"},{default:me(()=>[...E[6]||(E[6]=[Ve("mdi-lan-disconnect",-1)])]),_:1}),E[7]||(E[7]=ce("div",{class:"text-grey mt-2"},"Nothing to show",-1))])),le(T,{modelValue:B.value,"onUpdate:modelValue":E[2]||(E[2]=R=>B.value=R),"max-width":"80vw","max-height":"80vh"},{default:me(()=>[le(Ch,{mode:U.value,details:X.value,"read-protocol-index":w.value,"write-protocol-index":A.value,onClose:E[1]||(E[1]=R=>B.value=!1)},null,8,["mode","details","read-protocol-index","write-protocol-index"])]),_:1},8,["modelValue"])])}}})})}}));