-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvue-flow-core.iife.mjs
9 lines (9 loc) · 156 KB
/
vue-flow-core.iife.mjs
1
2
3
4
5
6
7
8
9
/**
* Minified by jsDelivr using Terser v5.19.0.
* Original file: /npm/@vue-flow/core@1.22.2/dist/vue-flow-core.iife.js
*
* Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
*/
var VueFlowCore=function(e,t){"use strict";function n(e){return!!t.getCurrentScope()&&(t.onScopeDispose(e),!0)}function o(e){return"function"==typeof e?e():t.unref(e)}const r=typeof window<"u",l=()=>{};const i=e=>e();function a(e,t=!1,n="Timeout"){return new Promise(((o,r)=>{setTimeout(t?()=>r(n):o,e)}))}function u(...e){if(1!==e.length)return t.toRef(...e);const n=e[0];return"function"==typeof n?t.readonly(t.customRef((()=>({get:n,set:l})))):t.ref(n)}var s=Object.defineProperty,c=Object.defineProperties,d=Object.getOwnPropertyDescriptors,f=Object.getOwnPropertySymbols,h=Object.prototype.hasOwnProperty,p=Object.prototype.propertyIsEnumerable,v=(e,t,n)=>t in e?s(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,g=(e,t)=>{for(var n in t||(t={}))h.call(t,n)&&v(e,n,t[n]);if(f)for(var n of f(t))p.call(t,n)&&v(e,n,t[n]);return e},m=(e,t)=>c(e,d(t));function y(e){if(!t.isRef(e))return t.toRefs(e);const n=Array.isArray(e.value)?new Array(e.value.length):{};for(const o in e.value)n[o]=t.customRef((()=>({get:()=>e.value[o],set(t){if(Array.isArray(e.value)){const n=[...e.value];n[o]=t,e.value=n}else{const n=m(g({},e.value),{[o]:t});Object.setPrototypeOf(n,e.value),e.value=n}}})));return n}function w(e,n=!1){function r(r,{flush:l="sync",deep:i=!1,timeout:u,throwOnTimeout:s}={}){let c=null;const d=[new Promise((o=>{c=t.watch(e,(e=>{r(e)!==n&&(null==c||c(),o(e))}),{flush:l,deep:i,immediate:!0})}))];return null!=u&&d.push(a(u,s).then((()=>o(e))).finally((()=>null==c?void 0:c()))),Promise.race(d)}function l(l,i){if(!t.isRef(l))return r((e=>e===l),i);const{flush:u="sync",deep:s=!1,timeout:c,throwOnTimeout:d}=i??{};let f=null;const h=[new Promise((o=>{f=t.watch([e,l],(([e,t])=>{n!==(e===t)&&(null==f||f(),o(e))}),{flush:u,deep:s,immediate:!0})}))];return null!=c&&h.push(a(c,d).then((()=>o(e))).finally((()=>(null==f||f(),o(e))))),Promise.race(h)}function i(e){return u(1,e)}function u(e=1,t){let n=-1;return r((()=>(n+=1,n>=e)),t)}return Array.isArray(o(e))?{toMatch:r,toContains:function(e,t){return r((t=>{const n=Array.from(t);return n.includes(e)||n.includes(o(e))}),t)},changed:i,changedTimes:u,get not(){return w(e,!n)}}:{toMatch:r,toBe:l,toBeTruthy:function(e){return r((e=>!!e),e)},toBeNull:function(e){return l(null,e)},toBeNaN:function(e){return r(Number.isNaN,e)},toBeUndefined:function(e){return l(void 0,e)},changed:i,changedTimes:u,get not(){return w(e,!n)}}}function b(e){return w(e)}var x=Object.getOwnPropertySymbols,E=Object.prototype.hasOwnProperty,_=Object.prototype.propertyIsEnumerable,S=(e,t)=>{var n={};for(var o in e)E.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&x)for(var o of x(e))t.indexOf(o)<0&&_.call(e,o)&&(n[o]=e[o]);return n};function k(e,n,o={}){const r=o,{eventFilter:l=i}=r,a=S(r,["eventFilter"]);return t.watch(e,function(e,t){return function(...n){return new Promise(((o,r)=>{Promise.resolve(e((()=>t.apply(this,n)),{fn:t,thisArg:this,args:n})).then(o).catch(r)}))}}(l,n),a)}var N=Object.defineProperty,C=Object.defineProperties,M=Object.getOwnPropertyDescriptors,B=Object.getOwnPropertySymbols,P=Object.prototype.hasOwnProperty,O=Object.prototype.propertyIsEnumerable,T=(e,t,n)=>t in e?N(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,I=(e,t)=>{for(var n in t||(t={}))P.call(t,n)&&T(e,n,t[n]);if(B)for(var n of B(t))O.call(t,n)&&T(e,n,t[n]);return e},z=(e,t)=>C(e,M(t)),A=(e,t)=>{var n={};for(var o in e)P.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&B)for(var o of B(e))t.indexOf(o)<0&&O.call(e,o)&&(n[o]=e[o]);return n};function $(e,n,o={}){const r=o,{eventFilter:l}=r,a=A(r,["eventFilter"]),{eventFilter:u,pause:s,resume:c,isActive:d}=function(e=i){const n=t.ref(!0);return{isActive:t.readonly(n),pause:function(){n.value=!1},resume:function(){n.value=!0},eventFilter:(...t)=>{n.value&&e(...t)}}}(l);return{stop:k(e,n,z(I({},a),{eventFilter:u})),pause:s,resume:c,isActive:d}}function D(e){var t;const n=o(e);return null!=(t=null==n?void 0:n.$el)?t:n}const R=r?window:void 0;function V(...e){let r,i,a,u;if("string"==typeof e[0]||Array.isArray(e[0])?([i,a,u]=e,r=R):[r,i,a,u]=e,!r)return l;Array.isArray(i)||(i=[i]),Array.isArray(a)||(a=[a]);const s=[],c=()=>{s.forEach((e=>e())),s.length=0},d=t.watch((()=>[D(r),o(u)]),(([e,t])=>{c(),e&&s.push(...i.flatMap((n=>a.map((o=>((e,t,n,o)=>(e.addEventListener(t,n,o),()=>e.removeEventListener(t,n,o)))(e,n,o,t))))))}),{immediate:!0,flush:"post"}),f=()=>{d(),c()};return n(f),f}function L(...e){let t,n,r={};3===e.length?(t=e[0],n=e[1],r=e[2]):2===e.length?"object"==typeof e[1]?(t=!0,n=e[0],r=e[1]):(t=e[0],n=e[1]):(t=!0,n=e[0]);const{target:l=R,eventName:i="keydown",passive:a=!1,dedupe:u=!1}=r,s=function(e){return"function"==typeof e?e:"string"==typeof e?t=>t.key===e:Array.isArray(e)?t=>e.includes(t.key):()=>!0}(t);return V(l,i,(e=>{e.repeat&&o(u)||s(e)&&n(e)}),a)}function H(e){const n=function(){const e=t.ref(!1);return t.getCurrentInstance()&&t.onMounted((()=>{e.value=!0})),e}();return t.computed((()=>(n.value,!!e())))}var Y=Object.getOwnPropertySymbols,F=Object.prototype.hasOwnProperty,G=Object.prototype.propertyIsEnumerable;function X(e,o,r={}){const l=r,{window:i=R}=l,a=((e,t)=>{var n={};for(var o in e)F.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&Y)for(var o of Y(e))t.indexOf(o)<0&&G.call(e,o)&&(n[o]=e[o]);return n})(l,["window"]);let u;const s=H((()=>i&&"ResizeObserver"in i)),c=()=>{u&&(u.disconnect(),u=void 0)},d=t.computed((()=>Array.isArray(e)?e.map((e=>D(e))):[D(e)])),f=t.watch(d,(e=>{if(c(),s.value&&i){u=new ResizeObserver(o);for(const t of e)t&&u.observe(t,a)}}),{immediate:!0,flush:"post",deep:!0}),h=()=>{c(),f()};return n(h),{isSupported:s,stop:h}}function j(e,n,o,r={}){var l,i,a;const{clone:u=!1,passive:s=!1,eventName:c,deep:d=!1,defaultValue:f,shouldEmit:h}=r,p=t.getCurrentInstance(),v=o||(null==p?void 0:p.emit)||(null==(l=null==p?void 0:p.$emit)?void 0:l.bind(p))||(null==(a=null==(i=null==p?void 0:p.proxy)?void 0:i.$emit)?void 0:a.bind(null==p?void 0:p.proxy));let g=c;n||(n="modelValue"),g=c||g||`update:${n.toString()}`;const m=e=>u?"function"==typeof u?u(e):function(e){return JSON.parse(JSON.stringify(e))}(e):e,y=()=>(e=>typeof e<"u")(e[n])?m(e[n]):f,w=e=>{h?h(e)&&v(g,e):v(g,e)};if(s){const o=y(),r=t.ref(o);return t.watch((()=>e[n]),(e=>r.value=m(e))),t.watch(r,(t=>{(t!==e[n]||d)&&w(t)}),{deep:d}),r}return t.computed({get:()=>y(),set(e){w(e)}})}var U={value:()=>{}};function Z(){for(var e,t=0,n=arguments.length,o={};t<n;++t){if(!(e=arguments[t]+"")||e in o||/[\s.]/.test(e))throw new Error("illegal type: "+e);o[e]=[]}return new q(o)}function q(e){this._=e}function K(e,t){for(var n,o=0,r=e.length;o<r;++o)if((n=e[o]).name===t)return n.value}function W(e,t,n){for(var o=0,r=e.length;o<r;++o)if(e[o].name===t){e[o]=U,e=e.slice(0,o).concat(e.slice(o+1));break}return null!=n&&e.push({name:t,value:n}),e}q.prototype=Z.prototype={constructor:q,on:function(e,t){var n,o=this._,r=function(e,t){return e.trim().split(/^|\s+/).map((function(e){var n="",o=e.indexOf(".");if(o>=0&&(n=e.slice(o+1),e=e.slice(0,o)),e&&!t.hasOwnProperty(e))throw new Error("unknown type: "+e);return{type:e,name:n}}))}(e+"",o),l=-1,i=r.length;if(!(arguments.length<2)){if(null!=t&&"function"!=typeof t)throw new Error("invalid callback: "+t);for(;++l<i;)if(n=(e=r[l]).type)o[n]=W(o[n],e.name,t);else if(null==t)for(n in o)o[n]=W(o[n],e.name,null);return this}for(;++l<i;)if((n=(e=r[l]).type)&&(n=K(o[n],e.name)))return n},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new q(e)},call:function(e,t){if((n=arguments.length-2)>0)for(var n,o,r=new Array(n),l=0;l<n;++l)r[l]=arguments[l+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(l=0,n=(o=this._[e]).length;l<n;++l)o[l].value.apply(t,r)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var o=this._[e],r=0,l=o.length;r<l;++r)o[r].value.apply(t,n)}};var J="http://www.w3.org/1999/xhtml";const Q={svg:"http://www.w3.org/2000/svg",xhtml:J,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function ee(e){var t=e+="",n=t.indexOf(":");return n>=0&&"xmlns"!==(t=e.slice(0,n))&&(e=e.slice(n+1)),Q.hasOwnProperty(t)?{space:Q[t],local:e}:e}function te(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===J&&t.documentElement.namespaceURI===J?t.createElement(e):t.createElementNS(n,e)}}function ne(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function oe(e){var t=ee(e);return(t.local?ne:te)(t)}function re(){}function le(e){return null==e?re:function(){return this.querySelector(e)}}function ie(){return[]}function ae(e){return null==e?ie:function(){return this.querySelectorAll(e)}}function ue(e){return function(){return function(e){return null==e?[]:Array.isArray(e)?e:Array.from(e)}(e.apply(this,arguments))}}function se(e){return function(){return this.matches(e)}}function ce(e){return function(t){return t.matches(e)}}var de=Array.prototype.find;function fe(){return this.firstElementChild}var he=Array.prototype.filter;function pe(){return Array.from(this.children)}function ve(e){return new Array(e.length)}function ge(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}function me(e,t,n,o,r,l){for(var i,a=0,u=t.length,s=l.length;a<s;++a)(i=t[a])?(i.__data__=l[a],o[a]=i):n[a]=new ge(e,l[a]);for(;a<u;++a)(i=t[a])&&(r[a]=i)}function ye(e,t,n,o,r,l,i){var a,u,s,c=new Map,d=t.length,f=l.length,h=new Array(d);for(a=0;a<d;++a)(u=t[a])&&(h[a]=s=i.call(u,u.__data__,a,t)+"",c.has(s)?r[a]=u:c.set(s,u));for(a=0;a<f;++a)s=i.call(e,l[a],a,l)+"",(u=c.get(s))?(o[a]=u,u.__data__=l[a],c.delete(s)):n[a]=new ge(e,l[a]);for(a=0;a<d;++a)(u=t[a])&&c.get(h[a])===u&&(r[a]=u)}function we(e){return e.__data__}function be(e){return"object"==typeof e&&"length"in e?e:Array.from(e)}function xe(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function Ee(e){return function(){this.removeAttribute(e)}}function _e(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Se(e,t){return function(){this.setAttribute(e,t)}}function ke(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function Ne(e,t){return function(){var n=t.apply(this,arguments);null==n?this.removeAttribute(e):this.setAttribute(e,n)}}function Ce(e,t){return function(){var n=t.apply(this,arguments);null==n?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function Me(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function Be(e){return function(){this.style.removeProperty(e)}}function Pe(e,t,n){return function(){this.style.setProperty(e,t,n)}}function Oe(e,t,n){return function(){var o=t.apply(this,arguments);null==o?this.style.removeProperty(e):this.style.setProperty(e,o,n)}}function Te(e,t){return e.style.getPropertyValue(t)||Me(e).getComputedStyle(e,null).getPropertyValue(t)}function Ie(e){return function(){delete this[e]}}function ze(e,t){return function(){this[e]=t}}function Ae(e,t){return function(){var n=t.apply(this,arguments);null==n?delete this[e]:this[e]=n}}function $e(e){return e.trim().split(/^|\s+/)}function De(e){return e.classList||new Re(e)}function Re(e){this._node=e,this._names=$e(e.getAttribute("class")||"")}function Ve(e,t){for(var n=De(e),o=-1,r=t.length;++o<r;)n.add(t[o])}function Le(e,t){for(var n=De(e),o=-1,r=t.length;++o<r;)n.remove(t[o])}function He(e){return function(){Ve(this,e)}}function Ye(e){return function(){Le(this,e)}}function Fe(e,t){return function(){(t.apply(this,arguments)?Ve:Le)(this,e)}}function Ge(){this.textContent=""}function Xe(e){return function(){this.textContent=e}}function je(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function Ue(){this.innerHTML=""}function Ze(e){return function(){this.innerHTML=e}}function qe(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function Ke(){this.nextSibling&&this.parentNode.appendChild(this)}function We(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Je(){return null}function Qe(){var e=this.parentNode;e&&e.removeChild(this)}function et(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function tt(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function nt(e){return function(){var t=this.__on;if(t){for(var n,o=0,r=-1,l=t.length;o<l;++o)n=t[o],e.type&&n.type!==e.type||n.name!==e.name?t[++r]=n:this.removeEventListener(n.type,n.listener,n.options);++r?t.length=r:delete this.__on}}}function ot(e,t,n){return function(){var o,r=this.__on,l=function(e){return function(t){e.call(this,t,this.__data__)}}(t);if(r)for(var i=0,a=r.length;i<a;++i)if((o=r[i]).type===e.type&&o.name===e.name)return this.removeEventListener(o.type,o.listener,o.options),this.addEventListener(o.type,o.listener=l,o.options=n),void(o.value=t);this.addEventListener(e.type,l,n),o={type:e.type,name:e.name,value:t,listener:l,options:n},r?r.push(o):this.__on=[o]}}function rt(e,t,n){var o=Me(e),r=o.CustomEvent;"function"==typeof r?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 lt(e,t){return function(){return rt(this,e,t)}}function it(e,t){return function(){return rt(this,e,t.apply(this,arguments))}}ge.prototype={constructor:ge,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)}},Re.prototype={add:function(e){this._names.indexOf(e)<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}};var at=[null];function ut(e,t){this._groups=e,this._parents=t}function st(){return new ut([[document.documentElement]],at)}function ct(e){return"string"==typeof e?new ut([[document.querySelector(e)]],[document.documentElement]):new ut([[e]],at)}function dt(e,t){if(e=function(e){let t;for(;t=e.sourceEvent;)e=t;return e}(e),void 0===t&&(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())).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]}ut.prototype=st.prototype={constructor:ut,select:function(e){"function"!=typeof e&&(e=le(e));for(var t=this._groups,n=t.length,o=new Array(n),r=0;r<n;++r)for(var l,i,a=t[r],u=a.length,s=o[r]=new Array(u),c=0;c<u;++c)(l=a[c])&&(i=e.call(l,l.__data__,c,a))&&("__data__"in l&&(i.__data__=l.__data__),s[c]=i);return new ut(o,this._parents)},selectAll:function(e){e="function"==typeof e?ue(e):ae(e);for(var t=this._groups,n=t.length,o=[],r=[],l=0;l<n;++l)for(var i,a=t[l],u=a.length,s=0;s<u;++s)(i=a[s])&&(o.push(e.call(i,i.__data__,s,a)),r.push(i));return new ut(o,r)},selectChild:function(e){return this.select(null==e?fe:function(e){return function(){return de.call(this.children,e)}}("function"==typeof e?e:ce(e)))},selectChildren:function(e){return this.selectAll(null==e?pe:function(e){return function(){return he.call(this.children,e)}}("function"==typeof e?e:ce(e)))},filter:function(e){"function"!=typeof e&&(e=se(e));for(var t=this._groups,n=t.length,o=new Array(n),r=0;r<n;++r)for(var l,i=t[r],a=i.length,u=o[r]=[],s=0;s<a;++s)(l=i[s])&&e.call(l,l.__data__,s,i)&&u.push(l);return new ut(o,this._parents)},data:function(e,t){if(!arguments.length)return Array.from(this,we);var n=t?ye:me,o=this._parents,r=this._groups;"function"!=typeof e&&(e=function(e){return function(){return e}}(e));for(var l=r.length,i=new Array(l),a=new Array(l),u=new Array(l),s=0;s<l;++s){var c=o[s],d=r[s],f=d.length,h=be(e.call(c,c&&c.__data__,s,o)),p=h.length,v=a[s]=new Array(p),g=i[s]=new Array(p);n(c,d,v,g,u[s]=new Array(f),h,t);for(var m,y,w=0,b=0;w<p;++w)if(m=v[w]){for(w>=b&&(b=w+1);!(y=g[b])&&++b<p;);m._next=y||null}}return(i=new ut(i,o))._enter=a,i._exit=u,i},enter:function(){return new ut(this._enter||this._groups.map(ve),this._parents)},exit:function(){return new ut(this._exit||this._groups.map(ve),this._parents)},join:function(e,t,n){var o=this.enter(),r=this,l=this.exit();return"function"==typeof e?(o=e(o))&&(o=o.selection()):o=o.append(e+""),null!=t&&((r=t(r))&&(r=r.selection())),null==n?l.remove():n(l),o&&r?o.merge(r).order():r},merge:function(e){for(var t=e.selection?e.selection():e,n=this._groups,o=t._groups,r=n.length,l=o.length,i=Math.min(r,l),a=new Array(r),u=0;u<i;++u)for(var s,c=n[u],d=o[u],f=c.length,h=a[u]=new Array(f),p=0;p<f;++p)(s=c[p]||d[p])&&(h[p]=s);for(;u<r;++u)a[u]=n[u];return new ut(a,this._parents)},selection:function(){return this},order:function(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var o,r=e[t],l=r.length-1,i=r[l];--l>=0;)(o=r[l])&&(i&&4^o.compareDocumentPosition(i)&&i.parentNode.insertBefore(o,i),i=o);return this},sort:function(e){function t(t,n){return t&&n?e(t.__data__,n.__data__):!t-!n}e||(e=xe);for(var n=this._groups,o=n.length,r=new Array(o),l=0;l<o;++l){for(var i,a=n[l],u=a.length,s=r[l]=new Array(u),c=0;c<u;++c)(i=a[c])&&(s[c]=i);s.sort(t)}return new ut(r,this._parents).order()},call:function(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this},nodes:function(){return Array.from(this)},node:function(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var o=e[t],r=0,l=o.length;r<l;++r){var i=o[r];if(i)return i}return null},size:function(){let e=0;for(const t of this)++e;return e},empty:function(){return!this.node()},each:function(e){for(var t=this._groups,n=0,o=t.length;n<o;++n)for(var r,l=t[n],i=0,a=l.length;i<a;++i)(r=l[i])&&e.call(r,r.__data__,i,l);return this},attr:function(e,t){var n=ee(e);if(arguments.length<2){var o=this.node();return n.local?o.getAttributeNS(n.space,n.local):o.getAttribute(n)}return this.each((null==t?n.local?_e:Ee:"function"==typeof t?n.local?Ce:Ne:n.local?ke:Se)(n,t))},style:function(e,t,n){return arguments.length>1?this.each((null==t?Be:"function"==typeof t?Oe:Pe)(e,t,n??"")):Te(this.node(),e)},property:function(e,t){return arguments.length>1?this.each((null==t?Ie:"function"==typeof t?Ae:ze)(e,t)):this.node()[e]},classed:function(e,t){var n=$e(e+"");if(arguments.length<2){for(var o=De(this.node()),r=-1,l=n.length;++r<l;)if(!o.contains(n[r]))return!1;return!0}return this.each(("function"==typeof t?Fe:t?He:Ye)(n,t))},text:function(e){return arguments.length?this.each(null==e?Ge:("function"==typeof e?je:Xe)(e)):this.node().textContent},html:function(e){return arguments.length?this.each(null==e?Ue:("function"==typeof e?qe:Ze)(e)):this.node().innerHTML},raise:function(){return this.each(Ke)},lower:function(){return this.each(We)},append:function(e){var t="function"==typeof e?e:oe(e);return this.select((function(){return this.appendChild(t.apply(this,arguments))}))},insert:function(e,t){var n="function"==typeof e?e:oe(e),o=null==t?Je:"function"==typeof t?t:le(t);return this.select((function(){return this.insertBefore(n.apply(this,arguments),o.apply(this,arguments)||null)}))},remove:function(){return this.each(Qe)},clone:function(e){return this.select(e?tt:et)},datum:function(e){return arguments.length?this.property("__data__",e):this.node().__data__},on:function(e,t,n){var o,r,l=function(e){return e.trim().split(/^|\s+/).map((function(e){var t="",n=e.indexOf(".");return n>=0&&(t=e.slice(n+1),e=e.slice(0,n)),{type:e,name:t}}))}(e+""),i=l.length;if(!(arguments.length<2)){for(a=t?ot:nt,o=0;o<i;++o)this.each(a(l[o],t,n));return this}var a=this.node().__on;if(a)for(var u,s=0,c=a.length;s<c;++s)for(o=0,u=a[s];o<i;++o)if((r=l[o]).type===u.type&&r.name===u.name)return u.value},dispatch:function(e,t){return this.each(("function"==typeof t?it:lt)(e,t))},[Symbol.iterator]:function*(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var o,r=e[t],l=0,i=r.length;l<i;++l)(o=r[l])&&(yield o)}};const ft={passive:!1},ht={capture:!0,passive:!1};function pt(e){e.stopImmediatePropagation()}function vt(e){e.preventDefault(),e.stopImmediatePropagation()}function gt(e){var t=e.document.documentElement,n=ct(e).on("dragstart.drag",vt,ht);"onselectstart"in t?n.on("selectstart.drag",vt,ht):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function mt(e,t){var n=e.document.documentElement,o=ct(e).on("dragstart.drag",null);t&&(o.on("click.drag",vt,ht),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 yt=e=>()=>e;function wt(e,{sourceEvent:t,subject:n,target:o,identifier:r,active:l,x:i,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:l,enumerable:!0,configurable:!0},x:{value:i,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}})}function bt(e){return!e.ctrlKey&&!e.button}function xt(){return this.parentNode}function Et(e,t){return t??{x:e.x,y:e.y}}function _t(){return navigator.maxTouchPoints||"ontouchstart"in this}function St(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function kt(e,t){var n=Object.create(e.prototype);for(var o in t)n[o]=t[o];return n}function Nt(){}wt.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};var Ct=.7,Mt=1/Ct,Bt="\\s*([+-]?\\d+)\\s*",Pt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ot="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Tt=/^#([0-9a-f]{3,8})$/,It=new RegExp(`^rgb\\(${Bt},${Bt},${Bt}\\)$`),zt=new RegExp(`^rgb\\(${Ot},${Ot},${Ot}\\)$`),At=new RegExp(`^rgba\\(${Bt},${Bt},${Bt},${Pt}\\)$`),$t=new RegExp(`^rgba\\(${Ot},${Ot},${Ot},${Pt}\\)$`),Dt=new RegExp(`^hsl\\(${Pt},${Ot},${Ot}\\)$`),Rt=new RegExp(`^hsla\\(${Pt},${Ot},${Ot},${Pt}\\)$`),Vt={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};function Lt(){return this.rgb().formatHex()}function Ht(){return this.rgb().formatRgb()}function Yt(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Tt.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?Ft(t):3===n?new jt(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?Gt(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?Gt(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=It.exec(e))?new jt(t[1],t[2],t[3],1):(t=zt.exec(e))?new jt(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=At.exec(e))?Gt(t[1],t[2],t[3],t[4]):(t=$t.exec(e))?Gt(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=Dt.exec(e))?Jt(t[1],t[2]/100,t[3]/100,1):(t=Rt.exec(e))?Jt(t[1],t[2]/100,t[3]/100,t[4]):Vt.hasOwnProperty(e)?Ft(Vt[e]):"transparent"===e?new jt(NaN,NaN,NaN,0):null}function Ft(e){return new jt(e>>16&255,e>>8&255,255&e,1)}function Gt(e,t,n,o){return o<=0&&(e=t=n=NaN),new jt(e,t,n,o)}function Xt(e,t,n,o){return 1===arguments.length?function(e){return e instanceof Nt||(e=Yt(e)),e?new jt((e=e.rgb()).r,e.g,e.b,e.opacity):new jt}(e):new jt(e,t,n,o??1)}function jt(e,t,n,o){this.r=+e,this.g=+t,this.b=+n,this.opacity=+o}function Ut(){return`#${Wt(this.r)}${Wt(this.g)}${Wt(this.b)}`}function Zt(){const e=qt(this.opacity);return`${1===e?"rgb(":"rgba("}${Kt(this.r)}, ${Kt(this.g)}, ${Kt(this.b)}${1===e?")":`, ${e})`}`}function qt(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Kt(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Wt(e){return((e=Kt(e))<16?"0":"")+e.toString(16)}function Jt(e,t,n,o){return o<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new en(e,t,n,o)}function Qt(e){if(e instanceof en)return new en(e.h,e.s,e.l,e.opacity);if(e instanceof Nt||(e=Yt(e)),!e)return new en;if(e instanceof en)return e;var t=(e=e.rgb()).r/255,n=e.g/255,o=e.b/255,r=Math.min(t,n,o),l=Math.max(t,n,o),i=NaN,a=l-r,u=(l+r)/2;return a?(i=t===l?(n-o)/a+6*(n<o):n===l?(o-t)/a+2:(t-n)/a+4,a/=u<.5?l+r:2-l-r,i*=60):a=u>0&&u<1?0:i,new en(i,a,u,e.opacity)}function en(e,t,n,o){this.h=+e,this.s=+t,this.l=+n,this.opacity=+o}function tn(e){return(e=(e||0)%360)<0?e+360:e}function nn(e){return Math.max(0,Math.min(1,e||0))}function on(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}St(Nt,Yt,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Lt,formatHex:Lt,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return Qt(this).formatHsl()},formatRgb:Ht,toString:Ht}),St(jt,Xt,kt(Nt,{brighter(e){return e=null==e?Mt:Math.pow(Mt,e),new jt(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?Ct:Math.pow(Ct,e),new jt(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new jt(Kt(this.r),Kt(this.g),Kt(this.b),qt(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:Ut,formatHex:Ut,formatHex8:function(){return`#${Wt(this.r)}${Wt(this.g)}${Wt(this.b)}${Wt(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:Zt,toString:Zt})),St(en,(function(e,t,n,o){return 1===arguments.length?Qt(e):new en(e,t,n,o??1)}),kt(Nt,{brighter(e){return e=null==e?Mt:Math.pow(Mt,e),new en(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?Ct:Math.pow(Ct,e),new en(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+360*(this.h<0),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 jt(on(e>=240?e-240:e+120,r,o),on(e,r,o),on(e<120?e+240:e-120,r,o),this.opacity)},clamp(){return new en(tn(this.h),nn(this.s),nn(this.l),qt(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=qt(this.opacity);return`${1===e?"hsl(":"hsla("}${tn(this.h)}, ${100*nn(this.s)}%, ${100*nn(this.l)}%${1===e?")":`, ${e})`}`}}));const rn=e=>()=>e;function ln(e){return 1==(e=+e)?an:function(t,n){return n-t?function(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)}}(t,n,e):rn(isNaN(t)?n:t)}}function an(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):rn(isNaN(e)?t:e)}const un=function e(t){var n=ln(t);function o(e,t){var o=n((e=Xt(e)).r,(t=Xt(t)).r),r=n(e.g,t.g),l=n(e.b,t.b),i=an(e.opacity,t.opacity);return function(t){return e.r=o(t),e.g=r(t),e.b=l(t),e.opacity=i(t),e+""}}return o.gamma=e,o}(1);function sn(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}var cn=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,dn=new RegExp(cn.source,"g");function fn(e,t){var n,o,r,l=cn.lastIndex=dn.lastIndex=0,i=-1,a=[],u=[];for(e+="",t+="";(n=cn.exec(e))&&(o=dn.exec(t));)(r=o.index)>l&&(r=t.slice(l,r),a[i]?a[i]+=r:a[++i]=r),(n=n[0])===(o=o[0])?a[i]?a[i]+=o:a[++i]=o:(a[++i]=null,u.push({i:i,x:sn(n,o)})),l=dn.lastIndex;return l<t.length&&(r=t.slice(l),a[i]?a[i]+=r:a[++i]=r),a.length<2?u[0]?function(e){return function(t){return e(t)+""}}(u[0].x):function(e){return function(){return e}}(t):(t=u.length,function(e){for(var n,o=0;o<t;++o)a[(n=u[o]).i]=n.x(e);return a.join("")})}var hn,pn=180/Math.PI,vn={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function gn(e,t,n,o,r,l){var i,a,u;return(i=Math.sqrt(e*e+t*t))&&(e/=i,t/=i),(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,i=-i),{translateX:r,translateY:l,rotate:Math.atan2(t,e)*pn,skewX:Math.atan(u)*pn,scaleX:i,scaleY:a}}function mn(e,t,n,o){function r(e){return e.length?e.pop()+" ":""}return function(l,i){var a=[],u=[];return l=e(l),i=e(i),function(e,o,r,l,i,a){if(e!==r||o!==l){var u=i.push("translate(",null,t,null,n);a.push({i:u-4,x:sn(e,r)},{i:u-2,x:sn(o,l)})}else(r||l)&&i.push("translate("+r+t+l+n)}(l.translateX,l.translateY,i.translateX,i.translateY,a,u),function(e,t,n,l){e!==t?(e-t>180?t+=360:t-e>180&&(e+=360),l.push({i:n.push(r(n)+"rotate(",null,o)-2,x:sn(e,t)})):t&&n.push(r(n)+"rotate("+t+o)}(l.rotate,i.rotate,a,u),function(e,t,n,l){e!==t?l.push({i:n.push(r(n)+"skewX(",null,o)-2,x:sn(e,t)}):t&&n.push(r(n)+"skewX("+t+o)}(l.skewX,i.skewX,a,u),function(e,t,n,o,l,i){if(e!==n||t!==o){var a=l.push(r(l)+"scale(",null,",",null,")");i.push({i:a-4,x:sn(e,n)},{i:a-2,x:sn(t,o)})}else(1!==n||1!==o)&&l.push(r(l)+"scale("+n+","+o+")")}(l.scaleX,l.scaleY,i.scaleX,i.scaleY,a,u),l=i=null,function(e){for(var t,n=-1,o=u.length;++n<o;)a[(t=u[n]).i]=t.x(e);return a.join("")}}}var yn=mn((function(e){const t=new("function"==typeof DOMMatrix?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?vn:gn(t.a,t.b,t.c,t.d,t.e,t.f)}),"px, ","px)","deg)"),wn=mn((function(e){return null!=e&&(hn||(hn=document.createElementNS("http://www.w3.org/2000/svg","g")),hn.setAttribute("transform",e),e=hn.transform.baseVal.consolidate())?gn((e=e.matrix).a,e.b,e.c,e.d,e.e,e.f):vn}),", ",")",")");function bn(e){return((e=Math.exp(e))+1/e)/2}const xn=function e(t,n,o){function r(e,r){var l,i,a=e[0],u=e[1],s=e[2],c=r[0],d=r[1],f=r[2],h=c-a,p=d-u,v=h*h+p*p;if(v<1e-12)i=Math.log(f/s)/t,l=function(e){return[a+e*h,u+e*p,s*Math.exp(t*e*i)]};else{var g=Math.sqrt(v),m=(f*f-s*s+o*v)/(2*s*n*g),y=(f*f-s*s-o*v)/(2*f*n*g),w=Math.log(Math.sqrt(m*m+1)-m),b=Math.log(Math.sqrt(y*y+1)-y);i=(b-w)/t,l=function(e){var o=e*i,r=bn(w),l=s/(n*g)*(r*function(e){return((e=Math.exp(2*e))-1)/(e+1)}(t*o+w)-function(e){return((e=Math.exp(e))-1/e)/2}(w));return[a+l*h,u+l*p,s*r/bn(t*o+w)]}}return l.duration=1e3*i*t/Math.SQRT2,l}return r.rho=function(t){var n=Math.max(.001,+t),o=n*n;return e(n,o,o*o)},r}(Math.SQRT2,2,4);var En,_n,Sn=0,kn=0,Nn=0,Cn=1e3,Mn=0,Bn=0,Pn=0,On="object"==typeof performance&&performance.now?performance:Date,Tn="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function In(){return Bn||(Tn(zn),Bn=On.now()+Pn)}function zn(){Bn=0}function An(){this._call=this._time=this._next=null}function $n(e,t,n){var o=new An;return o.restart(e,t,n),o}function Dn(){Bn=(Mn=On.now())+Pn,Sn=kn=0;try{!function(){In(),++Sn;for(var e,t=En;t;)(e=Bn-t._time)>=0&&t._call.call(void 0,e),t=t._next;--Sn}()}finally{Sn=0,function(){for(var e,t,n=En,o=1/0;n;)n._call?(o>n._time&&(o=n._time),e=n,n=n._next):(t=n._next,n._next=null,n=e?e._next=t:En=t);_n=e,Vn(o)}(),Bn=0}}function Rn(){var e=On.now(),t=e-Mn;t>Cn&&(Pn-=t,Mn=e)}function Vn(e){Sn||(kn&&(kn=clearTimeout(kn)),e-Bn>24?(e<1/0&&(kn=setTimeout(Dn,e-On.now()-Pn)),Nn&&(Nn=clearInterval(Nn))):(Nn||(Mn=On.now(),Nn=setInterval(Rn,Cn)),Sn=1,Tn(Dn)))}function Ln(e,t,n){var o=new An;return t=null==t?0:+t,o.restart((n=>{o.stop(),e(n+t)}),t,n),o}An.prototype=$n.prototype={constructor:An,restart:function(e,t,n){if("function"!=typeof e)throw new TypeError("callback is not a function");n=(null==n?In():+n)+(null==t?0:+t),!this._next&&_n!==this&&(_n?_n._next=this:En=this,_n=this),this._call=e,this._time=n,Vn()},stop:function(){this._call&&(this._call=null,this._time=1/0,Vn())}};var Hn=Z("start","end","cancel","interrupt"),Yn=[],Fn=0,Gn=1,Xn=2,jn=3,Un=4,Zn=5,qn=6;function Kn(e,t,n,o,r,l){var i=e.__transition;if(i){if(n in i)return}else e.__transition={};!function(e,t,n){var o,r=e.__transition;function l(e){n.state=Gn,n.timer.restart(i,n.delay,n.time),n.delay<=e&&i(e-n.delay)}function i(l){var s,c,d,f;if(n.state!==Gn)return u();for(s in r)if((f=r[s]).name===n.name){if(f.state===jn)return Ln(i);f.state===Un?(f.state=qn,f.timer.stop(),f.on.call("interrupt",e,e.__data__,f.index,f.group),delete r[s]):+s<t&&(f.state=qn,f.timer.stop(),f.on.call("cancel",e,e.__data__,f.index,f.group),delete r[s])}if(Ln((function(){n.state===jn&&(n.state=Un,n.timer.restart(a,n.delay,n.time),a(l))})),n.state=Xn,n.on.call("start",e,e.__data__,n.index,n.group),n.state===Xn){for(n.state=jn,o=new Array(d=n.tween.length),s=0,c=-1;s<d;++s)(f=n.tween[s].value.call(e,e.__data__,n.index,n.group))&&(o[++c]=f);o.length=c+1}}function a(t){for(var r=t<n.duration?n.ease.call(null,t/n.duration):(n.timer.restart(u),n.state=Zn,1),l=-1,i=o.length;++l<i;)o[l].call(e,r);n.state===Zn&&(n.on.call("end",e,e.__data__,n.index,n.group),u())}function u(){for(var o in n.state=qn,n.timer.stop(),delete r[t],r)return;delete e.__transition}r[t]=n,n.timer=$n(l,0,n.time)}(e,n,{name:t,index:o,group:r,on:Hn,tween:Yn,time:l.time,delay:l.delay,duration:l.duration,ease:l.ease,timer:null,state:Fn})}function Wn(e,t){var n=Qn(e,t);if(n.state>Fn)throw new Error("too late; already scheduled");return n}function Jn(e,t){var n=Qn(e,t);if(n.state>jn)throw new Error("too late; already running");return n}function Qn(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function eo(e,t){var n,o,r,l=e.__transition,i=!0;if(l){for(r in t=null==t?null:t+"",l)(n=l[r]).name===t?(o=n.state>Xn&&n.state<Zn,n.state=qn,n.timer.stop(),n.on.call(o?"interrupt":"cancel",e,e.__data__,n.index,n.group),delete l[r]):i=!1;i&&delete e.__transition}}function to(e,t){var n,o;return function(){var r=Jn(this,e),l=r.tween;if(l!==n)for(var i=0,a=(o=n=l).length;i<a;++i)if(o[i].name===t){(o=o.slice()).splice(i,1);break}r.tween=o}}function no(e,t,n){var o,r;if("function"!=typeof n)throw new Error;return function(){var l=Jn(this,e),i=l.tween;if(i!==o){r=(o=i).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)}l.tween=r}}function oo(e,t,n){var o=e._id;return e.each((function(){var e=Jn(this,o);(e.value||(e.value={}))[t]=n.apply(this,arguments)})),function(e){return Qn(e,o).value[t]}}function ro(e,t){var n;return("number"==typeof t?sn:t instanceof Yt?un:(n=Yt(t))?(t=n,un):fn)(e,t)}function lo(e){return function(){this.removeAttribute(e)}}function io(e){return function(){this.removeAttributeNS(e.space,e.local)}}function ao(e,t,n){var o,r,l=n+"";return function(){var i=this.getAttribute(e);return i===l?null:i===o?r:r=t(o=i,n)}}function uo(e,t,n){var o,r,l=n+"";return function(){var i=this.getAttributeNS(e.space,e.local);return i===l?null:i===o?r:r=t(o=i,n)}}function so(e,t,n){var o,r,l;return function(){var i,a,u=n(this);return null==u?void this.removeAttribute(e):(i=this.getAttribute(e))===(a=u+"")?null:i===o&&a===r?l:(r=a,l=t(o=i,u))}}function co(e,t,n){var o,r,l;return function(){var i,a,u=n(this);return null==u?void this.removeAttributeNS(e.space,e.local):(i=this.getAttributeNS(e.space,e.local))===(a=u+"")?null:i===o&&a===r?l:(r=a,l=t(o=i,u))}}function fo(e,t){var n,o;function r(){var r=t.apply(this,arguments);return r!==o&&(n=(o=r)&&function(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}(e,r)),n}return r._value=t,r}function ho(e,t){var n,o;function r(){var r=t.apply(this,arguments);return r!==o&&(n=(o=r)&&function(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}(e,r)),n}return r._value=t,r}function po(e,t){return function(){Wn(this,e).delay=+t.apply(this,arguments)}}function vo(e,t){return t=+t,function(){Wn(this,e).delay=t}}function go(e,t){return function(){Jn(this,e).duration=+t.apply(this,arguments)}}function mo(e,t){return t=+t,function(){Jn(this,e).duration=t}}var yo=st.prototype.constructor;function wo(e){return function(){this.style.removeProperty(e)}}var bo=0;function xo(e,t,n,o){this._groups=e,this._parents=t,this._name=n,this._id=o}function Eo(){return++bo}var _o=st.prototype;xo.prototype={constructor:xo,select:function(e){var t=this._name,n=this._id;"function"!=typeof e&&(e=le(e));for(var o=this._groups,r=o.length,l=new Array(r),i=0;i<r;++i)for(var a,u,s=o[i],c=s.length,d=l[i]=new Array(c),f=0;f<c;++f)(a=s[f])&&(u=e.call(a,a.__data__,f,s))&&("__data__"in a&&(u.__data__=a.__data__),d[f]=u,Kn(d[f],t,n,f,d,Qn(a,n)));return new xo(l,this._parents,t,n)},selectAll:function(e){var t=this._name,n=this._id;"function"!=typeof e&&(e=ae(e));for(var o=this._groups,r=o.length,l=[],i=[],a=0;a<r;++a)for(var u,s=o[a],c=s.length,d=0;d<c;++d)if(u=s[d]){for(var f,h=e.call(u,u.__data__,d,s),p=Qn(u,n),v=0,g=h.length;v<g;++v)(f=h[v])&&Kn(f,t,n,v,h,p);l.push(h),i.push(u)}return new xo(l,i,t,n)},selectChild:_o.selectChild,selectChildren:_o.selectChildren,filter:function(e){"function"!=typeof e&&(e=se(e));for(var t=this._groups,n=t.length,o=new Array(n),r=0;r<n;++r)for(var l,i=t[r],a=i.length,u=o[r]=[],s=0;s<a;++s)(l=i[s])&&e.call(l,l.__data__,s,i)&&u.push(l);return new xo(o,this._parents,this._name,this._id)},merge:function(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,o=t.length,r=n.length,l=Math.min(o,r),i=new Array(o),a=0;a<l;++a)for(var u,s=t[a],c=n[a],d=s.length,f=i[a]=new Array(d),h=0;h<d;++h)(u=s[h]||c[h])&&(f[h]=u);for(;a<o;++a)i[a]=t[a];return new xo(i,this._parents,this._name,this._id)},selection:function(){return new yo(this._groups,this._parents)},transition:function(){for(var e=this._name,t=this._id,n=Eo(),o=this._groups,r=o.length,l=0;l<r;++l)for(var i,a=o[l],u=a.length,s=0;s<u;++s)if(i=a[s]){var c=Qn(i,t);Kn(i,e,n,s,a,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new xo(o,this._parents,e,n)},call:_o.call,nodes:_o.nodes,node:_o.node,size:_o.size,empty:_o.empty,each:_o.each,on:function(e,t){var n=this._id;return arguments.length<2?Qn(this.node(),n).on.on(e):this.each(function(e,t,n){var o,r,l=function(e){return(e+"").trim().split(/^|\s+/).every((function(e){var t=e.indexOf(".");return t>=0&&(e=e.slice(0,t)),!e||"start"===e}))}(t)?Wn:Jn;return function(){var i=l(this,e),a=i.on;a!==o&&(r=(o=a).copy()).on(t,n),i.on=r}}(n,e,t))},attr:function(e,t){var n=ee(e),o="transform"===n?wn:ro;return this.attrTween(e,"function"==typeof t?(n.local?co:so)(n,o,oo(this,"attr."+e,t)):null==t?(n.local?io:lo)(n):(n.local?uo:ao)(n,o,t))},attrTween:function(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(null==t)return this.tween(n,null);if("function"!=typeof t)throw new Error;var o=ee(e);return this.tween(n,(o.local?fo:ho)(o,t))},style:function(e,t,n){var o="transform"==(e+="")?yn:ro;return null==t?this.styleTween(e,function(e,t){var n,o,r;return function(){var l=Te(this,e),i=(this.style.removeProperty(e),Te(this,e));return l===i?null:l===n&&i===o?r:r=t(n=l,o=i)}}(e,o)).on("end.style."+e,wo(e)):"function"==typeof t?this.styleTween(e,function(e,t,n){var o,r,l;return function(){var i=Te(this,e),a=n(this),u=a+"";return null==a&&(this.style.removeProperty(e),u=a=Te(this,e)),i===u?null:i===o&&u===r?l:(r=u,l=t(o=i,a))}}(e,o,oo(this,"style."+e,t))).each(function(e,t){var n,o,r,l,i="style."+t,a="end."+i;return function(){var u=Jn(this,e),s=u.on,c=null==u.value[i]?l||(l=wo(t)):void 0;(s!==n||r!==c)&&(o=(n=s).copy()).on(a,r=c),u.on=o}}(this._id,e)):this.styleTween(e,function(e,t,n){var o,r,l=n+"";return function(){var i=Te(this,e);return i===l?null:i===o?r:r=t(o=i,n)}}(e,o,t),n).on("end.style."+e,null)},styleTween:function(e,t,n){var o="style."+(e+="");if(arguments.length<2)return(o=this.tween(o))&&o._value;if(null==t)return this.tween(o,null);if("function"!=typeof t)throw new Error;return this.tween(o,function(e,t,n){var o,r;function l(){var l=t.apply(this,arguments);return l!==r&&(o=(r=l)&&function(e,t,n){return function(o){this.style.setProperty(e,t.call(this,o),n)}}(e,l,n)),o}return l._value=t,l}(e,t,n??""))},text:function(e){return this.tween("text","function"==typeof e?function(e){return function(){var t=e(this);this.textContent=t??""}}(oo(this,"text",e)):function(e){return function(){this.textContent=e}}(null==e?"":e+""))},textTween:function(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(null==e)return this.tween(t,null);if("function"!=typeof e)throw new Error;return this.tween(t,function(e){var t,n;function o(){var o=e.apply(this,arguments);return o!==n&&(t=(n=o)&&function(e){return function(t){this.textContent=e.call(this,t)}}(o)),t}return o._value=e,o}(e))},remove:function(){return this.on("end.remove",(e=this._id,function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}));var e},tween:function(e,t){var n=this._id;if(e+="",arguments.length<2){for(var o,r=Qn(this.node(),n).tween,l=0,i=r.length;l<i;++l)if((o=r[l]).name===e)return o.value;return null}return this.each((null==t?to:no)(n,e,t))},delay:function(e){var t=this._id;return arguments.length?this.each(("function"==typeof e?po:vo)(t,e)):Qn(this.node(),t).delay},duration:function(e){var t=this._id;return arguments.length?this.each(("function"==typeof e?go:mo)(t,e)):Qn(this.node(),t).duration},ease:function(e){var t=this._id;return arguments.length?this.each(function(e,t){if("function"!=typeof t)throw new Error;return function(){Jn(this,e).ease=t}}(t,e)):Qn(this.node(),t).ease},easeVarying:function(e){if("function"!=typeof e)throw new Error;return this.each(function(e,t){return function(){var n=t.apply(this,arguments);if("function"!=typeof n)throw new Error;Jn(this,e).ease=n}}(this._id,e))},end:function(){var e,t,n=this,o=n._id,r=n.size();return new Promise((function(l,i){var a={value:i},u={value:function(){0==--r&&l()}};n.each((function(){var n=Jn(this,o),r=n.on;r!==e&&((t=(e=r).copy())._.cancel.push(a),t._.interrupt.push(a),t._.end.push(u)),n.on=t})),0===r&&l()}))},[Symbol.iterator]:_o[Symbol.iterator]};var So={time:null,delay:0,duration:250,ease:function(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}};function ko(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}st.prototype.interrupt=function(e){return this.each((function(){eo(this,e)}))},st.prototype.transition=function(e){var t,n;e instanceof xo?(t=e._id,e=e._name):(t=Eo(),(n=So).time=In(),e=null==e?null:e+"");for(var o=this._groups,r=o.length,l=0;l<r;++l)for(var i,a=o[l],u=a.length,s=0;s<u;++s)(i=a[s])&&Kn(i,e,t,s,a,n||ko(i,t));return new xo(o,this._parents,e,t)};const No=e=>()=>e;function Co(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 Mo(e,t,n){this.k=e,this.x=t,this.y=n}Mo.prototype={constructor:Mo,scale:function(e){return 1===e?this:new Mo(this.k*e,this.x,this.y)},translate:function(e,t){return 0===e&0===t?this:new Mo(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 Bo=new Mo(1,0,0);function Po(e){e.stopImmediatePropagation()}function Oo(e){e.preventDefault(),e.stopImmediatePropagation()}function To(e){return!(e.ctrlKey&&"wheel"!==e.type||e.button)}function Io(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e).hasAttribute("viewBox")?[[(e=e.viewBox.baseVal).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 zo(){return this.__zoom||Bo}function Ao(e){return-e.deltaY*(1===e.deltaMode?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function $o(){return navigator.maxTouchPoints||"ontouchstart"in this}function Do(e,t,n){var o=e.invertX(t[0][0])-n[0][0],r=e.invertX(t[1][0])-n[1][0],l=e.invertY(t[0][1])-n[0][1],i=e.invertY(t[1][1])-n[1][1];return e.translate(r>o?(o+r)/2:Math.min(0,o)||Math.max(0,r),i>l?(l+i)/2:Math.min(0,l)||Math.max(0,i))}Mo.prototype;var Ro,Vo=((Ro=Vo||{}).Left="left",Ro.Top="top",Ro.Right="right",Ro.Bottom="bottom",Ro),Lo=(e=>(e.Partial="partial",e.Full="full",e))(Lo||{}),Ho=(e=>(e.Bezier="default",e.SimpleBezier="simple-bezier",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e))(Ho||{}),Yo=(e=>(e.Strict="strict",e.Loose="loose",e))(Yo||{}),Fo=(e=>(e.Arrow="arrow",e.ArrowClosed="arrowclosed",e))(Fo||{}),Go=(e=>(e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal",e))(Go||{}),Xo=(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))(Xo||{});const jo="vue-flow__node-desc",Uo="vue-flow__edge-desc",Zo=["Enter"," ","Escape"],qo={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};function Ko(e){return{...e.computedPosition||{x:0,y:0},width:e.dimensions.width||0,height:e.dimensions.height||0}}function Wo(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 Jo(e){return{width:e.offsetWidth,height:e.offsetHeight}}function Qo(e,t=0,n=1){return Math.min(Math.max(e,t),n)}function er(e,t){return{x:Qo(e.x,t[0][0],t[1][0]),y:Qo(e.y,t[0][1],t[1][1])}}function tr(e){const t=e.getRootNode(),n=fi();return"elementFromPoint"in t?t:n.document}function nr(e){return e&&"object"==typeof e&&"id"in e&&"source"in e&&"target"in e}function or(e){return nr(e)&&"sourceNode"in e&&"targetNode"in e}function rr(e){return e&&"object"==typeof e&&"id"in e&&"position"in e&&!nr(e)}function lr(e){return rr(e)&&"computedPosition"in e}function ir(e,n={}){const o=tl(e.events)?e.events:n.events&&tl(n.events)?n.events:{},r=tl(e.data)?e.data:n.data&&tl(n.data)?n.data:{};return n=or(e)?n:{...n,sourceHandle:(e.sourceHandle?e.sourceHandle.toString():void 0)||n.sourceHandle,targetHandle:(e.targetHandle?e.targetHandle.toString():void 0)||n.targetHandle,type:e.type??n.type??"default",source:e.source.toString()||n.source,target:e.target.toString()||n.target,updatable:e.updatable??n.updatable,selectable:e.selectable??n.selectable,focusable:e.focusable??n.focusable,data:r,events:t.markRaw(o),label:(e.label&&!Gr(e.label)?t.markRaw(e.label):e.label)||n.label,interactionWidth:e.interactionWidth||n.interactionWidth},Object.assign({},n,e,{id:e.id.toString()})}function ar(e,t,n){const o=Gr(e)?e:e.id,r="source"===n?"target":"source",l=t.filter((e=>nr(e)&&e[r]===o)).map((e=>nr(e)&&e[n]));return t.filter((e=>l.includes(e.id)))}function ur({source:e,sourceHandle:t,target:n,targetHandle:o}){return`vueflow__edge-${e}${t??""}-${n}${o??""}`}function sr(e,t){return t.some((t=>nr(t)&&t.source===e.source&&t.target===e.target&&(t.sourceHandle===e.sourceHandle||!t.sourceHandle&&!e.sourceHandle)&&(t.targetHandle===e.targetHandle||!t.targetHandle&&!e.targetHandle)))}function cr({x:e,y:t},{x:n,y:o,zoom:r}){return{x:e*r+n,y:t*r+o}}function dr({x:e,y:t},{x:n,y:o,zoom:r},l,[i,a]){const u={x:(e-n)/r,y:(t-o)/r};return l?{x:i*Math.round(u.x/i),y:a*Math.round(u.y/a)}:u}function fr(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 hr({x:e,y:t,width:n,height:o}){return{x:e,y:t,x2:e+n,y2:t+o}}function pr({x:e,y:t,x2:n,y2:o}){return{x:e,y:t,width:n-e,height:o-t}}function vr(e){return pr(e.reduce(((e,{computedPosition:t={x:0,y:0},dimensions:n={width:0,height:0}}={})=>fr(e,hr({...t,...n}))),{x:1/0,y:1/0,x2:-1/0,y2:-1/0}))}function gr(e,t,{x:n,y:o,zoom:r}={x:0,y:0,zoom:1},l=!1,i=!1){const a={x:(t.x-n)/r,y:(t.y-o)/r,width:t.width/r,height:t.height/r};return e.filter((e=>{const{computedPosition:t={x:0,y:0},dimensions:n={width:0,height:0},selectable:o}=e;if(i&&!o)return!1;const r={...t,width:n.width||0,height:n.height||0},u=Wo(a,r),s=typeof n.width>"u"||typeof n.height>"u"||0===n.width||0===n.height,c=l&&u>0,d=n.width*n.height;return s||c||u>=d}))}function mr(e,t){const n=e.map((e=>Gr(e)?e:e.id));return t.filter((e=>n.includes(e.source)||n.includes(e.target)))}function yr(e,t,n,o,r,l=.1,i={x:0,y:0}){const a=t/(e.width*(1+l)),u=n/(e.height*(1+l)),s=Qo(Math.min(a,u),o,r),c=e.x+e.width/2,d=e.y+e.height/2;return{x:t/2-c*s+(i.x??0),y:n/2-d*s+(i.y??0),zoom:s}}function wr(e,t){if(!e.parentNode)return!1;const n=t(e.parentNode);return!!n&&(!!n.selected||wr(n,t))}function br(e,t){return typeof e>"u"?"":"string"==typeof e?e:`${t?`${t}__`:""}${Object.keys(e).sort().map((t=>`${t}=${e[t]}`)).join("&")}`}function xr(e,t,n){return e<t?Qo(Math.abs(e-t),1,50)/50:e>n?-Qo(Math.abs(e-n),1,50)/50:0}function Er(e,t){return[20*xr(e.x,35,t.width-35),20*xr(e.y,35,t.height-35)]}function _r(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(Xr(t.style)?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(Gr(r.width)){const e=Number(r.width.replace("px",""));r.width=`${e+n}px`}else r.width+=n;if(o>0)if(Gr(r.height)){const e=Number(r.height.replace("px",""));r.height=`${e+o}px`}else r.height+=o;if(e.position.x<0){const n=Math.abs(e.position.x);if(t.position.x=t.position.x-n,Gr(r.width)){const e=Number(r.width.replace("px",""));r.width=`${e+n}px`}else r.width+=n;e.position.x=0}if(e.position.y<0){const n=Math.abs(e.position.y);if(t.position.y=t.position.y-n,Gr(r.height)){const e=Number(r.height.replace("px",""));r.height=`${e+n}px`}else r.height+=n;e.position.y=0}t.dimensions.width=Number(r.width.toString().replace("px","")),t.dimensions.height=Number(r.height.toString().replace("px","")),Xr(t.style)?t.style=e=>({...(0,t.style)(e),...r}):t.style={...t.style,...r}}}}function Sr(e,n){e.filter((e=>"add"===e.type||"remove"===e.type)).forEach((e=>{if("add"===e.type)-1===n.findIndex((t=>t.id===e.item.id))&&n.push(e.item);else if("remove"===e.type){const t=n.findIndex((t=>t.id===e.id));-1!==t&&n.splice(t,1)}}));const o=n.map((e=>e.id));return n.forEach((r=>{var l,i;const a=e.filter((e=>e.id===r.id));for(const e of a)switch(e.type){case"select":r.selected=e.selected;break;case"position":if(lr(r)&&(typeof e.position<"u"&&(r.position=e.position),typeof e.dragging<"u"&&(r.dragging=e.dragging),r.expandParent&&r.parentNode)){const e=n[o.indexOf(r.parentNode)];e&&lr(e)&&_r(r,e)}break;case"dimensions":if(lr(r)){if(typeof e.dimensions<"u"&&(r.dimensions=e.dimensions),typeof e.updateStyle<"u"&&(r.style={...r.style||{},width:`${null==(l=e.dimensions)?void 0:l.width}px`,height:`${null==(i=e.dimensions)?void 0:i.height}px`}),typeof e.resizing<"u"&&(r.resizing=e.resizing),r.expandParent&&r.parentNode){const e=n[o.indexOf(r.parentNode)];e&&lr(e)&&(e.initialized?_r(r,e):t.nextTick((()=>{_r(r,e)})))}r.initialized||(r.initialized=!0)}}})),n}function kr(e,t){return{id:e,type:"select",selected:t}}function Nr(e){return{item:e,type:"add"}}function Cr(e){return{id:e,type:"remove"}}function Mr(e,t){return e.reduce(((e,n)=>{let o=t.includes(n.id);tl(n.selectable)&&!n.selectable&&(o=!1);const r=lr(n)?"changedNodes":"changedEdges";return!n.selected&&o?e[r].push(kr(n.id,!0)):n.selected&&!o&&e[r].push(kr(n.id,!1)),e}),{changedNodes:[],changedEdges:[]})}function Br(e=(()=>{})){const t=new Set;e&&t.add(e);const o=e=>{t.delete(e)};return{on:r=>{t.has(e)&&t.delete(e),t.add(r);const l=()=>o(r);return n(l),{off:l}},off:o,trigger:e=>Promise.all(Array.from(t).map((t=>t(e)))),hasListeners:()=>t.size>0}}function Pr(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 Or(e,n,o,r,l){return e.filter((e=>(e.selected||e.id===l)&&(!e.parentNode||!wr(e,r))&&(e.draggable||n&&typeof e.draggable>"u"))).map((e=>{var n,r;return t.markRaw({id:e.id,position:e.position||{x:0,y:0},distance:{x:o.x-(null==(n=e.computedPosition)?void 0:n.x)||0,y:o.y-(null==(r=e.computedPosition)?void 0:r.y)||0},from:e.computedPosition,extent:e.extent,parentNode:e.parentNode,dimensions:e.dimensions})}))}function Tr({id:e,dragItems:t,findNode:n}){const o=t.reduce(((e,t)=>{const o=n(t.id);return o&&e.push(o),e}),[]);return[e?o.find((t=>t.id===e)):o[0],o]}function Ir(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 zr(e,t,n,o){let r=e.extent||n;if("parent"===r||!Array.isArray(r)&&"parent"===(null==r?void 0:r.range))if(e.parentNode&&o&&e.dimensions.width&&e.dimensions.height){const e=function(e,t,n){const[o,r,l,i]="string"!=typeof e?Ir(e.padding):[0,0,0,0];return!!(n&&jr(n.computedPosition.x)&&jr(n.computedPosition.y)&&jr(n.dimensions.width)&&jr(n.dimensions.height))&&[[n.computedPosition.x+i,n.computedPosition.y+o],[n.computedPosition.x+n.dimensions.width-r,n.computedPosition.y+n.dimensions.height-l]]}(r,0,o);e&&(r=e)}else t(new Hr(Vr.NODE_EXTENT_INVALID,e.id)),r=n;else if(Array.isArray(r)){const e=(null==o?void 0:o.computedPosition.x)||0,t=(null==o?void 0:o.computedPosition.y)||0;r=[[r[0][0]+e,r[0][1]+t],[r[1][0]+e,r[1][1]+t]]}else if(null!=r&&r.range&&Array.isArray(r.range)){const[e,t,n,l]=Ir(r.padding),i=(null==o?void 0:o.computedPosition.x)||0,a=(null==o?void 0:o.computedPosition.y)||0;r=[[r.range[0][0]+i+l,r.range[0][1]+a+e],[r.range[1][0]+i-t,r.range[1][1]+a-n]]}return r}function Ar(e,t,n,o,r){const l=function({width:e,height:t},n){return[n[0],[n[1][0]-(e||0),n[1][1]-(t||0)]]}(e.dimensions,zr(e,n,o,r)),i=er(t,l);return{position:{x:i.x-((null==r?void 0:r.computedPosition.x)||0),y:i.y-((null==r?void 0:r.computedPosition.y)||0)},computedPosition:i}}function $r(e,t,n){const o=((null==n?void 0:n.x)??0)+t.x,r=((null==n?void 0:n.y)??0)+t.y,l=(null==n?void 0:n.width)??t.width,i=(null==n?void 0:n.height)??t.height;switch(e){case Vo.Top:return{x:o+l/2,y:r};case Vo.Right:return{x:o+l,y:r+i/2};case Vo.Bottom:return{x:o+l/2,y:r+i};case Vo.Left:return{x:o,y:r+i/2}}}function Dr(e=[],t){return e.length?t&&1!==e.length?t&&e.find((e=>e.id===t))||null:e[0]:null}function Rr(e,t,n=!1){const o=jr(e.zIndex);let r=o?e.zIndex:0;const l=t(e.source),i=t(e.target);return l&&i?(n&&(r=o?e.zIndex:Math.max(l.computedPosition.z||0,i.computedPosition.z||0)),r):0}var Vr=(e=>(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))(Vr||{});const Lr={MISSING_VIEWPORT_DIMENSIONS:()=>"The Vue Flow parent container needs a width and a height to render the graph",NODE_INVALID:e=>`Node is invalid\nNode: ${e}`,NODE_NOT_FOUND:e=>`Node not found\nNode: ${e}`,NODE_MISSING_PARENT:(e,t)=>`Node is missing a parent\nNode: ${e}\nParent: ${t}`,NODE_TYPE_MISSING:e=>`Node type is missing\nType: ${e}`,NODE_EXTENT_INVALID:e=>`Only child nodes can use a parent extent\nNode: ${e}`,EDGE_INVALID:e=>`An edge needs a source and a target\nEdge: ${e}`,EDGE_SOURCE_MISSING:(e,t)=>`Edge source is missing\nEdge: ${e} \nSource: ${t}`,EDGE_TARGET_MISSING:(e,t)=>`Edge target is missing\nEdge: ${e} \nTarget: ${t}`,EDGE_TYPE_MISSING:e=>`Edge type is missing\nType: ${e}`,EDGE_SOURCE_TARGET_SAME:(e,t,n)=>`Edge source and target are the same\nEdge: ${e} \nSource: ${t} \nTarget: ${n}`,EDGE_SOURCE_TARGET_MISSING:(e,t,n)=>`Edge source or target is missing\nEdge: ${e} \nSource: ${t} \nTarget: ${n}`,EDGE_ORPHANED:e=>`Edge was orphaned (suddenly missing source or target) and has been removed\nEdge: ${e}`,EDGE_NOT_FOUND:e=>`Edge not found\nEdge: ${e}`};class Hr extends Error{constructor(e,...t){var n;super(null==(n=Lr[e])?void 0:n.call(Lr,...t)),this.code=e}}function Yr(e){return"clientX"in e}function Fr(e,t){var n,o;const r=Yr(e),l=r?e.clientX:null==(n=e.touches)?void 0:n[0].clientX,i=r?e.clientY:null==(o=e.touches)?void 0:o[0].clientY;return{x:l-((null==t?void 0:t.left)??0),y:i-((null==t?void 0:t.top)??0)}}function Gr(e){return"string"==typeof e}function Xr(e){return"function"==typeof e}function jr(e){return"number"==typeof e}function Ur(e){null==e||e.classList.remove("valid","connecting","vue-flow__handle-valid","vue-flow__handle-connecting")}function Zr(e,t,n,o){return(t[n]||[]).reduce(((t,r)=>{var l,i;return`${e.id}-${r.id}-${n}`!==o&&t.push({id:r.id||null,type:n,nodeId:e.id,x:((null==(l=e.computedPosition)?void 0:l.x)??0)+r.x+r.width/2,y:((null==(i=e.computedPosition)?void 0:i.y)??0)+r.y+r.height/2,width:r.width,height:r.height}),t}),[])}function qr(e,t,n,o,r,l,i,a,u,s){const c="target"===l,d=a.querySelector(`.vue-flow__handle[data-id="${null==t?void 0:t.nodeId}-${null==t?void 0:t.id}-${null==t?void 0:t.type}"]`),{x:f,y:h}=Fr(e),p=a.elementFromPoint(f,h),v=null!=p&&p.classList.contains("vue-flow__handle")?p:d,g={handleDomNode:null,isValid:!1,connection:{source:"",target:"",sourceHandle:null,targetHandle:null},endHandle:null};if(v){g.handleDomNode=v;const e=Kr(void 0,v),t=v.getAttribute("data-nodeid"),l=v.getAttribute("data-handleid"),a=v.classList.contains("connectable"),d=v.classList.contains("connectableend"),f={source:c?t:o,sourceHandle:c?l:r,target:c?o:t,targetHandle:c?r:l};g.connection=f;const h=a&&d&&(n===Yo.Strict?c&&"source"===e||!c&&"target"===e:t!==o||l!==r);g.endHandle={nodeId:t,handleId:l,type:e},h&&(g.isValid=i(f,{edges:u,sourceNode:s(f.source),targetNode:s(f.target)}))}return g}function Kr(e,t){return e||(null!=t&&t.classList.contains("target")?"target":null!=t&&t.classList.contains("source")?"source":null)}const Wr=["production","prod"];function Jr(e,...t){Wr.includes(production||"")||console.warn(`[Vue Flow]: ${e}`,...t)}function Qr(e,t,n){const o=t.querySelectorAll(`.vue-flow__handle${e}`);if(!o||!o.length)return;const r=Array.from(o),l=t.getBoundingClientRect();return r.map((e=>{const t=e.getBoundingClientRect();return{id:e.getAttribute("data-handleid"),position:e.getAttribute("data-handlepos"),x:(t.left-l.left)/n,y:(t.top-l.top)/n,...Jo(e)}}))}function el(e,n,o,r,l,i=!1,a){l.value=!1,e.selected?(i||e.selected&&n)&&(r([e]),t.nextTick((()=>{a.blur()}))):o([e])}function tl(e){return typeof t.unref(e)<"u"}function nl(e,n,o,r){const l={},i=e.reduce(((e,n)=>{if(!rr(n))return r(new Hr(Vr.NODE_INVALID)),e;const i=function(e,n={}){let o=n;return lr(e)||(o={type:e.type??n.type??"default",dimensions:t.markRaw({width:0,height:0}),handleBounds:{source:[],target:[]},computedPosition:t.markRaw({z:0,...e.position}),draggable:void 0,selectable:void 0,connectable:void 0,focusable:void 0,selected:!1,dragging:!1,resizing:!1,initialized:!1,...n,data:tl(e.data)?e.data:{},events:t.markRaw(tl(e.events)?e.events:{})}),Object.assign({},o,e,{id:e.id.toString()})}(n,{...o(n.id),parentNode:n.parentNode});return n.parentNode&&(l[n.parentNode]=!0),e.concat(i)}),[]),a=[...i,...n];for(const e of i){const t=a.find((t=>t.id===e.parentNode));e.parentNode&&!t&&r(new Hr(Vr.NODE_MISSING_PARENT,e.id,e.parentNode)),(e.parentNode||l[e.id])&&(l[e.id]&&(e.isParent=!0),t&&(t.isParent=!0))}return i}function ol(e){const{vueFlowRef:n,snapToGrid:r,snapGrid:l,noDragClassName:i,nodes:a,nodeExtent:u,viewport:s,autoPanOnNodeDrag:c,nodesDraggable:d,panBy:f,findNode:h,multiSelectionActive:p,nodesSelectionActive:v,selectNodesOnDrag:g,removeSelectedElements:m,addSelectedNodes:y,updateNodePositions:w,emits:b}=ui(),{onStart:x,onDrag:E,onStop:_,el:S,disabled:k,id:N,selectable:C,dragHandle:M}=e,B=t.ref(!1);let P,O=[],T=null,I={x:void 0,y:void 0},z={x:0,y:0},A=null,$=0,D=!1;const R=si(),V=({x:e,y:t})=>{I={x:e,y:t};let n=!1;if(O=O.map((o=>{const i={x:e-o.distance.x,y:t-o.distance.y};r.value&&(i.x=l.value[0]*Math.round(i.x/l.value[0]),i.y=l.value[1]*Math.round(i.y/l.value[1]));const{computedPosition:a}=Ar(o,i,b.error,u.value,o.parentNode?h(o.parentNode):void 0);return n=n||o.position.x!==a.x||o.position.y!==a.y,o.position=a,o})),n&&(w(O,!0,!0),B.value=!0,A)){const[e,t]=Tr({id:N,dragItems:O,findNode:h});E({event:A,node:e,nodes:t})}},L=()=>{if(!T)return;const[e,t]=Er(z,T);if(0!==e||0!==t){const n={x:(I.x??0)-e/s.value.zoom,y:(I.y??0)-t/s.value.zoom};f({x:e,y:t})&&V(n)}$=requestAnimationFrame(L)};return t.watch([()=>o(k),S],(([e,t])=>{if(t){const r=ct(t);e?r.on(".drag",null):(P=function(){var e,t,n,o,r=bt,l=xt,i=Et,a=_t,u={},s=Z("start","drag","end"),c=0,d=0;function f(e){e.on("mousedown.drag",h).filter(a).on("touchstart.drag",g).on("touchmove.drag",m,ft).on("touchend.drag touchcancel.drag",y).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function h(i,a){if(!o&&r.call(this,i,a)){var u=w(this,l.call(this,i,a),i,a,"mouse");u&&(ct(i.view).on("mousemove.drag",p,ht).on("mouseup.drag",v,ht),gt(i.view),pt(i),n=!1,e=i.clientX,t=i.clientY,u("start",i))}}function p(o){if(vt(o),!n){var r=o.clientX-e,l=o.clientY-t;n=r*r+l*l>d}u.mouse("drag",o)}function v(e){ct(e.view).on("mousemove.drag mouseup.drag",null),mt(e.view,n),vt(e),u.mouse("end",e)}function g(e,t){if(r.call(this,e,t)){var n,o,i=e.changedTouches,a=l.call(this,e,t),u=i.length;for(n=0;n<u;++n)(o=w(this,a,e,t,i[n].identifier,i[n]))&&(pt(e),o("start",e,i[n]))}}function m(e){var t,n,o=e.changedTouches,r=o.length;for(t=0;t<r;++t)(n=u[o[t].identifier])&&(vt(e),n("drag",e,o[t]))}function y(e){var t,n,r=e.changedTouches,l=r.length;for(o&&clearTimeout(o),o=setTimeout((function(){o=null}),500),t=0;t<l;++t)(n=u[r[t].identifier])&&(pt(e),n("end",e,r[t]))}function w(e,t,n,o,r,l){var a,d,h,p=s.copy(),v=dt(l||n,t);if(null!=(h=i.call(e,new wt("beforestart",{sourceEvent:n,target:f,identifier:r,active:c,x:v[0],y:v[1],dx:0,dy:0,dispatch:p}),o)))return a=h.x-v[0]||0,d=h.y-v[1]||0,function n(l,i,s){var g,m=v;switch(l){case"start":u[r]=n,g=c++;break;case"end":delete u[r],--c;case"drag":v=dt(s||i,t),g=c}p.call(l,e,new wt(l,{sourceEvent:i,subject:h,target:f,identifier:r,active:g,x:v[0]+a,y:v[1]+d,dx:v[0]-m[0],dy:v[1]-m[1],dispatch:p}),o)}}return f.filter=function(e){return arguments.length?(r="function"==typeof e?e:yt(!!e),f):r},f.container=function(e){return arguments.length?(l="function"==typeof e?e:yt(e),f):l},f.subject=function(e){return arguments.length?(i="function"==typeof e?e:yt(e),f):i},f.touchable=function(e){return arguments.length?(a="function"==typeof e?e:yt(!!e),f):a},f.on=function(){var e=s.on.apply(s,arguments);return e===s?f:e},f.clickDistance=function(e){return arguments.length?(d=(e=+e)*e,f):Math.sqrt(d)},f}().on("start",(e=>{var r;const l=h(N);!g.value&&!p.value&&l&&(l.selected||m()),l&&o(C)&&g.value&&el(l,p.value,y,m,v,!1,t);const i=R(e);if(I=i,O=Or(a.value,d.value,i,h,N),O.length){const[t,n]=Tr({id:N,dragItems:O,findNode:h});x({event:e.sourceEvent,node:t,nodes:n})}T=(null==(r=n.value)?void 0:r.getBoundingClientRect())||null,z=Fr(e.sourceEvent,T)})).on("drag",(e=>{const t=R(e);!D&&c.value&&(D=!0,L()),(I.x!==t.xSnapped||I.y!==t.ySnapped)&&O.length&&(A=e.sourceEvent,z=Fr(e.sourceEvent,T),V(t))})).on("end",(e=>{if(B.value=!1,D=!1,cancelAnimationFrame($),O.length){w(O,!1,!1);const[t,n]=Tr({id:N,dragItems:O,findNode:h});_({event:e.sourceEvent,node:t,nodes:n})}})).filter((e=>{const n=e.target,r=o(M);return!e.button&&(!i.value||!Pr(n,`.${i.value}`,t)&&(!r||Pr(n,r,t)))})),r.call(P))}})),B}function rl(e,t){const n={};for(const o in e)t.includes(o)||Object.defineProperty(n,o,{enumerable:!0,get:()=>e[o]});return n}const ll=["data-id","data-handleid","data-nodeid","data-handlepos"],il=t.defineComponent({name:"Handle",compatConfig:{MODE:3},props:{id:null,type:null,position:{default:Vo.Top},isValidConnection:{type:Function},connectable:{type:[Boolean,String,Function],default:void 0},connectableStart:{type:Boolean,default:!0},connectableEnd:{type:Boolean,default:!0}},setup(e){const n=rl(e,["position","connectable","connectableStart","connectableEnd","id"]),o=u(n,"type","source"),r=u(n,"isValidConnection",void 0),{connectionStartHandle:l,connectionClickStartHandle:i,connectionEndHandle:a,vueFlowRef:s,nodesConnectable:c,noDragClassName:d,noPanClassName:f}=ui(),{id:h,node:p,nodeEl:v,connectedEdges:g}=vi(),m=t.ref(),y=t.computed((()=>e.id??`${h}__handle-${e.position}`)),w=t.computed((()=>!(typeof e.connectableStart<"u")||e.connectableStart)),x=t.computed((()=>!(typeof e.connectableEnd<"u")||e.connectableEnd)),{handlePointerDown:E,handleClick:_}=di({nodeId:h,handleId:y,isValidConnection:r,type:o}),S=t.computed((()=>Gr(e.connectable)&&"single"===e.connectable?!g.value.some((e=>{const t=e[`${o.value}Handle`];return e[o.value]===h&&(!t||t===y.value)})):Xr(e.connectable)?e.connectable(p,g.value):tl(e.connectable)?e.connectable:c.value)),k=t.computed((()=>{var e,t,n,r,i,u;return(null==(e=l.value)?void 0:e.nodeId)===h&&(null==(t=l.value)?void 0:t.handleId)===y.value&&(null==(n=l.value)?void 0:n.type)===o.value||(null==(r=a.value)?void 0:r.nodeId)===h&&(null==(i=a.value)?void 0:i.handleId)===y.value&&(null==(u=a.value)?void 0:u.type)===o.value})),N=t.computed((()=>{var e,t,n;return(null==(e=i.value)?void 0:e.nodeId)===h&&(null==(t=i.value)?void 0:t.handleId)===y.value&&(null==(n=i.value)?void 0:n.type)===o.value}));function C(e){const t=Yr(e);S.value&&w.value&&(t&&0===e.button||!t)&&E(e)}function M(e){!h||!i.value&&!w.value||S.value&&_(e)}return b((()=>p.initialized)).toBe(!0,{flush:"post"}).then((()=>{var t;const n=null==(t=p.handleBounds[o.value])?void 0:t.find((e=>e.id===y.value));if(!s.value||n)return;const r=s.value.querySelector(".vue-flow__transformationpane");if(!(v.value&&m.value&&r&&y.value))return;const l=v.value.getBoundingClientRect(),i=m.value.getBoundingClientRect(),a=window.getComputedStyle(r),{m22:u}=new window.DOMMatrixReadOnly(a.transform),c={id:y.value,position:e.position,x:(i.left-l.left)/u,y:(i.top-l.top)/u,...Jo(m.value)};p.handleBounds[o.value]=[...p.handleBounds[o.value]??[],c]})),(n,r)=>(t.openBlock(),t.createElementBlock("div",{ref_key:"handle",ref:m,"data-id":`${t.unref(h)}-${t.unref(y)}-${t.unref(o)}`,"data-handleid":t.unref(y),"data-nodeid":t.unref(h),"data-handlepos":e.position,class:t.normalizeClass(["vue-flow__handle",[`vue-flow__handle-${e.position}`,`vue-flow__handle-${t.unref(y)}`,t.unref(d),t.unref(f),t.unref(o),{connectable:t.unref(S),connecting:t.unref(N),connectablestart:t.unref(w),connectableend:t.unref(x),connectionindicator:t.unref(S)&&(t.unref(w)&&!t.unref(k)||t.unref(x)&&t.unref(k))}]]),onMousedown:C,onTouchstartPassive:C,onClick:M},[t.renderSlot(n.$slots,"default",{id:e.id})],42,ll))}}),al=function({sourcePosition:e=Vo.Bottom,targetPosition:n=Vo.Top,label:o,connectable:r=!0,isValidTargetPos:l,isValidSourcePos:i}){return[t.h(il,{type:"target",position:n,connectable:r,isValidConnection:l}),"string"!=typeof o&&o?t.h(o):t.h("div",{innerHTML:o}),t.h(il,{type:"source",position:e,connectable:r,isValidConnection:i})]};al.props=["sourcePosition","targetPosition","label","isValidTargetPos","isValidSourcePos","connectable"],al.inheritAttrs=!1,al.compatConfig={MODE:3};const ul=al,sl=function({sourcePosition:e=Vo.Bottom,label:n,connectable:o=!0,isValidSourcePos:r}){return["string"!=typeof n&&n?t.h(n):t.h("div",{innerHTML:n}),t.h(il,{type:"source",position:e,connectable:o,isValidConnection:r})]};sl.props=["sourcePosition","label","isValidSourcePos","connectable"],sl.inheritAttrs=!1,sl.compatConfig={MODE:3};const cl=sl,dl=function({targetPosition:e=Vo.Top,label:n,connectable:o=!0,isValidTargetPos:r}){return[t.h(il,{type:"target",position:e,connectable:o,isValidConnection:r}),"string"!=typeof n&&n?t.h(n):t.h("div",{innerHTML:n})]};dl.props=["targetPosition","label","isValidTargetPos","connectable"],dl.inheritAttrs=!1,dl.compatConfig={MODE:3};const fl=dl,hl=Symbol("vueFlow"),pl=Symbol("nodeId"),vl=Symbol("nodeRef"),gl=Symbol("edgeId"),ml=Symbol("edgeRef"),yl=Symbol("slots"),wl=t.defineComponent({name:"Node",compatConfig:{MODE:3},props:["name","type","id","draggable","selectable","focusable","connectable","node","resizeObserver"],setup(e){t.provide(pl,e.id);const{id:n,edges:o,noPanClassName:r,selectNodesOnDrag:l,nodesSelectionActive:i,multiSelectionActive:a,emits:u,findNode:s,removeSelectedNodes:c,addSelectedNodes:d,updateNodeDimensions:f,onUpdateNodeInternals:h,getIntersectingNodes:p,getNodeTypes:v,nodeExtent:g,elevateNodesOnSelect:m,disableKeyboardA11y:y,ariaLiveMessage:w,snapToGrid:x,snapGrid:E}=ui(),_=gi(),S=j(e,"node"),k=t.computed((()=>s(S.value.parentNode))),N=t.computed((()=>mr([S.value],o.value))),C=t.ref(null);t.provide(vl,C);const{emit:M,on:B}=function(e,t){const n={doubleClick:Br(),click:Br(),mouseEnter:Br(),mouseMove:Br(),mouseLeave:Br(),contextMenu:Br(),dragStart:Br(),drag:Br(),dragStop:Br()};return n.doubleClick.on((n=>{var o,r;t.nodeDoubleClick(n),null==(r=null==(o=e.events)?void 0:o.doubleClick)||r.call(o,n)})),n.click.on((n=>{var o,r;t.nodeClick(n),null==(r=null==(o=e.events)?void 0:o.click)||r.call(o,n)})),n.mouseEnter.on((n=>{var o,r;t.nodeMouseEnter(n),null==(r=null==(o=e.events)?void 0:o.mouseEnter)||r.call(o,n)})),n.mouseMove.on((n=>{var o,r;t.nodeMouseMove(n),null==(r=null==(o=e.events)?void 0:o.mouseMove)||r.call(o,n)})),n.mouseLeave.on((n=>{var o,r;t.nodeMouseLeave(n),null==(r=null==(o=e.events)?void 0:o.mouseLeave)||r.call(o,n)})),n.contextMenu.on((n=>{var o,r;t.nodeContextMenu(n),null==(r=null==(o=e.events)?void 0:o.contextMenu)||r.call(o,n)})),n.dragStart.on((n=>{var o,r;t.nodeDragStart(n),null==(r=null==(o=e.events)?void 0:o.dragStart)||r.call(o,n)})),n.drag.on((n=>{var o,r;t.nodeDrag(n),null==(r=null==(o=e.events)?void 0:o.drag)||r.call(o,n)})),n.dragStop.on((n=>{var o,r;t.nodeDragStop(n),null==(r=null==(o=e.events)?void 0:o.dragStop)||r.call(o,n)})),Object.entries(n).reduce(((e,[t,n])=>(e.emit[t]=n.trigger,e.on[t]=n.on,e)),{emit:{},on:{}})}(S.value,u),P=ol({id:e.id,el:C,disabled:()=>!e.draggable,selectable:()=>e.selectable,dragHandle:()=>S.value.dragHandle,onStart(e){M.dragStart({...e,intersections:p(S.value)})},onDrag(e){M.drag({...e,intersections:p(S.value)})},onStop(e){M.dragStop({...e,intersections:p(S.value)})}}),O=t.computed((()=>S.value.class instanceof Function?S.value.class(S.value):S.value.class)),T=t.computed((()=>{const e=(S.value.style instanceof Function?S.value.style(S.value):S.value.style)||{},t=S.value.width instanceof Function?S.value.width(S.value):S.value.width,n=S.value.height instanceof Function?S.value.height(S.value):S.value.height;return t&&(e.width="string"==typeof t?t:`${t}px`),n&&(e.height="string"==typeof n?n:`${n}px`),e})),I=()=>Number(S.value.zIndex??T.value.zIndex??0);return h((t=>{t.includes(e.id)&&A()})),t.onMounted((()=>{e.resizeObserver.observe(C.value)})),t.onBeforeUnmount((()=>{e.resizeObserver.unobserve(C.value)})),t.watch([()=>S.value.type,()=>S.value.sourcePosition,()=>S.value.targetPosition],(()=>{f([{id:e.id,nodeElement:C.value,forceUpdate:!0}])}),{flush:"pre"}),t.watch([()=>S.value.position.x,()=>S.value.position.y,()=>{var e;return null==(e=k.value)?void 0:e.computedPosition.x},()=>{var e;return null==(e=k.value)?void 0:e.computedPosition.y},()=>{var e;return null==(e=k.value)?void 0:e.computedPosition.z},()=>I(),()=>S.value.selected,()=>S.value.dimensions.height,()=>S.value.dimensions.width,()=>{var e;return null==(e=k.value)?void 0:e.dimensions.height},()=>{var e;return null==(e=k.value)?void 0:e.dimensions.width}],(([e,t,n,o,r,l])=>{const i={x:e,y:t,z:l+(m.value&&S.value.selected?1e3:0)};jr(n)&&jr(o)?S.value.computedPosition=function(e,t){return{x:t.x+e.x,y:t.y+e.y,z:(e.z>t.z?e.z:t.z)+1}}({x:n,y:o,z:r},i):S.value.computedPosition=i}),{flush:"post",immediate:!0}),t.watch([()=>S.value.extent,g],(([e,t],[n,o])=>{(e!==n||t!==o)&&z()})),"parent"===S.value.extent||"object"==typeof S.value.extent&&"range"in S.value.extent&&"parent"===S.value.extent.range?b((()=>S.value.initialized)).toBe(!0).then(z):z(),()=>t.h("div",{ref:C,"data-id":S.value.id,class:["vue-flow__node",`vue-flow__node-${!1===e.type?"default":e.name}`,{[r.value]:e.draggable,dragging:null==P?void 0:P.value,selected:S.value.selected,selectable:e.selectable,parent:S.value.isParent},O.value],style:{zIndex:S.value.computedPosition.z??I(),transform:`translate(${S.value.computedPosition.x}px,${S.value.computedPosition.y}px)`,pointerEvents:e.selectable||e.draggable?"all":"none",visibility:S.value.initialized?"visible":"hidden",...T.value},tabIndex:e.focusable?0:void 0,role:e.focusable?"button":void 0,"aria-describedby":y.value?void 0:`${jo}-${n}`,"aria-label":S.value.ariaLabel,onMouseenter:$,onMousemove:D,onMouseleave:R,onContextmenu:V,onClick:H,onDblclick:L,onKeydown:Y},[t.h(!1===e.type?v.value.default:e.type,{id:S.value.id,type:S.value.type,data:S.value.data,events:{...S.value.events,...B},selected:!!S.value.selected,resizing:!!S.value.resizing,dragging:P.value,connectable:e.connectable,position:S.value.position,dimensions:S.value.dimensions,isValidTargetPos:S.value.isValidTargetPos,isValidSourcePos:S.value.isValidSourcePos,parent:S.value.parentNode,zIndex:S.value.computedPosition.z,targetPosition:S.value.targetPosition,sourcePosition:S.value.sourcePosition,label:S.value.label,dragHandle:S.value.dragHandle,onUpdateNodeInternals:A})]);function z(){const e=S.value.computedPosition;x.value&&(e.x=E.value[0]*Math.round(e.x/E.value[0]),e.y=E.value[1]*Math.round(e.y/E.value[1]));const{computedPosition:t,position:n}=Ar(S.value,e,u.error,g.value,k.value);(S.value.computedPosition.x!==t.x||S.value.computedPosition.y!==t.y)&&(S.value.computedPosition={...S.value.computedPosition,...t}),(S.value.position.x!==n.x||S.value.position.y!==n.y)&&(S.value.position=n)}function A(){C.value&&f([{id:e.id,nodeElement:C.value,forceUpdate:!0}])}function $(e){null!=P&&P.value||M.mouseEnter({event:e,node:S.value,connectedEdges:N.value})}function D(e){null!=P&&P.value||M.mouseMove({event:e,node:S.value,connectedEdges:N.value})}function R(e){null!=P&&P.value||M.mouseLeave({event:e,node:S.value,connectedEdges:N.value})}function V(e){return M.contextMenu({event:e,node:S.value,connectedEdges:N.value})}function L(e){return M.doubleClick({event:e,node:S.value,connectedEdges:N.value})}function H(t){e.selectable&&(!l.value||!e.draggable)&&el(S.value,a.value,d,c,i,!1,C.value),M.click({event:t,node:S.value,connectedEdges:N.value})}function Y(t){if(!hi(t))if(Zo.includes(t.key)&&e.selectable){const e="Escape"===t.key;el(S.value,a.value,d,c,i,e,C.value)}else!y.value&&e.draggable&&S.value.selected&&qo[t.key]&&(w.value=`Moved selected node ${t.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~S.value.position.x}, y: ${~~S.value.position.y}`,_({x:qo[t.key].x,y:qo[t.key].y},t.shiftKey))}}}),bl=["transform"],xl=["width","height","x","y","rx","ry"],El=["y"],_l=t.defineComponent({name:"EdgeText",compatConfig:{MODE:3},props:{"aria-activedescendant":null,"aria-atomic":{type:[Boolean,String]},"aria-autocomplete":null,"aria-busy":{type:[Boolean,String]},"aria-checked":{type:[Boolean,String]},"aria-colcount":null,"aria-colindex":null,"aria-colspan":null,"aria-controls":null,"aria-current":{type:[Boolean,String]},"aria-describedby":null,"aria-details":null,"aria-disabled":{type:[Boolean,String]},"aria-dropeffect":null,"aria-errormessage":null,"aria-expanded":{type:[Boolean,String]},"aria-flowto":null,"aria-grabbed":{type:[Boolean,String]},"aria-haspopup":{type:[Boolean,String]},"aria-hidden":{type:[Boolean,String]},"aria-invalid":{type:[Boolean,String]},"aria-keyshortcuts":null,"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":null,"aria-modal":{type:[Boolean,String]},"aria-multiline":{type:[Boolean,String]},"aria-multiselectable":{type:[Boolean,String]},"aria-orientation":null,"aria-owns":null,"aria-placeholder":null,"aria-posinset":null,"aria-pressed":{type:[Boolean,String]},"aria-readonly":{type:[Boolean,String]},"aria-relevant":null,"aria-required":{type:[Boolean,String]},"aria-roledescription":null,"aria-rowcount":null,"aria-rowindex":null,"aria-rowspan":null,"aria-selected":{type:[Boolean,String]},"aria-setsize":null,"aria-sort":null,"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null,innerHTML:null,class:null,style:null,color:null,height:null,id:null,lang:null,max:null,media:null,method:null,min:null,name:null,target:null,type:null,width:null,role:null,tabindex:null,"accent-height":null,accumulate:null,additive:null,"alignment-baseline":null,allowReorder:null,alphabetic:null,amplitude:null,"arabic-form":null,ascent:null,attributeName:null,attributeType:null,autoReverse:null,azimuth:null,baseFrequency:null,"baseline-shift":null,baseProfile:null,bbox:null,begin:null,bias:null,by:null,calcMode:null,"cap-height":null,clip:null,"clip-path":null,clipPathUnits:null,"clip-rule":null,"color-interpolation":null,"color-interpolation-filters":null,"color-profile":null,"color-rendering":null,contentScriptType:null,contentStyleType:null,cursor:null,cx:null,cy:null,d:null,decelerate:null,descent:null,diffuseConstant:null,direction:null,display:null,divisor:null,"dominant-baseline":null,dur:null,dx:null,dy:null,edgeMode:null,elevation:null,"enable-background":null,end:null,exponent:null,externalResourcesRequired:null,fill:null,"fill-opacity":null,"fill-rule":null,filter:null,filterRes:null,filterUnits:null,"flood-color":null,"flood-opacity":null,focusable:null,"font-family":null,"font-size":null,"font-size-adjust":null,"font-stretch":null,"font-style":null,"font-variant":null,"font-weight":null,format:null,from:null,fx:null,fy:null,g1:null,g2:null,"glyph-name":null,"glyph-orientation-horizontal":null,"glyph-orientation-vertical":null,glyphRef:null,gradientTransform:null,gradientUnits:null,hanging:null,"horiz-adv-x":null,"horiz-origin-x":null,href:null,ideographic:null,"image-rendering":null,in2:null,in:null,intercept:null,k1:null,k2:null,k3:null,k4:null,k:null,kernelMatrix:null,kernelUnitLength:null,kerning:null,keyPoints:null,keySplines:null,keyTimes:null,lengthAdjust:null,"letter-spacing":null,"lighting-color":null,limitingConeAngle:null,local:null,"marker-end":null,markerHeight:null,"marker-mid":null,"marker-start":null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,mode:null,numOctaves:null,offset:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,"overline-position":null,"overline-thickness":null,"paint-order":null,"panose-1":null,pathLength:null,patternContentUnits:null,patternTransform:null,patternUnits:null,"pointer-events":null,points:null,pointsAtX:null,pointsAtY:null,pointsAtZ:null,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,r:null,radius:null,refX:null,refY:null,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:null,requiredFeatures:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,"shape-rendering":null,slope:null,spacing:null,specularConstant:null,specularExponent:null,speed:null,spreadMethod:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,"stop-color":null,"stop-opacity":null,"strikethrough-position":null,"strikethrough-thickness":null,string:null,stroke:null,"stroke-dasharray":null,"stroke-dashoffset":null,"stroke-linecap":null,"stroke-linejoin":null,"stroke-miterlimit":null,"stroke-opacity":null,"stroke-width":null,surfaceScale:null,systemLanguage:null,tableValues:null,targetX:null,targetY:null,"text-anchor":null,"text-decoration":null,textLength:null,"text-rendering":null,to:null,transform:null,u1:null,u2:null,"underline-position":null,"underline-thickness":null,unicode:null,"unicode-bidi":null,"unicode-range":null,"unitsPer-em":null,"v-alphabetic":null,values:null,"vector-effect":null,version:null,"vert-adv-y":null,"vert-origin-x":null,"vert-origin-y":null,"v-hanging":null,"v-ideographic":null,viewBox:null,viewTarget:null,visibility:null,"v-mathematical":null,widths:null,"word-spacing":null,"writing-mode":null,x1:null,x2:null,x:null,xChannelSelector:null,"x-height":null,xlinkActuate:null,xlinkArcrole:null,xlinkHref:null,xlinkRole:null,xlinkShow:null,xlinkTitle:null,xlinkType:null,xmlns:null,y1:null,y2:null,y:null,yChannelSelector:null,z:null,zoomAndPan:null,label:null,labelStyle:{default:{}},labelShowBg:{type:Boolean,default:!0},labelBgStyle:{default:{}},labelBgPadding:{default:[2,4]},labelBgBorderRadius:{default:2}},setup(e){const n=t.ref({x:0,y:0,width:0,height:0}),o=t.ref(null),r=t.computed((()=>`translate(${e.x-n.value.width/2} ${e.y-n.value.height/2})`));function l(){if(!o.value)return;const e=o.value.getBBox();(e.width!==n.value.width||e.height!==n.value.height)&&(n.value=e)}return t.onMounted(l),t.watch([()=>e.x,()=>e.y,o,()=>e.label],l),(l,i)=>(t.openBlock(),t.createElementBlock("g",{transform:t.unref(r),class:"vue-flow__edge-textwrapper"},[e.labelShowBg?(t.openBlock(),t.createElementBlock("rect",{key:0,class:"vue-flow__edge-textbg",width:`${n.value.width+2*e.labelBgPadding[0]}px`,height:`${n.value.height+2*e.labelBgPadding[1]}px`,x:-e.labelBgPadding[0],y:-e.labelBgPadding[1],style:t.normalizeStyle(e.labelBgStyle),rx:e.labelBgBorderRadius,ry:e.labelBgBorderRadius},null,12,xl)):t.createCommentVNode("",!0),t.createElementVNode("text",t.mergeProps(l.$attrs,{ref_key:"el",ref:o,class:"vue-flow__edge-text",y:n.value.height/2,dy:"0.3em",style:e.labelStyle}),[t.renderSlot(l.$slots,"default",{},(()=>[t.unref(Gr)(e.label)?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createTextVNode(t.toDisplayString(e.label),1)],64)):(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.label),{key:0}))]))],16,El)],8,bl))}}),Sl=["id","d","marker-end","marker-start"],kl=["d","stroke-width"],Nl=t.defineComponent({name:"BaseEdge",inheritAttrs:!1,compatConfig:{MODE:3},props:{labelStyle:null,labelShowBg:{type:Boolean,default:!0},labelBgStyle:null,labelBgPadding:null,labelBgBorderRadius:null,id:null,labelX:null,labelY:null,path:null,label:null,markerStart:null,markerEnd:null,interactionWidth:{default:20},style:null,ref:null},setup(e,{expose:n}){const o=rl(e,["interactionWidth","labelShowBg"]),r=t.ref(null),l=t.ref(null),i=t.ref(null),a=t.useAttrs();return n({pathEl:r,interactionEl:l,labelEl:i}),(n,u)=>(t.openBlock(),t.createElementBlock(t.Fragment,null,[t.createElementVNode("path",{id:e.id,ref_key:"pathEl",ref:r,d:e.path,style:t.normalizeStyle(t.unref(o).style),class:t.normalizeClass(["vue-flow__edge-path",t.unref(a).class]),"marker-end":e.markerEnd,"marker-start":e.markerStart},null,14,Sl),e.interactionWidth?(t.openBlock(),t.createElementBlock("path",{key:0,ref_key:"interactionEl",ref:l,fill:"none",d:e.path,"stroke-width":e.interactionWidth,"stroke-opacity":0,class:"vue-flow__edge-interaction"},null,8,kl)):t.createCommentVNode("",!0),e.label&&t.unref(jr)(e.labelX)&&t.unref(jr)(e.labelY)?(t.openBlock(),t.createBlock(_l,{key:1,ref_key:"labelEl",ref:i,x:e.labelX,y:e.labelY,label:e.label,"label-show-bg":e.labelShowBg,"label-bg-style":e.labelBgStyle,"label-bg-padding":e.labelBgPadding,"label-bg-border-radius":e.labelBgBorderRadius,"label-style":e.labelStyle},null,8,["x","y","label","label-show-bg","label-bg-style","label-bg-padding","label-bg-border-radius","label-style"])):t.createCommentVNode("",!0)],64))}});function Cl({sourceX:e,sourceY:t,targetX:n,targetY:o}){const r=Math.abs(n-e)/2,l=n<e?n+r:n-r,i=Math.abs(o-t)/2;return[l,o<t?o+i:o-i,r,i]}function Ml({sourceX:e,sourceY:t,targetX:n,targetY:o,sourceControlX:r,sourceControlY:l,targetControlX:i,targetControlY:a}){const u=.125*e+.375*r+.375*i+.125*n,s=.125*t+.375*l+.375*a+.125*o;return[u,s,Math.abs(u-e),Math.abs(s-t)]}function Bl(e,t){return e>=0?.5*e:25*t*Math.sqrt(-e)}function Pl({pos:e,x1:t,y1:n,x2:o,y2:r,c:l}){let i,a;switch(e){case Vo.Left:i=t-Bl(t-o,l),a=n;break;case Vo.Right:i=t+Bl(o-t,l),a=n;break;case Vo.Top:i=t,a=n-Bl(n-r,l);break;case Vo.Bottom:i=t,a=n+Bl(r-n,l)}return[i,a]}function Ol({sourceX:e,sourceY:t,sourcePosition:n=Vo.Bottom,targetX:o,targetY:r,targetPosition:l=Vo.Top,curvature:i=.25}){const[a,u]=Pl({pos:n,x1:e,y1:t,x2:o,y2:r,c:i}),[s,c]=Pl({pos:l,x1:o,y1:r,x2:e,y2:t,c:i}),[d,f,h,p]=Ml({sourceX:e,sourceY:t,targetX:o,targetY:r,sourceControlX:a,sourceControlY:u,targetControlX:s,targetControlY:c});return[`M${e},${t} C${a},${u} ${s},${c} ${o},${r}`,d,f,h,p]}function Tl({pos:e,x1:t,y1:n,x2:o,y2:r}){let l,i;switch(e){case Vo.Left:case Vo.Right:l=.5*(t+o),i=n;break;case Vo.Top:case Vo.Bottom:l=t,i=.5*(n+r)}return[l,i]}function Il({sourceX:e,sourceY:t,sourcePosition:n=Vo.Bottom,targetX:o,targetY:r,targetPosition:l=Vo.Top}){const[i,a]=Tl({pos:n,x1:e,y1:t,x2:o,y2:r}),[u,s]=Tl({pos:l,x1:o,y1:r,x2:e,y2:t}),[c,d,f,h]=Ml({sourceX:e,sourceY:t,targetX:o,targetY:r,sourceControlX:i,sourceControlY:a,targetControlX:u,targetControlY:s});return[`M${e},${t} C${i},${a} ${u},${s} ${o},${r}`,c,d,f,h]}const zl={[Vo.Left]:{x:-1,y:0},[Vo.Right]:{x:1,y:0},[Vo.Top]:{x:0,y:-1},[Vo.Bottom]:{x:0,y:1}};function Al(e,t){return Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2)}function $l({source:e,sourcePosition:t=Vo.Bottom,target:n,targetPosition:o=Vo.Top,center:r,offset:l}){const i=zl[t],a=zl[o],u={x:e.x+i.x*l,y:e.y+i.y*l},s={x:n.x+a.x*l,y:n.y+a.y*l},c=function({source:e,sourcePosition:t=Vo.Bottom,target:n}){return t===Vo.Left||t===Vo.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}}({source:u,sourcePosition:t,target:s}),d=0!==c.x?"x":"y",f=c[d];let h,p,v;const[g,m,y,w]=Cl({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(i[d]*a[d]==-1){p=r.x||g,v=r.y||m;const e=[{x:p,y:u.y},{x:p,y:s.y}],t=[{x:u.x,y:v},{x:s.x,y:v}];h=i[d]===f?"x"===d?e:t:"x"===d?t:e}else{const e=[{x:u.x,y:s.y}],n=[{x:s.x,y:u.y}];if(h="x"===d?i.x===f?n:e:i.y===f?e:n,t!==o){const t="x"===d?"y":"x",o=i[d]===a[t],r=u[t]>s[t],l=u[t]<s[t];(1===i[d]&&(!o&&r||o&&l)||1!==i[d]&&(!o&&l||o&&r))&&(h="x"===d?e:n)}p=h[0].x,v=h[0].y}return[[e,u,...h,s,n],p,v,y,w]}function Dl({sourceX:e,sourceY:t,sourcePosition:n=Vo.Bottom,targetX:o,targetY:r,targetPosition:l=Vo.Top,borderRadius:i=5,centerX:a,centerY:u,offset:s=20}){const[c,d,f,h,p]=$l({source:{x:e,y:t},sourcePosition:n,target:{x:o,y:r},targetPosition:l,center:{x:a,y:u},offset:s});return[c.reduce(((e,t,n)=>{let o;return o=n>0&&n<c.length-1?function(e,t,n,o){const r=Math.min(Al(e,t)/2,Al(t,n)/2,o),{x:l,y:i}=t;if(e.x===l&&l===n.x||e.y===i&&i===n.y)return`L${l} ${i}`;if(e.y===i)return`L ${l+r*(e.x<n.x?-1:1)},${i}Q ${l},${i} ${l},${i+r*(e.y<n.y?1:-1)}`;const a=e.x<n.x?1:-1;return`L ${l},${i+r*(e.y<n.y?-1:1)}Q ${l},${i} ${l+r*a},${i}`}(c[n-1],t,c[n+1],i):`${0===n?"M":"L"}${t.x} ${t.y}`,e+=o}),""),d,f,h,p]}function Rl({sourceX:e,sourceY:t,targetX:n,targetY:o}){const[r,l,i,a]=Cl({sourceX:e,sourceY:t,targetX:n,targetY:o});return[`M ${e},${t}L ${n},${o}`,r,l,i,a]}const Vl=t.defineComponent({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:n})=>()=>{const[o,r,l]=Ol({...e,sourcePosition:e.sourcePosition??Vo.Bottom,targetPosition:e.targetPosition??Vo.Top});return t.h(Nl,{path:o,labelX:r,labelY:l,...n,...e})}}),Ll=t.defineComponent({name:"SimpleBezierEdge",props:["sourcePosition","targetPosition","label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","markerEnd","markerStart","interactionWidth"],compatConfig:{MODE:3},setup:(e,{attrs:n})=>()=>{const[o,r,l]=Il({...e,sourcePosition:e.sourcePosition??Vo.Bottom,targetPosition:e.targetPosition??Vo.Top});return t.h(Nl,{path:o,labelX:r,labelY:l,...n,...e})}}),Hl=t.defineComponent({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:n})=>()=>{const[o,r,l]=Dl({...e,sourcePosition:e.sourcePosition??Vo.Bottom,targetPosition:e.targetPosition??Vo.Top});return t.h(Nl,{path:o,labelX:r,labelY:l,...n,...e})}}),Yl=t.defineComponent({name:"StepEdge",props:["sourcePosition","targetPosition","label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","markerEnd","markerStart","interactionWidth"],setup:(e,{attrs:n})=>()=>t.h(Hl,{...e,...n,borderRadius:0})}),Fl=t.defineComponent({name:"StraightEdge",props:["label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","markerEnd","markerStart","interactionWidth"],compatConfig:{MODE:3},setup:(e,{attrs:n})=>()=>{const[o,r,l]=Rl(e);return t.h(Nl,{path:o,labelX:r,labelY:l,...n,...e})}});function Gl(e,t,n){return n===Vo.Left?e-t:n===Vo.Right?e+t:e}function Xl(e,t,n){return n===Vo.Top?e-t:n===Vo.Bottom?e+t:e}const jl=function({radius:e=10,centerX:n=0,centerY:o=0,position:r=Vo.Top,type:l}){return t.h("circle",{class:`vue-flow__edgeupdater vue-flow__edgeupdater-${l}`,cx:Gl(n,e,r),cy:Xl(o,e,r),r:e,stroke:"transparent",fill:"transparent"})};jl.props=["radius","centerX","centerY","position","type"],jl.compatConfig={MODE:3};const Ul=jl,Zl=t.defineComponent({name:"Edge",compatConfig:{MODE:3},props:["name","type","id","updatable","selectable","focusable","edge"],setup(e){const{id:n,addSelectedEdges:o,connectionMode:r,edgeUpdaterRadius:l,emits:i,nodesSelectionActive:a,noPanClassName:u,getEdgeTypes:s,removeSelectedEdges:c,findEdge:d,findNode:f,isValidConnection:h}=ui(),p=function(e,t){const n={doubleClick:Br(),click:Br(),mouseEnter:Br(),mouseMove:Br(),mouseLeave:Br(),contextMenu:Br(),updateStart:Br(),update:Br(),updateEnd:Br()};return n.doubleClick.on((n=>{var o,r;t.edgeDoubleClick(n),null==(r=null==(o=e.events)?void 0:o.doubleClick)||r.call(o,n)})),n.click.on((n=>{var o,r;t.edgeClick(n),null==(r=null==(o=e.events)?void 0:o.click)||r.call(o,n)})),n.mouseEnter.on((n=>{var o,r;t.edgeMouseEnter(n),null==(r=null==(o=e.events)?void 0:o.mouseEnter)||r.call(o,n)})),n.mouseMove.on((n=>{var o,r;t.edgeMouseMove(n),null==(r=null==(o=e.events)?void 0:o.mouseMove)||r.call(o,n)})),n.mouseLeave.on((n=>{var o,r;t.edgeMouseLeave(n),null==(r=null==(o=e.events)?void 0:o.mouseLeave)||r.call(o,n)})),n.contextMenu.on((n=>{var o,r;t.edgeContextMenu(n),null==(r=null==(o=e.events)?void 0:o.contextMenu)||r.call(o,n)})),n.updateStart.on((n=>{var o,r;t.edgeUpdateStart(n),null==(r=null==(o=e.events)?void 0:o.updateStart)||r.call(o,n)})),n.update.on((n=>{var o,r;t.edgeUpdate(n),null==(r=null==(o=e.events)?void 0:o.update)||r.call(o,n)})),n.updateEnd.on((n=>{var o,r;t.edgeUpdateEnd(n),null==(r=null==(o=e.events)?void 0:o.updateEnd)||r.call(o,n)})),Object.entries(n).reduce(((e,[t,n])=>(e.emit[t]=n.trigger,e.on[t]=n.on,e)),{emit:{},on:{}})}(e.edge,i),v=j(e,"edge"),g=t.ref(!1),m=t.ref(!1),y=t.ref(""),w=t.ref(null),b=t.ref("source"),x=t.ref(null);t.provide(gl,e.id),t.provide(ml,x);const E=t.computed((()=>v.value.class instanceof Function?v.value.class(v.value):v.value.class)),_=t.computed((()=>v.value.style instanceof Function?v.value.style(v.value):v.value.style)),{handlePointerDown:S}=di({nodeId:y,handleId:w,type:b,isValidConnection:h,edgeUpdaterType:b,onEdgeUpdate:function(e,t){p.emit.update({event:e,edge:v.value,connection:t})},onEdgeUpdateEnd:function(e){p.emit.updateEnd({event:e,edge:v.value}),m.value=!1}});return()=>{const o=f(v.value.source),i=f(v.value.target);if(!o||!i||!v.value||o.hidden||i.hidden)return null;let a;a=r.value===Yo.Strict?o.handleBounds.source:[...o.handleBounds.source||[],...o.handleBounds.target||[]];const c=Dr(a,v.value.sourceHandle);let d;d=r.value===Yo.Strict?i.handleBounds.target:[...i.handleBounds.target||[],...i.handleBounds.source||[]];const h=Dr(d,v.value.targetHandle),y=c?c.position:Vo.Bottom,w=h?h.position:Vo.Top,{sourceX:b,sourceY:S,targetY:C,targetX:D}=function(e,t,n,o,r,l){const i=$r(n,{...e.dimensions,...e.computedPosition},t),a=$r(l,{...o.dimensions,...o.computedPosition},r);return{sourceX:i.x,sourceY:i.y,targetX:a.x,targetY:a.y}}(o,c,y,i,h,w);return v.value.sourceX=b,v.value.sourceY=S,v.value.targetX=D,v.value.targetY=C,t.h("g",{ref:x,key:e.id,"data-id":e.id,class:["vue-flow__edge",`vue-flow__edge-${!1===e.type?"default":e.name}`,u.value,E.value,{updating:g.value,selected:v.value.selected,animated:v.value.animated,inactive:!e.selectable}],onClick:M,onContextmenu:B,onDblclick:P,onMouseenter:O,onMousemove:T,onMouseleave:I,onKeyDown:e.focusable?$:void 0,tabIndex:e.focusable?0:void 0,"aria-label":null===v.value.ariaLabel?void 0:v.value.ariaLabel||`Edge from ${v.value.source} to ${v.value.target}`,"aria-describedby":e.focusable?`${Uo}-${n}`:void 0,role:e.focusable?"button":void 0},[m.value?null:t.h(!1===e.type?s.value.default:e.type,{id:e.id,sourceNode:o,targetNode:i,source:v.value.source,target:v.value.target,type:v.value.type,updatable:e.updatable,selected:v.value.selected,animated:v.value.animated,label:v.value.label,labelStyle:v.value.labelStyle,labelShowBg:v.value.labelShowBg,labelBgStyle:v.value.labelBgStyle,labelBgPadding:v.value.labelBgPadding,labelBgBorderRadius:v.value.labelBgBorderRadius,data:v.value.data,events:{...v.value.events,...p.on},style:_.value,markerStart:`url(#${br(v.value.markerStart,n)})`,markerEnd:`url(#${br(v.value.markerEnd,n)})`,sourcePosition:y,targetPosition:w,sourceX:b,sourceY:S,targetX:D,targetY:C,sourceHandleId:v.value.sourceHandle,targetHandleId:v.value.targetHandle,interactionWidth:v.value.interactionWidth}),["source"===e.updatable||!0===e.updatable?[t.h("g",{onMousedown:z,onMouseenter:k,onMouseout:N},t.h(Ul,{position:y,centerX:b,centerY:S,radius:l.value,type:"source","data-type":"source"}))]:null,"target"===e.updatable||!0===e.updatable?[t.h("g",{onMousedown:A,onMouseenter:k,onMouseout:N},t.h(Ul,{position:w,centerX:D,centerY:C,radius:l.value,type:"target","data-type":"target"}))]:null]])};function k(){g.value=!0}function N(){g.value=!1}function C(e,t){0===e.button&&(m.value=!0,y.value=t?v.value.target:v.value.source,w.value=(t?v.value.targetHandle:v.value.sourceHandle)??"",b.value=t?"target":"source",p.emit.updateStart({event:e,edge:v.value}),S(e))}function M(t){const n={event:t,edge:v.value};e.selectable&&(a.value=!1,o([v.value])),p.emit.click(n)}function B(e){p.emit.contextMenu({event:e,edge:v.value})}function P(e){p.emit.doubleClick({event:e,edge:v.value})}function O(e){p.emit.mouseEnter({event:e,edge:v.value})}function T(e){p.emit.mouseMove({event:e,edge:v.value})}function I(e){p.emit.mouseLeave({event:e,edge:v.value})}function z(e){C(e,!0)}function A(e){C(e,!1)}function $(t){var n;Zo.includes(t.key)&&e.selectable&&("Escape"===t.key?(null==(n=x.value)||n.blur(),c([d(e.id)])):o([d(e.id)]))}}}),ql={height:"0",width:"0"},Kl=t.defineComponent({name:"EdgeLabelRenderer",compatConfig:{MODE:3},setup(e){const{viewportRef:n}=ui(),o=u((()=>n.value.getElementsByClassName("vue-flow__edge-labels")[0]));return(e,n)=>(t.openBlock(),t.createElementBlock("svg",null,[(t.openBlock(),t.createElementBlock("foreignObject",ql,[(t.openBlock(),t.createBlock(t.Teleport,{to:t.unref(o),disabled:!t.unref(o)},[t.renderSlot(e.$slots,"default")],8,["to","disabled"]))]))]))}}),Wl={[Vo.Left]:Vo.Right,[Vo.Right]:Vo.Left,[Vo.Top]:Vo.Bottom,[Vo.Bottom]:Vo.Top},Jl=t.defineComponent({name:"ConnectionLine",compatConfig:{MODE:3},setup(){var e;const{connectionMode:n,connectionStartHandle:o,connectionEndHandle:r,connectionPosition:l,connectionLineType:i,connectionLineStyle:a,connectionLineOptions:u,connectionStatus:s,viewport:c,findNode:d}=ui(),f=null==(e=t.inject(yl))?void 0:e["connection-line"];return()=>{var e,h,p,v;if(!o.value)return null;const g=d(o.value.nodeId);if(!g)return null;const m=o.value.handleId,y=o.value.type,w=(null==(e=r.value)?void 0:e.handleId)&&d(r.value.nodeId)||null,b=(l.value.x-c.value.x)/c.value.zoom,x=(l.value.y-c.value.y)/c.value.zoom,E=g.handleBounds;let _=null==E?void 0:E[y];if(n.value===Yo.Loose&&(_=_||(null==E?void 0:E["source"===y?"target":"source"])),!_)return null;const S=(m?_.find((e=>e.id===m)):_[0])??null,k=(null==S?void 0:S.position)||Vo.Top,{x:N,y:C}=$r(k,{...g.dimensions,...g.computedPosition},S),M=w&&(null==(h=r.value)?void 0:h.handleId)&&((n.value===Yo.Strict?null==(p=w.handleBounds["source"===y?"target":"source"])?void 0:p.find((e=>{var t;return e.id===(null==(t=r.value)?void 0:t.handleId)})):[...w.handleBounds.source||[],...w.handleBounds.target||[]].find((e=>{var t;return e.id===(null==(t=r.value)?void 0:t.handleId)})))||(null==(v=w.handleBounds[y??"target"])?void 0:v[0]))||null,B=k?Wl[k]:null;if(!k||!B)return null;const P=i.value??u.value.type;let O="";const T={sourceX:N,sourceY:C,sourcePosition:k,targetX:b,targetY:x,targetPosition:B};return P===Ho.Bezier?[O]=Ol(T):P===Ho.Step?[O]=Dl({...T,borderRadius:0}):P===Ho.SmoothStep?[O]=Dl(T):P===Ho.SimpleBezier?[O]=Il(T):O=`M${N},${C} ${b},${x}`,t.h("svg",{class:"vue-flow__edges vue-flow__connectionline vue-flow__container"},t.h("g",{class:"vue-flow__connection"},f?t.h(f,{sourceX:N,sourceY:C,sourcePosition:k,targetX:b,targetY:x,targetPosition:B,sourceNode:g,sourceHandle:S,targetNode:w,targetHandle:M,markerEnd:`url(#${br(u.value.markerEnd)})`,markerStart:`url(#${br(u.value.markerStart)})`,connectionStatus:s.value}):t.h("path",{d:O,class:[u.value.class,s,"vue-flow__connection-path"],style:a.value||u.value.style,"marker-end":`url(#${br(u.value.markerEnd)})`,"marker-start":`url(#${br(u.value.markerStart)})`})))}}}),Ql=["tabIndex"],ei=t.defineComponent({name:"NodesSelection",compatConfig:{MODE:3},setup(e){const n=ui(),o=t.toRef(n,"emits"),r=t.toRef(n,"viewport"),l=t.toRef(n,"getSelectedNodes"),i=t.toRef(n,"noPanClassName"),a=t.toRef(n,"disableKeyboardA11y"),u=t.toRef(n,"userSelectionActive"),s=gi(),c=t.ref(null),d=ol({el:c,onStart(e){o.value.selectionDragStart(e)},onDrag(e){o.value.selectionDrag(e)},onStop(e){o.value.selectionDragStop(e)}});t.onMounted((()=>{var e;a.value||null==(e=c.value)||e.focus({preventScroll:!0})}));const f=t.computed((()=>vr(l.value))),h=t.computed((()=>({width:`${f.value.width}px`,height:`${f.value.height}px`,top:`${f.value.y}px`,left:`${f.value.x}px`})));function p(e){o.value.selectionContextMenu({event:e,nodes:l.value})}function v(e){a.value||qo[e.key]&&s({x:qo[e.key].x,y:qo[e.key].y},e.shiftKey)}return(e,n)=>!t.unref(u)&&t.unref(f).width&&t.unref(f).height?(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(["vue-flow__nodesselection vue-flow__container",t.unref(i)]),style:t.normalizeStyle({transform:`translate(${t.unref(r).x}px,${t.unref(r).y}px) scale(${t.unref(r).zoom})`})},[t.createElementVNode("div",{ref_key:"el",ref:c,class:t.normalizeClass([{dragging:t.unref(d)},"vue-flow__nodesselection-rect"]),style:t.normalizeStyle(t.unref(h)),tabIndex:t.unref(a)?void 0:-1,onContextmenu:p,onKeydown:v},null,46,Ql)],6)):t.createCommentVNode("",!0)}}),ti=t.defineComponent({name:"UserSelection",compatConfig:{MODE:3},props:{userSelectionRect:null},setup:e=>(n,o)=>(t.openBlock(),t.createElementBlock("div",{class:"vue-flow__selection vue-flow__container",style:t.normalizeStyle({width:`${e.userSelectionRect.width}px`,height:`${e.userSelectionRect.height}px`,transform:`translate(${e.userSelectionRect.x}px, ${e.userSelectionRect.y}px)`})},null,4))}),ni={input:cl,default:ul,output:fl},oi={default:Vl,straight:Fl,step:Yl,smoothstep:Hl,simplebezier:Ll};function ri(e){const t={vueFlowRef:null,viewportRef:null,nodes:[],edges:[],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:Lo.Full,paneDragging:!1,preventScrolling:!0,zoomOnScroll:!0,zoomOnPinch:!0,zoomOnDoubleClick:!0,panOnScroll:!1,panOnScrollSpeed:.5,panOnScrollMode:Go.Free,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:Ho.Bezier,style:{}},connectionMode:Yo.Loose,connectionStartHandle:null,connectionEndHandle:null,connectionClickStartHandle:null,connectionPosition:{x:NaN,y:NaN},connectionRadius:20,connectOnClick:!0,connectionStatus:null,isValidConnection:null,snapGrid:[15,15],snapToGrid:!1,edgesUpdatable:!1,edgesFocusable:!0,nodesFocusable:!0,nodesConnectable:!0,nodesDraggable:!0,elementsSelectable:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,selectionKeyCode:"Shift",multiSelectionKeyCode:"Meta",zoomActivationKeyCode:"Meta",deleteKeyCode:"Backspace",panActivationKeyCode:"Space",hooks:{edgesChange:Br(),nodesChange:Br(),nodeDoubleClick:Br(),nodeClick:Br(),nodeMouseEnter:Br(),nodeMouseMove:Br(),nodeMouseLeave:Br(),nodeContextMenu:Br(),nodeDragStart:Br(),nodeDrag:Br(),nodeDragStop:Br(),nodesInitialized:Br(),miniMapNodeClick:Br(),miniMapNodeDoubleClick:Br(),miniMapNodeMouseEnter:Br(),miniMapNodeMouseMove:Br(),miniMapNodeMouseLeave:Br(),connect:Br(),connectStart:Br(),connectEnd:Br(),clickConnectStart:Br(),clickConnectEnd:Br(),paneReady:Br(),move:Br(),moveStart:Br(),moveEnd:Br(),selectionDragStart:Br(),selectionDrag:Br(),selectionDragStop:Br(),selectionContextMenu:Br(),selectionStart:Br(),selectionEnd:Br(),viewportChangeStart:Br(),viewportChange:Br(),viewportChangeEnd:Br(),paneScroll:Br(),paneClick:Br(),paneContextMenu:Br(),paneMouseEnter:Br(),paneMouseMove:Br(),paneMouseLeave:Br(),edgeContextMenu:Br(),edgeMouseEnter:Br(),edgeMouseMove:Br(),edgeMouseLeave:Br(),edgeDoubleClick:Br(),edgeClick:Br(),edgeUpdateStart:Br(),edgeUpdate:Br(),edgeUpdateEnd:Br(),updateNodeInternals:Br(),error:Br((e=>Jr(e.message)))},applyDefault:!0,autoConnect:!1,fitViewOnInit:!1,noDragClassName:"nodrag",noWheelClassName:"nowheel",noPanClassName:"nopan",defaultEdgeOptions:void 0,elevateEdgesOnSelect:!1,elevateNodesOnSelect:!0,autoPanOnNodeDrag:!0,autoPanOnConnect:!0,disableKeyboardA11y:!1,ariaLiveMessage:"",__experimentalFeatures:{nestedFlow:!1}};return e&&Object.keys(e).forEach((n=>{const o=e[n];tl(o)&&(t[n]=o)})),t}function li(e,t,n,o,r,l,i){const a=bi(o,r),u=e=>{const t=e??l.value??[];o.hooks.updateNodeInternals.trigger(t)},s=e=>{if(e)return o.nodes&&!l.value.length?o.nodes.find((t=>t.id===e)):o.nodes[l.value.indexOf(e)]},c=e=>{if(e)return o.edges&&!i.value.length?o.edges.find((t=>t.id===e)):o.edges[i.value.indexOf(e)]},d=(e,t)=>{const n=e.map((e=>e.id));let r,l=[];if(o.multiSelectionActive)r=n.map((e=>kr(e,t)));else{const e=Mr([...o.nodes,...o.edges],n);r=e.changedNodes,l=e.changedEdges}r.length&&o.hooks.nodesChange.trigger(r),l.length&&o.hooks.edgesChange.trigger(l)},f=(e,t)=>{const n=e.map((e=>e.id));let r,l=[];if(o.multiSelectionActive)r=n.map((e=>kr(e,t)));else{const e=Mr([...o.nodes,...o.edges],n);l=e.changedNodes,r=e.changedEdges}l.length&&o.hooks.nodesChange.trigger(l),r.length&&o.hooks.edgesChange.trigger(r)},h=(e,t)=>{const n=e.filter(rr).map((e=>e.id)),r=e.filter(nr).map((e=>e.id));let{changedNodes:l,changedEdges:i}=Mr([...o.nodes,...o.edges],[...n,...r]);o.multiSelectionActive&&(l=n.map((e=>kr(e,t))),i=r.map((e=>kr(e,t)))),l.length&&o.hooks.nodesChange.trigger(l),i.length&&o.hooks.edgesChange.trigger(i)},p=e=>{var t;null==(t=o.d3Zoom)||t.scaleExtent([e,o.maxZoom]),o.minZoom=e},v=e=>{var t;null==(t=o.d3Zoom)||t.scaleExtent([o.minZoom,e]),o.maxZoom=e},g=e=>{var t;null==(t=o.d3Zoom)||t.translateExtent(e),o.translateExtent=e},m=e=>{o.nodeExtent=e,u(l.value)},y=e=>{const t=e instanceof Function?e(o.nodes):e;!o.initialized&&!t.length||(o.nodes=nl(t,o.nodes,s,o.hooks.error.trigger))},w=e=>{const t=e instanceof Function?e(o.edges):e;if(!o.initialized&&!t.length)return;const n=o.isValidConnection?t.filter((e=>o.isValidConnection(e,{edges:o.edges,sourceNode:s(e.source),targetNode:s(e.target)}))):t;o.edges=n.reduce(((e,t)=>{const n=s(t.source),r=s(t.target),l=!n||typeof n>"u",i=!r||typeof r>"u";if(l&&i?o.hooks.error.trigger(new Hr(Vr.EDGE_SOURCE_TARGET_MISSING,t.id,t.source,t.target)):(l&&o.hooks.error.trigger(new Hr(Vr.EDGE_SOURCE_MISSING,t.id,t.source)),i&&o.hooks.error.trigger(new Hr(Vr.EDGE_TARGET_MISSING,t.id,t.target))),l||i)return e;const a=c(t.id);return e.push({...ir(t,Object.assign({},a,o.defaultEdgeOptions)),sourceNode:n,targetNode:r}),e}),[])},x=e=>{const t=e instanceof Function?e([...o.nodes,...o.edges]):e;!o.initialized&&!t.length||(y(t.filter(rr)),w(t.filter(nr)))},E=e=>{const t=function(e){return!!(e.width&&e.height&&e.x&&e.y)}(e),n=t?null:s(e.id);return t||n?[t?e:Ko(n),n,t]:[null,null,t]},_=e=>{const t=e instanceof Function?e(o):e,n=["modelValue","nodes","edges","maxZoom","minZoom","translateExtent","nodeExtent","hooks","defaultEdgeOptions"],r=["d3Zoom","d3Selection","d3ZoomHandler","viewportRef","vueFlowRef","dimensions","hooks"];tl(t.defaultEdgeOptions)&&(o.defaultEdgeOptions=t.defaultEdgeOptions);const l=t.modelValue||t.nodes||t.edges?[]:void 0;l&&(t.modelValue&&l.push(...t.modelValue),t.nodes&&l.push(...t.nodes),t.edges&&l.push(...t.edges),x(l));const i=()=>{tl(t.maxZoom)&&v(t.maxZoom),tl(t.minZoom)&&p(t.minZoom),tl(t.translateExtent)&&g(t.translateExtent),tl(t.nodeExtent)&&m(t.nodeExtent)};Object.keys(t).forEach((e=>{const l=e,i=t[l];![...n,...r].includes(l)&&tl(i)&&(o[l]=i)})),o.d3Zoom?i():b((()=>o.d3Zoom)).not.toBeUndefined().then(i),o.initialized||(o.initialized=!0)},S={updateNodePositions:(e,t,n)=>{const r=[];e.forEach((e=>{var o,l;const i={id:e.id,type:"position",dragging:n,from:e.from};if(t&&(i.position=e.position,e.parentNode)){const t=s(e.parentNode);i.position={x:i.position.x-((null==(o=null==t?void 0:t.computedPosition)?void 0:o.x)??0),y:i.position.y-((null==(l=null==t?void 0:t.computedPosition)?void 0:l.y)??0)}}r.push(i)})),null!=r&&r.length&&o.hooks.nodesChange.trigger(r)},updateNodeDimensions:e=>{var t;if(!o.vueFlowRef)return;const n=o.vueFlowRef.querySelector(".vue-flow__transformationpane");if(!n)return;let r;if(null!=(t=o.__experimentalFeatures)&&t.nestedFlow){let e,t=[n],o=n;for(;!e&&o;)o=o.parentElement,e=null==o?void 0:o.classList.contains("vue-flow__transformationpane"),e&&(t=[o,...t]);t.forEach((e=>{const t=window.getComputedStyle(e),{m22:n}=new window.DOMMatrixReadOnly(t.transform);r?r*=n:r=n}))}else{const e=window.getComputedStyle(n),{m22:t}=new window.DOMMatrixReadOnly(e.transform);r=t}const l=e.reduce(((e,t)=>{const n=s(t.id);if(n){const o=Jo(t.nodeElement);o.width&&o.height&&(n.dimensions.width!==o.width||n.dimensions.height!==o.height||t.forceUpdate)&&(n.handleBounds.source=Qr(".source",t.nodeElement,r),n.handleBounds.target=Qr(".target",t.nodeElement,r),n.dimensions=o,n.initialized=!0,e.push({id:n.id,type:"dimensions",dimensions:o}))}return e}),[]);l.length&&o.hooks.nodesChange.trigger(l)},setElements:x,setNodes:y,setEdges:w,addNodes:e=>{let t=e instanceof Function?e(o.nodes):e;t=Array.isArray(t)?t:[t];const n=nl(t,o.nodes,s,o.hooks.error.trigger).map(Nr);n.length&&o.hooks.nodesChange.trigger(n)},addEdges:e=>{let t=e instanceof Function?e(o.edges):e;t=Array.isArray(t)?t:[t];const n=(o.isValidConnection?t.filter((e=>o.isValidConnection(e,{edges:o.edges,sourceNode:s(e.source),targetNode:s(e.target)}))):t).reduce(((e,t)=>{const n=function(e,t,n){if(!e.source||!e.target)return n(new Hr(Vr.EDGE_INVALID,e.id)),!1;let o;return o=nr(e)?e:{...e,id:ur(e)},o=ir(o),!sr(o,t)&&o}({...t,...o.defaultEdgeOptions},o.edges,o.hooks.error.trigger);if(n){const t=s(n.source),r=s(n.target),l=!t||typeof t>"u",i=!r||typeof r>"u";if(l&&i?o.hooks.error.trigger(new Hr(Vr.EDGE_SOURCE_TARGET_MISSING,n.id,n.source,n.target)):(l&&o.hooks.error.trigger(new Hr(Vr.EDGE_SOURCE_MISSING,n.id,n.source)),i&&o.hooks.error.trigger(new Hr(Vr.EDGE_TARGET_MISSING,n.id,n.target))),l||i)return e;e.push(Nr({...n,sourceNode:t,targetNode:r}))}return e}),[]);n.length&&o.hooks.edgesChange.trigger(n)},removeNodes:(e,t=!0,n=!1)=>{let r=e instanceof Function?e(o.nodes):e;r=Array.isArray(r)?r:[r];const l=[],i=[];function a(e){const t=mr(e,o.edges).filter((e=>!tl(e.deletable)||e.deletable));i.push(...t.map((e=>Cr(e.id))))}function u(e){const n=o.nodes.filter((t=>t.parentNode===e));if(n.length){const e=n.map((e=>e.id));l.push(...e.map((e=>Cr(e)))),t&&a(n),n.forEach((e=>{u(e.id)}))}}r.forEach((e=>{const o="string"==typeof e?s(e):e;o&&(tl(o.deletable)&&!o.deletable||(l.push(Cr(o.id)),t&&a([o]),n&&u(o.id)))})),i.length&&o.hooks.edgesChange.trigger(i),l.length&&o.hooks.nodesChange.trigger(l)},removeEdges:e=>{let t=e instanceof Function?e(o.edges):e;t=Array.isArray(t)?t:[t];const n=[];t.forEach((e=>{const t="string"==typeof e?c(e):e;t&&(tl(t.deletable)&&!t.deletable||n.push(Cr("string"==typeof e?e:e.id)))})),o.hooks.edgesChange.trigger(n)},findNode:s,findEdge:c,updateEdge:(e,t,n=!0)=>function(e,t,n,o,r,l){if(!t.source||!t.target)return l(new Hr(Vr.EDGE_INVALID,e.id)),!1;const i=o(e.id);if(!i)return l(new Hr(Vr.EDGE_NOT_FOUND,e.id)),!1;const{id:a,...u}=e,s={...u,id:r?ur(t):a,source:t.source,target:t.target,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle};return n.splice(n.indexOf(i),1,s),s}(e,t,o.edges,c,n,o.hooks.error.trigger),applyEdgeChanges:e=>Sr(e,o.edges),applyNodeChanges:e=>Sr(e,o.nodes),addSelectedElements:e=>{h(e,!0)},addSelectedNodes:e=>{d(e,!0)},addSelectedEdges:e=>{f(e,!0)},setMinZoom:p,setMaxZoom:v,setTranslateExtent:g,setNodeExtent:m,removeSelectedElements:e=>{if(!e||!e.length)return h([],!1);const{changedNodes:t,changedEdges:n}=e.reduce(((e,t)=>{const n=kr(t.id,!1);return rr(t)?e.changedNodes.push(n):e.changedEdges.push(n),e}),{changedNodes:[],changedEdges:[]});t.length&&o.hooks.nodesChange.trigger(t),n.length&&o.hooks.edgesChange.trigger(n)},removeSelectedNodes:e=>{if(!e.length)return d(e,!1);const t=e.map((e=>e.id)).map((e=>kr(e,!1)));t.length&&o.hooks.nodesChange.trigger(t)},removeSelectedEdges:e=>{if(!e.length)return f(e,!1);const t=e.map((e=>e.id)).map((e=>kr(e,!1)));t.length&&o.hooks.edgesChange.trigger(t)},startConnection:(e,t,n,r=!1)=>{r?o.connectionClickStartHandle=e:o.connectionStartHandle=e,o.connectionEndHandle=null,o.connectionStatus=null,t&&(o.connectionPosition=t)},updateConnection:(e,t=null,n=null)=>{o.connectionStartHandle&&(o.connectionPosition=e,o.connectionEndHandle=t,o.connectionStatus=n)},endConnection:(e,t)=>{o.connectionPosition={x:NaN,y:NaN},o.connectionEndHandle=null,o.connectionStatus=null,t?o.connectionClickStartHandle=null:o.connectionStartHandle=null},setInteractive:e=>{o.nodesDraggable=e,o.nodesConnectable=e,o.elementsSelectable=e},setState:_,getIntersectingNodes:(e,t=!0,n)=>{const[r,l,i]=E(e);return r?(n||o.nodes).filter((n=>{if(!(i||n.id!==l.id&&n.computedPosition))return!1;const o=Wo(Ko(n),r);return t&&o>0||o>=Number(e.width)*Number(e.height)})):[]},isNodeIntersecting:(e,t,n=!0)=>{const[o]=E(e);if(!o)return!1;const r=Wo(o,t);return n&&r>0||r>=Number(e.width)*Number(e.height)},panBy:e=>{const{viewport:t,dimensions:n,d3Zoom:r,d3Selection:l,translateExtent:i}=o;if(!r||!l||!e.x&&!e.y)return!1;const a=Bo.translate(t.x+e.x,t.y+e.y).scale(t.zoom),u=[[0,0],[n.width,n.height]],s=r.constrain()(a,u,i),c=o.viewport.x!==s.x||o.viewport.y!==s.y||o.viewport.zoom!==s.k;return r.transform(l,s),c},fitView:e=>a.value.fitView(e),zoomIn:e=>a.value.zoomIn(e),zoomOut:e=>a.value.zoomOut(e),zoomTo:(e,t)=>a.value.zoomTo(e,t),setViewport:(e,t)=>a.value.setViewport(e,t),setTransform:(e,t)=>a.value.setTransform(e,t),getViewport:()=>a.value.getViewport(),getTransform:()=>a.value.getTransform(),setCenter:(e,t,n)=>a.value.setCenter(e,t,n),fitBounds:(e,t)=>a.value.fitBounds(e,t),project:e=>a.value.project(e),toObject:()=>JSON.parse(JSON.stringify({nodes:o.nodes.map((e=>{const{computedPosition:t,handleBounds:n,selected:o,dimensions:r,isParent:l,resizing:i,dragging:a,initialized:u,...s}=e;return s})),edges:o.edges.map((e=>{const{selected:t,sourceNode:n,targetNode:o,...r}=e;return r})),position:[o.viewport.x,o.viewport.y],zoom:o.viewport.zoom,viewport:o.viewport})),fromObject:e=>{const{nodes:t,edges:n,position:r,zoom:l,viewport:i}=e;if(t&&y(t),n&&w(n),null!=i&&i.x&&null!=i&&i.y||r){const e=(null==i?void 0:i.x)||r[0],t=(null==i?void 0:i.y)||r[1],n=(null==i?void 0:i.zoom)||l||o.viewport.zoom;b((()=>a.value.initialized)).toBe(!0).then((()=>{a.value.setViewport({x:e,y:t,zoom:n})}))}},updateNodeInternals:u,$reset:()=>{const e=ri();if(o.edges=[],o.nodes=[],o.d3Zoom&&o.d3Selection){const t=Bo.translate(e.defaultViewport.x??0,e.defaultViewport.y??0).scale(Qo(e.defaultViewport.zoom??1,e.minZoom,e.maxZoom)),n=o.viewportRef.getBoundingClientRect(),r=[[0,0],[n.width,n.height]],l=o.d3Zoom.constrain()(t,r,e.translateExtent);o.d3Zoom.transform(o.d3Selection,l)}_(e)},$destroy:()=>{}};return b((()=>a.value.initialized)).toBe(!0,{flush:"pre"}).then((()=>{o.fitViewOnInit&&a.value.fitView(),o.hooks.paneReady.trigger({id:e,emits:t,vueFlowVersion:"1.22.2",...n,...o,...r,...S})})),S}function ii(e,n,o){const r=t.computed((()=>t=>e.nodes&&!n.value.length?e.nodes.find((e=>e.id===t)):e.nodes[n.value.indexOf(t)])),l=t.computed((()=>t=>e.edges&&!o.value.length?e.edges.find((e=>e.id===t)):e.edges[o.value.indexOf(t)])),i=t.computed((()=>{var t;const n={...oi,...e.edgeTypes},o=Object.keys(n);return null==(t=e.edges)||t.forEach((e=>e.type&&!o.includes(e.type)&&(n[e.type]=e.type))),n})),a=t.computed((()=>{var t;const n={...ni,...e.nodeTypes},o=Object.keys(n);return null==(t=e.nodes)||t.forEach((e=>e.type&&!o.includes(e.type)&&(n[e.type]=e.type))),n})),u=t.computed((()=>{const t=e.nodes.filter((e=>!e.hidden));return e.onlyRenderVisibleElements?t&&gr(t,{x:0,y:0,width:e.dimensions.width,height:e.dimensions.height},e.viewport,!0):t??[]})),s=(t,n,o)=>{if(n=n??r.value(t.source),o=o??r.value(t.target),n&&o)return!t.hidden&&!o.hidden&&!n.hidden;e.hooks.error.trigger(new Hr(Vr.EDGE_ORPHANED,t.id))},c=t.computed((()=>e.onlyRenderVisibleElements?e.edges.filter((t=>{const n=r.value(t.source),o=r.value(t.target);return s(t,n,o)&&function({sourcePos:e,targetPos:t,sourceWidth:n,sourceHeight:o,targetWidth:r,targetHeight:l,width:i,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+l)};s.x===s.x2&&(s.x2+=1),s.y===s.y2&&(s.y2+=1);const c=hr({x:(0-u.x)/u.zoom,y:(0-u.y)/u.zoom,width:i/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}({sourcePos:n.computedPosition||{x:0,y:0},targetPos:o.computedPosition||{x:0,y:0},sourceWidth:n.dimensions.width,sourceHeight:n.dimensions.height,targetWidth:o.dimensions.width,targetHeight:o.dimensions.height,width:e.dimensions.width,height:e.dimensions.height,viewport:e.viewport})})):e.edges.filter((e=>s(e))))),d=t.computed((()=>[...u.value,...c.value])),f=t.computed((()=>e.nodes.filter((e=>e.selected)))),h=t.computed((()=>e.edges.filter((e=>e.selected)))),p=t.computed((()=>[...f.value??[],...h.value??[]])),v=t.computed((()=>u.value.filter((e=>e.initialized&&void 0!==e.handleBounds))));return{getNode:r,getEdge:l,getElements:d,getEdgeTypes:i,getNodeTypes:a,getEdges:c,getNodes:u,getSelectedElements:p,getSelectedNodes:f,getSelectedEdges:h,getNodesInitialized:v}}class ai{constructor(){this.currentId=0,this.flows=new Map}static getInstance(){return ai.instance||(ai.instance=new ai),ai.instance}set(e,t){return this.flows.set(e,t)}get(e){return this.flows.get(e)}remove(e){return this.flows.delete(e)}create(e,n){const o=ri(n),r=t.reactive(o),l={};Object.entries(r.hooks).forEach((([e,t])=>{const n=`on${e.charAt(0).toUpperCase()+e.slice(1)}`;l[n]=t.on}));const i={};Object.entries(r.hooks).forEach((([e,t])=>{i[e]=t.trigger}));const a=t.computed((()=>r.nodes.map((e=>e.id)))),u=t.computed((()=>r.edges.map((e=>e.id)))),s=ii(r,a,u),c=li(e,i,l,r,s,a,u);c.setState(r);const d={...l,...s,...c,...y(r),emits:i,id:e,vueFlowVersion:"1.22.2",$destroy:()=>{this.remove(e)}};return this.set(e,d),d}getId(){return"vue-flow-"+this.currentId++}}function ui(e){const o=ai.getInstance(),r=t.getCurrentScope(),l=null==e?void 0:e.id,i=(null==r?void 0:r.vueFlowId)||l;let a;if(r){const e=t.inject(hl,null);typeof e<"u"&&null!==e&&(a=e)}if(a||i&&(a=o.get(i)),!a||a&&l&&l!==a.id){const r=l??o.getId(),i=o.create(r,e);a=i,t.effectScope().run((()=>{t.watch(i.applyDefault,(e=>{const t=e=>{i.applyNodeChanges(e)},n=e=>{i.applyEdgeChanges(e)};e?(i.onNodesChange(t),i.onEdgesChange(n)):(i.hooks.value.nodesChange.off(t),i.hooks.value.edgesChange.off(n))}),{immediate:!0}),n((()=>{if(a){const e=o.get(a.id);e?e.$destroy():Jr(`No store instance found for id ${a.id} in storage.`)}}))}))}else e&&a.setState(e);return r&&(t.provide(hl,a),r.vueFlowId=a.id),a}function si(){const{viewport:e,snapGrid:t,snapToGrid:n}=ui();return({sourceEvent:o})=>{const r=o.touches?o.touches[0].clientX:o.clientX,l=o.touches?o.touches[0].clientY:o.clientY,i={x:(r-e.value.x)/e.value.zoom,y:(l-e.value.y)/e.value.zoom};return{xSnapped:n.value?t.value[0]*Math.round(i.x/t.value[0]):i.x,ySnapped:n.value?t.value[1]*Math.round(i.y/t.value[1]):i.y,...i}}}function ci(){return!0}function di({handleId:e,nodeId:t,type:n,isValidConnection:r,edgeUpdaterType:l,onEdgeUpdate:i,onEdgeUpdateEnd:a}){const{vueFlowRef:u,connectionMode:s,connectionRadius:c,connectOnClick:d,connectionClickStartHandle:f,nodesConnectable:h,autoPanOnConnect:p,findNode:v,panBy:g,getNodes:m,startConnection:y,updateConnection:w,endConnection:b,emits:x,viewport:E,edges:_,isValidConnection:S}=ui();let k=null,N=!1,C=null;return{handlePointerDown:function(d){var f;const h="target"===o(n),M=Yr(d),B=tr(d.target);if(M&&0===d.button||!M){let n=function(n){L=Fr(n,R);const{handle:r,validHandleResult:l}=function(e,t,n,o,r,l){const{x:i,y:a}=Fr(e),u=t.elementsFromPoint(i,a).find((e=>e.classList.contains("vue-flow__handle")));if(u){const e=u.getAttribute("data-nodeid");if(e){const t=Kr(void 0,u),o=u.getAttribute("data-handleid"),r=l({nodeId:e,id:o,type:t});if(r)return{handle:{id:o,type:t,nodeId:e,x:n.x,y:n.y},validHandleResult:r}}}let s=[],c=1/0;if(r.forEach((e=>{const t=Math.sqrt((e.x-n.x)**2+(e.y-n.y)**2);if(t<=o){const n=l(e);t<=c&&(t<c?s=[{handle:e,validHandleResult:n}]:t===c&&s.push({handle:e,validHandleResult:n}),c=t)}})),!s.length)return{handle:null,validHandleResult:{handleDomNode:null,isValid:!1,connection:{source:"",target:"",sourceHandle:null,targetHandle:null},endHandle:null}};if(1===s.length)return s[0];const d=s.some((({validHandleResult:e})=>e.isValid)),f=s.some((({handle:e})=>"target"===e.type));return s.find((({handle:e,validHandleResult:t})=>f?"target"===e.type:!d||t.isValid))||s[0]}(n,B,dr(L,E.value,!1,[1,1]),c.value,Y,(r=>qr(n,r,s.value,o(t),o(e),h?"target":"source",O,B,_.value,v)));if(T=r,H||(F(),H=!0),k=l.connection,N=l.isValid,C=l.handleDomNode,w(T&&N?cr({x:T.x,y:T.y},E.value):L,l.endHandle,function(e,t){let n=null;return t?n="valid":e&&!t&&(n="invalid"),n}(!!T,N)),!T&&!N&&!C)return Ur(V);k&&k.source!==k.target&&C&&(Ur(V),V=C,C.classList.add("connecting","vue-flow__handle-connecting"),C.classList.toggle("valid",N),C.classList.toggle("vue-flow__handle-valid",N))},M=function(e){(T||C)&&k&&N&&(i?i(e,k):x.connect(k)),x.connectEnd(e),l&&(null==a||a(e)),Ur(V),cancelAnimationFrame(I),b(e),H=!1,N=!1,k=null,C=null,B.removeEventListener("mousemove",n),B.removeEventListener("mouseup",M),B.removeEventListener("touchmove",n),B.removeEventListener("touchend",M)};const P=v(o(t));let O=o(r)||S.value||ci;!O&&P&&(O=(h?P.isValidSourcePos:P.isValidTargetPos)||ci);let T,I=0;const{x:z,y:A}=Fr(d),$=null==B?void 0:B.elementFromPoint(z,A),D=Kr(o(l),$),R=null==(f=u.value)?void 0:f.getBoundingClientRect();if(!R||!D)return;let V,L=Fr(d,R),H=!1;const Y=function({nodes:e,nodeId:t,handleId:n,handleType:o}){return e.reduce(((e,r)=>{const{handleBounds:l}=r;let i=[],a=[];return l&&(i=Zr(r,l,"source",`${t}-${n}-${o}`),a=Zr(r,l,"target",`${t}-${n}-${o}`)),e.push(...i,...a),e}),[])}({nodes:m.value,nodeId:o(t),handleId:o(e),handleType:D}),F=()=>{if(!p)return;const[e,t]=Er(L,R);g({x:e,y:t}),I=requestAnimationFrame(F)};y({nodeId:o(t),handleId:o(e),type:D},{x:z-R.left,y:A-R.top},d),x.connectStart({event:d,nodeId:o(t),handleId:o(e),handleType:D}),B.addEventListener("mousemove",n),B.addEventListener("mouseup",M),B.addEventListener("touchmove",n),B.addEventListener("touchend",M)}},handleClick:function(l){if(!d.value)return;const i="target"===o(n);if(f.value){let a=o(r)||S.value||ci;const u=v(o(t));if(!a&&u&&(a=(i?u.isValidSourcePos:u.isValidTargetPos)||ci),u&&!1===(typeof u.connectable>"u"?h.value:u.connectable))return;const c=tr(l.target),{connection:d,isValid:p}=qr(l,{nodeId:o(t),id:o(e),type:o(n)},s.value,f.value.nodeId,f.value.handleId||null,f.value.type,a,c,_.value,v),g=d.source===d.target;p&&!g&&x.connect(d),x.clickConnectEnd(l),b(l,!0)}else x.clickConnectStart({event:l,nodeId:o(t),handleId:o(e)}),y({nodeId:o(t),type:o(n),handleId:o(e)},void 0,l,!0)}}}function fi(){return typeof window<"u"?window:{chrome:!1}}function hi(e){var t,n;const o=(null==(n=null==(t=e.composedPath)?void 0:t.call(e))?void 0:n[0])||e.target,r=!!Xr(o.hasAttribute)&&o.hasAttribute("contenteditable"),l=Xr(o.closest)?o.closest(".nokey"):null;return["INPUT","SELECT","TEXTAREA"].includes(null==o?void 0:o.nodeName)||r||!!l}function pi(e,n){const r=fi(),l=t.ref(!0===o(e));let i=!1;const a=new Set;return t.watch(l,(()=>{null==n||n(l.value)})),t.watch((()=>o(e)),(e=>{r&&typeof r.addEventListener<"u"&&V(r,"blur",(()=>{l.value=!1})),function(e){return"boolean"==typeof e}(e)?l.value=e:(Array.isArray(e)&&(e=function(e,t){return n=>e.some((e=>{const o=e.split("+").map((e=>e.trim().toLowerCase()));return 1===o.length?n.key===e:(t.add(n.key.toLowerCase()),o.every((e=>t.has(e))))}))}(e,a)),e&&(L(e,(e=>{i=function(e){return e.ctrlKey||e.metaKey||e.shiftKey}(e),(i||!hi(e))&&(e.preventDefault(),l.value=!0)}),{eventName:"keydown"}),L(e,(e=>{if(l.value){if(!i&&hi(e))return;i=!1,a.clear(),l.value=!1}}),{eventName:"keyup"})))}),{immediate:!0}),l}function vi(e){const n=e??t.inject(pl,""),o=t.inject(vl,t.ref(null)),{findNode:r,edges:l,emits:i}=ui(),a=r(n);return a||i.error(new Hr(Vr.NODE_NOT_FOUND,n)),{id:n,nodeEl:o,node:a,parentNode:t.computed((()=>r(a.parentNode))),connectedEdges:t.computed((()=>mr([a],l.value)))}}function gi(){const{getSelectedNodes:e,nodeExtent:t,updateNodePositions:n,findNode:o,snapGrid:r,snapToGrid:l,nodesDraggable:i,emits:a}=ui();return(u,s=!1)=>{const c=l.value?r.value[0]:5,d=l.value?r.value[1]:5,f=s?4:1,h=u.x*c*f,p=u.y*d*f,v=e.value.filter((e=>e.draggable||i&&typeof e.draggable>"u")).map((e=>{const n={x:e.computedPosition.x+h,y:e.computedPosition.y+p},{computedPosition:r}=Ar(e,n,a.error,t.value,e.parentNode?o(e.parentNode):void 0);return{id:e.id,position:r,from:e.position,distance:{x:u.x,y:u.y},dimensions:e.dimensions}}));n(v,!0,!1)}}const mi=.1;function yi(){return Promise.resolve(!1)}const wi={zoomIn:yi,zoomOut:yi,zoomTo:yi,fitView:yi,setCenter:yi,fitBounds:yi,project:e=>e,setViewport:yi,setTransform:yi,getViewport:()=>({x:0,y:0,zoom:1}),getTransform:()=>({x:0,y:0,zoom:1}),initialized:!1};function bi(e,n){const o=e,r=t.toRef(o,"nodes"),l=t.toRef(o,"d3Zoom"),i=t.toRef(o,"d3Selection"),a=t.toRef(o,"dimensions"),u=t.toRef(o,"translateExtent"),s=t.toRef(o,"minZoom"),c=t.toRef(o,"maxZoom"),d=t.toRef(o,"viewport"),f=t.toRef(o,"snapToGrid"),h=t.toRef(o,"snapGrid"),{getNodes:p}=n,v=t.ref(!1);function g(e,t){return new Promise((n=>{i.value&&l.value?l.value.scaleBy(xi(i.value,t,(()=>{n(!0)})),e):n(!1)}))}function m(e,t,n,o){return new Promise((r=>{const{x:a,y:s}=er({x:-e,y:-t},u.value),c=Bo.translate(-a,-s).scale(n);i.value&&l.value?l.value.transform(xi(i.value,o,(()=>{r(!0)})),c):r(!1)}))}return b((()=>!!(l.value&&i.value&&a.value.width&&a.value.height))).toBe(!0).then((()=>{v.value=!0})),t.computed((()=>v.value?{initialized:!0,zoomIn:e=>g(1.2,null==e?void 0:e.duration),zoomOut:e=>g(.8333333333333334,null==e?void 0:e.duration),zoomTo:(e,t)=>new Promise((n=>{i.value&&l.value?l.value.scaleTo(xi(i.value,null==t?void 0:t.duration,(()=>{n(!0)})),e):n(!1)})),setViewport:(e,t)=>m(e.x,e.y,e.zoom,null==t?void 0:t.duration),setTransform:(e,t)=>m(e.x,e.y,e.zoom,null==t?void 0:t.duration),getViewport:()=>({x:d.value.x,y:d.value.y,zoom:d.value.zoom}),getTransform:()=>({x:d.value.x,y:d.value.y,zoom:d.value.zoom}),fitView:(e={padding:mi,includeHiddenNodes:!1,duration:0})=>{const t=(e.includeHiddenNodes?r.value:p.value).filter((t=>{var n;const o=t.initialized&&t.dimensions.width&&t.dimensions.height;let r=!0;return null!=(n=e.nodes)&&n.length&&(r=e.nodes.includes(t.id)),o&&r}));if(!t.length)return Promise.resolve(!1);const n=vr(t),{x:o,y:l,zoom:i}=yr(n,a.value.width,a.value.height,e.minZoom??s.value,e.maxZoom??c.value,e.padding??mi,e.offset);return m(o,l,i,null==e?void 0:e.duration)},setCenter:(e,t,n)=>{const o=typeof(null==n?void 0:n.zoom)<"u"?n.zoom:c.value;return m(a.value.width/2-e*o,a.value.height/2-t*o,o,null==n?void 0:n.duration)},fitBounds:(e,t={padding:mi})=>{const{x:n,y:o,zoom:r}=yr(e,a.value.width,a.value.height,s.value,c.value,t.padding);return m(n,o,r,null==t?void 0:t.duration)},project:e=>dr(e,d.value,f.value,h.value)}:wi))}function xi(e,t=0,n){return e.transition().duration(t).on("end",n)}function Ei(e,n,o){const r=t.effectScope();return r.run((()=>{r.run((()=>{let n,r,l=!(!o.nodes.value.length&&!o.edges.value.length);n=$([e.modelValue,()=>{var t,n;return null==(n=null==(t=e.modelValue)?void 0:t.value)?void 0:n.length}],(([e])=>{e&&Array.isArray(e)&&(null==r||r.pause(),o.setElements(e),r||l||!e.length?null==r||r.resume():l=!0)})),r=$([o.nodes,o.edges,()=>o.edges.value.length,()=>o.nodes.value.length],(([o,r])=>{var l;null!=(l=e.modelValue)&&l.value&&Array.isArray(e.modelValue.value)&&(null==n||n.pause(),e.modelValue.value=[...o,...r],t.nextTick((()=>{null==n||n.resume()})))}),{immediate:l}),t.onScopeDispose((()=>{null==n||n.stop(),null==r||r.stop()}))})),r.run((()=>{let n,r,l=!!o.nodes.value.length;n=$([e.nodes,()=>{var t,n;return null==(n=null==(t=e.nodes)?void 0:t.value)?void 0:n.length}],(([e])=>{e&&Array.isArray(e)&&(null==r||r.pause(),o.setNodes(e),r||l||!e.length?null==r||r.resume():l=!0)})),r=$([o.nodes,()=>o.nodes.value.length],(([o])=>{var r;null!=(r=e.nodes)&&r.value&&Array.isArray(e.nodes.value)&&(null==n||n.pause(),e.nodes.value=[...o],t.nextTick((()=>{null==n||n.resume()})))}),{immediate:l}),t.onScopeDispose((()=>{null==n||n.stop(),null==r||r.stop()}))})),r.run((()=>{let n,r,l=!!o.edges.value.length;n=$([e.edges,()=>{var t,n;return null==(n=null==(t=e.edges)?void 0:t.value)?void 0:n.length}],(([e])=>{e&&Array.isArray(e)&&(null==r||r.pause(),o.setEdges(e),r||l||!e.length?null==r||r.resume():l=!0)})),r=$([o.edges,()=>o.edges.value.length],(([o])=>{var r;null!=(r=e.edges)&&r.value&&Array.isArray(e.edges.value)&&(null==n||n.pause(),e.edges.value=[...o],t.nextTick((()=>{null==n||n.resume()})))}),{immediate:l}),t.onScopeDispose((()=>{null==n||n.stop(),null==r||r.stop()}))})),r.run((()=>{t.watch((()=>n.minZoom),(()=>{n.minZoom&&tl(n.minZoom)&&o.setMinZoom(n.minZoom)}))})),r.run((()=>{t.watch((()=>n.maxZoom),(()=>{n.maxZoom&&tl(n.maxZoom)&&o.setMaxZoom(n.maxZoom)}))})),r.run((()=>{t.watch((()=>n.translateExtent),(()=>{n.translateExtent&&tl(n.translateExtent)&&o.setTranslateExtent(n.translateExtent)}))})),r.run((()=>{t.watch((()=>n.nodeExtent),(()=>{n.nodeExtent&&tl(n.nodeExtent)&&o.setNodeExtent(n.nodeExtent)}))})),r.run((()=>{t.watch((()=>n.applyDefault),(()=>{tl(n.applyDefault)&&(o.applyDefault.value=n.applyDefault)}))})),r.run((()=>{const e=async e=>{let t=e;Xr(n.autoConnect)&&(t=await n.autoConnect(e)),!1!==t&&o.addEdges([t])};t.watch((()=>n.autoConnect),(()=>{tl(n.autoConnect)&&(o.autoConnect.value=n.autoConnect)})),t.watch(o.autoConnect,((t,n,r)=>{t?o.onConnect(e):o.hooks.value.connect.off(e),r((()=>{o.hooks.value.connect.off(e)}))}),{immediate:!0})})),(()=>{const e=["id","modelValue","translateExtent","nodeExtent","edges","nodes","maxZoom","minZoom","applyDefault","autoConnect"];Object.keys(n).forEach((l=>{if(!e.includes(l)){const e=u(n,l),i=o[l];r.run((()=>{t.watch(e,(e=>{tl(e)&&(i.value=e)}),{flush:"pre"})}))}}))})()})),()=>r.stop()}function _i(e,t){return{x:e.clientX-t.left,y:e.clientY-t.top}}const Si=t.defineComponent({name:"Pane",compatConfig:{MODE:3},props:{isSelecting:{type:Boolean}},setup(e){const{id:n,vueFlowRef:o,getNodes:r,getEdges:l,viewport:i,emits:a,userSelectionActive:u,removeSelectedElements:s,panOnDrag:c,userSelectionRect:d,elementsSelectable:f,nodesSelectionActive:h,addSelectedElements:p,getSelectedEdges:v,getSelectedNodes:g,removeNodes:m,removeEdges:y,selectionMode:w,deleteKeyCode:b,multiSelectionKeyCode:x,multiSelectionActive:E}=ui(),_=t.ref(null),S=t.ref(0),k=t.ref(0),N=t.ref(),C=t.computed((()=>f.value&&(e.isSelecting||u.value)));function M(){u.value=!1,d.value=null,S.value=0,k.value=0}function B(e){e.target!==_.value||C.value||(a.paneClick(e),s(),h.value=!1)}function P(e){var t;if(e.target===_.value){if(Array.isArray(c.value)&&null!=(t=c.value)&&t.includes(2))return void e.preventDefault();a.paneContextMenu(e)}}function O(e){e.target===_.value&&a.paneScroll(e)}function T(t){if(N.value=o.value.getBoundingClientRect(),!(C.value&&f&&e.isSelecting&&0===t.button&&t.target===_.value&&N.value))return;const{x:n,y:r}=_i(t,N.value);s(),d.value={width:0,height:0,startX:n,startY:r,x:n,y:r},u.value=!0,a.selectionStart(t)}function I(t){if(!C.value)return a.paneMouseMove(t);if(!e.isSelecting||!N.value||!d.value)return;u.value||(u.value=!0),h.value&&(h.value=!1);const n=_i(t,N.value),o=d.value.startX??0,s=d.value.startY??0,c={...d.value,x:n.x<o?n.x:o,y:n.y<s?n.y:s,width:Math.abs(n.x-o),height:Math.abs(n.y-s)},f=gr(r.value,d.value,i.value,w.value===Lo.Partial),v=mr(f,l.value);S.value=f.length,k.value=v.length,d.value=c,p([...f,...v])}function z(e){C.value&&0===e.button&&(!u.value&&d.value&&e.target===_.value&&B(e),h.value=S.value>0,M(),a.selectionEnd(e))}function A(e){var t;if(!C.value)return a.paneMouseLeave(e);u.value&&(h.value=S.value>0,null==(t=a.selectionEnd)||t.call(a,e)),M()}function $(e){C.value||a.paneMouseEnter(e)}return pi(b,(e=>{if(!e)return;const t=r.value.reduce(((e,t)=>((!t.selected&&t.parentNode&&e.find((e=>e.id===t.parentNode))||t.selected)&&e.push(t),e)),[]);(t||v.value)&&(v.value.length>0&&y(v.value),t.length>0&&m(t),h.value=!1,s())})),pi(x,(e=>{E.value=e})),(o,r)=>(t.openBlock(),t.createElementBlock("div",{ref_key:"container",ref:_,key:`pane-${t.unref(n)}`,class:t.normalizeClass(["vue-flow__pane vue-flow__container",{selection:e.isSelecting}]),onClick:B,onContextmenu:P,onWheelPassive:O,onMouseenter:$,onMousedown:T,onMousemove:I,onMouseup:z,onMouseleave:A},[t.renderSlot(o.$slots,"default"),t.unref(u)&&t.unref(d)?(t.openBlock(),t.createBlock(ti,{key:0,"user-selection-rect":t.unref(d)},null,8,["user-selection-rect"])):t.createCommentVNode("",!0),t.unref(h)&&t.unref(g).length?(t.openBlock(),t.createBlock(ei,{key:1})):t.createCommentVNode("",!0)],34))}}),ki={class:"vue-flow__nodes vue-flow__container"},Ni=t.defineComponent({name:"Nodes",compatConfig:{MODE:3},setup(e){const n=t.inject(yl),{nodesDraggable:o,nodesFocusable:r,elementsSelectable:l,nodesConnectable:i,getNodes:a,getNodesInitialized:u,getNodeTypes:s,updateNodeDimensions:c,emits:d}=ui(),f=t.ref(),h=t.getCurrentInstance();function p(e){return typeof e>"u"?o.value:e}function v(e){return typeof e>"u"?l.value:e}function g(e){return typeof e>"u"?i.value:e}function m(e){return typeof e>"u"?r.value:e}function y(e,o){const r=e||"default",l=null==n?void 0:n[`node-${r}`];if(l)return l;let i=o??s.value[r];if("string"==typeof i&&h){const e=Object.keys(h.appContext.components);e&&e.includes(r)&&(i=t.resolveComponent(r,!1))}return i&&"string"!=typeof i?i:(d.error(new Hr(Vr.NODE_TYPE_MISSING,i)),!1)}return b((()=>a.value.length>0&&u.value.length===a.value.length)).toBe(!0).then((()=>{t.nextTick((()=>{d.nodesInitialized(u.value)}))})),t.onMounted((()=>{f.value=new ResizeObserver((e=>{const t=e.map((e=>({id:e.target.getAttribute("data-id"),nodeElement:e.target,forceUpdate:!0})));c(t)}))})),t.onBeforeUnmount((()=>{var e;return null==(e=f.value)?void 0:e.disconnect()})),(e,n)=>(t.openBlock(),t.createElementBlock("div",ki,[f.value?(t.openBlock(!0),t.createElementBlock(t.Fragment,{key:0},t.renderList(t.unref(a),(e=>(t.openBlock(),t.createBlock(t.unref(wl),{id:e.id,key:e.id,"resize-observer":f.value,type:y(e.type,e.template),name:e.type||"default",draggable:p(e.draggable),selectable:v(e.selectable),connectable:g(e.connectable),focusable:m(e.focusable),node:e},null,8,["id","resize-observer","type","name","draggable","selectable","connectable","focusable","node"])))),128)):t.createCommentVNode("",!0)]))}}),Ci=["id","markerWidth","markerHeight","markerUnits","orient"],Mi=["stroke","stroke-width","fill"],Bi=["stroke","stroke-width"],Pi=t.defineComponent({name:"MarkerType",compatConfig:{MODE:3},props:{id:null,type:null,color:{default:"none"},width:{default:12.5},height:{default:12.5},markerUnits:{default:"strokeWidth"},orient:{default:"auto-start-reverse"},strokeWidth:{default:1}},setup:e=>(n,o)=>(t.openBlock(),t.createElementBlock("marker",{id:e.id,class:"vue-flow__arrowhead",viewBox:"-10 -10 20 20",refX:"0",refY:"0",markerWidth:`${e.width}`,markerHeight:`${e.height}`,markerUnits:e.markerUnits,orient:e.orient},[e.type===t.unref(Fo).ArrowClosed?(t.openBlock(),t.createElementBlock("polyline",{key:0,stroke:e.color,"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":e.strokeWidth,fill:e.color,points:"-5,-4 0,0 -5,4 -5,-4"},null,8,Mi)):t.createCommentVNode("",!0),e.type===t.unref(Fo).Arrow?(t.openBlock(),t.createElementBlock("polyline",{key:1,stroke:e.color,"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":e.strokeWidth,fill:"none",points:"-5,-4 0,0 -5,4"},null,8,Bi)):t.createCommentVNode("",!0)],8,Ci))}),Oi=t.defineComponent({name:"MarkerDefinitions",compatConfig:{MODE:3},setup(e){const n=ui(),o=t.toRef(n,"id"),r=t.toRef(n,"edges"),l=t.toRef(n,"connectionLineOptions"),i=t.toRef(n,"defaultMarkerColor"),a=t.computed((()=>{const e=[],t=[],n=n=>{if(n){const r=br(n,o.value);e.includes(r)||("object"==typeof n?t.push({...n,id:r,color:n.color||i.value}):t.push({id:r,color:i.value,type:n}),e.push(r))}};return[l.value.markerEnd,l.value.markerStart].forEach(n),r.value.reduce(((e,t)=>([t.markerStart,t.markerEnd].forEach(n),e.sort(((e,t)=>e.id.localeCompare(t.id))))),t),t}));return(e,n)=>(t.openBlock(),t.createElementBlock("defs",null,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(t.unref(a),(e=>(t.openBlock(),t.createBlock(Pi,{id:e.id,key:e.id,type:e.type,color:e.color,width:e.width,height:e.height,markerUnits:e.markerUnits,"stroke-width":e.strokeWidth,orient:e.orient},null,8,["id","type","color","width","height","markerUnits","stroke-width","orient"])))),128))]))}}),Ti={class:"vue-flow__edges vue-flow__container"},Ii=t.defineComponent({name:"Edges",compatConfig:{MODE:3},setup(e){const n=t.inject(yl),{edgesUpdatable:o,edgesFocusable:r,elementsSelectable:l,findNode:i,getEdges:a,getEdgeTypes:u,elevateEdgesOnSelect:s,dimensions:c,emits:d}=ui(),f=t.getCurrentInstance();function h(e){return typeof e>"u"?l.value:e}function p(e){return typeof e>"u"?o.value:e}function v(e){return typeof e>"u"?r.value:e}function g(e,o){const r=e||"default",l=null==n?void 0:n[`edge-${r}`];if(l)return l;let i=o??u.value[r];if("string"==typeof i&&f){const e=Object.keys(f.appContext.components);e&&e.includes(r)&&(i=t.resolveComponent(r,!1))}return i&&"string"!=typeof i?i:(d.error(new Hr(Vr.EDGE_TYPE_MISSING,i)),!1)}return(e,n)=>t.unref(c).width&&t.unref(c).height?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[(t.openBlock(),t.createElementBlock("svg",Ti,[t.createVNode(Oi)])),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(t.unref(a),(e=>(t.openBlock(),t.createElementBlock("svg",{key:e.id,class:"vue-flow__edges vue-flow__container",style:t.normalizeStyle({zIndex:t.unref(Rr)(e,t.unref(i),t.unref(s))})},[t.createVNode(t.unref(Zl),{id:e.id,edge:e,type:g(e.type,e.template),name:e.type||"default",selectable:h(e.selectable),updatable:p(e.updatable),focusable:v(e.focusable)},null,8,["id","edge","type","name","selectable","updatable","focusable"])],4)))),128)),t.createVNode(t.unref(Jl))],64)):t.createCommentVNode("",!0)}}),zi=t.createElementVNode("div",{class:"vue-flow__edge-labels"},null,-1),Ai=t.defineComponent({name:"Transform",compatConfig:{MODE:3},setup(e){const{id:n,viewport:o,d3Zoom:l,d3Selection:i,dimensions:a}=ui(),u=t.ref(!r);return b((()=>l.value&&i.value&&a.value.width>0&&a.value.height>0)).toBe(!0).then((()=>{setTimeout((()=>{u.value=!0}),1)})),(e,r)=>(t.openBlock(),t.createElementBlock("div",{key:`transform-${t.unref(n)}`,class:"vue-flow__transformationpane vue-flow__container",style:t.normalizeStyle({transform:`translate(${t.unref(o).x}px,${t.unref(o).y}px) scale(${t.unref(o).zoom})`,opacity:u.value?void 0:0})},[t.createVNode(Ii),zi,t.createVNode(Ni),t.renderSlot(e.$slots,"default")],4))}}),$i=t.defineComponent({name:"Viewport",compatConfig:{MODE:3},setup(e){const{id:n,minZoom:o,maxZoom:r,defaultViewport:l,translateExtent:i,dimensions:a,zoomActivationKeyCode:u,selectionKeyCode:s,panActivationKeyCode:c,panOnScroll:d,panOnScrollMode:f,panOnScrollSpeed:h,panOnDrag:p,zoomOnDoubleClick:v,zoomOnPinch:g,zoomOnScroll:m,preventScrolling:y,noWheelClassName:w,noPanClassName:b,emits:x,connectionStartHandle:E,userSelectionActive:_,paneDragging:S,d3Zoom:k,d3Selection:N,d3ZoomHandler:C,viewport:M,viewportRef:B}=ui(),P=t.ref(),O=t.ref(!1),T=t.ref(!1);let I=!1,z=0,A={x:0,y:0,zoom:0};const $=pi(c),D=t.computed((()=>!O.value&&p.value&&$.value)),R=t.computed((()=>!0!==s.value&&O.value||!0===s.value&&!D.value));function L(e,t){return 2===t&&Array.isArray(e)&&e.includes(2)}function H(e){return{x:e.x,y:e.y,zoom:e.k}}function Y(){if(!P.value)return;const{width:e,height:t}=Jo(P.value);(0===e||0===t)&&x.error(new Hr(Vr.MISSING_VIEWPORT_DIMENSIONS)),a.value.width=e||500,a.value.height=t||500}function F(e,t){return e.target.closest(`.${t}`)}return t.onMounted((()=>{X(P,Y);V(fi(),"resize",Y)})),t.onMounted((()=>{const e=P.value,n=e.getBoundingClientRect(),a=function(){var e,t,n,o=To,r=Io,l=Do,i=Ao,a=$o,u=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],c=250,d=xn,f=Z("start","zoom","end"),h=500,p=150,v=0,g=10;function m(e){e.property("__zoom",zo).on("wheel.zoom",S,{passive:!1}).on("mousedown.zoom",k).on("dblclick.zoom",N).filter(a).on("touchstart.zoom",C).on("touchmove.zoom",M).on("touchend.zoom touchcancel.zoom",B).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function y(e,t){return(t=Math.max(u[0],Math.min(u[1],t)))===e.k?e:new Mo(t,e.x,e.y)}function w(e,t,n){var o=t[0]-n[0]*e.k,r=t[1]-n[1]*e.k;return o===e.x&&r===e.y?e:new Mo(e.k,o,r)}function b(e){return[(+e[0][0]+ +e[1][0])/2,(+e[0][1]+ +e[1][1])/2]}function x(e,t,n,o){e.on("start.zoom",(function(){E(this,arguments).event(o).start()})).on("interrupt.zoom end.zoom",(function(){E(this,arguments).event(o).end()})).tween("zoom",(function(){var e=this,l=arguments,i=E(e,l).event(o),a=r.apply(e,l),u=null==n?b(a):"function"==typeof n?n.apply(e,l):n,s=Math.max(a[1][0]-a[0][0],a[1][1]-a[0][1]),c=e.__zoom,f="function"==typeof t?t.apply(e,l):t,h=d(c.invert(u).concat(s/c.k),f.invert(u).concat(s/f.k));return function(e){if(1===e)e=f;else{var t=h(e),n=s/t[2];e=new Mo(n,u[0]-t[0]*n,u[1]-t[1]*n)}i.zoom(null,e)}}))}function E(e,t,n){return!n&&e.__zooming||new _(e,t)}function _(e,t){this.that=e,this.args=t,this.active=0,this.sourceEvent=null,this.extent=r.apply(e,t),this.taps=0}function S(e,...t){if(o.apply(this,arguments)){var n=E(this,t).event(e),r=this.__zoom,a=Math.max(u[0],Math.min(u[1],r.k*Math.pow(2,i.apply(this,arguments)))),c=dt(e);if(n.wheel)(n.mouse[0][0]!==c[0]||n.mouse[0][1]!==c[1])&&(n.mouse[1]=r.invert(n.mouse[0]=c)),clearTimeout(n.wheel);else{if(r.k===a)return;n.mouse=[c,r.invert(c)],eo(this),n.start()}Oo(e),n.wheel=setTimeout((function(){n.wheel=null,n.end()}),p),n.zoom("mouse",l(w(y(r,a),n.mouse[0],n.mouse[1]),n.extent,s))}}function k(e,...t){if(!n&&o.apply(this,arguments)){var r=e.currentTarget,i=E(this,t,!0).event(e),a=ct(e.view).on("mousemove.zoom",(function(e){if(Oo(e),!i.moved){var t=e.clientX-c,n=e.clientY-d;i.moved=t*t+n*n>v}i.event(e).zoom("mouse",l(w(i.that.__zoom,i.mouse[0]=dt(e,r),i.mouse[1]),i.extent,s))}),!0).on("mouseup.zoom",(function(e){a.on("mousemove.zoom mouseup.zoom",null),mt(e.view,i.moved),Oo(e),i.event(e).end()}),!0),u=dt(e,r),c=e.clientX,d=e.clientY;gt(e.view),Po(e),i.mouse=[u,this.__zoom.invert(u)],eo(this),i.start()}}function N(e,...t){if(o.apply(this,arguments)){var n=this.__zoom,i=dt(e.changedTouches?e.changedTouches[0]:e,this),a=n.invert(i),u=n.k*(e.shiftKey?.5:2),d=l(w(y(n,u),i,a),r.apply(this,t),s);Oo(e),c>0?ct(this).transition().duration(c).call(x,d,i,e):ct(this).call(m.transform,d,i,e)}}function C(n,...r){if(o.apply(this,arguments)){var l,i,a,u,s=n.touches,c=s.length,d=E(this,r,n.changedTouches.length===c).event(n);for(Po(n),i=0;i<c;++i)u=[u=dt(a=s[i],this),this.__zoom.invert(u),a.identifier],d.touch0?!d.touch1&&d.touch0[2]!==u[2]&&(d.touch1=u,d.taps=0):(d.touch0=u,l=!0,d.taps=1+!!e);e&&(e=clearTimeout(e)),l&&(d.taps<2&&(t=u[0],e=setTimeout((function(){e=null}),h)),eo(this),d.start())}}function M(e,...t){if(this.__zooming){var n,o,r,i,a=E(this,t).event(e),u=e.changedTouches,c=u.length;for(Oo(e),n=0;n<c;++n)r=dt(o=u[n],this),a.touch0&&a.touch0[2]===o.identifier?a.touch0[0]=r:a.touch1&&a.touch1[2]===o.identifier&&(a.touch1[0]=r);if(o=a.that.__zoom,a.touch1){var d=a.touch0[0],f=a.touch0[1],h=a.touch1[0],p=a.touch1[1],v=(v=h[0]-d[0])*v+(v=h[1]-d[1])*v,g=(g=p[0]-f[0])*g+(g=p[1]-f[1])*g;o=y(o,Math.sqrt(v/g)),r=[(d[0]+h[0])/2,(d[1]+h[1])/2],i=[(f[0]+p[0])/2,(f[1]+p[1])/2]}else{if(!a.touch0)return;r=a.touch0[0],i=a.touch0[1]}a.zoom("touch",l(w(o,r,i),a.extent,s))}}function B(e,...o){if(this.__zooming){var r,l,i=E(this,o).event(e),a=e.changedTouches,u=a.length;for(Po(e),n&&clearTimeout(n),n=setTimeout((function(){n=null}),h),r=0;r<u;++r)l=a[r],i.touch0&&i.touch0[2]===l.identifier?delete i.touch0:i.touch1&&i.touch1[2]===l.identifier&&delete i.touch1;if(i.touch1&&!i.touch0&&(i.touch0=i.touch1,delete i.touch1),i.touch0)i.touch0[1]=this.__zoom.invert(i.touch0[0]);else if(i.end(),2===i.taps&&(l=dt(l,this),Math.hypot(t[0]-l[0],t[1]-l[1])<g)){var s=ct(this).on("dblclick.zoom");s&&s.apply(this,arguments)}}}return m.transform=function(e,t,n,o){var r=e.selection?e.selection():e;r.property("__zoom",zo),e!==r?x(e,t,n,o):r.interrupt().each((function(){E(this,arguments).event(o).start().zoom(null,"function"==typeof t?t.apply(this,arguments):t).end()}))},m.scaleBy=function(e,t,n,o){m.scaleTo(e,(function(){return this.__zoom.k*("function"==typeof t?t.apply(this,arguments):t)}),n,o)},m.scaleTo=function(e,t,n,o){m.transform(e,(function(){var e=r.apply(this,arguments),o=this.__zoom,i=null==n?b(e):"function"==typeof n?n.apply(this,arguments):n,a=o.invert(i),u="function"==typeof t?t.apply(this,arguments):t;return l(w(y(o,u),i,a),e,s)}),n,o)},m.translateBy=function(e,t,n,o){m.transform(e,(function(){return l(this.__zoom.translate("function"==typeof t?t.apply(this,arguments):t,"function"==typeof n?n.apply(this,arguments):n),r.apply(this,arguments),s)}),null,o)},m.translateTo=function(e,t,n,o,i){m.transform(e,(function(){var e=r.apply(this,arguments),i=this.__zoom,a=null==o?b(e):"function"==typeof o?o.apply(this,arguments):o;return l(Bo.translate(a[0],a[1]).scale(i.k).translate("function"==typeof t?-t.apply(this,arguments):-t,"function"==typeof n?-n.apply(this,arguments):-n),e,s)}),o,i)},_.prototype={event:function(e){return e&&(this.sourceEvent=e),this},start:function(){return 1==++this.active&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(e,t){return this.mouse&&"mouse"!==e&&(this.mouse[1]=t.invert(this.mouse[0])),this.touch0&&"touch"!==e&&(this.touch0[1]=t.invert(this.touch0[0])),this.touch1&&"touch"!==e&&(this.touch1[1]=t.invert(this.touch1[0])),this.that.__zoom=t,this.emit("zoom"),this},end:function(){return 0==--this.active&&(delete this.that.__zooming,this.emit("end")),this},emit:function(e){var t=ct(this.that).datum();f.call(e,this.that,new Co(e,{sourceEvent:this.sourceEvent,target:m,type:e,transform:this.that.__zoom,dispatch:f}),t)}},m.wheelDelta=function(e){return arguments.length?(i="function"==typeof e?e:No(+e),m):i},m.filter=function(e){return arguments.length?(o="function"==typeof e?e:No(!!e),m):o},m.touchable=function(e){return arguments.length?(a="function"==typeof e?e:No(!!e),m):a},m.extent=function(e){return arguments.length?(r="function"==typeof e?e:No([[+e[0][0],+e[0][1]],[+e[1][0],+e[1][1]]]),m):r},m.scaleExtent=function(e){return arguments.length?(u[0]=+e[0],u[1]=+e[1],m):[u[0],u[1]]},m.translateExtent=function(e){return arguments.length?(s[0][0]=+e[0][0],s[1][0]=+e[1][0],s[0][1]=+e[0][1],s[1][1]=+e[1][1],m):[[s[0][0],s[0][1]],[s[1][0],s[1][1]]]},m.constrain=function(e){return arguments.length?(l=e,m):l},m.duration=function(e){return arguments.length?(c=+e,m):c},m.interpolate=function(e){return arguments.length?(d=e,m):d},m.on=function(){var e=f.on.apply(f,arguments);return e===f?m:e},m.clickDistance=function(e){return arguments.length?(v=(e=+e)*e,m):Math.sqrt(v)},m.tapDistance=function(e){return arguments.length?(g=+e,m):g},m}().scaleExtent([o.value,r.value]).translateExtent(i.value),c=ct(e).call(a),E=c.on("wheel.zoom"),$=Bo.translate(l.value.x??0,l.value.y??0).scale(Qo(l.value.zoom??1,o.value,r.value)),D=[[0,0],[n.width,n.height]],R=a.constrain()($,D,i.value);a.transform(c,R),k.value=a,N.value=c,C.value=E,M.value={x:R.x,y:R.y,zoom:R.k},B.value=e,pi(s,(e=>{O.value=e}));const V=pi(u);t.watchEffect((()=>{O.value&&_.value&&!T.value?a.on("zoom",null):!O.value&&!_.value&&a.on("zoom",(e=>{M.value={x:e.transform.x,y:e.transform.y,zoom:e.transform.k};const t=H(e.transform);I=L(p.value,z??0),x.viewportChange(t),x.move({event:e,flowTransform:t})}))})),a.on("start",(e=>{var t;if(!e.sourceEvent)return null;z=e.sourceEvent.button,T.value=!0;const n=H(e.transform);"mousedown"===(null==(t=e.sourceEvent)?void 0:t.type)&&(S.value=!0),A=n,x.viewportChangeStart(n),x.moveStart({event:e,flowTransform:n})})),a.on("end",(e=>{if(!e.sourceEvent)return null;if(T.value=!1,S.value=!1,L(p.value,z??0)&&!I&&x.paneContextMenu(e.sourceEvent),I=!1,function(e,t){return e.x!==t.x&&!isNaN(t.x)||e.y!==t.y&&!isNaN(t.y)||e.zoom!==t.k&&!isNaN(t.k)}(A,e.transform)){const t=H(e.transform);A=t,x.viewportChangeEnd(t),x.moveEnd({event:e,flowTransform:t})}})),t.watchEffect((()=>{!d.value||V.value||_.value?typeof E<"u"&&c.on("wheel.zoom",(function(e,t){if(!y.value||F(e,w.value))return null;e.preventDefault(),E.call(this,e,t)}),{passive:!1}):c.on("wheel.zoom",(e=>{if(F(e,w.value))return!1;e.preventDefault(),e.stopImmediatePropagation();const t=c.property("__zoom").k||1;if(e.ctrlKey&&g.value){const n=dt(e),o=t*2**(-e.deltaY*(1===e.deltaMode?.05:e.deltaMode?1:.002)*10);return void a.scaleTo(c,o,n)}const n=1===e.deltaMode?20:1,o=f.value===Go.Vertical?0:e.deltaX*n,r=f.value===Go.Horizontal?0:e.deltaY*n;a.translateBy(c,-o/t*h.value,-r/t*h.value)}),{passive:!1})})),a.filter((e=>{var t,n;const o=V.value||m.value,r=g.value&&e.ctrlKey;if(1===e.button&&"mousedown"===e.type&&(null!=(t=e.target)&&t.closest(".vue-flow__node")||null!=(n=e.target)&&n.closest(".vue-flow__edge")))return!0;if(!p.value&&!o&&!d.value&&!v.value&&!g.value||_.value||!v.value&&"dblclick"===e.type||F(e,w.value)&&"wheel"===e.type||F(e,b.value)&&"wheel"!==e.type||!g.value&&e.ctrlKey&&"wheel"===e.type||!o&&!d.value&&!r&&"wheel"===e.type||!p.value&&("mousedown"===e.type||"touchstart"===e.type)||Array.isArray(p.value)&&!p.value.includes(e.button)&&("mousedown"===e.type||"touchstart"===e.type))return!1;const l=Array.isArray(p.value)&&p.value.includes(e.button)||!e.button||e.button<=1;return(!e.ctrlKey||"wheel"===e.type)&&l}))})),(e,o)=>(t.openBlock(),t.createElementBlock(t.Fragment,null,[(t.openBlock(),t.createElementBlock("div",{ref_key:"viewportEl",ref:P,key:`viewport-${t.unref(n)}`,class:"vue-flow__viewport vue-flow__container"},[t.createVNode(Si,{"is-selecting":t.unref(R),class:t.normalizeClass({connecting:!!t.unref(E),dragging:t.unref(S),draggable:!!t.unref(p)})},{default:t.withCtx((()=>[t.createVNode(Ai,null,{default:t.withCtx((()=>[t.renderSlot(e.$slots,"zoom-pane")])),_:3})])),_:3},8,["is-selecting","class"])])),t.renderSlot(e.$slots,"default")],64))}}),Di=["id"],Ri=["id"],Vi=["id"],Li=t.defineComponent({name:"A11yDescriptions",compatConfig:{MODE:3},setup(e){const{id:n,disableKeyboardA11y:o,ariaLiveMessage:r}=ui(),l={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"};return(e,i)=>(t.openBlock(),t.createElementBlock(t.Fragment,null,[t.createElementVNode("div",{id:`${t.unref(jo)}-${t.unref(n)}`,style:{display:"none"}}," Press enter or space to select a node. "+t.toDisplayString(t.unref(o)?"":"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,Di),t.createElementVNode("div",{id:`${t.unref(Uo)}-${t.unref(n)}`,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,Ri),t.unref(o)?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("div",{key:0,id:`${t.unref("vue-flow__aria-live")}-${t.unref(n)}`,"aria-live":"assertive","aria-atomic":"true",style:l},t.toDisplayString(t.unref(r)),9,Vi))],64))}}),Hi=t.defineComponent({name:"VueFlow",compatConfig:{MODE:3},props:{id:null,modelValue:null,nodes:null,edges:null,edgeTypes:null,nodeTypes:null,connectionMode:null,connectionLineType:null,connectionLineStyle:{default:void 0},connectionLineOptions:{default:void 0},connectionRadius:null,isValidConnection:{type:Function,default:void 0},deleteKeyCode:{type:[Boolean,String,Function],default:void 0},selectionKeyCode:{type:[Boolean,String,Function],default:void 0},multiSelectionKeyCode:{type:[Boolean,String,Function],default:void 0},zoomActivationKeyCode:{type:[Boolean,String,Function],default:void 0},panActivationKeyCode:{type:[Boolean,String,Function],default:void 0},snapToGrid:{type:Boolean,default:void 0},snapGrid:null,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},elementsSelectable:{type:Boolean,default:void 0},selectNodesOnDrag:{type:Boolean,default:void 0},panOnDrag:{type:Boolean,default:void 0},minZoom:null,maxZoom:null,defaultViewport:null,translateExtent:null,nodeExtent:null,defaultMarkerColor:null,zoomOnScroll:{type:Boolean,default:void 0},zoomOnPinch:{type:Boolean,default:void 0},panOnScroll:{type:Boolean,default:void 0},panOnScrollSpeed:null,panOnScrollMode:null,zoomOnDoubleClick:{type:Boolean,default:void 0},preventScrolling:{type:Boolean,default:void 0},selectionMode:null,edgeUpdaterRadius:null,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:null,noWheelClassName:null,noPanClassName:null,defaultEdgeOptions:null,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},__experimentalFeatures:null},emits:["nodesChange","edgesChange","nodeDoubleClick","nodeClick","nodeMouseEnter","nodeMouseMove","nodeMouseLeave","nodeContextMenu","nodeDragStart","nodeDrag","nodeDragStop","nodesInitialized","miniMapNodeClick","miniMapNodeDoubleClick","miniMapNodeMouseEnter","miniMapNodeMouseMove","miniMapNodeMouseLeave","connect","connectStart","connectEnd","clickConnectStart","clickConnectEnd","moveStart","move","moveEnd","selectionDragStart","selectionDrag","selectionDragStop","selectionContextMenu","selectionStart","selectionEnd","viewportChangeStart","viewportChange","viewportChangeEnd","paneReady","paneScroll","paneClick","paneContextMenu","paneMouseEnter","paneMouseMove","paneMouseLeave","edgeContextMenu","edgeMouseEnter","edgeMouseMove","edgeMouseLeave","edgeDoubleClick","edgeClick","edgeUpdateStart","edgeUpdate","edgeUpdateEnd","updateNodeInternals","error","update:modelValue","update:nodes","update:edges"],setup(e,{expose:o,emit:r}){const l=e,i=j(l,"modelValue",r),a=j(l,"nodes",r),u=j(l,"edges",r),{vueFlowRef:s,hooks:c,getNodeTypes:d,getEdgeTypes:f,...h}=ui(l),p=Ei({modelValue:i,nodes:a,edges:u},l,{vueFlowRef:s,hooks:c,getNodeTypes:d,getEdgeTypes:f,...h});!function(e,o){t.onBeforeMount((()=>{for(const[t,r]of Object.entries(o.value)){const o=n=>{e(t,n)};r.on(o),n((()=>{r.off(o)}))}}))}(r,c);const v=t.ref();return t.provide(yl,t.useSlots()),t.onUnmounted((()=>{p()})),t.onMounted((()=>{s.value=v.value})),o({vueFlowRef:s,hooks:c,getNodeTypes:d,getEdgeTypes:f,...h}),(e,n)=>(t.openBlock(),t.createElementBlock("div",{ref_key:"el",ref:v,class:"vue-flow"},[t.createVNode($i,null,{nodes:t.withCtx((()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(Object.keys(t.unref(d)),(n=>t.renderSlot(e.$slots,`node-${n}`))),256))])),edges:t.withCtx((()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(Object.keys(t.unref(f)),(n=>t.renderSlot(e.$slots,`edge-${n}`))),256))])),"connection-name":t.withCtx((()=>[t.renderSlot(e.$slots,"connection-line")])),"zoom-pane":t.withCtx((()=>[t.renderSlot(e.$slots,"zoom-pane")])),default:t.withCtx((()=>[t.renderSlot(e.$slots,"default")])),_:3}),t.createVNode(Li)],512))}}),Yi=t.defineComponent({name:"Panel",compatConfig:{MODE:3},props:{position:null},setup(e){const n=e,{userSelectionActive:o}=ui(),r=t.computed((()=>`${n.position}`.split("-")));return(e,n)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["vue-flow__panel",t.unref(r)]),style:t.normalizeStyle({pointerEvents:t.unref(o)?"none":"all"})},[t.renderSlot(e.$slots,"default")],6))}});return e.BaseEdge=Nl,e.BezierEdge=Vl,e.ConnectionLineType=Ho,e.ConnectionMode=Yo,e.EdgeLabelRenderer=Kl,e.EdgeText=_l,e.ErrorCode=Vr,e.GlobalVueFlowStorage=ai,e.Handle=il,e.MarkerType=Fo,e.NodeIdInjection=pl,e.PanOnScrollMode=Go,e.Panel=Yi,e.PanelPosition=Xo,e.Position=Vo,e.SelectionMode=Lo,e.SimpleBezierEdge=Ll,e.SmoothStepEdge=Hl,e.StepEdge=Yl,e.StraightEdge=Fl,e.VueFlow=Hi,e.VueFlowError=Hr,e.VueFlowInjection=hl,e.addEdge=function(e,t,n){if(!e.source||!e.target)return Jr("Can't create edge. An edge needs a source and a target."),t;let o;return o=nr(e)?{...e}:{...e,id:ur(e)},o=ir(o,n),sr(o,t)||t.push(o),t},e.applyChanges=Sr,e.applyEdgeChanges=function(e,t){return Sr(e,t)},e.applyNodeChanges=function(e,t){return Sr(e,t)},e.clamp=Qo,e.connectionExists=sr,e.defaultEdgeTypes=oi,e.defaultNodeTypes=ni,e.getBezierEdgeCenter=Ml,e.getBezierPath=Ol,e.getBoundsofRects=function(e,t){return pr(fr(hr(e),hr(t)))},e.getConnectedEdges=mr,e.getIncomers=function(e,t){return ar(e,t,"source")},e.getMarkerId=br,e.getNodesInside=gr,e.getOutgoers=function(e,t){return ar(e,t,"target")},e.getRectOfNodes=vr,e.getSimpleBezierPath=Il,e.getSimpleEdgeCenter=Cl,e.getSmoothStepPath=Dl,e.getStraightPath=Rl,e.getTransformForBounds=yr,e.graphPosToZoomedPos=cr,e.isEdge=nr,e.isGraphEdge=or,e.isGraphNode=lr,e.isNode=rr,e.pointToRendererPoint=dr,e.rendererPointToPoint=cr,e.updateEdge=function(e,t,n){if(!t.source||!t.target)return Jr("Can't create new edge. An edge needs a source and a target."),n;const o=n.find((t=>nr(t)&&t.id===e.id));if(!o)return Jr(`The old edge with id=${e.id} does not exist.`),n;const r={...e,id:ur(t),source:t.source,target:t.target,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle};return n.splice(n.indexOf(o),1,r),n.filter((t=>t.id!==e.id))},e.useEdge=function(e){const n=e??t.inject(gl,""),o=t.inject(ml,t.ref(null)),{findEdge:r,emits:l}=ui(),i=r(n);return i||l.error(new Hr(Vr.EDGE_NOT_FOUND,n)),{id:n,edge:i,edgeEl:o}},e.useGetPointerPosition=si,e.useHandle=di,e.useNode=vi,e.useVueFlow=ui,e.useZoomPanHelper=function(e){const t=ui({id:e}),n=bi(t.value,t.value);return{fitView:e=>n.value.fitView(e),zoomIn:e=>n.value.zoomIn(e),zoomOut:e=>n.value.zoomOut(e),zoomTo:(e,t)=>n.value.zoomTo(e,t),setViewport:(e,t)=>n.value.setViewport(e,t),setTransform:(e,t)=>n.value.setTransform(e,t),getViewport:()=>n.value.getViewport(),getTransform:()=>n.value.getTransform(),setCenter:(e,t,o)=>n.value.setCenter(e,t,o),fitBounds:(e,t)=>n.value.fitBounds(e,t),project:e=>n.value.project(e)}},Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),e}({},Vue);
export {VueFlowCore}
//# sourceMappingURL=/sm/3e1e3e9f46311b779ae9ea762dc1a9ab7998312b9ab7965d117ce0bdecd7c863.map