openc3-cosmos-tool-cmdtlmserver 7.2.1 → 7.4.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.
- checksums.yaml +4 -4
- data/tools/cmdtlmserver/{ArrayWidget-DMSm_P6c-694a5d20f37aee56e971.js → ArrayWidget-CIDdZjk3-e93771de14c32c248c92.js} +2 -2
- data/tools/cmdtlmserver/ArrayplotWidget-BfO1atvG-8b8fb63663cdcaf7deb3.js +1 -0
- data/tools/cmdtlmserver/BarColumn-CHX_3ye3-bd438bf972b67e4ed46c.js +1 -0
- data/tools/cmdtlmserver/BlockWidget-DSbunlY_-8140c3fc46c60895b065.js +2 -0
- data/tools/cmdtlmserver/ButtonWidget-BB4ZOCI8-877b51169cdd22a77791.js +1 -0
- data/tools/cmdtlmserver/CanvasWidget-DsyMt7xW-7cfb9d7eaec179010426.js +1 -0
- data/tools/cmdtlmserver/CanvasdotWidget-BZpkCAoH-adf05ba917ad02a80cab.js +1 -0
- data/tools/cmdtlmserver/{CanvasimageWidget-Czbq1GuF-f6237d2815bb4fb67627.js → CanvasimageWidget-DY1DDf0a-a34fd029ec2d25c17273.js} +1 -1
- data/tools/cmdtlmserver/CanvasimagevalueWidget-0lc2cCPV-2e9d2826ca46f991f111.js +1 -0
- data/tools/cmdtlmserver/CanvaslabelWidget-C6TDW9WO-da217b5f77c7ca2537f1.js +1 -0
- data/tools/cmdtlmserver/{CanvaslabelvalueWidget-BhzvZVfD-98ba8f4d0b737ae50149.js → CanvaslabelvalueWidget-Cf_dcDW2-bdf8b368fdb1fa71ebca.js} +1 -1
- data/tools/cmdtlmserver/CanvaslineWidget-jg2ozQ0N-eb531c51bbb4d3dc6a91.js +1 -0
- data/tools/cmdtlmserver/{CanvaslinevalueWidget-ihI97G8T-a999105fab2c48e7d5a3.js → CanvaslinevalueWidget-CKpjqlKA-17dde2a6a449ad806015.js} +1 -1
- data/tools/cmdtlmserver/CheckbuttonWidget-BWXinMaT-a54626829bc2de216d16.js +1 -0
- data/tools/cmdtlmserver/CmdPacketsTab-f0d7bb17079717aaa76e.js +1 -0
- data/tools/cmdtlmserver/CmdTlmServer-32bff3fcc4b2ce263346.js +2 -0
- data/tools/cmdtlmserver/{ComboboxWidget-CuuvOL9K-580e3a816c2a39c9dc31.js → ComboboxWidget-BzKkyRDT-d2609655726e617e6140.js} +1 -1
- data/tools/cmdtlmserver/DataFlowsTab-f8fa7ccddb2e11c0f4bd.js +1 -0
- data/tools/cmdtlmserver/DateWidget-qUbLzQsX-b058fb471e3fcd797726.js +1 -0
- data/tools/cmdtlmserver/DetailsDialog-CLPj0nP0-a923096c03a16ab24ce5.js +1 -0
- data/tools/cmdtlmserver/{DynamicWidget-BuSbQVhf-d28b4dd265895ced834e.js → DynamicWidget-yna_ejyc-67de1a2e4d3ca8e77d13.js} +1 -1
- data/tools/cmdtlmserver/FilechecksumWidget-DqNThsOX-9a244d23a05ba0cd4bc2.js +1 -0
- data/tools/cmdtlmserver/FiledisplayWidget-BRhhiVEs-8aee77b81ad52706adde.js +1 -0
- data/tools/cmdtlmserver/{FormatvalueWidget-BxyscMJc-deb6fbbd21db3f9b9533.js → FormatvalueWidget-pEjAh0h2-a8635e2292e64cf5e39f.js} +1 -1
- data/tools/cmdtlmserver/Graph-GVQZltap-916f8970fd5d42822d89.js +1 -0
- data/tools/cmdtlmserver/{GraphWidget-Cs9mvqUu-bb3bb075fd0ea3764beb.js → GraphWidget-BZjBkefj-d9dcbf0fe719cf812d83.js} +1 -1
- data/tools/cmdtlmserver/{HorizontalWidget-fWLFj7Kg-87dfe4a783ca9d8718a3.js → HorizontalWidget-Brag6E4y-48ed7a3d841d69afb943.js} +1 -1
- data/tools/cmdtlmserver/HorizontalboxWidget-BnkH4cVq-a81cc9f7c04e629754a0.js +1 -0
- data/tools/cmdtlmserver/HorizontallineWidget-k7fL4EPN-3583b50d2753936758e5.js +1 -0
- data/tools/cmdtlmserver/{IframeWidget-B143k4lo-211336261edc12558ba4.js → IframeWidget-Ciu5u58E-f35e28d26845c9ce425c.js} +1 -1
- data/tools/cmdtlmserver/ImageLoader-DH5e4lg8-3426a1c0f41a2bf44392.js +1 -0
- data/tools/cmdtlmserver/{ImageviewerWidget-CLrvr6dw-dbefc7bb490747b4d32b.js → ImageviewerWidget-vWMGPveb-3e068b180f6cf32ccd24.js} +1 -1
- data/tools/cmdtlmserver/InterfaceFlowChart-9ca67c593f3f2b877ee3.js +27 -0
- data/tools/cmdtlmserver/{InterfacesTab-c3d2cc4844087b3f946d.js → InterfacesTab-b3f53afb2ca5b30d2920.js} +1 -1
- data/tools/cmdtlmserver/{LabelWidget-CA1bTX2B-2c9d603681176335c5dd.js → LabelWidget-DVp0CmFH-97b4d14caae36b2b70fe.js} +1 -1
- data/tools/cmdtlmserver/LabelledWidget-1DeE1-6G-12aab221c27e077c7d31.js +1 -0
- data/tools/cmdtlmserver/LabelprogressbarWidget-DME-BrZe-03f95b34969c5b14cff6.js +1 -0
- data/tools/cmdtlmserver/LabelsparklineWidget-4iDHGnPL-f5ce9a4673c260d290c5.js +1 -0
- data/tools/cmdtlmserver/LabelvalueWidget-C6NQSHTb-84fc8a12ee8e4f0de54c.js +1 -0
- data/tools/cmdtlmserver/LabelvaluedescWidget-c5BUCRxB-2656a7bcfe6096dc52cd.js +1 -0
- data/tools/cmdtlmserver/LabelvaluelimitsbarWidget-DBKZLpXJ-af39812293b33f70b279.js +1 -0
- data/tools/cmdtlmserver/LabelvaluelimitscolumnWidget-NdEu06go-fef2aa9ed08cdf93d61d.js +1 -0
- data/tools/cmdtlmserver/LabelvaluerangebarWidget-CL5HLK0t-5e27588fee9cb4b7e9b8.js +1 -0
- data/tools/cmdtlmserver/{Layout--_zNJWnw-9367ae190fb0e9bf1b84.js → Layout-Df-lJgpB-914d505c295d7f5a9791.js} +1 -1
- data/tools/cmdtlmserver/{LedWidget-D2uxHxe3-22c8c1f89536f753f5e6.js → LedWidget-C97EJXBo-ce386ba85aedd75e9d27.js} +1 -1
- data/tools/cmdtlmserver/{LimitsBar-DN1s8-MS-d3248be80e3262273e82.js → LimitsBar-DNV39okL-cd07952d9c04ed1affbf.js} +1 -1
- data/tools/cmdtlmserver/LimitsbarWidget-BIO6xztx-28058ac54835f172dbaf.js +1 -0
- data/tools/cmdtlmserver/{LimitscolorWidget-haGB4RbY-ddf6b0791eb1be4ac6c5.js → LimitscolorWidget-BGrNA65J-a076cfb171ef2babaa50.js} +1 -1
- data/tools/cmdtlmserver/LimitscolumnWidget-Bw6EXJs9-d6e1e239d7c084c9f7bf.js +1 -0
- data/tools/cmdtlmserver/LinegraphWidget-Drf9tTPN-7c9a449d8dd3306582bf.js +1 -0
- data/tools/cmdtlmserver/{MatrixbycolumnsWidget-coHlLETG-e799eaa675cfbf970ed5.js → MatrixbycolumnsWidget-C33-g7kK-76c56ce004a1c3313336.js} +1 -1
- data/tools/cmdtlmserver/OpenC3TimePicker-cOr0aOVn-5ffe76ce1ab1f7ec0439.js +1 -0
- data/tools/cmdtlmserver/{ProgressbarWidget-D_yFssIZ-2510755cf05a8167431f.js → ProgressbarWidget-DqfSMI10-ce9c22710e61dc0b0e7c.js} +1 -1
- data/tools/cmdtlmserver/{RadiobuttonWidget-DL0jVTcb-101358296cb6f3e5ac75.js → RadiobuttonWidget-CSQeEacF-29953a844e8a06d304b9.js} +1 -1
- data/tools/cmdtlmserver/{RadiogroupWidget-2-td69IA-98144436c4729f2db047.js → RadiogroupWidget-DlQN9z-Z-bf4604885d001ad1f14f.js} +1 -1
- data/tools/cmdtlmserver/{RangebarWidget-i2mlnxys-3ecd19c88b6a2f13fc7a.js → RangebarWidget-CJSUof1--8b45d597a2fa911a953e.js} +1 -1
- data/tools/cmdtlmserver/{RawBuffer-5a59e58e37f6021cf46c.js → RawBuffer-d28de8d99b97e4d9e74a.js} +3 -3
- data/tools/cmdtlmserver/{RawDialog-3a0c000973893535a456.js → RawDialog-d0bdc67425dd15985b00.js} +1 -1
- data/tools/cmdtlmserver/{RollupWidget-BEJ2Icg1-416b8d9160f2a81fd538.js → RollupWidget-C977Lkcx-5ea74809c15bc60824cc.js} +1 -1
- data/tools/cmdtlmserver/{RoutersTab-7710ec67843901567d25.js → RoutersTab-06e215b54b2908b15301.js} +1 -1
- data/tools/cmdtlmserver/{ScrollwindowWidget-BU1cRpL8-d99f9e1c5467abc7ed03.js → ScrollwindowWidget-BFxz61oW-6a02d29fb76c6bc1625a.js} +1 -1
- data/tools/cmdtlmserver/{SignalWidget-hiTkeem9-9efe6cdd22515ebf8555.js → SignalWidget-BT6AcbBx-2f3a2c5e5b84c96df438.js} +1 -1
- data/tools/cmdtlmserver/SpacerWidget-B_f09KAi-d35a958be49dff620492.js +1 -0
- data/tools/cmdtlmserver/SparklineWidget-Bji9DILO-bc83a95dc405fc0453c5.js +1 -0
- data/tools/cmdtlmserver/{StatusTab-efcdd278c79f71b06e9b.js → StatusTab-575b3032342d08db5f96.js} +1 -1
- data/tools/cmdtlmserver/TabbookWidget-B74U8t2i-9274e9ec55c4292f274e.js +1 -0
- data/tools/cmdtlmserver/TargetsTab-b9f1a2b988ce8badd79d.js +1 -0
- data/tools/cmdtlmserver/TextboxWidget-CbKE9aSW-41ad0a5667b4b674d749.js +1 -0
- data/tools/cmdtlmserver/TextfieldWidget-CpdmfNk5-5fd1754fbc27b848e303.js +1 -0
- data/tools/cmdtlmserver/TimeWidget-BTaXBxVm-c61be141d1e5cc25062c.js +1 -0
- data/tools/cmdtlmserver/TitleWidget-ulO_gdVY-db3241f7de1f3c57a698.js +1 -0
- data/tools/cmdtlmserver/TlmPacketsTab-f24389ab30f97699f498.js +1 -0
- data/tools/cmdtlmserver/{Updater-af04370b0601580396d1.js → Updater-f4069804660e1d2bb1fb.js} +1 -1
- data/tools/cmdtlmserver/{VWidget-5qOYva88-5dc877752d53235d987d.js → VWidget-C4VLQ7-b-4ba9d3f0cbd835b6e437.js} +1 -1
- data/tools/cmdtlmserver/{ValueWidget-CAkuc_w_-0721aa9556f274d056ba.js → ValueWidget-B3-Jjoux-a1da92404f65428e9c38.js} +1 -1
- data/tools/cmdtlmserver/ValuelimitsbarWidget-CqRkPwWS-51f01694576524ab034a.js +1 -0
- data/tools/cmdtlmserver/{ValuelimitscolumnWidget-iOjB_fCj-ae174dd346919467bac7.js → ValuelimitscolumnWidget-CF4CN14a-7d5d1d7a571bb56f6f9b.js} +1 -1
- data/tools/cmdtlmserver/ValuerangebarWidget-DJtrknKH-4e5ab6bdc8c7135368d5.js +1 -0
- data/tools/cmdtlmserver/{VerticalWidget-C6O0dhRU-a30bbb27eaa68c233c89.js → VerticalWidget-CoJiy2TT-aaba0f3431f867ad36d1.js} +1 -1
- data/tools/cmdtlmserver/{VerticalboxWidget-B-CoqRJG-ba12b0177fbcd7fb76e1.js → VerticalboxWidget-BD5Eq3BH-8de3b73d0af06049b633.js} +1 -1
- data/tools/cmdtlmserver/Widget-ClRi417b-9e12a24a4c1c96620549.js +1 -0
- data/tools/cmdtlmserver/main-c7bd98cfab79a58efd19.js +1493 -0
- data/tools/cmdtlmserver/main.js +1 -1
- data/tools/cmdtlmserver/services-cd44604ec0d9ce785778.js +10 -0
- metadata +84 -84
- data/tools/cmdtlmserver/ArrayplotWidget-fdXLhGAl-ee49423a88f0830f3d10.js +0 -1
- data/tools/cmdtlmserver/BarColumn-Bb305iCi-1d6370d3a5948e7070fb.js +0 -1
- data/tools/cmdtlmserver/BlockWidget-Do3W6tZh-0465ab5ccbba95c9cd95.js +0 -2
- data/tools/cmdtlmserver/ButtonWidget-DukCQt0F-73553c5eb8665f5a122c.js +0 -2
- data/tools/cmdtlmserver/CanvasWidget-BRdVWln5-ecfd6c23ebdef1641cbe.js +0 -1
- data/tools/cmdtlmserver/CanvasdotWidget-DV8PeDWz-9ea509837174f807accc.js +0 -1
- data/tools/cmdtlmserver/CanvasimagevalueWidget-DKt5JgEt-4d4748409b4390fd9317.js +0 -1
- data/tools/cmdtlmserver/CanvaslabelWidget-DW2I1ra1-21be90e9689988d7cc0b.js +0 -1
- data/tools/cmdtlmserver/CanvaslineWidget-DsjY37tp-333343a7e55e7ced336a.js +0 -1
- data/tools/cmdtlmserver/CheckbuttonWidget-B778Z-Zo-929c0f581f4e6fc8bb9b.js +0 -1
- data/tools/cmdtlmserver/CmdPacketsTab-ab63982334bccb674566.js +0 -1
- data/tools/cmdtlmserver/CmdTlmServer-dbb3257de023db2ad7db.js +0 -2
- data/tools/cmdtlmserver/DataFlowsTab-651405c9f3cd11ec53ae.js +0 -1
- data/tools/cmdtlmserver/DateWidget-COvQTAeo-8e7e5760cca1eca77fb7.js +0 -1
- data/tools/cmdtlmserver/DetailsDialog-DE7lK17G-f251b58f150be03f9878.js +0 -1
- data/tools/cmdtlmserver/FilechecksumWidget-DRnOt_UE-e8bcb330e9f8161abcb5.js +0 -1
- data/tools/cmdtlmserver/FiledisplayWidget-26R46EjS-50600e2205e679c6e7a3.js +0 -1
- data/tools/cmdtlmserver/Graph-BKw7xw1a-cafa3fdb6d474421c777.js +0 -1
- data/tools/cmdtlmserver/HorizontalboxWidget-DEaXhKEz-3cc78a62e93fced5cc2d.js +0 -1
- data/tools/cmdtlmserver/HorizontallineWidget-Bvu1QP3S-1c0a38d8daf4285046b0.js +0 -1
- data/tools/cmdtlmserver/ImageLoader-BCpmQHIl-e1f186d47f7443384752.js +0 -1
- data/tools/cmdtlmserver/InterfaceFlowChart-87892813bbc3da7dd816.js +0 -27
- data/tools/cmdtlmserver/LabelledWidget-BDhvr03J-fe41df86dd3cc7e1d625.js +0 -1
- data/tools/cmdtlmserver/LabelprogressbarWidget-g7A5CE8S-17fe760704ac3e7697ad.js +0 -1
- data/tools/cmdtlmserver/LabelsparklineWidget-B27xXxWg-960e3827bda04825c04a.js +0 -1
- data/tools/cmdtlmserver/LabelvalueWidget-DFn8o6LC-382c91895aa50abef201.js +0 -1
- data/tools/cmdtlmserver/LabelvaluedescWidget-BQpaxFaB-abcd49094e4d21057a3d.js +0 -1
- data/tools/cmdtlmserver/LabelvaluelimitsbarWidget-C-z96q8z-1f5e8f4cf393ac65098f.js +0 -1
- data/tools/cmdtlmserver/LabelvaluelimitscolumnWidget-D2TMEv9O-11b6844f84b58504c3aa.js +0 -1
- data/tools/cmdtlmserver/LabelvaluerangebarWidget-D99dZCjz-2c72dd417308f8cf3b83.js +0 -1
- data/tools/cmdtlmserver/LimitsbarWidget-Cqhh7LKU-7f40da6484ccbe5da287.js +0 -1
- data/tools/cmdtlmserver/LimitscolumnWidget-B1GdmlR_-86b9a2cc5c084b705674.js +0 -1
- data/tools/cmdtlmserver/LinegraphWidget-COSOQ0uM-a5300046319a8e9bc2ac.js +0 -1
- data/tools/cmdtlmserver/OpenC3TimePicker-B8Vu9GBz-89d21b420245131e470d.js +0 -1
- data/tools/cmdtlmserver/SpacerWidget-CBmzzS_X-e8f51b2251bb08fed6b0.js +0 -1
- data/tools/cmdtlmserver/SparklineWidget-CizRh6QR-92a3ebcc84a5687d3b93.js +0 -1
- data/tools/cmdtlmserver/TabbookWidget-CvL3Ozmx-19c91b22633cf0927a1e.js +0 -1
- data/tools/cmdtlmserver/TargetsTab-326711a03f6c9686634d.js +0 -1
- data/tools/cmdtlmserver/TextboxWidget-BtEwXzDO-52792ac2b6593c85c776.js +0 -1
- data/tools/cmdtlmserver/TextfieldWidget-BDbb57HP-7306fcc70fc27079b1d3.js +0 -1
- data/tools/cmdtlmserver/TimeWidget-DzD8U8l8-db805689f0b8dbaab9f7.js +0 -1
- data/tools/cmdtlmserver/TitleWidget-CL53vf14-c0987297e98b6c858650.js +0 -1
- data/tools/cmdtlmserver/TlmPacketsTab-91250bba537c7eb02f7c.js +0 -1
- data/tools/cmdtlmserver/ValuelimitsbarWidget-Y8sO05E1-f729f6e347b2f5825407.js +0 -1
- data/tools/cmdtlmserver/ValuerangebarWidget-DsCoeAm6-7804711bfe999dad21a6.js +0 -1
- data/tools/cmdtlmserver/Widget-CtYQauzA-69fc956797d4c4719727.js +0 -1
- data/tools/cmdtlmserver/main-78902a467d9f5f7771dd.js +0 -1499
- data/tools/cmdtlmserver/services-fee3a04fec3ff6af8998.js +0 -10
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
System.register(["vue","./Updater-f4069804660e1d2bb1fb.js","./RawBuffer-d28de8d99b97e4d9e74a.js","./main-c7bd98cfab79a58efd19.js","./services-cd44604ec0d9ce785778.js"],(function(na,Rv){"use strict";var Kn,ot,qn,_e,ft,Ne,Jo,Qo,Q,de,q,le,me,ke,er,be,xe,he,Ke,ht,gt,tr,At,ze,nr,qe,ce,Re,sn,Te,Jn,or,Ie,Me,De,un,rr,ir,pe,Se,ye,lr,Qn,pt,Be,Rt,ar,sr,ur,cr,dr,rt,fr;return{setters:[te=>{Kn=te.getCurrentScope,ot=te.inject,qn=te.effectScope,_e=te.watch,ft=te.provide,Ne=te.defineComponent,Jo=te.useSlots,Qo=te.onUnmounted,Q=te.openBlock,de=te.createElementBlock,q=te.unref,le=te.createVNode,me=te.withCtx,ke=te.renderSlot,er=te.createPropsRestProxy,be=te.toRef,xe=te.ref,he=te.computed,Ke=te.onMounted,ht=te.normalizeClass,gt=te.getCurrentInstance,tr=te.reactive,At=te.onScopeDispose,ze=te.nextTick,nr=te.onBeforeMount,qe=te.shallowRef,ce=te.createElementVNode,Re=te.Fragment,sn=te.renderList,Te=te.normalizeStyle,Jn=te.onBeforeUnmount,or=te.isMemoSame,Ie=te.createBlock,Me=te.createCommentVNode,De=te.toDisplayString,un=te.isRef,rr=te.toRefs,ir=te.customRef,pe=te.toValue,Se=te.resolveComponent,ye=te.h,lr=te.useAttrs,Qn=te.mergeProps,pt=te.resolveDynamicComponent,Be=te.createTextVNode,Rt=te.markRaw,ar=te.readonly,sr=te.normalizeProps,ur=te.guardReactiveProps},te=>{cr=te.U},te=>{dr=te.R},te=>{rt=te._},te=>{fr=te.Q}],execute:(function(){var te=document.createElement("style");te.textContent=`.details-table[data-v-5079ef7f]{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(te);function Bt(e){return Kn()?(At(e),!0):!1}function Je(e){return typeof e=="function"?e():q(e)}const oa=typeof window<"u"&&typeof document<"u",ra=e=>typeof e<"u",ia=Object.prototype.toString,la=e=>ia.call(e)==="[object Object]",aa=()=>{};function sa(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 hr=e=>e();function ua(e=hr){const t=xe(!0);function n(){t.value=!1}function o(){t.value=!0}const r=(...i)=>{t.value&&e(...i)};return{isActive:ar(t),pause:n,resume:o,eventFilter:r}}function gr(e,t=!1,n="Timeout"){return new Promise((o,r)=>{setTimeout(t?()=>r(n):o,e)})}function ca(e,t,n={}){const{eventFilter:o=hr,...r}=n;return _e(e,sa(o,t),r)}function St(e,t,n={}){const{eventFilter:o,...r}=n,{eventFilter:i,pause:l,resume:a,isActive:u}=ua(o);return{stop:ca(e,t,{...r,eventFilter:i}),pause:l,resume:a,isActive:u}}function da(e,t={}){if(!un(e))return rr(e);const n=Array.isArray(e.value)?Array.from({length:e.value.length}):{};for(const o in e.value)n[o]=ir(()=>({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:b}={}){let w=null;const N=[new Promise(g=>{w=_e(e,E=>{d(E)!==t&&(w?.(),g(E))},{flush:f,deep:h,immediate:!0})})];return m!=null&&N.push(gr(m,b).then(()=>Je(e)).finally(()=>w?.())),Promise.race(N)}function o(d,f){if(!un(d))return n(E=>E===d,f);const{flush:h="sync",deep:m=!1,timeout:b,throwOnTimeout:w}=f??{};let C=null;const g=[new Promise(E=>{C=_e([e,d],([T,B])=>{t!==(T===B)&&(C?.(),E(T))},{flush:h,deep:m,immediate:!0})})];return b!=null&&g.push(gr(b,w).then(()=>Je(e)).finally(()=>(C?.(),Je(e)))),Promise.race(g)}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 fa(e){var t;const n=Je(e);return(t=n?.$el)!=null?t:n}const pr=oa?window:void 0;function vr(...e){let t,n,o,r;if(typeof e[0]=="string"||Array.isArray(e[0])?([n,o,r]=e,t=pr):[t,n,o,r]=e,!t)return aa;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(()=>[fa(t),Je(r)],([c,d])=>{if(l(),!c)return;const f=la(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 ha(e){return typeof e=="function"?e:typeof e=="string"?t=>t.key===e:Array.isArray(e)?t=>e.includes(t.key):()=>!0}function mr(...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=pr,eventName:i="keydown",passive:l=!1,dedupe:a=!1}=o,u=ha(t);return vr(r,i,c=>{c.repeat&&Je(a)||u(c)&&n(c)},l)}function ga(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 b=s;t||(t="modelValue"),b=b||`update:${t.toString()}`;const w=g=>a?typeof a=="function"?a(g):ga(g):g,C=()=>ra(e[t])?w(e[t]):d,N=g=>{f?f(g)&&m(b,g):m(b,g)};if(u){const g=C(),E=xe(g);let T=!1;return _e(()=>e[t],B=>{T||(T=!0,E.value=w(B),ze(()=>T=!1))}),_e(E,B=>{!T&&(B!==e[t]||c)&&N(B)},{deep:c}),E}else return he({get(){return C()},set(g){N(g)}})}var pa={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 va(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=va(e+"",n),r,i=-1,l=o.length;if(arguments.length<2){for(;++i<l;)if((r=(e=o[i]).type)&&(r=ma(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]=_r(n[r],e.name,t);else if(t==null)for(r in n)n[r]=_r(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 ma(e,t){for(var n=0,o=e.length,r;n<o;++n)if((r=e[n]).name===t)return r.value}function _r(e,t,n){for(var o=0,r=e.length;o<r;++o)if(e[o].name===t){e[o]=pa,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 yr={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)),yr.hasOwnProperty(t)?{space:yr[t],local:e}:e}function _a(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 ya(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function wr(e){var t=fn(e);return(t.local?ya:_a)(t)}function wa(){}function ro(e){return e==null?wa:function(){return this.querySelector(e)}}function ba(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 Ae(o,this._parents)}function xa(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function Ea(){return[]}function br(e){return e==null?Ea:function(){return this.querySelectorAll(e)}}function Na(e){return function(){return xa(e.apply(this,arguments))}}function Sa(e){typeof e=="function"?e=Na(e):e=br(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 Ae(o,r)}function xr(e){return function(){return this.matches(e)}}function Er(e){return function(t){return t.matches(e)}}var ka=Array.prototype.find;function Ca(e){return function(){return ka.call(this.children,e)}}function $a(){return this.firstElementChild}function Ia(e){return this.select(e==null?$a:Ca(typeof e=="function"?e:Er(e)))}var Ma=Array.prototype.filter;function Oa(){return Array.from(this.children)}function Da(e){return function(){return Ma.call(this.children,e)}}function Ta(e){return this.selectAll(e==null?Oa:Da(typeof e=="function"?e:Er(e)))}function Pa(e){typeof e!="function"&&(e=xr(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 Ae(o,this._parents)}function Nr(e){return new Array(e.length)}function za(){return new Ae(this._enter||this._groups.map(Nr),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 Aa(e){return function(){return e}}function Ra(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 Ba(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 Va(e){return e.__data__}function La(e,t){if(!arguments.length)return Array.from(this,Va);var n=t?Ba:Ra,o=this._parents,r=this._groups;typeof e!="function"&&(e=Aa(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=Ha(e.call(c,c&&c.__data__,s,o)),m=h.length,b=a[s]=new Array(m),w=l[s]=new Array(m),C=u[s]=new Array(f);n(c,d,b,w,C,h,t);for(var N=0,g=0,E,T;N<m;++N)if(E=b[N]){for(N>=g&&(g=N+1);!(T=w[g])&&++g<m;);E._next=T||null}}return l=new Ae(l,o),l._enter=a,l._exit=u,l}function Ha(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Fa(){return new Ae(this._exit||this._groups.map(Nr),this._parents)}function Ya(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 Ga(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 Ae(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 Xa(e){e||(e=Ua);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 Ae(r,this._parents).order()}function Ua(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function Wa(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function Za(){return Array.from(this)}function Ka(){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 qa(){let e=0;for(const t of this)++e;return e}function Ja(){return!this.node()}function Qa(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 es(e){return function(){this.removeAttribute(e)}}function ts(e){return function(){this.removeAttributeNS(e.space,e.local)}}function ns(e,t){return function(){this.setAttribute(e,t)}}function os(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function rs(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function is(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 ls(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?ts:es:typeof t=="function"?n.local?is:rs:n.local?os:ns)(n,t))}function Sr(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function as(e){return function(){this.style.removeProperty(e)}}function ss(e,t,n){return function(){this.style.setProperty(e,t,n)}}function us(e,t,n){return function(){var o=t.apply(this,arguments);o==null?this.style.removeProperty(e):this.style.setProperty(e,o,n)}}function cs(e,t,n){return arguments.length>1?this.each((t==null?as:typeof t=="function"?us:ss)(e,t,n??"")):kt(this.node(),e)}function kt(e,t){return e.style.getPropertyValue(t)||Sr(e).getComputedStyle(e,null).getPropertyValue(t)}function ds(e){return function(){delete this[e]}}function fs(e,t){return function(){this[e]=t}}function hs(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function gs(e,t){return arguments.length>1?this.each((t==null?ds:typeof t=="function"?hs:fs)(e,t)):this.node()[e]}function kr(e){return e.trim().split(/^|\s+/)}function io(e){return e.classList||new Cr(e)}function Cr(e){this._node=e,this._names=kr(e.getAttribute("class")||"")}Cr.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 $r(e,t){for(var n=io(e),o=-1,r=t.length;++o<r;)n.add(t[o])}function Ir(e,t){for(var n=io(e),o=-1,r=t.length;++o<r;)n.remove(t[o])}function ps(e){return function(){$r(this,e)}}function vs(e){return function(){Ir(this,e)}}function ms(e,t){return function(){(t.apply(this,arguments)?$r:Ir)(this,e)}}function _s(e,t){var n=kr(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"?ms:t?ps:vs)(n,t))}function ys(){this.textContent=""}function ws(e){return function(){this.textContent=e}}function bs(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function xs(e){return arguments.length?this.each(e==null?ys:(typeof e=="function"?bs:ws)(e)):this.node().textContent}function Es(){this.innerHTML=""}function Ns(e){return function(){this.innerHTML=e}}function Ss(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function ks(e){return arguments.length?this.each(e==null?Es:(typeof e=="function"?Ss:Ns)(e)):this.node().innerHTML}function Cs(){this.nextSibling&&this.parentNode.appendChild(this)}function $s(){return this.each(Cs)}function Is(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Ms(){return this.each(Is)}function Os(e){var t=typeof e=="function"?e:wr(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function Ds(){return null}function Ts(e,t){var n=typeof e=="function"?e:wr(e),o=t==null?Ds:typeof t=="function"?t:ro(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),o.apply(this,arguments)||null)})}function Ps(){var e=this.parentNode;e&&e.removeChild(this)}function zs(){return this.each(Ps)}function As(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Rs(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Bs(e){return this.select(e?Rs:As)}function Vs(e){return arguments.length?this.property("__data__",e):this.node().__data__}function Ls(e){return function(t){e.call(this,t,this.__data__)}}function Hs(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 Fs(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 Ys(e,t,n){return function(){var o=this.__on,r,i=Ls(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 Gs(e,t,n){var o=Hs(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?Ys:Fs,r=0;r<i;++r)this.each(a(o[r],t,n));return this}function Mr(e,t,n){var o=Sr(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 Mr(this,e,t)}}function Xs(e,t){return function(){return Mr(this,e,t.apply(this,arguments))}}function Us(e,t){return this.each((typeof t=="function"?Xs:js)(e,t))}function*Ws(){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 Or=[null];function Ae(e,t){this._groups=e,this._parents=t}function Vt(){return new Ae([[document.documentElement]],Or)}function Zs(){return this}Ae.prototype=Vt.prototype={constructor:Ae,select:ba,selectAll:Sa,selectChild:Ia,selectChildren:Ta,filter:Pa,data:La,enter:za,exit:Fa,join:Ya,merge:Ga,selection:Zs,order:ja,sort:Xa,call:Wa,nodes:Za,node:Ka,size:qa,empty:Ja,each:Qa,attr:ls,style:cs,property:gs,classed:_s,text:xs,html:ks,raise:$s,lower:Ms,append:Os,insert:Ts,remove:zs,clone:Bs,datum:Vs,on:Gs,dispatch:Us,[Symbol.iterator]:Ws};function Ve(e){return typeof e=="string"?new Ae([[document.querySelector(e)]],[document.documentElement]):new Ae([[e]],Or)}function Ks(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Ye(e,t){if(e=Ks(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 qs={passive:!1},Lt={capture:!0,passive:!1};function lo(e){e.stopImmediatePropagation()}function Ct(e){e.preventDefault(),e.stopImmediatePropagation()}function Dr(e){var t=e.document.documentElement,n=Ve(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 Tr(e,t){var n=e.document.documentElement,o=Ve(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 Js(e){return!e.ctrlKey&&!e.button}function Qs(){return this.parentNode}function eu(e,t){return t??{x:e.x,y:e.y}}function tu(){return navigator.maxTouchPoints||"ontouchstart"in this}function nu(){var e=Js,t=Qs,n=eu,o=tu,r={},i=cn("start","drag","end"),l=0,a,u,s,c,d=0;function f(E){E.on("mousedown.drag",h).filter(o).on("touchstart.drag",w).on("touchmove.drag",C,qs).on("touchend.drag touchcancel.drag",N).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function h(E,T){if(!(c||!e.call(this,E,T))){var B=g(this,t.call(this,E,T),E,T,"mouse");B&&(Ve(E.view).on("mousemove.drag",m,Lt).on("mouseup.drag",b,Lt),Dr(E.view),lo(E),s=!1,a=E.clientX,u=E.clientY,B("start",E))}}function m(E){if(Ct(E),!s){var T=E.clientX-a,B=E.clientY-u;s=T*T+B*B>d}r.mouse("drag",E)}function b(E){Ve(E.view).on("mousemove.drag mouseup.drag",null),Tr(E.view,s),Ct(E),r.mouse("end",E)}function w(E,T){if(e.call(this,E,T)){var B=E.changedTouches,L=t.call(this,E,T),P=B.length,j,G;for(j=0;j<P;++j)(G=g(this,L,E,T,B[j].identifier,B[j]))&&(lo(E),G("start",E,B[j]))}}function C(E){var T=E.changedTouches,B=T.length,L,P;for(L=0;L<B;++L)(P=r[T[L].identifier])&&(Ct(E),P("drag",E,T[L]))}function N(E){var T=E.changedTouches,B=T.length,L,P;for(c&&clearTimeout(c),c=setTimeout(function(){c=null},500),L=0;L<B;++L)(P=r[T[L].identifier])&&(lo(E),P("end",E,T[L]))}function g(E,T,B,L,P,j){var G=i.copy(),A=Ye(j||B,T),S,F,y;if((y=n.call(E,new ao("beforestart",{sourceEvent:B,target:f,identifier:P,active:l,x:A[0],y:A[1],dx:0,dy:0,dispatch:G}),L))!=null)return S=y.x-A[0]||0,F=y.y-A[1]||0,function p(_,M,z){var R=A,V;switch(_){case"start":r[P]=p,V=l++;break;case"end":delete r[P],--l;case"drag":A=Ye(z||M,T),V=l;break}G.call(_,E,new ao(_,{sourceEvent:M,subject:y,target:f,identifier:P,active:V,x:A[0]+S,y:A[1]+F,dx:A[0]-R[0],dy:A[1]-R[1],dispatch:G}),L)}}return f.filter=function(E){return arguments.length?(e=typeof E=="function"?E:gn(!!E),f):e},f.container=function(E){return arguments.length?(t=typeof E=="function"?E:gn(E),f):t},f.subject=function(E){return arguments.length?(n=typeof E=="function"?E:gn(E),f):n},f.touchable=function(E){return arguments.length?(o=typeof E=="function"?E:gn(!!E),f):o},f.on=function(){var E=i.on.apply(i,arguments);return E===i?f:E},f.clickDistance=function(E){return arguments.length?(d=(E=+E)*E,f):Math.sqrt(d)},f}function so(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Pr(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*",ou=/^#([0-9a-f]{3,8})$/,ru=new RegExp(`^rgb\\(${$t},${$t},${$t}\\)$`),iu=new RegExp(`^rgb\\(${Ge},${Ge},${Ge}\\)$`),lu=new RegExp(`^rgba\\(${$t},${$t},${$t},${Yt}\\)$`),au=new RegExp(`^rgba\\(${Ge},${Ge},${Ge},${Yt}\\)$`),su=new RegExp(`^hsl\\(${Yt},${Ge},${Ge}\\)$`),uu=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:Ar,formatHex:Ar,formatHex8:cu,formatHsl:du,formatRgb:Rr,toString:Rr});function Ar(){return this.rgb().formatHex()}function cu(){return this.rgb().formatHex8()}function du(){return Fr(this).formatHsl()}function Rr(){return this.rgb().formatRgb()}function vt(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=ou.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?Br(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=ru.exec(e))?new Pe(t[1],t[2],t[3],1):(t=iu.exec(e))?new Pe(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=lu.exec(e))?vn(t[1],t[2],t[3],t[4]):(t=au.exec(e))?vn(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=su.exec(e))?Hr(t[1],t[2]/100,t[3]/100,1):(t=uu.exec(e))?Hr(t[1],t[2]/100,t[3]/100,t[4]):zr.hasOwnProperty(e)?Br(zr[e]):e==="transparent"?new Pe(NaN,NaN,NaN,0):null}function Br(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 fu(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?fu(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,Pr(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:Vr,formatHex:Vr,formatHex8:hu,formatRgb:Lr,toString:Lr}));function Vr(){return`#${_t(this.r)}${_t(this.g)}${_t(this.b)}`}function hu(){return`#${_t(this.r)}${_t(this.g)}${_t(this.b)}${_t((isNaN(this.opacity)?1:this.opacity)*255)}`}function Lr(){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 Hr(e,t,n,o){return o<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Le(e,t,n,o)}function Fr(e){if(e instanceof Le)return new Le(e.h,e.s,e.l,e.opacity);if(e instanceof Ht||(e=vt(e)),!e)return new Le;if(e instanceof Le)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 Le(l,a,u,e.opacity)}function gu(e,t,n,o){return arguments.length===1?Fr(e):new Le(e,t,n,o??1)}function Le(e,t,n,o){this.h=+e,this.s=+t,this.l=+n,this.opacity=+o}so(Le,gu,Pr(Ht,{brighter(e){return e=e==null?pn:Math.pow(pn,e),new Le(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Ft:Math.pow(Ft,e),new Le(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 Le(Yr(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("}${Yr(this.h)}, ${_n(this.s)*100}%, ${_n(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Yr(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 pu(e,t){return function(n){return e+n*t}}function vu(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 mu(e){return(e=+e)==1?Gr:function(t,n){return n-t?vu(t,n,e):fo(isNaN(t)?n:t)}}function Gr(e,t){var n=t-e;return n?pu(e,n):fo(isNaN(e)?t:e)}const yn=(function e(t){var n=mu(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=Gr(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 _u(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 yu(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function wu(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 bu(e,t){var n=new Date;return e=+e,t=+t,function(o){return n.setTime(e*(1-o)+t*o),n}}function je(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function xu(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 Eu(e){return function(){return e}}function Nu(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:je(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]?Nu(u[0].x):Eu(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"?je:n==="string"?(o=vt(t))?(t=o,yn):jr:t instanceof vt?yn:t instanceof Date?bu:yu(t)?_u:Array.isArray(t)?wu:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?xu:je)(e,t)}var Xr=180/Math.PI,po={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Ur(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)*Xr,skewX:Math.atan(u)*Xr,scaleX:l,scaleY:a}}var wn;function Su(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?po:Ur(t.a,t.b,t.c,t.d,t.e,t.f)}function ku(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,Ur(e.a,e.b,e.c,e.d,e.e,e.f))}function Wr(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 b=h.push("translate(",null,t,null,n);m.push({i:b-4,x:je(s,d)},{i:b-2,x:je(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:je(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:je(s,c)}):c&&d.push(r(d)+"skewX("+c+o)}function u(s,c,d,f,h,m){if(s!==d||c!==f){var b=h.push(r(h)+"scale(",null,",",null,")");m.push({i:b-4,x:je(s,d)},{i:b-2,x:je(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,b=f.length,w;++m<b;)d[(w=f[m]).i]=w.x(h);return d.join("")}}}var Cu=Wr(Su,"px, ","px)","deg)"),$u=Wr(ku,", ",")",")"),Iu=1e-12;function Zr(e){return((e=Math.exp(e))+1/e)/2}function Mu(e){return((e=Math.exp(e))-1/e)/2}function Ou(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,b=h*h+m*m,w,C;if(b<Iu)C=Math.log(f/s)/t,w=function(L){return[a+L*h,u+L*m,s*Math.exp(t*L*C)]};else{var N=Math.sqrt(b),g=(f*f-s*s+o*b)/(2*s*n*N),E=(f*f-s*s-o*b)/(2*f*n*N),T=Math.log(Math.sqrt(g*g+1)-g),B=Math.log(Math.sqrt(E*E+1)-E);C=(B-T)/t,w=function(L){var P=L*C,j=Zr(T),G=s/(n*N)*(j*Ou(t*P+T)-Mu(T));return[a+G*h,u+G*m,s*j/Zr(t*P+T)]}}return w.duration=C*1e3*t/Math.SQRT2,w}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,jt=0,Xt=0,Kr=1e3,xn,Ut,En=0,yt=0,Nn=0,Wt=typeof performance=="object"&&performance.now?performance:Date,qr=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function vo(){return yt||(qr(Du),yt=Wt.now()+Nn)}function Du(){yt=0}function Sn(){this._call=this._time=this._next=null}Sn.prototype=Jr.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 Jr(e,t,n){var o=new Sn;return o.restart(e,t,n),o}function Tu(){vo(),++It;for(var e=xn,t;e;)(t=yt-e._time)>=0&&e._call.call(void 0,t),e=e._next;--It}function Qr(){yt=(En=Wt.now())+Nn,It=jt=0;try{Tu()}finally{It=0,zu(),yt=0}}function Pu(){var e=Wt.now(),t=e-En;t>Kr&&(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){jt&&(jt=clearTimeout(jt));var t=e-yt;t>24?(e<1/0&&(jt=setTimeout(Qr,e-Wt.now()-Nn)),Xt&&(Xt=clearInterval(Xt))):(Xt||(En=Wt.now(),Xt=setInterval(Pu,Kr)),It=1,qr(Qr))}}function ei(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 Au=cn("start","end","cancel","interrupt"),Ru=[],ti=0,ni=1,_o=2,kn=3,oi=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;Bu(e,n,{name:t,index:o,group:r,on:Au,tween:Ru,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:ti})}function wo(e,t){var n=He(e,t);if(n.state>ti)throw new Error("too late; already scheduled");return n}function Xe(e,t){var n=He(e,t);if(n.state>kn)throw new Error("too late; already running");return n}function He(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function Bu(e,t,n){var o=e.__transition,r;o[t]=n,n.timer=Jr(i,0,n.time);function i(s){n.state=ni,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!==ni)return u();for(c in o)if(h=o[c],h.name===n.name){if(h.state===kn)return ei(l);h.state===oi?(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(ei(function(){n.state===kn&&(n.state=oi,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 Vu(e){return this.each(function(){In(this,e)})}function Lu(e,t){var n,o;return function(){var r=Xe(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 Hu(e,t,n){var o,r;if(typeof n!="function")throw new Error;return function(){var i=Xe(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 Fu(e,t){var n=this._id;if(e+="",arguments.length<2){for(var o=He(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?Lu:Hu)(n,e,t))}function bo(e,t,n){var o=e._id;return e.each(function(){var r=Xe(this,o);(r.value||(r.value={}))[t]=n.apply(this,arguments)}),function(r){return He(r,o).value[t]}}function ri(e,t){var n;return(typeof t=="number"?je:t instanceof vt?yn:(n=vt(t))?(t=n,yn):jr)(e,t)}function Yu(e){return function(){this.removeAttribute(e)}}function Gu(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 Xu(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 Uu(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 Wu(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 Zu(e,t){var n=fn(e),o=n==="transform"?$u:ri;return this.attrTween(e,typeof t=="function"?(n.local?Wu:Uu)(n,o,bo(this,"attr."+e,t)):t==null?(n.local?Gu:Yu)(n):(n.local?Xu:ju)(n,o,t))}function Ku(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function qu(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function Ju(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 Qu(e,t){var n,o;function r(){var i=t.apply(this,arguments);return i!==o&&(n=(o=i)&&Ku(e,i)),n}return r._value=t,r}function ec(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?Ju:Qu)(o,t))}function tc(e,t){return function(){wo(this,e).delay=+t.apply(this,arguments)}}function nc(e,t){return t=+t,function(){wo(this,e).delay=t}}function oc(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?tc:nc)(t,e)):He(this.node(),t).delay}function rc(e,t){return function(){Xe(this,e).duration=+t.apply(this,arguments)}}function ic(e,t){return t=+t,function(){Xe(this,e).duration=t}}function lc(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?rc:ic)(t,e)):He(this.node(),t).duration}function ac(e,t){if(typeof t!="function")throw new Error;return function(){Xe(this,e).ease=t}}function sc(e){var t=this._id;return arguments.length?this.each(ac(t,e)):He(this.node(),t).ease}function uc(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;Xe(this,e).ease=n}}function cc(e){if(typeof e!="function")throw new Error;return this.each(uc(this._id,e))}function dc(e){typeof e!="function"&&(e=xr(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 fc(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 hc(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 gc(e,t,n){var o,r,i=hc(t)?wo:Xe;return function(){var l=i(this,e),a=l.on;a!==o&&(r=(o=a).copy()).on(t,n),l.on=r}}function pc(e,t){var n=this._id;return arguments.length<2?He(this.node(),n).on.on(e):this.each(gc(n,e,t))}function vc(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function mc(){return this.on("end.remove",vc(this._id))}function _c(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,He(c,n)));return new Qe(i,this._parents,t,n)}function yc(e){var t=this._name,n=this._id;typeof e!="function"&&(e=br(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=He(c,n),b=0,w=f.length;b<w;++b)(h=f[b])&&$n(h,t,n,b,f,m);i.push(f),l.push(c)}return new Qe(i,l,t,n)}var wc=Vt.prototype.constructor;function bc(){return new wc(this._groups,this._parents)}function xc(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 ii(e){return function(){this.style.removeProperty(e)}}function Ec(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 Nc(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 Sc(e,t){var n,o,r,i="style."+t,l="end."+i,a;return function(){var u=Xe(this,e),s=u.on,c=u.value[i]==null?a||(a=ii(t)):void 0;(s!==n||r!==c)&&(o=(n=s).copy()).on(l,r=c),u.on=o}}function kc(e,t,n){var o=(e+="")=="transform"?Cu:ri;return t==null?this.styleTween(e,xc(e,o)).on("end.style."+e,ii(e)):typeof t=="function"?this.styleTween(e,Nc(e,o,bo(this,"style."+e,t))).each(Sc(this._id,e)):this.styleTween(e,Ec(e,o,t),n).on("end.style."+e,null)}function Cc(e,t,n){return function(o){this.style.setProperty(e,t.call(this,o),n)}}function $c(e,t,n){var o,r;function i(){var l=t.apply(this,arguments);return l!==r&&(o=(r=l)&&Cc(e,l,n)),o}return i._value=t,i}function Ic(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,$c(e,t,n??""))}function Mc(e){return function(){this.textContent=e}}function Oc(e){return function(){var t=e(this);this.textContent=t??""}}function Dc(e){return this.tween("text",typeof e=="function"?Oc(bo(this,"text",e)):Mc(e==null?"":e+""))}function Tc(e){return function(t){this.textContent=e.call(this,t)}}function Pc(e){var t,n;function o(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&Tc(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,Pc(e))}function Ac(){for(var e=this._name,t=this._id,n=li(),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=He(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 Rc(){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=Xe(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 Bc=0;function Qe(e,t,n,o){this._groups=e,this._parents=t,this._name=n,this._id=o}function li(){return++Bc}var et=Vt.prototype;Qe.prototype={constructor:Qe,select:_c,selectAll:yc,selectChild:et.selectChild,selectChildren:et.selectChildren,filter:dc,merge:fc,selection:bc,transition:Ac,call:et.call,nodes:et.nodes,node:et.node,size:et.size,empty:et.empty,each:et.each,on:pc,attr:Zu,attrTween:ec,style:kc,styleTween:Ic,text:Dc,textTween:zc,remove:mc,tween:Fu,delay:oc,duration:lc,ease:sc,easeVarying:cc,end:Rc,[Symbol.iterator]:et[Symbol.iterator]};function Vc(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var Lc={time:null,delay:0,duration:250,ease:Vc};function Hc(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 Fc(e){var t,n;e instanceof Qe?(t=e._id,e=e._name):(t=li(),(n=Lc).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||Hc(u,t));return new Qe(o,this._parents,e,t)}Vt.prototype.interrupt=Vu,Vt.prototype.transition=Fc;const Mn=e=>()=>e;function Yc(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 Gc(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 ai(){return this.__zoom||Mt}function Xc(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function Uc(){return navigator.maxTouchPoints||"ontouchstart"in this}function Wc(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 Zc(){var e=Gc,t=jc,n=Wc,o=Xc,r=Uc,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,b=0,w=10;function C(y){y.property("__zoom",ai).on("wheel.zoom",P,{passive:!1}).on("mousedown.zoom",j).on("dblclick.zoom",G).filter(r).on("touchstart.zoom",A).on("touchmove.zoom",S).on("touchend.zoom touchcancel.zoom",F).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}C.transform=function(y,p,_,M){var z=y.selection?y.selection():y;z.property("__zoom",ai),y!==z?T(y,p,_,M):z.interrupt().each(function(){B(this,arguments).event(M).start().zoom(null,typeof p=="function"?p.apply(this,arguments):p).end()})},C.scaleBy=function(y,p,_,M){C.scaleTo(y,function(){var z=this.__zoom.k,R=typeof p=="function"?p.apply(this,arguments):p;return z*R},_,M)},C.scaleTo=function(y,p,_,M){C.transform(y,function(){var z=t.apply(this,arguments),R=this.__zoom,V=_==null?E(z):typeof _=="function"?_.apply(this,arguments):_,H=R.invert(V),U=typeof p=="function"?p.apply(this,arguments):p;return n(g(N(R,U),V,H),z,l)},_,M)},C.translateBy=function(y,p,_,M){C.transform(y,function(){return n(this.__zoom.translate(typeof p=="function"?p.apply(this,arguments):p,typeof _=="function"?_.apply(this,arguments):_),t.apply(this,arguments),l)},null,M)},C.translateTo=function(y,p,_,M,z){C.transform(y,function(){var R=t.apply(this,arguments),V=this.__zoom,H=M==null?E(R):typeof M=="function"?M.apply(this,arguments):M;return n(Mt.translate(H[0],H[1]).scale(V.k).translate(typeof p=="function"?-p.apply(this,arguments):-p,typeof _=="function"?-_.apply(this,arguments):-_),R,l)},M,z)};function N(y,p){return p=Math.max(i[0],Math.min(i[1],p)),p===y.k?y:new tt(p,y.x,y.y)}function g(y,p,_){var M=p[0]-_[0]*y.k,z=p[1]-_[1]*y.k;return M===y.x&&z===y.y?y:new tt(y.k,M,z)}function E(y){return[(+y[0][0]+ +y[1][0])/2,(+y[0][1]+ +y[1][1])/2]}function T(y,p,_,M){y.on("start.zoom",function(){B(this,arguments).event(M).start()}).on("interrupt.zoom end.zoom",function(){B(this,arguments).event(M).end()}).tween("zoom",function(){var z=this,R=arguments,V=B(z,R).event(M),H=t.apply(z,R),U=_==null?E(H):typeof _=="function"?_.apply(z,R):_,ne=Math.max(H[1][0]-H[0][0],H[1][1]-H[0][1]),fe=z.__zoom,O=typeof p=="function"?p.apply(z,R):p,D=u(fe.invert(U).concat(ne/fe.k),O.invert(U).concat(ne/O.k));return function(X){if(X===1)X=O;else{var Y=D(X),oe=ne/Y[2];X=new tt(oe,U[0]-Y[0]*oe,U[1]-Y[1]*oe)}V.zoom(null,X)}})}function B(y,p,_){return!_&&y.__zooming||new L(y,p)}function L(y,p){this.that=y,this.args=p,this.active=0,this.sourceEvent=null,this.extent=t.apply(y,p),this.taps=0}L.prototype={event:function(y){return y&&(this.sourceEvent=y),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(y,p){return this.mouse&&y!=="mouse"&&(this.mouse[1]=p.invert(this.mouse[0])),this.touch0&&y!=="touch"&&(this.touch0[1]=p.invert(this.touch0[0])),this.touch1&&y!=="touch"&&(this.touch1[1]=p.invert(this.touch1[0])),this.that.__zoom=p,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(y){var p=Ve(this.that).datum();s.call(y,this.that,new Yc(y,{sourceEvent:this.sourceEvent,target:C,transform:this.that.__zoom,dispatch:s}),p)}};function P(y,...p){if(!e.apply(this,arguments))return;var _=B(this,p).event(y),M=this.__zoom,z=Math.max(i[0],Math.min(i[1],M.k*Math.pow(2,o.apply(this,arguments)))),R=Ye(y);if(_.wheel)(_.mouse[0][0]!==R[0]||_.mouse[0][1]!==R[1])&&(_.mouse[1]=M.invert(_.mouse[0]=R)),clearTimeout(_.wheel);else{if(M.k===z)return;_.mouse=[R,M.invert(R)],In(this),_.start()}Zt(y),_.wheel=setTimeout(V,m),_.zoom("mouse",n(g(N(M,z),_.mouse[0],_.mouse[1]),_.extent,l));function V(){_.wheel=null,_.end()}}function j(y,...p){if(f||!e.apply(this,arguments))return;var _=y.currentTarget,M=B(this,p,!0).event(y),z=Ve(y.view).on("mousemove.zoom",U,!0).on("mouseup.zoom",ne,!0),R=Ye(y,_),V=y.clientX,H=y.clientY;Dr(y.view),xo(y),M.mouse=[R,this.__zoom.invert(R)],In(this),M.start();function U(fe){if(Zt(fe),!M.moved){var O=fe.clientX-V,D=fe.clientY-H;M.moved=O*O+D*D>b}M.event(fe).zoom("mouse",n(g(M.that.__zoom,M.mouse[0]=Ye(fe,_),M.mouse[1]),M.extent,l))}function ne(fe){z.on("mousemove.zoom mouseup.zoom",null),Tr(fe.view,M.moved),Zt(fe),M.event(fe).end()}}function G(y,...p){if(e.apply(this,arguments)){var _=this.__zoom,M=Ye(y.changedTouches?y.changedTouches[0]:y,this),z=_.invert(M),R=_.k*(y.shiftKey?.5:2),V=n(g(N(_,R),M,z),t.apply(this,p),l);Zt(y),a>0?Ve(this).transition().duration(a).call(T,V,M,y):Ve(this).call(C.transform,V,M,y)}}function A(y,...p){if(e.apply(this,arguments)){var _=y.touches,M=_.length,z=B(this,p,y.changedTouches.length===M).event(y),R,V,H,U;for(xo(y),V=0;V<M;++V)H=_[V],U=Ye(H,this),U=[U,this.__zoom.invert(U),H.identifier],z.touch0?!z.touch1&&z.touch0[2]!==U[2]&&(z.touch1=U,z.taps=0):(z.touch0=U,R=!0,z.taps=1+!!c);c&&(c=clearTimeout(c)),R&&(z.taps<2&&(d=U[0],c=setTimeout(function(){c=null},h)),In(this),z.start())}}function S(y,...p){if(this.__zooming){var _=B(this,p).event(y),M=y.changedTouches,z=M.length,R,V,H,U;for(Zt(y),R=0;R<z;++R)V=M[R],H=Ye(V,this),_.touch0&&_.touch0[2]===V.identifier?_.touch0[0]=H:_.touch1&&_.touch1[2]===V.identifier&&(_.touch1[0]=H);if(V=_.that.__zoom,_.touch1){var ne=_.touch0[0],fe=_.touch0[1],O=_.touch1[0],D=_.touch1[1],X=(X=O[0]-ne[0])*X+(X=O[1]-ne[1])*X,Y=(Y=D[0]-fe[0])*Y+(Y=D[1]-fe[1])*Y;V=N(V,Math.sqrt(X/Y)),H=[(ne[0]+O[0])/2,(ne[1]+O[1])/2],U=[(fe[0]+D[0])/2,(fe[1]+D[1])/2]}else if(_.touch0)H=_.touch0[0],U=_.touch0[1];else return;_.zoom("touch",n(g(V,H,U),_.extent,l))}}function F(y,...p){if(this.__zooming){var _=B(this,p).event(y),M=y.changedTouches,z=M.length,R,V;for(xo(y),f&&clearTimeout(f),f=setTimeout(function(){f=null},h),R=0;R<z;++R)V=M[R],_.touch0&&_.touch0[2]===V.identifier?delete _.touch0:_.touch1&&_.touch1[2]===V.identifier&&delete _.touch1;if(_.touch1&&!_.touch0&&(_.touch0=_.touch1,delete _.touch1),_.touch0)_.touch0[1]=this.__zoom.invert(_.touch0[0]);else if(_.end(),_.taps===2&&(V=Ye(V,this),Math.hypot(d[0]-V[0],d[1]-V[1])<w)){var H=Ve(this).on("dblclick.zoom");H&&H.apply(this,arguments)}}}return C.wheelDelta=function(y){return arguments.length?(o=typeof y=="function"?y:Mn(+y),C):o},C.filter=function(y){return arguments.length?(e=typeof y=="function"?y:Mn(!!y),C):e},C.touchable=function(y){return arguments.length?(r=typeof y=="function"?y:Mn(!!y),C):r},C.extent=function(y){return arguments.length?(t=typeof y=="function"?y:Mn([[+y[0][0],+y[0][1]],[+y[1][0],+y[1][1]]]),C):t},C.scaleExtent=function(y){return arguments.length?(i[0]=+y[0],i[1]=+y[1],C):[i[0],i[1]]},C.translateExtent=function(y){return arguments.length?(l[0][0]=+y[0][0],l[1][0]=+y[1][0],l[0][1]=+y[0][1],l[1][1]=+y[1][1],C):[[l[0][0],l[0][1]],[l[1][0],l[1][1]]]},C.constrain=function(y){return arguments.length?(n=y,C):n},C.duration=function(y){return arguments.length?(a=+y,C):a},C.interpolate=function(y){return arguments.length?(u=y,C):u},C.on=function(){var y=s.on.apply(s,arguments);return y===s?C:y},C.clickDistance=function(y){return arguments.length?(b=(y=+y)*y,C):Math.sqrt(b)},C.tapDistance=function(y){return arguments.length?(w=+y,C):w},C}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||{}),si=(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))(si||{});const Kc=["INPUT","SELECT","TEXTAREA"],qc=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 Kc.includes(o?.nodeName)||r||!!i}function Jc(e){return e.ctrlKey||e.metaKey||e.shiftKey||e.altKey}function ui(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 Qc(e,t){return n=>{if(!n.code&&!n.key)return!1;const o=ed(n.code,e);return Array.isArray(e)?e.some(r=>ui(n[o],r,t,n.type==="keyup")):ui(n[o],e,t,n.type==="keyup")}}function ed(e,t){return t.includes(e)?"code":"key"}function qt(e,t){const n=he(()=>pe(t?.target)??qc),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}),vr(["blur","contextmenu"],a),mr((...s)=>l(...s),s=>{var c,d;const f=pe(t?.actInsideInputWithModifier)??!0,h=pe(t?.preventDefault)??!1;if(r=Jc(s),(!r||r&&!f)&&So(s))return;const b=((d=(c=s.composedPath)==null?void 0:c.call(s))==null?void 0:d[0])||s.target,w=b?.nodeName==="BUTTON"||b?.nodeName==="A";!h&&(r||!w)&&s.preventDefault(),o.value=!0},{eventName:"keydown",target:n}),mr((...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"?Qc(s,i):s}return o}const ci="vue-flow__node-desc",di="vue-flow__edge-desc",td="vue-flow__aria-live",fi=["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 hi(e,t){return{x:bt(e.x,t[0][0],t[1][0]),y:bt(e.y,t[0][1],t[1][1])}}function gi(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 nd(e){return Pn(e.width)&&Pn(e.height)&&Pn(e.x)&&Pn(e.y)}function od(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 pi(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 vi(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 rd(...e){if(e.length===3){const[i,l,a]=e;return vi(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 id(...e){if(e.length===3){const[i,l,a]=e;return vi(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 mi({source:e,sourceHandle:t,target:n,targetHandle:o}){return`vueflow__edge-${e}${t??""}-${n}${o??""}`}function ld(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?An(a,l):a}function ad(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 _i({x:e,y:t,width:n,height:o}){return{x:e,y:t,x2:e+n,y2:t+o}}function sd({x:e,y:t,x2:n,y2:o}){return{x:e,y:t,width:n-e,height:o-t}}function yi(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=ad(t,_i({...o.computedPosition,...o.dimensions}))}return sd(t)}function wi(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,b=o&&h>0,w=(d??0)*(f??0);(m||b||h>=w||a.dragging)&&l.push(a)}return l}function bi(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 ud(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 cd(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 xi(e,t,n,o,r,i=.1){const l=ud(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,b=cd(e,h,m,c,t,n),w={left:Math.min(b.left-l.left,0),top:Math.min(b.top-l.top,0),right:Math.min(b.right-l.right,0),bottom:Math.min(b.bottom-l.bottom,0)};return{x:h-w.left+w.right,y:m-w.top+w.bottom,zoom:c}}function dd(e,t){return{x:t.x+e.x,y:t.y+e.y,z:(e.z>t.z?e.z:t.z)+1}}function Ei(e,t){if(!e.parentNode)return!1;const n=t.get(e.parentNode);return n?n.selected?!0:Ei(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 Ni(e){const t=e.ctrlKey&&zn()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t}function Si(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 ki(e,t,n=15,o=40){const r=Si(e.x,o,t.width-o)*n,i=Si(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 Ci(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):ze(()=>{ko(l,u)}))}break}return t}function at(e,t){return{id:e,type:"select",selected:t}}function $i(e){return{item:e,type:"add"}}function Ii(e){return{id:e,type:"remove"}}function Mi(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 Oi=()=>{};function W(e){const t=new Set;let n=Oi,o=()=>!1;const r=()=>t.size>0||o(),i=f=>{n=f},l=()=>{n=Oi},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 Di(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 fd(e,t,n,o){var r,i;const l=new Map;for(const[a,u]of e)(u.selected||u.id===o)&&(!u.parentNode||!Ei(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 Ti(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 hd(e,t,n){const[o,r,i,l]=typeof e!="string"?Ti(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 gd(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=hd(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]=Ti(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 pd({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=pd(e.dimensions,gd(e,n,o,r)),l=hi(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??yd(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 Pi(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function vd({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=_i({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 md(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 _d(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 zn=()=>{var e;return typeof navigator<"u"&&((e=navigator?.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function yd(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 An(e,t=[1,1]){return{x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}}const wd=()=>!0;function Mo(e){e?.classList.remove("valid","connecting","vue-flow__handle-valid","vue-flow__handle-connecting")}function bd(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 xd=250;function Ed(e,t,n,o){var r,i;let l=[],a=Number.POSITIVE_INFINITY;const u=bd(e,n,t+xd);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 Ai(e,{handle:t,connectionMode:n,fromNodeId:o,fromHandleId:r,fromType:i,doc:l,lib:a,flowId:u,isValidConnection:s=wd},c,d,f,h){const m=i==="target",b=t?l.querySelector(`.${a}-flow__handle[data-id="${u}-${t?.nodeId}-${t?.id}-${t?.type}"]`):null,{x:w,y:C}=Ue(e),N=l.elementFromPoint(w,C),g=N?.classList.contains(`${a}-flow__handle`)?N:b,E={handleDomNode:g,isValid:!1,connection:null,toHandle:null};if(g){const T=Ri(void 0,g),B=g.getAttribute("data-nodeid"),L=g.getAttribute("data-handleid"),P=g.classList.contains("connectable"),j=g.classList.contains("connectableend");if(!B||!T)return E;const G={source:m?B:o,sourceHandle:m?L:r,target:m?o:B,targetHandle:m?r:L};E.connection=G;const S=P&&j&&(n===it.Strict?m&&T==="source"||!m&&T==="target":B!==o||L!==r);E.isValid=S&&s(G,{nodes:d,edges:c,sourceNode:f(G.source),targetNode:f(G.target)}),E.toHandle=Bi(B,T,L,h,n,!0)}return E}function Ri(e,t){return e||(t?.classList.contains("target")?"target":t?.classList.contains("source")?"source":null)}function Nd(e,t){let n=null;return t?n="valid":e&&!t&&(n="invalid"),n}function Sd(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}function Bi(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},kd=["production","prod"];function nn(e,...t){Vi()&&console.warn(`[Vue Flow]: ${e}`,...t)}function Vi(){return!kd.includes("production")}function Li(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]),ze(()=>{l.blur()})):n([e])}function $e(e){return typeof q(e)<"u"}function Cd(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:mi(e)},r=pi(r,void 0,o),ld(r,t)?!1:r}function $d(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?mi(t):i,source:t.source,target:t.target,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle}}function Hi(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=od(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 Fi(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}`;Fi("source",u,c,e,r,l),Fi("target",u,s,e,i,a)}}function Yi(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:Cd(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({...pi(c,h,i),sourceNode:d,targetNode:f})}return u}const Gi=Symbol("vueFlow"),ji=Symbol("nodeId"),Xi=Symbol("nodeRef"),Id=Symbol("edgeId"),Md=Symbol("edgeRef"),Rn=Symbol("slots");function Ui(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:b,selectNodesOnDrag:w,removeSelectedElements:C,addSelectedNodes:N,updateNodePositions:g,emits:E}=Ee(),{onStart:T,onDrag:B,onStop:L,onClick:P,el:j,disabled:G,id:A,selectable:S,dragHandle:F}=e,y=qe(!1);let p=[],_,M=null,z={x:void 0,y:void 0},R={x:0,y:0},V=null,H=!1,U=!1,ne=0,fe=!1;const O=Td(),D=({x:se,y:ae})=>{z={x:se,y:ae};let x=!1;if(p=p.map(v=>{const k={x:se-v.distance.x,y:ae-v.distance.y},{computedPosition:I}=$o(v,n.value?An(k,o.value):k,E.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}),U=U||x,!!x&&(g(p,!0,!0),y.value=!0,V)){const[v,k]=Co({id:A,dragItems:p,findNode:h});B({event:V,node:v,nodes:k})}},X=()=>{if(!M)return;const[se,ae]=ki(R,M,c.value);if(se!==0||ae!==0){const x={x:(z.x??0)-se/u.value.zoom,y:(z.y??0)-ae/u.value.zoom};f({x:se,y:ae})&&D(x)}ne=requestAnimationFrame(X)},Y=(se,ae)=>{H=!0;const x=h(A);!w.value&&!m.value&&x&&(x.selected||C()),x&&pe(S)&&w.value&&Do(x,m.value,N,C,b,!1,ae);const v=O(se.sourceEvent);if(z=v,p=fd(i.value,d.value,v,A),p.length){const[k,I]=Co({id:A,dragItems:p,findNode:h});T({event:se.sourceEvent,node:k,nodes:I})}},oe=(se,ae)=>{var x;se.sourceEvent.type==="touchmove"&&se.sourceEvent.touches.length>1||(U=!1,a.value===0&&Y(se,ae),z=O(se.sourceEvent),M=((x=t.value)==null?void 0:x.getBoundingClientRect())||null,R=Ue(se.sourceEvent,M))},re=(se,ae)=>{const x=O(se.sourceEvent);if(!fe&&H&&s.value&&(fe=!0,X()),!H){const v=x.xSnapped-(z.x??0),k=x.ySnapped-(z.y??0);Math.sqrt(v*v+k*k)>a.value&&Y(se,ae)}(z.x!==x.xSnapped||z.y!==x.ySnapped)&&p.length&&H&&(V=se.sourceEvent,R=Ue(se.sourceEvent,M),D(x))},ge=se=>{let ae=!1;if(!H&&!y.value&&!m.value){const x=se.sourceEvent,v=O(x),k=v.xSnapped-(z.x??0),I=v.ySnapped-(z.y??0),$=Math.sqrt(k*k+I*I);$!==0&&$<=a.value&&(P?.(x),ae=!0)}if(p.length&&!ae){U&&(g(p,!1,!1),U=!1);const[x,v]=Co({id:A,dragItems:p,findNode:h});L({event:se.sourceEvent,node:x,nodes:v})}p=[],y.value=!1,fe=!1,H=!1,z={x:void 0,y:void 0},cancelAnimationFrame(ne)};return _e([()=>pe(G),j],([se,ae],x,v)=>{if(ae){const k=Ve(ae);se||(_=nu().on("start",I=>oe(I,ae)).on("drag",I=>re(I,ae)).on("end",I=>ge(I)).filter(I=>{const $=I.target,Z=pe(F);return!I.button&&(!r.value||!Di($,`.${r.value}`,ae)&&(!Z||Di($,Z,ae)))}),k.call(_)),v(()=>{k.on(".drag",null),_&&(_.on("start",null),_.on("drag",null),_.on("end",null))})}}),y}function Od(){return{doubleClick:W(),click:W(),mouseEnter:W(),mouseMove:W(),mouseLeave:W(),contextMenu:W(),updateStart:W(),update:W(),updateEnd:W()}}function Dd(e,t){const n=Od();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 Td(){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=_d(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?An(c,t.value):c;return{xSnapped:d,ySnapped:f,...c}}}function Bn(){return!0}function Wi({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:b,findNode:w,panBy:C,startConnection:N,updateConnection:g,endConnection:E,emits:T,viewport:B,edges:L,nodes:P,isValidConnection:j,nodeLookup:G}=Ee();let A=null,S=!1,F=null;function y(_){var M;const z=pe(n)==="target",R=Io(_),V=gi(_.target),H=_.currentTarget;if(H&&(R&&_.button===0||!R)){let U=function(ee){x=Ue(ee,ge),D=Ed(en(x,B.value,!1,[1,1]),c.value,G.value,I),v||(k(),v=!0);const ue=Ai(ee,{handle:D,connectionMode:s.value,fromNodeId:pe(t),fromHandleId:pe(e),fromType:z?"target":"source",isValidConnection:O,doc:V,lib:"vue",flowId:a,nodeLookup:G.value},L.value,P.value,w,G.value);F=ue.handleDomNode,A=ue.connection,S=Sd(!!D,ue.isValid);const ve={...ie,isValid:S,to:ue.toHandle&&S?Qt({x:ue.toHandle.x,y:ue.toHandle.y},B.value):x,toHandle:ue.toHandle,toPosition:S&&ue.toHandle?ue.toHandle.position:Oo[I.position],toNode:ue.toHandle?G.value.get(ue.toHandle.nodeId):null};if(S&&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(g(we&&S?Qt({x:we.x,y:we.y},B.value):x,we,Nd(!!we,S)),ie=ve,!D&&!S&&!F)return Mo(ae);A&&A.source!==A.target&&F&&(Mo(ae),ae=F,F.classList.add("connecting","vue-flow__handle-connecting"),F.classList.toggle("valid",!!S),F.classList.toggle("vue-flow__handle-valid",!!S))},ne=function(ee){"touches"in ee&&ee.touches.length>0||((D||F)&&A&&S&&(i?i(ee,A):T.connect(A)),T.connectEnd(ee),r&&l?.(ee),Mo(ae),cancelAnimationFrame(X),E(ee),v=!1,S=!1,A=null,F=null,V.removeEventListener("mousemove",U),V.removeEventListener("mouseup",ne),V.removeEventListener("touchmove",U),V.removeEventListener("touchend",ne))};const fe=w(pe(t));let O=pe(o)||j.value||Bn;!O&&fe&&(O=(z?fe.isValidSourcePos:fe.isValidTargetPos)||Bn);let D,X=0;const{x:Y,y:oe}=Ue(_),re=Ri(pe(r),H),ge=(M=u.value)==null?void 0:M.getBoundingClientRect();if(!ge||!re)return;const se=Bi(pe(t),re,pe(e),G.value,s.value);if(!se)return;let ae,x=Ue(_,ge),v=!1;const k=()=>{if(!m.value)return;const[ee,ue]=ki(x,ge,b.value);C({x:ee,y:ue}),X=requestAnimationFrame(k)},I={...se,nodeId:pe(t),type:re,position:se.position},$=G.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};N({nodeId:pe(t),id:pe(e),type:re,position:H?.getAttribute("data-handlepos")||J.Top,...x},{x:Y-ge.left,y:oe-ge.top}),T.connectStart({event:_,nodeId:pe(t),handleId:pe(e),handleType:re});let ie=K;V.addEventListener("mousemove",U),V.addEventListener("mouseup",ne),V.addEventListener("touchmove",U),V.addEventListener("touchend",ne)}}function p(_){var M,z;if(!d.value)return;const R=pe(n)==="target";if(!f.value){T.clickConnectStart({event:_,nodeId:pe(t),handleId:pe(e)}),N({nodeId:pe(t),type:pe(n),id:pe(e),position:J.Top,...Ue(_)},void 0,!0);return}let V=pe(o)||j.value||Bn;const H=w(pe(t));if(!V&&H&&(V=(R?H.isValidSourcePos:H.isValidTargetPos)||Bn),H&&(typeof H.connectable>"u"?h.value:H.connectable)===!1)return;const U=gi(_.target),ne=Ai(_,{handle:{nodeId:pe(t),id:pe(e),type:pe(n),position:J.Top,...Ue(_)},connectionMode:s.value,fromNodeId:f.value.nodeId,fromHandleId:f.value.id??null,fromType:f.value.type,isValidConnection:V,doc:U,lib:"vue",flowId:a,nodeLookup:G.value},L.value,P.value,w,G.value),fe=((M=ne.connection)==null?void 0:M.source)===((z=ne.connection)==null?void 0:z.target);ne.isValid&&ne.connection&&!fe&&T.connect(ne.connection),T.clickConnectEnd(_),E(_,!0)}return{handlePointerDown:y,handleClick:p}}function Pd(){return ot(ji,"")}function Zi(e){const t=e??Pd()??"",n=ot(Xi,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(()=>bi([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 Ad(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 Ki(){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,b=[];for(const w of e.value)if(w.draggable||l&&typeof w.draggable>"u"){const C={x:w.computedPosition.x+h,y:w.computedPosition.y+m},{position:N}=$o(w,C,a.error,t.value,w.parentNode?o(w.parentNode):void 0);b.push({id:w.id,position:N,from:w.position,distance:{x:u.x,y:u.y},dimensions:w.dimensions})}n(b,!0,!1)}}const Vn=.1,Rd=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 Bd={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 Vd(e){function t(o,r){return new Promise(i=>{e.d3Selection&&e.d3Zoom?e.d3Zoom.interpolate(r?.interpolate==="linear"?Gt:bn).scaleBy(zo(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}=hi({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(zo(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(zo(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=yi(a),{x:s,y:c,zoom:d}=xi(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}=xi(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}}}:Bd)}function zo(e,t=0,n=Rd,o=()=>{}){const r=typeof t=="number"&&t>0;return r||o(),r?e.transition().duration(t).ease(n).on("end",o):e}function Ld(e,t,n){const o=qn(!0);return o.run(()=>{const r=()=>{o.run(()=>{let b,w,C=!!(n.nodes.value.length||n.edges.value.length);b=St([e.modelValue,()=>{var N,g;return(g=(N=e.modelValue)==null?void 0:N.value)==null?void 0:g.length}],([N])=>{N&&Array.isArray(N)&&(w?.pause(),n.setElements(N),!w&&!C&&N.length?C=!0:w?.resume())}),w=St([n.nodes,n.edges,()=>n.edges.value.length,()=>n.nodes.value.length],([N,g])=>{var E;(E=e.modelValue)!=null&&E.value&&Array.isArray(e.modelValue.value)&&(b?.pause(),e.modelValue.value=[...N,...g],ze(()=>{b?.resume()}))},{immediate:C}),At(()=>{b?.stop(),w?.stop()})})},i=()=>{o.run(()=>{let b,w,C=!!n.nodes.value.length;b=St([e.nodes,()=>{var N,g;return(g=(N=e.nodes)==null?void 0:N.value)==null?void 0:g.length}],([N])=>{N&&Array.isArray(N)&&(w?.pause(),n.setNodes(N),!w&&!C&&N.length?C=!0:w?.resume())}),w=St([n.nodes,()=>n.nodes.value.length],([N])=>{var g;(g=e.nodes)!=null&&g.value&&Array.isArray(e.nodes.value)&&(b?.pause(),e.nodes.value=[...N],ze(()=>{b?.resume()}))},{immediate:C}),At(()=>{b?.stop(),w?.stop()})})},l=()=>{o.run(()=>{let b,w,C=!!n.edges.value.length;b=St([e.edges,()=>{var N,g;return(g=(N=e.edges)==null?void 0:N.value)==null?void 0:g.length}],([N])=>{N&&Array.isArray(N)&&(w?.pause(),n.setEdges(N),!w&&!C&&N.length?C=!0:w?.resume())}),w=St([n.edges,()=>n.edges.value.length],([N])=>{var g;(g=e.edges)!=null&&g.value&&Array.isArray(e.edges.value)&&(b?.pause(),e.edges.value=[...N],ze(()=>{b?.resume()}))},{immediate:C}),At(()=>{b?.stop(),w?.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 b=async w=>{let C=w;typeof t.autoConnect=="function"&&(C=await t.autoConnect(w)),C!==!1&&n.addEdges([C])};_e(()=>t.autoConnect,()=>{$e(t.autoConnect)&&(n.autoConnect.value=t.autoConnect)},{immediate:!0}),_e(n.autoConnect,(w,C,N)=>{w?n.onConnect(b):n.hooks.value.connect.off(b),N(()=>{n.hooks.value.connect.off(b)})},{immediate:!0})})},h=()=>{const b=["id","modelValue","translateExtent","nodeExtent","edges","nodes","maxZoom","minZoom","applyDefault","autoConnect"];for(const w of Object.keys(t)){const C=w;if(!b.includes(C)){const N=be(()=>t[C]),g=n[C];un(g)&&o.run(()=>{_e(N,E=>{$e(E)&&(g.value=E)},{immediate:!0})})}}};r(),i(),l(),u(),a(),s(),c(),d(),f(),h()}),()=>o.stop()}function Hd(){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 Fd(e,t){const n=gt();nr(()=>{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=Yd(r);return!!((i=n?.vnode.props)==null?void 0:i[l])}}function Yd(e){const[t,...n]=e.split(":");return`on${t.replace(/(?:^|-)(\w)/g,(r,i)=>i.toUpperCase())}${n.length?`:${n.join(":")}`:""}`}function qi(){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:zn()?"Meta":"Control",zoomActivationKeyCode:zn()?"Meta":"Control",deleteKeyCode:"Backspace",panActivationKeyCode:"Space",hooks:Hd(),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 Gd=["id","vueFlowRef","viewportRef","initialized","modelValue","nodes","edges","maxZoom","minZoom","translateExtent","hooks","defaultEdgeOptions"];function jd(e,t,n){const o=Vd(e),r=x=>{const v=x??[];e.hooks.updateNodeInternals.trigger(v)},i=x=>id(x,e.nodes,e.edges),l=x=>rd(x,e.nodes,e.edges),a=x=>bi(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 ee=s(K.parentNode);ie.position={x:ie.position.x-(((I=ee?.computedPosition)==null?void 0:I.x)??0),y:ie.position.y-((($=ee?.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 ee=Tn(K.nodeElement);if(!!(ee.width&&ee.height&&(ie.dimensions.width!==ee.width||ie.dimensions.height!==ee.height||K.forceUpdate))){const ve=K.nodeElement.getBoundingClientRect();ie.dimensions=ee,ie.handleBounds.source=Li("source",K.nodeElement,ve,I,ie.id),ie.handleBounds.target=Li("target",K.nodeElement,ve,I,ie.id),$.push({id:ie.id,type:"dimensions",dimensions:ee})}}}!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))},b=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))},w=x=>{h(x,!0)},C=x=>{const k=(x||e.nodes).map(I=>(I.selected=!1,at(I.id,!1)));e.hooks.nodesChange.trigger(k)},N=x=>{const k=(x||e.edges).map(I=>(I.selected=!1,at(I.id,!1)));e.hooks.edgesChange.trigger(k)},g=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)},E=x=>{var v;(v=e.d3Zoom)==null||v.scaleExtent([x,e.maxZoom]),e.minZoom=x},T=x=>{var v;(v=e.d3Zoom)==null||v.scaleExtent([e.minZoom,x]),e.maxZoom=x},B=x=>{var v;(v=e.d3Zoom)==null||v.translateExtent(x),e.translateExtent=x},L=x=>{e.nodeExtent=x,r()},P=x=>{var v;(v=e.d3Zoom)==null||v.clickDistance(x)},j=x=>{e.nodesDraggable=x,e.nodesConnectable=x,e.elementsSelectable=x},G=x=>{const v=x instanceof Function?x(e.nodes):x;!e.initialized&&!v.length||(e.nodes=Hi(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},S=x=>{const v=x instanceof Function?x([...e.nodes,...e.edges]):x;!e.initialized&&!v.length||(G(v.filter(xt)),A(v.filter(lt)))},F=x=>{let v=x instanceof Function?x(e.nodes):x;v=Array.isArray(v)?v:[v];const k=Hi(v,s,e.hooks.error.trigger),I=[];for(const $ of k)I.push($i($));I.length&&e.hooks.nodesChange.trigger(I)},y=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($i($));I.length&&e.hooks.edgesChange.trigger(I)},p=(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(Mi(we.id,we.source,we.target,we.sourceHandle,we.targetHandle))}function ee(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(Ii(we.id));v&&ie(ve);for(const we of ve)ee(we.id)}}for(const ue of $){const ve=typeof ue=="string"?s(ue):ue;ve&&($e(ve.deletable)&&!ve.deletable||(Z.push(Ii(ve.id)),v&&ie([ve]),k&&ee(ve.id)))}K.length&&e.hooks.edgesChange.trigger(K),Z.length&&e.hooks.nodesChange.trigger(Z)},_=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(Mi(typeof $=="string"?$:$.id,Z.source,Z.target,Z.sourceHandle,Z.targetHandle)))}e.hooks.edgesChange.trigger(I)},M=(x,v,k=!0)=>{const I=c(x.id);if(!I)return!1;const $=e.edges.indexOf(I),Z=$d(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,ee)=>ee===$?K:ie),To(e.connectionLookup,n.value,[K]),K}return!1},z=(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=>Ci(x,e.nodes),V=x=>{const v=Ci(x,e.edges);return To(e.connectionLookup,n.value,v),v},H=(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,$)},U=(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,...$}},ne=(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)},O=(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=nd(x),k=v?null:Jt(x)?x:s(x.id);return!v&&!k?[null,null,v]:[v?x:On(k),k,v]},X=(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 ee=On(ie),ue=Dn(ee,I);(v&&ue>0||ue>=ee.width*ee.height||ue>=Number(I.width)*Number(I.height))&&K.push(ie)}return K},Y=(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]],ee=I.constrain()(K,ie,Z),ue=e.viewport.x!==ee.x||e.viewport.y!==ee.y||e.viewport.zoom!==ee.k;return I.transform($,ee),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),S(I));const $=()=>{$e(v.maxZoom)&&T(v.maxZoom),$e(v.minZoom)&&E(v.minZoom),$e(v.translateExtent)&&B(v.translateExtent)};for(const Z of Object.keys(v)){const K=Z,ie=v[K];![...Gd,...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:S,setNodes:G,setEdges:A,addNodes:F,addEdges:y,removeNodes:p,removeEdges:_,findNode:s,findEdge:c,updateEdge:M,updateEdgeData:z,updateNode:H,updateNodeData:U,applyEdgeChanges:V,applyNodeChanges:R,addSelectedElements:w,addSelectedNodes:m,addSelectedEdges:b,setMinZoom:E,setMaxZoom:T,setTranslateExtent:B,setNodeExtent:L,setPaneClickDistance:P,removeSelectedElements:g,removeSelectedNodes:C,removeSelectedEdges:N,startConnection:ne,updateConnection:fe,endConnection:O,setInteractive:j,setState:re,getIntersectingNodes:X,getIncomers:i,getOutgoers:l,getConnectedEdges:a,getHandleConnections:u,isNodeIntersecting:Y,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:ee,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&&G(k),I&&A(I);const[ie,ee]=K?.x&&K?.y?[K.x,K.y]:$??[null,null];if(ie&&ee){const ue=K?.zoom||Z||e.viewport.zoom;return to(()=>o.value.viewportInitialized).toBe(!0).then(()=>{o.value.setViewport({x:ie,y:ee,zoom:ue}).then(()=>{v(!0)})})}else v(!0)}),updateNodeInternals:r,viewportHelper:o,$reset:()=>{const x=qi();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 Xd=["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=er(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:b,connectedEdges:w}=Zi(),C=xe(),N=be(()=>typeof e.connectableStart<"u"?e.connectableStart:!0),g=be(()=>typeof e.connectableEnd<"u"?e.connectableEnd:!0),E=be(()=>{var A,S,F,y,p,_;return((A=l.value)==null?void 0:A.nodeId)===h&&((S=l.value)==null?void 0:S.id)===e.id&&((F=l.value)==null?void 0:F.type)===o.value||((y=u.value)==null?void 0:y.nodeId)===h&&((p=u.value)==null?void 0:p.id)===e.id&&((_=u.value)==null?void 0:_.type)===o.value}),T=be(()=>{var A,S,F;return((A=a.value)==null?void 0:A.nodeId)===h&&((S=a.value)==null?void 0:S.id)===e.id&&((F=a.value)==null?void 0:F.type)===o.value}),{handlePointerDown:B,handleClick:L}=Wi({nodeId:h,handleId:e.id,isValidConnection:r,type:o}),P=he(()=>typeof e.connectable=="string"&&e.connectable==="single"?!w.value.some(A=>{const S=A[`${o.value}Handle`];return A[o.value]!==h?!1:S?S===e.id:!0}):typeof e.connectable=="number"?w.value.filter(A=>{const S=A[`${o.value}Handle`];return A[o.value]!==h?!1:S?S===e.id:!0}).length<e.connectable:typeof e.connectable=="function"?e.connectable(m,w.value):$e(e.connectable)?e.connectable:c.value);Ke(()=>{var A;if(!m.dimensions.width||!m.dimensions.height)return;const S=(A=m.handleBounds[o.value])==null?void 0:A.find(R=>R.id===e.id);if(!s.value||S)return;const F=s.value.querySelector(".vue-flow__transformationpane");if(!b.value||!C.value||!F||!e.id)return;const y=b.value.getBoundingClientRect(),p=C.value.getBoundingClientRect(),_=window.getComputedStyle(F),{m22:M}=new window.DOMMatrixReadOnly(_.transform),z={id:e.id,position:e.position,x:(p.left-y.left)/M,y:(p.top-y.top)/M,type:o.value,nodeId:h,...Tn(C.value)};m.handleBounds[o.value]=[...m.handleBounds[o.value]??[],z]});function j(A){const S=Io(A);P.value&&N.value&&(S&&A.button===0||!S)&&B(A)}function G(A){!h||!a.value&&!N.value||P.value&&L(A)}return t({handleClick:L,handlePointerDown:B,onClick:G,onPointerDown:j}),(A,S)=>(Q(),de("div",{ref_key:"handle",ref:C,"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:P.value,connecting:T.value,connectablestart:N.value,connectableend:g.value,connectionindicator:P.value&&(N.value&&!E.value||g.value&&E.value)}]]),onMousedown:j,onTouchstartPassive:j,onClick:G},[ke(A.$slots,"default",{id:A.id})],42,Xd))}}),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(Re,[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 Ud=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(Re,[i])]};Hn.props=["targetPosition","label","isValidTargetPos","connectable","data"],Hn.inheritAttrs=!1,Hn.compatConfig={MODE:3};const Wd=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(Re,[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 Zd=Fn,Kd=["transform"],qd=["width","height","x","y","rx","ry"],Jd=["y"],Qd=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)=>(Q(),de("g",{transform:o.value,class:"vue-flow__edge-textwrapper"},[i.labelShowBg?(Q(),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,qd)):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"?(Q(),Ie(pt(i.label),{key:0})):(Q(),de(Re,{key:1},[Be(De(i.label),1)],64))])],16,Jd)],8,Kd))}}),ef=["id","d","marker-end","marker-start"],tf=["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=lr();return t({pathEl:n,interactionEl:o,labelEl:r}),(l,a)=>(Q(),de(Re,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,ef),l.interactionWidth?(Q(),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,tf)):Me("",!0),l.label&&l.labelX&&l.labelY?(Q(),Ie(Qd,{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 Ji({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 Qi({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 el({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 tl(e){const{sourceX:t,sourceY:n,sourcePosition:o=J.Bottom,targetX:r,targetY:i,targetPosition:l=J.Top,curvature:a=.25}=e,[u,s]=el({pos:o,x1:t,y1:n,x2:r,y2:i,c:a}),[c,d]=el({pos:l,x1:r,y1:i,x2:t,y2:n,c:a}),[f,h,m,b]=Qi({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,b]}function nl({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 ol(e){const{sourceX:t,sourceY:n,sourcePosition:o=J.Bottom,targetX:r,targetY:i,targetPosition:l=J.Top}=e,[a,u]=nl({pos:o,x1:t,y1:n,x2:r,y2:i}),[s,c]=nl({pos:l,x1:r,y1:i,x2:t,y2:n}),[d,f,h,m]=Qi({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 rl={[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 nf({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 il(e,t){return Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2)}function of({source:e,sourcePosition:t=J.Bottom,target:n,targetPosition:o=J.Top,center:r,offset:i}){const l=rl[t],a=rl[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=nf({source:u,sourcePosition:t,target:s}),d=c.x!==0?"x":"y",f=c[d];let h,m,b;const w={x:0,y:0},C={x:0,y:0},[N,g,E,T]=Ji({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(l[d]*a[d]===-1){m=r.x??N,b=r.y??g;const L=[{x:m,y:u.y},{x:m,y:s.y}],P=[{x:u.x,y:b},{x:s.x,y:b}];l[d]===f?h=d==="x"?L:P:h=d==="x"?P:L}else{const L=[{x:u.x,y:s.y}],P=[{x:s.x,y:u.y}];if(d==="x"?h=l.x===f?P:L:h=l.y===f?L:P,t===o){const F=Math.abs(e[d]-n[d]);if(F<=i){const y=Math.min(i-1,i-F);l[d]===f?w[d]=(u[d]>e[d]?-1:1)*y:C[d]=(s[d]>n[d]?-1:1)*y}}if(t!==o){const F=d==="x"?"y":"x",y=l[d]===a[F],p=u[F]>s[F],_=u[F]<s[F];(l[d]===1&&(!y&&p||y&&_)||l[d]!==1&&(!y&&_||y&&p))&&(h=d==="x"?L:P)}const j={x:u.x+w.x,y:u.y+w.y},G={x:s.x+C.x,y:s.y+C.y},A=Math.max(Math.abs(j.x-h[0].x),Math.abs(G.x-h[0].x)),S=Math.max(Math.abs(j.y-h[0].y),Math.abs(G.y-h[0].y));A>=S?(m=(j.x+G.x)/2,b=h[0].y):(m=h[0].x,b=(j.y+G.y)/2)}return[[e,{x:u.x+w.x,y:u.y+w.y},...h,{x:s.x+C.x,y:s.y+C.y},n],m,b,E,T]}function rf(e,t,n,o){const r=Math.min(il(e,t)/2,il(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 Ao(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,b]=of({source:{x:t,y:n},sourcePosition:o,target:{x:r,y:i},targetPosition:l,center:{x:u,y:s},offset:c});return[d.reduce((C,N,g)=>{let E;return g>0&&g<d.length-1?E=rf(d[g-1],N,d[g+1],a):E=`${g===0?"M":"L"}${N.x} ${N.y}`,C+=E,C},""),f,h,m,b]}function lf(e){const{sourceX:t,sourceY:n,targetX:o,targetY:r}=e,[i,l,a,u]=Ji({sourceX:t,sourceY:n,targetX:o,targetY:r});return[`M ${t},${n}L ${o},${r}`,i,l,a,u]}const af=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]=lf(e);return ye(Yn,{path:n,labelX:o,labelY:r,...t,...e})}}}),ll=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]=Ao({...e,sourcePosition:e.sourcePosition??J.Bottom,targetPosition:e.targetPosition??J.Top});return ye(Yn,{path:n,labelX:o,labelY:r,...t,...e})}}}),sf=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(ll,{...e,...t,borderRadius:0})}}),uf=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]=tl({...e,sourcePosition:e.sourcePosition??J.Bottom,targetPosition:e.targetPosition??J.Top});return ye(Yn,{path:n,labelX:o,labelY:r,...t,...e})}}}),cf=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]=ol({...e,sourcePosition:e.sourcePosition??J.Bottom,targetPosition:e.targetPosition??J.Top});return ye(Yn,{path:n,labelX:o,labelY:r,...t,...e})}}}),df={input:Zd,default:Ud,output:Wd},ff={default:uf,straight:af,step:sf,smoothstep:ll,simplebezier:cf};function hf(e,t,n){const o=he(()=>b=>t.value.get(b)),r=he(()=>b=>n.value.get(b)),i=he(()=>{const b={...ff,...e.edgeTypes},w=Object.keys(b);for(const C of e.edges)C.type&&!w.includes(C.type)&&(b[C.type]=C.type);return b}),l=he(()=>{const b={...df,...e.nodeTypes},w=Object.keys(b);for(const C of e.nodes)C.type&&!w.includes(C.type)&&(b[C.type]=C.type);return b}),a=he(()=>e.onlyRenderVisibleElements?wi(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 b=[];for(const w of e.edges){const C=t.value.get(w.source),N=t.value.get(w.target);vd({sourcePos:C.computedPosition||{x:0,y:0},targetPos:N.computedPosition||{x:0,y:0},sourceWidth:C.dimensions.width,sourceHeight:C.dimensions.height,targetWidth:N.dimensions.width,targetHeight:N.dimensions.height,width:e.dimensions.width,height:e.dimensions.height,viewport:e.viewport})&&b.push(w)}return b}return e.edges}),s=he(()=>[...a.value,...u.value]),c=he(()=>{const b=[];for(const w of e.nodes)w.selected&&b.push(w);return b}),d=he(()=>{const b=[];for(const w of e.edges)w.selected&&b.push(w);return b}),f=he(()=>[...c.value,...d.value]),h=he(()=>{const b=[];for(const w of e.nodes)w.dimensions.width&&w.dimensions.height&&w.handleBounds!==void 0&&b.push(w);return b}),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=qi(),r=tr(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=hf(r,a,u),c=jd(r,a,u);c.setState({...r,...n});const d={...i,...s,...c,...da(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(Gi,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=w=>{s.applyNodeChanges(w)},b=w=>{s.applyEdgeChanges(w)};d?(s.onNodesChange(m),s.onEdgesChange(b)):(s.hooks.value.nodesChange.off(m),s.hooks.value.edgesChange.off(b)),h(()=>{s.hooks.value.nodesChange.off(m),s.hooks.value.edgesChange.off(b)})},{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(Gi,a),n.vueFlowId=a.id),o){const u=gt();u?.type.name!=="VueFlow"&&a.emits.error(new Oe(Ce.USEVUEFLOW_OPTIONS))}return a}function gf(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 pf=Ne({...{name:"UserSelection",compatConfig:{MODE:3}},props:{userSelectionRect:{}},setup(e){return(t,n)=>(Q(),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))}}),vf=["tabIndex"],mf=Ne({...{name:"NodesSelection",compatConfig:{MODE:3}},setup(e){const{emits:t,viewport:n,getSelectedNodes:o,noPanClassName:r,disableKeyboardA11y:i,userSelectionActive:l}=Ee(),a=Ki(),u=xe(null),s=Ui({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(()=>yi(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,b)=>!q(l)&&c.value.width&&c.value.height?(Q(),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,vf)],6)):Me("",!0)}});function _f(e,t){return{x:e.clientX-t.left,y:e.clientY-t.top}}const yf=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:b,multiSelectionKeyCode:w,multiSelectionActive:C,edgeLookup:N,nodeLookup:g,connectionLookup:E,defaultEdgeOptions:T,connectionStartHandle:B,panOnDrag:L}=Ee(),P=qe(null),j=qe(new Set),G=qe(new Set),A=qe(null),S=be(()=>u.value&&(e.isSelecting||i.value)),F=be(()=>B.value!==null);let y=!1,p=!1;const _=qt(b,{actInsideInputWithModifier:!1}),M=qt(w);_e(_,O=>{O&&(f(d.value),h(c.value),s.value=!1)}),_e(M,O=>{C.value=O});function z(O,D){return X=>{X.target===D&&O?.(X)}}function R(O){if(y||F.value){y=!1;return}r.paneClick(O),l(),s.value=!1}function V(O){var D;if(Array.isArray(L.value)&&((D=L.value)!=null&&D.includes(2))){O.preventDefault();return}r.paneContextMenu(O)}function H(O){r.paneScroll(O)}function U(O){var D,X,Y;if(A.value=((D=t.value)==null?void 0:D.getBoundingClientRect())??null,!u.value||!e.isSelecting||O.button!==0||O.target!==P.value||!A.value)return;(Y=(X=O.target)==null?void 0:X.setPointerCapture)==null||Y.call(X,O.pointerId);const{x:oe,y:re}=_f(O,A.value);p=!0,y=!1,l(),a.value={width:0,height:0,startX:oe,startY:re,x:oe,y:re},r.selectionStart(O)}function ne(O){var D;if(!A.value||!a.value)return;y=!0;const{x:X,y:Y}=Ue(O,A.value),{startX:oe=0,startY:re=0}=a.value,ge={startX:oe,startY:re,x:X<oe?X:oe,y:Y<re?Y:re,width:Math.abs(X-oe),height:Math.abs(Y-re)},se=j.value,ae=G.value;j.value=new Set(wi(n.value,ge,o.value,m.value===Eo.Partial,!0).map(v=>v.id)),G.value=new Set;const x=((D=T.value)==null?void 0:D.selectable)??!0;for(const v of j.value){const k=E.value.get(v);if(k)for(const{edgeId:I}of k.values()){const $=N.value.get(I);$&&($.selectable??x)&&G.value.add(I)}}if(!Yi(se,j.value)){const v=st(g.value,j.value,!0);r.nodesChange(v)}if(!Yi(ae,G.value)){const v=st(N.value,G.value);r.edgesChange(v)}a.value=ge,i.value=!0,s.value=!1}function fe(O){var D;O.button!==0||!p||((D=O.target)==null||D.releasePointerCapture(O.pointerId),!i.value&&a.value&&O.target===P.value&&R(O),i.value=!1,a.value=null,s.value=j.value.size>0,r.selectionEnd(O),e.selectionKeyPressed&&(y=!1),p=!1)}return(O,D)=>(Q(),de("div",{ref_key:"container",ref:P,class:ht(["vue-flow__pane vue-flow__container",{selection:O.isSelecting}]),onClick:D[0]||(D[0]=X=>S.value?void 0:z(R,P.value)(X)),onContextmenu:D[1]||(D[1]=X=>z(V,P.value)(X)),onWheelPassive:D[2]||(D[2]=X=>z(H,P.value)(X)),onPointerenter:D[3]||(D[3]=X=>S.value?void 0:q(r).paneMouseEnter(X)),onPointerdown:D[4]||(D[4]=X=>S.value?U(X):q(r).paneMouseMove(X)),onPointermove:D[5]||(D[5]=X=>S.value?ne(X):q(r).paneMouseMove(X)),onPointerup:D[6]||(D[6]=X=>S.value?fe(X):void 0),onPointerleave:D[7]||(D[7]=X=>q(r).paneMouseLeave(X))},[ke(O.$slots,"default"),q(i)&&q(a)?(Q(),Ie(pf,{key:0,"user-selection-rect":q(a)},null,8,["user-selection-rect"])):Me("",!0),q(s)&&q(d).length?(Q(),Ie(mf,{key:1})):Me("",!0)],34))}}),wf=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)=>(Q(),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))}}),bf=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:b,noWheelClassName:w,noPanClassName:C,emits:N,connectionStartHandle:g,userSelectionActive:E,paneDragging:T,d3Zoom:B,d3Selection:L,d3ZoomHandler:P,viewport:j,viewportRef:G,paneClickDistance:A}=Ee();gf(G);const S=qe(!1),F=qe(!1);let y=null,p=!1,_=0,M={x:0,y:0,zoom:0};const z=qt(a),R=qt(l),V=qt(i),H=be(()=>(!R.value||R.value&&l.value===!0)&&(z.value||d.value)),U=be(()=>z.value||u.value),ne=be(()=>l.value===!0&&H.value!==!0),fe=be(()=>R.value&&l.value!==!0||E.value||ne.value),O=be(()=>g.value!==null);Ke(()=>{if(!G.value){nn("Viewport element is missing");return}const re=G.value,ge=re.getBoundingClientRect(),se=Zc().clickDistance(A.value).scaleExtent([t.value,n.value]).translateExtent(r.value),ae=Ve(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(Ni),B.value=se,L.value=ae,P.value=x,j.value={x:I.x,y:I.y,zoom:I.k},se.on("start",$=>{var Z;if(!$.sourceEvent)return null;_=$.sourceEvent.button,S.value=!0;const K=Y($.transform);((Z=$.sourceEvent)==null?void 0:Z.type)==="mousedown"&&(T.value=!0),M=K,N.viewportChangeStart(K),N.moveStart({event:$,flowTransform:K})}),se.on("end",$=>{if(!$.sourceEvent)return null;if(S.value=!1,T.value=!1,D(H.value,_??0)&&!p&&N.paneContextMenu($.sourceEvent),p=!1,X(M,$.transform)){const Z=Y($.transform);M=Z,N.viewportChangeEnd(Z),N.moveEnd({event:$,flowTransform:Z})}}),se.filter($=>{var Z;const K=V.value||m.value,ie=h.value&&$.ctrlKey,ee=$.button,ue=$.type==="wheel";if(ee===1&&$.type==="mousedown"&&(oe($,"vue-flow__node")||oe($,"vue-flow__edge")))return!0;if(!H.value&&!K&&!U.value&&!f.value&&!h.value||E.value||O.value&&!ue||!f.value&&$.type==="dblclick"||oe($,w.value)&&ue||oe($,C.value)&&(!ue||U.value&&ue&&!V.value)||!h.value&&$.ctrlKey&&ue||!K&&!U.value&&!ie&&ue)return!1;if(!h&&$.type==="touchstart"&&((Z=$.touches)==null?void 0:Z.length)>1)return $.preventDefault(),!1;if(!H.value&&($.type==="mousedown"||$.type==="touchstart")||ne.value&&Array.isArray(d.value)&&d.value.includes(0)&&ee===0||Array.isArray(d.value)&&!d.value.includes(ee)&&($.type==="mousedown"||$.type==="touchstart"))return!1;const ve=Array.isArray(d.value)&&d.value.includes(ee)||l.value===!0&&Array.isArray(d.value)&&!d.value.includes(0)||!ee||ee<=1;return(!$.ctrlKey||z.value||ue)&&ve}),_e([E,H],()=>{E.value&&!S.value?se.on("zoom",null):E.value||se.on("zoom",$=>{j.value={x:$.transform.x,y:$.transform.y,zoom:$.transform.k};const Z=Y($.transform);p=D(H.value,_??0),N.viewportChange(Z),N.move({event:$,flowTransform:Z})})},{immediate:!0}),_e([E,U,s,V,h,b,w],()=>{U.value&&!V.value&&!E.value?ae.on("wheel.zoom",$=>{if(oe($,w.value))return!1;const Z=V.value||m.value,K=h.value&&$.ctrlKey;if(!(!b.value||U.value||Z||K))return!1;$.preventDefault(),$.stopImmediatePropagation();const ee=ae.property("__zoom").k||1,ue=zn();if(!z.value&&$.ctrlKey&&h.value&&ue){const Pv=Ye($),zv=Ni($),Av=ee*2**zv;se.scaleTo(ae,Av,Pv,$);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/ee)*c.value,-(dt/ee)*c.value);const Ze=Y(ae.property("__zoom"));y&&clearTimeout(y),F.value?(N.move({event:$,flowTransform:Ze}),N.viewportChange(Ze),y=setTimeout(()=>{N.moveEnd({event:$,flowTransform:Ze}),N.viewportChangeEnd(Ze),F.value=!1},150)):(F.value=!0,N.moveStart({event:$,flowTransform:Ze}),N.viewportChangeStart(Ze))},{passive:!1}):typeof x<"u"&&ae.on("wheel.zoom",function($,Z){const K=!b.value&&$.type==="wheel"&&!$.ctrlKey,ie=V.value||m.value,ee=h.value&&$.ctrlKey;if(!ie&&!u.value&&!ee&&$.type==="wheel"||K||oe($,w.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 X(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 Y(re){return{x:re.x,y:re.y,zoom:re.k}}function oe(re,ge){return re.target.closest(`.${ge}`)}return(re,ge)=>(Q(),de("div",{ref_key:"viewportRef",ref:G,class:"vue-flow__viewport vue-flow__container"},[le(yf,{"is-selecting":fe.value,"selection-key-pressed":q(R),class:ht({connecting:O.value,dragging:q(T),draggable:q(d)===!0||Array.isArray(q(d))&&q(d).includes(0)})},{default:me(()=>[le(wf,null,{default:me(()=>[ke(re.$slots,"default")]),_:3})]),_:3},8,["is-selecting","selection-key-pressed","class"])],512))}}),xf=["id"],Ef=["id"],Nf=["id"],Sf=Ne({...{name:"A11yDescriptions",compatConfig:{MODE:3}},setup(e){const{id:t,disableKeyboardA11y:n,ariaLiveMessage:o}=Ee();return(r,i)=>(Q(),de(Re,null,[ce("div",{id:`${q(ci)}-${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,xf),ce("div",{id:`${q(di)}-${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,Ef),q(n)?Me("",!0):(Q(),de("div",{key:0,id:`${q(td)}-${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,Nf))],64))}});function kf(){const e=Ee();_e(()=>e.viewportHelper.value.viewportInitialized,t=>{t&&setTimeout(()=>{e.emits.init(e),e.emits.paneReady(e)},1)})}function Cf(e,t,n){return n===J.Left?e-t:n===J.Right?e+t:e}function $f(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:Cf(t,e,o),cy:$f(n,e,o),r:e,stroke:"transparent",fill:"transparent"})};Ro.props=["radius","centerX","centerY","position","type"],Ro.compatConfig={MODE:3};const al=Ro,If=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:b,edgesUpdatable:w,edgesFocusable:C,hooks:N}=Ee(),g=he(()=>c(e.id)),{emit:E,on:T}=Dd(g.value,i),B=ot(Rn),L=gt(),P=xe(!1),j=xe(!1),G=xe(""),A=xe(null),S=xe("source"),F=xe(null),y=be(()=>typeof g.value.selectable>"u"?b.value:g.value.selectable),p=be(()=>typeof g.value.updatable>"u"?w.value:g.value.updatable),_=be(()=>typeof g.value.focusable>"u"?C.value:g.value.focusable);ft(Id,e.id),ft(Md,F);const M=he(()=>g.value.class instanceof Function?g.value.class(g.value):g.value.class),z=he(()=>g.value.style instanceof Function?g.value.style(g.value):g.value.style),R=he(()=>{const v=g.value.type||"default",k=B?.[`edge-${v}`];if(k)return k;let I=g.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:V}=Wi({nodeId:G,handleId:A,type:S,isValidConnection:f,edgeUpdaterType:S,onEdgeUpdate:ne,onEdgeUpdateEnd:fe});return()=>{const v=d(g.value.source),k=d(g.value.target),I="pathOptions"in g.value?g.value.pathOptions:{};if(!v&&!k)return i.error(new Oe(Ce.EDGE_SOURCE_TARGET_MISSING,g.value.id,g.value.source,g.value.target)),null;if(!v)return i.error(new Oe(Ce.EDGE_SOURCE_MISSING,g.value.id,g.value.source)),null;if(!k)return i.error(new Oe(Ce.EDGE_TARGET_MISSING,g.value.id,g.value.target)),null;if(!g.value||g.value.hidden||v.hidden||k.hidden)return null;let $;o.value===it.Strict?$=v.handleBounds.source:$=[...v.handleBounds.source||[],...v.handleBounds.target||[]];const Z=Pi($,g.value.sourceHandle);let K;o.value===it.Strict?K=k.handleBounds.target:K=[...k.handleBounds.target||[],...k.handleBounds.source||[]];const ie=Pi(K,g.value.targetHandle),ee=Z?.position||J.Bottom,ue=ie?.position||J.Top,{x:ve,y:we}=Tt(v,Z,ee),{x:dt,y:Ze}=Tt(k,ie,ue);return g.value.sourceX=ve,g.value.sourceY=we,g.value.targetX=dt,g.value.targetY=Ze,ye("g",{ref:F,key:e.id,"data-id":e.id,class:["vue-flow__edge",`vue-flow__edge-${R.value===!1?"default":g.value.type||"default"}`,a.value,M.value,{updating:P.value,selected:g.value.selected,animated:g.value.animated,inactive:!y.value&&!N.value.edgeClick.hasListeners()}],tabIndex:_.value?0:void 0,"aria-label":g.value.ariaLabel===null?void 0:g.value.ariaLabel??`Edge from ${g.value.source} to ${g.value.target}`,"aria-describedby":_.value?`${di}-${t}`:void 0,"aria-roledescription":"edge",role:_.value?"group":"img",...g.value.domAttributes,onClick:D,onContextmenu:X,onDblclick:Y,onMouseenter:oe,onMousemove:re,onMouseleave:ge,onKeyDown:_.value?x:void 0},[j.value?null:ye(R.value===!1?u.value.default:R.value,{id:e.id,sourceNode:v,targetNode:k,source:g.value.source,target:g.value.target,type:g.value.type,updatable:p.value,selected:g.value.selected,animated:g.value.animated,label:g.value.label,labelStyle:g.value.labelStyle,labelShowBg:g.value.labelShowBg,labelBgStyle:g.value.labelBgStyle,labelBgPadding:g.value.labelBgPadding,labelBgBorderRadius:g.value.labelBgBorderRadius,data:g.value.data,events:{...g.value.events,...T},style:z.value,markerStart:`url('#${tn(g.value.markerStart,t)}')`,markerEnd:`url('#${tn(g.value.markerEnd,t)}')`,sourcePosition:ee,targetPosition:ue,sourceX:ve,sourceY:we,targetX:dt,targetY:Ze,sourceHandleId:g.value.sourceHandle,targetHandleId:g.value.targetHandle,interactionWidth:g.value.interactionWidth,...I}),[p.value==="source"||p.value===!0?[ye("g",{onMousedown:se,onMouseenter:H,onMouseout:U},ye(al,{position:ee,centerX:ve,centerY:we,radius:r.value,type:"source","data-type":"source"}))]:null,p.value==="target"||p.value===!0?[ye("g",{onMousedown:ae,onMouseenter:H,onMouseout:U},ye(al,{position:ue,centerX:dt,centerY:Ze,radius:r.value,type:"target","data-type":"target"}))]:null]])};function H(){P.value=!0}function U(){P.value=!1}function ne(v,k){E.update({event:v,edge:g.value,connection:k})}function fe(v){E.updateEnd({event:v,edge:g.value}),j.value=!1}function O(v,k){v.button===0&&(j.value=!0,G.value=k?g.value.target:g.value.source,A.value=(k?g.value.targetHandle:g.value.sourceHandle)??null,S.value=k?"target":"source",E.updateStart({event:v,edge:g.value}),V(v))}function D(v){var k;const I={event:v,edge:g.value};y.value&&(l.value=!1,g.value.selected&&h.value?(s([g.value]),(k=F.value)==null||k.blur()):n([g.value])),E.click(I)}function X(v){E.contextMenu({event:v,edge:g.value})}function Y(v){E.doubleClick({event:v,edge:g.value})}function oe(v){E.mouseEnter({event:v,edge:g.value})}function re(v){E.mouseMove({event:v,edge:g.value})}function ge(v){E.mouseLeave({event:v,edge:g.value})}function se(v){O(v,!0)}function ae(v){O(v,!1)}function x(v){var k;!m.value&&fi.includes(v.key)&&y.value&&(v.key==="Escape"?((k=F.value)==null||k.blur(),s([c(e.id)])):n([c(e.id)]))}}}),Mf=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 N;return d((N=o.value)==null?void 0:N.nodeId)}),m=he(()=>{var N;return d((N=r.value)==null?void 0:N.nodeId)??null}),b=he(()=>({x:(i.value.x-c.value.x)/c.value.zoom,y:(i.value.y-c.value.y)/c.value.zoom})),w=he(()=>u.value.markerStart?`url(#${tn(u.value.markerStart,t)})`:""),C=he(()=>u.value.markerEnd?`url(#${tn(u.value.markerEnd,t)})`:"");return()=>{var N,g,E;if(!h.value||!o.value)return null;const T=o.value.id,B=o.value.type,L=h.value.handleBounds;let P=L?.[B]??[];if(n.value===it.Loose){const z=L?.[B==="source"?"target":"source"]??[];P=[...P,...z]}if(!P)return null;const j=(T?P.find(z=>z.id===T):P[0])??null,G=j?.position??J.Top,{x:A,y:S}=Tt(h.value,j,G);let F=null;m.value&&(n.value===it.Strict?F=((N=m.value.handleBounds[B==="source"?"target":"source"])==null?void 0:N.find(z=>{var R;return z.id===((R=r.value)==null?void 0:R.id)}))||null:F=((g=[...m.value.handleBounds.source??[],...m.value.handleBounds.target??[]])==null?void 0:g.find(z=>{var R;return z.id===((R=r.value)==null?void 0:R.id)}))||null);const y=((E=r.value)==null?void 0:E.position)??(G?Oo[G]:null);if(!G||!y)return null;const p=l.value??u.value.type??wt.Bezier;let _="";const M={sourceX:A,sourceY:S,sourcePosition:G,targetX:b.value.x,targetY:b.value.y,targetPosition:y};return p===wt.Bezier?[_]=tl(M):p===wt.Step?[_]=Ao({...M,borderRadius:0}):p===wt.SmoothStep?[_]=Ao(M):p===wt.SimpleBezier?[_]=ol(M):_=`M${A},${S} ${b.value.x},${b.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:S,sourcePosition:G,targetX:b.value.x,targetY:b.value.y,targetPosition:y,sourceNode:h.value,sourceHandle:j,targetNode:m.value,targetHandle:F,markerEnd:C.value,markerStart:w.value,connectionStatus:s.value}):ye("path",{d:_,class:[u.value.class,s.value,"vue-flow__connection-path"],style:{...a.value,...u.value.style},"marker-end":C.value,"marker-start":w.value})))}}}),Of=["id","markerWidth","markerHeight","markerUnits","orient"],Df=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)=>(Q(),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?(Q(),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?(Q(),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,Of))}}),Tf={class:"vue-flow__marker vue-flow__container","aria-hidden":"true"},Pf=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)=>(Q(),de("svg",Tf,[ce("defs",null,[(Q(!0),de(Re,null,sn(i.value,u=>(Q(),Ie(Df,{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)=>(Q(),de(Re,null,[le(Pf),(Q(!0),de(Re,null,sn(q(n),l=>(Q(),de("svg",{key:l.id,class:"vue-flow__edges vue-flow__container",style:Te({zIndex:q(md)(l,q(t),q(o))})},[le(q(If),{id:l.id},null,8,["id"])],4))),128)),le(q(Mf))],64))}}),Af=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:b,snapToGrid:w,snapGrid:C,nodeDragThreshold:N,nodesDraggable:g,elementsSelectable:E,nodesConnectable:T,nodesFocusable:B,hooks:L}=Ee(),P=xe(null);ft(Xi,P),ft(ji,e.id);const j=ot(Rn),G=gt(),A=Ki(),{node:S,parentNode:F}=Zi(e.id),{emit:y,on:p}=Ad(S,l),_=be(()=>typeof S.draggable>"u"?g.value:S.draggable),M=be(()=>typeof S.selectable>"u"?E.value:S.selectable),z=be(()=>typeof S.connectable>"u"?T.value:S.connectable),R=be(()=>typeof S.focusable>"u"?B.value:S.focusable),V=he(()=>M.value||_.value||L.value.nodeClick.hasListeners()||L.value.nodeDoubleClick.hasListeners()||L.value.nodeMouseEnter.hasListeners()||L.value.nodeMouseMove.hasListeners()||L.value.nodeMouseLeave.hasListeners()),H=be(()=>!!S.dimensions.width&&!!S.dimensions.height),U=he(()=>{const k=S.type||"default",I=j?.[`node-${k}`];if(I)return I;let $=S.template||d.value[k];if(typeof $=="string"&&G){const Z=Object.keys(G.appContext.components);Z&&Z.includes(k)&&($=Se(k,!1))}return $&&typeof $!="string"?$:(l.error(new Oe(Ce.NODE_TYPE_MISSING,$)),!1)}),ne=Ui({id:e.id,el:P,disabled:()=>!_.value,selectable:M,dragHandle:()=>S.dragHandle,onStart(k){y.dragStart(k)},onDrag(k){y.drag(k)},onStop(k){y.dragStop(k)},onClick(k){x(k)}}),fe=he(()=>S.class instanceof Function?S.class(S):S.class),O=he(()=>{const k=(S.style instanceof Function?S.style(S):S.style)||{},I=S.width instanceof Function?S.width(S):S.width,$=S.height instanceof Function?S.height(S):S.height;return!k.width&&I&&(k.width=typeof I=="string"?I:`${I}px`),!k.height&&$&&(k.height=typeof $=="string"?$:`${$}px`),k}),D=be(()=>Number(S.zIndex??O.value.zIndex??0));return c(k=>{(k.includes(e.id)||!k.length)&&Y()}),Ke(()=>{_e(()=>S.hidden,(k=!1,I,$)=>{!k&&P.value&&(e.resizeObserver.observe(P.value),$(()=>{P.value&&e.resizeObserver.unobserve(P.value)}))},{immediate:!0,flush:"post"})}),_e([()=>S.type,()=>S.sourcePosition,()=>S.targetPosition],()=>{ze(()=>{s([{id:e.id,nodeElement:P.value,forceUpdate:!0}])})}),_e([()=>S.position.x,()=>S.position.y,()=>{var k;return(k=F.value)==null?void 0:k.computedPosition.x},()=>{var k;return(k=F.value)==null?void 0:k.computedPosition.y},()=>{var k;return(k=F.value)==null?void 0:k.computedPosition.z},D,()=>S.selected,()=>S.dimensions.height,()=>S.dimensions.width,()=>{var k;return(k=F.value)==null?void 0:k.dimensions.height},()=>{var k;return(k=F.value)==null?void 0:k.dimensions.width}],([k,I,$,Z,K,ie])=>{const ee={x:k,y:I,z:ie+(h.value&&S.selected?1e3:0)};typeof $<"u"&&typeof Z<"u"?S.computedPosition=dd({x:$,y:Z,z:K},ee):S.computedPosition=ee},{flush:"post",immediate:!0}),_e([()=>S.extent,f],([k,I],[$,Z])=>{(k!==$||I!==Z)&&X()}),S.extent==="parent"||typeof S.extent=="object"&&"range"in S.extent&&S.extent.range==="parent"?to(()=>H).toBe(!0).then(X):X(),()=>S.hidden?null:ye("div",{ref:P,"data-id":S.id,class:["vue-flow__node",`vue-flow__node-${U.value===!1?"default":S.type||"default"}`,{[n.value]:_.value,dragging:ne?.value,draggable:_.value,selected:S.selected,selectable:M.value,parent:S.isParent},fe.value],style:{visibility:H.value?"visible":"hidden",zIndex:S.computedPosition.z??D.value,transform:`translate(${S.computedPosition.x}px,${S.computedPosition.y}px)`,pointerEvents:V.value?"all":"none",...O.value},tabIndex:R.value?0:void 0,role:R.value?"group":void 0,"aria-describedby":m.value?void 0:`${ci}-${t}`,"aria-label":S.ariaLabel,"aria-roledescription":"node",...S.domAttributes,onMouseenter:oe,onMousemove:re,onMouseleave:ge,onContextmenu:se,onClick:x,onDblclick:ae,onKeydown:v},[ye(U.value===!1?d.value.default:U.value,{id:S.id,type:S.type,data:S.data,events:{...S.events,...p},selected:S.selected,resizing:S.resizing,dragging:ne.value,connectable:z.value,position:S.computedPosition,dimensions:S.dimensions,isValidTargetPos:S.isValidTargetPos,isValidSourcePos:S.isValidSourcePos,parent:S.parentNode,parentNodeId:S.parentNode,zIndex:S.computedPosition.z??D.value,targetPosition:S.targetPosition,sourcePosition:S.sourcePosition,label:S.label,dragHandle:S.dragHandle,onUpdateNodeInternals:Y})]);function X(){const k=S.computedPosition,{computedPosition:I,position:$}=$o(S,w.value?An(k,C.value):k,l.error,f.value,F.value);(S.computedPosition.x!==I.x||S.computedPosition.y!==I.y)&&(S.computedPosition={...S.computedPosition,...I}),(S.position.x!==$.x||S.position.y!==$.y)&&(S.position=$)}function Y(){P.value&&s([{id:e.id,nodeElement:P.value,forceUpdate:!0}])}function oe(k){ne?.value||y.mouseEnter({event:k,node:S})}function re(k){ne?.value||y.mouseMove({event:k,node:S})}function ge(k){ne?.value||y.mouseLeave({event:k,node:S})}function se(k){return y.contextMenu({event:k,node:S})}function ae(k){return y.doubleClick({event:k,node:S})}function x(k){M.value&&(!o.value||!_.value||N.value>0)&&Do(S,i.value,u,a,r,!1,P.value),y.click({event:k,node:S})}function v(k){if(!(So(k)||m.value))if(fi.includes(k.key)&&M.value){const I=k.key==="Escape";Do(S,i.value,u,a,r,I,P.value)}else _.value&&S.selected&&Ot[k.key]&&(k.preventDefault(),b.value=`Moved selected node ${k.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~S.position.x}, y: ${~~S.position.y}`,A({x:Ot[k.key].x,y:Ot[k.key].y},k.shiftKey))}}});function Rf(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 Bf={class:"vue-flow__nodes vue-flow__container"},Vf=Ne({...{name:"Nodes",compatConfig:{MODE:3}},setup(e){const{getNodes:t,updateNodeDimensions:n,emits:o}=Ee(),r=Rf(),i=xe();return _e(r,l=>{l&&ze(()=>{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}));ze(()=>n(a))})}),Jn(()=>{var l;return(l=i.value)==null?void 0:l.disconnect()}),(l,a)=>(Q(),de("div",Bf,[i.value?(Q(!0),de(Re,{key:0},sn(q(t),(u,s,c,d)=>{const f=[u.id];if(d&&d.key===u.id&&or(d,f))return d;const h=(Q(),Ie(q(Af),{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 Lf(){const{emits:e}=Ee();Ke(()=>{if(Vi()){const t=document.querySelector(".vue-flow__pane");t&&window.getComputedStyle(t).zIndex!=="1"&&e.error(new Oe(Ce.MISSING_STYLES))}})}const Hf=ce("div",{class:"vue-flow__edge-labels"},null,-1),Ff=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=Jo(),i=no(o,"modelValue",n),l=no(o,"nodes",n),a=no(o,"edges",n),u=Ee(o),s=Ld({modelValue:i,nodes:l,edges:a},o,u);return Fd(n,u.hooks),kf(),Lf(),ft(Rn,r),Qo(s),t(u),(c,d)=>(Q(),de("div",{ref:q(u).vueFlowRef,class:"vue-flow"},[le(bf,null,{default:me(()=>[le(zf),Hf,le(Vf),ke(c.$slots,"zoom-pane")]),_:3}),ke(c.$slots,"default"),le(Sf)],512))}}),Yf=Ne({...{name:"Panel",compatConfig:{MODE:3}},props:{position:{}},setup(e){const t=e,{userSelectionActive:n}=Ee(),o=he(()=>`${t.position}`.split("-"));return(r,i)=>(Q(),de("div",{class:ht(["vue-flow__panel",o.value]),style:Te({pointerEvents:q(n)?"none":"all"})},[ke(r.$slots,"default")],6))}}),Gf={name:"ControlButton",compatConfig:{MODE:3}},jf=(e,t)=>{const n=e.__vccOpts||e;for(const[o,r]of t)n[o]=r;return n},Xf={type:"button",class:"vue-flow__controls-button"};function Uf(e,t,n,o,r,i){return Q(),de("button",Xf,[ke(e.$slots,"default")])}const on=jf(Gf,[["render",Uf]]),Wf={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32"},Zf=[ce("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"},null,-1)];function Kf(e,t){return Q(),de("svg",Wf,Zf)}const qf={render:Kf},Jf={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5"},Qf=[ce("path",{d:"M0 0h32v4.2H0z"},null,-1)];function eh(e,t){return Q(),de("svg",Jf,Qf)}const th={render:eh},nh={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30"},oh=[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 rh(e,t){return Q(),de("svg",nh,oh)}const ih={render:rh},lh={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},ah=[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 sh(e,t){return Q(),de("svg",lh,ah)}const uh={render:sh},ch={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},dh=[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 fh(e,t){return Q(),de("svg",ch,dh)}const hh={render:fh},gh=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:()=>si.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 b(){l(),t("zoomIn")}function w(){a(),t("zoomOut")}function C(){u(e.fitViewParams),t("fitView")}function N(){i(!f.value),t("interactionChange",!f.value)}return(g,E)=>(Q(),Ie(q(Yf),{class:"vue-flow__controls",position:g.position},{default:me(()=>[ke(g.$slots,"top"),g.showZoom?(Q(),de(Re,{key:0},[ke(g.$slots,"control-zoom-in",{},()=>[le(on,{class:"vue-flow__controls-zoomin",disabled:m.value,onClick:b},{default:me(()=>[ke(g.$slots,"icon-zoom-in",{},()=>[(Q(),Ie(pt(q(qf))))])]),_:3},8,["disabled"])]),ke(g.$slots,"control-zoom-out",{},()=>[le(on,{class:"vue-flow__controls-zoomout",disabled:h.value,onClick:w},{default:me(()=>[ke(g.$slots,"icon-zoom-out",{},()=>[(Q(),Ie(pt(q(th))))])]),_:3},8,["disabled"])])],64)):Me("",!0),g.showFitView?ke(g.$slots,"control-fit-view",{key:1},()=>[le(on,{class:"vue-flow__controls-fitview",onClick:C},{default:me(()=>[ke(g.$slots,"icon-fit-view",{},()=>[(Q(),Ie(pt(q(ih))))])]),_:3})]):Me("",!0),g.showInteractive?ke(g.$slots,"control-interactive",{key:2},()=>[g.showInteractive?(Q(),Ie(on,{key:0,class:"vue-flow__controls-interactive",onClick:N},{default:me(()=>[f.value?ke(g.$slots,"icon-unlock",{key:0},()=>[(Q(),Ie(pt(q(hh))))]):Me("",!0),f.value?Me("",!0):ke(g.$slots,"icon-lock",{key:1},()=>[(Q(),Ie(pt(q(uh))))])]),_:3})):Me("",!0)]):Me("",!0),ke(g.$slots,"default")]),_:3},8,["position"]))}});var nt=(e=>(e.Lines="lines",e.Dots="dots",e))(nt||{});const sl=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]}`})},ul=function({radius:e,color:t}){return ye("circle",{cx:e,cy:e,r:e,fill:t})};nt.Lines+"",nt.Dots+"";const ph={[nt.Dots]:"#81818a",[nt.Lines]:"#eee"},vh=["id","x","y","width","height","patternTransform"],mh={key:2,height:"100",width:"100"},_h=["fill"],yh=["x","y","fill"],wh=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||ph[e.variant||nt.Dots]);return(l,a)=>(Q(),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?(Q(),Ie(q(sl),{key:0,size:l.lineWidth,color:i.value,dimensions:o.value.scaledGap},null,8,["size","color","dimensions"])):l.variant===q(nt).Dots?(Q(),Ie(q(ul),{key:1,color:i.value,radius:o.value.size/2},null,8,["color","radius"])):Me("",!0),l.bgColor?(Q(),de("svg",mh,[ce("rect",{width:"100%",height:"100%",fill:l.bgColor},null,8,_h)])):Me("",!0)])],8,vh)]),ce("rect",{x:l.x,y:l.y,width:"100%",height:"100%",fill:`url(#${r.value})`},null,8,yh),ke(l.$slots,"default",{id:r.value})],4))}}),bh={name:"DetailsTable",components:{RawBuffer:dr},mixins:[cr],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=new Set(["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.has(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.replaceAll("_"," ").replace(/\b\w/g,t=>t.toUpperCase())},formatValue(e){return e==null?"null":typeof e=="object"?JSON.stringify(e,null,2):String(e)}}},xh={class:"details-table"},Eh={class:"text-wrap"},Nh={key:1,class:"d-flex justify-center align-center pa-4"};function Sh(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"),b=Se("v-card");return Q(),Ie(b,{"max-height":"80vh",class:"d-flex flex-column"},{default:me(()=>[le(u,{class:"d-flex align-center flex-shrink-0"},{default:me(()=>[Be(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",xh,[le(h,null,{default:me(()=>[le(d,{cols:"4"},{default:me(()=>[i.shownDetails?(Q(),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:w})=>[ce("span",Eh,De(w.value),1)]),_:1},8,["headers","items"])):(Q(),de("div",Nh,[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]=w=>i.upperData.data=w)},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]=w=>i.lowerData.data=w)},null,8,["modelValue"])]),_:1})]),_:1})])]),_:1})]),_:1})}const kh=rt(bh,[["render",Sh],["__scopeId","data-v-5079ef7f"]]),Ch={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`}}}},$h={class:"node-label"};function Ih(e,t,n,o,r,i){const l=Se("v-icon"),a=Se("Handle");return Q(),de("div",{class:"interface-node",style:Te(i.interfaceStyle)},[le(l,{color:"#1d85e1"},{default:me(()=>[...t[0]||(t[0]=[Be("mdi-swap-horizontal-bold",-1)])]),_:1}),ce("div",$h,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 Mh=rt(Ch,[["render",Ih],["__scopeId","data-v-31945a3b"]]),Oh={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`}}}},Dh={class:"node-label"};function Th(e,t,n,o,r,i){const l=Se("v-icon"),a=Se("Handle");return Q(),de("div",{class:"router-node",style:Te(i.routerStyle)},[le(l,{color:"#ba1de1"},{default:me(()=>[...t[0]||(t[0]=[Be("mdi-call-split",-1)])]),_:1}),ce("div",Dh,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 Ph=rt(Oh,[["render",Th],["__scopeId","data-v-b1fbfb62"]]),zh={name:"TargetNode",components:{Handle:ct},props:{data:{type:Object,required:!0}}},Ah={class:"cosmos-node"},Rh={class:"node-label"};function Bh(e,t,n,o,r,i){const l=Se("Handle"),a=Se("v-icon");return Q(),de("div",Ah,[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]=[Be("mdi-rocket-launch",-1)])]),_:1}),ce("div",Rh,De(n.data.label),1),t[3]||(t[3]=ce("div",{class:"node-label"},"Processing",-1))])}const Vh=rt(zh,[["render",Bh],["__scopeId","data-v-c2b5368b"]]),Lh={name:"TargetNode",components:{Handle:ct},props:{data:{type:Object,required:!0}}},Hh={class:"target-node"},Fh={class:"node-label"};function Yh(e,t,n,o,r,i){const l=Se("Handle"),a=Se("v-icon");return Q(),de("div",Hh,[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]=[Be("mdi-target",-1)])]),_:1}),ce("div",Fh,De(n.data.label),1),t[3]||(t[3]=ce("div",{class:"node-label"},"Target",-1))])}const Gh=rt(Lh,[["render",Yh],["__scopeId","data-v-125c8608"]]),jh={name:"WriteProtocolNode",props:{data:{type:Object,required:!0}},computed:{protocolStyle(){return this.data.width?{width:`${this.data.width}px`}:{}}}},Xh={class:"protocol-label"};function Uh(e,t,n,o,r,i){const l=Se("v-icon");return Q(),de("div",{class:"write-protocol-node",style:Te(i.protocolStyle)},[le(l,{color:"#f97316",size:"small"},{default:me(()=>[...t[0]||(t[0]=[Be("mdi-arrow-right-bold",-1)])]),_:1}),ce("div",Xh,De(n.data.label),1)],4)}const Wh=rt(jh,[["render",Uh],["__scopeId","data-v-1bec9d38"]]),Zh={name:"ReadProtocolNode",props:{data:{type:Object,required:!0}},computed:{protocolStyle(){return this.data.width?{width:`${this.data.width}px`}:{}}}},Kh={class:"protocol-label"};function qh(e,t,n,o,r,i){const l=Se("v-icon");return Q(),de("div",{class:"read-protocol-node",style:Te(i.protocolStyle)},[le(l,{color:"#06b6d4",size:"small"},{default:me(()=>[...t[0]||(t[0]=[Be("mdi-arrow-left-bold",-1)])]),_:1}),ce("div",Kh,De(n.data.label),1)],4)}const Jh=rt(Zh,[["render",qh],["__scopeId","data-v-c903bd6c"]]);var cl=Object.defineProperty,Qh=(e,t,n)=>t in e?cl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,eg=(e,t)=>{for(var n in t)cl(e,n,{get:t[n],enumerable:!0})},tg=(e,t,n)=>Qh(e,t+"",n),dl={};eg(dl,{Graph:()=>Fe,alg:()=>Lo});var ng=Object.defineProperty,fl=(e,t)=>{for(var n in t)ng(e,n,{get:t[n],enumerable:!0})},Bo=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),o=this.successors(e);if(o)for(let r of o)n.add(r);return Array.from(n.values())}}isLeaf(e){var t;let n;return this.isDirected()?n=this.successors(e):n=this.neighbors(e),((t=n?.length)!=null?t:0)===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,i):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=og(this._isDirected,r,i,l);return r=c.v,i=c.w,Object.freeze(c),this._edgeObjs[s]=c,hl(this._preds[i],r),hl(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?Vo(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"||o===null?{label:o}:o}hasEdge(e,t,n){return(arguments.length===1?Vo(this._isDirected,e):rn(this._isDirected,e,t,n))in this._edgeLabels}removeEdge(e,t,n){let o=arguments.length===1?Vo(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],gl(this._preds[l],i),gl(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 hl(e,t){e[t]?e[t]++:e[t]=1}function gl(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 og(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 Vo(e,t){return rn(e,t.v,t.w,t.name)}var rg={};fl(rg,{read:()=>sg,write:()=>ig});function ig(e){let t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:lg(e),edges:ag(e)},n=e.graph();return n!==void 0&&(t.value=structuredClone(n)),t}function lg(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 ag(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 sg(e){let t=new Bo(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 Lo={};fl(Lo,{CycleException:()=>Xn,bellmanFord:()=>pl,components:()=>dg,dijkstra:()=>jn,dijkstraAll:()=>gg,findCycles:()=>pg,floydWarshall:()=>mg,isAcyclic:()=>yg,postorder:()=>bg,preorder:()=>xg,prim:()=>Eg,shortestPaths:()=>Ng,tarjan:()=>ml,topsort:()=>_l});var ug=()=>1;function pl(e,t,n,o){return cg(e,String(t),n||ug,o||function(r){var i;return(i=e.outEdges(r))!=null?i:[]})}function cg(e,t,n,o){let r={},i,l=0,a=e.nodes(),u=function(d){let f=r[d.v],h=r[d.w];if(!f||!h)return;let m=n(d);f.distance+m<h.distance&&(r[d.w]={distance:f.distance+m,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 dg(e){let t={},n=[],o;function r(i){var l,a;i in t||(t[i]=!0,o.push(i),(l=e.successors(i))==null||l.forEach(r),(a=e.predecessors(i))==null||a.forEach(r))}return e.nodes().forEach(function(i){o=[],r(i),o.length&&n.push(o)}),n}var vl=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(){if(this.size()===0)throw new Error("Queue underflow");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}},fg=()=>1;function jn(e,t,n,o){let r=function(i){var l;return(l=e.outEdges(i))!=null?l:[]};return hg(e,String(t),n||fg,o||r)}function hg(e,t,n,o){let r={},i=new vl,l,a,u=function(s){let c=s.v!==l?s.v:s.w,d=r[c];if(!d)return;let 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();let s=r[l];if(!s||s.distance===Number.POSITIVE_INFINITY)break;a=s,o(l).forEach(u)}return r}function gg(e,t,n){return e.nodes().reduce(function(o,r){return o[r]=jn(e,r,t,n),o},{})}function ml(e){let t=0,n=[],o={},r=[];function i(l){var a;let u=o[l]={onStack:!0,lowlink:t,index:t++};if(n.push(l),(a=e.successors(l))==null||a.forEach(function(s){if(s in o){let c=o[s];c!=null&&c.onStack&&(u.lowlink=Math.min(u.lowlink,c.index))}else{i(s);let c=o[s];c&&(u.lowlink=Math.min(u.lowlink,c.lowlink))}}),u.lowlink===u.index){let s=[],c;do{c=n.pop();let d=o[c];d&&(d.onStack=!1),s.push(c)}while(l!==c);r.push(s)}}return e.nodes().forEach(function(l){l in o||i(l)}),r}function pg(e){return ml(e).filter(function(t){var n;let o=t[0];return o?t.length>1||t.length===1&&((n=e.outEdges(o,o))!=null?n:[]).length>0:!1})}var vg=()=>1;function mg(e,t,n){return _g(e,t||vg,n||function(o){var r;return(r=e.outEdges(o))!=null?r:[]})}function _g(e,t,n){let o={},r=e.nodes();return r.forEach(function(i){let l={};o[i]=l,l[i]={distance:0,predecessor:""},r.forEach(function(a){i!==a&&(l[a]={distance:Number.POSITIVE_INFINITY,predecessor:""})}),n(i).forEach(function(a){let u=a.v===i?a.w:a.v,s=t(a);l[u]={distance:s,predecessor:i}})}),r.forEach(function(i){let l=o[i];l&&r.forEach(function(a){let u=o[a];u&&r.forEach(function(s){let c=u[i],d=l[s],f=u[s];if(c&&d&&f){let h=c.distance+d.distance;h<f.distance&&(f.distance=h,f.predecessor=d.predecessor)}})})}),o}var Xn=class extends Error{constructor(e){super(e),this.name="CycleException"}};function _l(e){let t={},n={},o=[];function r(i){var l;if(i in n)throw new Xn;i in t||(n[i]=!0,t[i]=!0,(l=e.predecessors(i))==null||l.forEach(r),delete n[i],o.push(i))}if(e.sinks().forEach(r),Object.keys(t).length!==e.nodeCount())throw new Xn;return o}function yg(e){try{_l(e)}catch(t){if(t instanceof Xn)return!1;throw t}return!0}function wg(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=yl(e,a,n==="post",l,i,o,r)}),r}function yl(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=yl(e,a,n,o,r,i,l)}),n&&(l=i(l,t))),l}function wl(e,t,n){return wg(e,t,n,function(o,r){return o.push(r),o},[])}function bg(e,t){return wl(e,t,"post")}function xg(e,t){return wl(e,t,"pre")}function Eg(e,t){var n;let o=new Bo,r={},i=new vl,l;function a(c){let d=c.v===l?c.w:c.v,f=i.priority(d);if(f!==void 0){let h=t(c);h<f&&(r[d]=l,i.decrease(d,h))}}if(e.nodeCount()===0)return o;e.nodes().forEach(function(c){i.add(c,Number.POSITIVE_INFINITY),o.setNode(c)});let u=e.nodes()[0];u!==void 0&&i.decrease(u,0);let s=!1;for(;i.size()>0;){if(l=i.removeMin(),l in r)o.setEdge(l,r[l]);else{if(s)throw new Error("Input graph is not connected: "+e);s=!0}(n=e.nodeEdges(l))==null||n.forEach(a)}return o}function Ng(e,t,n,o){return Sg(e,t,n,o??(r=>{var i;return(i=e.outEdges(r))!=null?i:[]}))}function Sg(e,t,n,o){if(n===void 0)return jn(e,t,n,o);let r=!1,i=e.nodes();for(let l=0;l<i.length;l++){let a=i[l];if(a===void 0)continue;let u=o(a);for(let s=0;s<u.length;s++){let c=u[s];if(!c)continue;let d=c.v===a?c.v:c.w,f=d===c.v?c.w:c.v;n({v:d,w:f})<0&&(r=!0)}if(r)return pl(e,t,n,o)}return jn(e,t,n,o)}var Fe=Bo;function Pt(e,t,n,o){let r=o;for(;e.hasNode(r);)r=Ho(o);return n.dummy=t,e.setNode(r,n),r}function kg(e){let t=new Fe().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 bl(e){let t=new Fe({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 xl(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(Sl(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 Cg(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 $g(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 El(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 Ig(e,t=Nl){let n=[];for(let o=0;o<e.length;o+=t){let r=e.slice(o,o+t);n.push(r)}return n}var Nl=65535;function We(e,t){if(t.length>Nl){let n=Ig(t);return e(...n.map(o=>e(...o)))}else return e(...t)}function Sl(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 Mg(e,t){let n={lhs:[],rhs:[]};return e.forEach(o=>{t(o)?n.lhs.push(o):n.rhs.push(o)}),n}function Og(e,t){let n=Date.now();try{return t()}finally{console.log(e+" time: "+(Date.now()-n)+"ms")}}function kl(e,t){return t()}var Dg=0;function Ho(e){let t=++Dg;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 Tg(e,t){return e.reduce((n,o,r)=>(n[o]=t[r],n),{})}var Zn="\0";function Cl(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(b=>{var w,C;return((w=b[1].edgeObj)==null?void 0:w.v)===t.edgeObj.v&&((C=b[1].edgeObj)==null?void 0:C.w)===t.edgeObj.w&&b[1].rank===c}),f=Object.entries(e).find(b=>{var w,C;return((w=b[1].edgeObj)==null?void 0:w.v)===n.edgeObj.v&&((C=b[1].edgeObj)==null?void 0:C.w)===n.edgeObj.w&&b[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 Pg="3.1.1",zg=class{constructor(){tg(this,"_sentinel");let e={};e._next=e._prev=e,this._sentinel=e}dequeue(){let e=this._sentinel,t=e._prev;if(t!==e)return $l(t),t}enqueue(e){let t=this._sentinel;e._prev&&e._next&&$l(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,Ag)),n=n._prev;return"["+e.join(", ")+"]"}};function $l(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function Ag(e,t){if(e!=="_next"&&e!=="_prev")return t}var Rg=zg,Bg=()=>1;function Vg(e,t){if(e.nodeCount()<=1)return[];let n=Hg(e,t||Bg);return Lg(n.graph,n.buckets,n.zeroIdx).flatMap(o=>e.outEdges(o.v,o.w)||[])}function Lg(e,t,n){var o;let r=[],i=t[t.length-1],l=t[0],a;for(;e.nodeCount();){for(;a=l.dequeue();)Fo(e,t,n,a);for(;a=i.dequeue();)Fo(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(Fo(e,t,n,a,!0)||[]);break}}}return r}function Fo(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,Yo(t,n,s)}),(e.outEdges(o.v)||[]).forEach(a=>{let u=e.edge(a),s=a.w,c=e.node(s);c.in-=u,Yo(t,n,c)}),e.removeNode(o.v),l}function Hg(e,t){let n=new Fe,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=Fg(r+o+3).map(()=>new Rg),l=o+1;return n.nodes().forEach(a=>{Yo(i,l,n.node(a))}),{graph:n,buckets:i,zeroIdx:l}}function Yo(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 Fg(e){let t=[];for(let n=0;n<e;n++)t.push(n);return t}function Yg(e,t){(e.graph().acyclicer==="greedy"?Vg(e,n(e)):Gg(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,Ho("rev"))});function n(o){return r=>o.edge(r).weight}}function Gg(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)&&Xg(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 Xg(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 Ug(e){e.graph().dummyChains=[],e.edges().forEach(t=>Wg(e,t))}function Wg(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 Zg(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 Go(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 zt(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}var Il=Kg;function Kg(e){let t=new Fe({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(;qg(t,e)<r&&(i=Jg(t,e),!!i);)l=t.hasNode(i.v)?zt(e,i):-zt(e,i),Qg(t,e,l);return t}function qg(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)&&!zt(t,i)&&(e.setNode(a,{}),e.setEdge(o,a,{}),n(a))})}return e.nodes().forEach(n),e.nodeCount()}function Jg(e,t){return t.edges().reduce((n,o)=>{let r=Number.POSITIVE_INFINITY;return e.hasNode(o.v)!==e.hasNode(o.w)&&(r=zt(t,o)),r<n[0]?[r,o]:n},[Number.POSITIVE_INFINITY,null])[1]}function Qg(e,t,n){e.nodes().forEach(o=>t.node(o).rank+=n)}var{preorder:ep,postorder:tp}=Lo,np=Nt;Nt.initLowLimValues=Xo,Nt.initCutValues=jo,Nt.calcCutValue=Ml,Nt.leaveEdge=Dl,Nt.enterEdge=Tl,Nt.exchangeEdges=Pl;function Nt(e){e=kg(e),Go(e);let t=Il(e);Xo(t),jo(t,e);let n,o;for(;n=Dl(t);)o=Tl(t,e,n),Pl(t,e,n,o)}function jo(e,t){let n=tp(e,e.nodes());n=n.slice(0,n.length-1),n.forEach(o=>op(e,t,o))}function op(e,t,n){let o=e.node(n).parent,r=e.edge(n,o);r.cutvalue=Ml(e,t,n)}function Ml(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,ip(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]),Ol(e,{},1,t)}function Ol(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=Ol(e,t,n,u,o))}),l.low=i,l.lim=n++,r?l.parent=r:delete l.parent,n}function Dl(e){return e.edges().find(t=>e.edge(t).cutvalue<0)}function Tl(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===zl(e,e.node(s.v),a)&&u!==zl(e,e.node(s.w),a)).reduce((s,c)=>zt(t,c)<zt(t,s)?c:s)}function Pl(e,t,n,o){let r=n.v,i=n.w;e.removeEdge(r,i),e.setEdge(o.v,o.w,{}),Xo(e),jo(e,t),rp(e,t)}function rp(e,t){let n=e.nodes().find(r=>!e.node(r).parent);if(!n)return;let o=ep(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 ip(e,t,n){return e.hasEdge(t,n)}function zl(e,t,n){return n.low<=t.lim&&t.lim<=n.lim}var lp=ap;function ap(e){let t=e.graph().ranker;if(typeof t=="function")return t(e);switch(t){case"network-simplex":Al(e);break;case"tight-tree":up(e);break;case"longest-path":sp(e);break;case"none":break;default:Al(e)}}var sp=Go;function up(e){Go(e),Il(e)}function Al(e){np(e)}var cp=dp;function dp(e){let t=hp(e),n=e.graph();Array.isArray(n.dummyChains)&&n.dummyChains.forEach(o=>{let r=e.node(o),i=r.edgeObj,l=fp(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 fp(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 hp(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 gp(e){let t=Pt(e,"root",{},"_root"),n=pp(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=vp(e)+1;e.children(Zn).forEach(a=>{Rl(e,t,i,l,r,n,a)}),e.graph().nodeRankFactor=i}function Rl(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=El(e,"_bt"),c=El(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;Rl(e,t,n,o,r,i,f);let m=e.node(f),b=m.borderTop?m.borderTop:f,w=m.borderBottom?m.borderBottom:f,C=m.borderTop?o:2*o,N=b!==w?1:r-((h=i[l])!=null?h:0)+1;e.setEdge(s,b,{weight:C,minlen:N,nestingEdge:!0}),e.setEdge(w,c,{weight:C,minlen:N,nestingEdge:!0})}),e.parent(l)||e.setEdge(t,s,{weight:0,minlen:r+((a=i[l])!=null?a:0)})}function pp(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 vp(e){return e.edges().reduce((t,n)=>t+e.edge(n).weight,0)}function mp(e){let t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,e.edges().forEach(n=>{e.edge(n).nestingEdge&&e.removeEdge(n)})}var _p=yp;function yp(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)Bl(e,"borderLeft","_bl",n,r,i),Bl(e,"borderRight","_br",n,r,i)}}e.children(Zn).forEach(t)}function Bl(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 wp(e){var t;let n=(t=e.graph().rankdir)==null?void 0:t.toLowerCase();(n==="lr"||n==="rl")&&Vl(e)}function bp(e){var t;let n=(t=e.graph().rankdir)==null?void 0:t.toLowerCase();(n==="bt"||n==="rl")&&xp(e),(n==="lr"||n==="rl")&&(Ep(e),Vl(e))}function Vl(e){e.nodes().forEach(t=>Ll(e.node(t))),e.edges().forEach(t=>Ll(e.edge(t)))}function Ll(e){let t=e.width;e.width=e.height,e.height=t}function xp(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,"y")&&Uo(o)})}function Uo(e){e.y=-e.y}function Ep(e){e.nodes().forEach(t=>Wo(e.node(t))),e.edges().forEach(t=>{var n;let o=e.edge(t);(n=o.points)==null||n.forEach(Wo),Object.hasOwn(o,"x")&&Wo(o)})}function Wo(e){let t=e.x;e.x=e.y,e.y=t}function Np(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 Cl(t,d,f)}return l}function Sp(e,t){let n=0;for(let o=1;o<t.length;++o)n+=kp(e,t[o-1],t[o]);return n}function kp(e,t,n){let o=Tg(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 Cp(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 $p(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 Ip(o)}function Ip(e){let t=[];function n(r){return i=>{i.merged||(i.barycenter===void 0||r.barycenter===void 0||i.barycenter>=r.barycenter)&&Mp(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 Mp(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 Op(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=Mg(e,C=>Object.hasOwn(C,"barycenter")),c=s.lhs,d=s.rhs.sort((C,N)=>N.i-C.i),f=[],h=0,m=0,b=0;c.sort(Dp(a,l,!!u));for(let[C,N]of Object.entries(i)){let g=c.findIndex(E=>E.vs[0]===C);c.splice(g+1,0,N)}b=Hl(f,d,b),c.forEach(C=>{b+=C.vs.length,f.push(C.vs),h+=C.barycenter*C.weight,m+=C.weight,b=Hl(f,d,b)});let w={vs:f.flat(1)};return m&&(w.barycenter=h/m,w.weight=m),w}function Hl(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 Dp(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=Cl(t,i,l);if(a!==0)return a}return n?r.i-o.i:o.i-r.i}}function Fl(e,t,n,o,r){var i,l,a,u,s,c,d,f,h,m,b;let w=null,C=r;typeof o=="boolean"?(C=o,w=null):o!==void 0&&(w=o);let N=e.children(t),g=e.node(t),E=g?g.borderLeft:void 0,T=g?g.borderRight:void 0,B={};E&&(N=N.filter(S=>S!==E&&S!==T));let L=Cp(e,N);L.forEach(S=>{if(e.children(S.v).length){let{result:F}=Fl(e,S.v,n,w,C);B[S.v]=F,Object.hasOwn(F,"barycenter")&&Pp(S,F)}});let P=$p(L,n);Tp(P,B);let j={},G=!1;for(let S=0;S<P.length;S++)for(let F=S+1;F<P.length;F++)if(!(!P[S]||!P[F]||!((i=P[S])!=null&&i.barycenter)||!((l=P[F])!=null&&l.barycenter))&&((a=P[S])==null?void 0:a.barycenter)===P[F].barycenter){let y=(s=(u=P[S])==null?void 0:u.vs[0])!=null?s:"",p=(d=(c=P[F])==null?void 0:c.vs[0])!=null?d:"",_=e.node(y),M=e.node(p);if(_.dummy==="edge"&&M.dummy==="edge"&&((f=_.edgeObj)==null?void 0:f.v)===((h=M.edgeObj)==null?void 0:h.v)&&((m=_.edgeObj)==null?void 0:m.w)===((b=M.edgeObj)==null?void 0:b.w))if(_.edgeLabel.reversed){j[p]=P[S],P.splice(S,1),S--;break}else j[y]=P[F],P.splice(F,1),F--;else G=!0}let A=Op(P,j,w,e,C);if(E&&T){A.vs=[E,A.vs,T].flat(1);let S=e.predecessors(E);if(S&&S.length){let F=e.node(S[0]),y=e.predecessors(T),p=e.node(y[0]);Object.hasOwn(A,"barycenter")||(A.barycenter=0,A.weight=0),A.barycenter=(A.barycenter*A.weight+F.order+p.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:G,enumerable:!1,configurable:!0,writable:!0}),A}function Tp(e,t){e.forEach(n=>{n.vs=n.vs.flatMap(o=>t[o]?t[o].vs:o)})}function Pp(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=Ap(e),i=new Fe({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 Ap(e){let t;for(;e.hasNode(t=Ho("_root")););return t}function Rp(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 Yl(e,t={},n=null){if(typeof t.customOrder=="function"){t.customOrder(e,Yl);return}let o=Sl(e),r=Gl(e,an(1,o+1),"inEdges"),i=Gl(e,an(o-1,-1,-1),"outEdges"),l=Np(e,n);if(jl(e,l),t.disableOptimalOrderHeuristic)return;let a=Number.POSITIVE_INFINITY,u,s=t.constraints||[];for(let c=0,d=0;d<4;++c,++d){Bp(c%2?r:i,c%4>=2,s,n),l=ln(e);let f=Sp(e,l);f<a?(d=0,u=Object.assign({},l),a=f):f===a&&(u=structuredClone(l))}jl(e,u)}function Gl(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 Bp(e,t,n,o){let r=!0,i=new Fe;e.forEach(function(l){n.forEach(c=>i.setEdge(c.left,c.right));let a=l.graph().root,{result:u,usedBias:s}=Fl(l,a,i,o,r);t&&s&&(r=!r),u.vs.forEach((c,d)=>l.node(c).order=d),Rp(l,i,u.vs)})}function jl(e,t){Object.values(t).forEach(n=>n.forEach((o,r)=>e.node(o).order=r))}function Vp(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=Hp(e,c),h=f?e.node(f).order:u;(f||c===s)&&(i.slice(a,d+1).forEach(m=>{let b=e.predecessors(m);b&&b.forEach(w=>{let C=e.node(w),N=C.order;(N<l||h<N)&&!(C.dummy&&e.node(m).dummy)&&Xl(n,w,m)})}),a=d+1,l=h)}),i}return t.length&&t.reduce(o),n}function Lp(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)&&Xl(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 Hp(e,t){if(e.node(t).dummy){let n=e.predecessors(t);if(n)return n.find(o=>e.node(o).dummy)}}function Xl(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 Fp(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 Yp(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)||Ul(m,e,r));h>0&&(f=[u[h],...u.slice(0,h),...u.slice(h+1)],d=!0),f.forEach(m=>{var b;let w=o(m);if(w&&w.length){r!=null&&r.includes(m)&&(w=w.filter(g=>Ul(g,e,r)));let C=w.sort((g,E)=>{let T=a[g],B=a[E];return(T!==void 0?T:0)-(B!==void 0?B:0)}),N=(C.length-1)/2;for(let g=Math.floor(N),E=Math.ceil(N);g<=E;++g){let T=C[g];if(T===void 0)continue;let B=a[T];if(B!==void 0&&l[m]===m&&s<B&&a[T]!==c&&!Fp(n,m,T)){let L=i[T];L!==void 0&&(l[T]=m,l[m]=i[m]=L,s=B,d&&(s=-1,c=(b=a[T])!=null?b:-1,d=!1))}}}})}),{root:i,align:l}}function Gp(e,t,n,o,r=!1){let i={},l=jp(e,t,n,r),a=r?"borderLeft":"borderRight";function u(h,m){let b=l.nodes().slice(),w={},C=b.pop();for(;C;){if(w[C])h(C);else{w[C]=!0,b.push(C);for(let N of m(C))b.push(N)}C=b.pop()}}function s(h){let m=l.inEdges(h);m?i[h]=m.reduce((b,w)=>{var C;let N=(C=i[w.v])!=null?C:0,g=l.edge(w);return Math.max(b,N+(g!==void 0?g:0))},0):i[h]=0}function c(h){let m=l.outEdges(h),b=Number.POSITIVE_INFINITY;m&&(b=m.reduce((C,N)=>{let g=i[N.w],E=l.edge(N);return Math.min(C,(g!==void 0?g:0)-(E!==void 0?E:0))},Number.POSITIVE_INFINITY));let w=e.node(h);b!==Number.POSITIVE_INFINITY&&w.borderType!==a&&(i[h]=Math.max(i[h]!==void 0?i[h]:0,b))}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 b=n[h];b!==void 0&&(i[h]=(m=i[b])!=null?m:0)}),i}function jp(e,t,n,o){let r=new Fe,i=e.graph(),l=Kp(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 Xp(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=qp(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 Up(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 Wp(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 Zp(e,t){let n=ln(e),o=Object.assign(Vp(e,n),Lp(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=Yp(e,i,o,d=>(a==="u"?e.predecessors(d):e.successors(d))||[],t),c=Gp(e,i,s.root,s.align,u==="r");u==="r"&&(c=Wn(c,d=>-d)),r[a+u]=c})});let l=Xp(e,r);return Up(r,l),Wp(r,e.graph().align)}function Kp(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 qp(e,t){return e.node(t).width}function Ul(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 Jp(e,t){e=bl(e),Qp(e),Object.entries(Zp(e,t)).forEach(([n,o])=>e.node(n).x=o)}function Qp(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 Wl=new WeakMap;function ev(e,t={}){return Kl(e,kl,t),e}function Zl(e,t,n){let o=t;for(;o!==void 0;){let r=e.parent(o);if(r===n)return o;o=r}}function Kl(e,t,n){var o;let r=e.nodes().filter(N=>e.children(N).length),i={};r.forEach(N=>{let g=e.node(N);if(g&&g.rankdir){let E=new Fe({multigraph:!0,compound:!0});E.setGraph({rankdir:g.rankdir});let T=e.children(N);T.forEach(y=>{let p={...e.node(y)};E.setNode(y,p);let _=e.parent(y);_&&_!==N&&T.includes(_)&&E.setParent(y,_)});let B=new Set;e.edges().forEach(y=>{let p=Zl(e,y.v,N),_=Zl(e,y.w,N);if(p&&_&&p!==_){let M=`${p}\0${_}`;B.has(M)||(B.add(M),E.setEdge(p,_,{...e.edge(y)}))}}),Kl(E,t,n);let L=ea(E);ql(L,t,n,null),Jl(E,L);let P=1/0,j=1/0,G=-1/0,A=-1/0;E.nodes().forEach(y=>{if(y===N)return;let p=E.node(y);p&&typeof p.x=="number"&&typeof p.y=="number"&&typeof p.width=="number"&&typeof p.height=="number"&&(P=Math.min(P,p.x-p.width/2),G=Math.max(G,p.x+p.width/2),j=Math.min(j,p.y-p.height/2),A=Math.max(A,p.y+p.height/2))}),(!isFinite(P)||!isFinite(j)||!isFinite(G)||!isFinite(A))&&(P=j=0,G=A=0);let S=G-P,F=A-j;i[N]={minX:P,minY:j,maxX:G,maxY:A,width:S,height:F,offsetX:P,offsetY:j},g._dagreClusterSubgraph=E}});let l=[],a=N=>{let g=[],E=(e.children(N)||[]).filter(T=>T!==N);for(;E.length>0;){let T=E.shift();g.push(T),(e.children(T)||[]).filter(B=>B!==T).forEach(B=>E.push(B))}return g},u=new Map;r.forEach(N=>{let g=e.node(N);g&&g.rankdir&&i[N]&&u.set(N,(e.children(N)||[]).filter(E=>E!==N))});let s=new Set([...u.values()].flat()),c=new Map;u.forEach((N,g)=>{s.has(g)||c.set(g,a(g))});let d=new Set([...c.values()].flat()),f=N=>{for(let[g,E]of c)if(E.includes(N))return g;return N},h=[];e.edges().forEach(N=>{(d.has(N.v)||d.has(N.w))&&h.push({edge:N,label:e.edge(N)})});let m=new Map;d.forEach(N=>{let g=e.parent(N);m.set(N,typeof g=="string"?g:void 0)}),c.forEach((N,g)=>{let E=e.node(g),T=[];N.forEach(P=>{let j=e.node(P);j&&(T.push({id:P,node:j,parent:m.get(P)}),e.removeNode(P))});let B=h.filter(({edge:P})=>N.includes(P.v)||N.includes(P.w)),L=i[g];E&&(l.push({clusterId:g,subgraph:E._dagreClusterSubgraph,bounds:L,children:N,removedNodes:T,removedEdges:B}),E.width=L.width,E.height=L.height)});let b=new Set;h.forEach(({edge:N,label:g})=>{let E=f(N.v),T=f(N.w);if(E!==T&&e.hasNode(E)&&e.hasNode(T)){let B=`${E}\0${T}`;b.has(B)||(b.add(B),e.setEdge(E,T,{...g,width:0,height:0}))}});let w=ea(e),C=ql(w,t,n,(o=Wl.get(e))!=null?o:null);Wl.set(e,C),Jl(e,w),b.forEach(N=>{let g=N.indexOf("\0"),E=N.slice(0,g),T=N.slice(g+1);e.hasEdge(E,T)&&e.removeEdge(E,T)}),l.forEach(({clusterId:N,subgraph:g,bounds:E,removedNodes:T,removedEdges:B})=>{var L,P;let j=e.node(N),G=(L=j?.x)!=null?L:0,A=(P=j?.y)!=null?P:0,S=(E.minX+E.maxX)/2,F=(E.minY+E.maxY)/2;T.forEach(({id:y,node:p,parent:_})=>{e.setNode(y,p),_!==void 0&&e.setParent(y,_)}),B.forEach(({edge:y,label:p})=>{e.setEdge(y,p)}),g.nodes().forEach(y=>{if(y===N)return;let p=g.node(y),_=e.node(y);_&&p&&typeof p.x=="number"&&typeof p.y=="number"&&(_.x=G+(p.x-S),_.y=A+(p.y-F))}),delete j._dagreClusterSubgraph}),r.forEach(N=>{var g,E;let T=e.node(N),B=i[N];if(T&&T.rankdir&&T._dagreClusterSubgraph&&B){let L=T._dagreClusterSubgraph,P=(g=T.x)!=null?g:0,j=(E=T.y)!=null?E:0,G=(B.minX+B.maxX)/2,A=(B.minY+B.maxY)/2;L.nodes().forEach(S=>{if(S===N)return;let F=L.node(S),y=e.node(S);if(y&&F&&typeof F.x=="number"&&typeof F.y=="number"){let p=F.x-G,_=F.y-A;y.x=P+p,y.y=j+_}}),delete T._dagreClusterSubgraph}})}function ql(e,t,n,o=null){var r,i;let l=n?.useDynamic!==!1,a=l&&(r=o?.graph)!=null?r:null,u=l&&(i=o?.rawNodes)!=null?i:null;t(" makeSpaceForEdgeLabels",()=>sv(e)),t(" removeSelfEdges",()=>mv(e)),t(" acyclic",()=>Yg(e,a)),t(" nestingGraph.run",()=>gp(e)),t(" rank",()=>lp(bl(e))),t(" injectEdgeLabelProxies",()=>uv(e)),t(" removeEmptyRanks",()=>$g(e)),t(" nestingGraph.cleanup",()=>mp(e)),t(" normalizeRanks",()=>Cg(e)),t(" assignRankMinMax",()=>cv(e)),t(" removeEdgeLabelProxies",()=>dv(e)),t(" normalize.run",()=>Ug(e)),t(" parentDummyChains",()=>cp(e)),t(" addBorderSegments",()=>_p(e)),t(" order",()=>Yl(e,n,u)),t(" insertSelfEdges",()=>_v(e)),t(" adjustCoordinateSystem",()=>wp(e)),t(" position",()=>Jp(e,n.corePath)),t(" positionSelfEdges",()=>yv(e));let s=JSON.parse(JSON.stringify(e._nodes));return t(" removeBorderNodes",()=>vv(e)),t(" normalize.undo",()=>Zg(e)),t(" fixupEdgeLabelCoords",()=>gv(e)),t(" undoCoordinateSystem",()=>bp(e)),t(" translateGraph",()=>fv(e)),t(" assignNodeIntersects",()=>hv(e)),t(" reversePoints",()=>pv(e)),t(" acyclic.undo",()=>jg(e)),{graph:e,rawNodes:s}}function Jl(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 tv=["nodesep","edgesep","ranksep","marginx","marginy"],nv={ranksep:50,edgesep:20,nodesep:50,rankdir:"TB",rankalign:"center"},ov=["acyclicer","ranker","rankdir","align","rankalign"],rv=["width","height","rank"],Ql={width:0,height:0},iv=["minlen","weight","width","height","labeloffset"],lv={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},av=["labelpos"];function ea(e){let t=new Fe({multigraph:!0,compound:!0}),n=Ko(e.graph());return t.setGraph(Object.assign({},nv,Zo(n,tv),Un(n,ov))),e.nodes().forEach(o=>{let r=Ko(e.node(o)),i=Zo(r,rv);Object.keys(Ql).forEach(a=>{i[a]===void 0&&(i[a]=Ql[a])}),t.setNode(o,i);let l=e.parent(o);l!==void 0&&t.setParent(o,l)}),e.edges().forEach(o=>{let r=Ko(e.edge(o));t.setEdge(o,Object.assign({},lv,Zo(r,iv),Un(r,av)))}),t}function sv(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 uv(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 cv(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 dv(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 fv(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 hv(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(xl(o,i)),n.points.push(xl(r,l))})}function gv(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 pv(e){e.edges().forEach(t=>{let n=e.edge(t);n.reversed&&n.points.reverse()})}function vv(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 mv(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 _v(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 yv(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 Zo(e,t){return Wn(Un(e,t),Number)}function Ko(e){let t={};return e&&Object.entries(e).forEach(([n,o])=>{typeof n=="string"&&(n=n.toLowerCase()),t[n]=o}),t}function wv(e){let t=ln(e),n=new Fe({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 bv={graphlib:dl,version:Pg,layout:ev,debug:wv,util:{time:Og,notime:kl}},qo=bv;function xv(){const{findNode:e}=Ee(),t=xe(new qo.graphlib.Graph),n=xe("LR");function o(r,i,l){const a=new qo.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,qo.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 Ev={class:"interface-flow-chart"},Nv={class:"docs-overlay"},Sv={href:"/tools/staticdocs/docs/tools/cmd-tlm-server#data-flows-tab",target:"_blank",class:"docs-link"},kv={key:1,class:"empty-state"},Cv=50,ta=50,$v=10,Iv=6.5,Mv=40,Ov=60,Dv=98,Tv=148,gm=na("_",{__name:"InterfaceFlowChart",props:{interfaceDetails:{type:Array,default:()=>[]},routerDetails:{type:Array,default:()=>[]}},setup(e){const{layout:t}=xv(),{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 fr,m=e,b=xe([]),w=xe([]);let C=!1,N=!1;function g(p,_=!1){(C||_)&&(b.value=t(b.value,w.value,p),C=!1,N=!1,ze(()=>{u()}))}n(p=>{let _=p.source.startsWith("interface__"),M=p.target.startsWith("interface__"),z=p.source.startsWith("router__"),R=p.target.startsWith("router__"),V=p.source.startsWith("cosmos__"),H=p.target.startsWith("cosmos__"),U=p.source.startsWith("target__"),ne=p.target.startsWith("target__"),fe=p.sourceHandle.split("__")[1],O=p.targetHandle.split("__")[1];if(fe!==O||_&&M||z&&R||z&&M||_&&R||V&&H||U&&ne||V&&ne||U&&H)return;let D="";V&&(D=D+`cosmos__${p.source.split("__")[1]}`),H&&(D=D+`cosmos__${p.target.split("__")[1]}`),D.length==0&&(_&&(D=D+`interface__${p.source.split("__")[1]}`),M&&(D=D+`interface__${p.target.split("__")[1]}`),z&&(D=D+`router__${p.source.split("__")[1]}`),R&&(D=D+`router__${p.target.split("__")[1]}`)),D.startsWith("cosmos__")&&(_&&(D=D+`__interface__${p.source.split("__")[1]}`),M&&(D=D+`__interface__${p.target.split("__")[1]}`),z&&(D=D+`__router__${p.source.split("__")[1]}`),R&&(D=D+`__router__${p.target.split("__")[1]}`)),U&&(D=D+`__target__${p.source.split("__")[1]}`),ne&&(D=D+`__target__${p.target.split("__")[1]}`),D=D+`__${fe}`,p.id=D;let X=!1;if(w.value.forEach(x=>{x.id===D&&(X=!0)}),X)return;let Y="",oe="",re="",ge=D.split("__"),se=ge[0],ae=ge[4];se==="cosmos"?(oe=ge[1],Y=ge[2],re=ge[3],ae=="cmd"?(p.type="default",p.label="CMD Enable",p.markerStart={type:"arrowclosed"}):(p.type="default",p.label="Tlm Enable",p.markerEnd={type:"arrowclosed"}),Y==="interface"?h.interface_target_enable(re,oe,ae==="cmd",ae==="tlm").then(x=>{o(p),w.value.push(p)}):h.router_target_enable(re,oe,ae==="cmd",ae==="tlm").then(x=>{o(p),w.value.push(p)})):(Y=ge[0],re=ge[1],oe=ge[3],ae=="cmd"?(p.type="default",p.label="CMD Map",p.markerStart={type:"arrowclosed"}):(p.type="default",p.label="Tlm Map",p.markerEnd={type:"arrowclosed"}),Y==="interface"?f.confirm(`${p.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(p),w.value.push(p)})}):f.confirm(`${p.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(()=>{o(p),w.value.push(p)})}))}),r(p=>{const _=[];for(const M of p)M.type!=="remove"&&_.push(M),M.type==="dimensions"&&N&&(C=!0,ze(()=>{g("LR")}));i(_)}),l(p=>{const _=[];for(const M of p)if(M.type!=="remove")_.push(M);else{let z="",R="",V="",H="",U="",ne=M.id.split("__"),fe=ne[0],O=ne[4];fe==="cosmos"?(V=ne[1],H=ne[2],U=ne[3],z=`Disable ${V} ${O} with ${H} ${U}?`,R="Disable"):(H=ne[0],U=ne[1],V=ne[3],z=`Unmap ${V} ${O} with ${H} ${U}? Note this will cause the ${H} to restart.`,R="Unmap"),f.confirm(z,{okText:R,cancelText:"Cancel"}).then(()=>{fe=="cosmos"?H=="interface"?h.interface_target_disable(U,V,O==="cmd",O==="tlm").then(()=>{a([M]),w.value.forEach((D,X)=>{D.id===M.id&&w.value.splice(X,1)})}):h.router_target_disable(U,V,O==="cmd",O==="tlm").then(()=>{a([M]),w.value.forEach((D,X)=>{D.id===M.id&&w.value.splice(X,1)})}):H=="interface"?h.unmap_target_from_interface(V,U,O==="cmd",O==="tlm").then(()=>{a([M]),w.value.forEach((D,X)=>{D.id===M.id&&w.value.splice(X,1)})}):h.unmap_target_from_router(V,U,O==="cmd",O==="tlm").then(()=>{a([M]),w.value.forEach((D,X)=>{D.id===M.id&&w.value.splice(X,1)})})})}a(_)});function E(p,_=!1){const M=p.map((R,V)=>{let H=R.name;H.slice(-8)==="Protocol"&&(H=H.slice(0,-8));const U=Math.ceil(Math.max(Ov,Mv+H.length*Iv));return{label:H,width:U,index:V}});_&&M.reverse();let z=Cv;return M.forEach(R=>{R.x=z,z+=R.width+$v}),M}function T(p){if(p.length===0)return 0;const _=p[p.length-1];return _.x+_.width}function B(p){const _=E(p.write_protocols||[]),M=E(p.read_protocols||[],!0),z=Math.max(200,T(_)+ta,T(M)+ta);return{writeRow:_,readRow:M,width:z}}function L(p,_,M){[{type:"write-protocol",row:M.writeRow,y:Dv},{type:"read-protocol",row:M.readRow,y:Tv}].forEach(({type:R,row:V,y:H})=>{V.forEach(U=>{b.value.push({id:`${R}__${p}__${_}__${U.index}`,type:R,position:{x:U.x,y:H},data:{index:U.index,[p]:_,label:U.label,width:U.width},draggable:!1,parentNode:`${p}__${_}`,extent:"parent"})})})}const P=xe(!1),j=xe(null),G=xe(null),A=xe(null),S=xe(null);function F(p){p.node.type==="interface"?(j.value="Interface",G.value=m.interfaceDetails[p.node.data.label],A.value=null,S.value=null,P.value=!0):p.node.type=="router"?(j.value="Router",G.value=m.routerDetails[p.node.data.label],A.value=null,S.value=null,P.value=!0):(p.node.type==="read-protocol"||p.node.type=="write-protocol")&&(p.node.data.interface?(j.value="Interface",G.value=m.interfaceDetails[p.node.data.interface]):(j.value="Router",G.value=m.routerDetails[p.node.data.router]),p.node.type==="write-protocol"?(A.value=p.node.data.index,S.value=null):(A.value=null,S.value=p.node.data.index),P.value=!0)}function y(){const p=new Set(b.value.map(O=>O.id)),_=new Map,M=p.size>0?c():null;b.value.forEach(O=>{const D=s(O.id);D&&_.set(O.id,{x:D.position.x,y:D.position.y})}),b.value=[],w.value=[];const z=[];let R=m.interfaceDetails||{};for(const O in R){(m.interfaceDetails[O].cmd_target_names||[]).forEach(Y=>{z.includes(Y)||z.push(Y);const oe={id:`interface__${O}__target__${Y}__cmd`,source:`interface__${O}`,target:`target__${Y}`,sourceHandle:"interface__cmd__output",targetHandle:"target__cmd",type:"default",label:"CMD Map",markerEnd:{type:"arrowclosed"}};w.value.push(oe)});for(const[Y,oe]of Object.entries(m.interfaceDetails[O].cmd_target_enabled)){if(Y==="UNKNOWN"||!oe)continue;const re={id:`cosmos__${Y}__interface__${O}__cmd`,target:`interface__${O}`,source:`cosmos__${Y}`,sourceHandle:"cosmos__cmd",targetHandle:"interface__cmd__input",type:"default",label:"CMD Enable",markerEnd:{type:"arrowclosed"}};w.value.push(re)}(m.interfaceDetails[O].tlm_target_names||[]).forEach(Y=>{z.includes(Y)||z.push(Y);const oe={id:`interface__${O}__target__${Y}__tlm`,source:`interface__${O}`,target:`target__${Y}`,sourceHandle:"interface__tlm__output",targetHandle:"target__tlm",type:"default",label:"TLM Map",markerStart:{type:"arrowclosed"}};w.value.push(oe)});for(const[Y,oe]of Object.entries(m.interfaceDetails[O].tlm_target_enabled)){if(Y==="UNKNOWN"||!oe)continue;const re={id:`cosmos__${Y}__interface__${O}__tlm`,target:`interface__${O}`,source:`cosmos__${Y}`,sourceHandle:"cosmos__tlm",targetHandle:"interface__tlm__input",type:"default",label:"TLM Enable",markerStart:{type:"arrowclosed"}};w.value.push(re)}}let V=m.routerDetails||{};for(const O in V){(m.routerDetails[O].cmd_target_names||[]).forEach(Y=>{z.includes(Y)||z.push(Y);const oe={id:`router__${O}__target__${Y}__cmd`,source:`router__${O}`,target:`target__${Y}`,sourceHandle:"router__cmd__output",targetHandle:"target__cmd",type:"default",label:"CMD Map",markerEnd:{type:"arrowclosed"}};w.value.push(oe)});for(const[Y,oe]of Object.entries(m.routerDetails[O].cmd_target_enabled)){if(Y==="UNKNOWN"||!oe)continue;const re={id:`cosmos__${Y}__router__${O}__cmd`,target:`router__${O}`,source:`cosmos__${Y}`,sourceHandle:"cosmos__cmd",targetHandle:"router__cmd__input",type:"default",label:"CMD Enable",markerEnd:{type:"arrowclosed"}};w.value.push(re)}(m.routerDetails[O].tlm_target_names||[]).forEach(Y=>{z.includes(Y)||z.push(Y);const oe={id:`router__${O}__target__${Y}__tlm`,source:`router__${O}`,target:`target__${Y}`,sourceHandle:"router__tlm__output",targetHandle:"target__tlm",type:"default",label:"TLM Map",markerStart:{type:"arrowclosed"}};w.value.push(oe)});for(const[Y,oe]of Object.entries(m.routerDetails[O].tlm_target_enabled)){if(Y==="UNKNOWN"||!oe)continue;const re={id:`cosmos__${Y}__router__${O}__tlm`,target:`router__${O}`,source:`cosmos__${Y}`,sourceHandle:"cosmos__tlm",targetHandle:"router__tlm__input",type:"default",label:"TLM Enable",markerStart:{type:"arrowclosed"}};w.value.push(re)}}z.forEach((O,D)=>{let X,Y;X=0,Y=D*250;const oe={id:`cosmos__${O}`,type:"cosmos",position:{x:X,y:Y},data:{label:O},draggable:!0};b.value.push(oe)});let H=0,U=200;for(const O in R){const D=B(m.interfaceDetails[O]);D.width>U&&(U=D.width);const X=200,Y={id:`interface__${O}`,type:"interface",position:{x:400,y:(X+50)*H},data:{label:O,width:D.width,height:X},draggable:!0};b.value.push(Y),H+=1,L("interface",O,D)}for(const O in V){const D=B(m.routerDetails[O]);D.width>U&&(U=D.width);const X=200,Y={id:`router__${O}`,type:"router",position:{x:400,y:(X+50)*H},data:{label:O,width:D.width,height:X},draggable:!0};b.value.push(Y),H+=1,L("router",O,D)}z.forEach((O,D)=>{let X,Y;X=400+U+200,Y=D*250;const oe={id:`target__${O}`,type:"target",position:{x:X,y:Y},data:{label:O},draggable:!0};b.value.push(oe)});const ne=new Set(b.value.map(O=>O.id));p.size===0||p.size!==ne.size||[...ne].some(O=>!p.has(O))||[...p].some(O=>!ne.has(O))?(N=!0,C=!0):N||(b.value=b.value.map(O=>{const D=_.get(O.id);return D?{...O,position:D}:O}),M&&ze(()=>{d(M)}))}return _e(()=>m.interfaceDetails,()=>{m.interfaceDetails!==null&&y()},{immediate:!0}),_e(()=>m.routerDetails,()=>{m.routerDetails!==null&&y()},{immediate:!0}),(p,_)=>{const M=Se("v-icon"),z=Se("v-dialog");return Q(),de("div",Ev,[b.value.length>0?(Q(),Ie(q(Ff),{key:0,nodes:b.value,edges:w.value,"max-zoom":4,"min-zoom":.01,class:"vue-flow-container","elevate-edges-on-select":"","apply-default":!1,onNodeClick:F},{"node-interface":me(({data:R})=>[le(Mh,{data:R},null,8,["data"])]),"node-router":me(({data:R})=>[le(Ph,{data:R},null,8,["data"])]),"node-target":me(({data:R})=>[le(Gh,{data:R},null,8,["data"])]),"node-cosmos":me(R=>[le(Vh,sr(ur(R)),null,16)]),"node-write-protocol":me(({data:R})=>[le(Wh,{data:R},null,8,["data"])]),"node-read-protocol":me(({data:R})=>[le(Jh,{data:R},null,8,["data"])]),default:me(()=>[le(q(wh),{"pattern-color":"#aaa",gap:16}),ce("div",Nv,[ce("a",Sv,[le(M,{size:"small",class:"mr-1"},{default:me(()=>[..._[3]||(_[3]=[Be("mdi-file-document-outline",-1)])]),_:1}),_[4]||(_[4]=Be(" Docs ",-1))])]),le(q(gh),null,{default:me(()=>[le(q(on),{title:"Reset",onClick:_[0]||(_[0]=R=>g("LR",!0))},{default:me(()=>[..._[5]||(_[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"])):(Q(),de("div",kv,[le(M,{size:"large",color:"grey"},{default:me(()=>[..._[6]||(_[6]=[Be("mdi-lan-disconnect",-1)])]),_:1}),_[7]||(_[7]=ce("div",{class:"text-grey mt-2"},"Nothing to show",-1))])),le(z,{modelValue:P.value,"onUpdate:modelValue":_[2]||(_[2]=R=>P.value=R),"max-width":"80vw","max-height":"80vh"},{default:me(()=>[le(kh,{mode:j.value,details:G.value,"read-protocol-index":S.value,"write-protocol-index":A.value,onClose:_[1]||(_[1]=R=>P.value=!1)},null,8,["mode","details","read-protocol-index","write-protocol-index"])]),_:1},8,["modelValue"])])}}})})}}));
|