Files
vue-pure-admin/static/js/vue-flow-core-CVPar5v3.js

27 lines
159 KiB
JavaScript

var Tr=Object.defineProperty,kr=Object.defineProperties;var $r=Object.getOwnPropertyDescriptors;var Wt=Object.getOwnPropertySymbols;var Eo=Object.prototype.hasOwnProperty,So=Object.prototype.propertyIsEnumerable;var ht=Math.pow,xo=(e,t,n)=>t in e?Tr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,$=(e,t)=>{for(var n in t||(t={}))Eo.call(t,n)&&xo(e,n,t[n]);if(Wt)for(var n of Wt(t))So.call(t,n)&&xo(e,n,t[n]);return e},fe=(e,t)=>kr(e,$r(t));var gt=(e,t)=>{var n={};for(var o in e)Eo.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(e!=null&&Wt)for(var o of Wt(e))t.indexOf(o)<0&&So.call(e,o)&&(n[o]=e[o]);return n};var No=(e,t,n)=>new Promise((o,i)=>{var r=l=>{try{a(n.next(l))}catch(u){i(u)}},s=l=>{try{a(n.throw(l))}catch(u){i(u)}},a=l=>l.done?o(l.value):Promise.resolve(l.value).then(r,s);a((n=n.apply(e,t)).next())});import{ba as Ct,eN as pi,n as ve,d as be,b as ge,j as ye,K as Xe,q as Ue,u as te,s as wt,v as re,dx as Dr,g as st,a4 as mi,i as Be,e as at,F as Ve,l as Ee,T as Ar,P as we,eO as Or,m as et,a$ as zr,o as Br,f as Fe,w as Xn,Z as Mt,bb as yi,bc as rn,U as Vr,h as Rr,t as Un,Y as Hr,k as lo,x as Ge,y as _i,eP as Lr,L as Je,r as Fr,aE as uo,b6 as Yr,eQ as Gr,N as ue,bd as bt,J as me,a1 as sn,eR as Xr,a as wi}from"./index-ChQ6eMdI.js";function Bt(e){return yi()?(rn(e),!0):!1}function Le(e){return typeof e=="function"?e():te(e)}const Ur=typeof window!="undefined"&&typeof document!="undefined",Zr=e=>typeof e!="undefined",Wr=Object.prototype.toString,Kr=e=>Wr.call(e)==="[object Object]",qr=()=>{};function Jr(e,t){function n(...o){return new Promise((i,r)=>{Promise.resolve(e(()=>t.apply(this,o),{fn:t,thisArg:this,args:o})).then(i).catch(r)})}return n}const bi=e=>e();function Qr(e=bi){const t=Ee(!0);function n(){t.value=!1}function o(){t.value=!0}const i=(...r)=>{t.value&&e(...r)};return{isActive:Xr(t),pause:n,resume:o,eventFilter:i}}function Co(e,t=!1,n="Timeout"){return new Promise((o,i)=>{setTimeout(t?()=>i(n):o,e)})}function jr(e,t,n={}){const r=n,{eventFilter:o=bi}=r,i=gt(r,["eventFilter"]);return ve(e,Jr(o,t),i)}function vt(e,t,n={}){const c=n,{eventFilter:o}=c,i=gt(c,["eventFilter"]),{eventFilter:r,pause:s,resume:a,isActive:l}=Qr(o);return{stop:jr(e,t,fe($({},i),{eventFilter:r})),pause:s,resume:a,isActive:l}}function es(e,t={}){if(!uo(e))return Yr(e);const n=Array.isArray(e.value)?Array.from({length:e.value.length}):{};for(const o in e.value)n[o]=Gr(()=>({get(){return e.value[o]},set(i){var r;if((r=Le(t.replaceRef))!=null?r:!0)if(Array.isArray(e.value)){const a=[...e.value];a[o]=i,e.value=a}else{const a=fe($({},e.value),{[o]:i});Object.setPrototypeOf(a,Object.getPrototypeOf(e.value)),e.value=a}else e.value[o]=i}}));return n}function Zn(e,t=!1){function n(d,{flush:h="sync",deep:g=!1,timeout:E,throwOnTimeout:w}={}){let S=null;const M=[new Promise(y=>{S=ve(e,N=>{d(N)!==t&&(S==null||S(),y(N))},{flush:h,deep:g,immediate:!0})})];return E!=null&&M.push(Co(E,w).then(()=>Le(e)).finally(()=>S==null?void 0:S())),Promise.race(M)}function o(d,h){if(!uo(d))return n(N=>N===d,h);const{flush:g="sync",deep:E=!1,timeout:w,throwOnTimeout:S}=h!=null?h:{};let C=null;const y=[new Promise(N=>{C=ve([e,d],([z,L])=>{t!==(z===L)&&(C==null||C(),N(z))},{flush:g,deep:E,immediate:!0})})];return w!=null&&y.push(Co(w,S).then(()=>Le(e)).finally(()=>(C==null||C(),Le(e)))),Promise.race(y)}function i(d){return n(h=>!!h,d)}function r(d){return o(null,d)}function s(d){return o(void 0,d)}function a(d){return n(Number.isNaN,d)}function l(d,h){return n(g=>{const E=Array.from(g);return E.includes(d)||E.includes(Le(d))},h)}function u(d){return c(1,d)}function c(d=1,h){let g=-1;return n(()=>(g+=1,g>=d),h)}return Array.isArray(Le(e))?{toMatch:n,toContains:l,changed:u,changedTimes:c,get not(){return Zn(e,!t)}}:{toMatch:n,toBe:o,toBeTruthy:i,toBeNull:r,toBeNaN:a,toBeUndefined:s,changed:u,changedTimes:c,get not(){return Zn(e,!t)}}}function Wn(e){return Zn(e)}function ts(e){var t;const n=Le(e);return(t=n==null?void 0:n.$el)!=null?t:n}const xi=Ur?window:void 0;function Ei(...e){let t,n,o,i;if(typeof e[0]=="string"||Array.isArray(e[0])?([n,o,i]=e,t=xi):[t,n,o,i]=e,!t)return qr;Array.isArray(n)||(n=[n]),Array.isArray(o)||(o=[o]);const r=[],s=()=>{r.forEach(c=>c()),r.length=0},a=(c,d,h,g)=>(c.addEventListener(d,h,g),()=>c.removeEventListener(d,h,g)),l=ve(()=>[ts(t),Le(i)],([c,d])=>{if(s(),!c)return;const h=Kr(d)?$({},d):d;r.push(...n.flatMap(g=>o.map(E=>a(c,g,E,h))))},{immediate:!0,flush:"post"}),u=()=>{l(),s()};return Bt(u),u}function ns(e){return typeof e=="function"?e:typeof e=="string"?t=>t.key===e:Array.isArray(e)?t=>e.includes(t.key):()=>!0}function Mo(...e){let t,n,o={};e.length===3?(t=e[0],n=e[1],o=e[2]):e.length===2?typeof e[1]=="object"?(t=!0,n=e[0],o=e[1]):(t=e[0],n=e[1]):(t=!0,n=e[0]);const{target:i=xi,eventName:r="keydown",passive:s=!1,dedupe:a=!1}=o,l=ns(t);return Ei(i,r,c=>{c.repeat&&Le(a)||l(c)&&n(c)},s)}function os(e){return JSON.parse(JSON.stringify(e))}function An(e,t,n,o={}){var i,r,s;const{clone:a=!1,passive:l=!1,eventName:u,deep:c=!1,defaultValue:d,shouldEmit:h}=o,g=Mt(),E=n||(g==null?void 0:g.emit)||((i=g==null?void 0:g.$emit)==null?void 0:i.bind(g))||((s=(r=g==null?void 0:g.proxy)==null?void 0:r.$emit)==null?void 0:s.bind(g==null?void 0:g.proxy));let w=u;t||(t="modelValue"),w=w||`update:${t.toString()}`;const S=y=>a?typeof a=="function"?a(y):os(y):y,C=()=>Zr(e[t])?S(e[t]):d,M=y=>{h?h(y)&&E(w,y):E(w,y)};if(l){const y=C(),N=Ee(y);let z=!1;return ve(()=>e[t],L=>{z||(z=!0,N.value=S(L),Ge(()=>z=!1))}),ve(N,L=>{!z&&(L!==e[t]||c)&&M(L)},{deep:c}),N}else return re({get(){return C()},set(y){M(y)}})}var is={value:()=>{}};function En(){for(var e=0,t=arguments.length,n={},o;e<t;++e){if(!(o=arguments[e]+"")||o in n||/[\s.]/.test(o))throw new Error("illegal type: "+o);n[o]=[]}return new an(n)}function an(e){this._=e}function rs(e,t){return e.trim().split(/^|\s+/).map(function(n){var o="",i=n.indexOf(".");if(i>=0&&(o=n.slice(i+1),n=n.slice(0,i)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:o}})}an.prototype=En.prototype={constructor:an,on:function(e,t){var n=this._,o=rs(e+"",n),i,r=-1,s=o.length;if(arguments.length<2){for(;++r<s;)if((i=(e=o[r]).type)&&(i=ss(n[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++r<s;)if(i=(e=o[r]).type)n[i]=Io(n[i],e.name,t);else if(t==null)for(i in n)n[i]=Io(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new an(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=new Array(i),o=0,i,r;o<i;++o)n[o]=arguments[o+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(r=this._[e],o=0,i=r.length;o<i;++o)r[o].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var o=this._[e],i=0,r=o.length;i<r;++i)o[i].value.apply(t,n)}};function ss(e,t){for(var n=0,o=e.length,i;n<o;++n)if((i=e[n]).name===t)return i.value}function Io(e,t,n){for(var o=0,i=e.length;o<i;++o)if(e[o].name===t){e[o]=is,e=e.slice(0,o).concat(e.slice(o+1));break}return n!=null&&e.push({name:t,value:n}),e}var Kn="http://www.w3.org/1999/xhtml";const Po={svg:"http://www.w3.org/2000/svg",xhtml:Kn,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Sn(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),Po.hasOwnProperty(t)?{space:Po[t],local:e}:e}function as(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Kn&&t.documentElement.namespaceURI===Kn?t.createElement(e):t.createElementNS(n,e)}}function ls(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Si(e){var t=Sn(e);return(t.local?ls:as)(t)}function us(){}function co(e){return e==null?us:function(){return this.querySelector(e)}}function cs(e){typeof e!="function"&&(e=co(e));for(var t=this._groups,n=t.length,o=new Array(n),i=0;i<n;++i)for(var r=t[i],s=r.length,a=o[i]=new Array(s),l,u,c=0;c<s;++c)(l=r[c])&&(u=e.call(l,l.__data__,c,r))&&("__data__"in l&&(u.__data__=l.__data__),a[c]=u);return new Ie(o,this._parents)}function ds(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function fs(){return[]}function Ni(e){return e==null?fs:function(){return this.querySelectorAll(e)}}function hs(e){return function(){return ds(e.apply(this,arguments))}}function gs(e){typeof e=="function"?e=hs(e):e=Ni(e);for(var t=this._groups,n=t.length,o=[],i=[],r=0;r<n;++r)for(var s=t[r],a=s.length,l,u=0;u<a;++u)(l=s[u])&&(o.push(e.call(l,l.__data__,u,s)),i.push(l));return new Ie(o,i)}function Ci(e){return function(){return this.matches(e)}}function Mi(e){return function(t){return t.matches(e)}}var vs=Array.prototype.find;function ps(e){return function(){return vs.call(this.children,e)}}function ms(){return this.firstElementChild}function ys(e){return this.select(e==null?ms:ps(typeof e=="function"?e:Mi(e)))}var _s=Array.prototype.filter;function ws(){return Array.from(this.children)}function bs(e){return function(){return _s.call(this.children,e)}}function xs(e){return this.selectAll(e==null?ws:bs(typeof e=="function"?e:Mi(e)))}function Es(e){typeof e!="function"&&(e=Ci(e));for(var t=this._groups,n=t.length,o=new Array(n),i=0;i<n;++i)for(var r=t[i],s=r.length,a=o[i]=[],l,u=0;u<s;++u)(l=r[u])&&e.call(l,l.__data__,u,r)&&a.push(l);return new Ie(o,this._parents)}function Ii(e){return new Array(e.length)}function Ss(){return new Ie(this._enter||this._groups.map(Ii),this._parents)}function fn(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}fn.prototype={constructor:fn,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function Ns(e){return function(){return e}}function Cs(e,t,n,o,i,r){for(var s=0,a,l=t.length,u=r.length;s<u;++s)(a=t[s])?(a.__data__=r[s],o[s]=a):n[s]=new fn(e,r[s]);for(;s<l;++s)(a=t[s])&&(i[s]=a)}function Ms(e,t,n,o,i,r,s){var a,l,u=new Map,c=t.length,d=r.length,h=new Array(c),g;for(a=0;a<c;++a)(l=t[a])&&(h[a]=g=s.call(l,l.__data__,a,t)+"",u.has(g)?i[a]=l:u.set(g,l));for(a=0;a<d;++a)g=s.call(e,r[a],a,r)+"",(l=u.get(g))?(o[a]=l,l.__data__=r[a],u.delete(g)):n[a]=new fn(e,r[a]);for(a=0;a<c;++a)(l=t[a])&&u.get(h[a])===l&&(i[a]=l)}function Is(e){return e.__data__}function Ps(e,t){if(!arguments.length)return Array.from(this,Is);var n=t?Ms:Cs,o=this._parents,i=this._groups;typeof e!="function"&&(e=Ns(e));for(var r=i.length,s=new Array(r),a=new Array(r),l=new Array(r),u=0;u<r;++u){var c=o[u],d=i[u],h=d.length,g=Ts(e.call(c,c&&c.__data__,u,o)),E=g.length,w=a[u]=new Array(E),S=s[u]=new Array(E),C=l[u]=new Array(h);n(c,d,w,S,C,g,t);for(var M=0,y=0,N,z;M<E;++M)if(N=w[M]){for(M>=y&&(y=M+1);!(z=S[y])&&++y<E;);N._next=z||null}}return s=new Ie(s,o),s._enter=a,s._exit=l,s}function Ts(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function ks(){return new Ie(this._exit||this._groups.map(Ii),this._parents)}function $s(e,t,n){var o=this.enter(),i=this,r=this.exit();return typeof e=="function"?(o=e(o),o&&(o=o.selection())):o=o.append(e+""),t!=null&&(i=t(i),i&&(i=i.selection())),n==null?r.remove():n(r),o&&i?o.merge(i).order():i}function Ds(e){for(var t=e.selection?e.selection():e,n=this._groups,o=t._groups,i=n.length,r=o.length,s=Math.min(i,r),a=new Array(i),l=0;l<s;++l)for(var u=n[l],c=o[l],d=u.length,h=a[l]=new Array(d),g,E=0;E<d;++E)(g=u[E]||c[E])&&(h[E]=g);for(;l<i;++l)a[l]=n[l];return new Ie(a,this._parents)}function As(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var o=e[t],i=o.length-1,r=o[i],s;--i>=0;)(s=o[i])&&(r&&s.compareDocumentPosition(r)^4&&r.parentNode.insertBefore(s,r),r=s);return this}function Os(e){e||(e=zs);function t(d,h){return d&&h?e(d.__data__,h.__data__):!d-!h}for(var n=this._groups,o=n.length,i=new Array(o),r=0;r<o;++r){for(var s=n[r],a=s.length,l=i[r]=new Array(a),u,c=0;c<a;++c)(u=s[c])&&(l[c]=u);l.sort(t)}return new Ie(i,this._parents).order()}function zs(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function Bs(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function Vs(){return Array.from(this)}function Rs(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var o=e[t],i=0,r=o.length;i<r;++i){var s=o[i];if(s)return s}return null}function Hs(){let e=0;for(const t of this)++e;return e}function Ls(){return!this.node()}function Fs(e){for(var t=this._groups,n=0,o=t.length;n<o;++n)for(var i=t[n],r=0,s=i.length,a;r<s;++r)(a=i[r])&&e.call(a,a.__data__,r,i);return this}function Ys(e){return function(){this.removeAttribute(e)}}function Gs(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Xs(e,t){return function(){this.setAttribute(e,t)}}function Us(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function Zs(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function Ws(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function Ks(e,t){var n=Sn(e);if(arguments.length<2){var o=this.node();return n.local?o.getAttributeNS(n.space,n.local):o.getAttribute(n)}return this.each((t==null?n.local?Gs:Ys:typeof t=="function"?n.local?Ws:Zs:n.local?Us:Xs)(n,t))}function Pi(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function qs(e){return function(){this.style.removeProperty(e)}}function Js(e,t,n){return function(){this.style.setProperty(e,t,n)}}function Qs(e,t,n){return function(){var o=t.apply(this,arguments);o==null?this.style.removeProperty(e):this.style.setProperty(e,o,n)}}function js(e,t,n){return arguments.length>1?this.each((t==null?qs:typeof t=="function"?Qs:Js)(e,t,n==null?"":n)):xt(this.node(),e)}function xt(e,t){return e.style.getPropertyValue(t)||Pi(e).getComputedStyle(e,null).getPropertyValue(t)}function ea(e){return function(){delete this[e]}}function ta(e,t){return function(){this[e]=t}}function na(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function oa(e,t){return arguments.length>1?this.each((t==null?ea:typeof t=="function"?na:ta)(e,t)):this.node()[e]}function Ti(e){return e.trim().split(/^|\s+/)}function fo(e){return e.classList||new ki(e)}function ki(e){this._node=e,this._names=Ti(e.getAttribute("class")||"")}ki.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function $i(e,t){for(var n=fo(e),o=-1,i=t.length;++o<i;)n.add(t[o])}function Di(e,t){for(var n=fo(e),o=-1,i=t.length;++o<i;)n.remove(t[o])}function ia(e){return function(){$i(this,e)}}function ra(e){return function(){Di(this,e)}}function sa(e,t){return function(){(t.apply(this,arguments)?$i:Di)(this,e)}}function aa(e,t){var n=Ti(e+"");if(arguments.length<2){for(var o=fo(this.node()),i=-1,r=n.length;++i<r;)if(!o.contains(n[i]))return!1;return!0}return this.each((typeof t=="function"?sa:t?ia:ra)(n,t))}function la(){this.textContent=""}function ua(e){return function(){this.textContent=e}}function ca(e){return function(){var t=e.apply(this,arguments);this.textContent=t==null?"":t}}function da(e){return arguments.length?this.each(e==null?la:(typeof e=="function"?ca:ua)(e)):this.node().textContent}function fa(){this.innerHTML=""}function ha(e){return function(){this.innerHTML=e}}function ga(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t==null?"":t}}function va(e){return arguments.length?this.each(e==null?fa:(typeof e=="function"?ga:ha)(e)):this.node().innerHTML}function pa(){this.nextSibling&&this.parentNode.appendChild(this)}function ma(){return this.each(pa)}function ya(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function _a(){return this.each(ya)}function wa(e){var t=typeof e=="function"?e:Si(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function ba(){return null}function xa(e,t){var n=typeof e=="function"?e:Si(e),o=t==null?ba:typeof t=="function"?t:co(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),o.apply(this,arguments)||null)})}function Ea(){var e=this.parentNode;e&&e.removeChild(this)}function Sa(){return this.each(Ea)}function Na(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Ca(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Ma(e){return this.select(e?Ca:Na)}function Ia(e){return arguments.length?this.property("__data__",e):this.node().__data__}function Pa(e){return function(t){e.call(this,t,this.__data__)}}function Ta(e){return e.trim().split(/^|\s+/).map(function(t){var n="",o=t.indexOf(".");return o>=0&&(n=t.slice(o+1),t=t.slice(0,o)),{type:t,name:n}})}function ka(e){return function(){var t=this.__on;if(t){for(var n=0,o=-1,i=t.length,r;n<i;++n)r=t[n],(!e.type||r.type===e.type)&&r.name===e.name?this.removeEventListener(r.type,r.listener,r.options):t[++o]=r;++o?t.length=o:delete this.__on}}}function $a(e,t,n){return function(){var o=this.__on,i,r=Pa(t);if(o){for(var s=0,a=o.length;s<a;++s)if((i=o[s]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=r,i.options=n),i.value=t;return}}this.addEventListener(e.type,r,n),i={type:e.type,name:e.name,value:t,listener:r,options:n},o?o.push(i):this.__on=[i]}}function Da(e,t,n){var o=Ta(e+""),i,r=o.length,s;if(arguments.length<2){var a=this.node().__on;if(a){for(var l=0,u=a.length,c;l<u;++l)for(i=0,c=a[l];i<r;++i)if((s=o[i]).type===c.type&&s.name===c.name)return c.value}return}for(a=t?$a:ka,i=0;i<r;++i)this.each(a(o[i],t,n));return this}function Ai(e,t,n){var o=Pi(e),i=o.CustomEvent;typeof i=="function"?i=new i(t,n):(i=o.document.createEvent("Event"),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function Aa(e,t){return function(){return Ai(this,e,t)}}function Oa(e,t){return function(){return Ai(this,e,t.apply(this,arguments))}}function za(e,t){return this.each((typeof t=="function"?Oa:Aa)(e,t))}function*Ba(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var o=e[t],i=0,r=o.length,s;i<r;++i)(s=o[i])&&(yield s)}var Oi=[null];function Ie(e,t){this._groups=e,this._parents=t}function Xt(){return new Ie([[document.documentElement]],Oi)}function Va(){return this}Ie.prototype=Xt.prototype={constructor:Ie,select:cs,selectAll:gs,selectChild:ys,selectChildren:xs,filter:Es,data:Ps,enter:Ss,exit:ks,join:$s,merge:Ds,selection:Va,order:As,sort:Os,call:Bs,nodes:Vs,node:Rs,size:Hs,empty:Ls,each:Fs,attr:Ks,style:js,property:oa,classed:aa,text:da,html:va,raise:ma,lower:_a,append:wa,insert:xa,remove:Sa,clone:Ma,datum:Ia,on:Da,dispatch:za,[Symbol.iterator]:Ba};function Pe(e){return typeof e=="string"?new Ie([[document.querySelector(e)]],[document.documentElement]):new Ie([[e]],Oi)}function Ra(e){let t;for(;t=e.sourceEvent;)e=t;return e}function De(e,t){if(e=Ra(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var o=n.createSVGPoint();return o.x=e.clientX,o.y=e.clientY,o=o.matrixTransform(t.getScreenCTM().inverse()),[o.x,o.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}const Ha={passive:!1},Vt={capture:!0,passive:!1};function On(e){e.stopImmediatePropagation()}function mt(e){e.preventDefault(),e.stopImmediatePropagation()}function zi(e){var t=e.document.documentElement,n=Pe(e).on("dragstart.drag",mt,Vt);"onselectstart"in t?n.on("selectstart.drag",mt,Vt):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function Bi(e,t){var n=e.document.documentElement,o=Pe(e).on("dragstart.drag",null);t&&(o.on("click.drag",mt,Vt),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 Kt=e=>()=>e;function qn(e,{sourceEvent:t,subject:n,target:o,identifier:i,active:r,x:s,y:a,dx:l,dy:u,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:i,enumerable:!0,configurable:!0},active:{value:r,enumerable:!0,configurable:!0},x:{value:s,enumerable:!0,configurable:!0},y:{value:a,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:c}})}qn.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function La(e){return!e.ctrlKey&&!e.button}function Fa(){return this.parentNode}function Ya(e,t){return t==null?{x:e.x,y:e.y}:t}function Ga(){return navigator.maxTouchPoints||"ontouchstart"in this}function Xa(){var e=La,t=Fa,n=Ya,o=Ga,i={},r=En("start","drag","end"),s=0,a,l,u,c,d=0;function h(N){N.on("mousedown.drag",g).filter(o).on("touchstart.drag",S).on("touchmove.drag",C,Ha).on("touchend.drag touchcancel.drag",M).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function g(N,z){if(!(c||!e.call(this,N,z))){var L=y(this,t.call(this,N,z),N,z,"mouse");L&&(Pe(N.view).on("mousemove.drag",E,Vt).on("mouseup.drag",w,Vt),zi(N.view),On(N),u=!1,a=N.clientX,l=N.clientY,L("start",N))}}function E(N){if(mt(N),!u){var z=N.clientX-a,L=N.clientY-l;u=z*z+L*L>d}i.mouse("drag",N)}function w(N){Pe(N.view).on("mousemove.drag mouseup.drag",null),Bi(N.view,u),mt(N),i.mouse("end",N)}function S(N,z){if(e.call(this,N,z)){var L=N.changedTouches,K=t.call(this,N,z),Y=L.length,J,X;for(J=0;J<Y;++J)(X=y(this,K,N,z,L[J].identifier,L[J]))&&(On(N),X("start",N,L[J]))}}function C(N){var z=N.changedTouches,L=z.length,K,Y;for(K=0;K<L;++K)(Y=i[z[K].identifier])&&(mt(N),Y("drag",N,z[K]))}function M(N){var z=N.changedTouches,L=z.length,K,Y;for(c&&clearTimeout(c),c=setTimeout(function(){c=null},500),K=0;K<L;++K)(Y=i[z[K].identifier])&&(On(N),Y("end",N,z[K]))}function y(N,z,L,K,Y,J){var X=r.copy(),D=De(J||L,z),b,ee,m;if((m=n.call(N,new qn("beforestart",{sourceEvent:L,target:h,identifier:Y,active:s,x:D[0],y:D[1],dx:0,dy:0,dispatch:X}),K))!=null)return b=m.x-D[0]||0,ee=m.y-D[1]||0,function I(x,k,A){var B=D,O;switch(x){case"start":i[Y]=I,O=s++;break;case"end":delete i[Y],--s;case"drag":D=De(A||k,z),O=s;break}X.call(x,N,new qn(x,{sourceEvent:k,subject:m,target:h,identifier:Y,active:O,x:D[0]+b,y:D[1]+ee,dx:D[0]-B[0],dy:D[1]-B[1],dispatch:X}),K)}}return h.filter=function(N){return arguments.length?(e=typeof N=="function"?N:Kt(!!N),h):e},h.container=function(N){return arguments.length?(t=typeof N=="function"?N:Kt(N),h):t},h.subject=function(N){return arguments.length?(n=typeof N=="function"?N:Kt(N),h):n},h.touchable=function(N){return arguments.length?(o=typeof N=="function"?N:Kt(!!N),h):o},h.on=function(){var N=r.on.apply(r,arguments);return N===r?h:N},h.clickDistance=function(N){return arguments.length?(d=(N=+N)*N,h):Math.sqrt(d)},h}function ho(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Vi(e,t){var n=Object.create(e.prototype);for(var o in t)n[o]=t[o];return n}function Ut(){}var Rt=.7,hn=1/Rt,yt="\\s*([+-]?\\d+)\\s*",Ht="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",ze="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Ua=/^#([0-9a-f]{3,8})$/,Za=new RegExp(`^rgb\\(${yt},${yt},${yt}\\)$`),Wa=new RegExp(`^rgb\\(${ze},${ze},${ze}\\)$`),Ka=new RegExp(`^rgba\\(${yt},${yt},${yt},${Ht}\\)$`),qa=new RegExp(`^rgba\\(${ze},${ze},${ze},${Ht}\\)$`),Ja=new RegExp(`^hsl\\(${Ht},${ze},${ze}\\)$`),Qa=new RegExp(`^hsla\\(${Ht},${ze},${ze},${Ht}\\)$`),To={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};ho(Ut,lt,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:ko,formatHex:ko,formatHex8:ja,formatHsl:el,formatRgb:$o,toString:$o});function ko(){return this.rgb().formatHex()}function ja(){return this.rgb().formatHex8()}function el(){return Ri(this).formatHsl()}function $o(){return this.rgb().formatRgb()}function lt(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Ua.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?Do(t):n===3?new Me(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?qt(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?qt(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=Za.exec(e))?new Me(t[1],t[2],t[3],1):(t=Wa.exec(e))?new Me(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Ka.exec(e))?qt(t[1],t[2],t[3],t[4]):(t=qa.exec(e))?qt(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Ja.exec(e))?zo(t[1],t[2]/100,t[3]/100,1):(t=Qa.exec(e))?zo(t[1],t[2]/100,t[3]/100,t[4]):To.hasOwnProperty(e)?Do(To[e]):e==="transparent"?new Me(NaN,NaN,NaN,0):null}function Do(e){return new Me(e>>16&255,e>>8&255,e&255,1)}function qt(e,t,n,o){return o<=0&&(e=t=n=NaN),new Me(e,t,n,o)}function tl(e){return e instanceof Ut||(e=lt(e)),e?(e=e.rgb(),new Me(e.r,e.g,e.b,e.opacity)):new Me}function Jn(e,t,n,o){return arguments.length===1?tl(e):new Me(e,t,n,o==null?1:o)}function Me(e,t,n,o){this.r=+e,this.g=+t,this.b=+n,this.opacity=+o}ho(Me,Jn,Vi(Ut,{brighter(e){return e=e==null?hn:Math.pow(hn,e),new Me(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Rt:Math.pow(Rt,e),new Me(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Me(it(this.r),it(this.g),it(this.b),gn(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:Ao,formatHex:Ao,formatHex8:nl,formatRgb:Oo,toString:Oo}));function Ao(){return`#${ot(this.r)}${ot(this.g)}${ot(this.b)}`}function nl(){return`#${ot(this.r)}${ot(this.g)}${ot(this.b)}${ot((isNaN(this.opacity)?1:this.opacity)*255)}`}function Oo(){const e=gn(this.opacity);return`${e===1?"rgb(":"rgba("}${it(this.r)}, ${it(this.g)}, ${it(this.b)}${e===1?")":`, ${e})`}`}function gn(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function it(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function ot(e){return e=it(e),(e<16?"0":"")+e.toString(16)}function zo(e,t,n,o){return o<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Te(e,t,n,o)}function Ri(e){if(e instanceof Te)return new Te(e.h,e.s,e.l,e.opacity);if(e instanceof Ut||(e=lt(e)),!e)return new Te;if(e instanceof Te)return e;e=e.rgb();var t=e.r/255,n=e.g/255,o=e.b/255,i=Math.min(t,n,o),r=Math.max(t,n,o),s=NaN,a=r-i,l=(r+i)/2;return a?(t===r?s=(n-o)/a+(n<o)*6:n===r?s=(o-t)/a+2:s=(t-n)/a+4,a/=l<.5?r+i:2-r-i,s*=60):a=l>0&&l<1?0:s,new Te(s,a,l,e.opacity)}function ol(e,t,n,o){return arguments.length===1?Ri(e):new Te(e,t,n,o==null?1:o)}function Te(e,t,n,o){this.h=+e,this.s=+t,this.l=+n,this.opacity=+o}ho(Te,ol,Vi(Ut,{brighter(e){return e=e==null?hn:Math.pow(hn,e),new Te(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Rt:Math.pow(Rt,e),new Te(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,o=n+(n<.5?n:1-n)*t,i=2*n-o;return new Me(zn(e>=240?e-240:e+120,i,o),zn(e,i,o),zn(e<120?e+240:e-120,i,o),this.opacity)},clamp(){return new Te(Bo(this.h),Jt(this.s),Jt(this.l),gn(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=gn(this.opacity);return`${e===1?"hsl(":"hsla("}${Bo(this.h)}, ${Jt(this.s)*100}%, ${Jt(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Bo(e){return e=(e||0)%360,e<0?e+360:e}function Jt(e){return Math.max(0,Math.min(1,e||0))}function zn(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const go=e=>()=>e;function il(e,t){return function(n){return e+n*t}}function rl(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(o){return Math.pow(e+o*t,n)}}function sl(e){return(e=+e)==1?Hi:function(t,n){return n-t?rl(t,n,e):go(isNaN(t)?n:t)}}function Hi(e,t){var n=t-e;return n?il(e,n):go(isNaN(e)?t:e)}const vn=(function e(t){var n=sl(t);function o(i,r){var s=n((i=Jn(i)).r,(r=Jn(r)).r),a=n(i.g,r.g),l=n(i.b,r.b),u=Hi(i.opacity,r.opacity);return function(c){return i.r=s(c),i.g=a(c),i.b=l(c),i.opacity=u(c),i+""}}return o.gamma=e,o})(1);function al(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,o=t.slice(),i;return function(r){for(i=0;i<n;++i)o[i]=e[i]*(1-r)+t[i]*r;return o}}function ll(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function ul(e,t){var n=t?t.length:0,o=e?Math.min(n,e.length):0,i=new Array(o),r=new Array(n),s;for(s=0;s<o;++s)i[s]=At(e[s],t[s]);for(;s<n;++s)r[s]=t[s];return function(a){for(s=0;s<o;++s)r[s]=i[s](a);return r}}function cl(e,t){var n=new Date;return e=+e,t=+t,function(o){return n.setTime(e*(1-o)+t*o),n}}function Ae(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function dl(e,t){var n={},o={},i;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(i in t)i in e?n[i]=At(e[i],t[i]):o[i]=t[i];return function(r){for(i in n)o[i]=n[i](r);return o}}var Qn=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Bn=new RegExp(Qn.source,"g");function fl(e){return function(){return e}}function hl(e){return function(t){return e(t)+""}}function Li(e,t){var n=Qn.lastIndex=Bn.lastIndex=0,o,i,r,s=-1,a=[],l=[];for(e=e+"",t=t+"";(o=Qn.exec(e))&&(i=Bn.exec(t));)(r=i.index)>n&&(r=t.slice(n,r),a[s]?a[s]+=r:a[++s]=r),(o=o[0])===(i=i[0])?a[s]?a[s]+=i:a[++s]=i:(a[++s]=null,l.push({i:s,x:Ae(o,i)})),n=Bn.lastIndex;return n<t.length&&(r=t.slice(n),a[s]?a[s]+=r:a[++s]=r),a.length<2?l[0]?hl(l[0].x):fl(t):(t=l.length,function(u){for(var c=0,d;c<t;++c)a[(d=l[c]).i]=d.x(u);return a.join("")})}function At(e,t){var n=typeof t,o;return t==null||n==="boolean"?go(t):(n==="number"?Ae:n==="string"?(o=lt(t))?(t=o,vn):Li:t instanceof lt?vn:t instanceof Date?cl:ll(t)?al:Array.isArray(t)?ul:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?dl:Ae)(e,t)}var Vo=180/Math.PI,jn={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Fi(e,t,n,o,i,r){var s,a,l;return(s=Math.sqrt(e*e+t*t))&&(e/=s,t/=s),(l=e*n+t*o)&&(n-=e*l,o-=t*l),(a=Math.sqrt(n*n+o*o))&&(n/=a,o/=a,l/=a),e*o<t*n&&(e=-e,t=-t,l=-l,s=-s),{translateX:i,translateY:r,rotate:Math.atan2(t,e)*Vo,skewX:Math.atan(l)*Vo,scaleX:s,scaleY:a}}var Qt;function gl(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?jn:Fi(t.a,t.b,t.c,t.d,t.e,t.f)}function vl(e){return e==null||(Qt||(Qt=document.createElementNS("http://www.w3.org/2000/svg","g")),Qt.setAttribute("transform",e),!(e=Qt.transform.baseVal.consolidate()))?jn:(e=e.matrix,Fi(e.a,e.b,e.c,e.d,e.e,e.f))}function Yi(e,t,n,o){function i(u){return u.length?u.pop()+" ":""}function r(u,c,d,h,g,E){if(u!==d||c!==h){var w=g.push("translate(",null,t,null,n);E.push({i:w-4,x:Ae(u,d)},{i:w-2,x:Ae(c,h)})}else(d||h)&&g.push("translate("+d+t+h+n)}function s(u,c,d,h){u!==c?(u-c>180?c+=360:c-u>180&&(u+=360),h.push({i:d.push(i(d)+"rotate(",null,o)-2,x:Ae(u,c)})):c&&d.push(i(d)+"rotate("+c+o)}function a(u,c,d,h){u!==c?h.push({i:d.push(i(d)+"skewX(",null,o)-2,x:Ae(u,c)}):c&&d.push(i(d)+"skewX("+c+o)}function l(u,c,d,h,g,E){if(u!==d||c!==h){var w=g.push(i(g)+"scale(",null,",",null,")");E.push({i:w-4,x:Ae(u,d)},{i:w-2,x:Ae(c,h)})}else(d!==1||h!==1)&&g.push(i(g)+"scale("+d+","+h+")")}return function(u,c){var d=[],h=[];return u=e(u),c=e(c),r(u.translateX,u.translateY,c.translateX,c.translateY,d,h),s(u.rotate,c.rotate,d,h),a(u.skewX,c.skewX,d,h),l(u.scaleX,u.scaleY,c.scaleX,c.scaleY,d,h),u=c=null,function(g){for(var E=-1,w=h.length,S;++E<w;)d[(S=h[E]).i]=S.x(g);return d.join("")}}}var pl=Yi(gl,"px, ","px)","deg)"),ml=Yi(vl,", ",")",")"),yl=1e-12;function Ro(e){return((e=Math.exp(e))+1/e)/2}function _l(e){return((e=Math.exp(e))-1/e)/2}function wl(e){return((e=Math.exp(2*e))-1)/(e+1)}const ln=(function e(t,n,o){function i(r,s){var a=r[0],l=r[1],u=r[2],c=s[0],d=s[1],h=s[2],g=c-a,E=d-l,w=g*g+E*E,S,C;if(w<yl)C=Math.log(h/u)/t,S=function(K){return[a+K*g,l+K*E,u*Math.exp(t*K*C)]};else{var M=Math.sqrt(w),y=(h*h-u*u+o*w)/(2*u*n*M),N=(h*h-u*u-o*w)/(2*h*n*M),z=Math.log(Math.sqrt(y*y+1)-y),L=Math.log(Math.sqrt(N*N+1)-N);C=(L-z)/t,S=function(K){var Y=K*C,J=Ro(z),X=u/(n*M)*(J*wl(t*Y+z)-_l(z));return[a+X*g,l+X*E,u*J/Ro(t*Y+z)]}}return S.duration=C*1e3*t/Math.SQRT2,S}return i.rho=function(r){var s=Math.max(.001,+r),a=s*s,l=a*a;return e(s,a,l)},i})(Math.SQRT2,2,4);var Et=0,kt=0,Pt=0,Gi=1e3,pn,$t,mn=0,ut=0,Nn=0,Lt=typeof performance=="object"&&performance.now?performance:Date,Xi=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function vo(){return ut||(Xi(bl),ut=Lt.now()+Nn)}function bl(){ut=0}function yn(){this._call=this._time=this._next=null}yn.prototype=Ui.prototype={constructor:yn,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?vo():+n)+(t==null?0:+t),!this._next&&$t!==this&&($t?$t._next=this:pn=this,$t=this),this._call=e,this._time=n,eo()},stop:function(){this._call&&(this._call=null,this._time=1/0,eo())}};function Ui(e,t,n){var o=new yn;return o.restart(e,t,n),o}function xl(){vo(),++Et;for(var e=pn,t;e;)(t=ut-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Et}function Ho(){ut=(mn=Lt.now())+Nn,Et=kt=0;try{xl()}finally{Et=0,Sl(),ut=0}}function El(){var e=Lt.now(),t=e-mn;t>Gi&&(Nn-=t,mn=e)}function Sl(){for(var e,t=pn,n,o=1/0;t;)t._call?(o>t._time&&(o=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:pn=n);$t=e,eo(o)}function eo(e){if(!Et){kt&&(kt=clearTimeout(kt));var t=e-ut;t>24?(e<1/0&&(kt=setTimeout(Ho,e-Lt.now()-Nn)),Pt&&(Pt=clearInterval(Pt))):(Pt||(mn=Lt.now(),Pt=setInterval(El,Gi)),Et=1,Xi(Ho))}}function Lo(e,t,n){var o=new yn;return t=t==null?0:+t,o.restart(i=>{o.stop(),e(i+t)},t,n),o}var Nl=En("start","end","cancel","interrupt"),Cl=[],Zi=0,Fo=1,to=2,un=3,Yo=4,no=5,cn=6;function Cn(e,t,n,o,i,r){var s=e.__transition;if(!s)e.__transition={};else if(n in s)return;Ml(e,n,{name:t,index:o,group:i,on:Nl,tween:Cl,time:r.time,delay:r.delay,duration:r.duration,ease:r.ease,timer:null,state:Zi})}function po(e,t){var n=ke(e,t);if(n.state>Zi)throw new Error("too late; already scheduled");return n}function Re(e,t){var n=ke(e,t);if(n.state>un)throw new Error("too late; already running");return n}function ke(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function Ml(e,t,n){var o=e.__transition,i;o[t]=n,n.timer=Ui(r,0,n.time);function r(u){n.state=Fo,n.timer.restart(s,n.delay,n.time),n.delay<=u&&s(u-n.delay)}function s(u){var c,d,h,g;if(n.state!==Fo)return l();for(c in o)if(g=o[c],g.name===n.name){if(g.state===un)return Lo(s);g.state===Yo?(g.state=cn,g.timer.stop(),g.on.call("interrupt",e,e.__data__,g.index,g.group),delete o[c]):+c<t&&(g.state=cn,g.timer.stop(),g.on.call("cancel",e,e.__data__,g.index,g.group),delete o[c])}if(Lo(function(){n.state===un&&(n.state=Yo,n.timer.restart(a,n.delay,n.time),a(u))}),n.state=to,n.on.call("start",e,e.__data__,n.index,n.group),n.state===to){for(n.state=un,i=new Array(h=n.tween.length),c=0,d=-1;c<h;++c)(g=n.tween[c].value.call(e,e.__data__,n.index,n.group))&&(i[++d]=g);i.length=d+1}}function a(u){for(var c=u<n.duration?n.ease.call(null,u/n.duration):(n.timer.restart(l),n.state=no,1),d=-1,h=i.length;++d<h;)i[d].call(e,c);n.state===no&&(n.on.call("end",e,e.__data__,n.index,n.group),l())}function l(){n.state=cn,n.timer.stop(),delete o[t];for(var u in o)return;delete e.__transition}}function dn(e,t){var n=e.__transition,o,i,r=!0,s;if(n){t=t==null?null:t+"";for(s in n){if((o=n[s]).name!==t){r=!1;continue}i=o.state>to&&o.state<no,o.state=cn,o.timer.stop(),o.on.call(i?"interrupt":"cancel",e,e.__data__,o.index,o.group),delete n[s]}r&&delete e.__transition}}function Il(e){return this.each(function(){dn(this,e)})}function Pl(e,t){var n,o;return function(){var i=Re(this,e),r=i.tween;if(r!==n){o=n=r;for(var s=0,a=o.length;s<a;++s)if(o[s].name===t){o=o.slice(),o.splice(s,1);break}}i.tween=o}}function Tl(e,t,n){var o,i;if(typeof n!="function")throw new Error;return function(){var r=Re(this,e),s=r.tween;if(s!==o){i=(o=s).slice();for(var a={name:t,value:n},l=0,u=i.length;l<u;++l)if(i[l].name===t){i[l]=a;break}l===u&&i.push(a)}r.tween=i}}function kl(e,t){var n=this._id;if(e+="",arguments.length<2){for(var o=ke(this.node(),n).tween,i=0,r=o.length,s;i<r;++i)if((s=o[i]).name===e)return s.value;return null}return this.each((t==null?Pl:Tl)(n,e,t))}function mo(e,t,n){var o=e._id;return e.each(function(){var i=Re(this,o);(i.value||(i.value={}))[t]=n.apply(this,arguments)}),function(i){return ke(i,o).value[t]}}function Wi(e,t){var n;return(typeof t=="number"?Ae:t instanceof lt?vn:(n=lt(t))?(t=n,vn):Li)(e,t)}function $l(e){return function(){this.removeAttribute(e)}}function Dl(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Al(e,t,n){var o,i=n+"",r;return function(){var s=this.getAttribute(e);return s===i?null:s===o?r:r=t(o=s,n)}}function Ol(e,t,n){var o,i=n+"",r;return function(){var s=this.getAttributeNS(e.space,e.local);return s===i?null:s===o?r:r=t(o=s,n)}}function zl(e,t,n){var o,i,r;return function(){var s,a=n(this),l;return a==null?void this.removeAttribute(e):(s=this.getAttribute(e),l=a+"",s===l?null:s===o&&l===i?r:(i=l,r=t(o=s,a)))}}function Bl(e,t,n){var o,i,r;return function(){var s,a=n(this),l;return a==null?void this.removeAttributeNS(e.space,e.local):(s=this.getAttributeNS(e.space,e.local),l=a+"",s===l?null:s===o&&l===i?r:(i=l,r=t(o=s,a)))}}function Vl(e,t){var n=Sn(e),o=n==="transform"?ml:Wi;return this.attrTween(e,typeof t=="function"?(n.local?Bl:zl)(n,o,mo(this,"attr."+e,t)):t==null?(n.local?Dl:$l)(n):(n.local?Ol:Al)(n,o,t))}function Rl(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function Hl(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function Ll(e,t){var n,o;function i(){var r=t.apply(this,arguments);return r!==o&&(n=(o=r)&&Hl(e,r)),n}return i._value=t,i}function Fl(e,t){var n,o;function i(){var r=t.apply(this,arguments);return r!==o&&(n=(o=r)&&Rl(e,r)),n}return i._value=t,i}function Yl(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var o=Sn(e);return this.tween(n,(o.local?Ll:Fl)(o,t))}function Gl(e,t){return function(){po(this,e).delay=+t.apply(this,arguments)}}function Xl(e,t){return t=+t,function(){po(this,e).delay=t}}function Ul(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Gl:Xl)(t,e)):ke(this.node(),t).delay}function Zl(e,t){return function(){Re(this,e).duration=+t.apply(this,arguments)}}function Wl(e,t){return t=+t,function(){Re(this,e).duration=t}}function Kl(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Zl:Wl)(t,e)):ke(this.node(),t).duration}function ql(e,t){if(typeof t!="function")throw new Error;return function(){Re(this,e).ease=t}}function Jl(e){var t=this._id;return arguments.length?this.each(ql(t,e)):ke(this.node(),t).ease}function Ql(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;Re(this,e).ease=n}}function jl(e){if(typeof e!="function")throw new Error;return this.each(Ql(this._id,e))}function eu(e){typeof e!="function"&&(e=Ci(e));for(var t=this._groups,n=t.length,o=new Array(n),i=0;i<n;++i)for(var r=t[i],s=r.length,a=o[i]=[],l,u=0;u<s;++u)(l=r[u])&&e.call(l,l.__data__,u,r)&&a.push(l);return new Ze(o,this._parents,this._name,this._id)}function tu(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,o=t.length,i=n.length,r=Math.min(o,i),s=new Array(o),a=0;a<r;++a)for(var l=t[a],u=n[a],c=l.length,d=s[a]=new Array(c),h,g=0;g<c;++g)(h=l[g]||u[g])&&(d[g]=h);for(;a<o;++a)s[a]=t[a];return new Ze(s,this._parents,this._name,this._id)}function nu(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function ou(e,t,n){var o,i,r=nu(t)?po:Re;return function(){var s=r(this,e),a=s.on;a!==o&&(i=(o=a).copy()).on(t,n),s.on=i}}function iu(e,t){var n=this._id;return arguments.length<2?ke(this.node(),n).on.on(e):this.each(ou(n,e,t))}function ru(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function su(){return this.on("end.remove",ru(this._id))}function au(e){var t=this._name,n=this._id;typeof e!="function"&&(e=co(e));for(var o=this._groups,i=o.length,r=new Array(i),s=0;s<i;++s)for(var a=o[s],l=a.length,u=r[s]=new Array(l),c,d,h=0;h<l;++h)(c=a[h])&&(d=e.call(c,c.__data__,h,a))&&("__data__"in c&&(d.__data__=c.__data__),u[h]=d,Cn(u[h],t,n,h,u,ke(c,n)));return new Ze(r,this._parents,t,n)}function lu(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Ni(e));for(var o=this._groups,i=o.length,r=[],s=[],a=0;a<i;++a)for(var l=o[a],u=l.length,c,d=0;d<u;++d)if(c=l[d]){for(var h=e.call(c,c.__data__,d,l),g,E=ke(c,n),w=0,S=h.length;w<S;++w)(g=h[w])&&Cn(g,t,n,w,h,E);r.push(h),s.push(c)}return new Ze(r,s,t,n)}var uu=Xt.prototype.constructor;function cu(){return new uu(this._groups,this._parents)}function du(e,t){var n,o,i;return function(){var r=xt(this,e),s=(this.style.removeProperty(e),xt(this,e));return r===s?null:r===n&&s===o?i:i=t(n=r,o=s)}}function Ki(e){return function(){this.style.removeProperty(e)}}function fu(e,t,n){var o,i=n+"",r;return function(){var s=xt(this,e);return s===i?null:s===o?r:r=t(o=s,n)}}function hu(e,t,n){var o,i,r;return function(){var s=xt(this,e),a=n(this),l=a+"";return a==null&&(l=a=(this.style.removeProperty(e),xt(this,e))),s===l?null:s===o&&l===i?r:(i=l,r=t(o=s,a))}}function gu(e,t){var n,o,i,r="style."+t,s="end."+r,a;return function(){var l=Re(this,e),u=l.on,c=l.value[r]==null?a||(a=Ki(t)):void 0;(u!==n||i!==c)&&(o=(n=u).copy()).on(s,i=c),l.on=o}}function vu(e,t,n){var o=(e+="")=="transform"?pl:Wi;return t==null?this.styleTween(e,du(e,o)).on("end.style."+e,Ki(e)):typeof t=="function"?this.styleTween(e,hu(e,o,mo(this,"style."+e,t))).each(gu(this._id,e)):this.styleTween(e,fu(e,o,t),n).on("end.style."+e,null)}function pu(e,t,n){return function(o){this.style.setProperty(e,t.call(this,o),n)}}function mu(e,t,n){var o,i;function r(){var s=t.apply(this,arguments);return s!==i&&(o=(i=s)&&pu(e,s,n)),o}return r._value=t,r}function yu(e,t,n){var o="style."+(e+="");if(arguments.length<2)return(o=this.tween(o))&&o._value;if(t==null)return this.tween(o,null);if(typeof t!="function")throw new Error;return this.tween(o,mu(e,t,n==null?"":n))}function _u(e){return function(){this.textContent=e}}function wu(e){return function(){var t=e(this);this.textContent=t==null?"":t}}function bu(e){return this.tween("text",typeof e=="function"?wu(mo(this,"text",e)):_u(e==null?"":e+""))}function xu(e){return function(t){this.textContent=e.call(this,t)}}function Eu(e){var t,n;function o(){var i=e.apply(this,arguments);return i!==n&&(t=(n=i)&&xu(i)),t}return o._value=e,o}function Su(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,Eu(e))}function Nu(){for(var e=this._name,t=this._id,n=qi(),o=this._groups,i=o.length,r=0;r<i;++r)for(var s=o[r],a=s.length,l,u=0;u<a;++u)if(l=s[u]){var c=ke(l,t);Cn(l,e,n,u,s,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new Ze(o,this._parents,e,n)}function Cu(){var e,t,n=this,o=n._id,i=n.size();return new Promise(function(r,s){var a={value:s},l={value:function(){--i===0&&r()}};n.each(function(){var u=Re(this,o),c=u.on;c!==e&&(t=(e=c).copy(),t._.cancel.push(a),t._.interrupt.push(a),t._.end.push(l)),u.on=t}),i===0&&r()})}var Mu=0;function Ze(e,t,n,o){this._groups=e,this._parents=t,this._name=n,this._id=o}function qi(){return++Mu}var He=Xt.prototype;Ze.prototype={constructor:Ze,select:au,selectAll:lu,selectChild:He.selectChild,selectChildren:He.selectChildren,filter:eu,merge:tu,selection:cu,transition:Nu,call:He.call,nodes:He.nodes,node:He.node,size:He.size,empty:He.empty,each:He.each,on:iu,attr:Vl,attrTween:Yl,style:vu,styleTween:yu,text:bu,textTween:Su,remove:su,tween:kl,delay:Ul,duration:Kl,ease:Jl,easeVarying:jl,end:Cu,[Symbol.iterator]:He[Symbol.iterator]};function Iu(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var Pu={time:null,delay:0,duration:250,ease:Iu};function Tu(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function ku(e){var t,n;e instanceof Ze?(t=e._id,e=e._name):(t=qi(),(n=Pu).time=vo(),e=e==null?null:e+"");for(var o=this._groups,i=o.length,r=0;r<i;++r)for(var s=o[r],a=s.length,l,u=0;u<a;++u)(l=s[u])&&Cn(l,e,t,u,s,n||Tu(l,t));return new Ze(o,this._parents,e,t)}Xt.prototype.interrupt=Il;Xt.prototype.transition=ku;const jt=e=>()=>e;function $u(e,{sourceEvent:t,target:n,transform:o,dispatch:i}){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:i}})}function Ye(e,t,n){this.k=e,this.x=t,this.y=n}Ye.prototype={constructor:Ye,scale:function(e){return e===1?this:new Ye(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Ye(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 St=new Ye(1,0,0);Ye.prototype;function Vn(e){e.stopImmediatePropagation()}function Tt(e){e.preventDefault(),e.stopImmediatePropagation()}function Du(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function Au(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function Go(){return this.__zoom||St}function Ou(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function zu(){return navigator.maxTouchPoints||"ontouchstart"in this}function Bu(e,t,n){var o=e.invertX(t[0][0])-n[0][0],i=e.invertX(t[1][0])-n[1][0],r=e.invertY(t[0][1])-n[0][1],s=e.invertY(t[1][1])-n[1][1];return e.translate(i>o?(o+i)/2:Math.min(0,o)||Math.max(0,i),s>r?(r+s)/2:Math.min(0,r)||Math.max(0,s))}function Vu(){var e=Du,t=Au,n=Bu,o=Ou,i=zu,r=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],a=250,l=ln,u=En("start","zoom","end"),c,d,h,g=500,E=150,w=0,S=10;function C(m){m.property("__zoom",Go).on("wheel.zoom",Y,{passive:!1}).on("mousedown.zoom",J).on("dblclick.zoom",X).filter(i).on("touchstart.zoom",D).on("touchmove.zoom",b).on("touchend.zoom touchcancel.zoom",ee).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}C.transform=function(m,I,x,k){var A=m.selection?m.selection():m;A.property("__zoom",Go),m!==A?z(m,I,x,k):A.interrupt().each(function(){L(this,arguments).event(k).start().zoom(null,typeof I=="function"?I.apply(this,arguments):I).end()})},C.scaleBy=function(m,I,x,k){C.scaleTo(m,function(){var A=this.__zoom.k,B=typeof I=="function"?I.apply(this,arguments):I;return A*B},x,k)},C.scaleTo=function(m,I,x,k){C.transform(m,function(){var A=t.apply(this,arguments),B=this.__zoom,O=x==null?N(A):typeof x=="function"?x.apply(this,arguments):x,U=B.invert(O),Q=typeof I=="function"?I.apply(this,arguments):I;return n(y(M(B,Q),O,U),A,s)},x,k)},C.translateBy=function(m,I,x,k){C.transform(m,function(){return n(this.__zoom.translate(typeof I=="function"?I.apply(this,arguments):I,typeof x=="function"?x.apply(this,arguments):x),t.apply(this,arguments),s)},null,k)},C.translateTo=function(m,I,x,k,A){C.transform(m,function(){var B=t.apply(this,arguments),O=this.__zoom,U=k==null?N(B):typeof k=="function"?k.apply(this,arguments):k;return n(St.translate(U[0],U[1]).scale(O.k).translate(typeof I=="function"?-I.apply(this,arguments):-I,typeof x=="function"?-x.apply(this,arguments):-x),B,s)},k,A)};function M(m,I){return I=Math.max(r[0],Math.min(r[1],I)),I===m.k?m:new Ye(I,m.x,m.y)}function y(m,I,x){var k=I[0]-x[0]*m.k,A=I[1]-x[1]*m.k;return k===m.x&&A===m.y?m:new Ye(m.k,k,A)}function N(m){return[(+m[0][0]+ +m[1][0])/2,(+m[0][1]+ +m[1][1])/2]}function z(m,I,x,k){m.on("start.zoom",function(){L(this,arguments).event(k).start()}).on("interrupt.zoom end.zoom",function(){L(this,arguments).event(k).end()}).tween("zoom",function(){var A=this,B=arguments,O=L(A,B).event(k),U=t.apply(A,B),Q=x==null?N(U):typeof x=="function"?x.apply(A,B):x,oe=Math.max(U[1][0]-U[0][0],U[1][1]-U[0][1]),ae=A.__zoom,H=typeof I=="function"?I.apply(A,B):I,F=l(ae.invert(Q).concat(oe/ae.k),H.invert(Q).concat(oe/H.k));return function(W){if(W===1)W=H;else{var ce=F(W),pe=oe/ce[2];W=new Ye(pe,Q[0]-ce[0]*pe,Q[1]-ce[1]*pe)}O.zoom(null,W)}})}function L(m,I,x){return!x&&m.__zooming||new K(m,I)}function K(m,I){this.that=m,this.args=I,this.active=0,this.sourceEvent=null,this.extent=t.apply(m,I),this.taps=0}K.prototype={event:function(m){return m&&(this.sourceEvent=m),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(m,I){return this.mouse&&m!=="mouse"&&(this.mouse[1]=I.invert(this.mouse[0])),this.touch0&&m!=="touch"&&(this.touch0[1]=I.invert(this.touch0[0])),this.touch1&&m!=="touch"&&(this.touch1[1]=I.invert(this.touch1[0])),this.that.__zoom=I,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(m){var I=Pe(this.that).datum();u.call(m,this.that,new $u(m,{sourceEvent:this.sourceEvent,target:C,transform:this.that.__zoom,dispatch:u}),I)}};function Y(m,...I){if(!e.apply(this,arguments))return;var x=L(this,I).event(m),k=this.__zoom,A=Math.max(r[0],Math.min(r[1],k.k*Math.pow(2,o.apply(this,arguments)))),B=De(m);if(x.wheel)(x.mouse[0][0]!==B[0]||x.mouse[0][1]!==B[1])&&(x.mouse[1]=k.invert(x.mouse[0]=B)),clearTimeout(x.wheel);else{if(k.k===A)return;x.mouse=[B,k.invert(B)],dn(this),x.start()}Tt(m),x.wheel=setTimeout(O,E),x.zoom("mouse",n(y(M(k,A),x.mouse[0],x.mouse[1]),x.extent,s));function O(){x.wheel=null,x.end()}}function J(m,...I){if(h||!e.apply(this,arguments))return;var x=m.currentTarget,k=L(this,I,!0).event(m),A=Pe(m.view).on("mousemove.zoom",Q,!0).on("mouseup.zoom",oe,!0),B=De(m,x),O=m.clientX,U=m.clientY;zi(m.view),Vn(m),k.mouse=[B,this.__zoom.invert(B)],dn(this),k.start();function Q(ae){if(Tt(ae),!k.moved){var H=ae.clientX-O,F=ae.clientY-U;k.moved=H*H+F*F>w}k.event(ae).zoom("mouse",n(y(k.that.__zoom,k.mouse[0]=De(ae,x),k.mouse[1]),k.extent,s))}function oe(ae){A.on("mousemove.zoom mouseup.zoom",null),Bi(ae.view,k.moved),Tt(ae),k.event(ae).end()}}function X(m,...I){if(e.apply(this,arguments)){var x=this.__zoom,k=De(m.changedTouches?m.changedTouches[0]:m,this),A=x.invert(k),B=x.k*(m.shiftKey?.5:2),O=n(y(M(x,B),k,A),t.apply(this,I),s);Tt(m),a>0?Pe(this).transition().duration(a).call(z,O,k,m):Pe(this).call(C.transform,O,k,m)}}function D(m,...I){if(e.apply(this,arguments)){var x=m.touches,k=x.length,A=L(this,I,m.changedTouches.length===k).event(m),B,O,U,Q;for(Vn(m),O=0;O<k;++O)U=x[O],Q=De(U,this),Q=[Q,this.__zoom.invert(Q),U.identifier],A.touch0?!A.touch1&&A.touch0[2]!==Q[2]&&(A.touch1=Q,A.taps=0):(A.touch0=Q,B=!0,A.taps=1+!!c);c&&(c=clearTimeout(c)),B&&(A.taps<2&&(d=Q[0],c=setTimeout(function(){c=null},g)),dn(this),A.start())}}function b(m,...I){if(this.__zooming){var x=L(this,I).event(m),k=m.changedTouches,A=k.length,B,O,U,Q;for(Tt(m),B=0;B<A;++B)O=k[B],U=De(O,this),x.touch0&&x.touch0[2]===O.identifier?x.touch0[0]=U:x.touch1&&x.touch1[2]===O.identifier&&(x.touch1[0]=U);if(O=x.that.__zoom,x.touch1){var oe=x.touch0[0],ae=x.touch0[1],H=x.touch1[0],F=x.touch1[1],W=(W=H[0]-oe[0])*W+(W=H[1]-oe[1])*W,ce=(ce=F[0]-ae[0])*ce+(ce=F[1]-ae[1])*ce;O=M(O,Math.sqrt(W/ce)),U=[(oe[0]+H[0])/2,(oe[1]+H[1])/2],Q=[(ae[0]+F[0])/2,(ae[1]+F[1])/2]}else if(x.touch0)U=x.touch0[0],Q=x.touch0[1];else return;x.zoom("touch",n(y(O,U,Q),x.extent,s))}}function ee(m,...I){if(this.__zooming){var x=L(this,I).event(m),k=m.changedTouches,A=k.length,B,O;for(Vn(m),h&&clearTimeout(h),h=setTimeout(function(){h=null},g),B=0;B<A;++B)O=k[B],x.touch0&&x.touch0[2]===O.identifier?delete x.touch0:x.touch1&&x.touch1[2]===O.identifier&&delete x.touch1;if(x.touch1&&!x.touch0&&(x.touch0=x.touch1,delete x.touch1),x.touch0)x.touch0[1]=this.__zoom.invert(x.touch0[0]);else if(x.end(),x.taps===2&&(O=De(O,this),Math.hypot(d[0]-O[0],d[1]-O[1])<S)){var U=Pe(this).on("dblclick.zoom");U&&U.apply(this,arguments)}}}return C.wheelDelta=function(m){return arguments.length?(o=typeof m=="function"?m:jt(+m),C):o},C.filter=function(m){return arguments.length?(e=typeof m=="function"?m:jt(!!m),C):e},C.touchable=function(m){return arguments.length?(i=typeof m=="function"?m:jt(!!m),C):i},C.extent=function(m){return arguments.length?(t=typeof m=="function"?m:jt([[+m[0][0],+m[0][1]],[+m[1][0],+m[1][1]]]),C):t},C.scaleExtent=function(m){return arguments.length?(r[0]=+m[0],r[1]=+m[1],C):[r[0],r[1]]},C.translateExtent=function(m){return arguments.length?(s[0][0]=+m[0][0],s[1][0]=+m[1][0],s[0][1]=+m[0][1],s[1][1]=+m[1][1],C):[[s[0][0],s[0][1]],[s[1][0],s[1][1]]]},C.constrain=function(m){return arguments.length?(n=m,C):n},C.duration=function(m){return arguments.length?(a=+m,C):a},C.interpolate=function(m){return arguments.length?(l=m,C):l},C.on=function(){var m=u.on.apply(u,arguments);return m===u?C:m},C.clickDistance=function(m){return arguments.length?(w=(m=+m)*m,C):Math.sqrt(w)},C.tapDistance=function(m){return arguments.length?(S=+m,C):S},C}var q=(e=>(e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom",e))(q||{}),yo=(e=>(e.Partial="partial",e.Full="full",e))(yo||{}),tt=(e=>(e.Bezier="default",e.SimpleBezier="simple-bezier",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e))(tt||{}),Qe=(e=>(e.Strict="strict",e.Loose="loose",e))(Qe||{}),oo=(e=>(e.Arrow="arrow",e.ArrowClosed="arrowclosed",e))(oo||{}),Ot=(e=>(e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal",e))(Ot||{});const Ru=["INPUT","SELECT","TEXTAREA"],Hu=typeof document!="undefined"?document:null;function io(e){var t,n;const o=((n=(t=e.composedPath)==null?void 0:t.call(e))==null?void 0:n[0])||e.target,i=typeof(o==null?void 0:o.hasAttribute)=="function"?o.hasAttribute("contenteditable"):!1,r=typeof(o==null?void 0:o.closest)=="function"?o.closest(".nokey"):null;return Ru.includes(o==null?void 0:o.nodeName)||i||!!r}function Lu(e){return e.ctrlKey||e.metaKey||e.shiftKey||e.altKey}function Xo(e,t,n,o){const i=t.replace("+",`
`).replace(`
`,`
+`).split(`
`).map(s=>s.trim().toLowerCase());if(i.length===1)return e.toLowerCase()===t.toLowerCase();o||n.add(e.toLowerCase());const r=i.every((s,a)=>n.has(s)&&Array.from(n.values())[a]===i[a]);return o&&n.delete(e.toLowerCase()),r}function Fu(e,t){return n=>{if(!n.code&&!n.key)return!1;const o=Yu(n.code,e);return Array.isArray(e)?e.some(i=>Xo(n[o],i,t,n.type==="keyup")):Xo(n[o],e,t,n.type==="keyup")}}function Yu(e,t){return t.includes(e)?"code":"key"}function zt(e,t){const n=re(()=>{var u;return(u=ue(t==null?void 0:t.target))!=null?u:Hu}),o=Je(ue(e)===!0);let i=!1;const r=new Set;let s=l(ue(e));ve(()=>ue(e),(u,c)=>{typeof c=="boolean"&&typeof u!="boolean"&&a(),s=l(u)},{immediate:!0}),Ei(["blur","contextmenu"],a),Mo((...u)=>s(...u),u=>{var C,M;var c,d;const h=(C=ue(t==null?void 0:t.actInsideInputWithModifier))!=null?C:!0,g=(M=ue(t==null?void 0:t.preventDefault))!=null?M:!1;if(i=Lu(u),(!i||i&&!h)&&io(u))return;const w=((d=(c=u.composedPath)==null?void 0:c.call(u))==null?void 0:d[0])||u.target,S=(w==null?void 0:w.nodeName)==="BUTTON"||(w==null?void 0:w.nodeName)==="A";!g&&(i||!S)&&u.preventDefault(),o.value=!0},{eventName:"keydown",target:n}),Mo((...u)=>s(...u),u=>{var d;const c=(d=ue(t==null?void 0:t.actInsideInputWithModifier))!=null?d:!0;if(o.value){if((!i||i&&!c)&&io(u))return;i=!1,o.value=!1}},{eventName:"keyup",target:n});function a(){i=!1,r.clear(),o.value=ue(e)===!0}function l(u){return u===null?(a(),()=>!1):typeof u=="boolean"?(a(),o.value=u,()=>!1):Array.isArray(u)||typeof u=="string"?Fu(u,r):u}return o}const Ji="vue-flow__node-desc",Qi="vue-flow__edge-desc",Gu="vue-flow__aria-live",ji=["Enter"," ","Escape"],_t={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};function _n(e){return fe($({},e.computedPosition||{x:0,y:0}),{width:e.dimensions.width||0,height:e.dimensions.height||0})}function wn(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 Mn(e){return{width:e.offsetWidth,height:e.offsetHeight}}function ct(e,t=0,n=1){return Math.min(Math.max(e,t),n)}function er(e,t){return{x:ct(e.x,t[0][0],t[1][0]),y:ct(e.y,t[0][1],t[1][1])}}function Uo(e){const t=e.getRootNode();return"elementFromPoint"in t?t:window.document}function je(e){return e&&typeof e=="object"&&"id"in e&&"source"in e&&"target"in e}function rt(e){return e&&typeof e=="object"&&"id"in e&&"position"in e&&!je(e)}function Dt(e){return rt(e)&&"computedPosition"in e}function en(e){return!Number.isNaN(e)&&Number.isFinite(e)}function Xu(e){return en(e.width)&&en(e.height)&&en(e.x)&&en(e.y)}function Uu(e,t,n){var i;const o={id:e.id.toString(),type:(i=e.type)!=null?i:"default",dimensions:sn({width:0,height:0}),computedPosition:sn($({z:0},e.position)),handleBounds:{source:[],target:[]},draggable:void 0,selectable:void 0,connectable:void 0,focusable:void 0,selected:!1,dragging:!1,resizing:!1,initialized:!1,isParent:!1,position:{x:0,y:0},data:xe(e.data)?e.data:{},events:sn(xe(e.events)?e.events:{})};return Object.assign(t!=null?t:o,e,{id:e.id.toString(),parentNode:n})}function tr(e,t,n){var s,a,l,u,c,d,h;var o,i;const r=$({id:e.id.toString(),type:(a=(s=e.type)!=null?s:t==null?void 0:t.type)!=null?a:"default",source:e.source.toString(),target:e.target.toString(),sourceHandle:(o=e.sourceHandle)==null?void 0:o.toString(),targetHandle:(i=e.targetHandle)==null?void 0:i.toString(),updatable:(l=e.updatable)!=null?l:n==null?void 0:n.updatable,selectable:(u=e.selectable)!=null?u:n==null?void 0:n.selectable,focusable:(c=e.focusable)!=null?c:n==null?void 0:n.focusable,data:xe(e.data)?e.data:{},events:sn(xe(e.events)?e.events:{}),label:(d=e.label)!=null?d:"",interactionWidth:(h=e.interactionWidth)!=null?h:n==null?void 0:n.interactionWidth},n!=null?n:{});return Object.assign(t!=null?t:r,e,{id:e.id.toString()})}function nr(e,t,n,o){const i=typeof e=="string"?e:e.id,r=new Set,s=o==="source"?"target":"source";for(const a of n)a[s]===i&&r.add(a[o]);return t.filter(a=>r.has(a.id))}function Zu(...e){if(e.length===3){const[r,s,a]=e;return nr(r,s,a,"target")}const[t,n]=e,o=typeof t=="string"?t:t.id;return n.filter(r=>je(r)&&r.source===o).map(r=>n.find(s=>rt(s)&&s.id===r.target))}function Wu(...e){if(e.length===3){const[r,s,a]=e;return nr(r,s,a,"source")}const[t,n]=e,o=typeof t=="string"?t:t.id;return n.filter(r=>je(r)&&r.target===o).map(r=>n.find(s=>rt(s)&&s.id===r.source))}function or({source:e,sourceHandle:t,target:n,targetHandle:o}){return`vueflow__edge-${e}${t!=null?t:""}-${n}${o!=null?o:""}`}function Ku(e,t){return t.some(n=>je(n)&&n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle))}function Ft({x:e,y:t},{x:n,y:o,zoom:i}){return{x:e*i+n,y:t*i+o}}function Yt({x:e,y:t},{x:n,y:o,zoom:i},r=!1,s=[1,1]){const a={x:(e-n)/i,y:(t-o)/i};return r?In(a,s):a}function qu(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 ir({x:e,y:t,width:n,height:o}){return{x:e,y:t,x2:e+n,y2:t+o}}function Ju({x:e,y:t,x2:n,y2:o}){return{x:e,y:t,width:n-e,height:o-t}}function rr(e){let t={x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY,x2:Number.NEGATIVE_INFINITY,y2:Number.NEGATIVE_INFINITY};for(let n=0;n<e.length;n++){const o=e[n];t=qu(t,ir($($({},o.computedPosition),o.dimensions)))}return Ju(t)}function sr(e,t,n={x:0,y:0,zoom:1},o=!1,i=!1){var a,l,u,c;const r=fe($({},Yt(t,n)),{width:t.width/n.zoom,height:t.height/n.zoom}),s=[];for(const d of e){const{dimensions:h,selectable:g=!0,hidden:E=!1}=d,w=(l=(a=h.width)!=null?a:d.width)!=null?l:null,S=(c=(u=h.height)!=null?u:d.height)!=null?c:null;if(i&&!g||E)continue;const C=wn(r,_n(d)),M=w===null||S===null,y=o&&C>0,N=(w!=null?w:0)*(S!=null?S:0);(M||y||C>=N||d.dragging)&&s.push(d)}return s}function ar(e,t){const n=new Set;if(typeof e=="string")n.add(e);else if(e.length>=1)for(const o of e)n.add(o.id);return t.filter(o=>n.has(o.source)||n.has(o.target))}function pt(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const n=Number.parseFloat(e);if(!Number.isNaN(n))return Math.floor(n)}if(typeof e=="string"&&e.endsWith("%")){const n=Number.parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return It(`The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function Qu(e,t,n){var o,i,r,s,a,l,u,c;if(typeof e=="string"||typeof e=="number"){const d=pt(e,n),h=pt(e,t);return{top:d,right:h,bottom:d,left:h,x:h*2,y:d*2}}if(typeof e=="object"){const d=pt((i=(o=e.top)!=null?o:e.y)!=null?i:0,n),h=pt((s=(r=e.bottom)!=null?r:e.y)!=null?s:0,n),g=pt((l=(a=e.left)!=null?a:e.x)!=null?l:0,t),E=pt((c=(u=e.right)!=null?u:e.x)!=null?c:0,t);return{top:d,right:E,bottom:h,left:g,x:g+E,y:d+h}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function ju(e,t,n,o,i,r){const{x:s,y:a}=Ft(e,{x:t,y:n,zoom:o}),{x:l,y:u}=Ft({x:e.x+e.width,y:e.y+e.height},{x:t,y:n,zoom:o}),c=i-l,d=r-u;return{left:Math.floor(s),top:Math.floor(a),right:Math.floor(c),bottom:Math.floor(d)}}function Zo(e,t,n,o,i,r=.1){const s=Qu(r,t,n),a=(t-s.x)/e.width,l=(n-s.y)/e.height,u=Math.min(a,l),c=ct(u,o,i),d=e.x+e.width/2,h=e.y+e.height/2,g=t/2-d*c,E=n/2-h*c,w=ju(e,g,E,c,t,n),S={left:Math.min(w.left-s.left,0),top:Math.min(w.top-s.top,0),right:Math.min(w.right-s.right,0),bottom:Math.min(w.bottom-s.bottom,0)};return{x:g-S.left+S.right,y:E-S.top+S.bottom,zoom:c}}function ec(e,t){return{x:t.x+e.x,y:t.y+e.y,z:(e.z>t.z?e.z:t.z)+1}}function lr(e,t){if(!e.parentNode)return!1;const n=t.get(e.parentNode);return n?n.selected?!0:lr(n,t):!1}function Gt(e,t){return typeof e=="undefined"?"":typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(o=>`${o}=${e[o]}`).join("&")}`}function Wo(e){const t=e.ctrlKey&&bn()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t}function Ko(e,t,n){return e<t?ct(Math.abs(e-t),1,t)/t:e>n?-ct(Math.abs(e-n),1,t)/t:0}function ur(e,t,n=15,o=40){const i=Ko(e.x,o,t.width-o)*n,r=Ko(e.y,o,t.height-o)*n;return[i,r]}function Rn(e,t){var n,o;if(t){const i=e.position.x+e.dimensions.width-t.dimensions.width,r=e.position.y+e.dimensions.height-t.dimensions.height;if(i>0||r>0||e.position.x<0||e.position.y<0){let s={};if(typeof t.style=="function"?s=$({},t.style(t)):t.style&&(s=$({},t.style)),s.width=(n=s.width)!=null?n:`${t.dimensions.width}px`,s.height=(o=s.height)!=null?o:`${t.dimensions.height}px`,i>0)if(typeof s.width=="string"){const a=Number(s.width.replace("px",""));s.width=`${a+i}px`}else s.width+=i;if(r>0)if(typeof s.height=="string"){const a=Number(s.height.replace("px",""));s.height=`${a+r}px`}else s.height+=r;if(e.position.x<0){const a=Math.abs(e.position.x);if(t.position.x=t.position.x-a,typeof s.width=="string"){const l=Number(s.width.replace("px",""));s.width=`${l+a}px`}else s.width+=a;e.position.x=0}if(e.position.y<0){const a=Math.abs(e.position.y);if(t.position.y=t.position.y-a,typeof s.height=="string"){const l=Number(s.height.replace("px",""));s.height=`${l+a}px`}else s.height+=a;e.position.y=0}t.dimensions.width=Number(s.width.toString().replace("px","")),t.dimensions.height=Number(s.height.toString().replace("px","")),typeof t.style=="function"?t.style=a=>{const l=t.style;return $($({},l(a)),s)}:t.style=$($({},t.style),s)}}}function qo(e,t){var n,o;const i=e.filter(s=>s.type==="add"||s.type==="remove");for(const s of i)if(s.type==="add")t.findIndex(l=>l.id===s.item.id)===-1&&t.push(s.item);else if(s.type==="remove"){const a=t.findIndex(l=>l.id===s.id);a!==-1&&t.splice(a,1)}const r=t.map(s=>s.id);for(const s of t)for(const a of e)if(a.id===s.id)switch(a.type){case"select":s.selected=a.selected;break;case"position":if(Dt(s)&&(typeof a.position!="undefined"&&(s.position=a.position),typeof a.dragging!="undefined"&&(s.dragging=a.dragging),s.expandParent&&s.parentNode)){const l=t[r.indexOf(s.parentNode)];l&&Dt(l)&&Rn(s,l)}break;case"dimensions":if(Dt(s)&&(typeof a.dimensions!="undefined"&&(s.dimensions=a.dimensions),typeof a.updateStyle!="undefined"&&a.updateStyle&&(s.style=fe($({},s.style||{}),{width:`${(n=a.dimensions)==null?void 0:n.width}px`,height:`${(o=a.dimensions)==null?void 0:o.height}px`})),typeof a.resizing!="undefined"&&(s.resizing=a.resizing),s.expandParent&&s.parentNode)){const l=t[r.indexOf(s.parentNode)];l&&Dt(l)&&(!!l.dimensions.width&&!!l.dimensions.height?Rn(s,l):Ge(()=>{Rn(s,l)}))}break}return t}function Ke(e,t){return{id:e,type:"select",selected:t}}function Jo(e){return{item:e,type:"add"}}function Qo(e){return{id:e,type:"remove"}}function jo(e,t,n,o,i){return{id:e,source:t,target:n,sourceHandle:o||null,targetHandle:i||null,type:"remove"}}function qe(e,t=new Set,n=!1){const o=[];for(const[i,r]of e){const s=t.has(i);!(r.selected===void 0&&!s)&&r.selected!==s&&(n&&(r.selected=s),o.push(Ke(r.id,s)))}return o}const ei=()=>{};function R(e){const t=new Set;let n=ei,o=()=>!1;const i=()=>t.size>0||o(),r=h=>{n=h},s=()=>{n=ei},a=h=>{o=h},l=()=>{o=()=>!1},u=h=>{t.delete(h)};return{on:h=>{t.add(h);const g=()=>u(h);return Bt(g),{off:g}},off:u,trigger:h=>{const g=[n];return i()?g.push(...t):e&&g.push(e),Promise.allSettled(g.map(E=>E(h)))},hasListeners:i,listeners:t,setEmitter:r,removeEmitter:s,setHasEmitListeners:a,removeHasEmitListeners:l}}function ti(e,t,n){let o=e;do{if(o&&o.matches(t))return!0;if(o===n)return!1;o=o.parentElement}while(o);return!1}function tc(e,t,n,o){var i,r;const s=new Map;for(const[a,l]of e)(l.selected||l.id===o)&&(!l.parentNode||!lr(l,e))&&(l.draggable||t&&typeof l.draggable=="undefined")&&e.get(a)&&s.set(a,{id:l.id,position:l.position||{x:0,y:0},distance:{x:n.x-((i=l.computedPosition)==null?void 0:i.x)||0,y:n.y-((r=l.computedPosition)==null?void 0:r.y)||0},from:{x:l.computedPosition.x,y:l.computedPosition.y},extent:l.extent,parentNode:l.parentNode,dimensions:$({},l.dimensions),expandParent:l.expandParent});return Array.from(s.values())}function Hn({id:e,dragItems:t,findNode:n}){const o=[];for(const i of t){const r=n(i.id);r&&o.push(r)}return[e?o.find(i=>i.id===e):o[0],o]}function cr(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 nc(e,t,n){const[o,i,r,s]=typeof e!="string"?cr(e.padding):[0,0,0,0];return n&&typeof n.computedPosition.x!="undefined"&&typeof n.computedPosition.y!="undefined"&&typeof n.dimensions.width!="undefined"&&typeof n.dimensions.height!="undefined"?[[n.computedPosition.x+s,n.computedPosition.y+o],[n.computedPosition.x+n.dimensions.width-i,n.computedPosition.y+n.dimensions.height-r]]:!1}function oc(e,t,n,o){let i=e.extent||n;if((i==="parent"||!Array.isArray(i)&&(i==null?void 0:i.range)==="parent")&&!e.expandParent)if(e.parentNode&&o&&e.dimensions.width&&e.dimensions.height){const r=nc(i,e,o);r&&(i=r)}else t(new Ne(Se.NODE_EXTENT_INVALID,e.id)),i=n;else if(Array.isArray(i)){const r=(o==null?void 0:o.computedPosition.x)||0,s=(o==null?void 0:o.computedPosition.y)||0;i=[[i[0][0]+r,i[0][1]+s],[i[1][0]+r,i[1][1]+s]]}else if(i!=="parent"&&(i!=null&&i.range)&&Array.isArray(i.range)){const[r,s,a,l]=cr(i.padding),u=(o==null?void 0:o.computedPosition.x)||0,c=(o==null?void 0:o.computedPosition.y)||0;i=[[i.range[0][0]+u+l,i.range[0][1]+c+r],[i.range[1][0]+u-s,i.range[1][1]+c-a]]}return i==="parent"?[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]]:i}function ic({width:e,height:t},n){return[n[0],[n[1][0]-(e||0),n[1][1]-(t||0)]]}function _o(e,t,n,o,i){const r=ic(e.dimensions,oc(e,n,o,i)),s=er(t,r);return{position:{x:s.x-((i==null?void 0:i.computedPosition.x)||0),y:s.y-((i==null?void 0:i.computedPosition.y)||0)},computedPosition:s}}function Nt(e,t,n=q.Left,o=!1){var u,c,d;const i=((u=t==null?void 0:t.x)!=null?u:0)+e.computedPosition.x,r=((c=t==null?void 0:t.y)!=null?c:0)+e.computedPosition.y,{width:s,height:a}=t!=null?t:lc(e);if(o)return{x:i+s/2,y:r+a/2};switch((d=t==null?void 0:t.position)!=null?d:n){case q.Top:return{x:i+s/2,y:r};case q.Right:return{x:i+s,y:r+a/2};case q.Bottom:return{x:i+s/2,y:r+a};case q.Left:return{x:i,y:r+a/2}}}function ni(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function rc({sourcePos:e,targetPos:t,sourceWidth:n,sourceHeight:o,targetWidth:i,targetHeight:r,width:s,height:a,viewport:l}){const u={x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x+n,t.x+i),y2:Math.max(e.y+o,t.y+r)};u.x===u.x2&&(u.x2+=1),u.y===u.y2&&(u.y2+=1);const c=ir({x:(0-l.x)/l.zoom,y:(0-l.y)/l.zoom,width:s/l.zoom,height:a/l.zoom}),d=Math.max(0,Math.min(c.x2,u.x2)-Math.max(c.x,u.x)),h=Math.max(0,Math.min(c.y2,u.y2)-Math.max(c.y,u.y));return Math.ceil(d*h)>0}function sc(e,t,n=!1){const o=typeof e.zIndex=="number";let i=o?e.zIndex:0;const r=t(e.source),s=t(e.target);return!r||!s?0:(n&&(i=o?e.zIndex:Math.max(r.computedPosition.z||0,s.computedPosition.z||0)),i)}var Se=(e=>(e.MISSING_STYLES="MISSING_STYLES",e.MISSING_VIEWPORT_DIMENSIONS="MISSING_VIEWPORT_DIMENSIONS",e.NODE_INVALID="NODE_INVALID",e.NODE_NOT_FOUND="NODE_NOT_FOUND",e.NODE_MISSING_PARENT="NODE_MISSING_PARENT",e.NODE_TYPE_MISSING="NODE_TYPE_MISSING",e.NODE_EXTENT_INVALID="NODE_EXTENT_INVALID",e.EDGE_INVALID="EDGE_INVALID",e.EDGE_NOT_FOUND="EDGE_NOT_FOUND",e.EDGE_SOURCE_MISSING="EDGE_SOURCE_MISSING",e.EDGE_TARGET_MISSING="EDGE_TARGET_MISSING",e.EDGE_TYPE_MISSING="EDGE_TYPE_MISSING",e.EDGE_SOURCE_TARGET_SAME="EDGE_SOURCE_TARGET_SAME",e.EDGE_SOURCE_TARGET_MISSING="EDGE_SOURCE_TARGET_MISSING",e.EDGE_ORPHANED="EDGE_ORPHANED",e.USEVUEFLOW_OPTIONS="USEVUEFLOW_OPTIONS",e))(Se||{});const oi={MISSING_STYLES:()=>"It seems that you haven't loaded the necessary styles. Please import '@vue-flow/core/dist/style.css' to ensure that the graph is rendered correctly",MISSING_VIEWPORT_DIMENSIONS:()=>"The Vue Flow parent container needs a width and a height to render the graph",NODE_INVALID:e=>`Node is invalid
Node: ${e}`,NODE_NOT_FOUND:e=>`Node not found
Node: ${e}`,NODE_MISSING_PARENT:(e,t)=>`Node is missing a parent
Node: ${e}
Parent: ${t}`,NODE_TYPE_MISSING:e=>`Node type is missing
Type: ${e}`,NODE_EXTENT_INVALID:e=>`Only child nodes can use a parent extent
Node: ${e}`,EDGE_INVALID:e=>`An edge needs a source and a target
Edge: ${e}`,EDGE_SOURCE_MISSING:(e,t)=>`Edge source is missing
Edge: ${e}
Source: ${t}`,EDGE_TARGET_MISSING:(e,t)=>`Edge target is missing
Edge: ${e}
Target: ${t}`,EDGE_TYPE_MISSING:e=>`Edge type is missing
Type: ${e}`,EDGE_SOURCE_TARGET_SAME:(e,t,n)=>`Edge source and target are the same
Edge: ${e}
Source: ${t}
Target: ${n}`,EDGE_SOURCE_TARGET_MISSING:(e,t,n)=>`Edge source or target is missing
Edge: ${e}
Source: ${t}
Target: ${n}`,EDGE_ORPHANED:e=>`Edge was orphaned (suddenly missing source or target) and has been removed
Edge: ${e}`,EDGE_NOT_FOUND:e=>`Edge not found
Edge: ${e}`,USEVUEFLOW_OPTIONS:()=>"The options parameter is deprecated and will be removed in the next major version. Please use the id parameter instead"};class Ne extends Error{constructor(t,...n){var o;super((o=oi[t])==null?void 0:o.call(oi,...n)),this.name="VueFlowError",this.code=t,this.args=n}}function wo(e){return"clientX"in e}function ac(e){return"sourceEvent"in e}function Oe(e,t){var r,s;const n=wo(e);let o,i;return n?(o=e.clientX,i=e.clientY):"touches"in e&&e.touches.length>0?(o=e.touches[0].clientX,i=e.touches[0].clientY):"changedTouches"in e&&e.changedTouches.length>0?(o=e.changedTouches[0].clientX,i=e.changedTouches[0].clientY):(o=0,i=0),{x:o-((r=t==null?void 0:t.left)!=null?r:0),y:i-((s=t==null?void 0:t.top)!=null?s:0)}}const bn=()=>{var e;return typeof navigator!="undefined"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function lc(e){var o,i,r,s;var t,n;return{width:(i=(o=(t=e.dimensions)==null?void 0:t.width)!=null?o:e.width)!=null?i:0,height:(s=(r=(n=e.dimensions)==null?void 0:n.height)!=null?r:e.height)!=null?s:0}}function In(e,t=[1,1]){return{x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}}const uc=()=>!0;function Ln(e){e==null||e.classList.remove("valid","connecting","vue-flow__handle-valid","vue-flow__handle-connecting")}function cc(e,t,n){const o=[],i={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const r of t.values())wn(i,_n(r))>0&&o.push(r);return o}const dc=250;function fc(e,t,n,o){var u,c,d;var i,r;let s=[],a=Number.POSITIVE_INFINITY;const l=cc(e,n,t+dc);for(const h of l){const g=[...(u=(i=h.handleBounds)==null?void 0:i.source)!=null?u:[],...(c=(r=h.handleBounds)==null?void 0:r.target)!=null?c:[]];for(const E of g){if(o.nodeId===E.nodeId&&o.type===E.type&&o.id===E.id)continue;const{x:w,y:S}=Nt(h,E,E.position,!0),C=Math.sqrt(ht(w-e.x,2)+ht(S-e.y,2));C>t||(C<a?(s=[fe($({},E),{x:w,y:S})],a=C):C===a&&s.push(fe($({},E),{x:w,y:S})))}}if(!s.length)return null;if(s.length>1){const h=o.type==="source"?"target":"source";return(d=s.find(g=>g.type===h))!=null?d:s[0]}return s[0]}function ii(e,{handle:t,connectionMode:n,fromNodeId:o,fromHandleId:i,fromType:r,doc:s,lib:a,flowId:l,isValidConnection:u=uc},c,d,h,g){const E=r==="target",w=t?s.querySelector(`.${a}-flow__handle[data-id="${l}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:S,y:C}=Oe(e),M=s.elementFromPoint(S,C),y=M!=null&&M.classList.contains(`${a}-flow__handle`)?M:w,N={handleDomNode:y,isValid:!1,connection:null,toHandle:null};if(y){const z=dr(void 0,y),L=y.getAttribute("data-nodeid"),K=y.getAttribute("data-handleid"),Y=y.classList.contains("connectable"),J=y.classList.contains("connectableend");if(!L||!z)return N;const X={source:E?L:o,sourceHandle:E?K:i,target:E?o:L,targetHandle:E?i:K};N.connection=X;const b=Y&&J&&(n===Qe.Strict?E&&z==="source"||!E&&z==="target":L!==o||K!==i);N.isValid=b&&u(X,{nodes:d,edges:c,sourceNode:h(X.source),targetNode:h(X.target)}),N.toHandle=fr(L,z,K,g,n,!0)}return N}function dr(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function hc(e,t){let n=null;return t?n="valid":e&&!t&&(n="invalid"),n}function gc(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}function fr(e,t,n,o,i,r=!1){var h,g,E;var s,a,l;const u=o.get(e);if(!u)return null;const c=i===Qe.Strict?(s=u.handleBounds)==null?void 0:s[t]:[...(h=(a=u.handleBounds)==null?void 0:a.source)!=null?h:[],...(g=(l=u.handleBounds)==null?void 0:l.target)!=null?g:[]],d=(E=n?c==null?void 0:c.find(w=>w.id===n):c==null?void 0:c[0])!=null?E:null;return d&&r?$($({},d),Nt(u,d,d.position,!0)):d}const ro={[q.Left]:q.Right,[q.Right]:q.Left,[q.Top]:q.Bottom,[q.Bottom]:q.Top},vc=["production","prod"];function It(e,...t){hr()&&console.warn(`[Vue Flow]: ${e}`,...t)}function hr(){return!vc.includes("production")}function ri(e,t,n,o,i){const r=t.querySelectorAll(`.vue-flow__handle.${e}`);return r!=null&&r.length?Array.from(r).map(s=>{const a=s.getBoundingClientRect();return $({id:s.getAttribute("data-handleid"),type:e,nodeId:i,position:s.getAttribute("data-handlepos"),x:(a.left-n.left)/o,y:(a.top-n.top)/o},Mn(s))}):null}function so(e,t,n,o,i,r=!1,s){i.value=!1,e.selected?(r||e.selected&&t)&&(o([e]),Ge(()=>{s.blur()})):n([e])}function xe(e){return typeof te(e)!="undefined"}function pc(e,t,n,o){var r;if(!e||!e.source||!e.target)return n(new Ne(Se.EDGE_INVALID,(r=e==null?void 0:e.id)!=null?r:"[ID UNKNOWN]")),!1;let i;return je(e)?i=e:i=fe($({},e),{id:or(e)}),i=tr(i,void 0,o),Ku(i,t)?!1:i}function mc(e,t,n,o,i){if(!t.source||!t.target)return i(new Ne(Se.EDGE_INVALID,e.id)),!1;if(!n)return i(new Ne(Se.EDGE_NOT_FOUND,e.id)),!1;const a=e,{id:r}=a,s=gt(a,["id"]);return fe($({},s),{id:o?or(t):r,source:t.source,target:t.target,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle})}function si(e,t,n){const o={},i=[];for(let r=0;r<e.length;++r){const s=e[r];if(!rt(s)){n(new Ne(Se.NODE_INVALID,s==null?void 0:s.id)||`[ID UNKNOWN|INDEX ${r}]`);continue}const a=Uu(s,t(s.id),s.parentNode);s.parentNode&&(o[s.parentNode]=!0),i[r]=a}for(const r of i){const s=t(r.parentNode)||i.find(a=>a.id===r.parentNode);r.parentNode&&!s&&n(new Ne(Se.NODE_MISSING_PARENT,r.id,r.parentNode)),(r.parentNode||o[r.id])&&(o[r.id]&&(r.isParent=!0),s&&(s.isParent=!0))}return i}function ai(e,t,n,o,i,r){let s=i;const a=o.get(s)||new Map;o.set(s,a.set(n,t)),s=`${i}-${e}`;const l=o.get(s)||new Map;if(o.set(s,l.set(n,t)),r){s=`${i}-${e}-${r}`;const u=o.get(s)||new Map;o.set(s,u.set(n,t))}}function Fn(e,t,n){e.clear();for(const o of n){const{source:i,target:r,sourceHandle:s=null,targetHandle:a=null}=o,l={edgeId:o.id,source:i,target:r,sourceHandle:s,targetHandle:a},u=`${i}-${s}--${r}-${a}`,c=`${r}-${a}--${i}-${s}`;ai("source",l,c,e,i,s),ai("target",l,u,e,r,a)}}function li(e,t,n){if(!n)return;const o=[];for(const i of e.keys())t.has(i)||o.push(e.get(i));o.length&&n(o)}function yc(e,t){if(!e&&!t)return!0;if(!e||!t||e.size!==t.size)return!1;if(!e.size&&!t.size)return!0;for(const n of e.keys())if(!t.has(n))return!1;return!0}function ui(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function Yn(e,t,n,o,i,r,s,a){const l=[];for(const u of e){const c=je(u)?u:pc(u,a,i,r);if(!c)continue;const d=n(c.source),h=n(c.target);if(!d||!h){i(new Ne(Se.EDGE_SOURCE_TARGET_MISSING,c.id,c.source,c.target));continue}if(!d){i(new Ne(Se.EDGE_SOURCE_MISSING,c.id,c.source));continue}if(!h){i(new Ne(Se.EDGE_TARGET_MISSING,c.id,c.target));continue}if(t&&!t(c,{edges:a,nodes:s,sourceNode:d,targetNode:h})){i(new Ne(Se.EDGE_INVALID,c.id));continue}const g=o(c.id);l.push(fe($({},tr(c,g,r)),{sourceNode:d,targetNode:h}))}return l}const ci=Symbol("vueFlow"),gr=Symbol("nodeId"),vr=Symbol("nodeRef"),_c=Symbol("edgeId"),wc=Symbol("edgeRef"),Pn=Symbol("slots");function pr(e){const{vueFlowRef:t,snapToGrid:n,snapGrid:o,noDragClassName:i,nodeLookup:r,nodeExtent:s,nodeDragThreshold:a,viewport:l,autoPanOnNodeDrag:u,autoPanSpeed:c,nodesDraggable:d,panBy:h,findNode:g,multiSelectionActive:E,nodesSelectionActive:w,selectNodesOnDrag:S,removeSelectedElements:C,addSelectedNodes:M,updateNodePositions:y,emits:N}=_e(),{onStart:z,onDrag:L,onStop:K,onClick:Y,el:J,disabled:X,id:D,selectable:b,dragHandle:ee}=e,m=Je(!1);let I=[],x,k=null,A={x:void 0,y:void 0},B={x:0,y:0},O=null,U=!1,Q=!1,oe=0,ae=!1;const H=Ec(),F=({x:ne,y:ie})=>{A={x:ne,y:ie};let v=!1;if(I=I.map(f=>{const p={x:ne-f.distance.x,y:ie-f.distance.y},{computedPosition:_}=_o(f,n.value?In(p,o.value):p,N.error,s.value,f.parentNode?g(f.parentNode):void 0);return v=v||f.position.x!==_.x||f.position.y!==_.y,f.position=_,f}),Q=Q||v,!!v&&(y(I,!0,!0),m.value=!0,O)){const[f,p]=Hn({id:D,dragItems:I,findNode:g});L({event:O,node:f,nodes:p})}},W=()=>{var v,f;if(!k)return;const[ne,ie]=ur(B,k,c.value);if(ne!==0||ie!==0){const p={x:((v=A.x)!=null?v:0)-ne/l.value.zoom,y:((f=A.y)!=null?f:0)-ie/l.value.zoom};h({x:ne,y:ie})&&F(p)}oe=requestAnimationFrame(W)},ce=(ne,ie)=>{U=!0;const v=g(D);!S.value&&!E.value&&v&&(v.selected||C()),v&&ue(b)&&S.value&&so(v,E.value,M,C,w,!1,ie);const f=H(ne.sourceEvent);if(A=f,I=tc(r.value,d.value,f,D),I.length){const[p,_]=Hn({id:D,dragItems:I,findNode:g});z({event:ne.sourceEvent,node:p,nodes:_})}},pe=(ne,ie)=>{var v;ne.sourceEvent.type==="touchmove"&&ne.sourceEvent.touches.length>1||(Q=!1,a.value===0&&ce(ne,ie),A=H(ne.sourceEvent),k=((v=t.value)==null?void 0:v.getBoundingClientRect())||null,B=Oe(ne.sourceEvent,k))},le=(ne,ie)=>{var f,p;const v=H(ne.sourceEvent);if(!ae&&U&&u.value&&(ae=!0,W()),!U){const _=v.xSnapped-((f=A.x)!=null?f:0),T=v.ySnapped-((p=A.y)!=null?p:0);Math.sqrt(_*_+T*T)>a.value&&ce(ne,ie)}(A.x!==v.xSnapped||A.y!==v.ySnapped)&&I.length&&U&&(O=ne.sourceEvent,B=Oe(ne.sourceEvent,k),F(v))},he=ne=>{var v,f;let ie=!1;if(!U&&!m.value&&!E.value){const p=ne.sourceEvent,_=H(p),T=_.xSnapped-((v=A.x)!=null?v:0),V=_.ySnapped-((f=A.y)!=null?f:0),Z=Math.sqrt(T*T+V*V);Z!==0&&Z<=a.value&&(Y==null||Y(p),ie=!0)}if(I.length&&!ie){Q&&(y(I,!1,!1),Q=!1);const[p,_]=Hn({id:D,dragItems:I,findNode:g});K({event:ne.sourceEvent,node:p,nodes:_})}I=[],m.value=!1,ae=!1,U=!1,A={x:void 0,y:void 0},cancelAnimationFrame(oe)};return ve([()=>ue(X),J],([ne,ie],v,f)=>{if(ie){const p=Pe(ie);ne||(x=Xa().on("start",_=>pe(_,ie)).on("drag",_=>le(_,ie)).on("end",_=>he(_)).filter(_=>{const T=_.target,V=ue(ee);return!_.button&&(!i.value||!ti(T,`.${i.value}`,ie)&&(!V||ti(T,V,ie)))}),p.call(x)),f(()=>{p.on(".drag",null),x&&(x.on("start",null),x.on("drag",null),x.on("end",null))})}}),m}function bc(){return{doubleClick:R(),click:R(),mouseEnter:R(),mouseMove:R(),mouseLeave:R(),contextMenu:R(),updateStart:R(),update:R(),updateEnd:R()}}function xc(e,t){const n=bc();return n.doubleClick.on(o=>{var i,r;t.edgeDoubleClick(o),(r=(i=e.events)==null?void 0:i.doubleClick)==null||r.call(i,o)}),n.click.on(o=>{var i,r;t.edgeClick(o),(r=(i=e.events)==null?void 0:i.click)==null||r.call(i,o)}),n.mouseEnter.on(o=>{var i,r;t.edgeMouseEnter(o),(r=(i=e.events)==null?void 0:i.mouseEnter)==null||r.call(i,o)}),n.mouseMove.on(o=>{var i,r;t.edgeMouseMove(o),(r=(i=e.events)==null?void 0:i.mouseMove)==null||r.call(i,o)}),n.mouseLeave.on(o=>{var i,r;t.edgeMouseLeave(o),(r=(i=e.events)==null?void 0:i.mouseLeave)==null||r.call(i,o)}),n.contextMenu.on(o=>{var i,r;t.edgeContextMenu(o),(r=(i=e.events)==null?void 0:i.contextMenu)==null||r.call(i,o)}),n.updateStart.on(o=>{var i,r;t.edgeUpdateStart(o),(r=(i=e.events)==null?void 0:i.updateStart)==null||r.call(i,o)}),n.update.on(o=>{var i,r;t.edgeUpdate(o),(r=(i=e.events)==null?void 0:i.update)==null||r.call(i,o)}),n.updateEnd.on(o=>{var i,r;t.edgeUpdateEnd(o),(r=(i=e.events)==null?void 0:i.updateEnd)==null||r.call(i,o)}),Object.entries(n).reduce((o,[i,r])=>(o.emit[i]=r.trigger,o.on[i]=r.on,o),{emit:{},on:{}})}function Ec(){const{viewport:e,snapGrid:t,snapToGrid:n,vueFlowRef:o}=_e();return i=>{var g;var r;const s=(g=(r=o.value)==null?void 0:r.getBoundingClientRect())!=null?g:{left:0,top:0},a=ac(i)?i.sourceEvent:i,{x:l,y:u}=Oe(a,s),c=Yt({x:l,y:u},e.value),{x:d,y:h}=n.value?In(c,t.value):c;return $({xSnapped:d,ySnapped:h},c)}}function tn(){return!0}function mr({handleId:e,nodeId:t,type:n,isValidConnection:o,edgeUpdaterType:i,onEdgeUpdate:r,onEdgeUpdateEnd:s}){const{id:a,vueFlowRef:l,connectionMode:u,connectionRadius:c,connectOnClick:d,connectionClickStartHandle:h,nodesConnectable:g,autoPanOnConnect:E,autoPanSpeed:w,findNode:S,panBy:C,startConnection:M,updateConnection:y,endConnection:N,emits:z,viewport:L,edges:K,nodes:Y,isValidConnection:J,nodeLookup:X}=_e();let D=null,b=!1,ee=null;function m(x){var k;const A=ue(n)==="target",B=wo(x),O=Uo(x.target),U=x.currentTarget;if(U&&(B&&x.button===0||!B)){let Q=function(G){v=Oe(G,he),F=fc(Yt(v,L.value,!1,[1,1]),c.value,X.value,_),f||(p(),f=!0);const j=ii(G,{handle:F,connectionMode:u.value,fromNodeId:ue(t),fromHandleId:ue(e),fromType:A?"target":"source",isValidConnection:H,doc:O,lib:"vue",flowId:a,nodeLookup:X.value},K.value,Y.value,S,X.value);ee=j.handleDomNode,D=j.connection,b=gc(!!F,j.isValid);const se=fe($({},P),{isValid:b,to:j.toHandle&&b?Ft({x:j.toHandle.x,y:j.toHandle.y},L.value):v,toHandle:j.toHandle,toPosition:b&&j.toHandle?j.toHandle.position:ro[_.position],toNode:j.toHandle?X.value.get(j.toHandle.nodeId):null});if(b&&F&&(P!=null&&P.toHandle)&&se.toHandle&&P.toHandle.type===se.toHandle.type&&P.toHandle.nodeId===se.toHandle.nodeId&&P.toHandle.id===se.toHandle.id&&P.to.x===se.to.x&&P.to.y===se.to.y)return;const de=F!=null?F:j.toHandle;if(y(de&&b?Ft({x:de.x,y:de.y},L.value):v,de,hc(!!de,b)),P=se,!F&&!b&&!ee)return Ln(ie);D&&D.source!==D.target&&ee&&(Ln(ie),ie=ee,ee.classList.add("connecting","vue-flow__handle-connecting"),ee.classList.toggle("valid",!!b),ee.classList.toggle("vue-flow__handle-valid",!!b))},oe=function(G){"touches"in G&&G.touches.length>0||((F||ee)&&D&&b&&(r?r(G,D):z.connect(D)),z.connectEnd(G),i&&(s==null||s(G)),Ln(ie),cancelAnimationFrame(W),N(G),f=!1,b=!1,D=null,ee=null,O.removeEventListener("mousemove",Q),O.removeEventListener("mouseup",oe),O.removeEventListener("touchmove",Q),O.removeEventListener("touchend",oe))};const ae=S(ue(t));let H=ue(o)||J.value||tn;!H&&ae&&(H=(A?ae.isValidSourcePos:ae.isValidTargetPos)||tn);let F,W=0;const{x:ce,y:pe}=Oe(x),le=dr(ue(i),U),he=(k=l.value)==null?void 0:k.getBoundingClientRect();if(!he||!le)return;const ne=fr(ue(t),le,ue(e),X.value,u.value);if(!ne)return;let ie,v=Oe(x,he),f=!1;const p=()=>{if(!E.value)return;const[G,j]=ur(v,he,w.value);C({x:G,y:j}),W=requestAnimationFrame(p)},_=fe($({},ne),{nodeId:ue(t),type:le,position:ne.position}),T=X.value.get(ue(t)),Z={inProgress:!0,isValid:null,from:Nt(T,_,q.Left,!0),fromHandle:_,fromPosition:_.position,fromNode:T,to:v,toHandle:null,toPosition:ro[_.position],toNode:null};M($({nodeId:ue(t),id:ue(e),type:le,position:(U==null?void 0:U.getAttribute("data-handlepos"))||q.Top},v),{x:ce-he.left,y:pe-he.top}),z.connectStart({event:x,nodeId:ue(t),handleId:ue(e),handleType:le});let P=Z;O.addEventListener("mousemove",Q),O.addEventListener("mouseup",oe),O.addEventListener("touchmove",Q),O.addEventListener("touchend",oe)}}function I(x){var H;var k,A;if(!d.value)return;const B=ue(n)==="target";if(!h.value){z.clickConnectStart({event:x,nodeId:ue(t),handleId:ue(e)}),M($({nodeId:ue(t),type:ue(n),id:ue(e),position:q.Top},Oe(x)),void 0,!0);return}let O=ue(o)||J.value||tn;const U=S(ue(t));if(!O&&U&&(O=(B?U.isValidSourcePos:U.isValidTargetPos)||tn),U&&(typeof U.connectable=="undefined"?g.value:U.connectable)===!1)return;const Q=Uo(x.target),oe=ii(x,{handle:$({nodeId:ue(t),id:ue(e),type:ue(n),position:q.Top},Oe(x)),connectionMode:u.value,fromNodeId:h.value.nodeId,fromHandleId:(H=h.value.id)!=null?H:null,fromType:h.value.type,isValidConnection:O,doc:Q,lib:"vue",flowId:a,nodeLookup:X.value},K.value,Y.value,S,X.value),ae=((k=oe.connection)==null?void 0:k.source)===((A=oe.connection)==null?void 0:A.target);oe.isValid&&oe.connection&&!ae&&z.connect(oe.connection),z.clickConnectEnd(x),N(x,!0)}return{handlePointerDown:m,handleClick:I}}function yr(){return Ct(gr,"")}function _r(e){var a;const t=(a=e!=null?e:yr())!=null?a:"",n=Ct(vr,Ee(null)),{findNode:o,edges:i,emits:r}=_e(),s=o(t);return s||r.error(new Ne(Se.NODE_NOT_FOUND,t)),{id:t,nodeEl:n,node:s,parentNode:re(()=>o(s.parentNode)),connectedEdges:re(()=>ar([s],i.value))}}function Sc(){return{doubleClick:R(),click:R(),mouseEnter:R(),mouseMove:R(),mouseLeave:R(),contextMenu:R(),dragStart:R(),drag:R(),dragStop:R()}}function Nc(e,t){const n=Sc();return n.doubleClick.on(o=>{var i,r;t.nodeDoubleClick(o),(r=(i=e.events)==null?void 0:i.doubleClick)==null||r.call(i,o)}),n.click.on(o=>{var i,r;t.nodeClick(o),(r=(i=e.events)==null?void 0:i.click)==null||r.call(i,o)}),n.mouseEnter.on(o=>{var i,r;t.nodeMouseEnter(o),(r=(i=e.events)==null?void 0:i.mouseEnter)==null||r.call(i,o)}),n.mouseMove.on(o=>{var i,r;t.nodeMouseMove(o),(r=(i=e.events)==null?void 0:i.mouseMove)==null||r.call(i,o)}),n.mouseLeave.on(o=>{var i,r;t.nodeMouseLeave(o),(r=(i=e.events)==null?void 0:i.mouseLeave)==null||r.call(i,o)}),n.contextMenu.on(o=>{var i,r;t.nodeContextMenu(o),(r=(i=e.events)==null?void 0:i.contextMenu)==null||r.call(i,o)}),n.dragStart.on(o=>{var i,r;t.nodeDragStart(o),(r=(i=e.events)==null?void 0:i.dragStart)==null||r.call(i,o)}),n.drag.on(o=>{var i,r;t.nodeDrag(o),(r=(i=e.events)==null?void 0:i.drag)==null||r.call(i,o)}),n.dragStop.on(o=>{var i,r;t.nodeDragStop(o),(r=(i=e.events)==null?void 0:i.dragStop)==null||r.call(i,o)}),Object.entries(n).reduce((o,[i,r])=>(o.emit[i]=r.trigger,o.on[i]=r.on,o),{emit:{},on:{}})}function wr(){const{getSelectedNodes:e,nodeExtent:t,updateNodePositions:n,findNode:o,snapGrid:i,snapToGrid:r,nodesDraggable:s,emits:a}=_e();return(l,u=!1)=>{const c=r.value?i.value[0]:5,d=r.value?i.value[1]:5,h=u?4:1,g=l.x*c*h,E=l.y*d*h,w=[];for(const S of e.value)if(S.draggable||s&&typeof S.draggable=="undefined"){const C={x:S.computedPosition.x+g,y:S.computedPosition.y+E},{position:M}=_o(S,C,a.error,t.value,S.parentNode?o(S.parentNode):void 0);w.push({id:S.id,position:M,from:S.position,distance:{x:l.x,y:l.y},dimensions:S.dimensions})}n(w,!0,!1)}}const nn=.1,Cc=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2;function We(){return It("Viewport not initialized yet."),Promise.resolve(!1)}const Mc={zoomIn:We,zoomOut:We,zoomTo:We,fitView:We,setCenter:We,fitBounds:We,project:e=>e,screenToFlowCoordinate:e=>e,flowToScreenCoordinate:e=>e,setViewport:We,setTransform:We,getViewport:()=>({x:0,y:0,zoom:1}),getTransform:()=>({x:0,y:0,zoom:1}),viewportInitialized:!1};function Ic(e){function t(o,i){return new Promise(r=>{e.d3Selection&&e.d3Zoom?e.d3Zoom.interpolate((i==null?void 0:i.interpolate)==="linear"?At:ln).scaleBy(Gn(e.d3Selection,i==null?void 0:i.duration,i==null?void 0:i.ease,()=>{r(!0)}),o):r(!1)})}function n(o,i,r,s){return new Promise(a=>{var l;const{x:u,y:c}=er({x:-o,y:-i},e.translateExtent),d=St.translate(-u,-c).scale(r);e.d3Selection&&e.d3Zoom?(l=e.d3Zoom)==null||l.interpolate((s==null?void 0:s.interpolate)==="linear"?At:ln).transform(Gn(e.d3Selection,s==null?void 0:s.duration,s==null?void 0:s.ease,()=>{a(!0)}),d):a(!1)})}return re(()=>e.d3Zoom&&e.d3Selection&&e.dimensions.width&&e.dimensions.height?{viewportInitialized:!0,zoomIn:i=>t(1.2,i),zoomOut:i=>t(1/1.2,i),zoomTo:(i,r)=>new Promise(s=>{e.d3Selection&&e.d3Zoom?e.d3Zoom.interpolate((r==null?void 0:r.interpolate)==="linear"?At:ln).scaleTo(Gn(e.d3Selection,r==null?void 0:r.duration,r==null?void 0:r.ease,()=>{s(!0)}),i):s(!1)}),setViewport:(i,r)=>n(i.x,i.y,i.zoom,r),setTransform:(i,r)=>n(i.x,i.y,i.zoom,r),getViewport:()=>({x:e.viewport.x,y:e.viewport.y,zoom:e.viewport.zoom}),getTransform:()=>({x:e.viewport.x,y:e.viewport.y,zoom:e.viewport.zoom}),fitView:(i={padding:nn,includeHiddenNodes:!1,duration:0})=>{var h,g,E;var r,s;const a=[];for(const w of e.nodes)w.dimensions.width&&w.dimensions.height&&(i!=null&&i.includeHiddenNodes||!w.hidden)&&(!((r=i.nodes)!=null&&r.length)||(s=i.nodes)!=null&&s.length&&i.nodes.includes(w.id))&&a.push(w);if(!a.length)return Promise.resolve(!1);const l=rr(a),{x:u,y:c,zoom:d}=Zo(l,e.dimensions.width,e.dimensions.height,(h=i.minZoom)!=null?h:e.minZoom,(g=i.maxZoom)!=null?g:e.maxZoom,(E=i.padding)!=null?E:nn);return n(u,c,d,i)},setCenter:(i,r,s)=>{const a=typeof(s==null?void 0:s.zoom)!="undefined"?s.zoom:e.maxZoom,l=e.dimensions.width/2-i*a,u=e.dimensions.height/2-r*a;return n(l,u,a,s)},fitBounds:(i,r={padding:nn})=>{var u;const{x:s,y:a,zoom:l}=Zo(i,e.dimensions.width,e.dimensions.height,e.minZoom,e.maxZoom,(u=r.padding)!=null?u:nn);return n(s,a,l,r)},project:i=>Yt(i,e.viewport,e.snapToGrid,e.snapGrid),screenToFlowCoordinate:i=>{if(e.vueFlowRef){const{x:r,y:s}=e.vueFlowRef.getBoundingClientRect(),a={x:i.x-r,y:i.y-s};return Yt(a,e.viewport,e.snapToGrid,e.snapGrid)}return{x:0,y:0}},flowToScreenCoordinate:i=>{if(e.vueFlowRef){const{x:r,y:s}=e.vueFlowRef.getBoundingClientRect(),a={x:i.x+r,y:i.y+s};return Ft(a,e.viewport)}return{x:0,y:0}}}:Mc)}function Gn(e,t=0,n=Cc,o=()=>{}){const i=typeof t=="number"&&t>0;return i||o(),i?e.transition().duration(t).ease(n).on("end",o):e}function Pc(e,t,n){const o=pi(!0);return o.run(()=>{const i=()=>{o.run(()=>{let w,S,C=!!(n.nodes.value.length||n.edges.value.length);w=vt([e.modelValue,()=>{var M,y;return(y=(M=e.modelValue)==null?void 0:M.value)==null?void 0:y.length}],([M])=>{M&&Array.isArray(M)&&(S==null||S.pause(),n.setElements(M),!S&&!C&&M.length?C=!0:S==null||S.resume())}),S=vt([n.nodes,n.edges,()=>n.edges.value.length,()=>n.nodes.value.length],([M,y])=>{var N;(N=e.modelValue)!=null&&N.value&&Array.isArray(e.modelValue.value)&&(w==null||w.pause(),e.modelValue.value=[...M,...y],Ge(()=>{w==null||w.resume()}))},{immediate:C}),rn(()=>{w==null||w.stop(),S==null||S.stop()})})},r=()=>{o.run(()=>{let w,S,C=!!n.nodes.value.length;w=vt([e.nodes,()=>{var M,y;return(y=(M=e.nodes)==null?void 0:M.value)==null?void 0:y.length}],([M])=>{M&&Array.isArray(M)&&(S==null||S.pause(),n.setNodes(M),!S&&!C&&M.length?C=!0:S==null||S.resume())}),S=vt([n.nodes,()=>n.nodes.value.length],([M])=>{var y;(y=e.nodes)!=null&&y.value&&Array.isArray(e.nodes.value)&&(w==null||w.pause(),e.nodes.value=[...M],Ge(()=>{w==null||w.resume()}))},{immediate:C}),rn(()=>{w==null||w.stop(),S==null||S.stop()})})},s=()=>{o.run(()=>{let w,S,C=!!n.edges.value.length;w=vt([e.edges,()=>{var M,y;return(y=(M=e.edges)==null?void 0:M.value)==null?void 0:y.length}],([M])=>{M&&Array.isArray(M)&&(S==null||S.pause(),n.setEdges(M),!S&&!C&&M.length?C=!0:S==null||S.resume())}),S=vt([n.edges,()=>n.edges.value.length],([M])=>{var y;(y=e.edges)!=null&&y.value&&Array.isArray(e.edges.value)&&(w==null||w.pause(),e.edges.value=[...M],Ge(()=>{w==null||w.resume()}))},{immediate:C}),rn(()=>{w==null||w.stop(),S==null||S.stop()})})},a=()=>{o.run(()=>{ve(()=>t.maxZoom,()=>{t.maxZoom&&xe(t.maxZoom)&&n.setMaxZoom(t.maxZoom)},{immediate:!0})})},l=()=>{o.run(()=>{ve(()=>t.minZoom,()=>{t.minZoom&&xe(t.minZoom)&&n.setMinZoom(t.minZoom)},{immediate:!0})})},u=()=>{o.run(()=>{ve(()=>t.translateExtent,()=>{t.translateExtent&&xe(t.translateExtent)&&n.setTranslateExtent(t.translateExtent)},{immediate:!0})})},c=()=>{o.run(()=>{ve(()=>t.nodeExtent,()=>{t.nodeExtent&&xe(t.nodeExtent)&&n.setNodeExtent(t.nodeExtent)},{immediate:!0})})},d=()=>{o.run(()=>{ve(()=>t.applyDefault,()=>{xe(t.applyDefault)&&(n.applyDefault.value=t.applyDefault)},{immediate:!0})})},h=()=>{o.run(()=>{const w=S=>No(null,null,function*(){let C=S;typeof t.autoConnect=="function"&&(C=yield t.autoConnect(S)),C!==!1&&n.addEdges([C])});ve(()=>t.autoConnect,()=>{xe(t.autoConnect)&&(n.autoConnect.value=t.autoConnect)},{immediate:!0}),ve(n.autoConnect,(S,C,M)=>{S?n.onConnect(w):n.hooks.value.connect.off(w),M(()=>{n.hooks.value.connect.off(w)})},{immediate:!0})})},g=()=>{const w=["id","modelValue","translateExtent","nodeExtent","edges","nodes","maxZoom","minZoom","applyDefault","autoConnect"];for(const S of Object.keys(t)){const C=S;if(!w.includes(C)){const M=we(()=>t[C]),y=n[C];uo(y)&&o.run(()=>{ve(M,N=>{xe(N)&&(y.value=N)},{immediate:!0})})}}};i(),r(),s(),l(),a(),u(),c(),d(),h(),g()}),()=>o.stop()}function Tc(){return{edgesChange:R(),nodesChange:R(),nodeDoubleClick:R(),nodeClick:R(),nodeMouseEnter:R(),nodeMouseMove:R(),nodeMouseLeave:R(),nodeContextMenu:R(),nodeDragStart:R(),nodeDrag:R(),nodeDragStop:R(),nodesInitialized:R(),miniMapNodeClick:R(),miniMapNodeDoubleClick:R(),miniMapNodeMouseEnter:R(),miniMapNodeMouseMove:R(),miniMapNodeMouseLeave:R(),connect:R(),connectStart:R(),connectEnd:R(),clickConnectStart:R(),clickConnectEnd:R(),paneReady:R(),init:R(),move:R(),moveStart:R(),moveEnd:R(),selectionDragStart:R(),selectionDrag:R(),selectionDragStop:R(),selectionContextMenu:R(),selectionStart:R(),selectionEnd:R(),viewportChangeStart:R(),viewportChange:R(),viewportChangeEnd:R(),paneScroll:R(),paneClick:R(),paneContextMenu:R(),paneMouseEnter:R(),paneMouseMove:R(),paneMouseLeave:R(),edgeContextMenu:R(),edgeMouseEnter:R(),edgeMouseMove:R(),edgeMouseLeave:R(),edgeDoubleClick:R(),edgeClick:R(),edgeUpdateStart:R(),edgeUpdate:R(),edgeUpdateEnd:R(),updateNodeInternals:R(),error:R(e=>It(e.message))}}function kc(e,t){const n=Mt();Hr(()=>{for(const[i,r]of Object.entries(t.value)){const s=a=>{e(i,a)};r.setEmitter(s),Bt(r.removeEmitter),r.setHasEmitListeners(()=>o(i)),Bt(r.removeHasEmitListeners)}});function o(i){var r;const s=$c(i);return!!((r=n==null?void 0:n.vnode.props)==null?void 0:r[s])}}function $c(e){const[t,...n]=e.split(":");return`on${t.replace(/(?:^|-)(\w)/g,(i,r)=>r.toUpperCase())}${n.length?`:${n.join(":")}`:""}`}function br(){return{vueFlowRef:null,viewportRef:null,nodes:[],edges:[],connectionLookup:new Map,nodeTypes:{},edgeTypes:{},initialized:!1,dimensions:{width:0,height:0},viewport:{x:0,y:0,zoom:1},d3Zoom:null,d3Selection:null,d3ZoomHandler:null,minZoom:.5,maxZoom:2,translateExtent:[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],nodeExtent:[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],selectionMode:yo.Full,paneDragging:!1,preventScrolling:!0,zoomOnScroll:!0,zoomOnPinch:!0,zoomOnDoubleClick:!0,panOnScroll:!1,panOnScrollSpeed:.5,panOnScrollMode:Ot.Free,paneClickDistance:0,panOnDrag:!0,edgeUpdaterRadius:10,onlyRenderVisibleElements:!1,defaultViewport:{x:0,y:0,zoom:1},nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,defaultMarkerColor:"#b1b1b7",connectionLineStyle:{},connectionLineType:null,connectionLineOptions:{type:tt.Bezier,style:{}},connectionMode:Qe.Loose,connectionStartHandle:null,connectionEndHandle:null,connectionClickStartHandle:null,connectionPosition:{x:Number.NaN,y:Number.NaN},connectionRadius:20,connectOnClick:!0,connectionStatus:null,isValidConnection:null,snapGrid:[15,15],snapToGrid:!1,edgesUpdatable:!1,edgesFocusable:!0,nodesFocusable:!0,nodesConnectable:!0,nodesDraggable:!0,nodeDragThreshold:1,elementsSelectable:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,selectionKeyCode:"Shift",multiSelectionKeyCode:bn()?"Meta":"Control",zoomActivationKeyCode:bn()?"Meta":"Control",deleteKeyCode:"Backspace",panActivationKeyCode:"Space",hooks:Tc(),applyDefault:!0,autoConnect:!1,fitViewOnInit:!1,fitViewOnInitDone:!1,noDragClassName:"nodrag",noWheelClassName:"nowheel",noPanClassName:"nopan",defaultEdgeOptions:void 0,elevateEdgesOnSelect:!1,elevateNodesOnSelect:!0,autoPanOnNodeDrag:!0,autoPanOnConnect:!0,autoPanSpeed:15,disableKeyboardA11y:!1,ariaLiveMessage:""}}const Dc=["id","vueFlowRef","viewportRef","initialized","modelValue","nodes","edges","maxZoom","minZoom","translateExtent","hooks","defaultEdgeOptions"];function Ac(e,t,n){const o=Ic(e),i=v=>{const f=v!=null?v:[];e.hooks.updateNodeInternals.trigger(f)},r=v=>Wu(v,e.nodes,e.edges),s=v=>Zu(v,e.nodes,e.edges),a=v=>ar(v,e.edges),l=({id:v,type:f,nodeId:p})=>{var V;var _;const T=v?`-${f}-${v}`:`-${f}`;return Array.from((V=(_=e.connectionLookup.get(`${p}${T}`))==null?void 0:_.values())!=null?V:[])},u=v=>{if(v)return t.value.get(v)},c=v=>{if(v)return n.value.get(v)},d=(v,f,p)=>{var Z,P;var _,T;const V=[];for(const G of v){const j={id:G.id,type:"position",dragging:p,from:G.from};if(f&&(j.position=G.position,G.parentNode)){const se=u(G.parentNode);j.position={x:j.position.x-((Z=(_=se==null?void 0:se.computedPosition)==null?void 0:_.x)!=null?Z:0),y:j.position.y-((P=(T=se==null?void 0:se.computedPosition)==null?void 0:T.y)!=null?P:0)}}V.push(j)}V!=null&&V.length&&e.hooks.nodesChange.trigger(V)},h=v=>{if(!e.vueFlowRef)return;const f=e.vueFlowRef.querySelector(".vue-flow__transformationpane");if(!f)return;const p=window.getComputedStyle(f),{m22:_}=new window.DOMMatrixReadOnly(p.transform),T=[];for(const V of v){const Z=V,P=u(Z.id);if(P){const G=Mn(Z.nodeElement);if(!!(G.width&&G.height&&(P.dimensions.width!==G.width||P.dimensions.height!==G.height||Z.forceUpdate))){const se=Z.nodeElement.getBoundingClientRect();P.dimensions=G,P.handleBounds.source=ri("source",Z.nodeElement,se,_,P.id),P.handleBounds.target=ri("target",Z.nodeElement,se,_,P.id),T.push({id:P.id,type:"dimensions",dimensions:G})}}}!e.fitViewOnInitDone&&e.fitViewOnInit&&o.value.fitView().then(()=>{e.fitViewOnInitDone=!0}),T.length&&e.hooks.nodesChange.trigger(T)},g=(v,f)=>{const p=new Set,_=new Set;for(const Z of v)rt(Z)?p.add(Z.id):je(Z)&&_.add(Z.id);const T=qe(t.value,p,!0),V=qe(n.value,_);if(e.multiSelectionActive){for(const Z of p)T.push(Ke(Z,f));for(const Z of _)V.push(Ke(Z,f))}T.length&&e.hooks.nodesChange.trigger(T),V.length&&e.hooks.edgesChange.trigger(V)},E=v=>{if(e.multiSelectionActive){const f=v.map(p=>Ke(p.id,!0));e.hooks.nodesChange.trigger(f);return}e.hooks.nodesChange.trigger(qe(t.value,new Set(v.map(f=>f.id)),!0)),e.hooks.edgesChange.trigger(qe(n.value))},w=v=>{if(e.multiSelectionActive){const f=v.map(p=>Ke(p.id,!0));e.hooks.edgesChange.trigger(f);return}e.hooks.edgesChange.trigger(qe(n.value,new Set(v.map(f=>f.id)))),e.hooks.nodesChange.trigger(qe(t.value,new Set,!0))},S=v=>{g(v,!0)},C=v=>{const p=(v||e.nodes).map(_=>(_.selected=!1,Ke(_.id,!1)));e.hooks.nodesChange.trigger(p)},M=v=>{const p=(v||e.edges).map(_=>(_.selected=!1,Ke(_.id,!1)));e.hooks.edgesChange.trigger(p)},y=v=>{if(!v||!v.length)return g([],!1);const f=v.reduce((p,_)=>{const T=Ke(_.id,!1);return rt(_)?p.nodes.push(T):p.edges.push(T),p},{nodes:[],edges:[]});f.nodes.length&&e.hooks.nodesChange.trigger(f.nodes),f.edges.length&&e.hooks.edgesChange.trigger(f.edges)},N=v=>{var f;(f=e.d3Zoom)==null||f.scaleExtent([v,e.maxZoom]),e.minZoom=v},z=v=>{var f;(f=e.d3Zoom)==null||f.scaleExtent([e.minZoom,v]),e.maxZoom=v},L=v=>{var f;(f=e.d3Zoom)==null||f.translateExtent(v),e.translateExtent=v},K=v=>{e.nodeExtent=v,i()},Y=v=>{var f;(f=e.d3Zoom)==null||f.clickDistance(v)},J=v=>{e.nodesDraggable=v,e.nodesConnectable=v,e.elementsSelectable=v},X=v=>{const f=v instanceof Function?v(e.nodes):v;!e.initialized&&!f.length||(e.nodes=si(f,u,e.hooks.error.trigger))},D=v=>{const f=v instanceof Function?v(e.edges):v;if(!e.initialized&&!f.length)return;const p=Yn(f,e.isValidConnection,u,c,e.hooks.error.trigger,e.defaultEdgeOptions,e.nodes,e.edges);Fn(e.connectionLookup,n.value,p),e.edges=p},b=v=>{const f=v instanceof Function?v([...e.nodes,...e.edges]):v;!e.initialized&&!f.length||(X(f.filter(rt)),D(f.filter(je)))},ee=v=>{let f=v instanceof Function?v(e.nodes):v;f=Array.isArray(f)?f:[f];const p=si(f,u,e.hooks.error.trigger),_=[];for(const T of p)_.push(Jo(T));_.length&&e.hooks.nodesChange.trigger(_)},m=v=>{let f=v instanceof Function?v(e.edges):v;f=Array.isArray(f)?f:[f];const p=Yn(f,e.isValidConnection,u,c,e.hooks.error.trigger,e.defaultEdgeOptions,e.nodes,e.edges),_=[];for(const T of p)_.push(Jo(T));_.length&&e.hooks.edgesChange.trigger(_)},I=(v,f=!0,p=!1)=>{const _=v instanceof Function?v(e.nodes):v,T=Array.isArray(_)?_:[_],V=[],Z=[];function P(j){const se=a(j);for(const de of se)(!xe(de.deletable)||de.deletable)&&Z.push(jo(de.id,de.source,de.target,de.sourceHandle,de.targetHandle))}function G(j){const se=[];for(const de of e.nodes)de.parentNode===j&&se.push(de);if(se.length){for(const de of se)V.push(Qo(de.id));f&&P(se);for(const de of se)G(de.id)}}for(const j of T){const se=typeof j=="string"?u(j):j;se&&(xe(se.deletable)&&!se.deletable||(V.push(Qo(se.id)),f&&P([se]),p&&G(se.id)))}Z.length&&e.hooks.edgesChange.trigger(Z),V.length&&e.hooks.nodesChange.trigger(V)},x=v=>{const f=v instanceof Function?v(e.edges):v,p=Array.isArray(f)?f:[f],_=[];for(const T of p){const V=typeof T=="string"?c(T):T;V&&(xe(V.deletable)&&!V.deletable||_.push(jo(typeof T=="string"?T:T.id,V.source,V.target,V.sourceHandle,V.targetHandle)))}e.hooks.edgesChange.trigger(_)},k=(v,f,p=!0)=>{const _=c(v.id);if(!_)return!1;const T=e.edges.indexOf(_),V=mc(v,f,_,p,e.hooks.error.trigger);if(V){const[Z]=Yn([V],e.isValidConnection,u,c,e.hooks.error.trigger,e.defaultEdgeOptions,e.nodes,e.edges);return e.edges=e.edges.map((P,G)=>G===T?Z:P),Fn(e.connectionLookup,n.value,[Z]),Z}return!1},A=(v,f,p={replace:!1})=>{const _=c(v);if(!_)return;const T=typeof f=="function"?f(_):f;_.data=p.replace?T:$($({},_.data),T)},B=v=>qo(v,e.nodes),O=v=>{const f=qo(v,e.edges);return Fn(e.connectionLookup,n.value,f),f},U=(v,f,p={replace:!1})=>{const _=u(v);if(!_)return;const T=typeof f=="function"?f(_):f;p.replace?e.nodes.splice(e.nodes.indexOf(_),1,T):Object.assign(_,T)},Q=(v,f,p={replace:!1})=>{const _=u(v);if(!_)return;const T=typeof f=="function"?f(_):f;_.data=p.replace?T:$($({},_.data),T)},oe=(v,f,p=!1)=>{p?e.connectionClickStartHandle=v:e.connectionStartHandle=v,e.connectionEndHandle=null,e.connectionStatus=null,f&&(e.connectionPosition=f)},ae=(v,f=null,p=null)=>{e.connectionStartHandle&&(e.connectionPosition=v,e.connectionEndHandle=f,e.connectionStatus=p)},H=(v,f)=>{e.connectionPosition={x:Number.NaN,y:Number.NaN},e.connectionEndHandle=null,e.connectionStatus=null,f?e.connectionClickStartHandle=null:e.connectionStartHandle=null},F=v=>{const f=Xu(v),p=f?null:Dt(v)?v:u(v.id);return!f&&!p?[null,null,f]:[f?v:_n(p),p,f]},W=(v,f=!0,p=e.nodes)=>{const[_,T,V]=F(v);if(!_)return[];const Z=[];for(const P of p||e.nodes){if(!V&&(P.id===T.id||!P.computedPosition))continue;const G=_n(P),j=wn(G,_);(f&&j>0||j>=G.width*G.height||j>=Number(_.width)*Number(_.height))&&Z.push(P)}return Z},ce=(v,f,p=!0)=>{const[_]=F(v);if(!_)return!1;const T=wn(_,f);return p&&T>0||T>=Number(_.width)*Number(_.height)},pe=v=>{const{viewport:f,dimensions:p,d3Zoom:_,d3Selection:T,translateExtent:V}=e;if(!_||!T||!v.x&&!v.y)return!1;const Z=St.translate(f.x+v.x,f.y+v.y).scale(f.zoom),P=[[0,0],[p.width,p.height]],G=_.constrain()(Z,P,V),j=e.viewport.x!==G.x||e.viewport.y!==G.y||e.viewport.zoom!==G.k;return _.transform(T,G),j},le=v=>{const f=v instanceof Function?v(e):v,p=["d3Zoom","d3Selection","d3ZoomHandler","viewportRef","vueFlowRef","dimensions","hooks"];xe(f.defaultEdgeOptions)&&(e.defaultEdgeOptions=f.defaultEdgeOptions);const _=f.modelValue||f.nodes||f.edges?[]:void 0;_&&(f.modelValue&&_.push(...f.modelValue),f.nodes&&_.push(...f.nodes),f.edges&&_.push(...f.edges),b(_));const T=()=>{xe(f.maxZoom)&&z(f.maxZoom),xe(f.minZoom)&&N(f.minZoom),xe(f.translateExtent)&&L(f.translateExtent)};for(const V of Object.keys(f)){const Z=V,P=f[Z];![...Dc,...p].includes(Z)&&xe(P)&&(e[Z]=P)}Wn(()=>e.d3Zoom).not.toBeNull().then(T),e.initialized||(e.initialized=!0)};return{updateNodePositions:d,updateNodeDimensions:h,setElements:b,setNodes:X,setEdges:D,addNodes:ee,addEdges:m,removeNodes:I,removeEdges:x,findNode:u,findEdge:c,updateEdge:k,updateEdgeData:A,updateNode:U,updateNodeData:Q,applyEdgeChanges:O,applyNodeChanges:B,addSelectedElements:S,addSelectedNodes:E,addSelectedEdges:w,setMinZoom:N,setMaxZoom:z,setTranslateExtent:L,setNodeExtent:K,setPaneClickDistance:Y,removeSelectedElements:y,removeSelectedNodes:C,removeSelectedEdges:M,startConnection:oe,updateConnection:ae,endConnection:H,setInteractive:J,setState:le,getIntersectingNodes:W,getIncomers:r,getOutgoers:s,getConnectedEdges:a,getHandleConnections:l,isNodeIntersecting:ce,panBy:pe,fitView:v=>o.value.fitView(v),zoomIn:v=>o.value.zoomIn(v),zoomOut:v=>o.value.zoomOut(v),zoomTo:(v,f)=>o.value.zoomTo(v,f),setViewport:(v,f)=>o.value.setViewport(v,f),setTransform:(v,f)=>o.value.setTransform(v,f),getViewport:()=>o.value.getViewport(),getTransform:()=>o.value.getTransform(),setCenter:(v,f,p)=>o.value.setCenter(v,f,p),fitBounds:(v,f)=>o.value.fitBounds(v,f),project:v=>o.value.project(v),screenToFlowCoordinate:v=>o.value.screenToFlowCoordinate(v),flowToScreenCoordinate:v=>o.value.flowToScreenCoordinate(v),toObject:()=>{const v=[],f=[];for(const T of e.nodes){const p=T,{computedPosition:V,handleBounds:Z,selected:P,dimensions:G,isParent:j,resizing:se,dragging:de,events:Ce}=p,$e=gt(p,["computedPosition","handleBounds","selected","dimensions","isParent","resizing","dragging","events"]);v.push($e)}for(const T of e.edges){const _=T,{selected:V,sourceNode:Z,targetNode:P,events:G}=_,j=gt(_,["selected","sourceNode","targetNode","events"]);f.push(j)}return JSON.parse(JSON.stringify({nodes:v,edges:f,position:[e.viewport.x,e.viewport.y],zoom:e.viewport.zoom,viewport:e.viewport}))},fromObject:v=>new Promise(f=>{const{nodes:p,edges:_,position:T,zoom:V,viewport:Z}=v;p&&X(p),_&&D(_);const[P,G]=Z!=null&&Z.x&&(Z!=null&&Z.y)?[Z.x,Z.y]:T!=null?T:[null,null];if(P&&G){const j=(Z==null?void 0:Z.zoom)||V||e.viewport.zoom;return Wn(()=>o.value.viewportInitialized).toBe(!0).then(()=>{o.value.setViewport({x:P,y:G,zoom:j}).then(()=>{f(!0)})})}else f(!0)}),updateNodeInternals:i,viewportHelper:o,$reset:()=>{var f,p,_;const v=br();if(e.edges=[],e.nodes=[],e.d3Zoom&&e.d3Selection){const T=St.translate((f=v.defaultViewport.x)!=null?f:0,(p=v.defaultViewport.y)!=null?p:0).scale(ct((_=v.defaultViewport.zoom)!=null?_:1,v.minZoom,v.maxZoom)),V=e.viewportRef.getBoundingClientRect(),Z=[[0,0],[V.width,V.height]],P=e.d3Zoom.constrain()(T,Z,v.translateExtent);e.d3Zoom.transform(e.d3Selection,P)}le(v)},$destroy:()=>{}}}const Oc=["data-id","data-handleid","data-nodeid","data-handlepos"],zc={name:"Handle",compatConfig:{MODE:3}},xn=be(fe($({},zc),{props:{id:{default:null},type:{},position:{default:()=>q.Top},isValidConnection:{type:Function},connectable:{type:[Boolean,Number,String,Function],default:void 0},connectableStart:{type:Boolean,default:!0},connectableEnd:{type:Boolean,default:!0}},setup(e,{expose:t}){const n=Or(e,["position","connectable","connectableStart","connectableEnd","id"]),o=we(()=>{var D;return(D=n.type)!=null?D:"source"}),i=we(()=>{var D;return(D=n.isValidConnection)!=null?D:null}),{id:r,connectionStartHandle:s,connectionClickStartHandle:a,connectionEndHandle:l,vueFlowRef:u,nodesConnectable:c,noDragClassName:d,noPanClassName:h}=_e(),{id:g,node:E,nodeEl:w,connectedEdges:S}=_r(),C=Ee(),M=we(()=>typeof e.connectableStart!="undefined"?e.connectableStart:!0),y=we(()=>typeof e.connectableEnd!="undefined"?e.connectableEnd:!0),N=we(()=>{var D,b,ee,m,I,x;return((D=s.value)==null?void 0:D.nodeId)===g&&((b=s.value)==null?void 0:b.id)===e.id&&((ee=s.value)==null?void 0:ee.type)===o.value||((m=l.value)==null?void 0:m.nodeId)===g&&((I=l.value)==null?void 0:I.id)===e.id&&((x=l.value)==null?void 0:x.type)===o.value}),z=we(()=>{var D,b,ee;return((D=a.value)==null?void 0:D.nodeId)===g&&((b=a.value)==null?void 0:b.id)===e.id&&((ee=a.value)==null?void 0:ee.type)===o.value}),{handlePointerDown:L,handleClick:K}=mr({nodeId:g,handleId:e.id,isValidConnection:i,type:o}),Y=re(()=>typeof e.connectable=="string"&&e.connectable==="single"?!S.value.some(D=>{const b=D[`${o.value}Handle`];return D[o.value]!==g?!1:b?b===e.id:!0}):typeof e.connectable=="number"?S.value.filter(D=>{const b=D[`${o.value}Handle`];return D[o.value]!==g?!1:b?b===e.id:!0}).length<e.connectable:typeof e.connectable=="function"?e.connectable(E,S.value):xe(e.connectable)?e.connectable:c.value);et(()=>{var B;var D;if(!E.dimensions.width||!E.dimensions.height)return;const b=(D=E.handleBounds[o.value])==null?void 0:D.find(O=>O.id===e.id);if(!u.value||b)return;const ee=u.value.querySelector(".vue-flow__transformationpane");if(!w.value||!C.value||!ee||!e.id)return;const m=w.value.getBoundingClientRect(),I=C.value.getBoundingClientRect(),x=window.getComputedStyle(ee),{m22:k}=new window.DOMMatrixReadOnly(x.transform),A=$({id:e.id,position:e.position,x:(I.left-m.left)/k,y:(I.top-m.top)/k,type:o.value,nodeId:g},Mn(C.value));E.handleBounds[o.value]=[...(B=E.handleBounds[o.value])!=null?B:[],A]});function J(D){const b=wo(D);Y.value&&M.value&&(b&&D.button===0||!b)&&L(D)}function X(D){!g||!a.value&&!M.value||Y.value&&K(D)}return t({handleClick:K,handlePointerDown:L,onClick:X,onPointerDown:J}),(D,b)=>(ge(),ye("div",{ref_key:"handle",ref:C,"data-id":`${te(r)}-${te(g)}-${e.id}-${o.value}`,"data-handleid":e.id,"data-nodeid":te(g),"data-handlepos":D.position,class:wt(["vue-flow__handle",[`vue-flow__handle-${D.position}`,`vue-flow__handle-${e.id}`,te(d),te(h),o.value,{connectable:Y.value,connecting:z.value,connectablestart:M.value,connectableend:y.value,connectionindicator:Y.value&&(M.value&&!N.value||y.value&&N.value)}]]),onMousedown:J,onTouchstartPassive:J,onClick:X},[Xe(D.$slots,"default",{id:D.id})],42,Oc))}})),Tn=function({sourcePosition:e=q.Bottom,targetPosition:t=q.Top,label:n,connectable:o=!0,isValidTargetPos:i,isValidSourcePos:r,data:s}){var l;const a=(l=s.label)!=null?l:n;return[me(xn,{type:"target",position:t,connectable:o,isValidConnection:i}),typeof a!="string"&&a?me(a):me(Ve,[a]),me(xn,{type:"source",position:e,connectable:o,isValidConnection:r})]};Tn.props=["sourcePosition","targetPosition","label","isValidTargetPos","isValidSourcePos","connectable","data"];Tn.inheritAttrs=!1;Tn.compatConfig={MODE:3};const Bc=Tn,kn=function({targetPosition:e=q.Top,label:t,connectable:n=!0,isValidTargetPos:o,data:i}){var s;const r=(s=i.label)!=null?s:t;return[me(xn,{type:"target",position:e,connectable:n,isValidConnection:o}),typeof r!="string"&&r?me(r):me(Ve,[r])]};kn.props=["targetPosition","label","isValidTargetPos","connectable","data"];kn.inheritAttrs=!1;kn.compatConfig={MODE:3};const Vc=kn,$n=function({sourcePosition:e=q.Bottom,label:t,connectable:n=!0,isValidSourcePos:o,data:i}){var s;const r=(s=i.label)!=null?s:t;return[typeof r!="string"&&r?me(r):me(Ve,[r]),me(xn,{type:"source",position:e,connectable:n,isValidConnection:o})]};$n.props=["sourcePosition","label","isValidSourcePos","connectable","data"];$n.inheritAttrs=!1;$n.compatConfig={MODE:3};const Rc=$n,Hc=["transform"],Lc=["width","height","x","y","rx","ry"],Fc=["y"],Yc={name:"EdgeText",compatConfig:{MODE:3}},Gc=be(fe($({},Yc),{props:{x:{},y:{},label:{},labelStyle:{default:()=>({})},labelShowBg:{type:Boolean,default:!0},labelBgStyle:{default:()=>({})},labelBgPadding:{default:()=>[2,4]},labelBgBorderRadius:{default:2}},setup(e){const t=Ee({x:0,y:0,width:0,height:0}),n=Ee(null),o=re(()=>`translate(${e.x-t.value.width/2} ${e.y-t.value.height/2})`);et(i),ve([()=>e.x,()=>e.y,n,()=>e.label],i);function i(){if(!n.value)return;const r=n.value.getBBox();(r.width!==t.value.width||r.height!==t.value.height)&&(t.value=r)}return(r,s)=>(ge(),ye("g",{transform:o.value,class:"vue-flow__edge-textwrapper"},[r.labelShowBg?(ge(),ye("rect",{key:0,class:"vue-flow__edge-textbg",width:`${t.value.width+2*r.labelBgPadding[0]}px`,height:`${t.value.height+2*r.labelBgPadding[1]}px`,x:-r.labelBgPadding[0],y:-r.labelBgPadding[1],style:Ue(r.labelBgStyle),rx:r.labelBgBorderRadius,ry:r.labelBgBorderRadius},null,12,Lc)):Be("",!0),st("text",mi(r.$attrs,{ref_key:"el",ref:n,class:"vue-flow__edge-text",y:t.value.height/2,dy:"0.3em",style:r.labelStyle}),[Xe(r.$slots,"default",{},()=>[typeof r.label!="string"?(ge(),at(Vr(r.label),{key:0})):(ge(),ye(Ve,{key:1},[Rr(Un(r.label),1)],64))])],16,Fc)],8,Hc))}})),Xc=["id","d","marker-end","marker-start"],Uc=["d","stroke-width"],Zc={name:"BaseEdge",inheritAttrs:!1,compatConfig:{MODE:3}},Dn=be(fe($({},Zc),{props:{id:{},labelX:{},labelY:{},path:{},label:{},markerStart:{},markerEnd:{},interactionWidth:{default:20},labelStyle:{},labelShowBg:{type:Boolean},labelBgStyle:{},labelBgPadding:{},labelBgBorderRadius:{}},setup(e,{expose:t}){const n=Ee(null),o=Ee(null),i=Ee(null),r=Dr();return t({pathEl:n,interactionEl:o,labelEl:i}),(s,a)=>(ge(),ye(Ve,null,[st("path",mi(te(r),{id:s.id,ref_key:"pathEl",ref:n,d:s.path,class:"vue-flow__edge-path","marker-end":s.markerEnd,"marker-start":s.markerStart}),null,16,Xc),s.interactionWidth?(ge(),ye("path",{key:0,ref_key:"interactionEl",ref:o,fill:"none",d:s.path,"stroke-width":s.interactionWidth,"stroke-opacity":0,class:"vue-flow__edge-interaction"},null,8,Uc)):Be("",!0),s.label&&s.labelX&&s.labelY?(ge(),at(Gc,{key:1,ref_key:"labelEl",ref:i,x:s.labelX,y:s.labelY,label:s.label,"label-show-bg":s.labelShowBg,"label-bg-style":s.labelBgStyle,"label-bg-padding":s.labelBgPadding,"label-bg-border-radius":s.labelBgBorderRadius,"label-style":s.labelStyle},null,8,["x","y","label","label-show-bg","label-bg-style","label-bg-padding","label-bg-border-radius","label-style"])):Be("",!0)],64))}}));function xr({sourceX:e,sourceY:t,targetX:n,targetY:o}){const i=Math.abs(n-e)/2,r=n<e?n+i:n-i,s=Math.abs(o-t)/2,a=o<t?o+s:o-s;return[r,a,i,s]}function Er({sourceX:e,sourceY:t,targetX:n,targetY:o,sourceControlX:i,sourceControlY:r,targetControlX:s,targetControlY:a}){const l=e*.125+i*.375+s*.375+n*.125,u=t*.125+r*.375+a*.375+o*.125,c=Math.abs(l-e),d=Math.abs(u-t);return[l,u,c,d]}function on(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function di({pos:e,x1:t,y1:n,x2:o,y2:i,c:r}){let s,a;switch(e){case q.Left:s=t-on(t-o,r),a=n;break;case q.Right:s=t+on(o-t,r),a=n;break;case q.Top:s=t,a=n-on(n-i,r);break;case q.Bottom:s=t,a=n+on(i-n,r);break}return[s,a]}function Sr(e){const{sourceX:t,sourceY:n,sourcePosition:o=q.Bottom,targetX:i,targetY:r,targetPosition:s=q.Top,curvature:a=.25}=e,[l,u]=di({pos:o,x1:t,y1:n,x2:i,y2:r,c:a}),[c,d]=di({pos:s,x1:i,y1:r,x2:t,y2:n,c:a}),[h,g,E,w]=Er({sourceX:t,sourceY:n,targetX:i,targetY:r,sourceControlX:l,sourceControlY:u,targetControlX:c,targetControlY:d});return[`M${t},${n} C${l},${u} ${c},${d} ${i},${r}`,h,g,E,w]}function fi({pos:e,x1:t,y1:n,x2:o,y2:i}){let r,s;switch(e){case q.Left:case q.Right:r=.5*(t+o),s=n;break;case q.Top:case q.Bottom:r=t,s=.5*(n+i);break}return[r,s]}function Nr(e){const{sourceX:t,sourceY:n,sourcePosition:o=q.Bottom,targetX:i,targetY:r,targetPosition:s=q.Top}=e,[a,l]=fi({pos:o,x1:t,y1:n,x2:i,y2:r}),[u,c]=fi({pos:s,x1:i,y1:r,x2:t,y2:n}),[d,h,g,E]=Er({sourceX:t,sourceY:n,targetX:i,targetY:r,sourceControlX:a,sourceControlY:l,targetControlX:u,targetControlY:c});return[`M${t},${n} C${a},${l} ${u},${c} ${i},${r}`,d,h,g,E]}const hi={[q.Left]:{x:-1,y:0},[q.Right]:{x:1,y:0},[q.Top]:{x:0,y:-1},[q.Bottom]:{x:0,y:1}};function Wc({source:e,sourcePosition:t=q.Bottom,target:n}){return t===q.Left||t===q.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1}}function gi(e,t){return Math.sqrt(ht(t.x-e.x,2)+ht(t.y-e.y,2))}function Kc({source:e,sourcePosition:t=q.Bottom,target:n,targetPosition:o=q.Top,center:i,offset:r}){var K,Y;const s=hi[t],a=hi[o],l={x:e.x+s.x*r,y:e.y+s.y*r},u={x:n.x+a.x*r,y:n.y+a.y*r},c=Wc({source:l,sourcePosition:t,target:u}),d=c.x!==0?"x":"y",h=c[d];let g,E,w;const S={x:0,y:0},C={x:0,y:0},[M,y,N,z]=xr({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(s[d]*a[d]===-1){E=(K=i.x)!=null?K:M,w=(Y=i.y)!=null?Y:y;const J=[{x:E,y:l.y},{x:E,y:u.y}],X=[{x:l.x,y:w},{x:u.x,y:w}];s[d]===h?g=d==="x"?J:X:g=d==="x"?X:J}else{const J=[{x:l.x,y:u.y}],X=[{x:u.x,y:l.y}];if(d==="x"?g=s.x===h?X:J:g=s.y===h?J:X,t===o){const I=Math.abs(e[d]-n[d]);if(I<=r){const x=Math.min(r-1,r-I);s[d]===h?S[d]=(l[d]>e[d]?-1:1)*x:C[d]=(u[d]>n[d]?-1:1)*x}}if(t!==o){const I=d==="x"?"y":"x",x=s[d]===a[I],k=l[I]>u[I],A=l[I]<u[I];(s[d]===1&&(!x&&k||x&&A)||s[d]!==1&&(!x&&A||x&&k))&&(g=d==="x"?J:X)}const D={x:l.x+S.x,y:l.y+S.y},b={x:u.x+C.x,y:u.y+C.y},ee=Math.max(Math.abs(D.x-g[0].x),Math.abs(b.x-g[0].x)),m=Math.max(Math.abs(D.y-g[0].y),Math.abs(b.y-g[0].y));ee>=m?(E=(D.x+b.x)/2,w=g[0].y):(E=g[0].x,w=(D.y+b.y)/2)}return[[e,{x:l.x+S.x,y:l.y+S.y},...g,{x:u.x+C.x,y:u.y+C.y},n],E,w,N,z]}function qc(e,t,n,o){const i=Math.min(gi(e,t)/2,gi(t,n)/2,o),{x:r,y:s}=t;if(e.x===r&&r===n.x||e.y===s&&s===n.y)return`L${r} ${s}`;if(e.y===s){const u=e.x<n.x?-1:1,c=e.y<n.y?1:-1;return`L ${r+i*u},${s}Q ${r},${s} ${r},${s+i*c}`}const a=e.x<n.x?1:-1,l=e.y<n.y?-1:1;return`L ${r},${s+i*l}Q ${r},${s} ${r+i*a},${s}`}function ao(e){const{sourceX:t,sourceY:n,sourcePosition:o=q.Bottom,targetX:i,targetY:r,targetPosition:s=q.Top,borderRadius:a=5,centerX:l,centerY:u,offset:c=20}=e,[d,h,g,E,w]=Kc({source:{x:t,y:n},sourcePosition:o,target:{x:i,y:r},targetPosition:s,center:{x:l,y:u},offset:c});return[d.reduce((C,M,y)=>{let N;return y>0&&y<d.length-1?N=qc(d[y-1],M,d[y+1],a):N=`${y===0?"M":"L"}${M.x} ${M.y}`,C+=N,C},""),h,g,E,w]}function Jc(e){const{sourceX:t,sourceY:n,targetX:o,targetY:i}=e,[r,s,a,l]=xr({sourceX:t,sourceY:n,targetX:o,targetY:i});return[`M ${t},${n}L ${o},${i}`,r,s,a,l]}const Qc=be({name:"StraightEdge",props:["label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","markerEnd","markerStart","interactionWidth"],compatConfig:{MODE:3},setup(e,{attrs:t}){return()=>{const[n,o,i]=Jc(e);return me(Dn,$($({path:n,labelX:o,labelY:i},t),e))}}}),jc=Qc,ed=be({name:"SmoothStepEdge",props:["sourcePosition","targetPosition","label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","borderRadius","markerEnd","markerStart","interactionWidth","offset"],compatConfig:{MODE:3},setup(e,{attrs:t}){return()=>{var r,s;const[n,o,i]=ao(fe($({},e),{sourcePosition:(r=e.sourcePosition)!=null?r:q.Bottom,targetPosition:(s=e.targetPosition)!=null?s:q.Top}));return me(Dn,$($({path:n,labelX:o,labelY:i},t),e))}}}),Cr=ed,td=be({name:"StepEdge",props:["sourcePosition","targetPosition","label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","markerEnd","markerStart","interactionWidth"],setup(e,{attrs:t}){return()=>me(Cr,fe($($({},e),t),{borderRadius:0}))}}),nd=td,od=be({name:"BezierEdge",props:["sourcePosition","targetPosition","label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","curvature","markerEnd","markerStart","interactionWidth"],compatConfig:{MODE:3},setup(e,{attrs:t}){return()=>{var r,s;const[n,o,i]=Sr(fe($({},e),{sourcePosition:(r=e.sourcePosition)!=null?r:q.Bottom,targetPosition:(s=e.targetPosition)!=null?s:q.Top}));return me(Dn,$($({path:n,labelX:o,labelY:i},t),e))}}}),id=od,rd=be({name:"SimpleBezierEdge",props:["sourcePosition","targetPosition","label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","markerEnd","markerStart","interactionWidth"],compatConfig:{MODE:3},setup(e,{attrs:t}){return()=>{var r,s;const[n,o,i]=Nr(fe($({},e),{sourcePosition:(r=e.sourcePosition)!=null?r:q.Bottom,targetPosition:(s=e.targetPosition)!=null?s:q.Top}));return me(Dn,$($({path:n,labelX:o,labelY:i},t),e))}}}),sd=rd,ad={input:Rc,default:Bc,output:Vc},ld={default:id,straight:jc,step:nd,smoothstep:Cr,simplebezier:sd};function ud(e,t,n){const o=re(()=>w=>t.value.get(w)),i=re(()=>w=>n.value.get(w)),r=re(()=>{const w=$($({},ld),e.edgeTypes),S=Object.keys(w);for(const C of e.edges)C.type&&!S.includes(C.type)&&(w[C.type]=C.type);return w}),s=re(()=>{const w=$($({},ad),e.nodeTypes),S=Object.keys(w);for(const C of e.nodes)C.type&&!S.includes(C.type)&&(w[C.type]=C.type);return w}),a=re(()=>e.onlyRenderVisibleElements?sr(e.nodes,{x:0,y:0,width:e.dimensions.width,height:e.dimensions.height},e.viewport,!0):e.nodes),l=re(()=>{if(e.onlyRenderVisibleElements){const w=[];for(const S of e.edges){const C=t.value.get(S.source),M=t.value.get(S.target);rc({sourcePos:C.computedPosition||{x:0,y:0},targetPos:M.computedPosition||{x:0,y:0},sourceWidth:C.dimensions.width,sourceHeight:C.dimensions.height,targetWidth:M.dimensions.width,targetHeight:M.dimensions.height,width:e.dimensions.width,height:e.dimensions.height,viewport:e.viewport})&&w.push(S)}return w}return e.edges}),u=re(()=>[...a.value,...l.value]),c=re(()=>{const w=[];for(const S of e.nodes)S.selected&&w.push(S);return w}),d=re(()=>{const w=[];for(const S of e.edges)S.selected&&w.push(S);return w}),h=re(()=>[...c.value,...d.value]),g=re(()=>{const w=[];for(const S of e.nodes)S.dimensions.width&&S.dimensions.height&&S.handleBounds!==void 0&&w.push(S);return w}),E=re(()=>a.value.length>0&&g.value.length===a.value.length);return{getNode:o,getEdge:i,getElements:u,getEdgeTypes:r,getNodeTypes:s,getEdges:l,getNodes:a,getSelectedElements:h,getSelectedNodes:c,getSelectedEdges:d,getNodesInitialized:g,areNodesInitialized:E}}class nt{constructor(){this.currentId=0,this.flows=new Map}static getInstance(){var i;var t;const n=(t=Mt())==null?void 0:t.appContext.app,o=(i=n==null?void 0:n.config.globalProperties.$vueFlowStorage)!=null?i:nt.instance;return nt.instance=o!=null?o:new nt,n&&(n.config.globalProperties.$vueFlowStorage=nt.instance),nt.instance}set(t,n){return this.flows.set(t,n)}get(t){return this.flows.get(t)}remove(t){return this.flows.delete(t)}create(t,n){const o=br(),i=Fr(o),r={};for(const[h,g]of Object.entries(i.hooks)){const E=`on${h.charAt(0).toUpperCase()+h.slice(1)}`;r[E]=g.on}const s={};for(const[h,g]of Object.entries(i.hooks))s[h]=g.trigger;const a=re(()=>{const h=new Map;for(const g of i.nodes)h.set(g.id,g);return h}),l=re(()=>{const h=new Map;for(const g of i.edges)h.set(g.id,g);return h}),u=ud(i,a,l),c=Ac(i,a,l);c.setState($($({},i),n));const d=fe($($($($({},r),u),c),es(i)),{nodeLookup:a,edgeLookup:l,emits:s,id:t,vueFlowVersion:"1.48.2",$destroy:()=>{this.remove(t)}});return this.set(t,d),d}getId(){return`vue-flow-${this.currentId++}`}}function _e(e){const t=nt.getInstance(),n=yi(),o=typeof e=="object",i=o?e:{id:e},r=i.id,s=r!=null?r:n==null?void 0:n.vueFlowId;let a;if(n){const l=Ct(ci,null);typeof l!="undefined"&&l!==null&&(!s||l.id===s)&&(a=l)}if(a||s&&(a=t.get(s)),!a||s&&a.id!==s){const l=r!=null?r:t.getId(),u=t.create(l,i);a=u,(n!=null?n:pi(!0)).run(()=>{ve(u.applyDefault,(d,h,g)=>{const E=S=>{u.applyNodeChanges(S)},w=S=>{u.applyEdgeChanges(S)};d?(u.onNodesChange(E),u.onEdgesChange(w)):(u.hooks.value.nodesChange.off(E),u.hooks.value.edgesChange.off(w)),g(()=>{u.hooks.value.nodesChange.off(E),u.hooks.value.edgesChange.off(w)})},{immediate:!0}),Bt(()=>{if(a){const d=t.get(a.id);d?d.$destroy():It(`No store instance found for id ${a.id} in storage.`)}})})}else o&&a.setState(i);if(n&&(bt(ci,a),n.vueFlowId=a.id),o){const l=Mt();(l==null?void 0:l.type.name)!=="VueFlow"&&a.emits.error(new Ne(Se.USEVUEFLOW_OPTIONS))}return a}function cd(e){const{emits:t,dimensions:n}=_e();let o;et(()=>{const i=()=>{var l;var r,s;if(!e.value||!((l=(s=(r=e.value).checkVisibility)==null?void 0:s.call(r))==null||l))return;const a=Mn(e.value);(a.width===0||a.height===0)&&t.error(new Ne(Se.MISSING_VIEWPORT_DIMENSIONS)),n.value={width:a.width||500,height:a.height||500}};i(),window.addEventListener("resize",i),e.value&&(o=new ResizeObserver(()=>i()),o.observe(e.value)),_i(()=>{window.removeEventListener("resize",i),o&&e.value&&o.unobserve(e.value)})})}const dd={name:"UserSelection",compatConfig:{MODE:3}},fd=be(fe($({},dd),{props:{userSelectionRect:{}},setup(e){return(t,n)=>(ge(),ye("div",{class:"vue-flow__selection vue-flow__container",style:Ue({width:`${t.userSelectionRect.width}px`,height:`${t.userSelectionRect.height}px`,transform:`translate(${t.userSelectionRect.x}px, ${t.userSelectionRect.y}px)`})},null,4))}})),hd=["tabIndex"],gd={name:"NodesSelection",compatConfig:{MODE:3}},vd=be(fe($({},gd),{setup(e){const{emits:t,viewport:n,getSelectedNodes:o,noPanClassName:i,disableKeyboardA11y:r,userSelectionActive:s}=_e(),a=wr(),l=Ee(null),u=pr({el:l,onStart(E){t.selectionDragStart(E),t.nodeDragStart(E)},onDrag(E){t.selectionDrag(E),t.nodeDrag(E)},onStop(E){t.selectionDragStop(E),t.nodeDragStop(E)}});et(()=>{var E;r.value||(E=l.value)==null||E.focus({preventScroll:!0})});const c=re(()=>rr(o.value)),d=re(()=>({width:`${c.value.width}px`,height:`${c.value.height}px`,top:`${c.value.y}px`,left:`${c.value.x}px`}));function h(E){t.selectionContextMenu({event:E,nodes:o.value})}function g(E){r.value||_t[E.key]&&(E.preventDefault(),a({x:_t[E.key].x,y:_t[E.key].y},E.shiftKey))}return(E,w)=>!te(s)&&c.value.width&&c.value.height?(ge(),ye("div",{key:0,class:wt(["vue-flow__nodesselection vue-flow__container",te(i)]),style:Ue({transform:`translate(${te(n).x}px,${te(n).y}px) scale(${te(n).zoom})`})},[st("div",{ref_key:"el",ref:l,class:wt([{dragging:te(u)},"vue-flow__nodesselection-rect"]),style:Ue(d.value),tabIndex:te(r)?void 0:-1,onContextmenu:h,onKeydown:g},null,46,hd)],6)):Be("",!0)}}));function pd(e,t){return{x:e.clientX-t.left,y:e.clientY-t.top}}const md={name:"Pane",compatConfig:{MODE:3}},yd=be(fe($({},md),{props:{isSelecting:{type:Boolean},selectionKeyPressed:{type:Boolean}},setup(e){const{vueFlowRef:t,nodes:n,viewport:o,emits:i,userSelectionActive:r,removeSelectedElements:s,userSelectionRect:a,elementsSelectable:l,nodesSelectionActive:u,getSelectedEdges:c,getSelectedNodes:d,removeNodes:h,removeEdges:g,selectionMode:E,deleteKeyCode:w,multiSelectionKeyCode:S,multiSelectionActive:C,edgeLookup:M,nodeLookup:y,connectionLookup:N,defaultEdgeOptions:z,connectionStartHandle:L,panOnDrag:K}=_e(),Y=Je(null),J=Je(new Set),X=Je(new Set),D=Je(null),b=we(()=>l.value&&(e.isSelecting||r.value)),ee=we(()=>L.value!==null);let m=!1,I=!1;const x=zt(w,{actInsideInputWithModifier:!1}),k=zt(S);ve(x,H=>{H&&(h(d.value),g(c.value),u.value=!1)}),ve(k,H=>{C.value=H});function A(H,F){return W=>{W.target===F&&(H==null||H(W))}}function B(H){if(m||ee.value){m=!1;return}i.paneClick(H),s(),u.value=!1}function O(H){var F;if(Array.isArray(K.value)&&((F=K.value)!=null&&F.includes(2))){H.preventDefault();return}i.paneContextMenu(H)}function U(H){i.paneScroll(H)}function Q(H){var he;var F,W,ce;if(D.value=(he=(F=t.value)==null?void 0:F.getBoundingClientRect())!=null?he:null,!l.value||!e.isSelecting||H.button!==0||H.target!==Y.value||!D.value)return;(ce=(W=H.target)==null?void 0:W.setPointerCapture)==null||ce.call(W,H.pointerId);const{x:pe,y:le}=pd(H,D.value);I=!0,m=!1,s(),a.value={width:0,height:0,startX:pe,startY:le,x:pe,y:le},i.selectionStart(H)}function oe(H){var f,p;var F;if(!D.value||!a.value)return;m=!0;const{x:W,y:ce}=Oe(H,D.value),{startX:pe=0,startY:le=0}=a.value,he={startX:pe,startY:le,x:W<pe?W:pe,y:ce<le?ce:le,width:Math.abs(W-pe),height:Math.abs(ce-le)},ne=J.value,ie=X.value;J.value=new Set(sr(n.value,he,o.value,E.value===yo.Partial,!0).map(_=>_.id)),X.value=new Set;const v=(f=(F=z.value)==null?void 0:F.selectable)!=null?f:!0;for(const _ of J.value){const T=N.value.get(_);if(T)for(const{edgeId:V}of T.values()){const Z=M.value.get(V);Z&&((p=Z.selectable)!=null?p:v)&&X.value.add(V)}}if(!ui(ne,J.value)){const _=qe(y.value,J.value,!0);i.nodesChange(_)}if(!ui(ie,X.value)){const _=qe(M.value,X.value);i.edgesChange(_)}a.value=he,r.value=!0,u.value=!1}function ae(H){var F;H.button!==0||!I||((F=H.target)==null||F.releasePointerCapture(H.pointerId),!r.value&&a.value&&H.target===Y.value&&B(H),r.value=!1,a.value=null,u.value=J.value.size>0,i.selectionEnd(H),e.selectionKeyPressed&&(m=!1),I=!1)}return(H,F)=>(ge(),ye("div",{ref_key:"container",ref:Y,class:wt(["vue-flow__pane vue-flow__container",{selection:H.isSelecting}]),onClick:F[0]||(F[0]=W=>b.value?void 0:A(B,Y.value)(W)),onContextmenu:F[1]||(F[1]=W=>A(O,Y.value)(W)),onWheelPassive:F[2]||(F[2]=W=>A(U,Y.value)(W)),onPointerenter:F[3]||(F[3]=W=>b.value?void 0:te(i).paneMouseEnter(W)),onPointerdown:F[4]||(F[4]=W=>b.value?Q(W):te(i).paneMouseMove(W)),onPointermove:F[5]||(F[5]=W=>b.value?oe(W):te(i).paneMouseMove(W)),onPointerup:F[6]||(F[6]=W=>b.value?ae(W):void 0),onPointerleave:F[7]||(F[7]=W=>te(i).paneMouseLeave(W))},[Xe(H.$slots,"default"),te(r)&&te(a)?(ge(),at(fd,{key:0,"user-selection-rect":te(a)},null,8,["user-selection-rect"])):Be("",!0),te(u)&&te(d).length?(ge(),at(vd,{key:1})):Be("",!0)],34))}})),_d={name:"Transform",compatConfig:{MODE:3}},wd=be(fe($({},_d),{setup(e){const{viewport:t,fitViewOnInit:n,fitViewOnInitDone:o}=_e(),i=re(()=>n.value?!o.value:!1),r=re(()=>`translate(${t.value.x}px,${t.value.y}px) scale(${t.value.zoom})`);return(s,a)=>(ge(),ye("div",{class:"vue-flow__transformationpane vue-flow__container",style:Ue({transform:r.value,opacity:i.value?0:void 0})},[Xe(s.$slots,"default")],4))}})),bd={name:"Viewport",compatConfig:{MODE:3}},xd=be(fe($({},bd),{setup(e){const{minZoom:t,maxZoom:n,defaultViewport:o,translateExtent:i,zoomActivationKeyCode:r,selectionKeyCode:s,panActivationKeyCode:a,panOnScroll:l,panOnScrollMode:u,panOnScrollSpeed:c,panOnDrag:d,zoomOnDoubleClick:h,zoomOnPinch:g,zoomOnScroll:E,preventScrolling:w,noWheelClassName:S,noPanClassName:C,emits:M,connectionStartHandle:y,userSelectionActive:N,paneDragging:z,d3Zoom:L,d3Selection:K,d3ZoomHandler:Y,viewport:J,viewportRef:X,paneClickDistance:D}=_e();cd(X);const b=Je(!1),ee=Je(!1);let m=null,I=!1,x=0,k={x:0,y:0,zoom:0};const A=zt(a),B=zt(s),O=zt(r),U=we(()=>(!B.value||B.value&&s.value===!0)&&(A.value||d.value)),Q=we(()=>A.value||l.value),oe=we(()=>s.value===!0&&U.value!==!0),ae=we(()=>B.value&&s.value!==!0||N.value||oe.value),H=we(()=>y.value!==null);et(()=>{var T,V,Z;if(!X.value){It("Viewport element is missing");return}const le=X.value,he=le.getBoundingClientRect(),ne=Vu().clickDistance(D.value).scaleExtent([t.value,n.value]).translateExtent(i.value),ie=Pe(le).call(ne),v=ie.on("wheel.zoom"),f=St.translate((T=o.value.x)!=null?T:0,(V=o.value.y)!=null?V:0).scale(ct((Z=o.value.zoom)!=null?Z:1,t.value,n.value)),p=[[0,0],[he.width,he.height]],_=ne.constrain()(f,p,i.value);ne.transform(ie,_),ne.wheelDelta(Wo),L.value=ne,K.value=ie,Y.value=v,J.value={x:_.x,y:_.y,zoom:_.k},ne.on("start",P=>{var G;if(!P.sourceEvent)return null;x=P.sourceEvent.button,b.value=!0;const j=ce(P.transform);((G=P.sourceEvent)==null?void 0:G.type)==="mousedown"&&(z.value=!0),k=j,M.viewportChangeStart(j),M.moveStart({event:P,flowTransform:j})}),ne.on("end",P=>{if(!P.sourceEvent)return null;if(b.value=!1,z.value=!1,F(U.value,x!=null?x:0)&&!I&&M.paneContextMenu(P.sourceEvent),I=!1,W(k,P.transform)){const G=ce(P.transform);k=G,M.viewportChangeEnd(G),M.moveEnd({event:P,flowTransform:G})}}),ne.filter(P=>{var G;const j=O.value||E.value,se=g.value&&P.ctrlKey,de=P.button,Ce=P.type==="wheel";if(de===1&&P.type==="mousedown"&&(pe(P,"vue-flow__node")||pe(P,"vue-flow__edge")))return!0;if(!U.value&&!j&&!Q.value&&!h.value&&!g.value||N.value||H.value&&!Ce||!h.value&&P.type==="dblclick"||pe(P,S.value)&&Ce||pe(P,C.value)&&(!Ce||Q.value&&Ce&&!O.value)||!g.value&&P.ctrlKey&&Ce||!j&&!Q.value&&!se&&Ce)return!1;if(!g&&P.type==="touchstart"&&((G=P.touches)==null?void 0:G.length)>1)return P.preventDefault(),!1;if(!U.value&&(P.type==="mousedown"||P.type==="touchstart")||oe.value&&Array.isArray(d.value)&&d.value.includes(0)&&de===0||Array.isArray(d.value)&&!d.value.includes(de)&&(P.type==="mousedown"||P.type==="touchstart"))return!1;const $e=Array.isArray(d.value)&&d.value.includes(de)||s.value===!0&&Array.isArray(d.value)&&!d.value.includes(0)||!de||de<=1;return(!P.ctrlKey||A.value||Ce)&&$e}),ve([N,U],()=>{N.value&&!b.value?ne.on("zoom",null):N.value||ne.on("zoom",P=>{J.value={x:P.transform.x,y:P.transform.y,zoom:P.transform.k};const G=ce(P.transform);I=F(U.value,x!=null?x:0),M.viewportChange(G),M.move({event:P,flowTransform:G})})},{immediate:!0}),ve([N,Q,u,O,g,w,S],()=>{Q.value&&!O.value&&!N.value?ie.on("wheel.zoom",P=>{if(pe(P,S.value))return!1;const G=O.value||E.value,j=g.value&&P.ctrlKey;if(!(!w.value||Q.value||G||j))return!1;P.preventDefault(),P.stopImmediatePropagation();const de=ie.property("__zoom").k||1,Ce=bn();if(!A.value&&P.ctrlKey&&g.value&&Ce){const Mr=De(P),Ir=Wo(P),Pr=de*ht(2,Ir);ne.scaleTo(ie,Pr,Mr,P);return}const $e=P.deltaMode===1?20:1;let dt=u.value===Ot.Vertical?0:P.deltaX*$e,Zt=u.value===Ot.Horizontal?0:P.deltaY*$e;!Ce&&P.shiftKey&&u.value!==Ot.Vertical&&!dt&&Zt&&(dt=Zt,Zt=0),ne.translateBy(ie,-(dt/de)*c.value,-(Zt/de)*c.value);const ft=ce(ie.property("__zoom"));m&&clearTimeout(m),ee.value?(M.move({event:P,flowTransform:ft}),M.viewportChange(ft),m=setTimeout(()=>{M.moveEnd({event:P,flowTransform:ft}),M.viewportChangeEnd(ft),ee.value=!1},150)):(ee.value=!0,M.moveStart({event:P,flowTransform:ft}),M.viewportChangeStart(ft))},{passive:!1}):typeof v!="undefined"&&ie.on("wheel.zoom",function(P,G){const j=!w.value&&P.type==="wheel"&&!P.ctrlKey,se=O.value||E.value,de=g.value&&P.ctrlKey;if(!se&&!l.value&&!de&&P.type==="wheel"||j||pe(P,S.value))return null;P.preventDefault(),v.call(this,P,G)},{passive:!1})},{immediate:!0})});function F(le,he){return he===2&&Array.isArray(le)&&le.includes(2)}function W(le,he){return le.x!==he.x&&!Number.isNaN(he.x)||le.y!==he.y&&!Number.isNaN(he.y)||le.zoom!==he.k&&!Number.isNaN(he.k)}function ce(le){return{x:le.x,y:le.y,zoom:le.k}}function pe(le,he){return le.target.closest(`.${he}`)}return(le,he)=>(ge(),ye("div",{ref_key:"viewportRef",ref:X,class:"vue-flow__viewport vue-flow__container"},[Fe(yd,{"is-selecting":ae.value,"selection-key-pressed":te(B),class:wt({connecting:H.value,dragging:te(z),draggable:te(d)===!0||Array.isArray(te(d))&&te(d).includes(0)})},{default:Xn(()=>[Fe(wd,null,{default:Xn(()=>[Xe(le.$slots,"default")]),_:3})]),_:3},8,["is-selecting","selection-key-pressed","class"])],512))}})),Ed=["id"],Sd=["id"],Nd=["id"],Cd={name:"A11yDescriptions",compatConfig:{MODE:3}},Md=be(fe($({},Cd),{setup(e){const{id:t,disableKeyboardA11y:n,ariaLiveMessage:o}=_e();return(i,r)=>(ge(),ye(Ve,null,[st("div",{id:`${te(Ji)}-${te(t)}`,style:{display:"none"}}," Press enter or space to select a node. "+Un(te(n)?"":"You can then use the arrow keys to move the node around.")+" You can then use the arrow keys to move the node around, press delete to remove it and press escape to cancel. ",9,Ed),st("div",{id:`${te(Qi)}-${te(t)}`,style:{display:"none"}}," Press enter or space to select an edge. You can then press delete to remove it or press escape to cancel. ",8,Sd),te(n)?Be("",!0):(ge(),ye("div",{key:0,id:`${te(Gu)}-${te(t)}`,"aria-live":"assertive","aria-atomic":"true",style:{position:"absolute",width:"1px",height:"1px",margin:"-1px",border:"0",padding:"0",overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)","clip-path":"inset(100%)"}},Un(te(o)),9,Nd))],64))}}));function Id(){const e=_e();ve(()=>e.viewportHelper.value.viewportInitialized,t=>{t&&setTimeout(()=>{e.emits.init(e),e.emits.paneReady(e)},1)})}function Pd(e,t,n){return n===q.Left?e-t:n===q.Right?e+t:e}function Td(e,t,n){return n===q.Top?e-t:n===q.Bottom?e+t:e}const bo=function({radius:e=10,centerX:t=0,centerY:n=0,position:o=q.Top,type:i}){return me("circle",{class:`vue-flow__edgeupdater vue-flow__edgeupdater-${i}`,cx:Pd(t,e,o),cy:Td(n,e,o),r:e,stroke:"transparent",fill:"transparent"})};bo.props=["radius","centerX","centerY","position","type"];bo.compatConfig={MODE:3};const vi=bo,kd=be({name:"Edge",compatConfig:{MODE:3},props:["id"],setup(e){const{id:t,addSelectedEdges:n,connectionMode:o,edgeUpdaterRadius:i,emits:r,nodesSelectionActive:s,noPanClassName:a,getEdgeTypes:l,removeSelectedEdges:u,findEdge:c,findNode:d,isValidConnection:h,multiSelectionActive:g,disableKeyboardA11y:E,elementsSelectable:w,edgesUpdatable:S,edgesFocusable:C,hooks:M}=_e(),y=re(()=>c(e.id)),{emit:N,on:z}=xc(y.value,r),L=Ct(Pn),K=Mt(),Y=Ee(!1),J=Ee(!1),X=Ee(""),D=Ee(null),b=Ee("source"),ee=Ee(null),m=we(()=>typeof y.value.selectable=="undefined"?w.value:y.value.selectable),I=we(()=>typeof y.value.updatable=="undefined"?S.value:y.value.updatable),x=we(()=>typeof y.value.focusable=="undefined"?C.value:y.value.focusable);bt(_c,e.id),bt(wc,ee);const k=re(()=>y.value.class instanceof Function?y.value.class(y.value):y.value.class),A=re(()=>y.value.style instanceof Function?y.value.style(y.value):y.value.style),B=re(()=>{var T;const f=y.value.type||"default",p=L==null?void 0:L[`edge-${f}`];if(p)return p;let _=(T=y.value.template)!=null?T:l.value[f];if(typeof _=="string"&&K){const V=Object.keys(K.appContext.components);V&&V.includes(f)&&(_=wi(f,!1))}return _&&typeof _!="string"?_:(r.error(new Ne(Se.EDGE_TYPE_MISSING,_)),!1)}),{handlePointerDown:O}=mr({nodeId:X,handleId:D,type:b,isValidConnection:h,edgeUpdaterType:b,onEdgeUpdate:oe,onEdgeUpdateEnd:ae});return()=>{var dt;const f=d(y.value.source),p=d(y.value.target),_="pathOptions"in y.value?y.value.pathOptions:{};if(!f&&!p)return r.error(new Ne(Se.EDGE_SOURCE_TARGET_MISSING,y.value.id,y.value.source,y.value.target)),null;if(!f)return r.error(new Ne(Se.EDGE_SOURCE_MISSING,y.value.id,y.value.source)),null;if(!p)return r.error(new Ne(Se.EDGE_TARGET_MISSING,y.value.id,y.value.target)),null;if(!y.value||y.value.hidden||f.hidden||p.hidden)return null;let T;o.value===Qe.Strict?T=f.handleBounds.source:T=[...f.handleBounds.source||[],...f.handleBounds.target||[]];const V=ni(T,y.value.sourceHandle);let Z;o.value===Qe.Strict?Z=p.handleBounds.target:Z=[...p.handleBounds.target||[],...p.handleBounds.source||[]];const P=ni(Z,y.value.targetHandle),G=(V==null?void 0:V.position)||q.Bottom,j=(P==null?void 0:P.position)||q.Top,{x:se,y:de}=Nt(f,V,G),{x:Ce,y:$e}=Nt(p,P,j);return y.value.sourceX=se,y.value.sourceY=de,y.value.targetX=Ce,y.value.targetY=$e,me("g",fe($({ref:ee,key:e.id,"data-id":e.id,class:["vue-flow__edge",`vue-flow__edge-${B.value===!1?"default":y.value.type||"default"}`,a.value,k.value,{updating:Y.value,selected:y.value.selected,animated:y.value.animated,inactive:!m.value&&!M.value.edgeClick.hasListeners()}],tabIndex:x.value?0:void 0,"aria-label":y.value.ariaLabel===null?void 0:(dt=y.value.ariaLabel)!=null?dt:`Edge from ${y.value.source} to ${y.value.target}`,"aria-describedby":x.value?`${Qi}-${t}`:void 0,"aria-roledescription":"edge",role:x.value?"group":"img"},y.value.domAttributes),{onClick:F,onContextmenu:W,onDblclick:ce,onMouseenter:pe,onMousemove:le,onMouseleave:he,onKeyDown:x.value?v:void 0}),[J.value?null:me(B.value===!1?l.value.default:B.value,$({id:e.id,sourceNode:f,targetNode:p,source:y.value.source,target:y.value.target,type:y.value.type,updatable:I.value,selected:y.value.selected,animated:y.value.animated,label:y.value.label,labelStyle:y.value.labelStyle,labelShowBg:y.value.labelShowBg,labelBgStyle:y.value.labelBgStyle,labelBgPadding:y.value.labelBgPadding,labelBgBorderRadius:y.value.labelBgBorderRadius,data:y.value.data,events:$($({},y.value.events),z),style:A.value,markerStart:`url('#${Gt(y.value.markerStart,t)}')`,markerEnd:`url('#${Gt(y.value.markerEnd,t)}')`,sourcePosition:G,targetPosition:j,sourceX:se,sourceY:de,targetX:Ce,targetY:$e,sourceHandleId:y.value.sourceHandle,targetHandleId:y.value.targetHandle,interactionWidth:y.value.interactionWidth},_)),[I.value==="source"||I.value===!0?[me("g",{onMousedown:ne,onMouseenter:U,onMouseout:Q},me(vi,{position:G,centerX:se,centerY:de,radius:i.value,type:"source","data-type":"source"}))]:null,I.value==="target"||I.value===!0?[me("g",{onMousedown:ie,onMouseenter:U,onMouseout:Q},me(vi,{position:j,centerX:Ce,centerY:$e,radius:i.value,type:"target","data-type":"target"}))]:null]])};function U(){Y.value=!0}function Q(){Y.value=!1}function oe(f,p){N.update({event:f,edge:y.value,connection:p})}function ae(f){N.updateEnd({event:f,edge:y.value}),J.value=!1}function H(f,p){var _;f.button===0&&(J.value=!0,X.value=p?y.value.target:y.value.source,D.value=(_=p?y.value.targetHandle:y.value.sourceHandle)!=null?_:null,b.value=p?"target":"source",N.updateStart({event:f,edge:y.value}),O(f))}function F(f){var p;const _={event:f,edge:y.value};m.value&&(s.value=!1,y.value.selected&&g.value?(u([y.value]),(p=ee.value)==null||p.blur()):n([y.value])),N.click(_)}function W(f){N.contextMenu({event:f,edge:y.value})}function ce(f){N.doubleClick({event:f,edge:y.value})}function pe(f){N.mouseEnter({event:f,edge:y.value})}function le(f){N.mouseMove({event:f,edge:y.value})}function he(f){N.mouseLeave({event:f,edge:y.value})}function ne(f){H(f,!0)}function ie(f){H(f,!1)}function v(f){var p;!E.value&&ji.includes(f.key)&&m.value&&(f.key==="Escape"?((p=ee.value)==null||p.blur(),u([c(e.id)])):n([c(e.id)]))}}}),$d=kd,Dd=be({name:"ConnectionLine",compatConfig:{MODE:3},setup(){var e;const{id:t,connectionMode:n,connectionStartHandle:o,connectionEndHandle:i,connectionPosition:r,connectionLineType:s,connectionLineStyle:a,connectionLineOptions:l,connectionStatus:u,viewport:c,findNode:d}=_e(),h=(e=Ct(Pn))==null?void 0:e["connection-line"],g=re(()=>{var M;return d((M=o.value)==null?void 0:M.nodeId)}),E=re(()=>{var y;var M;return(y=d((M=i.value)==null?void 0:M.nodeId))!=null?y:null}),w=re(()=>({x:(r.value.x-c.value.x)/c.value.zoom,y:(r.value.y-c.value.y)/c.value.zoom})),S=re(()=>l.value.markerStart?`url(#${Gt(l.value.markerStart,t)})`:""),C=re(()=>l.value.markerEnd?`url(#${Gt(l.value.markerEnd,t)})`:"");return()=>{var A,B,O,U,Q,oe,ae,H,F;var M,y,N;if(!g.value||!o.value)return null;const z=o.value.id,L=o.value.type,K=g.value.handleBounds;let Y=(A=K==null?void 0:K[L])!=null?A:[];if(n.value===Qe.Loose){const W=(B=K==null?void 0:K[L==="source"?"target":"source"])!=null?B:[];Y=[...Y,...W]}if(!Y)return null;const J=(O=z?Y.find(W=>W.id===z):Y[0])!=null?O:null,X=(U=J==null?void 0:J.position)!=null?U:q.Top,{x:D,y:b}=Nt(g.value,J,X);let ee=null;E.value&&(n.value===Qe.Strict?ee=((M=E.value.handleBounds[L==="source"?"target":"source"])==null?void 0:M.find(W=>{var ce;return W.id===((ce=i.value)==null?void 0:ce.id)}))||null:ee=((y=[...(Q=E.value.handleBounds.source)!=null?Q:[],...(oe=E.value.handleBounds.target)!=null?oe:[]])==null?void 0:y.find(W=>{var ce;return W.id===((ce=i.value)==null?void 0:ce.id)}))||null);const m=(ae=(N=i.value)==null?void 0:N.position)!=null?ae:X?ro[X]:null;if(!X||!m)return null;const I=(F=(H=s.value)!=null?H:l.value.type)!=null?F:tt.Bezier;let x="";const k={sourceX:D,sourceY:b,sourcePosition:X,targetX:w.value.x,targetY:w.value.y,targetPosition:m};return I===tt.Bezier?[x]=Sr(k):I===tt.Step?[x]=ao(fe($({},k),{borderRadius:0})):I===tt.SmoothStep?[x]=ao(k):I===tt.SimpleBezier?[x]=Nr(k):x=`M${D},${b} ${w.value.x},${w.value.y}`,me("svg",{class:"vue-flow__edges vue-flow__connectionline vue-flow__container"},me("g",{class:"vue-flow__connection"},h?me(h,{sourceX:D,sourceY:b,sourcePosition:X,targetX:w.value.x,targetY:w.value.y,targetPosition:m,sourceNode:g.value,sourceHandle:J,targetNode:E.value,targetHandle:ee,markerEnd:C.value,markerStart:S.value,connectionStatus:u.value}):me("path",{d:x,class:[l.value.class,u.value,"vue-flow__connection-path"],style:$($({},a.value),l.value.style),"marker-end":C.value,"marker-start":S.value})))}}}),Ad=Dd,Od=["id","markerWidth","markerHeight","markerUnits","orient"],zd={name:"MarkerType",compatConfig:{MODE:3}},Bd=be(fe($({},zd),{props:{id:{},type:{},color:{default:"none"},width:{default:12.5},height:{default:12.5},markerUnits:{default:"strokeWidth"},orient:{default:"auto-start-reverse"},strokeWidth:{default:1}},setup(e){return(t,n)=>(ge(),ye("marker",{id:t.id,class:"vue-flow__arrowhead",viewBox:"-10 -10 20 20",refX:"0",refY:"0",markerWidth:`${t.width}`,markerHeight:`${t.height}`,markerUnits:t.markerUnits,orient:t.orient},[t.type===te(oo).ArrowClosed?(ge(),ye("polyline",{key:0,style:Ue({stroke:t.color,fill:t.color,strokeWidth:t.strokeWidth}),"stroke-linecap":"round","stroke-linejoin":"round",points:"-5,-4 0,0 -5,4 -5,-4"},null,4)):Be("",!0),t.type===te(oo).Arrow?(ge(),ye("polyline",{key:1,style:Ue({stroke:t.color,strokeWidth:t.strokeWidth}),"stroke-linecap":"round","stroke-linejoin":"round",fill:"none",points:"-5,-4 0,0 -5,4"},null,4)):Be("",!0)],8,Od))}})),Vd={class:"vue-flow__marker vue-flow__container","aria-hidden":"true"},Rd={name:"MarkerDefinitions",compatConfig:{MODE:3}},Hd=be(fe($({},Rd),{setup(e){const{id:t,edges:n,connectionLineOptions:o,defaultMarkerColor:i}=_e(),r=re(()=>{const s=new Set,a=[],l=u=>{if(u){const c=Gt(u,t);s.has(c)||(typeof u=="object"?a.push(fe($({},u),{id:c,color:u.color||i.value})):a.push({id:c,color:i.value,type:u}),s.add(c))}};for(const u of[o.value.markerEnd,o.value.markerStart])l(u);for(const u of n.value)for(const c of[u.markerStart,u.markerEnd])l(c);return a.sort((u,c)=>u.id.localeCompare(c.id))});return(s,a)=>(ge(),ye("svg",Vd,[st("defs",null,[(ge(!0),ye(Ve,null,lo(r.value,l=>(ge(),at(Bd,{id:l.id,key:l.id,type:l.type,color:l.color,width:l.width,height:l.height,markerUnits:l.markerUnits,"stroke-width":l.strokeWidth,orient:l.orient},null,8,["id","type","color","width","height","markerUnits","stroke-width","orient"]))),128))])]))}})),Ld={name:"Edges",compatConfig:{MODE:3}},Fd=be(fe($({},Ld),{setup(e){const{findNode:t,getEdges:n,elevateEdgesOnSelect:o}=_e();return(i,r)=>(ge(),ye(Ve,null,[Fe(Hd),(ge(!0),ye(Ve,null,lo(te(n),s=>(ge(),ye("svg",{key:s.id,class:"vue-flow__edges vue-flow__container",style:Ue({zIndex:te(sc)(s,te(t),te(o))})},[Fe(te($d),{id:s.id},null,8,["id"])],4))),128)),Fe(te(Ad))],64))}})),Yd=be({name:"Node",compatConfig:{MODE:3},props:["id","resizeObserver"],setup(e){const{id:t,noPanClassName:n,selectNodesOnDrag:o,nodesSelectionActive:i,multiSelectionActive:r,emits:s,removeSelectedNodes:a,addSelectedNodes:l,updateNodeDimensions:u,onUpdateNodeInternals:c,getNodeTypes:d,nodeExtent:h,elevateNodesOnSelect:g,disableKeyboardA11y:E,ariaLiveMessage:w,snapToGrid:S,snapGrid:C,nodeDragThreshold:M,nodesDraggable:y,elementsSelectable:N,nodesConnectable:z,nodesFocusable:L,hooks:K}=_e(),Y=Ee(null);bt(vr,Y),bt(gr,e.id);const J=Ct(Pn),X=Mt(),D=wr(),{node:b,parentNode:ee}=_r(e.id),{emit:m,on:I}=Nc(b,s),x=we(()=>typeof b.draggable=="undefined"?y.value:b.draggable),k=we(()=>typeof b.selectable=="undefined"?N.value:b.selectable),A=we(()=>typeof b.connectable=="undefined"?z.value:b.connectable),B=we(()=>typeof b.focusable=="undefined"?L.value:b.focusable),O=re(()=>k.value||x.value||K.value.nodeClick.hasListeners()||K.value.nodeDoubleClick.hasListeners()||K.value.nodeMouseEnter.hasListeners()||K.value.nodeMouseMove.hasListeners()||K.value.nodeMouseLeave.hasListeners()),U=we(()=>!!b.dimensions.width&&!!b.dimensions.height),Q=re(()=>{const p=b.type||"default",_=J==null?void 0:J[`node-${p}`];if(_)return _;let T=b.template||d.value[p];if(typeof T=="string"&&X){const V=Object.keys(X.appContext.components);V&&V.includes(p)&&(T=wi(p,!1))}return T&&typeof T!="string"?T:(s.error(new Ne(Se.NODE_TYPE_MISSING,T)),!1)}),oe=pr({id:e.id,el:Y,disabled:()=>!x.value,selectable:k,dragHandle:()=>b.dragHandle,onStart(p){m.dragStart(p)},onDrag(p){m.drag(p)},onStop(p){m.dragStop(p)},onClick(p){v(p)}}),ae=re(()=>b.class instanceof Function?b.class(b):b.class),H=re(()=>{const p=(b.style instanceof Function?b.style(b):b.style)||{},_=b.width instanceof Function?b.width(b):b.width,T=b.height instanceof Function?b.height(b):b.height;return!p.width&&_&&(p.width=typeof _=="string"?_:`${_}px`),!p.height&&T&&(p.height=typeof T=="string"?T:`${T}px`),p}),F=we(()=>{var p,_;return Number((_=(p=b.zIndex)!=null?p:H.value.zIndex)!=null?_:0)});return c(p=>{(p.includes(e.id)||!p.length)&&ce()}),et(()=>{ve(()=>b.hidden,(p=!1,_,T)=>{!p&&Y.value&&(e.resizeObserver.observe(Y.value),T(()=>{Y.value&&e.resizeObserver.unobserve(Y.value)}))},{immediate:!0,flush:"post"})}),ve([()=>b.type,()=>b.sourcePosition,()=>b.targetPosition],()=>{Ge(()=>{u([{id:e.id,nodeElement:Y.value,forceUpdate:!0}])})}),ve([()=>b.position.x,()=>b.position.y,()=>{var p;return(p=ee.value)==null?void 0:p.computedPosition.x},()=>{var p;return(p=ee.value)==null?void 0:p.computedPosition.y},()=>{var p;return(p=ee.value)==null?void 0:p.computedPosition.z},F,()=>b.selected,()=>b.dimensions.height,()=>b.dimensions.width,()=>{var p;return(p=ee.value)==null?void 0:p.dimensions.height},()=>{var p;return(p=ee.value)==null?void 0:p.dimensions.width}],([p,_,T,V,Z,P])=>{const G={x:p,y:_,z:P+(g.value&&b.selected?1e3:0)};typeof T!="undefined"&&typeof V!="undefined"?b.computedPosition=ec({x:T,y:V,z:Z},G):b.computedPosition=G},{flush:"post",immediate:!0}),ve([()=>b.extent,h],([p,_],[T,V])=>{(p!==T||_!==V)&&W()}),b.extent==="parent"||typeof b.extent=="object"&&"range"in b.extent&&b.extent.range==="parent"?Wn(()=>U).toBe(!0).then(W):W(),()=>{var p,_;return b.hidden?null:me("div",fe($({ref:Y,"data-id":b.id,class:["vue-flow__node",`vue-flow__node-${Q.value===!1?"default":b.type||"default"}`,{[n.value]:x.value,dragging:oe==null?void 0:oe.value,draggable:x.value,selected:b.selected,selectable:k.value,parent:b.isParent},ae.value],style:$({visibility:U.value?"visible":"hidden",zIndex:(p=b.computedPosition.z)!=null?p:F.value,transform:`translate(${b.computedPosition.x}px,${b.computedPosition.y}px)`,pointerEvents:O.value?"all":"none"},H.value),tabIndex:B.value?0:void 0,role:B.value?"group":void 0,"aria-describedby":E.value?void 0:`${Ji}-${t}`,"aria-label":b.ariaLabel,"aria-roledescription":"node"},b.domAttributes),{onMouseenter:pe,onMousemove:le,onMouseleave:he,onContextmenu:ne,onClick:v,onDblclick:ie,onKeydown:f}),[me(Q.value===!1?d.value.default:Q.value,{id:b.id,type:b.type,data:b.data,events:$($({},b.events),I),selected:b.selected,resizing:b.resizing,dragging:oe.value,connectable:A.value,position:b.computedPosition,dimensions:b.dimensions,isValidTargetPos:b.isValidTargetPos,isValidSourcePos:b.isValidSourcePos,parent:b.parentNode,parentNodeId:b.parentNode,zIndex:(_=b.computedPosition.z)!=null?_:F.value,targetPosition:b.targetPosition,sourcePosition:b.sourcePosition,label:b.label,dragHandle:b.dragHandle,onUpdateNodeInternals:ce})])};function W(){const p=b.computedPosition,{computedPosition:_,position:T}=_o(b,S.value?In(p,C.value):p,s.error,h.value,ee.value);(b.computedPosition.x!==_.x||b.computedPosition.y!==_.y)&&(b.computedPosition=$($({},b.computedPosition),_)),(b.position.x!==T.x||b.position.y!==T.y)&&(b.position=T)}function ce(){Y.value&&u([{id:e.id,nodeElement:Y.value,forceUpdate:!0}])}function pe(p){oe!=null&&oe.value||m.mouseEnter({event:p,node:b})}function le(p){oe!=null&&oe.value||m.mouseMove({event:p,node:b})}function he(p){oe!=null&&oe.value||m.mouseLeave({event:p,node:b})}function ne(p){return m.contextMenu({event:p,node:b})}function ie(p){return m.doubleClick({event:p,node:b})}function v(p){k.value&&(!o.value||!x.value||M.value>0)&&so(b,r.value,l,a,i,!1,Y.value),m.click({event:p,node:b})}function f(p){if(!(io(p)||E.value))if(ji.includes(p.key)&&k.value){const _=p.key==="Escape";so(b,r.value,l,a,i,_,Y.value)}else x.value&&b.selected&&_t[p.key]&&(p.preventDefault(),w.value=`Moved selected node ${p.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~b.position.x}, y: ${~~b.position.y}`,D({x:_t[p.key].x,y:_t[p.key].y},p.shiftKey))}}}),Gd=Yd,Xd={height:"0",width:"0"},Ud={name:"EdgeLabelRenderer",compatConfig:{MODE:3}},of=be(fe($({},Ud),{setup(e){const{viewportRef:t}=_e(),n=we(()=>{var o;return(o=t.value)==null?void 0:o.getElementsByClassName("vue-flow__edge-labels")[0]});return(o,i)=>(ge(),ye("svg",null,[(ge(),ye("foreignObject",Xd,[(ge(),at(Ar,{to:n.value,disabled:!n.value},[Xe(o.$slots,"default")],8,["to","disabled"]))]))]))}}));function Zd(e={includeHiddenNodes:!1}){const{nodes:t}=_e();return re(()=>{if(t.value.length===0)return!1;for(const n of t.value)if((e.includeHiddenNodes||!n.hidden)&&((n==null?void 0:n.handleBounds)===void 0||n.dimensions.width===0||n.dimensions.height===0))return!1;return!0})}const Wd={class:"vue-flow__nodes vue-flow__container"},Kd={name:"Nodes",compatConfig:{MODE:3}},qd=be(fe($({},Kd),{setup(e){const{getNodes:t,updateNodeDimensions:n,emits:o}=_e(),i=Zd(),r=Ee();return ve(i,s=>{s&&Ge(()=>{o.nodesInitialized(t.value)})},{immediate:!0}),et(()=>{r.value=new ResizeObserver(s=>{const a=s.map(l=>({id:l.target.getAttribute("data-id"),nodeElement:l.target,forceUpdate:!0}));Ge(()=>n(a))})}),_i(()=>{var s;return(s=r.value)==null?void 0:s.disconnect()}),(s,a)=>(ge(),ye("div",Wd,[r.value?(ge(!0),ye(Ve,{key:0},lo(te(t),(l,u,c,d)=>{const h=[l.id];if(d&&d.key===l.id&&Lr(d,h))return d;const g=(ge(),at(te(Gd),{id:l.id,key:l.id,"resize-observer":r.value},null,8,["id","resize-observer"]));return g.memo=h,g},a,0),128)):Be("",!0)]))}}));function Jd(){const{emits:e}=_e();et(()=>{if(hr()){const t=document.querySelector(".vue-flow__pane");t&&window.getComputedStyle(t).zIndex!=="1"&&e.error(new Ne(Se.MISSING_STYLES))}})}const Qd=st("div",{class:"vue-flow__edge-labels"},null,-1),jd={name:"VueFlow",compatConfig:{MODE:3}},rf=be(fe($({},jd),{props:{id:{},modelValue:{},nodes:{},edges:{},edgeTypes:{},nodeTypes:{},connectionMode:{},connectionLineType:{},connectionLineStyle:{default:void 0},connectionLineOptions:{default:void 0},connectionRadius:{},isValidConnection:{type:[Function,null],default:void 0},deleteKeyCode:{default:void 0},selectionKeyCode:{type:[Boolean,null],default:void 0},multiSelectionKeyCode:{default:void 0},zoomActivationKeyCode:{default:void 0},panActivationKeyCode:{default:void 0},snapToGrid:{type:Boolean,default:void 0},snapGrid:{},onlyRenderVisibleElements:{type:Boolean,default:void 0},edgesUpdatable:{type:[Boolean,String],default:void 0},nodesDraggable:{type:Boolean,default:void 0},nodesConnectable:{type:Boolean,default:void 0},nodeDragThreshold:{},elementsSelectable:{type:Boolean,default:void 0},selectNodesOnDrag:{type:Boolean,default:void 0},panOnDrag:{type:[Boolean,Array],default:void 0},minZoom:{},maxZoom:{},defaultViewport:{},translateExtent:{},nodeExtent:{},defaultMarkerColor:{},zoomOnScroll:{type:Boolean,default:void 0},zoomOnPinch:{type:Boolean,default:void 0},panOnScroll:{type:Boolean,default:void 0},panOnScrollSpeed:{},panOnScrollMode:{},paneClickDistance:{},zoomOnDoubleClick:{type:Boolean,default:void 0},preventScrolling:{type:Boolean,default:void 0},selectionMode:{},edgeUpdaterRadius:{},fitViewOnInit:{type:Boolean,default:void 0},connectOnClick:{type:Boolean,default:void 0},applyDefault:{type:Boolean,default:void 0},autoConnect:{type:[Boolean,Function],default:void 0},noDragClassName:{},noWheelClassName:{},noPanClassName:{},defaultEdgeOptions:{},elevateEdgesOnSelect:{type:Boolean,default:void 0},elevateNodesOnSelect:{type:Boolean,default:void 0},disableKeyboardA11y:{type:Boolean,default:void 0},edgesFocusable:{type:Boolean,default:void 0},nodesFocusable:{type:Boolean,default:void 0},autoPanOnConnect:{type:Boolean,default:void 0},autoPanOnNodeDrag:{type:Boolean,default:void 0},autoPanSpeed:{}},emits:["nodesChange","edgesChange","nodesInitialized","paneReady","init","updateNodeInternals","error","connect","connectStart","connectEnd","clickConnectStart","clickConnectEnd","moveStart","move","moveEnd","selectionDragStart","selectionDrag","selectionDragStop","selectionContextMenu","selectionStart","selectionEnd","viewportChangeStart","viewportChange","viewportChangeEnd","paneScroll","paneClick","paneContextMenu","paneMouseEnter","paneMouseMove","paneMouseLeave","edgeUpdate","edgeContextMenu","edgeMouseEnter","edgeMouseMove","edgeMouseLeave","edgeDoubleClick","edgeClick","edgeUpdateStart","edgeUpdateEnd","nodeContextMenu","nodeMouseEnter","nodeMouseMove","nodeMouseLeave","nodeDoubleClick","nodeClick","nodeDragStart","nodeDrag","nodeDragStop","miniMapNodeClick","miniMapNodeDoubleClick","miniMapNodeMouseEnter","miniMapNodeMouseMove","miniMapNodeMouseLeave","update:modelValue","update:nodes","update:edges"],setup(e,{expose:t,emit:n}){const o=e,i=zr(),r=An(o,"modelValue",n),s=An(o,"nodes",n),a=An(o,"edges",n),l=_e(o),u=Pc({modelValue:r,nodes:s,edges:a},o,l);return kc(n,l.hooks),Id(),Jd(),bt(Pn,i),Br(u),t(l),(c,d)=>(ge(),ye("div",{ref:te(l).vueFlowRef,class:"vue-flow"},[Fe(xd,null,{default:Xn(()=>[Fe(Fd),Qd,Fe(qd),Xe(c.$slots,"zoom-pane")]),_:3}),Xe(c.$slots,"default"),Fe(Md)],512))}})),ef={name:"Panel",compatConfig:{MODE:3}},sf=be(fe($({},ef),{props:{position:{}},setup(e){const t=e,{userSelectionActive:n}=_e(),o=re(()=>`${t.position}`.split("-"));return(i,r)=>(ge(),ye("div",{class:wt(["vue-flow__panel",o.value]),style:Ue({pointerEvents:te(n)?"none":"all"})},[Xe(i.$slots,"default")],6))}}));function af(e={}){const{handleType:t,handleId:n,nodeId:o,onConnect:i,onDisconnect:r}=e,{connectionLookup:s}=_e(),a=yr(),l=Ee(null),u=Ee(),c=re(()=>{var w;const d=(w=ue(o))!=null?w:a,h=ue(t),g=ue(n);let E="";return h&&(E=g?`-${h}-${g}`:`-${h}`),`${d}${E}`});return ve(()=>s.value.get(c.value),d=>{yc(u.value,d)||(u.value=d)},{immediate:!0}),ve([u,()=>typeof i!="undefined",()=>typeof r!="undefined"],([d=new Map])=>{l.value&&l.value!==d&&(li(l.value,d,r),li(d,l.value,i)),l.value=d},{immediate:!0}),re(()=>u.value?Array.from(u.value.values()):[])}function lf(e){const{findNode:t}=_e();return re({get(){const n=ue(e);if(!Array.isArray(n)){const i=t(n);return i?{id:i.id,type:i.type,data:i.data}:null}const o=[];for(const i of n){const r=t(i);r&&o.push({id:r.id,type:r.type,data:r.data})}return o},set(){It("You are trying to set node data via useNodesData. This is not supported.")}})}export{q as P,sf as _,rf as a,af as b,xn as c,lf as d,Dn as e,of as f,ao as g,_e as u};