@lunora/studio 1.0.0-alpha.96 → 1.0.0-alpha.97
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/standalone/{chunk-ESIEIGR3.js → chunk-2KRXOCZ2.js} +1 -1
- package/dist/standalone/{chunk-2YGNOZPZ.js → chunk-3626PHEZ.js} +1 -1
- package/dist/standalone/{chunk-2FRLB5SB.js → chunk-3IF75YS7.js} +1 -1
- package/dist/standalone/{chunk-44T6NSYY.js → chunk-3SGYSFRC.js} +1 -1
- package/dist/standalone/{chunk-WPERYUTG.js → chunk-4EHNOASW.js} +1 -1
- package/dist/standalone/{chunk-ZCPQGIQW.js → chunk-5A7NIX77.js} +1 -1
- package/dist/standalone/{chunk-34WN3PEC.js → chunk-5L2VKBAJ.js} +1 -1
- package/dist/standalone/{chunk-YOKL7XDT.js → chunk-5L63KFHD.js} +1 -1
- package/dist/standalone/{chunk-LZGOETI3.js → chunk-6F7KP54M.js} +1 -1
- package/dist/standalone/{chunk-DXJWFZFI.js → chunk-73B3T2SA.js} +1 -1
- package/dist/standalone/{chunk-VWKQ6X2S.js → chunk-7CWPU3LW.js} +1 -1
- package/dist/standalone/{chunk-IGBUUFPN.js → chunk-A6NAMYVS.js} +1 -1
- package/dist/standalone/{chunk-57BUSXRD.js → chunk-ATLV7KWK.js} +1 -1
- package/dist/standalone/{chunk-NSUBZT43.js → chunk-BLHSTFG3.js} +1 -1
- package/dist/standalone/{chunk-ETU7KIO4.js → chunk-C2ZFQARQ.js} +1 -1
- package/dist/standalone/{chunk-WQJOV6L5.js → chunk-CXBXUT5A.js} +2 -2
- package/dist/standalone/{chunk-HJC67CE4.js → chunk-D264UAKY.js} +1 -1
- package/dist/standalone/{chunk-AUXEGD24.js → chunk-DDO5EGID.js} +1 -1
- package/dist/standalone/{chunk-QNQTMABQ.js → chunk-E3Z4QXAD.js} +1 -1
- package/dist/standalone/{chunk-I7FF5IIJ.js → chunk-EZKBI7SZ.js} +1 -1
- package/dist/standalone/{chunk-UZHRBXA7.js → chunk-FHZ5WDTU.js} +1 -1
- package/dist/standalone/{chunk-WOBRLIBX.js → chunk-FXBBFE7Y.js} +1 -1
- package/dist/standalone/{chunk-BAJXBWFJ.js → chunk-G2O3XP7Y.js} +1 -1
- package/dist/standalone/{chunk-BLJANR7J.js → chunk-H5ZYPSLB.js} +1 -1
- package/dist/standalone/{chunk-J4POSI6T.js → chunk-HH5CZ6KD.js} +1 -1
- package/dist/standalone/{chunk-UE6A3CRB.js → chunk-I7V54EDS.js} +1 -1
- package/dist/standalone/{chunk-EYIEO5QZ.js → chunk-II64XEZV.js} +1 -1
- package/dist/standalone/{chunk-TKFI6XYV.js → chunk-IZFPJXB3.js} +1 -1
- package/dist/standalone/{chunk-D7B2KFWM.js → chunk-J4UYSDWF.js} +1 -1
- package/dist/standalone/{chunk-TVRCPIAV.js → chunk-JNY7CFF4.js} +1 -1
- package/dist/standalone/{chunk-TAWXVVAZ.js → chunk-KP6VHTO4.js} +1 -1
- package/dist/standalone/{chunk-CFXL7MQK.js → chunk-LAEO6D34.js} +1 -1
- package/dist/standalone/{chunk-QVPKPH2T.js → chunk-LHAHIDNT.js} +1 -1
- package/dist/standalone/{chunk-LT236J7E.js → chunk-M2M3RYJU.js} +1 -1
- package/dist/standalone/{chunk-KGPNIBOV.js → chunk-M3Z2YAHD.js} +1 -1
- package/dist/standalone/{chunk-TGQH54CS.js → chunk-MW5YIENZ.js} +1 -1
- package/dist/standalone/{chunk-2IFGRS6R.js → chunk-NBANYYGB.js} +1 -1
- package/dist/standalone/{chunk-3WISGFZ7.js → chunk-NCKRVNF2.js} +1 -1
- package/dist/standalone/{chunk-JRAUQ4L2.js → chunk-NDO6YSEG.js} +1 -1
- package/dist/standalone/{chunk-DGO2XJOT.js → chunk-NJRW66LJ.js} +1 -1
- package/dist/standalone/{chunk-LV5UVTHL.js → chunk-OKZP3YY3.js} +1 -1
- package/dist/standalone/{chunk-NQ4FA65F.js → chunk-ON2FIVI2.js} +1 -1
- package/dist/standalone/{chunk-U7ILDM43.js → chunk-OQIGV6FX.js} +1 -1
- package/dist/standalone/{chunk-E2C6CK7F.js → chunk-OZA2RA45.js} +1 -1
- package/dist/standalone/{chunk-YEGFNH56.js → chunk-P33WK7YI.js} +1 -1
- package/dist/standalone/{chunk-LZ2RREQV.js → chunk-PKWJ7UOG.js} +1 -1
- package/dist/standalone/{chunk-GL7YL3VF.js → chunk-PLFTCTMX.js} +1 -1
- package/dist/standalone/{chunk-Q2QILUP4.js → chunk-PMGTIUU2.js} +1 -1
- package/dist/standalone/{chunk-SFQX7RUJ.js → chunk-QC4T2L6I.js} +1 -1
- package/dist/standalone/{chunk-U5MIBWJD.js → chunk-QEVFPILV.js} +1 -1
- package/dist/standalone/{chunk-ECF57FQF.js → chunk-QQYX5WN4.js} +1 -1
- package/dist/standalone/{chunk-7URLLMST.js → chunk-S7ZOM3NK.js} +1 -1
- package/dist/standalone/{chunk-AQZMKZMP.js → chunk-SPE3AB54.js} +1 -1
- package/dist/standalone/{chunk-7KU3LR7G.js → chunk-STESBRLN.js} +1 -1
- package/dist/standalone/{chunk-ZURV2PEP.js → chunk-SZXVX6PY.js} +1 -1
- package/dist/standalone/{chunk-OZK52CH2.js → chunk-UYPXC3OO.js} +1 -1
- package/dist/standalone/{chunk-3PXUIMP2.js → chunk-VH2IO643.js} +1 -1
- package/dist/standalone/{chunk-BMYWOK5Q.js → chunk-WLXH4ECM.js} +1 -1
- package/dist/standalone/{chunk-2NO45MRI.js → chunk-XPOUF2XH.js} +1 -1
- package/dist/standalone/{chunk-MVJMAEP4.js → chunk-YP7WZ6YM.js} +1 -1
- package/dist/standalone/{chunk-FA6AR5QU.js → chunk-YZIR7PL5.js} +1 -1
- package/dist/standalone/studio.js +1 -1
- package/package.json +6 -6
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as je,b as _i}from"./chunk-GMR677FL.js";import{a as Ni,b as Mi,c as Ii,f as xn}from"./chunk-4KIQ5RLS.js";import{e as wi,k as bi}from"./chunk-QBWRC5YX.js";import{a as fo,b as ho,c as Si,d as vi,e as yn,g as Ei,h as Ci,i as ht}from"./chunk-4UOFSGUS.js";import{R as xi}from"./chunk-CFPZYHPY.js";import{b as Ll}from"./chunk-T6VMSOBB.js";import{a as Ol}from"./chunk-7QIFDWQV.js";import{c as uo}from"./chunk-FXCBF4XT.js";import{b as Ht}from"./chunk-THIXMMZD.js";import{d as Lt,o as mn}from"./chunk-IUYFXK4X.js";import{c as mi}from"./chunk-YEGFNH56.js";import{a as o,e as Le,f as lo,g as $l,h as yi,j as Je}from"./chunk-3XIESWL4.js";var ft=Le($l(),1);var A=Le(yi()),k=Le(lo());function ae(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,r;n<e.length;n++)(r=ae(e[n]))!==""&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}o(ae,"cc");var Hl={value:o(()=>{},"value")};function ki(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new wn(n)}o(ki,"dispatch");function wn(e){this._=e}o(wn,"Dispatch");function Bl(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");if(i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}o(Bl,"parseTypenames");wn.prototype=ki.prototype={constructor:wn,on:o(function(e,t){var n=this._,r=Bl(e+"",n),i,s=-1,a=r.length;if(arguments.length<2){for(;++s<a;)if((i=(e=r[s]).type)&&(i=Vl(n[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++s<a;)if(i=(e=r[s]).type)n[i]=Pi(n[i],e.name,t);else if(t==null)for(i in n)n[i]=Pi(n[i],e.name,null);return this},"on"),copy:o(function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new wn(e)},"copy"),call:o(function(e,t){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,s;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(s=this._[e],r=0,i=s.length;r<i;++r)s[r].value.apply(t,n)},"call"),apply:o(function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],i=0,s=r.length;i<s;++i)r[i].value.apply(t,n)},"apply")};function Vl(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}o(Vl,"get");function Pi(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=Hl,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}o(Pi,"set");var et=ki;var bn="http://www.w3.org/1999/xhtml",po={svg:"http://www.w3.org/2000/svg",xhtml:bn,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Me(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}o(Me,"default");function Fl(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===bn&&t.documentElement.namespaceURI===bn?t.createElement(e):t.createElementNS(n,e)}}o(Fl,"creatorInherit");function Wl(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}o(Wl,"creatorFixed");function Bt(e){var t=Me(e);return(t.local?Wl:Fl)(t)}o(Bt,"default");function Xl(){}o(Xl,"none");function He(e){return e==null?Xl:function(){return this.querySelector(e)}}o(He,"default");function go(e){typeof e!="function"&&(e=He(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var s=t[i],a=s.length,c=r[i]=new Array(a),l,u,d=0;d<a;++d)(l=s[d])&&(u=e.call(l,l.__data__,d,s))&&("__data__"in l&&(u.__data__=l.__data__),c[d]=u);return new ce(r,this._parents)}o(go,"default");function mo(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}o(mo,"array");function Yl(){return[]}o(Yl,"empty");function pt(e){return e==null?Yl:function(){return this.querySelectorAll(e)}}o(pt,"default");function Zl(e){return function(){return mo(e.apply(this,arguments))}}o(Zl,"arrayAll");function yo(e){typeof e=="function"?e=Zl(e):e=pt(e);for(var t=this._groups,n=t.length,r=[],i=[],s=0;s<n;++s)for(var a=t[s],c=a.length,l,u=0;u<c;++u)(l=a[u])&&(r.push(e.call(l,l.__data__,u,a)),i.push(l));return new ce(r,i)}o(yo,"default");function gt(e){return function(){return this.matches(e)}}o(gt,"default");function Sn(e){return function(t){return t.matches(e)}}o(Sn,"childMatcher");var Ul=Array.prototype.find;function ql(e){return function(){return Ul.call(this.children,e)}}o(ql,"childFind");function Kl(){return this.firstElementChild}o(Kl,"childFirst");function xo(e){return this.select(e==null?Kl:ql(typeof e=="function"?e:Sn(e)))}o(xo,"default");var Gl=Array.prototype.filter;function Ql(){return Array.from(this.children)}o(Ql,"children");function Jl(e){return function(){return Gl.call(this.children,e)}}o(Jl,"childrenFilter");function wo(e){return this.selectAll(e==null?Ql:Jl(typeof e=="function"?e:Sn(e)))}o(wo,"default");function bo(e){typeof e!="function"&&(e=gt(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var s=t[i],a=s.length,c=r[i]=[],l,u=0;u<a;++u)(l=s[u])&&e.call(l,l.__data__,u,s)&&c.push(l);return new ce(r,this._parents)}o(bo,"default");function Vt(e){return new Array(e.length)}o(Vt,"default");function So(){return new ce(this._enter||this._groups.map(Vt),this._parents)}o(So,"default");function Ft(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}o(Ft,"EnterNode");Ft.prototype={constructor:Ft,appendChild:o(function(e){return this._parent.insertBefore(e,this._next)},"appendChild"),insertBefore:o(function(e,t){return this._parent.insertBefore(e,t)},"insertBefore"),querySelector:o(function(e){return this._parent.querySelector(e)},"querySelector"),querySelectorAll:o(function(e){return this._parent.querySelectorAll(e)},"querySelectorAll")};function vo(e){return function(){return e}}o(vo,"default");function jl(e,t,n,r,i,s){for(var a=0,c,l=t.length,u=s.length;a<u;++a)(c=t[a])?(c.__data__=s[a],r[a]=c):n[a]=new Ft(e,s[a]);for(;a<l;++a)(c=t[a])&&(i[a]=c)}o(jl,"bindIndex");function eu(e,t,n,r,i,s,a){var c,l,u=new Map,d=t.length,f=s.length,h=new Array(d),g;for(c=0;c<d;++c)(l=t[c])&&(h[c]=g=a.call(l,l.__data__,c,t)+"",u.has(g)?i[c]=l:u.set(g,l));for(c=0;c<f;++c)g=a.call(e,s[c],c,s)+"",(l=u.get(g))?(r[c]=l,l.__data__=s[c],u.delete(g)):n[c]=new Ft(e,s[c]);for(c=0;c<d;++c)(l=t[c])&&u.get(h[c])===l&&(i[c]=l)}o(eu,"bindKey");function tu(e){return e.__data__}o(tu,"datum");function Eo(e,t){if(!arguments.length)return Array.from(this,tu);var n=t?eu:jl,r=this._parents,i=this._groups;typeof e!="function"&&(e=vo(e));for(var s=i.length,a=new Array(s),c=new Array(s),l=new Array(s),u=0;u<s;++u){var d=r[u],f=i[u],h=f.length,g=nu(e.call(d,d&&d.__data__,u,r)),p=g.length,S=c[u]=new Array(p),b=a[u]=new Array(p),y=l[u]=new Array(h);n(d,f,S,b,y,g,t);for(var v=0,m=0,w,N;v<p;++v)if(w=S[v]){for(v>=m&&(m=v+1);!(N=b[m])&&++m<p;);w._next=N||null}}return a=new ce(a,r),a._enter=c,a._exit=l,a}o(Eo,"default");function nu(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}o(nu,"arraylike");function Co(){return new ce(this._exit||this._groups.map(Vt),this._parents)}o(Co,"default");function _o(e,t,n){var r=this.enter(),i=this,s=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(i=t(i),i&&(i=i.selection())),n==null?s.remove():n(s),r&&i?r.merge(i).order():i}o(_o,"default");function No(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,s=r.length,a=Math.min(i,s),c=new Array(i),l=0;l<a;++l)for(var u=n[l],d=r[l],f=u.length,h=c[l]=new Array(f),g,p=0;p<f;++p)(g=u[p]||d[p])&&(h[p]=g);for(;l<i;++l)c[l]=n[l];return new ce(c,this._parents)}o(No,"default");function Mo(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],i=r.length-1,s=r[i],a;--i>=0;)(a=r[i])&&(s&&a.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(a,s),s=a);return this}o(Mo,"default");function Io(e){e||(e=ou);function t(f,h){return f&&h?e(f.__data__,h.__data__):!f-!h}o(t,"compareNode");for(var n=this._groups,r=n.length,i=new Array(r),s=0;s<r;++s){for(var a=n[s],c=a.length,l=i[s]=new Array(c),u,d=0;d<c;++d)(u=a[d])&&(l[d]=u);l.sort(t)}return new ce(i,this._parents).order()}o(Io,"default");function ou(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}o(ou,"ascending");function Po(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}o(Po,"default");function ko(){return Array.from(this)}o(ko,"default");function Ao(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,s=r.length;i<s;++i){var a=r[i];if(a)return a}return null}o(Ao,"default");function To(){let e=0;for(let t of this)++e;return e}o(To,"default");function Do(){return!this.node()}o(Do,"default");function Ro(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i=t[n],s=0,a=i.length,c;s<a;++s)(c=i[s])&&e.call(c,c.__data__,s,i);return this}o(Ro,"default");function ru(e){return function(){this.removeAttribute(e)}}o(ru,"attrRemove");function iu(e){return function(){this.removeAttributeNS(e.space,e.local)}}o(iu,"attrRemoveNS");function su(e,t){return function(){this.setAttribute(e,t)}}o(su,"attrConstant");function au(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}o(au,"attrConstantNS");function cu(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}o(cu,"attrFunction");function lu(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)}}o(lu,"attrFunctionNS");function zo(e,t){var n=Me(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?iu:ru:typeof t=="function"?n.local?lu:cu:n.local?au:su)(n,t))}o(zo,"default");function Wt(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}o(Wt,"default");function uu(e){return function(){this.style.removeProperty(e)}}o(uu,"styleRemove");function du(e,t,n){return function(){this.style.setProperty(e,t,n)}}o(du,"styleConstant");function fu(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}o(fu,"styleFunction");function Oo(e,t,n){return arguments.length>1?this.each((t==null?uu:typeof t=="function"?fu:du)(e,t,n??"")):Be(this.node(),e)}o(Oo,"default");function Be(e,t){return e.style.getPropertyValue(t)||Wt(e).getComputedStyle(e,null).getPropertyValue(t)}o(Be,"styleValue");function hu(e){return function(){delete this[e]}}o(hu,"propertyRemove");function pu(e,t){return function(){this[e]=t}}o(pu,"propertyConstant");function gu(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}o(gu,"propertyFunction");function $o(e,t){return arguments.length>1?this.each((t==null?hu:typeof t=="function"?gu:pu)(e,t)):this.node()[e]}o($o,"default");function Ai(e){return e.trim().split(/^|\s+/)}o(Ai,"classArray");function Lo(e){return e.classList||new Ti(e)}o(Lo,"classList");function Ti(e){this._node=e,this._names=Ai(e.getAttribute("class")||"")}o(Ti,"ClassList");Ti.prototype={add:o(function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},"add"),remove:o(function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},"remove"),contains:o(function(e){return this._names.indexOf(e)>=0},"contains")};function Di(e,t){for(var n=Lo(e),r=-1,i=t.length;++r<i;)n.add(t[r])}o(Di,"classedAdd");function Ri(e,t){for(var n=Lo(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}o(Ri,"classedRemove");function mu(e){return function(){Di(this,e)}}o(mu,"classedTrue");function yu(e){return function(){Ri(this,e)}}o(yu,"classedFalse");function xu(e,t){return function(){(t.apply(this,arguments)?Di:Ri)(this,e)}}o(xu,"classedFunction");function Ho(e,t){var n=Ai(e+"");if(arguments.length<2){for(var r=Lo(this.node()),i=-1,s=n.length;++i<s;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t=="function"?xu:t?mu:yu)(n,t))}o(Ho,"default");function wu(){this.textContent=""}o(wu,"textRemove");function bu(e){return function(){this.textContent=e}}o(bu,"textConstant");function Su(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}o(Su,"textFunction");function Bo(e){return arguments.length?this.each(e==null?wu:(typeof e=="function"?Su:bu)(e)):this.node().textContent}o(Bo,"default");function vu(){this.innerHTML=""}o(vu,"htmlRemove");function Eu(e){return function(){this.innerHTML=e}}o(Eu,"htmlConstant");function Cu(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}o(Cu,"htmlFunction");function Vo(e){return arguments.length?this.each(e==null?vu:(typeof e=="function"?Cu:Eu)(e)):this.node().innerHTML}o(Vo,"default");function _u(){this.nextSibling&&this.parentNode.appendChild(this)}o(_u,"raise");function Fo(){return this.each(_u)}o(Fo,"default");function Nu(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}o(Nu,"lower");function Wo(){return this.each(Nu)}o(Wo,"default");function Xo(e){var t=typeof e=="function"?e:Bt(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}o(Xo,"default");function Mu(){return null}o(Mu,"constantNull");function Yo(e,t){var n=typeof e=="function"?e:Bt(e),r=t==null?Mu:typeof t=="function"?t:He(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}o(Yo,"default");function Iu(){var e=this.parentNode;e&&e.removeChild(this)}o(Iu,"remove");function Zo(){return this.each(Iu)}o(Zo,"default");function Pu(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}o(Pu,"selection_cloneShallow");function ku(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}o(ku,"selection_cloneDeep");function Uo(e){return this.select(e?ku:Pu)}o(Uo,"default");function qo(e){return arguments.length?this.property("__data__",e):this.node().__data__}o(qo,"default");function Au(e){return function(t){e.call(this,t,this.__data__)}}o(Au,"contextListener");function Tu(e){return e.trim().split(/^|\s+/).map(function(t){var n="",r=t.indexOf(".");return r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}o(Tu,"parseTypenames");function Du(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,s;n<i;++n)s=t[n],(!e.type||s.type===e.type)&&s.name===e.name?this.removeEventListener(s.type,s.listener,s.options):t[++r]=s;++r?t.length=r:delete this.__on}}}o(Du,"onRemove");function Ru(e,t,n){return function(){var r=this.__on,i,s=Au(t);if(r){for(var a=0,c=r.length;a<c;++a)if((i=r[a]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=s,i.options=n),i.value=t;return}}this.addEventListener(e.type,s,n),i={type:e.type,name:e.name,value:t,listener:s,options:n},r?r.push(i):this.__on=[i]}}o(Ru,"onAdd");function Ko(e,t,n){var r=Tu(e+""),i,s=r.length,a;if(arguments.length<2){var c=this.node().__on;if(c){for(var l=0,u=c.length,d;l<u;++l)for(i=0,d=c[l];i<s;++i)if((a=r[i]).type===d.type&&a.name===d.name)return d.value}return}for(c=t?Ru:Du,i=0;i<s;++i)this.each(c(r[i],t,n));return this}o(Ko,"default");function zi(e,t,n){var r=Wt(e),i=r.CustomEvent;typeof i=="function"?i=new i(t,n):(i=r.document.createEvent("Event"),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}o(zi,"dispatchEvent");function zu(e,t){return function(){return zi(this,e,t)}}o(zu,"dispatchConstant");function Ou(e,t){return function(){return zi(this,e,t.apply(this,arguments))}}o(Ou,"dispatchFunction");function Go(e,t){return this.each((typeof t=="function"?Ou:zu)(e,t))}o(Go,"default");function*Qo(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,s=r.length,a;i<s;++i)(a=r[i])&&(yield a)}o(Qo,"default");var Jo=[null];function ce(e,t){this._groups=e,this._parents=t}o(ce,"Selection");function Oi(){return new ce([[document.documentElement]],Jo)}o(Oi,"selection");function $u(){return this}o($u,"selection_selection");ce.prototype=Oi.prototype={constructor:ce,select:go,selectAll:yo,selectChild:xo,selectChildren:wo,filter:bo,data:Eo,enter:So,exit:Co,join:_o,merge:No,selection:$u,order:Mo,sort:Io,call:Po,nodes:ko,node:Ao,size:To,empty:Do,each:Ro,attr:zo,style:Oo,property:$o,classed:Ho,text:Bo,html:Vo,raise:Fo,lower:Wo,append:Xo,insert:Yo,remove:Zo,clone:Uo,datum:qo,on:Ko,dispatch:Go,[Symbol.iterator]:Qo};var De=Oi;function le(e){return typeof e=="string"?new ce([[document.querySelector(e)]],[document.documentElement]):new ce([[e]],Jo)}o(le,"default");function jo(e){let t;for(;t=e.sourceEvent;)e=t;return e}o(jo,"default");function fe(e,t){if(e=jo(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.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]}o(fe,"default");var $i={passive:!1},tt={capture:!0,passive:!1};function vn(e){e.stopImmediatePropagation()}o(vn,"nopropagation");function Re(e){e.preventDefault(),e.stopImmediatePropagation()}o(Re,"default");function mt(e){var t=e.document.documentElement,n=le(e).on("dragstart.drag",Re,tt);"onselectstart"in t?n.on("selectstart.drag",Re,tt):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}o(mt,"default");function Xt(e,t){var n=e.document.documentElement,r=le(e).on("dragstart.drag",null);t&&(r.on("click.drag",Re,tt),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}o(Xt,"yesdrag");var Yt=o(e=>()=>e,"default");function Zt(e,{sourceEvent:t,subject:n,target:r,identifier:i,active:s,x:a,y:c,dx:l,dy:u,dispatch:d}){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:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:s,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:c,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:d}})}o(Zt,"DragEvent");Zt.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function Lu(e){return!e.ctrlKey&&!e.button}o(Lu,"defaultFilter");function Hu(){return this.parentNode}o(Hu,"defaultContainer");function Bu(e,t){return t??{x:e.x,y:e.y}}o(Bu,"defaultSubject");function Vu(){return navigator.maxTouchPoints||"ontouchstart"in this}o(Vu,"defaultTouchable");function Ut(){var e=Lu,t=Hu,n=Bu,r=Vu,i={},s=et("start","drag","end"),a=0,c,l,u,d,f=0;function h(w){w.on("mousedown.drag",g).filter(r).on("touchstart.drag",b).on("touchmove.drag",y,$i).on("touchend.drag touchcancel.drag",v).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}o(h,"drag");function g(w,N){if(!(d||!e.call(this,w,N))){var _=m(this,t.call(this,w,N),w,N,"mouse");_&&(le(w.view).on("mousemove.drag",p,tt).on("mouseup.drag",S,tt),mt(w.view),vn(w),u=!1,c=w.clientX,l=w.clientY,_("start",w))}}o(g,"mousedowned");function p(w){if(Re(w),!u){var N=w.clientX-c,_=w.clientY-l;u=N*N+_*_>f}i.mouse("drag",w)}o(p,"mousemoved");function S(w){le(w.view).on("mousemove.drag mouseup.drag",null),Xt(w.view,u),Re(w),i.mouse("end",w)}o(S,"mouseupped");function b(w,N){if(e.call(this,w,N)){var _=w.changedTouches,P=t.call(this,w,N),I=_.length,T,F;for(T=0;T<I;++T)(F=m(this,P,w,N,_[T].identifier,_[T]))&&(vn(w),F("start",w,_[T]))}}o(b,"touchstarted");function y(w){var N=w.changedTouches,_=N.length,P,I;for(P=0;P<_;++P)(I=i[N[P].identifier])&&(Re(w),I("drag",w,N[P]))}o(y,"touchmoved");function v(w){var N=w.changedTouches,_=N.length,P,I;for(d&&clearTimeout(d),d=setTimeout(function(){d=null},500),P=0;P<_;++P)(I=i[N[P].identifier])&&(vn(w),I("end",w,N[P]))}o(v,"touchended");function m(w,N,_,P,I,T){var F=s.copy(),z=fe(T||_,N),H,O,x;if((x=n.call(w,new Zt("beforestart",{sourceEvent:_,target:h,identifier:I,active:a,x:z[0],y:z[1],dx:0,dy:0,dispatch:F}),P))!=null)return H=x.x-z[0]||0,O=x.y-z[1]||0,o(function E(C,M,R){var D=z,V;switch(C){case"start":i[I]=E,V=a++;break;case"end":delete i[I],--a;case"drag":z=fe(R||M,N),V=a;break}F.call(C,w,new Zt(C,{sourceEvent:M,subject:x,target:h,identifier:I,active:V,x:z[0]+H,y:z[1]+O,dx:z[0]-D[0],dy:z[1]-D[1],dispatch:F}),P)},"gesture")}return o(m,"beforestart"),h.filter=function(w){return arguments.length?(e=typeof w=="function"?w:Yt(!!w),h):e},h.container=function(w){return arguments.length?(t=typeof w=="function"?w:Yt(w),h):t},h.subject=function(w){return arguments.length?(n=typeof w=="function"?w:Yt(w),h):n},h.touchable=function(w){return arguments.length?(r=typeof w=="function"?w:Yt(!!w),h):r},h.on=function(){var w=s.on.apply(s,arguments);return w===s?h:w},h.clickDistance=function(w){return arguments.length?(f=(w=+w)*w,h):Math.sqrt(f)},h}o(Ut,"default");var yt=0,Kt=0,qt=0,Hi=1e3,En,Gt,Cn=0,nt=0,_n=0,Qt=typeof performance=="object"&&performance.now?performance:Date,Bi=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function jt(){return nt||(Bi(Fu),nt=Qt.now()+_n)}o(jt,"now");function Fu(){nt=0}o(Fu,"clearNow");function Jt(){this._call=this._time=this._next=null}o(Jt,"Timer");Jt.prototype=Nn.prototype={constructor:Jt,restart:o(function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?jt():+n)+(t==null?0:+t),!this._next&&Gt!==this&&(Gt?Gt._next=this:En=this,Gt=this),this._call=e,this._time=n,er()},"restart"),stop:o(function(){this._call&&(this._call=null,this._time=1/0,er())},"stop")};function Nn(e,t,n){var r=new Jt;return r.restart(e,t,n),r}o(Nn,"timer");function Vi(){jt(),++yt;for(var e=En,t;e;)(t=nt-e._time)>=0&&e._call.call(void 0,t),e=e._next;--yt}o(Vi,"timerFlush");function Li(){nt=(Cn=Qt.now())+_n,yt=Kt=0;try{Vi()}finally{yt=0,Xu(),nt=0}}o(Li,"wake");function Wu(){var e=Qt.now(),t=e-Cn;t>Hi&&(_n-=t,Cn=e)}o(Wu,"poke");function Xu(){for(var e,t=En,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:En=n);Gt=e,er(r)}o(Xu,"nap");function er(e){if(!yt){Kt&&(Kt=clearTimeout(Kt));var t=e-nt;t>24?(e<1/0&&(Kt=setTimeout(Li,e-Qt.now()-_n)),qt&&(qt=clearInterval(qt))):(qt||(Cn=Qt.now(),qt=setInterval(Wu,Hi)),yt=1,Bi(Li))}}o(er,"sleep");function en(e,t,n){var r=new Jt;return t=t==null?0:+t,r.restart(i=>{r.stop(),e(i+t)},t,n),r}o(en,"default");var Yu=et("start","end","cancel","interrupt"),Zu=[],Xi=0,Fi=1,In=2,Mn=3,Wi=4,Pn=5,tn=6;function ze(e,t,n,r,i,s){var a=e.__transition;if(!a)e.__transition={};else if(n in a)return;Uu(e,n,{name:t,index:r,group:i,on:Yu,tween:Zu,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:Xi})}o(ze,"default");function nn(e,t){var n=ue(e,t);if(n.state>Xi)throw new Error("too late; already scheduled");return n}o(nn,"init");function de(e,t){var n=ue(e,t);if(n.state>Mn)throw new Error("too late; already running");return n}o(de,"set");function ue(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}o(ue,"get");function Uu(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=Nn(s,0,n.time);function s(u){n.state=Fi,n.timer.restart(a,n.delay,n.time),n.delay<=u&&a(u-n.delay)}o(s,"schedule");function a(u){var d,f,h,g;if(n.state!==Fi)return l();for(d in r)if(g=r[d],g.name===n.name){if(g.state===Mn)return en(a);g.state===Wi?(g.state=tn,g.timer.stop(),g.on.call("interrupt",e,e.__data__,g.index,g.group),delete r[d]):+d<t&&(g.state=tn,g.timer.stop(),g.on.call("cancel",e,e.__data__,g.index,g.group),delete r[d])}if(en(function(){n.state===Mn&&(n.state=Wi,n.timer.restart(c,n.delay,n.time),c(u))}),n.state=In,n.on.call("start",e,e.__data__,n.index,n.group),n.state===In){for(n.state=Mn,i=new Array(h=n.tween.length),d=0,f=-1;d<h;++d)(g=n.tween[d].value.call(e,e.__data__,n.index,n.group))&&(i[++f]=g);i.length=f+1}}o(a,"start");function c(u){for(var d=u<n.duration?n.ease.call(null,u/n.duration):(n.timer.restart(l),n.state=Pn,1),f=-1,h=i.length;++f<h;)i[f].call(e,d);n.state===Pn&&(n.on.call("end",e,e.__data__,n.index,n.group),l())}o(c,"tick");function l(){n.state=tn,n.timer.stop(),delete r[t];for(var u in r)return;delete e.__transition}o(l,"stop")}o(Uu,"create");function Ve(e,t){var n=e.__transition,r,i,s=!0,a;if(n){t=t==null?null:t+"";for(a in n){if((r=n[a]).name!==t){s=!1;continue}i=r.state>In&&r.state<Pn,r.state=tn,r.timer.stop(),r.on.call(i?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[a]}s&&delete e.__transition}}o(Ve,"default");function tr(e){return this.each(function(){Ve(this,e)})}o(tr,"default");function qu(e,t){var n,r;return function(){var i=de(this,e),s=i.tween;if(s!==n){r=n=s;for(var a=0,c=r.length;a<c;++a)if(r[a].name===t){r=r.slice(),r.splice(a,1);break}}i.tween=r}}o(qu,"tweenRemove");function Ku(e,t,n){var r,i;if(typeof n!="function")throw new Error;return function(){var s=de(this,e),a=s.tween;if(a!==r){i=(r=a).slice();for(var c={name:t,value:n},l=0,u=i.length;l<u;++l)if(i[l].name===t){i[l]=c;break}l===u&&i.push(c)}s.tween=i}}o(Ku,"tweenFunction");function nr(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=ue(this.node(),n).tween,i=0,s=r.length,a;i<s;++i)if((a=r[i]).name===e)return a.value;return null}return this.each((t==null?qu:Ku)(n,e,t))}o(nr,"default");function xt(e,t,n){var r=e._id;return e.each(function(){var i=de(this,r);(i.value||(i.value={}))[t]=n.apply(this,arguments)}),function(i){return ue(i,r).value[t]}}o(xt,"tweenValue");function on(e,t){var n;return(typeof t=="number"?Si:t instanceof fo?ho:(n=fo(t))?(t=n,ho):vi)(e,t)}o(on,"default");function Gu(e){return function(){this.removeAttribute(e)}}o(Gu,"attrRemove");function Qu(e){return function(){this.removeAttributeNS(e.space,e.local)}}o(Qu,"attrRemoveNS");function Ju(e,t,n){var r,i=n+"",s;return function(){var a=this.getAttribute(e);return a===i?null:a===r?s:s=t(r=a,n)}}o(Ju,"attrConstant");function ju(e,t,n){var r,i=n+"",s;return function(){var a=this.getAttributeNS(e.space,e.local);return a===i?null:a===r?s:s=t(r=a,n)}}o(ju,"attrConstantNS");function ed(e,t,n){var r,i,s;return function(){var a,c=n(this),l;return c==null?void this.removeAttribute(e):(a=this.getAttribute(e),l=c+"",a===l?null:a===r&&l===i?s:(i=l,s=t(r=a,c)))}}o(ed,"attrFunction");function td(e,t,n){var r,i,s;return function(){var a,c=n(this),l;return c==null?void this.removeAttributeNS(e.space,e.local):(a=this.getAttributeNS(e.space,e.local),l=c+"",a===l?null:a===r&&l===i?s:(i=l,s=t(r=a,c)))}}o(td,"attrFunctionNS");function or(e,t){var n=Me(e),r=n==="transform"?Ci:on;return this.attrTween(e,typeof t=="function"?(n.local?td:ed)(n,r,xt(this,"attr."+e,t)):t==null?(n.local?Qu:Gu)(n):(n.local?ju:Ju)(n,r,t))}o(or,"default");function nd(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}o(nd,"attrInterpolate");function od(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}o(od,"attrInterpolateNS");function rd(e,t){var n,r;function i(){var s=t.apply(this,arguments);return s!==r&&(n=(r=s)&&od(e,s)),n}return o(i,"tween"),i._value=t,i}o(rd,"attrTweenNS");function id(e,t){var n,r;function i(){var s=t.apply(this,arguments);return s!==r&&(n=(r=s)&&nd(e,s)),n}return o(i,"tween"),i._value=t,i}o(id,"attrTween");function rr(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 r=Me(e);return this.tween(n,(r.local?rd:id)(r,t))}o(rr,"default");function sd(e,t){return function(){nn(this,e).delay=+t.apply(this,arguments)}}o(sd,"delayFunction");function ad(e,t){return t=+t,function(){nn(this,e).delay=t}}o(ad,"delayConstant");function ir(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?sd:ad)(t,e)):ue(this.node(),t).delay}o(ir,"default");function cd(e,t){return function(){de(this,e).duration=+t.apply(this,arguments)}}o(cd,"durationFunction");function ld(e,t){return t=+t,function(){de(this,e).duration=t}}o(ld,"durationConstant");function sr(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?cd:ld)(t,e)):ue(this.node(),t).duration}o(sr,"default");function ud(e,t){if(typeof t!="function")throw new Error;return function(){de(this,e).ease=t}}o(ud,"easeConstant");function ar(e){var t=this._id;return arguments.length?this.each(ud(t,e)):ue(this.node(),t).ease}o(ar,"default");function dd(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;de(this,e).ease=n}}o(dd,"easeVarying");function cr(e){if(typeof e!="function")throw new Error;return this.each(dd(this._id,e))}o(cr,"default");function lr(e){typeof e!="function"&&(e=gt(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var s=t[i],a=s.length,c=r[i]=[],l,u=0;u<a;++u)(l=s[u])&&e.call(l,l.__data__,u,s)&&c.push(l);return new ge(r,this._parents,this._name,this._id)}o(lr,"default");function ur(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,i=n.length,s=Math.min(r,i),a=new Array(r),c=0;c<s;++c)for(var l=t[c],u=n[c],d=l.length,f=a[c]=new Array(d),h,g=0;g<d;++g)(h=l[g]||u[g])&&(f[g]=h);for(;c<r;++c)a[c]=t[c];return new ge(a,this._parents,this._name,this._id)}o(ur,"default");function fd(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}o(fd,"start");function hd(e,t,n){var r,i,s=fd(t)?nn:de;return function(){var a=s(this,e),c=a.on;c!==r&&(i=(r=c).copy()).on(t,n),a.on=i}}o(hd,"onFunction");function dr(e,t){var n=this._id;return arguments.length<2?ue(this.node(),n).on.on(e):this.each(hd(n,e,t))}o(dr,"default");function pd(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}o(pd,"removeFunction");function fr(){return this.on("end.remove",pd(this._id))}o(fr,"default");function hr(e){var t=this._name,n=this._id;typeof e!="function"&&(e=He(e));for(var r=this._groups,i=r.length,s=new Array(i),a=0;a<i;++a)for(var c=r[a],l=c.length,u=s[a]=new Array(l),d,f,h=0;h<l;++h)(d=c[h])&&(f=e.call(d,d.__data__,h,c))&&("__data__"in d&&(f.__data__=d.__data__),u[h]=f,ze(u[h],t,n,h,u,ue(d,n)));return new ge(s,this._parents,t,n)}o(hr,"default");function pr(e){var t=this._name,n=this._id;typeof e!="function"&&(e=pt(e));for(var r=this._groups,i=r.length,s=[],a=[],c=0;c<i;++c)for(var l=r[c],u=l.length,d,f=0;f<u;++f)if(d=l[f]){for(var h=e.call(d,d.__data__,f,l),g,p=ue(d,n),S=0,b=h.length;S<b;++S)(g=h[S])&&ze(g,t,n,S,h,p);s.push(h),a.push(d)}return new ge(s,a,t,n)}o(pr,"default");var gd=De.prototype.constructor;function gr(){return new gd(this._groups,this._parents)}o(gr,"default");function md(e,t){var n,r,i;return function(){var s=Be(this,e),a=(this.style.removeProperty(e),Be(this,e));return s===a?null:s===n&&a===r?i:i=t(n=s,r=a)}}o(md,"styleNull");function Yi(e){return function(){this.style.removeProperty(e)}}o(Yi,"styleRemove");function yd(e,t,n){var r,i=n+"",s;return function(){var a=Be(this,e);return a===i?null:a===r?s:s=t(r=a,n)}}o(yd,"styleConstant");function xd(e,t,n){var r,i,s;return function(){var a=Be(this,e),c=n(this),l=c+"";return c==null&&(l=c=(this.style.removeProperty(e),Be(this,e))),a===l?null:a===r&&l===i?s:(i=l,s=t(r=a,c))}}o(xd,"styleFunction");function wd(e,t){var n,r,i,s="style."+t,a="end."+s,c;return function(){var l=de(this,e),u=l.on,d=l.value[s]==null?c||(c=Yi(t)):void 0;(u!==n||i!==d)&&(r=(n=u).copy()).on(a,i=d),l.on=r}}o(wd,"styleMaybeRemove");function mr(e,t,n){var r=(e+="")=="transform"?Ei:on;return t==null?this.styleTween(e,md(e,r)).on("end.style."+e,Yi(e)):typeof t=="function"?this.styleTween(e,xd(e,r,xt(this,"style."+e,t))).each(wd(this._id,e)):this.styleTween(e,yd(e,r,t),n).on("end.style."+e,null)}o(mr,"default");function bd(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}o(bd,"styleInterpolate");function Sd(e,t,n){var r,i;function s(){var a=t.apply(this,arguments);return a!==i&&(r=(i=a)&&bd(e,a,n)),r}return o(s,"tween"),s._value=t,s}o(Sd,"styleTween");function yr(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;return this.tween(r,Sd(e,t,n??""))}o(yr,"default");function vd(e){return function(){this.textContent=e}}o(vd,"textConstant");function Ed(e){return function(){var t=e(this);this.textContent=t??""}}o(Ed,"textFunction");function xr(e){return this.tween("text",typeof e=="function"?Ed(xt(this,"text",e)):vd(e==null?"":e+""))}o(xr,"default");function Cd(e){return function(t){this.textContent=e.call(this,t)}}o(Cd,"textInterpolate");function _d(e){var t,n;function r(){var i=e.apply(this,arguments);return i!==n&&(t=(n=i)&&Cd(i)),t}return o(r,"tween"),r._value=e,r}o(_d,"textTween");function wr(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,_d(e))}o(wr,"default");function br(){for(var e=this._name,t=this._id,n=kn(),r=this._groups,i=r.length,s=0;s<i;++s)for(var a=r[s],c=a.length,l,u=0;u<c;++u)if(l=a[u]){var d=ue(l,t);ze(l,e,n,u,a,{time:d.time+d.delay+d.duration,delay:0,duration:d.duration,ease:d.ease})}return new ge(r,this._parents,e,n)}o(br,"default");function Sr(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(s,a){var c={value:a},l={value:o(function(){--i===0&&s()},"value")};n.each(function(){var u=de(this,r),d=u.on;d!==e&&(t=(e=d).copy(),t._.cancel.push(c),t._.interrupt.push(c),t._.end.push(l)),u.on=t}),i===0&&s()})}o(Sr,"default");var Nd=0;function ge(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}o(ge,"Transition");function Zi(e){return De().transition(e)}o(Zi,"transition");function kn(){return++Nd}o(kn,"newId");var Oe=De.prototype;ge.prototype=Zi.prototype={constructor:ge,select:hr,selectAll:pr,selectChild:Oe.selectChild,selectChildren:Oe.selectChildren,filter:lr,merge:ur,selection:gr,transition:br,call:Oe.call,nodes:Oe.nodes,node:Oe.node,size:Oe.size,empty:Oe.empty,each:Oe.each,on:dr,attr:or,attrTween:rr,style:mr,styleTween:yr,text:xr,textTween:wr,remove:fr,tween:nr,delay:ir,duration:sr,ease:ar,easeVarying:cr,end:Sr,[Symbol.iterator]:Oe[Symbol.iterator]};function An(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}o(An,"cubicInOut");var Md={time:null,delay:0,duration:250,ease:An};function Id(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}o(Id,"inherit");function vr(e){var t,n;e instanceof ge?(t=e._id,e=e._name):(t=kn(),(n=Md).time=jt(),e=e==null?null:e+"");for(var r=this._groups,i=r.length,s=0;s<i;++s)for(var a=r[s],c=a.length,l,u=0;u<c;++u)(l=a[u])&&ze(l,e,t,u,a,n||Id(l,t));return new ge(r,this._parents,e,t)}o(vr,"default");De.prototype.interrupt=tr;De.prototype.transition=vr;var rn=o(e=>()=>e,"default");function Er(e,{sourceEvent:t,target:n,transform:r,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:r,enumerable:!0,configurable:!0},_:{value:i}})}o(Er,"ZoomEvent");function ve(e,t,n){this.k=e,this.x=t,this.y=n}o(ve,"Transform");ve.prototype={constructor:ve,scale:o(function(e){return e===1?this:new ve(this.k*e,this.x,this.y)},"scale"),translate:o(function(e,t){return e===0&t===0?this:new ve(this.k,this.x+this.k*e,this.y+this.k*t)},"translate"),apply:o(function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},"apply"),applyX:o(function(e){return e*this.k+this.x},"applyX"),applyY:o(function(e){return e*this.k+this.y},"applyY"),invert:o(function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},"invert"),invertX:o(function(e){return(e-this.x)/this.k},"invertX"),invertY:o(function(e){return(e-this.y)/this.k},"invertY"),rescaleX:o(function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},"rescaleX"),rescaleY:o(function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},"rescaleY"),toString:o(function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"},"toString")};var ot=new ve(1,0,0);sn.prototype=ve.prototype;function sn(e){for(;!e.__zoom;)if(!(e=e.parentNode))return ot;return e.__zoom}o(sn,"transform");function Tn(e){e.stopImmediatePropagation()}o(Tn,"nopropagation");function rt(e){e.preventDefault(),e.stopImmediatePropagation()}o(rt,"default");function Pd(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}o(Pd,"defaultFilter");function kd(){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]]}o(kd,"defaultExtent");function Ui(){return this.__zoom||ot}o(Ui,"defaultTransform");function Ad(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}o(Ad,"defaultWheelDelta");function Td(){return navigator.maxTouchPoints||"ontouchstart"in this}o(Td,"defaultTouchable");function Dd(e,t,n){var r=e.invertX(t[0][0])-n[0][0],i=e.invertX(t[1][0])-n[1][0],s=e.invertY(t[0][1])-n[0][1],a=e.invertY(t[1][1])-n[1][1];return e.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),a>s?(s+a)/2:Math.min(0,s)||Math.max(0,a))}o(Dd,"defaultConstrain");function an(){var e=Pd,t=kd,n=Dd,r=Ad,i=Td,s=[0,1/0],a=[[-1/0,-1/0],[1/0,1/0]],c=250,l=ht,u=et("start","zoom","end"),d,f,h,g=500,p=150,S=0,b=10;function y(x){x.property("__zoom",Ui).on("wheel.zoom",I,{passive:!1}).on("mousedown.zoom",T).on("dblclick.zoom",F).filter(i).on("touchstart.zoom",z).on("touchmove.zoom",H).on("touchend.zoom touchcancel.zoom",O).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}o(y,"zoom"),y.transform=function(x,E,C,M){var R=x.selection?x.selection():x;R.property("__zoom",Ui),x!==R?N(x,E,C,M):R.interrupt().each(function(){_(this,arguments).event(M).start().zoom(null,typeof E=="function"?E.apply(this,arguments):E).end()})},y.scaleBy=function(x,E,C,M){y.scaleTo(x,function(){var R=this.__zoom.k,D=typeof E=="function"?E.apply(this,arguments):E;return R*D},C,M)},y.scaleTo=function(x,E,C,M){y.transform(x,function(){var R=t.apply(this,arguments),D=this.__zoom,V=C==null?w(R):typeof C=="function"?C.apply(this,arguments):C,B=D.invert(V),L=typeof E=="function"?E.apply(this,arguments):E;return n(m(v(D,L),V,B),R,a)},C,M)},y.translateBy=function(x,E,C,M){y.transform(x,function(){return n(this.__zoom.translate(typeof E=="function"?E.apply(this,arguments):E,typeof C=="function"?C.apply(this,arguments):C),t.apply(this,arguments),a)},null,M)},y.translateTo=function(x,E,C,M,R){y.transform(x,function(){var D=t.apply(this,arguments),V=this.__zoom,B=M==null?w(D):typeof M=="function"?M.apply(this,arguments):M;return n(ot.translate(B[0],B[1]).scale(V.k).translate(typeof E=="function"?-E.apply(this,arguments):-E,typeof C=="function"?-C.apply(this,arguments):-C),D,a)},M,R)};function v(x,E){return E=Math.max(s[0],Math.min(s[1],E)),E===x.k?x:new ve(E,x.x,x.y)}o(v,"scale");function m(x,E,C){var M=E[0]-C[0]*x.k,R=E[1]-C[1]*x.k;return M===x.x&&R===x.y?x:new ve(x.k,M,R)}o(m,"translate");function w(x){return[(+x[0][0]+ +x[1][0])/2,(+x[0][1]+ +x[1][1])/2]}o(w,"centroid");function N(x,E,C,M){x.on("start.zoom",function(){_(this,arguments).event(M).start()}).on("interrupt.zoom end.zoom",function(){_(this,arguments).event(M).end()}).tween("zoom",function(){var R=this,D=arguments,V=_(R,D).event(M),B=t.apply(R,D),L=C==null?w(B):typeof C=="function"?C.apply(R,D):C,U=Math.max(B[1][0]-B[0][0],B[1][1]-B[0][1]),X=R.__zoom,K=typeof E=="function"?E.apply(R,D):E,ee=l(X.invert(L).concat(U/X.k),K.invert(L).concat(U/K.k));return function(G){if(G===1)G=K;else{var $=ee(G),W=U/$[2];G=new ve(W,L[0]-$[0]*W,L[1]-$[1]*W)}V.zoom(null,G)}})}o(N,"schedule");function _(x,E,C){return!C&&x.__zooming||new P(x,E)}o(_,"gesture");function P(x,E){this.that=x,this.args=E,this.active=0,this.sourceEvent=null,this.extent=t.apply(x,E),this.taps=0}o(P,"Gesture"),P.prototype={event:o(function(x){return x&&(this.sourceEvent=x),this},"event"),start:o(function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},"start"),zoom:o(function(x,E){return this.mouse&&x!=="mouse"&&(this.mouse[1]=E.invert(this.mouse[0])),this.touch0&&x!=="touch"&&(this.touch0[1]=E.invert(this.touch0[0])),this.touch1&&x!=="touch"&&(this.touch1[1]=E.invert(this.touch1[0])),this.that.__zoom=E,this.emit("zoom"),this},"zoom"),end:o(function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},"end"),emit:o(function(x){var E=le(this.that).datum();u.call(x,this.that,new Er(x,{sourceEvent:this.sourceEvent,target:y,type:x,transform:this.that.__zoom,dispatch:u}),E)},"emit")};function I(x,...E){if(!e.apply(this,arguments))return;var C=_(this,E).event(x),M=this.__zoom,R=Math.max(s[0],Math.min(s[1],M.k*Math.pow(2,r.apply(this,arguments)))),D=fe(x);if(C.wheel)(C.mouse[0][0]!==D[0]||C.mouse[0][1]!==D[1])&&(C.mouse[1]=M.invert(C.mouse[0]=D)),clearTimeout(C.wheel);else{if(M.k===R)return;C.mouse=[D,M.invert(D)],Ve(this),C.start()}rt(x),C.wheel=setTimeout(V,p),C.zoom("mouse",n(m(v(M,R),C.mouse[0],C.mouse[1]),C.extent,a));function V(){C.wheel=null,C.end()}o(V,"wheelidled")}o(I,"wheeled");function T(x,...E){if(h||!e.apply(this,arguments))return;var C=x.currentTarget,M=_(this,E,!0).event(x),R=le(x.view).on("mousemove.zoom",L,!0).on("mouseup.zoom",U,!0),D=fe(x,C),V=x.clientX,B=x.clientY;mt(x.view),Tn(x),M.mouse=[D,this.__zoom.invert(D)],Ve(this),M.start();function L(X){if(rt(X),!M.moved){var K=X.clientX-V,ee=X.clientY-B;M.moved=K*K+ee*ee>S}M.event(X).zoom("mouse",n(m(M.that.__zoom,M.mouse[0]=fe(X,C),M.mouse[1]),M.extent,a))}o(L,"mousemoved");function U(X){R.on("mousemove.zoom mouseup.zoom",null),Xt(X.view,M.moved),rt(X),M.event(X).end()}o(U,"mouseupped")}o(T,"mousedowned");function F(x,...E){if(e.apply(this,arguments)){var C=this.__zoom,M=fe(x.changedTouches?x.changedTouches[0]:x,this),R=C.invert(M),D=C.k*(x.shiftKey?.5:2),V=n(m(v(C,D),M,R),t.apply(this,E),a);rt(x),c>0?le(this).transition().duration(c).call(N,V,M,x):le(this).call(y.transform,V,M,x)}}o(F,"dblclicked");function z(x,...E){if(e.apply(this,arguments)){var C=x.touches,M=C.length,R=_(this,E,x.changedTouches.length===M).event(x),D,V,B,L;for(Tn(x),V=0;V<M;++V)B=C[V],L=fe(B,this),L=[L,this.__zoom.invert(L),B.identifier],R.touch0?!R.touch1&&R.touch0[2]!==L[2]&&(R.touch1=L,R.taps=0):(R.touch0=L,D=!0,R.taps=1+!!d);d&&(d=clearTimeout(d)),D&&(R.taps<2&&(f=L[0],d=setTimeout(function(){d=null},g)),Ve(this),R.start())}}o(z,"touchstarted");function H(x,...E){if(this.__zooming){var C=_(this,E).event(x),M=x.changedTouches,R=M.length,D,V,B,L;for(rt(x),D=0;D<R;++D)V=M[D],B=fe(V,this),C.touch0&&C.touch0[2]===V.identifier?C.touch0[0]=B:C.touch1&&C.touch1[2]===V.identifier&&(C.touch1[0]=B);if(V=C.that.__zoom,C.touch1){var U=C.touch0[0],X=C.touch0[1],K=C.touch1[0],ee=C.touch1[1],G=(G=K[0]-U[0])*G+(G=K[1]-U[1])*G,$=($=ee[0]-X[0])*$+($=ee[1]-X[1])*$;V=v(V,Math.sqrt(G/$)),B=[(U[0]+K[0])/2,(U[1]+K[1])/2],L=[(X[0]+ee[0])/2,(X[1]+ee[1])/2]}else if(C.touch0)B=C.touch0[0],L=C.touch0[1];else return;C.zoom("touch",n(m(V,B,L),C.extent,a))}}o(H,"touchmoved");function O(x,...E){if(this.__zooming){var C=_(this,E).event(x),M=x.changedTouches,R=M.length,D,V;for(Tn(x),h&&clearTimeout(h),h=setTimeout(function(){h=null},g),D=0;D<R;++D)V=M[D],C.touch0&&C.touch0[2]===V.identifier?delete C.touch0:C.touch1&&C.touch1[2]===V.identifier&&delete C.touch1;if(C.touch1&&!C.touch0&&(C.touch0=C.touch1,delete C.touch1),C.touch0)C.touch0[1]=this.__zoom.invert(C.touch0[0]);else if(C.end(),C.taps===2&&(V=fe(V,this),Math.hypot(f[0]-V[0],f[1]-V[1])<b)){var B=le(this).on("dblclick.zoom");B&&B.apply(this,arguments)}}}return o(O,"touchended"),y.wheelDelta=function(x){return arguments.length?(r=typeof x=="function"?x:rn(+x),y):r},y.filter=function(x){return arguments.length?(e=typeof x=="function"?x:rn(!!x),y):e},y.touchable=function(x){return arguments.length?(i=typeof x=="function"?x:rn(!!x),y):i},y.extent=function(x){return arguments.length?(t=typeof x=="function"?x:rn([[+x[0][0],+x[0][1]],[+x[1][0],+x[1][1]]]),y):t},y.scaleExtent=function(x){return arguments.length?(s[0]=+x[0],s[1]=+x[1],y):[s[0],s[1]]},y.translateExtent=function(x){return arguments.length?(a[0][0]=+x[0][0],a[1][0]=+x[1][0],a[0][1]=+x[0][1],a[1][1]=+x[1][1],y):[[a[0][0],a[0][1]],[a[1][0],a[1][1]]]},y.constrain=function(x){return arguments.length?(n=x,y):n},y.duration=function(x){return arguments.length?(c=+x,y):c},y.interpolate=function(x){return arguments.length?(l=x,y):l},y.on=function(){var x=u.on.apply(u,arguments);return x===u?y:x},y.clickDistance=function(x){return arguments.length?(S=(x=+x)*x,y):Math.sqrt(S)},y.tapDistance=function(x){return arguments.length?(b=+x,y):b},y}o(an,"default");var ye={error001:o((e="react")=>`Seems like you have not used ${e==="svelte"?"SvelteFlowProvider":"ReactFlowProvider"} as an ancestor. Help: https://${e}flow.dev/error#001`,"error001"),error002:o(()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.","error002"),error003:o(e=>`Node type "${e}" not found. Using fallback type "default".`,"error003"),error004:o(()=>"The parent container needs a width and a height to render the graph.","error004"),error005:o(()=>"Only child nodes can use a parent extent.","error005"),error006:o(()=>"Can't create edge. An edge needs a source and a target.","error006"),error007:o(e=>`The old edge with id=${e} does not exist.`,"error007"),error009:o(e=>`Marker type "${e}" doesn't exist.`,"error009"),error008:o((e,{id:t,sourceHandle:n,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:r}", edge id: ${t}.`,"error008"),error010:o(()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.","error010"),error011:o(e=>`Edge type "${e}" not found. Using fallback type "default".`,"error011"),error012:o(e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,"error012"),error013:o((e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,"error013"),error014:o(()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.","error014"),error015:o(()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs.","error015"),error016:o(e=>`Edge with id "${e}" does not exist, it may have been removed. This can happen when an edge is deleted before the "onEdgeClick" handler is called.`,"error016")},Et=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Ir=["Enter"," ","Escape"],Pr={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":o(({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"node.a11yDescription.ariaLiveMessage"),"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"},Xe;(function(e){e.Strict="strict",e.Loose="loose"})(Xe||(Xe={}));var $e;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})($e||($e={}));var it;(function(e){e.Partial="partial",e.Full="full"})(it||(it={}));var kr={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null},Ie;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Ie||(Ie={}));var St;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(St||(St={}));var Y;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Y||(Y={}));var qi={[Y.Left]:Y.Right,[Y.Right]:Y.Left,[Y.Top]:Y.Bottom,[Y.Bottom]:Y.Top};function Ar(e){return e===null?null:e?"valid":"invalid"}o(Ar,"getConnectionStatus");var Tr=o(e=>!!e&&typeof e=="object"&&"id"in e&&"source"in e&&"target"in e,"isEdgeBase"),as=o(e=>!!e&&typeof e=="object"&&"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),"isNodeBase"),Dr=o(e=>!!e&&typeof e=="object"&&"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),"isInternalNodeBase");var ln=o((e,t=[0,0])=>{let{width:n,height:r}=Ee(e),i=e.origin??t,s=n*i[0],a=r*i[1];return{x:e.position.x-s,y:e.position.y-a}},"getNodePositionWithOrigin"),un=o((e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};let n=e.reduce((r,i)=>{let s=typeof i=="string",a=!t.nodeLookup&&!s?i:void 0;t.nodeLookup&&(a=s?t.nodeLookup.get(i):Dr(i)?i:t.nodeLookup.get(i.id));let c=a?zn(a,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return Ln(r,c)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return Hn(n)},"getNodesBounds"),Ct=o((e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(i=>{(t.filter===void 0||t.filter(i))&&(n=Ln(n,zn(i)),r=!0)}),r?Hn(n):{x:0,y:0,width:0,height:0}},"getInternalNodesBounds"),On=o((e,t,[n,r,i]=[0,0,1],s=!1,a=!1)=>{let c=(t.x-n)/i,l=(t.y-r)/i,u=t.width/i,d=t.height/i,f=[];for(let h of e.values()){let{measured:g,selectable:p=!0,hidden:S=!1}=h;if(a&&!p||S)continue;let b=g.width??h.width??h.initialWidth??0,y=g.height??h.height??h.initialHeight??0,{x:v,y:m}=h.internals.positionAbsolute,w=fs(c,l,u,d,v,m,b,y),N=b*y,_=s&&w>0;(!h.internals.handleBounds||_||w>=N||h.dragging)&&f.push(h)}return f},"getNodesInside"),cs=o((e,t)=>{let n=new Set;return e.forEach(r=>{n.add(r.id)}),t.filter(r=>n.has(r.source)||n.has(r.target))},"getConnectedEdges");function Rd(e,t){let n=new Map,r=t?.nodes?new Set(t.nodes.map(i=>i.id)):null;return e.forEach(i=>{let s;if(t?.includeHiddenNodes){let{width:a,height:c}=Ee(i);s=a>0&&c>0}else s=!!(i.measured.width&&i.measured.height&&!i.hidden);s&&(!r||r.has(i.id))&&n.set(i.id,i)}),n}o(Rd,"getFitViewNodes");async function ls({nodes:e,width:t,height:n,panZoom:r,minZoom:i,maxZoom:s},a){if(e.size===0)return!0;let c=Rd(e,a),l=Ct(c),u=lt(l,t,n,a?.minZoom??i,a?.maxZoom??s,a?.padding??.1);return await r.setViewport(u,{duration:a?.duration,ease:a?.ease,interpolate:a?.interpolate}),!0}o(ls,"fitViewport");function Rr({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:i,onError:s}){let a=n.get(e),c=a.parentId?n.get(a.parentId):void 0,{x:l,y:u}=c?c.internals.positionAbsolute:{x:0,y:0},d=a.origin??r,f=a.extent||i;if(a.extent==="parent"&&!a.expandParent)if(!c)s?.("005",ye.error005());else{let g=c.measured.width,p=c.measured.height;g&&p&&(f=[[l,u],[l+g,u+p]])}else c&&ct(a.extent)&&(f=[[a.extent[0][0]+l,a.extent[0][1]+u],[a.extent[1][0]+l,a.extent[1][1]+u]]);let h=ct(f)?st(t,f,a.measured):t;return(a.measured.width===void 0||a.measured.height===void 0)&&s?.("015",ye.error015()),{position:{x:h.x-l+(a.measured.width??0)*d[0],y:h.y-u+(a.measured.height??0)*d[1]},positionAbsolute:h}}o(Rr,"calculateNodePosition");async function us({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:i}){let s=new Set(e.map(h=>h.id)),a=[];for(let h of n){if(h.deletable===!1)continue;let g=s.has(h.id),p=!g&&h.parentId&&a.find(S=>S.id===h.parentId);(g||p)&&a.push(h)}let c=new Set(t.map(h=>h.id)),l=r.filter(h=>h.deletable!==!1),d=cs(a,l);for(let h of l)c.has(h.id)&&!d.find(p=>p.id===h.id)&&d.push(h);if(!i)return{edges:d,nodes:a};let f=await i({nodes:a,edges:d});return typeof f=="boolean"?f?{edges:d,nodes:a}:{edges:[],nodes:[]}:f}o(us,"getElementsToRemove");var vt=o((e,t=0,n=1)=>Math.min(Math.max(e,t),n),"clamp"),st=o((e={x:0,y:0},t,n)=>({x:vt(e.x,t[0][0],t[1][0]-(n?.width??0)),y:vt(e.y,t[0][1],t[1][1]-(n?.height??0))}),"clampPosition");function ds(e,t,n){let{width:r,height:i}=Ee(n),{x:s,y:a}=n.internals.positionAbsolute;return st(e,[[s,a],[s+r,a+i]],t)}o(ds,"clampPositionToParent");var Ki=o((e,t,n)=>e<t?vt(Math.abs(e-t),1,t)/t:e>n?-vt(Math.abs(e-n),1,t)/t:0,"calcAutoPanVelocity"),$n=o((e,t,n=15,r=40)=>{let i=Ki(e.x,r,t.width-r)*n,s=Ki(e.y,r,t.height-r)*n;return[i,s]},"calcAutoPan"),Ln=o((e,t)=>({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)}),"getBoundsOfBoxes"),Mr=o(({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),"rectToBox"),Hn=o(({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),"boxToRect"),_t=o((e,t=[0,0])=>{let{x:n,y:r}=Dr(e)?e.internals.positionAbsolute:ln(e,t);return{x:n,y:r,width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}},"nodeToRect"),zn=o((e,t=[0,0])=>{let{x:n,y:r}=Dr(e)?e.internals.positionAbsolute:ln(e,t);return{x:n,y:r,x2:n+(e.measured?.width??e.width??e.initialWidth??0),y2:r+(e.measured?.height??e.height??e.initialHeight??0)}},"nodeToBox"),zr=o((e,t)=>Hn(Ln(Mr(e),Mr(t))),"getBoundsOfRects"),fs=o((e,t,n,r,i,s,a,c)=>{let l=Math.max(0,Math.min(e+n,i+a)-Math.max(e,i)),u=Math.max(0,Math.min(t+r,s+c)-Math.max(t,s));return Math.ceil(l*u)},"getRectsOverlappingArea"),dn=o((e,t)=>fs(e.x,e.y,e.width,e.height,t.x,t.y,t.width,t.height),"getOverlappingArea"),Or=o(e=>we(e.width)&&we(e.height)&&we(e.x)&&we(e.y),"isRectObject"),we=o(e=>!isNaN(e)&&isFinite(e),"isNumeric"),$r=o((e,t)=>(n,r)=>{},"createDevWarn"),Nt=o((e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),"snapPosition"),Mt=o(({x:e,y:t},[n,r,i],s=!1,a=[1,1])=>{let c={x:(e-n)/i,y:(t-r)/i};return s?Nt(c,a):c},"pointToRendererPoint"),at=o(({x:e,y:t},[n,r,i])=>({x:e*i+n,y:t*i+r}),"rendererPointToPoint");function wt(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){let n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(n)}if(typeof e=="string"&&e.endsWith("%")){let n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}o(wt,"parsePadding");function zd(e,t,n){if(typeof e=="string"||typeof e=="number"){let r=wt(e,n),i=wt(e,t);return{top:r,right:i,bottom:r,left:i,x:i*2,y:r*2}}if(typeof e=="object"){let r=wt(e.top??e.y??0,n),i=wt(e.bottom??e.y??0,n),s=wt(e.left??e.x??0,t),a=wt(e.right??e.x??0,t);return{top:r,right:a,bottom:i,left:s,x:s+a,y:r+i}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}o(zd,"parsePaddings");function Od(e,t,n,r,i,s){let{x:a,y:c}=at(e,[t,n,r]),{x:l,y:u}=at({x:e.x+e.width,y:e.y+e.height},[t,n,r]),d=i-l,f=s-u;return{left:Math.floor(a),top:Math.floor(c),right:Math.floor(d),bottom:Math.floor(f)}}o(Od,"calculateAppliedPaddings");var lt=o((e,t,n,r,i,s)=>{let a=zd(s,t,n),c=(t-a.x)/e.width,l=(n-a.y)/e.height,u=Math.min(c,l),d=vt(u,r,i),f=e.x+e.width/2,h=e.y+e.height/2,g=t/2-f*d,p=n/2-h*d,S=Od(e,g,p,d,t,n),b={left:Math.min(S.left-a.left,0),top:Math.min(S.top-a.top,0),right:Math.min(S.right-a.right,0),bottom:Math.min(S.bottom-a.bottom,0)};return{x:g-b.left+b.right,y:p-b.top+b.bottom,zoom:d}},"getViewportForBounds"),It=o(()=>typeof navigator<"u"&&navigator?.userAgent?.indexOf("Mac")>=0,"isMacOs");function ct(e){return e!=null&&e!=="parent"}o(ct,"isCoordinateExtent");function Ee(e){return{width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}}o(Ee,"getNodeDimensions");function Bn(e){return(e.measured?.width??e.width??e.initialWidth)!==void 0&&(e.measured?.height??e.height??e.initialHeight)!==void 0}o(Bn,"nodeHasDimensions");function Lr(e,t={width:0,height:0},n,r,i){let s={...e},a=r.get(n);if(a){let c=a.origin||i;s.x+=a.internals.positionAbsolute.x-(t.width??0)*c[0],s.y+=a.internals.positionAbsolute.y-(t.height??0)*c[1]}return s}o(Lr,"evaluateAbsolutePosition");function Hr(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}o(Hr,"areSetsEqual");function hs(){let e,t;return{promise:new Promise((r,i)=>{e=r,t=i}),resolve:e,reject:t}}o(hs,"withResolvers");function ps(e){return{...Pr,...e||{}}}o(ps,"mergeAriaLabelConfig");function cn(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:i}){let{x:s,y:a}=be(e),c=Mt({x:s-(i?.left??0),y:a-(i?.top??0)},r),{x:l,y:u}=n?Nt(c,t):c;return{xSnapped:l,ySnapped:u,...c}}o(cn,"getPointerPosition");var Vn=o(e=>({width:e.offsetWidth,height:e.offsetHeight}),"getDimensions"),Br=o(e=>e?.getRootNode?.()||window?.document,"getHostForElement"),$d=["INPUT","SELECT","TEXTAREA"];function Vr(e){let t=e.composedPath?.()?.[0]||e.target;return t?.nodeType!==1?!1:$d.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}o(Vr,"isInputDOMNode");var Fr=o(e=>"clientX"in e,"isMouseEvent"),be=o((e,t)=>{let n=Fr(e),r=n?e.clientX:e.touches?.[0].clientX,i=n?e.clientY:e.touches?.[0].clientY;return{x:r-(t?.left??0),y:i-(t?.top??0)}},"getEventPosition"),Gi=o((e,t,n,r,i)=>{let s=t.querySelectorAll(`.${e}`);return!s||!s.length?null:Array.from(s).map(a=>{let c=a.getBoundingClientRect();return{id:a.getAttribute("data-handleid"),type:e,nodeId:i,position:a.getAttribute("data-handlepos"),x:(c.left-n.left)/r,y:(c.top-n.top)/r,...Vn(a)}})},"getHandleBounds");function Fn({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:i,sourceControlY:s,targetControlX:a,targetControlY:c}){let l=e*.125+i*.375+a*.375+n*.125,u=t*.125+s*.375+c*.375+r*.125,d=Math.abs(l-e),f=Math.abs(u-t);return[l,u,d,f]}o(Fn,"getBezierEdgeCenter");function Dn(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}o(Dn,"calculateControlOffset");function Qi({pos:e,x1:t,y1:n,x2:r,y2:i,c:s}){switch(e){case Y.Left:return[t-Dn(t-r,s),n];case Y.Right:return[t+Dn(r-t,s),n];case Y.Top:return[t,n-Dn(n-i,s)];case Y.Bottom:return[t,n+Dn(i-n,s)]}}o(Qi,"getControlWithCurvature");function Wn({sourceX:e,sourceY:t,sourcePosition:n=Y.Bottom,targetX:r,targetY:i,targetPosition:s=Y.Top,curvature:a=.25}){let[c,l]=Qi({pos:n,x1:e,y1:t,x2:r,y2:i,c:a}),[u,d]=Qi({pos:s,x1:r,y1:i,x2:e,y2:t,c:a}),[f,h,g,p]=Fn({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:c,sourceControlY:l,targetControlX:u,targetControlY:d});return[`M${e},${t} C${c},${l} ${u},${d} ${r},${i}`,f,h,g,p]}o(Wn,"getBezierPath");function Wr({sourceX:e,sourceY:t,targetX:n,targetY:r}){let i=Math.abs(n-e)/2,s=n<e?n+i:n-i,a=Math.abs(r-t)/2,c=r<t?r+a:r-a;return[s,c,i,a]}o(Wr,"getEdgeCenter");function gs({sourceNode:e,targetNode:t,selected:n=!1,zIndex:r=0,elevateOnSelect:i=!1,zIndexMode:s="basic"}){if(s==="manual")return r;let a=i&&n?r+1e3:r,c=Math.max(e.parentId||i&&e.selected?e.internals.z:0,t.parentId||i&&t.selected?t.internals.z:0);return a+c}o(gs,"getElevatedEdgeZIndex");function ms({sourceNode:e,targetNode:t,width:n,height:r,transform:i}){let s=Ln(zn(e),zn(t));s.x===s.x2&&(s.x2+=1),s.y===s.y2&&(s.y2+=1);let a={x:-i[0]/i[2],y:-i[1]/i[2],width:n/i[2],height:r/i[2]};return dn(a,Hn(s))>0}o(ms,"isEdgeVisible");var Ld=o(({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,"getEdgeId"),Hd=o((e,t)=>t.some(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)),"connectionExists"),ys=o((e,t,n={})=>{if(!e.source||!e.target)return n.onError?.("006",ye.error006()),t;let r=n.getEdgeId||Ld,i;return Tr(e)?i={...e}:i={...e,id:r(e)},Hd(i,t)?t:(i.sourceHandle===null&&delete i.sourceHandle,i.targetHandle===null&&delete i.targetHandle,t.concat(i))},"addEdge");function Xn({sourceX:e,sourceY:t,targetX:n,targetY:r}){let[i,s,a,c]=Wr({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,i,s,a,c]}o(Xn,"getStraightPath");var Ji={[Y.Left]:{x:-1,y:0},[Y.Right]:{x:1,y:0},[Y.Top]:{x:0,y:-1},[Y.Bottom]:{x:0,y:1}},Bd=o(({source:e,sourcePosition:t=Y.Bottom,target:n})=>t===Y.Left||t===Y.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},"getDirection"),ji=o((e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2)),"distance");function Vd({source:e,sourcePosition:t=Y.Bottom,target:n,targetPosition:r=Y.Top,center:i,offset:s,stepPosition:a}){let c=Ji[t],l=Ji[r],u={x:e.x+c.x*s,y:e.y+c.y*s},d={x:n.x+l.x*s,y:n.y+l.y*s},f=Bd({source:u,sourcePosition:t,target:d}),h=f.x!==0?"x":"y",g=f[h],p=[],S,b,y={x:0,y:0},v={x:0,y:0},[,,m,w]=Wr({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(c[h]*l[h]===-1){h==="x"?(S=i.x??u.x+(d.x-u.x)*a,b=i.y??(u.y+d.y)/2):(S=i.x??(u.x+d.x)/2,b=i.y??u.y+(d.y-u.y)*a);let I=[{x:S,y:u.y},{x:S,y:d.y}],T=[{x:u.x,y:b},{x:d.x,y:b}];c[h]===g?p=h==="x"?I:T:p=h==="x"?T:I}else{let I=[{x:u.x,y:d.y}],T=[{x:d.x,y:u.y}];if(h==="x"?p=c.x===g?T:I:p=c.y===g?I:T,t===r){let x=Math.abs(e[h]-n[h]);if(x<=s){let E=Math.min(s-1,s-x);c[h]===g?y[h]=(u[h]>e[h]?-1:1)*E:v[h]=(d[h]>n[h]?-1:1)*E}}if(t!==r){let x=h==="x"?"y":"x",E=c[h]===l[x],C=u[x]>d[x],M=u[x]<d[x];(c[h]===1&&(!E&&C||E&&M)||c[h]!==1&&(!E&&M||E&&C))&&(p=h==="x"?I:T)}let F={x:u.x+y.x,y:u.y+y.y},z={x:d.x+v.x,y:d.y+v.y},H=Math.max(Math.abs(F.x-p[0].x),Math.abs(z.x-p[0].x)),O=Math.max(Math.abs(F.y-p[0].y),Math.abs(z.y-p[0].y));H>=O?(S=(F.x+z.x)/2,b=p[0].y):(S=p[0].x,b=(F.y+z.y)/2)}let N={x:u.x+y.x,y:u.y+y.y},_={x:d.x+v.x,y:d.y+v.y};return[[e,...N.x!==p[0].x||N.y!==p[0].y?[N]:[],...p,..._.x!==p[p.length-1].x||_.y!==p[p.length-1].y?[_]:[],n],S,b,m,w]}o(Vd,"getPoints");function Fd(e,t,n,r){let i=Math.min(ji(e,t)/2,ji(t,n)/2,r),{x:s,y:a}=t;if(e.x===s&&s===n.x||e.y===a&&a===n.y)return`L${s} ${a}`;if(e.y===a){let u=e.x<n.x?-1:1,d=e.y<n.y?1:-1;return`L ${s+i*u},${a}Q ${s},${a} ${s},${a+i*d}`}let c=e.x<n.x?1:-1,l=e.y<n.y?-1:1;return`L ${s},${a+i*l}Q ${s},${a} ${s+i*c},${a}`}o(Fd,"getBend");function fn({sourceX:e,sourceY:t,sourcePosition:n=Y.Bottom,targetX:r,targetY:i,targetPosition:s=Y.Top,borderRadius:a=5,centerX:c,centerY:l,offset:u=20,stepPosition:d=.5}){let[f,h,g,p,S]=Vd({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:i},targetPosition:s,center:{x:c,y:l},offset:u,stepPosition:d}),b=`M${f[0].x} ${f[0].y}`;for(let y=1;y<f.length-1;y++)b+=Fd(f[y-1],f[y],f[y+1],a);return b+=`L${f[f.length-1].x} ${f[f.length-1].y}`,[b,h,g,p,S]}o(fn,"getSmoothStepPath");function es(e){return e&&!!(e.internals.handleBounds||e.handles?.length)&&!!(e.measured.width||e.width||e.initialWidth)}o(es,"isNodeInitialized");function xs(e){let{sourceNode:t,targetNode:n}=e;if(!es(t)||!es(n))return null;let r=t.internals.handleBounds||ts(t.handles),i=n.internals.handleBounds||ts(n.handles),s=ns(r?.source??[],e.sourceHandle),a=ns(e.connectionMode===Xe.Strict?i?.target??[]:(i?.target??[]).concat(i?.source??[]),e.targetHandle);if(!s||!a)return e.onError?.("008",ye.error008(s?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;let c=s?.position||Y.Bottom,l=a?.position||Y.Top,u=Ye(t,s,c),d=Ye(n,a,l);return{sourceX:u.x,sourceY:u.y,targetX:d.x,targetY:d.y,sourcePosition:c,targetPosition:l}}o(xs,"getEdgePosition");function ts(e){if(!e)return null;let t=[],n=[];for(let r of e)r.width=r.width??1,r.height=r.height??1,r.type==="source"?t.push(r):r.type==="target"&&n.push(r);return{source:t,target:n}}o(ts,"toHandleBounds");function Ye(e,t,n=Y.Left,r=!1){let i=(t?.x??0)+e.internals.positionAbsolute.x,s=(t?.y??0)+e.internals.positionAbsolute.y,{width:a,height:c}=t??Ee(e);if(r)return{x:i+a/2,y:s+c/2};switch(t?.position??n){case Y.Top:return{x:i+a/2,y:s};case Y.Right:return{x:i+a,y:s+c/2};case Y.Bottom:return{x:i+a/2,y:s+c};case Y.Left:return{x:i,y:s+c/2}}}o(Ye,"getHandlePosition");function ns(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}o(ns,"getHandle$1");function Yn(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}o(Yn,"getMarkerId");function ws(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:i}){let s=new Set;return e.reduce((a,c)=>([c.markerStart||r,c.markerEnd||i].forEach(l=>{if(l&&typeof l=="object"){let u=Yn(l,t);s.has(u)||(a.push({id:u,color:l.color||n,...l}),s.add(u))}}),a),[]).sort((a,c)=>a.id.localeCompare(c.id))}o(ws,"createMarkerIds");var bs=1e3,Wd=10,Xr={nodeOrigin:[0,0],nodeExtent:Et,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},Xd={...Xr,checkEquality:!0};function Yr(e,t){let n={...e};for(let r in t)t[r]!==void 0&&(n[r]=t[r]);return n}o(Yr,"mergeObjects");function Ss(e,t,n){let r=Yr(Xr,n);for(let i of e.values())if(i.parentId)Ur(i,e,t,r);else{let s=ln(i,r.nodeOrigin),a=ct(i.extent)?i.extent:r.nodeExtent,c=st(s,a,Ee(i));i.internals.positionAbsolute=c}}o(Ss,"updateAbsolutePositions");function Yd(e,t){if(!e.handles)return e.measured?t?.internals.handleBounds:void 0;let n=[],r=[];for(let i of e.handles){let s={id:i.id,width:i.width??1,height:i.height??1,nodeId:e.id,x:i.x,y:i.y,position:i.position,type:i.type};i.type==="source"?n.push(s):i.type==="target"&&r.push(s)}return{source:n,target:r}}o(Yd,"parseHandles");function Zr(e){return e==="manual"}o(Zr,"isManualZIndexMode");function Zn(e,t,n,r={}){let i=Yr(Xd,r),s={i:0},a=new Map(t),c=i?.elevateNodesOnSelect&&!Zr(i.zIndexMode)?bs:0,l=e.length>0,u=!1;t.clear(),n.clear();for(let d of e){let f=a.get(d.id);if(i.checkEquality&&d===f?.internals.userNode)t.set(d.id,f);else{let h=ln(d,i.nodeOrigin),g=ct(d.extent)?d.extent:i.nodeExtent,p=st(h,g,Ee(d));f={...i.defaults,...d,measured:{width:d.measured?.width,height:d.measured?.height},internals:{positionAbsolute:p,handleBounds:Yd(d,f),z:vs(d,c,i.zIndexMode),userNode:d}},t.set(d.id,f)}(f.measured===void 0||f.measured.width===void 0||f.measured.height===void 0)&&!f.hidden&&(l=!1),d.parentId&&Ur(f,t,n,r,s),u||=d.selected??!1}return{nodesInitialized:l,hasSelectedNodes:u}}o(Zn,"adoptUserNodes");function Zd(e,t){if(!e.parentId)return;let n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}o(Zd,"updateParentLookup");function Ur(e,t,n,r,i){let{elevateNodesOnSelect:s,nodeOrigin:a,nodeExtent:c,zIndexMode:l}=Yr(Xr,r),u=e.parentId,d=t.get(u);if(!d){console.warn(`Parent node ${u} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}Zd(e,n),i&&!d.parentId&&d.internals.rootParentIndex===void 0&&l==="auto"&&(d.internals.rootParentIndex=++i.i,d.internals.z=d.internals.z+i.i*Wd),i&&d.internals.rootParentIndex!==void 0&&(i.i=d.internals.rootParentIndex);let f=s&&!Zr(l)?bs:0,{x:h,y:g,z:p}=Ud(e,d,a,c,f,l),{positionAbsolute:S}=e.internals,b=h!==S.x||g!==S.y;(b||p!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:b?{x:h,y:g}:S,z:p}})}o(Ur,"updateChildNode");function vs(e,t,n){let r=we(e.zIndex)?e.zIndex:0;return Zr(n)?r:r+(e.selected?t:0)}o(vs,"calculateZ");function Ud(e,t,n,r,i,s){let{x:a,y:c}=t.internals.positionAbsolute,l=Ee(e),u=ln(e,n),d=ct(e.extent)?st(u,e.extent,l):u,f=st({x:a+d.x,y:c+d.y},r,l);e.extent==="parent"&&(f=ds(f,l,t));let h=vs(e,i,s),g=t.internals.z??0;return{x:f.x,y:f.y,z:g>=h?g+1:h}}o(Ud,"calculateChildXYZ");function Un(e,t,n,r=[0,0]){let i=[],s=new Map;for(let a of e){let c=t.get(a.parentId);if(!c)continue;let l=s.get(a.parentId)?.expandedRect??_t(c),u=zr(l,a.rect);s.set(a.parentId,{expandedRect:u,parent:c})}return s.size>0&&s.forEach(({expandedRect:a,parent:c},l)=>{let u=c.internals.positionAbsolute,d=Ee(c),f=c.origin??r,h=a.x<u.x?Math.round(Math.abs(u.x-a.x)):0,g=a.y<u.y?Math.round(Math.abs(u.y-a.y)):0,p=Math.max(d.width,Math.round(a.width)),S=Math.max(d.height,Math.round(a.height)),b=(p-d.width)*f[0],y=(S-d.height)*f[1];(h>0||g>0||b||y)&&(i.push({id:l,type:"position",position:{x:c.position.x-h+b,y:c.position.y-g+y}}),n.get(l)?.forEach(v=>{e.some(m=>m.id===v.id)||i.push({id:v.id,type:"position",position:{x:v.position.x+h,y:v.position.y+g}})})),(d.width<a.width||d.height<a.height||h||g)&&i.push({id:l,type:"dimensions",setAttributes:!0,dimensions:{width:p+(h?f[0]*h-b:0),height:S+(g?f[1]*g-y:0)}})}),i}o(Un,"handleExpandParent");function Es(e,t,n,r,i,s,a){let c=r?.querySelector(".xyflow__viewport"),l=!1;if(!c)return{changes:[],updatedInternals:l};let u=[],d=window.getComputedStyle(c),{m22:f}=new window.DOMMatrixReadOnly(d.transform),h=[];for(let g of e.values()){let p=t.get(g.id);if(!p)continue;if(p.hidden){t.set(p.id,{...p,internals:{...p.internals,handleBounds:void 0}}),l=!0;continue}let S=Vn(g.nodeElement),b=p.measured.width!==S.width||p.measured.height!==S.height;if(!!(S.width&&S.height&&(b||!p.internals.handleBounds||g.force))){let v=g.nodeElement.getBoundingClientRect(),m=ct(p.extent)?p.extent:s,{positionAbsolute:w}=p.internals;if(p.parentId&&p.extent==="parent"){let _=t.get(p.parentId);_&&(w=ds(w,S,_))}else m&&(w=st(w,m,S));let N={...p,measured:S,internals:{...p.internals,positionAbsolute:w,handleBounds:{source:Gi("source",g.nodeElement,v,f,p.id),target:Gi("target",g.nodeElement,v,f,p.id)}}};t.set(p.id,N),p.parentId&&Ur(N,t,n,{nodeOrigin:i,zIndexMode:a}),l=!0,b&&(u.push({id:p.id,type:"dimensions",dimensions:S}),p.expandParent&&p.parentId&&h.push({id:p.id,parentId:p.parentId,rect:_t(N,i)}))}}if(h.length>0){let g=Un(h,t,n,i);u.push(...g)}return{changes:u,updatedInternals:l}}o(Es,"updateNodeInternals");async function Cs({delta:e,panZoom:t,transform:n,translateExtent:r,width:i,height:s}){if(!t||!e.x&&!e.y)return!1;let a=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[i,s]],r);return!!a&&(a.x!==n[0]||a.y!==n[1]||a.k!==n[2])}o(Cs,"panBy");function os(e,t,n,r,i,s){let a=i,c=r.get(a)||new Map;r.set(a,c.set(n,t)),a=`${i}-${e}`;let l=r.get(a)||new Map;if(r.set(a,l.set(n,t)),s){a=`${i}-${e}-${s}`;let u=r.get(a)||new Map;r.set(a,u.set(n,t))}}o(os,"addConnectionToLookup");function qr(e,t,n){e.clear(),t.clear();for(let r of n){let{source:i,target:s,sourceHandle:a=null,targetHandle:c=null}=r,l={edgeId:r.id,source:i,target:s,sourceHandle:a,targetHandle:c},u=`${i}-${a}--${s}-${c}`,d=`${s}-${c}--${i}-${a}`;os("source",l,d,e,i,a),os("target",l,u,e,s,c),t.set(r.id,r)}}o(qr,"updateConnectionLookup");function _s(e,t){if(!e.parentId)return!1;let n=t.get(e.parentId);return n?n.selected?!0:_s(n,t):!1}o(_s,"isParentSelected");function rs(e,t,n){let r=e;do{if(r?.matches?.(t))return!0;if(r===n)return!1;r=r?.parentElement}while(r);return!1}o(rs,"hasSelector");function qd(e,t,n,r){let i=new Map;for(let[s,a]of e)if((a.selected||a.id===r)&&(!a.parentId||!_s(a,e))&&(a.draggable||t&&typeof a.draggable>"u")){let c=e.get(s);c&&i.set(s,{id:s,position:c.position||{x:0,y:0},distance:{x:n.x-c.internals.positionAbsolute.x,y:n.y-c.internals.positionAbsolute.y},extent:c.extent,parentId:c.parentId,origin:c.origin,expandParent:c.expandParent,internals:{positionAbsolute:c.internals.positionAbsolute||{x:0,y:0}},measured:{width:c.measured.width??0,height:c.measured.height??0}})}return i}o(qd,"getDragItems");function Cr({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){let i=[];for(let[a,c]of t){let l=n.get(a)?.internals.userNode;l&&i.push({...l,position:c.position,dragging:r})}if(!e)return[i[0],i];let s=n.get(e)?.internals.userNode;return[s?{...s,position:t.get(e)?.position||s.position,dragging:r}:i[0],i]}o(Cr,"getEventHandlerParams");function Kd({dragItems:e,snapGrid:t,x:n,y:r}){let i=e.values().next().value;if(!i)return null;let s={x:n-i.distance.x,y:r-i.distance.y},a=Nt(s,t);return{x:a.x-s.x,y:a.y-s.y}}o(Kd,"calculateSnapOffset");function Ns({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:i}){let s={x:null,y:null},a=0,c=new Map,l=!1,u={x:0,y:0},d=null,f=!1,h=null,g=!1,p=!1,S=null;function b({noDragClassName:v,handleSelector:m,domNode:w,isSelectable:N,nodeId:_,nodeClickDistance:P=0}){h=le(w);function I({x:H,y:O}){let{nodeLookup:x,nodeExtent:E,snapGrid:C,snapToGrid:M,nodeOrigin:R,onNodeDrag:D,onSelectionDrag:V,onError:B,updateNodePositions:L}=t();s={x:H,y:O};let U=!1,X=c.size>1,K=X&&E?Mr(Ct(c)):null,ee=X&&M?Kd({dragItems:c,snapGrid:C,x:H,y:O}):null;for(let[G,$]of c){if(!x.has(G))continue;let W={x:H-$.distance.x,y:O-$.distance.y};M&&(W=ee?{x:Math.round(W.x+ee.x),y:Math.round(W.y+ee.y)}:Nt(W,C));let j=null;if(X&&E&&!$.extent&&K){let{positionAbsolute:Q}=$.internals,ne=Q.x-K.x+E[0][0],oe=Q.x+$.measured.width-K.x2+E[1][0],se=Q.y-K.y+E[0][1],pe=Q.y+$.measured.height-K.y2+E[1][1];j=[[ne,se],[oe,pe]]}let{position:J,positionAbsolute:q}=Rr({nodeId:G,nextPosition:W,nodeLookup:x,nodeExtent:j||E,nodeOrigin:R,onError:B});U=U||$.position.x!==J.x||$.position.y!==J.y,$.position=J,$.internals.positionAbsolute=q}if(p=p||U,!!U&&(L(c,!0),S&&(r||D||!_&&V))){let[G,$]=Cr({nodeId:_,dragItems:c,nodeLookup:x});r?.(S,c,G,$),D?.(S,G,$),_||V?.(S,$)}}o(I,"updateNodes");async function T(){if(!d)return;let{transform:H,panBy:O,autoPanSpeed:x,autoPanOnNodeDrag:E}=t();if(!E){l=!1,cancelAnimationFrame(a);return}let[C,M]=$n(u,d,x);(C!==0||M!==0)&&(s.x=(s.x??0)-C/H[2],s.y=(s.y??0)-M/H[2],await O({x:C,y:M})&&I(s)),a=requestAnimationFrame(T)}o(T,"autoPan");function F(H){let{nodeLookup:O,multiSelectionActive:x,nodesDraggable:E,transform:C,snapGrid:M,snapToGrid:R,selectNodesOnDrag:D,onNodeDragStart:V,onSelectionDragStart:B,unselectNodesAndEdges:L}=t();f=!0,(!D||!N)&&!x&&_&&(O.get(_)?.selected||L()),N&&D&&_&&e?.(_);let U=cn(H.sourceEvent,{transform:C,snapGrid:M,snapToGrid:R,containerBounds:d});if(s=U,c=qd(O,E,U,_),c.size>0&&(n||V||!_&&B)){let[X,K]=Cr({nodeId:_,dragItems:c,nodeLookup:O});n?.(H.sourceEvent,c,X,K),V?.(H.sourceEvent,X,K),_||B?.(H.sourceEvent,K)}}o(F,"startDrag");let z=Ut().clickDistance(P).on("start",H=>{let{domNode:O,nodeDragThreshold:x,transform:E,snapGrid:C,snapToGrid:M}=t();d=O?.getBoundingClientRect()||null,g=!1,p=!1,S=H.sourceEvent,x===0&&F(H),s=cn(H.sourceEvent,{transform:E,snapGrid:C,snapToGrid:M,containerBounds:d}),u=be(H.sourceEvent,d)}).on("drag",H=>{let{autoPanOnNodeDrag:O,transform:x,snapGrid:E,snapToGrid:C,nodeDragThreshold:M,nodeLookup:R}=t(),D=cn(H.sourceEvent,{transform:x,snapGrid:E,snapToGrid:C,containerBounds:d});if(S=H.sourceEvent,(H.sourceEvent.type==="touchmove"&&H.sourceEvent.touches.length>1||_&&!R.has(_))&&(g=!0),!g){if(!l&&O&&f&&(l=!0,T()),!f){let V=be(H.sourceEvent,d),B=V.x-u.x,L=V.y-u.y;Math.sqrt(B*B+L*L)>M&&F(H)}(s.x!==D.xSnapped||s.y!==D.ySnapped)&&c&&f&&(u=be(H.sourceEvent,d),I(D))}}).on("end",H=>{if(!f||g){g&&c.size>0&&t().updateNodePositions(c,!1);return}if(l=!1,f=!1,cancelAnimationFrame(a),c.size>0){let{nodeLookup:O,updateNodePositions:x,onNodeDragStop:E,onSelectionDragStop:C}=t();if(p&&(x(c,!1),p=!1),i||E||!_&&C){let[M,R]=Cr({nodeId:_,dragItems:c,nodeLookup:O,dragging:!1});i?.(H.sourceEvent,c,M,R),E?.(H.sourceEvent,M,R),_||C?.(H.sourceEvent,R)}}}).filter(H=>{let O=H.target;return!H.button&&(!v||!rs(O,`.${v}`,w))&&(!m||rs(O,m,w))});h.call(z)}o(b,"update");function y(){h?.on(".drag",null)}return o(y,"destroy"),{update:b,destroy:y}}o(Ns,"XYDrag");function Gd(e,t,n){let r=[],i={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(let s of t.values())dn(i,_t(s))>0&&r.push(s);return r}o(Gd,"getNodesWithinDistance");var Qd=250;function Jd(e,t,n,r){let i=[],s=1/0,a=Gd(e,n,t+Qd);for(let c of a){let l=[...c.internals.handleBounds?.source??[],...c.internals.handleBounds?.target??[]];for(let u of l){if(r.nodeId===u.nodeId&&r.type===u.type&&r.id===u.id)continue;let{x:d,y:f}=Ye(c,u,u.position,!0),h=Math.sqrt(Math.pow(d-e.x,2)+Math.pow(f-e.y,2));h>t||(h<s?(i=[{...u,x:d,y:f}],s=h):h===s&&i.push({...u,x:d,y:f}))}}if(!i.length)return null;if(i.length>1){let c=r.type==="source"?"target":"source";return i.find(l=>l.type===c)??i[0]}return i[0]}o(Jd,"getClosestHandle");function Ms(e,t,n,r,i,s=!1){let a=r.get(e);if(!a)return null;let c=i==="strict"?a.internals.handleBounds?.[t]:[...a.internals.handleBounds?.source??[],...a.internals.handleBounds?.target??[]],l=(n?c?.find(u=>u.id===n):c?.[0])??null;return l&&s?{...l,...Ye(a,l,l.position,!0)}:l}o(Ms,"getHandle");function Is(e,t){return e||(t?.classList.contains("target")?"target":t?.classList.contains("source")?"source":null)}o(Is,"getHandleType");function jd(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}o(jd,"isConnectionValid");var Ps=o(()=>!0,"alwaysValid");function ef(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:i,edgeUpdaterType:s,isTarget:a,domNode:c,nodeLookup:l,lib:u,autoPanOnConnect:d,flowId:f,panBy:h,cancelConnection:g,onConnectStart:p,onConnect:S,onConnectEnd:b,isValidConnection:y=Ps,onReconnectEnd:v,updateConnection:m,getTransform:w,getFromHandle:N,autoPanSpeed:_,dragThreshold:P=1,handleDomNode:I}){let T=Br(e.target),F=0,z,{x:H,y:O}=be(e),x=Is(s,I),E=c?.getBoundingClientRect(),C=!1;if(!E||!x)return;let M=Ms(i,x,r,l,t);if(!M)return;let R=be(e,E),D=!1,V=null,B=!1,L=null;function U(){if(!d||!E)return;let[J,q]=$n(R,E,_);h({x:J,y:q}),F=requestAnimationFrame(U)}o(U,"autoPan");let X={...M,nodeId:i,type:x,position:M.position},K=l.get(i),G={inProgress:!0,isValid:null,from:Ye(K,X,Y.Left,!0),fromHandle:X,fromPosition:X.position,fromNode:K,to:R,toHandle:null,toPosition:qi[X.position],toNode:null,pointer:R};function $(){C=!0,m(G),p?.(e,{nodeId:i,handleId:r,handleType:x})}o($,"startConnection"),P===0&&$();function W(J){if(!C){let{x:pe,y:Pe}=be(J),_e=pe-H,Ne=Pe-O;if(!(_e*_e+Ne*Ne>P*P))return;$()}if(!N()||!X){j(J);return}let q=w();R=be(J,E),z=Jd(Mt(R,q,!1,[1,1]),n,l,X),D||(U(),D=!0);let Q=ks(J,{handle:z,connectionMode:t,fromNodeId:i,fromHandleId:r,fromType:a?"target":"source",isValidConnection:y,doc:T,lib:u,flowId:f,nodeLookup:l});L=Q.handleDomNode,V=Q.connection,B=jd(!!z,Q.isValid);let ne=l.get(i),oe=ne?Ye(ne,X,Y.Left,!0):G.from,se={...G,from:oe,isValid:B,to:Q.toHandle&&B?at({x:Q.toHandle.x,y:Q.toHandle.y},q):R,toHandle:Q.toHandle,toPosition:B&&Q.toHandle?Q.toHandle.position:qi[X.position],toNode:Q.toHandle?l.get(Q.toHandle.nodeId):null,pointer:R};m(se),G=se}o(W,"onPointerMove");function j(J){if(!("touches"in J&&J.touches.length>0)){if(C){(z||L)&&V&&B&&S?.(V);let{inProgress:q,...Q}=G,ne={...Q,toPosition:G.toHandle?G.toPosition:null};b?.(J,ne),s&&v?.(J,ne)}g(),cancelAnimationFrame(F),D=!1,B=!1,V=null,L=null,T.removeEventListener("mousemove",W),T.removeEventListener("mouseup",j),T.removeEventListener("touchmove",W),T.removeEventListener("touchend",j)}}o(j,"onPointerUp"),T.addEventListener("mousemove",W),T.addEventListener("mouseup",j),T.addEventListener("touchmove",W),T.addEventListener("touchend",j)}o(ef,"onPointerDown");function ks(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:s,doc:a,lib:c,flowId:l,isValidConnection:u=Ps,nodeLookup:d}){let f=s==="target",h=t?a.querySelector(`.${c}-flow__handle[data-id="${l}-${t?.nodeId}-${t?.id}-${t?.type}"]`):null,{x:g,y:p}=be(e),S=a.elementFromPoint(g,p),b=S?.classList.contains(`${c}-flow__handle`)?S:h,y={handleDomNode:b,isValid:!1,connection:null,toHandle:null};if(b){let v=Is(void 0,b),m=b.getAttribute("data-nodeid"),w=b.getAttribute("data-handleid"),N=b.classList.contains("connectable"),_=b.classList.contains("connectableend");if(!m||!v)return y;let P={source:f?m:r,sourceHandle:f?w:i,target:f?r:m,targetHandle:f?i:w};y.connection=P;let T=N&&_&&(n===Xe.Strict?f&&v==="source"||!f&&v==="target":m!==r||w!==i);y.isValid=T&&u(P),y.toHandle=Ms(m,v,w,d,n,!0)}return y}o(ks,"isValidHandle");var qn={onPointerDown:ef,isValid:ks};function As({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){let i=le(e);function s({translateExtent:c,width:l,height:u,zoomStep:d=1,pannable:f=!0,zoomable:h=!0,inversePan:g=!1}){let p=o(m=>{if(m.sourceEvent.type!=="wheel"||!t)return;let w=n(),N=m.sourceEvent.ctrlKey&&It()?10:1,_=-m.sourceEvent.deltaY*(m.sourceEvent.deltaMode===1?.05:m.sourceEvent.deltaMode?1:.002)*d,P=w[2]*Math.pow(2,_*N);t.scaleTo(P)},"zoomHandler"),S=[0,0],b=o(m=>{(m.sourceEvent.type==="mousedown"||m.sourceEvent.type==="touchstart")&&(S=[m.sourceEvent.clientX??m.sourceEvent.touches[0].clientX,m.sourceEvent.clientY??m.sourceEvent.touches[0].clientY])},"panStartHandler"),y=o(m=>{let w=n();if(m.sourceEvent.type!=="mousemove"&&m.sourceEvent.type!=="touchmove"||!t)return;let N=[m.sourceEvent.clientX??m.sourceEvent.touches[0].clientX,m.sourceEvent.clientY??m.sourceEvent.touches[0].clientY],_=[N[0]-S[0],N[1]-S[1]];S=N;let P=r()*Math.max(w[2],Math.log(w[2]))*(g?-1:1),I={x:w[0]-_[0]*P,y:w[1]-_[1]*P},T=[[0,0],[l,u]];t.setViewportConstrained({x:I.x,y:I.y,zoom:w[2]},T,c)},"panHandler"),v=an().on("start",b).on("zoom",f?y:null).on("zoom.wheel",h?p:null);i.call(v,{})}o(s,"update");function a(){i.on("zoom",null)}return o(a,"destroy"),{update:s,destroy:a,pointer:fe}}o(As,"XYMinimap");var Kn=o(e=>({x:e.x,y:e.y,zoom:e.k}),"transformToViewport"),_r=o(({x:e,y:t,zoom:n})=>ot.translate(e,t).scale(n),"viewportToTransform"),bt=o((e,t)=>e.target.closest(`.${t}`),"isWrappedWithClass"),Ts=o((e,t)=>t===2&&Array.isArray(e)&&e.includes(2),"isRightClickPan"),tf=o(e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,"defaultEase"),Nr=o((e,t=0,n=tf,r=()=>{})=>{let i=typeof t=="number"&&t>0;return i||r(),i?e.transition().duration(t).ease(n).on("end",r):e},"getD3Transition"),Ds=o(e=>{let t=e.ctrlKey&&It()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t},"wheelDelta");function nf({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:i,panOnScrollSpeed:s,zoomOnPinch:a,onPanZoomStart:c,onPanZoom:l,onPanZoomEnd:u}){return d=>{if(bt(d,t))return d.ctrlKey&&d.preventDefault(),!1;d.preventDefault(),d.stopImmediatePropagation();let f=n.property("__zoom").k||1;if(d.ctrlKey&&a){let b=fe(d),y=Ds(d),v=f*Math.pow(2,y);r.scaleTo(n,v,b,d);return}let h=d.deltaMode===1?20:1,g=i===$e.Vertical?0:d.deltaX*h,p=i===$e.Horizontal?0:d.deltaY*h;!It()&&d.shiftKey&&i!==$e.Vertical&&(g=d.deltaY*h,p=0),r.translateBy(n,-(g/f)*s,-(p/f)*s,{internal:!0});let S=Kn(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?l?.(d,S):(e.isPanScrolling=!0,c?.(d,S)),e.panScrollTimeout=setTimeout(()=>{u?.(d,S),e.isPanScrolling=!1},150)}}o(nf,"createPanOnScrollHandler");function of({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,i){let s=r.type==="wheel",a=!t&&s&&!r.ctrlKey,c=bt(r,e);if(r.ctrlKey&&s&&c&&r.preventDefault(),a||c)return null;r.preventDefault(),n.call(this,r,i)}}o(of,"createZoomOnScrollHandler");function rf({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{if(r.sourceEvent?.internal)return;let i=Kn(r.transform);e.mouseButton=r.sourceEvent?.button||0,e.isZoomingOrPanning=!0,e.prevViewport=i,r.sourceEvent?.type==="mousedown"&&t(!0),n&&n?.(r.sourceEvent,i)}}o(rf,"createPanZoomStartHandler");function sf({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:i}){return s=>{e.usedRightMouseButton=!!(n&&Ts(t,e.mouseButton??0)),s.sourceEvent?.sync||r([s.transform.x,s.transform.y,s.transform.k]),i&&!s.sourceEvent?.internal&&i?.(s.sourceEvent,Kn(s.transform))}}o(sf,"createPanZoomHandler");function af({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:i,onPaneContextMenu:s}){return a=>{if(!a.sourceEvent?.internal&&(e.isZoomingOrPanning=!1,s&&Ts(t,e.mouseButton??0)&&!e.usedRightMouseButton&&a.sourceEvent&&s(a.sourceEvent),e.usedRightMouseButton=!1,r(!1),i)){let c=Kn(a.transform);e.prevViewport=c,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{i?.(a.sourceEvent,c)},n?150:0)}}}o(af,"createPanZoomEndHandler");function cf({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:i,zoomOnDoubleClick:s,userSelectionActive:a,noWheelClassName:c,noPanClassName:l,lib:u,connectionInProgress:d}){return f=>{let h=e||t,g=n&&f.ctrlKey,p=f.type==="wheel";if(f.button===1&&f.type==="mousedown"&&(bt(f,`${u}-flow__node`)||bt(f,`${u}-flow__edge`)))return!0;if(!r&&!h&&!i&&!s&&!n||a||d&&!p||bt(f,c)&&p||bt(f,l)&&(!p||i&&p&&!e)||!n&&f.ctrlKey&&p)return!1;if(!n&&f.type==="touchstart"&&f.touches?.length>1)return f.preventDefault(),!1;if(!h&&!i&&!g&&p||!r&&(f.type==="mousedown"||f.type==="touchstart")||Array.isArray(r)&&!r.includes(f.button)&&f.type==="mousedown")return!1;let S=Array.isArray(r)&&r.includes(f.button)||!f.button||f.button<=1;return(!f.ctrlKey||p)&&S}}o(cf,"createFilter");function Rs({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:i,onPanZoom:s,onPanZoomStart:a,onPanZoomEnd:c,onDraggingChange:l}){let u={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},d=e.getBoundingClientRect(),f=[[0,0],[d.width,d.height]];(typeof ResizeObserver<"u"?new ResizeObserver(O=>{let x=O[0];x&&(f=[[0,0],[x.contentRect.width,x.contentRect.height]])}):null)?.observe(e);let g=an().extent(()=>f).scaleExtent([t,n]).translateExtent(r),p=le(e).call(g);w({x:i.x,y:i.y,zoom:vt(i.zoom,t,n)},[[0,0],[d.width,d.height]],r);let S=p.on("wheel.zoom"),b=p.on("dblclick.zoom");g.wheelDelta(Ds);async function y(O,x){return p?new Promise(E=>{g?.interpolate(x?.interpolate==="linear"?yn:ht).transform(Nr(p,x?.duration,x?.ease,()=>E(!0)),O)}):!1}o(y,"setTransform");function v({noWheelClassName:O,noPanClassName:x,onPaneContextMenu:E,userSelectionActive:C,panOnScroll:M,panOnDrag:R,panOnScrollMode:D,panOnScrollSpeed:V,preventScrolling:B,zoomOnPinch:L,zoomOnScroll:U,zoomOnDoubleClick:X,zoomActivationKeyPressed:K,lib:ee,onTransformChange:G,connectionInProgress:$,paneClickDistance:W,selectionOnDrag:j}){C&&!u.isZoomingOrPanning&&m();let J=M&&!K&&!C;g.clickDistance(j?1/0:!we(W)||W<0?0:W);let q=J?nf({zoomPanValues:u,noWheelClassName:O,d3Selection:p,d3Zoom:g,panOnScrollMode:D,panOnScrollSpeed:V,zoomOnPinch:L,onPanZoomStart:a,onPanZoom:s,onPanZoomEnd:c}):of({noWheelClassName:O,preventScrolling:B,d3ZoomHandler:S});p.on("wheel.zoom",q,{passive:!1});let Q=rf({zoomPanValues:u,onDraggingChange:l,onPanZoomStart:a});g.on("start",Q);let ne=sf({zoomPanValues:u,panOnDrag:R,onPaneContextMenu:!!E,onPanZoom:s,onTransformChange:G});g.on("zoom",ne);let oe=af({zoomPanValues:u,panOnDrag:R,panOnScroll:M,onPaneContextMenu:E,onPanZoomEnd:c,onDraggingChange:l});g.on("end",oe);let se=cf({zoomActivationKeyPressed:K,panOnDrag:R,zoomOnScroll:U,panOnScroll:M,zoomOnDoubleClick:X,zoomOnPinch:L,userSelectionActive:C,noPanClassName:x,noWheelClassName:O,lib:ee,connectionInProgress:$});g.filter(se),X?p.on("dblclick.zoom",b):p.on("dblclick.zoom",null)}o(v,"update");function m(){g.on("zoom",null)}o(m,"destroy");async function w(O,x,E){let C=_r(O),M=g?.constrain()(C,x,E);return M&&await y(M),M}o(w,"setViewportConstrained");async function N(O,x){let E=_r(O);return await y(E,x),E}o(N,"setViewport");function _(O){if(p){let x=_r(O),E=p.property("__zoom");(E.k!==O.zoom||E.x!==O.x||E.y!==O.y)&&g?.transform(p,x,null,{sync:!0})}}o(_,"syncViewport");function P(){let O=p?sn(p.node()):{x:0,y:0,k:1};return{x:O.x,y:O.y,zoom:O.k}}o(P,"getViewport");async function I(O,x){return p?new Promise(E=>{g?.interpolate(x?.interpolate==="linear"?yn:ht).scaleTo(Nr(p,x?.duration,x?.ease,()=>E(!0)),O)}):!1}o(I,"scaleTo");async function T(O,x){return p?new Promise(E=>{g?.interpolate(x?.interpolate==="linear"?yn:ht).scaleBy(Nr(p,x?.duration,x?.ease,()=>E(!0)),O)}):!1}o(T,"scaleBy");function F(O){g?.scaleExtent(O)}o(F,"setScaleExtent");function z(O){g?.translateExtent(O)}o(z,"setTranslateExtent");function H(O){let x=!we(O)||O<0?0:O;g?.clickDistance(x)}return o(H,"setClickDistance"),{update:v,destroy:m,setViewport:N,setViewportConstrained:w,getViewport:P,scaleTo:I,scaleBy:T,setScaleExtent:F,setTranslateExtent:z,syncViewport:_,setClickDistance:H}}o(Rs,"XYPanZoom");var Ze;(function(e){e.Line="line",e.Handle="handle"})(Ze||(Ze={}));function lf({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:i,affectsY:s}){let a=e-t,c=n-r,l=[a>0?1:a<0?-1:0,c>0?1:c<0?-1:0];return a&&i&&(l[0]=l[0]*-1),c&&s&&(l[1]=l[1]*-1),l}o(lf,"getResizeDirection");function is(e){let t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),r=e.includes("left"),i=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:r,affectsY:i}}o(is,"getControlDirection");function Fe(e,t){return Math.max(0,t-e)}o(Fe,"getLowerExtentClamp");function We(e,t){return Math.max(0,e-t)}o(We,"getUpperExtentClamp");function Rn(e,t,n){return Math.max(0,t-e,e-n)}o(Rn,"getSizeClamp");function ss(e,t){return e?!t:t}o(ss,"xor");function uf(e,t,n,r,i,s,a,c){let{affectsX:l,affectsY:u}=t,{isHorizontal:d,isVertical:f}=t,h=d&&f,{xSnapped:g,ySnapped:p}=n,{minWidth:S,maxWidth:b,minHeight:y,maxHeight:v}=r,{x:m,y:w,width:N,height:_,aspectRatio:P}=e,I=Math.floor(d?g-e.pointerX:0),T=Math.floor(f?p-e.pointerY:0),F=N+(l?-I:I),z=_+(u?-T:T),H=-s[0]*N,O=-s[1]*_,x=Rn(F,S,b),E=Rn(z,y,v);if(a){let R=0,D=0;l&&I<0?R=Fe(m+I+H,a[0][0]):!l&&I>0&&(R=We(m+F+H,a[1][0])),u&&T<0?D=Fe(w+T+O,a[0][1]):!u&&T>0&&(D=We(w+z+O,a[1][1])),x=Math.max(x,R),E=Math.max(E,D)}if(c){let R=0,D=0;l&&I>0?R=We(m+I,c[0][0]):!l&&I<0&&(R=Fe(m+F,c[1][0])),u&&T>0?D=We(w+T,c[0][1]):!u&&T<0&&(D=Fe(w+z,c[1][1])),x=Math.max(x,R),E=Math.max(E,D)}if(i){if(d){let R=Rn(F/P,y,v)*P;if(x=Math.max(x,R),a){let D=0;!l&&!u||l&&!u&&h?D=We(w+O+F/P,a[1][1])*P:D=Fe(w+O+(l?I:-I)/P,a[0][1])*P,x=Math.max(x,D)}if(c){let D=0;!l&&!u||l&&!u&&h?D=Fe(w+F/P,c[1][1])*P:D=We(w+(l?I:-I)/P,c[0][1])*P,x=Math.max(x,D)}}if(f){let R=Rn(z*P,S,b)/P;if(E=Math.max(E,R),a){let D=0;!l&&!u||u&&!l&&h?D=We(m+z*P+H,a[1][0])/P:D=Fe(m+(u?T:-T)*P+H,a[0][0])/P,E=Math.max(E,D)}if(c){let D=0;!l&&!u||u&&!l&&h?D=Fe(m+z*P,c[1][0])/P:D=We(m+(u?T:-T)*P,c[0][0])/P,E=Math.max(E,D)}}}T=T+(T<0?E:-E),I=I+(I<0?x:-x),i&&(h?F>z*P?T=(ss(l,u)?-I:I)/P:I=(ss(l,u)?-T:T)*P:d?(T=I/P,u=l):(I=T*P,l=u));let C=l?m+I:m,M=u?w+T:w;return{width:N+(l?-I:I),height:_+(u?-T:T),x:s[0]*I*(l?-1:1)+C,y:s[1]*T*(u?-1:1)+M}}o(uf,"getDimensionsAfterResize");var zs={width:0,height:0,x:0,y:0},df={...zs,pointerX:0,pointerY:0,aspectRatio:1};function ff(e,t,n){let r=t.position.x+e.position.x,i=t.position.y+e.position.y,s=e.measured.width??0,a=e.measured.height??0,c=n[0]*s,l=n[1]*a;return[[r-c,i-l],[r+s-c,i+a-l]]}o(ff,"nodeToChildExtent");function Os({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:i}){let s=le(e),a={controlDirection:is("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function c({controlPosition:u,boundaries:d,keepAspectRatio:f,resizeDirection:h,onResizeStart:g,onResize:p,onResizeEnd:S,shouldResize:b}){let y={...zs},v={...df};a={boundaries:d,resizeDirection:h,keepAspectRatio:f,controlDirection:is(u)};let m,w=null,N=[],_,P,I,T=!1,F=Ut().on("start",z=>{let{nodeLookup:H,transform:O,snapGrid:x,snapToGrid:E,nodeOrigin:C,paneDomNode:M}=n();if(m=H.get(t),!m)return;w=M?.getBoundingClientRect()??null;let{xSnapped:R,ySnapped:D}=cn(z.sourceEvent,{transform:O,snapGrid:x,snapToGrid:E,containerBounds:w});y={width:m.measured.width??0,height:m.measured.height??0,x:m.position.x??0,y:m.position.y??0},v={...y,pointerX:R,pointerY:D,aspectRatio:y.width/y.height},_=void 0,P=ct(m.extent)?m.extent:void 0,m.parentId&&(m.extent==="parent"||m.expandParent)&&(_=H.get(m.parentId)),_&&m.extent==="parent"&&(P=[[0,0],[_.measured.width,_.measured.height]]),N=[],I=void 0;for(let[V,B]of H)if(B.parentId===t&&(N.push({id:V,position:{...B.position},extent:B.extent}),B.extent==="parent"||B.expandParent)){let L=ff(B,m,B.origin??C);I?I=[[Math.min(L[0][0],I[0][0]),Math.min(L[0][1],I[0][1])],[Math.max(L[1][0],I[1][0]),Math.max(L[1][1],I[1][1])]]:I=L}g?.(z,{...y})}).on("drag",z=>{let{transform:H,snapGrid:O,snapToGrid:x,nodeOrigin:E}=n(),C=cn(z.sourceEvent,{transform:H,snapGrid:O,snapToGrid:x,containerBounds:w}),M=[];if(!m)return;let{x:R,y:D,width:V,height:B}=y,L={},U=m.origin??E,{width:X,height:K,x:ee,y:G}=uf(v,a.controlDirection,C,a.boundaries,a.keepAspectRatio,U,P,I),$=X!==V,W=K!==B,j=ee!==R&&$,J=G!==D&&W;if(!j&&!J&&!$&&!W)return;if((j||J||U[0]===1||U[1]===1)&&(L.x=j?ee:y.x,L.y=J?G:y.y,y.x=L.x,y.y=L.y,N.length>0)){let oe=ee-R,se=G-D;for(let pe of N)pe.position={x:pe.position.x-oe+U[0]*(X-V),y:pe.position.y-se+U[1]*(K-B)},M.push(pe)}if(($||W)&&(L.width=$&&(!a.resizeDirection||a.resizeDirection==="horizontal")?X:y.width,L.height=W&&(!a.resizeDirection||a.resizeDirection==="vertical")?K:y.height,y.width=L.width,y.height=L.height),_&&m.expandParent){let oe=U[0]*(L.width??0);L.x&&L.x<oe&&(y.x=oe,v.x=v.x-(L.x-oe));let se=U[1]*(L.height??0);L.y&&L.y<se&&(y.y=se,v.y=v.y-(L.y-se))}let q=lf({width:y.width,prevWidth:V,height:y.height,prevHeight:B,affectsX:a.controlDirection.affectsX,affectsY:a.controlDirection.affectsY}),Q={...y,direction:q};b?.(z,Q)!==!1&&(T=!0,p?.(z,Q),r(L,M))}).on("end",z=>{T&&(S?.(z,{...y}),i?.({...y}),T=!1)});s.call(F)}o(c,"update");function l(){s.on(".drag",null)}return o(l,"destroy"),{update:c,destroy:l}}o(Os,"XYResizer");var Bs=Le(lo(),1),Vs=Le(Ll(),1);var $s=o(e=>{let t,n=new Set,r=o((d,f)=>{let h=typeof d=="function"?d(t):d;if(!Object.is(h,t)){let g=t;t=f??(typeof h!="object"||h===null)?h:Object.assign({},t,h),n.forEach(p=>p(t,g))}},"setState"),i=o(()=>t,"getState"),l={setState:r,getState:i,getInitialState:o(()=>u,"getInitialState"),subscribe:o(d=>(n.add(d),()=>n.delete(d)),"subscribe"),destroy:o(()=>{(import.meta.env?import.meta.env.MODE:void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()},"destroy")},u=t=e(r,i,l);return l},"createStoreImpl"),Ls=o(e=>e?$s(e):$s,"createStore");var{useDebugValue:hf}=Bs.default,{useSyncExternalStoreWithSelector:pf}=Vs.default,gf=o(e=>e,"identity");function Kr(e,t=gf,n){let r=pf(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return hf(r),r}o(Kr,"useStoreWithEqualityFn");var Hs=o((e,t)=>{let n=Ls(e),r=o((i,s=t)=>Kr(n,i,s),"useBoundStoreWithEqualityFn");return Object.assign(r,n),r},"createWithEqualityFnImpl"),Fs=o((e,t)=>e?Hs(e,t):Hs,"createWithEqualityFn");function re(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(let[r,i]of e)if(!Object.is(i,t.get(r)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(let r of e)if(!t.has(r))return!1;return!0}let n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}o(re,"shallow$1");var mf=Le(Ol());var jn=(0,k.createContext)(null),yf=jn.Provider,ga=ye.error001("react");function te(e,t){let n=(0,k.useContext)(jn);if(n===null)throw new Error(ga);return Kr(n,e,t)}o(te,"useStore");function ie(){let e=(0,k.useContext)(jn);if(e===null)throw new Error(ga);return(0,k.useMemo)(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}o(ie,"useStoreApi");var Ws={display:"none"},xf={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},ma="react-flow__node-desc",ya="react-flow__edge-desc",wf="react-flow__aria-live",bf=o(e=>e.ariaLiveMessage,"ariaLiveSelector"),Sf=o(e=>e.ariaLabelConfig,"ariaLabelConfigSelector");function vf({rfId:e}){let t=te(bf);return(0,A.jsx)("div",{id:`${wf}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:xf,children:t})}o(vf,"AriaLiveMessage");function Ef({rfId:e,disableKeyboardA11y:t}){let n=te(Sf);return(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)("div",{id:`${ma}-${e}`,style:Ws,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),(0,A.jsx)("div",{id:`${ya}-${e}`,style:Ws,children:n["edge.a11yDescription.default"]}),!t&&(0,A.jsx)(vf,{rfId:e})]})}o(Ef,"A11yDescriptions");var qe=(0,k.forwardRef)(({position:e="top-left",children:t,className:n,style:r,...i},s)=>{let a=`${e}`.split("-");return(0,A.jsx)("div",{className:ae(["react-flow__panel",n,...a]),style:r,ref:s,...i,children:t})});qe.displayName="Panel";var Xs="https://reactflow.dev?utm_source=attribution";function Cf({proOptions:e,position:t="bottom-right"}){return e?.hideAttribution?null:(0,A.jsx)(qe,{position:t,className:"react-flow__attribution","data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: ${Xs}`,children:(0,A.jsx)("a",{href:Xs,target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}o(Cf,"Attribution");var _f=o(e=>{let t=[],n=[];for(let[,r]of e.nodeLookup)r.selected&&t.push(r.internals.userNode);for(let[,r]of e.edgeLookup)r.selected&&n.push(r);return{selectedNodes:t,selectedEdges:n}},"selector$l"),Gn=o(e=>e.id,"selectId");function Nf(e,t){return re(e.selectedNodes.map(Gn),t.selectedNodes.map(Gn))&&re(e.selectedEdges.map(Gn),t.selectedEdges.map(Gn))}o(Nf,"areEqual$1");function Mf({onSelectionChange:e}){let t=ie(),{selectedNodes:n,selectedEdges:r}=te(_f,Nf);return(0,k.useEffect)(()=>{let i={nodes:n,edges:r};e?.(i),t.getState().onSelectionChangeHandlers.forEach(s=>s(i))},[n,r,e]),null}o(Mf,"SelectionListenerInner");var If=o(e=>!!e.onSelectionChangeHandlers,"changeSelector");function Pf({onSelectionChange:e}){let t=te(If);return e||t?(0,A.jsx)(Mf,{onSelectionChange:e}):null}o(Pf,"SelectionListener");var xa=[0,0],kf={x:0,y:0,zoom:1},Af=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","ariaLabelConfig","zIndexMode"],Ys=[...Af,"rfId"],Tf=o(e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),"selector$k"),Zs={translateExtent:Et,nodeOrigin:xa,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function Df(e){let{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:i,setTranslateExtent:s,setNodeExtent:a,reset:c,setDefaultNodesAndEdges:l}=te(Tf,re),u=ie();(0,k.useEffect)(()=>(l(e.defaultNodes,e.defaultEdges),()=>{d.current=Zs,c()}),[]);let d=(0,k.useRef)(Zs);return(0,k.useEffect)(()=>{for(let f of Ys){let h=e[f],g=d.current[f];h!==g&&(typeof e[f]>"u"||(f==="nodes"?t(h):f==="edges"?n(h):f==="minZoom"?r(h):f==="maxZoom"?i(h):f==="translateExtent"?s(h):f==="nodeExtent"?a(h):f==="ariaLabelConfig"?u.setState({ariaLabelConfig:ps(h)}):f==="fitView"?u.setState({fitViewQueued:h}):f==="fitViewOptions"?u.setState({fitViewOptions:h}):u.setState({[f]:h})))}d.current=e},Ys.map(f=>e[f])),null}o(Df,"StoreUpdater");function Us(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}o(Us,"getMediaQuery");function Rf(e){let[t,n]=(0,k.useState)(e==="system"?null:e);return(0,k.useEffect)(()=>{if(e!=="system"){n(e);return}let r=Us(),i=o(()=>n(r?.matches?"dark":"light"),"updateColorModeClass");return i(),r?.addEventListener("change",i),()=>{r?.removeEventListener("change",i)}},[e]),t!==null?t:Us()?.matches?"dark":"light"}o(Rf,"useColorModeClass");var qs=typeof document<"u"?document:null;function hn(e=null,t={target:qs,actInsideInputWithModifier:!0}){let[n,r]=(0,k.useState)(!1),i=(0,k.useRef)(!1),s=(0,k.useRef)(new Set([])),[a,c]=(0,k.useMemo)(()=>{if(e!==null){let u=(Array.isArray(e)?e:[e]).filter(f=>typeof f=="string").map(f=>f.replace("+",`
|
|
1
|
+
import{a as je,b as _i}from"./chunk-GMR677FL.js";import{a as Ni,b as Mi,c as Ii,f as xn}from"./chunk-4KIQ5RLS.js";import{e as wi,k as bi}from"./chunk-QBWRC5YX.js";import{a as fo,b as ho,c as Si,d as vi,e as yn,g as Ei,h as Ci,i as ht}from"./chunk-4UOFSGUS.js";import{R as xi}from"./chunk-CFPZYHPY.js";import{b as Ll}from"./chunk-T6VMSOBB.js";import{a as Ol}from"./chunk-7QIFDWQV.js";import{c as uo}from"./chunk-FXCBF4XT.js";import{b as Ht}from"./chunk-THIXMMZD.js";import{d as Lt,o as mn}from"./chunk-IUYFXK4X.js";import{c as mi}from"./chunk-P33WK7YI.js";import{a as o,e as Le,f as lo,g as $l,h as yi,j as Je}from"./chunk-3XIESWL4.js";var ft=Le($l(),1);var A=Le(yi()),k=Le(lo());function ae(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,r;n<e.length;n++)(r=ae(e[n]))!==""&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}o(ae,"cc");var Hl={value:o(()=>{},"value")};function ki(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new wn(n)}o(ki,"dispatch");function wn(e){this._=e}o(wn,"Dispatch");function Bl(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");if(i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}o(Bl,"parseTypenames");wn.prototype=ki.prototype={constructor:wn,on:o(function(e,t){var n=this._,r=Bl(e+"",n),i,s=-1,a=r.length;if(arguments.length<2){for(;++s<a;)if((i=(e=r[s]).type)&&(i=Vl(n[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++s<a;)if(i=(e=r[s]).type)n[i]=Pi(n[i],e.name,t);else if(t==null)for(i in n)n[i]=Pi(n[i],e.name,null);return this},"on"),copy:o(function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new wn(e)},"copy"),call:o(function(e,t){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,s;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(s=this._[e],r=0,i=s.length;r<i;++r)s[r].value.apply(t,n)},"call"),apply:o(function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],i=0,s=r.length;i<s;++i)r[i].value.apply(t,n)},"apply")};function Vl(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}o(Vl,"get");function Pi(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=Hl,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}o(Pi,"set");var et=ki;var bn="http://www.w3.org/1999/xhtml",po={svg:"http://www.w3.org/2000/svg",xhtml:bn,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Me(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}o(Me,"default");function Fl(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===bn&&t.documentElement.namespaceURI===bn?t.createElement(e):t.createElementNS(n,e)}}o(Fl,"creatorInherit");function Wl(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}o(Wl,"creatorFixed");function Bt(e){var t=Me(e);return(t.local?Wl:Fl)(t)}o(Bt,"default");function Xl(){}o(Xl,"none");function He(e){return e==null?Xl:function(){return this.querySelector(e)}}o(He,"default");function go(e){typeof e!="function"&&(e=He(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var s=t[i],a=s.length,c=r[i]=new Array(a),l,u,d=0;d<a;++d)(l=s[d])&&(u=e.call(l,l.__data__,d,s))&&("__data__"in l&&(u.__data__=l.__data__),c[d]=u);return new ce(r,this._parents)}o(go,"default");function mo(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}o(mo,"array");function Yl(){return[]}o(Yl,"empty");function pt(e){return e==null?Yl:function(){return this.querySelectorAll(e)}}o(pt,"default");function Zl(e){return function(){return mo(e.apply(this,arguments))}}o(Zl,"arrayAll");function yo(e){typeof e=="function"?e=Zl(e):e=pt(e);for(var t=this._groups,n=t.length,r=[],i=[],s=0;s<n;++s)for(var a=t[s],c=a.length,l,u=0;u<c;++u)(l=a[u])&&(r.push(e.call(l,l.__data__,u,a)),i.push(l));return new ce(r,i)}o(yo,"default");function gt(e){return function(){return this.matches(e)}}o(gt,"default");function Sn(e){return function(t){return t.matches(e)}}o(Sn,"childMatcher");var Ul=Array.prototype.find;function ql(e){return function(){return Ul.call(this.children,e)}}o(ql,"childFind");function Kl(){return this.firstElementChild}o(Kl,"childFirst");function xo(e){return this.select(e==null?Kl:ql(typeof e=="function"?e:Sn(e)))}o(xo,"default");var Gl=Array.prototype.filter;function Ql(){return Array.from(this.children)}o(Ql,"children");function Jl(e){return function(){return Gl.call(this.children,e)}}o(Jl,"childrenFilter");function wo(e){return this.selectAll(e==null?Ql:Jl(typeof e=="function"?e:Sn(e)))}o(wo,"default");function bo(e){typeof e!="function"&&(e=gt(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var s=t[i],a=s.length,c=r[i]=[],l,u=0;u<a;++u)(l=s[u])&&e.call(l,l.__data__,u,s)&&c.push(l);return new ce(r,this._parents)}o(bo,"default");function Vt(e){return new Array(e.length)}o(Vt,"default");function So(){return new ce(this._enter||this._groups.map(Vt),this._parents)}o(So,"default");function Ft(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}o(Ft,"EnterNode");Ft.prototype={constructor:Ft,appendChild:o(function(e){return this._parent.insertBefore(e,this._next)},"appendChild"),insertBefore:o(function(e,t){return this._parent.insertBefore(e,t)},"insertBefore"),querySelector:o(function(e){return this._parent.querySelector(e)},"querySelector"),querySelectorAll:o(function(e){return this._parent.querySelectorAll(e)},"querySelectorAll")};function vo(e){return function(){return e}}o(vo,"default");function jl(e,t,n,r,i,s){for(var a=0,c,l=t.length,u=s.length;a<u;++a)(c=t[a])?(c.__data__=s[a],r[a]=c):n[a]=new Ft(e,s[a]);for(;a<l;++a)(c=t[a])&&(i[a]=c)}o(jl,"bindIndex");function eu(e,t,n,r,i,s,a){var c,l,u=new Map,d=t.length,f=s.length,h=new Array(d),g;for(c=0;c<d;++c)(l=t[c])&&(h[c]=g=a.call(l,l.__data__,c,t)+"",u.has(g)?i[c]=l:u.set(g,l));for(c=0;c<f;++c)g=a.call(e,s[c],c,s)+"",(l=u.get(g))?(r[c]=l,l.__data__=s[c],u.delete(g)):n[c]=new Ft(e,s[c]);for(c=0;c<d;++c)(l=t[c])&&u.get(h[c])===l&&(i[c]=l)}o(eu,"bindKey");function tu(e){return e.__data__}o(tu,"datum");function Eo(e,t){if(!arguments.length)return Array.from(this,tu);var n=t?eu:jl,r=this._parents,i=this._groups;typeof e!="function"&&(e=vo(e));for(var s=i.length,a=new Array(s),c=new Array(s),l=new Array(s),u=0;u<s;++u){var d=r[u],f=i[u],h=f.length,g=nu(e.call(d,d&&d.__data__,u,r)),p=g.length,S=c[u]=new Array(p),b=a[u]=new Array(p),y=l[u]=new Array(h);n(d,f,S,b,y,g,t);for(var v=0,m=0,w,N;v<p;++v)if(w=S[v]){for(v>=m&&(m=v+1);!(N=b[m])&&++m<p;);w._next=N||null}}return a=new ce(a,r),a._enter=c,a._exit=l,a}o(Eo,"default");function nu(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}o(nu,"arraylike");function Co(){return new ce(this._exit||this._groups.map(Vt),this._parents)}o(Co,"default");function _o(e,t,n){var r=this.enter(),i=this,s=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(i=t(i),i&&(i=i.selection())),n==null?s.remove():n(s),r&&i?r.merge(i).order():i}o(_o,"default");function No(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,s=r.length,a=Math.min(i,s),c=new Array(i),l=0;l<a;++l)for(var u=n[l],d=r[l],f=u.length,h=c[l]=new Array(f),g,p=0;p<f;++p)(g=u[p]||d[p])&&(h[p]=g);for(;l<i;++l)c[l]=n[l];return new ce(c,this._parents)}o(No,"default");function Mo(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],i=r.length-1,s=r[i],a;--i>=0;)(a=r[i])&&(s&&a.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(a,s),s=a);return this}o(Mo,"default");function Io(e){e||(e=ou);function t(f,h){return f&&h?e(f.__data__,h.__data__):!f-!h}o(t,"compareNode");for(var n=this._groups,r=n.length,i=new Array(r),s=0;s<r;++s){for(var a=n[s],c=a.length,l=i[s]=new Array(c),u,d=0;d<c;++d)(u=a[d])&&(l[d]=u);l.sort(t)}return new ce(i,this._parents).order()}o(Io,"default");function ou(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}o(ou,"ascending");function Po(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}o(Po,"default");function ko(){return Array.from(this)}o(ko,"default");function Ao(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,s=r.length;i<s;++i){var a=r[i];if(a)return a}return null}o(Ao,"default");function To(){let e=0;for(let t of this)++e;return e}o(To,"default");function Do(){return!this.node()}o(Do,"default");function Ro(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i=t[n],s=0,a=i.length,c;s<a;++s)(c=i[s])&&e.call(c,c.__data__,s,i);return this}o(Ro,"default");function ru(e){return function(){this.removeAttribute(e)}}o(ru,"attrRemove");function iu(e){return function(){this.removeAttributeNS(e.space,e.local)}}o(iu,"attrRemoveNS");function su(e,t){return function(){this.setAttribute(e,t)}}o(su,"attrConstant");function au(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}o(au,"attrConstantNS");function cu(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}o(cu,"attrFunction");function lu(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)}}o(lu,"attrFunctionNS");function zo(e,t){var n=Me(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?iu:ru:typeof t=="function"?n.local?lu:cu:n.local?au:su)(n,t))}o(zo,"default");function Wt(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}o(Wt,"default");function uu(e){return function(){this.style.removeProperty(e)}}o(uu,"styleRemove");function du(e,t,n){return function(){this.style.setProperty(e,t,n)}}o(du,"styleConstant");function fu(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}o(fu,"styleFunction");function Oo(e,t,n){return arguments.length>1?this.each((t==null?uu:typeof t=="function"?fu:du)(e,t,n??"")):Be(this.node(),e)}o(Oo,"default");function Be(e,t){return e.style.getPropertyValue(t)||Wt(e).getComputedStyle(e,null).getPropertyValue(t)}o(Be,"styleValue");function hu(e){return function(){delete this[e]}}o(hu,"propertyRemove");function pu(e,t){return function(){this[e]=t}}o(pu,"propertyConstant");function gu(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}o(gu,"propertyFunction");function $o(e,t){return arguments.length>1?this.each((t==null?hu:typeof t=="function"?gu:pu)(e,t)):this.node()[e]}o($o,"default");function Ai(e){return e.trim().split(/^|\s+/)}o(Ai,"classArray");function Lo(e){return e.classList||new Ti(e)}o(Lo,"classList");function Ti(e){this._node=e,this._names=Ai(e.getAttribute("class")||"")}o(Ti,"ClassList");Ti.prototype={add:o(function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},"add"),remove:o(function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},"remove"),contains:o(function(e){return this._names.indexOf(e)>=0},"contains")};function Di(e,t){for(var n=Lo(e),r=-1,i=t.length;++r<i;)n.add(t[r])}o(Di,"classedAdd");function Ri(e,t){for(var n=Lo(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}o(Ri,"classedRemove");function mu(e){return function(){Di(this,e)}}o(mu,"classedTrue");function yu(e){return function(){Ri(this,e)}}o(yu,"classedFalse");function xu(e,t){return function(){(t.apply(this,arguments)?Di:Ri)(this,e)}}o(xu,"classedFunction");function Ho(e,t){var n=Ai(e+"");if(arguments.length<2){for(var r=Lo(this.node()),i=-1,s=n.length;++i<s;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t=="function"?xu:t?mu:yu)(n,t))}o(Ho,"default");function wu(){this.textContent=""}o(wu,"textRemove");function bu(e){return function(){this.textContent=e}}o(bu,"textConstant");function Su(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}o(Su,"textFunction");function Bo(e){return arguments.length?this.each(e==null?wu:(typeof e=="function"?Su:bu)(e)):this.node().textContent}o(Bo,"default");function vu(){this.innerHTML=""}o(vu,"htmlRemove");function Eu(e){return function(){this.innerHTML=e}}o(Eu,"htmlConstant");function Cu(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}o(Cu,"htmlFunction");function Vo(e){return arguments.length?this.each(e==null?vu:(typeof e=="function"?Cu:Eu)(e)):this.node().innerHTML}o(Vo,"default");function _u(){this.nextSibling&&this.parentNode.appendChild(this)}o(_u,"raise");function Fo(){return this.each(_u)}o(Fo,"default");function Nu(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}o(Nu,"lower");function Wo(){return this.each(Nu)}o(Wo,"default");function Xo(e){var t=typeof e=="function"?e:Bt(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}o(Xo,"default");function Mu(){return null}o(Mu,"constantNull");function Yo(e,t){var n=typeof e=="function"?e:Bt(e),r=t==null?Mu:typeof t=="function"?t:He(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}o(Yo,"default");function Iu(){var e=this.parentNode;e&&e.removeChild(this)}o(Iu,"remove");function Zo(){return this.each(Iu)}o(Zo,"default");function Pu(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}o(Pu,"selection_cloneShallow");function ku(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}o(ku,"selection_cloneDeep");function Uo(e){return this.select(e?ku:Pu)}o(Uo,"default");function qo(e){return arguments.length?this.property("__data__",e):this.node().__data__}o(qo,"default");function Au(e){return function(t){e.call(this,t,this.__data__)}}o(Au,"contextListener");function Tu(e){return e.trim().split(/^|\s+/).map(function(t){var n="",r=t.indexOf(".");return r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}o(Tu,"parseTypenames");function Du(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,s;n<i;++n)s=t[n],(!e.type||s.type===e.type)&&s.name===e.name?this.removeEventListener(s.type,s.listener,s.options):t[++r]=s;++r?t.length=r:delete this.__on}}}o(Du,"onRemove");function Ru(e,t,n){return function(){var r=this.__on,i,s=Au(t);if(r){for(var a=0,c=r.length;a<c;++a)if((i=r[a]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=s,i.options=n),i.value=t;return}}this.addEventListener(e.type,s,n),i={type:e.type,name:e.name,value:t,listener:s,options:n},r?r.push(i):this.__on=[i]}}o(Ru,"onAdd");function Ko(e,t,n){var r=Tu(e+""),i,s=r.length,a;if(arguments.length<2){var c=this.node().__on;if(c){for(var l=0,u=c.length,d;l<u;++l)for(i=0,d=c[l];i<s;++i)if((a=r[i]).type===d.type&&a.name===d.name)return d.value}return}for(c=t?Ru:Du,i=0;i<s;++i)this.each(c(r[i],t,n));return this}o(Ko,"default");function zi(e,t,n){var r=Wt(e),i=r.CustomEvent;typeof i=="function"?i=new i(t,n):(i=r.document.createEvent("Event"),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}o(zi,"dispatchEvent");function zu(e,t){return function(){return zi(this,e,t)}}o(zu,"dispatchConstant");function Ou(e,t){return function(){return zi(this,e,t.apply(this,arguments))}}o(Ou,"dispatchFunction");function Go(e,t){return this.each((typeof t=="function"?Ou:zu)(e,t))}o(Go,"default");function*Qo(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,s=r.length,a;i<s;++i)(a=r[i])&&(yield a)}o(Qo,"default");var Jo=[null];function ce(e,t){this._groups=e,this._parents=t}o(ce,"Selection");function Oi(){return new ce([[document.documentElement]],Jo)}o(Oi,"selection");function $u(){return this}o($u,"selection_selection");ce.prototype=Oi.prototype={constructor:ce,select:go,selectAll:yo,selectChild:xo,selectChildren:wo,filter:bo,data:Eo,enter:So,exit:Co,join:_o,merge:No,selection:$u,order:Mo,sort:Io,call:Po,nodes:ko,node:Ao,size:To,empty:Do,each:Ro,attr:zo,style:Oo,property:$o,classed:Ho,text:Bo,html:Vo,raise:Fo,lower:Wo,append:Xo,insert:Yo,remove:Zo,clone:Uo,datum:qo,on:Ko,dispatch:Go,[Symbol.iterator]:Qo};var De=Oi;function le(e){return typeof e=="string"?new ce([[document.querySelector(e)]],[document.documentElement]):new ce([[e]],Jo)}o(le,"default");function jo(e){let t;for(;t=e.sourceEvent;)e=t;return e}o(jo,"default");function fe(e,t){if(e=jo(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.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]}o(fe,"default");var $i={passive:!1},tt={capture:!0,passive:!1};function vn(e){e.stopImmediatePropagation()}o(vn,"nopropagation");function Re(e){e.preventDefault(),e.stopImmediatePropagation()}o(Re,"default");function mt(e){var t=e.document.documentElement,n=le(e).on("dragstart.drag",Re,tt);"onselectstart"in t?n.on("selectstart.drag",Re,tt):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}o(mt,"default");function Xt(e,t){var n=e.document.documentElement,r=le(e).on("dragstart.drag",null);t&&(r.on("click.drag",Re,tt),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}o(Xt,"yesdrag");var Yt=o(e=>()=>e,"default");function Zt(e,{sourceEvent:t,subject:n,target:r,identifier:i,active:s,x:a,y:c,dx:l,dy:u,dispatch:d}){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:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:s,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:c,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:d}})}o(Zt,"DragEvent");Zt.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function Lu(e){return!e.ctrlKey&&!e.button}o(Lu,"defaultFilter");function Hu(){return this.parentNode}o(Hu,"defaultContainer");function Bu(e,t){return t??{x:e.x,y:e.y}}o(Bu,"defaultSubject");function Vu(){return navigator.maxTouchPoints||"ontouchstart"in this}o(Vu,"defaultTouchable");function Ut(){var e=Lu,t=Hu,n=Bu,r=Vu,i={},s=et("start","drag","end"),a=0,c,l,u,d,f=0;function h(w){w.on("mousedown.drag",g).filter(r).on("touchstart.drag",b).on("touchmove.drag",y,$i).on("touchend.drag touchcancel.drag",v).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}o(h,"drag");function g(w,N){if(!(d||!e.call(this,w,N))){var _=m(this,t.call(this,w,N),w,N,"mouse");_&&(le(w.view).on("mousemove.drag",p,tt).on("mouseup.drag",S,tt),mt(w.view),vn(w),u=!1,c=w.clientX,l=w.clientY,_("start",w))}}o(g,"mousedowned");function p(w){if(Re(w),!u){var N=w.clientX-c,_=w.clientY-l;u=N*N+_*_>f}i.mouse("drag",w)}o(p,"mousemoved");function S(w){le(w.view).on("mousemove.drag mouseup.drag",null),Xt(w.view,u),Re(w),i.mouse("end",w)}o(S,"mouseupped");function b(w,N){if(e.call(this,w,N)){var _=w.changedTouches,P=t.call(this,w,N),I=_.length,T,F;for(T=0;T<I;++T)(F=m(this,P,w,N,_[T].identifier,_[T]))&&(vn(w),F("start",w,_[T]))}}o(b,"touchstarted");function y(w){var N=w.changedTouches,_=N.length,P,I;for(P=0;P<_;++P)(I=i[N[P].identifier])&&(Re(w),I("drag",w,N[P]))}o(y,"touchmoved");function v(w){var N=w.changedTouches,_=N.length,P,I;for(d&&clearTimeout(d),d=setTimeout(function(){d=null},500),P=0;P<_;++P)(I=i[N[P].identifier])&&(vn(w),I("end",w,N[P]))}o(v,"touchended");function m(w,N,_,P,I,T){var F=s.copy(),z=fe(T||_,N),H,O,x;if((x=n.call(w,new Zt("beforestart",{sourceEvent:_,target:h,identifier:I,active:a,x:z[0],y:z[1],dx:0,dy:0,dispatch:F}),P))!=null)return H=x.x-z[0]||0,O=x.y-z[1]||0,o(function E(C,M,R){var D=z,V;switch(C){case"start":i[I]=E,V=a++;break;case"end":delete i[I],--a;case"drag":z=fe(R||M,N),V=a;break}F.call(C,w,new Zt(C,{sourceEvent:M,subject:x,target:h,identifier:I,active:V,x:z[0]+H,y:z[1]+O,dx:z[0]-D[0],dy:z[1]-D[1],dispatch:F}),P)},"gesture")}return o(m,"beforestart"),h.filter=function(w){return arguments.length?(e=typeof w=="function"?w:Yt(!!w),h):e},h.container=function(w){return arguments.length?(t=typeof w=="function"?w:Yt(w),h):t},h.subject=function(w){return arguments.length?(n=typeof w=="function"?w:Yt(w),h):n},h.touchable=function(w){return arguments.length?(r=typeof w=="function"?w:Yt(!!w),h):r},h.on=function(){var w=s.on.apply(s,arguments);return w===s?h:w},h.clickDistance=function(w){return arguments.length?(f=(w=+w)*w,h):Math.sqrt(f)},h}o(Ut,"default");var yt=0,Kt=0,qt=0,Hi=1e3,En,Gt,Cn=0,nt=0,_n=0,Qt=typeof performance=="object"&&performance.now?performance:Date,Bi=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function jt(){return nt||(Bi(Fu),nt=Qt.now()+_n)}o(jt,"now");function Fu(){nt=0}o(Fu,"clearNow");function Jt(){this._call=this._time=this._next=null}o(Jt,"Timer");Jt.prototype=Nn.prototype={constructor:Jt,restart:o(function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?jt():+n)+(t==null?0:+t),!this._next&&Gt!==this&&(Gt?Gt._next=this:En=this,Gt=this),this._call=e,this._time=n,er()},"restart"),stop:o(function(){this._call&&(this._call=null,this._time=1/0,er())},"stop")};function Nn(e,t,n){var r=new Jt;return r.restart(e,t,n),r}o(Nn,"timer");function Vi(){jt(),++yt;for(var e=En,t;e;)(t=nt-e._time)>=0&&e._call.call(void 0,t),e=e._next;--yt}o(Vi,"timerFlush");function Li(){nt=(Cn=Qt.now())+_n,yt=Kt=0;try{Vi()}finally{yt=0,Xu(),nt=0}}o(Li,"wake");function Wu(){var e=Qt.now(),t=e-Cn;t>Hi&&(_n-=t,Cn=e)}o(Wu,"poke");function Xu(){for(var e,t=En,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:En=n);Gt=e,er(r)}o(Xu,"nap");function er(e){if(!yt){Kt&&(Kt=clearTimeout(Kt));var t=e-nt;t>24?(e<1/0&&(Kt=setTimeout(Li,e-Qt.now()-_n)),qt&&(qt=clearInterval(qt))):(qt||(Cn=Qt.now(),qt=setInterval(Wu,Hi)),yt=1,Bi(Li))}}o(er,"sleep");function en(e,t,n){var r=new Jt;return t=t==null?0:+t,r.restart(i=>{r.stop(),e(i+t)},t,n),r}o(en,"default");var Yu=et("start","end","cancel","interrupt"),Zu=[],Xi=0,Fi=1,In=2,Mn=3,Wi=4,Pn=5,tn=6;function ze(e,t,n,r,i,s){var a=e.__transition;if(!a)e.__transition={};else if(n in a)return;Uu(e,n,{name:t,index:r,group:i,on:Yu,tween:Zu,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:Xi})}o(ze,"default");function nn(e,t){var n=ue(e,t);if(n.state>Xi)throw new Error("too late; already scheduled");return n}o(nn,"init");function de(e,t){var n=ue(e,t);if(n.state>Mn)throw new Error("too late; already running");return n}o(de,"set");function ue(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}o(ue,"get");function Uu(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=Nn(s,0,n.time);function s(u){n.state=Fi,n.timer.restart(a,n.delay,n.time),n.delay<=u&&a(u-n.delay)}o(s,"schedule");function a(u){var d,f,h,g;if(n.state!==Fi)return l();for(d in r)if(g=r[d],g.name===n.name){if(g.state===Mn)return en(a);g.state===Wi?(g.state=tn,g.timer.stop(),g.on.call("interrupt",e,e.__data__,g.index,g.group),delete r[d]):+d<t&&(g.state=tn,g.timer.stop(),g.on.call("cancel",e,e.__data__,g.index,g.group),delete r[d])}if(en(function(){n.state===Mn&&(n.state=Wi,n.timer.restart(c,n.delay,n.time),c(u))}),n.state=In,n.on.call("start",e,e.__data__,n.index,n.group),n.state===In){for(n.state=Mn,i=new Array(h=n.tween.length),d=0,f=-1;d<h;++d)(g=n.tween[d].value.call(e,e.__data__,n.index,n.group))&&(i[++f]=g);i.length=f+1}}o(a,"start");function c(u){for(var d=u<n.duration?n.ease.call(null,u/n.duration):(n.timer.restart(l),n.state=Pn,1),f=-1,h=i.length;++f<h;)i[f].call(e,d);n.state===Pn&&(n.on.call("end",e,e.__data__,n.index,n.group),l())}o(c,"tick");function l(){n.state=tn,n.timer.stop(),delete r[t];for(var u in r)return;delete e.__transition}o(l,"stop")}o(Uu,"create");function Ve(e,t){var n=e.__transition,r,i,s=!0,a;if(n){t=t==null?null:t+"";for(a in n){if((r=n[a]).name!==t){s=!1;continue}i=r.state>In&&r.state<Pn,r.state=tn,r.timer.stop(),r.on.call(i?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[a]}s&&delete e.__transition}}o(Ve,"default");function tr(e){return this.each(function(){Ve(this,e)})}o(tr,"default");function qu(e,t){var n,r;return function(){var i=de(this,e),s=i.tween;if(s!==n){r=n=s;for(var a=0,c=r.length;a<c;++a)if(r[a].name===t){r=r.slice(),r.splice(a,1);break}}i.tween=r}}o(qu,"tweenRemove");function Ku(e,t,n){var r,i;if(typeof n!="function")throw new Error;return function(){var s=de(this,e),a=s.tween;if(a!==r){i=(r=a).slice();for(var c={name:t,value:n},l=0,u=i.length;l<u;++l)if(i[l].name===t){i[l]=c;break}l===u&&i.push(c)}s.tween=i}}o(Ku,"tweenFunction");function nr(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=ue(this.node(),n).tween,i=0,s=r.length,a;i<s;++i)if((a=r[i]).name===e)return a.value;return null}return this.each((t==null?qu:Ku)(n,e,t))}o(nr,"default");function xt(e,t,n){var r=e._id;return e.each(function(){var i=de(this,r);(i.value||(i.value={}))[t]=n.apply(this,arguments)}),function(i){return ue(i,r).value[t]}}o(xt,"tweenValue");function on(e,t){var n;return(typeof t=="number"?Si:t instanceof fo?ho:(n=fo(t))?(t=n,ho):vi)(e,t)}o(on,"default");function Gu(e){return function(){this.removeAttribute(e)}}o(Gu,"attrRemove");function Qu(e){return function(){this.removeAttributeNS(e.space,e.local)}}o(Qu,"attrRemoveNS");function Ju(e,t,n){var r,i=n+"",s;return function(){var a=this.getAttribute(e);return a===i?null:a===r?s:s=t(r=a,n)}}o(Ju,"attrConstant");function ju(e,t,n){var r,i=n+"",s;return function(){var a=this.getAttributeNS(e.space,e.local);return a===i?null:a===r?s:s=t(r=a,n)}}o(ju,"attrConstantNS");function ed(e,t,n){var r,i,s;return function(){var a,c=n(this),l;return c==null?void this.removeAttribute(e):(a=this.getAttribute(e),l=c+"",a===l?null:a===r&&l===i?s:(i=l,s=t(r=a,c)))}}o(ed,"attrFunction");function td(e,t,n){var r,i,s;return function(){var a,c=n(this),l;return c==null?void this.removeAttributeNS(e.space,e.local):(a=this.getAttributeNS(e.space,e.local),l=c+"",a===l?null:a===r&&l===i?s:(i=l,s=t(r=a,c)))}}o(td,"attrFunctionNS");function or(e,t){var n=Me(e),r=n==="transform"?Ci:on;return this.attrTween(e,typeof t=="function"?(n.local?td:ed)(n,r,xt(this,"attr."+e,t)):t==null?(n.local?Qu:Gu)(n):(n.local?ju:Ju)(n,r,t))}o(or,"default");function nd(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}o(nd,"attrInterpolate");function od(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}o(od,"attrInterpolateNS");function rd(e,t){var n,r;function i(){var s=t.apply(this,arguments);return s!==r&&(n=(r=s)&&od(e,s)),n}return o(i,"tween"),i._value=t,i}o(rd,"attrTweenNS");function id(e,t){var n,r;function i(){var s=t.apply(this,arguments);return s!==r&&(n=(r=s)&&nd(e,s)),n}return o(i,"tween"),i._value=t,i}o(id,"attrTween");function rr(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 r=Me(e);return this.tween(n,(r.local?rd:id)(r,t))}o(rr,"default");function sd(e,t){return function(){nn(this,e).delay=+t.apply(this,arguments)}}o(sd,"delayFunction");function ad(e,t){return t=+t,function(){nn(this,e).delay=t}}o(ad,"delayConstant");function ir(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?sd:ad)(t,e)):ue(this.node(),t).delay}o(ir,"default");function cd(e,t){return function(){de(this,e).duration=+t.apply(this,arguments)}}o(cd,"durationFunction");function ld(e,t){return t=+t,function(){de(this,e).duration=t}}o(ld,"durationConstant");function sr(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?cd:ld)(t,e)):ue(this.node(),t).duration}o(sr,"default");function ud(e,t){if(typeof t!="function")throw new Error;return function(){de(this,e).ease=t}}o(ud,"easeConstant");function ar(e){var t=this._id;return arguments.length?this.each(ud(t,e)):ue(this.node(),t).ease}o(ar,"default");function dd(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;de(this,e).ease=n}}o(dd,"easeVarying");function cr(e){if(typeof e!="function")throw new Error;return this.each(dd(this._id,e))}o(cr,"default");function lr(e){typeof e!="function"&&(e=gt(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var s=t[i],a=s.length,c=r[i]=[],l,u=0;u<a;++u)(l=s[u])&&e.call(l,l.__data__,u,s)&&c.push(l);return new ge(r,this._parents,this._name,this._id)}o(lr,"default");function ur(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,i=n.length,s=Math.min(r,i),a=new Array(r),c=0;c<s;++c)for(var l=t[c],u=n[c],d=l.length,f=a[c]=new Array(d),h,g=0;g<d;++g)(h=l[g]||u[g])&&(f[g]=h);for(;c<r;++c)a[c]=t[c];return new ge(a,this._parents,this._name,this._id)}o(ur,"default");function fd(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}o(fd,"start");function hd(e,t,n){var r,i,s=fd(t)?nn:de;return function(){var a=s(this,e),c=a.on;c!==r&&(i=(r=c).copy()).on(t,n),a.on=i}}o(hd,"onFunction");function dr(e,t){var n=this._id;return arguments.length<2?ue(this.node(),n).on.on(e):this.each(hd(n,e,t))}o(dr,"default");function pd(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}o(pd,"removeFunction");function fr(){return this.on("end.remove",pd(this._id))}o(fr,"default");function hr(e){var t=this._name,n=this._id;typeof e!="function"&&(e=He(e));for(var r=this._groups,i=r.length,s=new Array(i),a=0;a<i;++a)for(var c=r[a],l=c.length,u=s[a]=new Array(l),d,f,h=0;h<l;++h)(d=c[h])&&(f=e.call(d,d.__data__,h,c))&&("__data__"in d&&(f.__data__=d.__data__),u[h]=f,ze(u[h],t,n,h,u,ue(d,n)));return new ge(s,this._parents,t,n)}o(hr,"default");function pr(e){var t=this._name,n=this._id;typeof e!="function"&&(e=pt(e));for(var r=this._groups,i=r.length,s=[],a=[],c=0;c<i;++c)for(var l=r[c],u=l.length,d,f=0;f<u;++f)if(d=l[f]){for(var h=e.call(d,d.__data__,f,l),g,p=ue(d,n),S=0,b=h.length;S<b;++S)(g=h[S])&&ze(g,t,n,S,h,p);s.push(h),a.push(d)}return new ge(s,a,t,n)}o(pr,"default");var gd=De.prototype.constructor;function gr(){return new gd(this._groups,this._parents)}o(gr,"default");function md(e,t){var n,r,i;return function(){var s=Be(this,e),a=(this.style.removeProperty(e),Be(this,e));return s===a?null:s===n&&a===r?i:i=t(n=s,r=a)}}o(md,"styleNull");function Yi(e){return function(){this.style.removeProperty(e)}}o(Yi,"styleRemove");function yd(e,t,n){var r,i=n+"",s;return function(){var a=Be(this,e);return a===i?null:a===r?s:s=t(r=a,n)}}o(yd,"styleConstant");function xd(e,t,n){var r,i,s;return function(){var a=Be(this,e),c=n(this),l=c+"";return c==null&&(l=c=(this.style.removeProperty(e),Be(this,e))),a===l?null:a===r&&l===i?s:(i=l,s=t(r=a,c))}}o(xd,"styleFunction");function wd(e,t){var n,r,i,s="style."+t,a="end."+s,c;return function(){var l=de(this,e),u=l.on,d=l.value[s]==null?c||(c=Yi(t)):void 0;(u!==n||i!==d)&&(r=(n=u).copy()).on(a,i=d),l.on=r}}o(wd,"styleMaybeRemove");function mr(e,t,n){var r=(e+="")=="transform"?Ei:on;return t==null?this.styleTween(e,md(e,r)).on("end.style."+e,Yi(e)):typeof t=="function"?this.styleTween(e,xd(e,r,xt(this,"style."+e,t))).each(wd(this._id,e)):this.styleTween(e,yd(e,r,t),n).on("end.style."+e,null)}o(mr,"default");function bd(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}o(bd,"styleInterpolate");function Sd(e,t,n){var r,i;function s(){var a=t.apply(this,arguments);return a!==i&&(r=(i=a)&&bd(e,a,n)),r}return o(s,"tween"),s._value=t,s}o(Sd,"styleTween");function yr(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;return this.tween(r,Sd(e,t,n??""))}o(yr,"default");function vd(e){return function(){this.textContent=e}}o(vd,"textConstant");function Ed(e){return function(){var t=e(this);this.textContent=t??""}}o(Ed,"textFunction");function xr(e){return this.tween("text",typeof e=="function"?Ed(xt(this,"text",e)):vd(e==null?"":e+""))}o(xr,"default");function Cd(e){return function(t){this.textContent=e.call(this,t)}}o(Cd,"textInterpolate");function _d(e){var t,n;function r(){var i=e.apply(this,arguments);return i!==n&&(t=(n=i)&&Cd(i)),t}return o(r,"tween"),r._value=e,r}o(_d,"textTween");function wr(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,_d(e))}o(wr,"default");function br(){for(var e=this._name,t=this._id,n=kn(),r=this._groups,i=r.length,s=0;s<i;++s)for(var a=r[s],c=a.length,l,u=0;u<c;++u)if(l=a[u]){var d=ue(l,t);ze(l,e,n,u,a,{time:d.time+d.delay+d.duration,delay:0,duration:d.duration,ease:d.ease})}return new ge(r,this._parents,e,n)}o(br,"default");function Sr(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(s,a){var c={value:a},l={value:o(function(){--i===0&&s()},"value")};n.each(function(){var u=de(this,r),d=u.on;d!==e&&(t=(e=d).copy(),t._.cancel.push(c),t._.interrupt.push(c),t._.end.push(l)),u.on=t}),i===0&&s()})}o(Sr,"default");var Nd=0;function ge(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}o(ge,"Transition");function Zi(e){return De().transition(e)}o(Zi,"transition");function kn(){return++Nd}o(kn,"newId");var Oe=De.prototype;ge.prototype=Zi.prototype={constructor:ge,select:hr,selectAll:pr,selectChild:Oe.selectChild,selectChildren:Oe.selectChildren,filter:lr,merge:ur,selection:gr,transition:br,call:Oe.call,nodes:Oe.nodes,node:Oe.node,size:Oe.size,empty:Oe.empty,each:Oe.each,on:dr,attr:or,attrTween:rr,style:mr,styleTween:yr,text:xr,textTween:wr,remove:fr,tween:nr,delay:ir,duration:sr,ease:ar,easeVarying:cr,end:Sr,[Symbol.iterator]:Oe[Symbol.iterator]};function An(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}o(An,"cubicInOut");var Md={time:null,delay:0,duration:250,ease:An};function Id(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}o(Id,"inherit");function vr(e){var t,n;e instanceof ge?(t=e._id,e=e._name):(t=kn(),(n=Md).time=jt(),e=e==null?null:e+"");for(var r=this._groups,i=r.length,s=0;s<i;++s)for(var a=r[s],c=a.length,l,u=0;u<c;++u)(l=a[u])&&ze(l,e,t,u,a,n||Id(l,t));return new ge(r,this._parents,e,t)}o(vr,"default");De.prototype.interrupt=tr;De.prototype.transition=vr;var rn=o(e=>()=>e,"default");function Er(e,{sourceEvent:t,target:n,transform:r,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:r,enumerable:!0,configurable:!0},_:{value:i}})}o(Er,"ZoomEvent");function ve(e,t,n){this.k=e,this.x=t,this.y=n}o(ve,"Transform");ve.prototype={constructor:ve,scale:o(function(e){return e===1?this:new ve(this.k*e,this.x,this.y)},"scale"),translate:o(function(e,t){return e===0&t===0?this:new ve(this.k,this.x+this.k*e,this.y+this.k*t)},"translate"),apply:o(function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},"apply"),applyX:o(function(e){return e*this.k+this.x},"applyX"),applyY:o(function(e){return e*this.k+this.y},"applyY"),invert:o(function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},"invert"),invertX:o(function(e){return(e-this.x)/this.k},"invertX"),invertY:o(function(e){return(e-this.y)/this.k},"invertY"),rescaleX:o(function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},"rescaleX"),rescaleY:o(function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},"rescaleY"),toString:o(function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"},"toString")};var ot=new ve(1,0,0);sn.prototype=ve.prototype;function sn(e){for(;!e.__zoom;)if(!(e=e.parentNode))return ot;return e.__zoom}o(sn,"transform");function Tn(e){e.stopImmediatePropagation()}o(Tn,"nopropagation");function rt(e){e.preventDefault(),e.stopImmediatePropagation()}o(rt,"default");function Pd(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}o(Pd,"defaultFilter");function kd(){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]]}o(kd,"defaultExtent");function Ui(){return this.__zoom||ot}o(Ui,"defaultTransform");function Ad(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}o(Ad,"defaultWheelDelta");function Td(){return navigator.maxTouchPoints||"ontouchstart"in this}o(Td,"defaultTouchable");function Dd(e,t,n){var r=e.invertX(t[0][0])-n[0][0],i=e.invertX(t[1][0])-n[1][0],s=e.invertY(t[0][1])-n[0][1],a=e.invertY(t[1][1])-n[1][1];return e.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),a>s?(s+a)/2:Math.min(0,s)||Math.max(0,a))}o(Dd,"defaultConstrain");function an(){var e=Pd,t=kd,n=Dd,r=Ad,i=Td,s=[0,1/0],a=[[-1/0,-1/0],[1/0,1/0]],c=250,l=ht,u=et("start","zoom","end"),d,f,h,g=500,p=150,S=0,b=10;function y(x){x.property("__zoom",Ui).on("wheel.zoom",I,{passive:!1}).on("mousedown.zoom",T).on("dblclick.zoom",F).filter(i).on("touchstart.zoom",z).on("touchmove.zoom",H).on("touchend.zoom touchcancel.zoom",O).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}o(y,"zoom"),y.transform=function(x,E,C,M){var R=x.selection?x.selection():x;R.property("__zoom",Ui),x!==R?N(x,E,C,M):R.interrupt().each(function(){_(this,arguments).event(M).start().zoom(null,typeof E=="function"?E.apply(this,arguments):E).end()})},y.scaleBy=function(x,E,C,M){y.scaleTo(x,function(){var R=this.__zoom.k,D=typeof E=="function"?E.apply(this,arguments):E;return R*D},C,M)},y.scaleTo=function(x,E,C,M){y.transform(x,function(){var R=t.apply(this,arguments),D=this.__zoom,V=C==null?w(R):typeof C=="function"?C.apply(this,arguments):C,B=D.invert(V),L=typeof E=="function"?E.apply(this,arguments):E;return n(m(v(D,L),V,B),R,a)},C,M)},y.translateBy=function(x,E,C,M){y.transform(x,function(){return n(this.__zoom.translate(typeof E=="function"?E.apply(this,arguments):E,typeof C=="function"?C.apply(this,arguments):C),t.apply(this,arguments),a)},null,M)},y.translateTo=function(x,E,C,M,R){y.transform(x,function(){var D=t.apply(this,arguments),V=this.__zoom,B=M==null?w(D):typeof M=="function"?M.apply(this,arguments):M;return n(ot.translate(B[0],B[1]).scale(V.k).translate(typeof E=="function"?-E.apply(this,arguments):-E,typeof C=="function"?-C.apply(this,arguments):-C),D,a)},M,R)};function v(x,E){return E=Math.max(s[0],Math.min(s[1],E)),E===x.k?x:new ve(E,x.x,x.y)}o(v,"scale");function m(x,E,C){var M=E[0]-C[0]*x.k,R=E[1]-C[1]*x.k;return M===x.x&&R===x.y?x:new ve(x.k,M,R)}o(m,"translate");function w(x){return[(+x[0][0]+ +x[1][0])/2,(+x[0][1]+ +x[1][1])/2]}o(w,"centroid");function N(x,E,C,M){x.on("start.zoom",function(){_(this,arguments).event(M).start()}).on("interrupt.zoom end.zoom",function(){_(this,arguments).event(M).end()}).tween("zoom",function(){var R=this,D=arguments,V=_(R,D).event(M),B=t.apply(R,D),L=C==null?w(B):typeof C=="function"?C.apply(R,D):C,U=Math.max(B[1][0]-B[0][0],B[1][1]-B[0][1]),X=R.__zoom,K=typeof E=="function"?E.apply(R,D):E,ee=l(X.invert(L).concat(U/X.k),K.invert(L).concat(U/K.k));return function(G){if(G===1)G=K;else{var $=ee(G),W=U/$[2];G=new ve(W,L[0]-$[0]*W,L[1]-$[1]*W)}V.zoom(null,G)}})}o(N,"schedule");function _(x,E,C){return!C&&x.__zooming||new P(x,E)}o(_,"gesture");function P(x,E){this.that=x,this.args=E,this.active=0,this.sourceEvent=null,this.extent=t.apply(x,E),this.taps=0}o(P,"Gesture"),P.prototype={event:o(function(x){return x&&(this.sourceEvent=x),this},"event"),start:o(function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},"start"),zoom:o(function(x,E){return this.mouse&&x!=="mouse"&&(this.mouse[1]=E.invert(this.mouse[0])),this.touch0&&x!=="touch"&&(this.touch0[1]=E.invert(this.touch0[0])),this.touch1&&x!=="touch"&&(this.touch1[1]=E.invert(this.touch1[0])),this.that.__zoom=E,this.emit("zoom"),this},"zoom"),end:o(function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},"end"),emit:o(function(x){var E=le(this.that).datum();u.call(x,this.that,new Er(x,{sourceEvent:this.sourceEvent,target:y,type:x,transform:this.that.__zoom,dispatch:u}),E)},"emit")};function I(x,...E){if(!e.apply(this,arguments))return;var C=_(this,E).event(x),M=this.__zoom,R=Math.max(s[0],Math.min(s[1],M.k*Math.pow(2,r.apply(this,arguments)))),D=fe(x);if(C.wheel)(C.mouse[0][0]!==D[0]||C.mouse[0][1]!==D[1])&&(C.mouse[1]=M.invert(C.mouse[0]=D)),clearTimeout(C.wheel);else{if(M.k===R)return;C.mouse=[D,M.invert(D)],Ve(this),C.start()}rt(x),C.wheel=setTimeout(V,p),C.zoom("mouse",n(m(v(M,R),C.mouse[0],C.mouse[1]),C.extent,a));function V(){C.wheel=null,C.end()}o(V,"wheelidled")}o(I,"wheeled");function T(x,...E){if(h||!e.apply(this,arguments))return;var C=x.currentTarget,M=_(this,E,!0).event(x),R=le(x.view).on("mousemove.zoom",L,!0).on("mouseup.zoom",U,!0),D=fe(x,C),V=x.clientX,B=x.clientY;mt(x.view),Tn(x),M.mouse=[D,this.__zoom.invert(D)],Ve(this),M.start();function L(X){if(rt(X),!M.moved){var K=X.clientX-V,ee=X.clientY-B;M.moved=K*K+ee*ee>S}M.event(X).zoom("mouse",n(m(M.that.__zoom,M.mouse[0]=fe(X,C),M.mouse[1]),M.extent,a))}o(L,"mousemoved");function U(X){R.on("mousemove.zoom mouseup.zoom",null),Xt(X.view,M.moved),rt(X),M.event(X).end()}o(U,"mouseupped")}o(T,"mousedowned");function F(x,...E){if(e.apply(this,arguments)){var C=this.__zoom,M=fe(x.changedTouches?x.changedTouches[0]:x,this),R=C.invert(M),D=C.k*(x.shiftKey?.5:2),V=n(m(v(C,D),M,R),t.apply(this,E),a);rt(x),c>0?le(this).transition().duration(c).call(N,V,M,x):le(this).call(y.transform,V,M,x)}}o(F,"dblclicked");function z(x,...E){if(e.apply(this,arguments)){var C=x.touches,M=C.length,R=_(this,E,x.changedTouches.length===M).event(x),D,V,B,L;for(Tn(x),V=0;V<M;++V)B=C[V],L=fe(B,this),L=[L,this.__zoom.invert(L),B.identifier],R.touch0?!R.touch1&&R.touch0[2]!==L[2]&&(R.touch1=L,R.taps=0):(R.touch0=L,D=!0,R.taps=1+!!d);d&&(d=clearTimeout(d)),D&&(R.taps<2&&(f=L[0],d=setTimeout(function(){d=null},g)),Ve(this),R.start())}}o(z,"touchstarted");function H(x,...E){if(this.__zooming){var C=_(this,E).event(x),M=x.changedTouches,R=M.length,D,V,B,L;for(rt(x),D=0;D<R;++D)V=M[D],B=fe(V,this),C.touch0&&C.touch0[2]===V.identifier?C.touch0[0]=B:C.touch1&&C.touch1[2]===V.identifier&&(C.touch1[0]=B);if(V=C.that.__zoom,C.touch1){var U=C.touch0[0],X=C.touch0[1],K=C.touch1[0],ee=C.touch1[1],G=(G=K[0]-U[0])*G+(G=K[1]-U[1])*G,$=($=ee[0]-X[0])*$+($=ee[1]-X[1])*$;V=v(V,Math.sqrt(G/$)),B=[(U[0]+K[0])/2,(U[1]+K[1])/2],L=[(X[0]+ee[0])/2,(X[1]+ee[1])/2]}else if(C.touch0)B=C.touch0[0],L=C.touch0[1];else return;C.zoom("touch",n(m(V,B,L),C.extent,a))}}o(H,"touchmoved");function O(x,...E){if(this.__zooming){var C=_(this,E).event(x),M=x.changedTouches,R=M.length,D,V;for(Tn(x),h&&clearTimeout(h),h=setTimeout(function(){h=null},g),D=0;D<R;++D)V=M[D],C.touch0&&C.touch0[2]===V.identifier?delete C.touch0:C.touch1&&C.touch1[2]===V.identifier&&delete C.touch1;if(C.touch1&&!C.touch0&&(C.touch0=C.touch1,delete C.touch1),C.touch0)C.touch0[1]=this.__zoom.invert(C.touch0[0]);else if(C.end(),C.taps===2&&(V=fe(V,this),Math.hypot(f[0]-V[0],f[1]-V[1])<b)){var B=le(this).on("dblclick.zoom");B&&B.apply(this,arguments)}}}return o(O,"touchended"),y.wheelDelta=function(x){return arguments.length?(r=typeof x=="function"?x:rn(+x),y):r},y.filter=function(x){return arguments.length?(e=typeof x=="function"?x:rn(!!x),y):e},y.touchable=function(x){return arguments.length?(i=typeof x=="function"?x:rn(!!x),y):i},y.extent=function(x){return arguments.length?(t=typeof x=="function"?x:rn([[+x[0][0],+x[0][1]],[+x[1][0],+x[1][1]]]),y):t},y.scaleExtent=function(x){return arguments.length?(s[0]=+x[0],s[1]=+x[1],y):[s[0],s[1]]},y.translateExtent=function(x){return arguments.length?(a[0][0]=+x[0][0],a[1][0]=+x[1][0],a[0][1]=+x[0][1],a[1][1]=+x[1][1],y):[[a[0][0],a[0][1]],[a[1][0],a[1][1]]]},y.constrain=function(x){return arguments.length?(n=x,y):n},y.duration=function(x){return arguments.length?(c=+x,y):c},y.interpolate=function(x){return arguments.length?(l=x,y):l},y.on=function(){var x=u.on.apply(u,arguments);return x===u?y:x},y.clickDistance=function(x){return arguments.length?(S=(x=+x)*x,y):Math.sqrt(S)},y.tapDistance=function(x){return arguments.length?(b=+x,y):b},y}o(an,"default");var ye={error001:o((e="react")=>`Seems like you have not used ${e==="svelte"?"SvelteFlowProvider":"ReactFlowProvider"} as an ancestor. Help: https://${e}flow.dev/error#001`,"error001"),error002:o(()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.","error002"),error003:o(e=>`Node type "${e}" not found. Using fallback type "default".`,"error003"),error004:o(()=>"The parent container needs a width and a height to render the graph.","error004"),error005:o(()=>"Only child nodes can use a parent extent.","error005"),error006:o(()=>"Can't create edge. An edge needs a source and a target.","error006"),error007:o(e=>`The old edge with id=${e} does not exist.`,"error007"),error009:o(e=>`Marker type "${e}" doesn't exist.`,"error009"),error008:o((e,{id:t,sourceHandle:n,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:r}", edge id: ${t}.`,"error008"),error010:o(()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.","error010"),error011:o(e=>`Edge type "${e}" not found. Using fallback type "default".`,"error011"),error012:o(e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,"error012"),error013:o((e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,"error013"),error014:o(()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.","error014"),error015:o(()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs.","error015"),error016:o(e=>`Edge with id "${e}" does not exist, it may have been removed. This can happen when an edge is deleted before the "onEdgeClick" handler is called.`,"error016")},Et=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Ir=["Enter"," ","Escape"],Pr={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":o(({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"node.a11yDescription.ariaLiveMessage"),"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"},Xe;(function(e){e.Strict="strict",e.Loose="loose"})(Xe||(Xe={}));var $e;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})($e||($e={}));var it;(function(e){e.Partial="partial",e.Full="full"})(it||(it={}));var kr={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null},Ie;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Ie||(Ie={}));var St;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(St||(St={}));var Y;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Y||(Y={}));var qi={[Y.Left]:Y.Right,[Y.Right]:Y.Left,[Y.Top]:Y.Bottom,[Y.Bottom]:Y.Top};function Ar(e){return e===null?null:e?"valid":"invalid"}o(Ar,"getConnectionStatus");var Tr=o(e=>!!e&&typeof e=="object"&&"id"in e&&"source"in e&&"target"in e,"isEdgeBase"),as=o(e=>!!e&&typeof e=="object"&&"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),"isNodeBase"),Dr=o(e=>!!e&&typeof e=="object"&&"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),"isInternalNodeBase");var ln=o((e,t=[0,0])=>{let{width:n,height:r}=Ee(e),i=e.origin??t,s=n*i[0],a=r*i[1];return{x:e.position.x-s,y:e.position.y-a}},"getNodePositionWithOrigin"),un=o((e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};let n=e.reduce((r,i)=>{let s=typeof i=="string",a=!t.nodeLookup&&!s?i:void 0;t.nodeLookup&&(a=s?t.nodeLookup.get(i):Dr(i)?i:t.nodeLookup.get(i.id));let c=a?zn(a,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return Ln(r,c)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return Hn(n)},"getNodesBounds"),Ct=o((e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(i=>{(t.filter===void 0||t.filter(i))&&(n=Ln(n,zn(i)),r=!0)}),r?Hn(n):{x:0,y:0,width:0,height:0}},"getInternalNodesBounds"),On=o((e,t,[n,r,i]=[0,0,1],s=!1,a=!1)=>{let c=(t.x-n)/i,l=(t.y-r)/i,u=t.width/i,d=t.height/i,f=[];for(let h of e.values()){let{measured:g,selectable:p=!0,hidden:S=!1}=h;if(a&&!p||S)continue;let b=g.width??h.width??h.initialWidth??0,y=g.height??h.height??h.initialHeight??0,{x:v,y:m}=h.internals.positionAbsolute,w=fs(c,l,u,d,v,m,b,y),N=b*y,_=s&&w>0;(!h.internals.handleBounds||_||w>=N||h.dragging)&&f.push(h)}return f},"getNodesInside"),cs=o((e,t)=>{let n=new Set;return e.forEach(r=>{n.add(r.id)}),t.filter(r=>n.has(r.source)||n.has(r.target))},"getConnectedEdges");function Rd(e,t){let n=new Map,r=t?.nodes?new Set(t.nodes.map(i=>i.id)):null;return e.forEach(i=>{let s;if(t?.includeHiddenNodes){let{width:a,height:c}=Ee(i);s=a>0&&c>0}else s=!!(i.measured.width&&i.measured.height&&!i.hidden);s&&(!r||r.has(i.id))&&n.set(i.id,i)}),n}o(Rd,"getFitViewNodes");async function ls({nodes:e,width:t,height:n,panZoom:r,minZoom:i,maxZoom:s},a){if(e.size===0)return!0;let c=Rd(e,a),l=Ct(c),u=lt(l,t,n,a?.minZoom??i,a?.maxZoom??s,a?.padding??.1);return await r.setViewport(u,{duration:a?.duration,ease:a?.ease,interpolate:a?.interpolate}),!0}o(ls,"fitViewport");function Rr({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:i,onError:s}){let a=n.get(e),c=a.parentId?n.get(a.parentId):void 0,{x:l,y:u}=c?c.internals.positionAbsolute:{x:0,y:0},d=a.origin??r,f=a.extent||i;if(a.extent==="parent"&&!a.expandParent)if(!c)s?.("005",ye.error005());else{let g=c.measured.width,p=c.measured.height;g&&p&&(f=[[l,u],[l+g,u+p]])}else c&&ct(a.extent)&&(f=[[a.extent[0][0]+l,a.extent[0][1]+u],[a.extent[1][0]+l,a.extent[1][1]+u]]);let h=ct(f)?st(t,f,a.measured):t;return(a.measured.width===void 0||a.measured.height===void 0)&&s?.("015",ye.error015()),{position:{x:h.x-l+(a.measured.width??0)*d[0],y:h.y-u+(a.measured.height??0)*d[1]},positionAbsolute:h}}o(Rr,"calculateNodePosition");async function us({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:i}){let s=new Set(e.map(h=>h.id)),a=[];for(let h of n){if(h.deletable===!1)continue;let g=s.has(h.id),p=!g&&h.parentId&&a.find(S=>S.id===h.parentId);(g||p)&&a.push(h)}let c=new Set(t.map(h=>h.id)),l=r.filter(h=>h.deletable!==!1),d=cs(a,l);for(let h of l)c.has(h.id)&&!d.find(p=>p.id===h.id)&&d.push(h);if(!i)return{edges:d,nodes:a};let f=await i({nodes:a,edges:d});return typeof f=="boolean"?f?{edges:d,nodes:a}:{edges:[],nodes:[]}:f}o(us,"getElementsToRemove");var vt=o((e,t=0,n=1)=>Math.min(Math.max(e,t),n),"clamp"),st=o((e={x:0,y:0},t,n)=>({x:vt(e.x,t[0][0],t[1][0]-(n?.width??0)),y:vt(e.y,t[0][1],t[1][1]-(n?.height??0))}),"clampPosition");function ds(e,t,n){let{width:r,height:i}=Ee(n),{x:s,y:a}=n.internals.positionAbsolute;return st(e,[[s,a],[s+r,a+i]],t)}o(ds,"clampPositionToParent");var Ki=o((e,t,n)=>e<t?vt(Math.abs(e-t),1,t)/t:e>n?-vt(Math.abs(e-n),1,t)/t:0,"calcAutoPanVelocity"),$n=o((e,t,n=15,r=40)=>{let i=Ki(e.x,r,t.width-r)*n,s=Ki(e.y,r,t.height-r)*n;return[i,s]},"calcAutoPan"),Ln=o((e,t)=>({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)}),"getBoundsOfBoxes"),Mr=o(({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),"rectToBox"),Hn=o(({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),"boxToRect"),_t=o((e,t=[0,0])=>{let{x:n,y:r}=Dr(e)?e.internals.positionAbsolute:ln(e,t);return{x:n,y:r,width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}},"nodeToRect"),zn=o((e,t=[0,0])=>{let{x:n,y:r}=Dr(e)?e.internals.positionAbsolute:ln(e,t);return{x:n,y:r,x2:n+(e.measured?.width??e.width??e.initialWidth??0),y2:r+(e.measured?.height??e.height??e.initialHeight??0)}},"nodeToBox"),zr=o((e,t)=>Hn(Ln(Mr(e),Mr(t))),"getBoundsOfRects"),fs=o((e,t,n,r,i,s,a,c)=>{let l=Math.max(0,Math.min(e+n,i+a)-Math.max(e,i)),u=Math.max(0,Math.min(t+r,s+c)-Math.max(t,s));return Math.ceil(l*u)},"getRectsOverlappingArea"),dn=o((e,t)=>fs(e.x,e.y,e.width,e.height,t.x,t.y,t.width,t.height),"getOverlappingArea"),Or=o(e=>we(e.width)&&we(e.height)&&we(e.x)&&we(e.y),"isRectObject"),we=o(e=>!isNaN(e)&&isFinite(e),"isNumeric"),$r=o((e,t)=>(n,r)=>{},"createDevWarn"),Nt=o((e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),"snapPosition"),Mt=o(({x:e,y:t},[n,r,i],s=!1,a=[1,1])=>{let c={x:(e-n)/i,y:(t-r)/i};return s?Nt(c,a):c},"pointToRendererPoint"),at=o(({x:e,y:t},[n,r,i])=>({x:e*i+n,y:t*i+r}),"rendererPointToPoint");function wt(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){let n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(n)}if(typeof e=="string"&&e.endsWith("%")){let n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}o(wt,"parsePadding");function zd(e,t,n){if(typeof e=="string"||typeof e=="number"){let r=wt(e,n),i=wt(e,t);return{top:r,right:i,bottom:r,left:i,x:i*2,y:r*2}}if(typeof e=="object"){let r=wt(e.top??e.y??0,n),i=wt(e.bottom??e.y??0,n),s=wt(e.left??e.x??0,t),a=wt(e.right??e.x??0,t);return{top:r,right:a,bottom:i,left:s,x:s+a,y:r+i}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}o(zd,"parsePaddings");function Od(e,t,n,r,i,s){let{x:a,y:c}=at(e,[t,n,r]),{x:l,y:u}=at({x:e.x+e.width,y:e.y+e.height},[t,n,r]),d=i-l,f=s-u;return{left:Math.floor(a),top:Math.floor(c),right:Math.floor(d),bottom:Math.floor(f)}}o(Od,"calculateAppliedPaddings");var lt=o((e,t,n,r,i,s)=>{let a=zd(s,t,n),c=(t-a.x)/e.width,l=(n-a.y)/e.height,u=Math.min(c,l),d=vt(u,r,i),f=e.x+e.width/2,h=e.y+e.height/2,g=t/2-f*d,p=n/2-h*d,S=Od(e,g,p,d,t,n),b={left:Math.min(S.left-a.left,0),top:Math.min(S.top-a.top,0),right:Math.min(S.right-a.right,0),bottom:Math.min(S.bottom-a.bottom,0)};return{x:g-b.left+b.right,y:p-b.top+b.bottom,zoom:d}},"getViewportForBounds"),It=o(()=>typeof navigator<"u"&&navigator?.userAgent?.indexOf("Mac")>=0,"isMacOs");function ct(e){return e!=null&&e!=="parent"}o(ct,"isCoordinateExtent");function Ee(e){return{width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}}o(Ee,"getNodeDimensions");function Bn(e){return(e.measured?.width??e.width??e.initialWidth)!==void 0&&(e.measured?.height??e.height??e.initialHeight)!==void 0}o(Bn,"nodeHasDimensions");function Lr(e,t={width:0,height:0},n,r,i){let s={...e},a=r.get(n);if(a){let c=a.origin||i;s.x+=a.internals.positionAbsolute.x-(t.width??0)*c[0],s.y+=a.internals.positionAbsolute.y-(t.height??0)*c[1]}return s}o(Lr,"evaluateAbsolutePosition");function Hr(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}o(Hr,"areSetsEqual");function hs(){let e,t;return{promise:new Promise((r,i)=>{e=r,t=i}),resolve:e,reject:t}}o(hs,"withResolvers");function ps(e){return{...Pr,...e||{}}}o(ps,"mergeAriaLabelConfig");function cn(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:i}){let{x:s,y:a}=be(e),c=Mt({x:s-(i?.left??0),y:a-(i?.top??0)},r),{x:l,y:u}=n?Nt(c,t):c;return{xSnapped:l,ySnapped:u,...c}}o(cn,"getPointerPosition");var Vn=o(e=>({width:e.offsetWidth,height:e.offsetHeight}),"getDimensions"),Br=o(e=>e?.getRootNode?.()||window?.document,"getHostForElement"),$d=["INPUT","SELECT","TEXTAREA"];function Vr(e){let t=e.composedPath?.()?.[0]||e.target;return t?.nodeType!==1?!1:$d.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}o(Vr,"isInputDOMNode");var Fr=o(e=>"clientX"in e,"isMouseEvent"),be=o((e,t)=>{let n=Fr(e),r=n?e.clientX:e.touches?.[0].clientX,i=n?e.clientY:e.touches?.[0].clientY;return{x:r-(t?.left??0),y:i-(t?.top??0)}},"getEventPosition"),Gi=o((e,t,n,r,i)=>{let s=t.querySelectorAll(`.${e}`);return!s||!s.length?null:Array.from(s).map(a=>{let c=a.getBoundingClientRect();return{id:a.getAttribute("data-handleid"),type:e,nodeId:i,position:a.getAttribute("data-handlepos"),x:(c.left-n.left)/r,y:(c.top-n.top)/r,...Vn(a)}})},"getHandleBounds");function Fn({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:i,sourceControlY:s,targetControlX:a,targetControlY:c}){let l=e*.125+i*.375+a*.375+n*.125,u=t*.125+s*.375+c*.375+r*.125,d=Math.abs(l-e),f=Math.abs(u-t);return[l,u,d,f]}o(Fn,"getBezierEdgeCenter");function Dn(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}o(Dn,"calculateControlOffset");function Qi({pos:e,x1:t,y1:n,x2:r,y2:i,c:s}){switch(e){case Y.Left:return[t-Dn(t-r,s),n];case Y.Right:return[t+Dn(r-t,s),n];case Y.Top:return[t,n-Dn(n-i,s)];case Y.Bottom:return[t,n+Dn(i-n,s)]}}o(Qi,"getControlWithCurvature");function Wn({sourceX:e,sourceY:t,sourcePosition:n=Y.Bottom,targetX:r,targetY:i,targetPosition:s=Y.Top,curvature:a=.25}){let[c,l]=Qi({pos:n,x1:e,y1:t,x2:r,y2:i,c:a}),[u,d]=Qi({pos:s,x1:r,y1:i,x2:e,y2:t,c:a}),[f,h,g,p]=Fn({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:c,sourceControlY:l,targetControlX:u,targetControlY:d});return[`M${e},${t} C${c},${l} ${u},${d} ${r},${i}`,f,h,g,p]}o(Wn,"getBezierPath");function Wr({sourceX:e,sourceY:t,targetX:n,targetY:r}){let i=Math.abs(n-e)/2,s=n<e?n+i:n-i,a=Math.abs(r-t)/2,c=r<t?r+a:r-a;return[s,c,i,a]}o(Wr,"getEdgeCenter");function gs({sourceNode:e,targetNode:t,selected:n=!1,zIndex:r=0,elevateOnSelect:i=!1,zIndexMode:s="basic"}){if(s==="manual")return r;let a=i&&n?r+1e3:r,c=Math.max(e.parentId||i&&e.selected?e.internals.z:0,t.parentId||i&&t.selected?t.internals.z:0);return a+c}o(gs,"getElevatedEdgeZIndex");function ms({sourceNode:e,targetNode:t,width:n,height:r,transform:i}){let s=Ln(zn(e),zn(t));s.x===s.x2&&(s.x2+=1),s.y===s.y2&&(s.y2+=1);let a={x:-i[0]/i[2],y:-i[1]/i[2],width:n/i[2],height:r/i[2]};return dn(a,Hn(s))>0}o(ms,"isEdgeVisible");var Ld=o(({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,"getEdgeId"),Hd=o((e,t)=>t.some(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)),"connectionExists"),ys=o((e,t,n={})=>{if(!e.source||!e.target)return n.onError?.("006",ye.error006()),t;let r=n.getEdgeId||Ld,i;return Tr(e)?i={...e}:i={...e,id:r(e)},Hd(i,t)?t:(i.sourceHandle===null&&delete i.sourceHandle,i.targetHandle===null&&delete i.targetHandle,t.concat(i))},"addEdge");function Xn({sourceX:e,sourceY:t,targetX:n,targetY:r}){let[i,s,a,c]=Wr({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,i,s,a,c]}o(Xn,"getStraightPath");var Ji={[Y.Left]:{x:-1,y:0},[Y.Right]:{x:1,y:0},[Y.Top]:{x:0,y:-1},[Y.Bottom]:{x:0,y:1}},Bd=o(({source:e,sourcePosition:t=Y.Bottom,target:n})=>t===Y.Left||t===Y.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},"getDirection"),ji=o((e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2)),"distance");function Vd({source:e,sourcePosition:t=Y.Bottom,target:n,targetPosition:r=Y.Top,center:i,offset:s,stepPosition:a}){let c=Ji[t],l=Ji[r],u={x:e.x+c.x*s,y:e.y+c.y*s},d={x:n.x+l.x*s,y:n.y+l.y*s},f=Bd({source:u,sourcePosition:t,target:d}),h=f.x!==0?"x":"y",g=f[h],p=[],S,b,y={x:0,y:0},v={x:0,y:0},[,,m,w]=Wr({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(c[h]*l[h]===-1){h==="x"?(S=i.x??u.x+(d.x-u.x)*a,b=i.y??(u.y+d.y)/2):(S=i.x??(u.x+d.x)/2,b=i.y??u.y+(d.y-u.y)*a);let I=[{x:S,y:u.y},{x:S,y:d.y}],T=[{x:u.x,y:b},{x:d.x,y:b}];c[h]===g?p=h==="x"?I:T:p=h==="x"?T:I}else{let I=[{x:u.x,y:d.y}],T=[{x:d.x,y:u.y}];if(h==="x"?p=c.x===g?T:I:p=c.y===g?I:T,t===r){let x=Math.abs(e[h]-n[h]);if(x<=s){let E=Math.min(s-1,s-x);c[h]===g?y[h]=(u[h]>e[h]?-1:1)*E:v[h]=(d[h]>n[h]?-1:1)*E}}if(t!==r){let x=h==="x"?"y":"x",E=c[h]===l[x],C=u[x]>d[x],M=u[x]<d[x];(c[h]===1&&(!E&&C||E&&M)||c[h]!==1&&(!E&&M||E&&C))&&(p=h==="x"?I:T)}let F={x:u.x+y.x,y:u.y+y.y},z={x:d.x+v.x,y:d.y+v.y},H=Math.max(Math.abs(F.x-p[0].x),Math.abs(z.x-p[0].x)),O=Math.max(Math.abs(F.y-p[0].y),Math.abs(z.y-p[0].y));H>=O?(S=(F.x+z.x)/2,b=p[0].y):(S=p[0].x,b=(F.y+z.y)/2)}let N={x:u.x+y.x,y:u.y+y.y},_={x:d.x+v.x,y:d.y+v.y};return[[e,...N.x!==p[0].x||N.y!==p[0].y?[N]:[],...p,..._.x!==p[p.length-1].x||_.y!==p[p.length-1].y?[_]:[],n],S,b,m,w]}o(Vd,"getPoints");function Fd(e,t,n,r){let i=Math.min(ji(e,t)/2,ji(t,n)/2,r),{x:s,y:a}=t;if(e.x===s&&s===n.x||e.y===a&&a===n.y)return`L${s} ${a}`;if(e.y===a){let u=e.x<n.x?-1:1,d=e.y<n.y?1:-1;return`L ${s+i*u},${a}Q ${s},${a} ${s},${a+i*d}`}let c=e.x<n.x?1:-1,l=e.y<n.y?-1:1;return`L ${s},${a+i*l}Q ${s},${a} ${s+i*c},${a}`}o(Fd,"getBend");function fn({sourceX:e,sourceY:t,sourcePosition:n=Y.Bottom,targetX:r,targetY:i,targetPosition:s=Y.Top,borderRadius:a=5,centerX:c,centerY:l,offset:u=20,stepPosition:d=.5}){let[f,h,g,p,S]=Vd({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:i},targetPosition:s,center:{x:c,y:l},offset:u,stepPosition:d}),b=`M${f[0].x} ${f[0].y}`;for(let y=1;y<f.length-1;y++)b+=Fd(f[y-1],f[y],f[y+1],a);return b+=`L${f[f.length-1].x} ${f[f.length-1].y}`,[b,h,g,p,S]}o(fn,"getSmoothStepPath");function es(e){return e&&!!(e.internals.handleBounds||e.handles?.length)&&!!(e.measured.width||e.width||e.initialWidth)}o(es,"isNodeInitialized");function xs(e){let{sourceNode:t,targetNode:n}=e;if(!es(t)||!es(n))return null;let r=t.internals.handleBounds||ts(t.handles),i=n.internals.handleBounds||ts(n.handles),s=ns(r?.source??[],e.sourceHandle),a=ns(e.connectionMode===Xe.Strict?i?.target??[]:(i?.target??[]).concat(i?.source??[]),e.targetHandle);if(!s||!a)return e.onError?.("008",ye.error008(s?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;let c=s?.position||Y.Bottom,l=a?.position||Y.Top,u=Ye(t,s,c),d=Ye(n,a,l);return{sourceX:u.x,sourceY:u.y,targetX:d.x,targetY:d.y,sourcePosition:c,targetPosition:l}}o(xs,"getEdgePosition");function ts(e){if(!e)return null;let t=[],n=[];for(let r of e)r.width=r.width??1,r.height=r.height??1,r.type==="source"?t.push(r):r.type==="target"&&n.push(r);return{source:t,target:n}}o(ts,"toHandleBounds");function Ye(e,t,n=Y.Left,r=!1){let i=(t?.x??0)+e.internals.positionAbsolute.x,s=(t?.y??0)+e.internals.positionAbsolute.y,{width:a,height:c}=t??Ee(e);if(r)return{x:i+a/2,y:s+c/2};switch(t?.position??n){case Y.Top:return{x:i+a/2,y:s};case Y.Right:return{x:i+a,y:s+c/2};case Y.Bottom:return{x:i+a/2,y:s+c};case Y.Left:return{x:i,y:s+c/2}}}o(Ye,"getHandlePosition");function ns(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}o(ns,"getHandle$1");function Yn(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}o(Yn,"getMarkerId");function ws(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:i}){let s=new Set;return e.reduce((a,c)=>([c.markerStart||r,c.markerEnd||i].forEach(l=>{if(l&&typeof l=="object"){let u=Yn(l,t);s.has(u)||(a.push({id:u,color:l.color||n,...l}),s.add(u))}}),a),[]).sort((a,c)=>a.id.localeCompare(c.id))}o(ws,"createMarkerIds");var bs=1e3,Wd=10,Xr={nodeOrigin:[0,0],nodeExtent:Et,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},Xd={...Xr,checkEquality:!0};function Yr(e,t){let n={...e};for(let r in t)t[r]!==void 0&&(n[r]=t[r]);return n}o(Yr,"mergeObjects");function Ss(e,t,n){let r=Yr(Xr,n);for(let i of e.values())if(i.parentId)Ur(i,e,t,r);else{let s=ln(i,r.nodeOrigin),a=ct(i.extent)?i.extent:r.nodeExtent,c=st(s,a,Ee(i));i.internals.positionAbsolute=c}}o(Ss,"updateAbsolutePositions");function Yd(e,t){if(!e.handles)return e.measured?t?.internals.handleBounds:void 0;let n=[],r=[];for(let i of e.handles){let s={id:i.id,width:i.width??1,height:i.height??1,nodeId:e.id,x:i.x,y:i.y,position:i.position,type:i.type};i.type==="source"?n.push(s):i.type==="target"&&r.push(s)}return{source:n,target:r}}o(Yd,"parseHandles");function Zr(e){return e==="manual"}o(Zr,"isManualZIndexMode");function Zn(e,t,n,r={}){let i=Yr(Xd,r),s={i:0},a=new Map(t),c=i?.elevateNodesOnSelect&&!Zr(i.zIndexMode)?bs:0,l=e.length>0,u=!1;t.clear(),n.clear();for(let d of e){let f=a.get(d.id);if(i.checkEquality&&d===f?.internals.userNode)t.set(d.id,f);else{let h=ln(d,i.nodeOrigin),g=ct(d.extent)?d.extent:i.nodeExtent,p=st(h,g,Ee(d));f={...i.defaults,...d,measured:{width:d.measured?.width,height:d.measured?.height},internals:{positionAbsolute:p,handleBounds:Yd(d,f),z:vs(d,c,i.zIndexMode),userNode:d}},t.set(d.id,f)}(f.measured===void 0||f.measured.width===void 0||f.measured.height===void 0)&&!f.hidden&&(l=!1),d.parentId&&Ur(f,t,n,r,s),u||=d.selected??!1}return{nodesInitialized:l,hasSelectedNodes:u}}o(Zn,"adoptUserNodes");function Zd(e,t){if(!e.parentId)return;let n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}o(Zd,"updateParentLookup");function Ur(e,t,n,r,i){let{elevateNodesOnSelect:s,nodeOrigin:a,nodeExtent:c,zIndexMode:l}=Yr(Xr,r),u=e.parentId,d=t.get(u);if(!d){console.warn(`Parent node ${u} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}Zd(e,n),i&&!d.parentId&&d.internals.rootParentIndex===void 0&&l==="auto"&&(d.internals.rootParentIndex=++i.i,d.internals.z=d.internals.z+i.i*Wd),i&&d.internals.rootParentIndex!==void 0&&(i.i=d.internals.rootParentIndex);let f=s&&!Zr(l)?bs:0,{x:h,y:g,z:p}=Ud(e,d,a,c,f,l),{positionAbsolute:S}=e.internals,b=h!==S.x||g!==S.y;(b||p!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:b?{x:h,y:g}:S,z:p}})}o(Ur,"updateChildNode");function vs(e,t,n){let r=we(e.zIndex)?e.zIndex:0;return Zr(n)?r:r+(e.selected?t:0)}o(vs,"calculateZ");function Ud(e,t,n,r,i,s){let{x:a,y:c}=t.internals.positionAbsolute,l=Ee(e),u=ln(e,n),d=ct(e.extent)?st(u,e.extent,l):u,f=st({x:a+d.x,y:c+d.y},r,l);e.extent==="parent"&&(f=ds(f,l,t));let h=vs(e,i,s),g=t.internals.z??0;return{x:f.x,y:f.y,z:g>=h?g+1:h}}o(Ud,"calculateChildXYZ");function Un(e,t,n,r=[0,0]){let i=[],s=new Map;for(let a of e){let c=t.get(a.parentId);if(!c)continue;let l=s.get(a.parentId)?.expandedRect??_t(c),u=zr(l,a.rect);s.set(a.parentId,{expandedRect:u,parent:c})}return s.size>0&&s.forEach(({expandedRect:a,parent:c},l)=>{let u=c.internals.positionAbsolute,d=Ee(c),f=c.origin??r,h=a.x<u.x?Math.round(Math.abs(u.x-a.x)):0,g=a.y<u.y?Math.round(Math.abs(u.y-a.y)):0,p=Math.max(d.width,Math.round(a.width)),S=Math.max(d.height,Math.round(a.height)),b=(p-d.width)*f[0],y=(S-d.height)*f[1];(h>0||g>0||b||y)&&(i.push({id:l,type:"position",position:{x:c.position.x-h+b,y:c.position.y-g+y}}),n.get(l)?.forEach(v=>{e.some(m=>m.id===v.id)||i.push({id:v.id,type:"position",position:{x:v.position.x+h,y:v.position.y+g}})})),(d.width<a.width||d.height<a.height||h||g)&&i.push({id:l,type:"dimensions",setAttributes:!0,dimensions:{width:p+(h?f[0]*h-b:0),height:S+(g?f[1]*g-y:0)}})}),i}o(Un,"handleExpandParent");function Es(e,t,n,r,i,s,a){let c=r?.querySelector(".xyflow__viewport"),l=!1;if(!c)return{changes:[],updatedInternals:l};let u=[],d=window.getComputedStyle(c),{m22:f}=new window.DOMMatrixReadOnly(d.transform),h=[];for(let g of e.values()){let p=t.get(g.id);if(!p)continue;if(p.hidden){t.set(p.id,{...p,internals:{...p.internals,handleBounds:void 0}}),l=!0;continue}let S=Vn(g.nodeElement),b=p.measured.width!==S.width||p.measured.height!==S.height;if(!!(S.width&&S.height&&(b||!p.internals.handleBounds||g.force))){let v=g.nodeElement.getBoundingClientRect(),m=ct(p.extent)?p.extent:s,{positionAbsolute:w}=p.internals;if(p.parentId&&p.extent==="parent"){let _=t.get(p.parentId);_&&(w=ds(w,S,_))}else m&&(w=st(w,m,S));let N={...p,measured:S,internals:{...p.internals,positionAbsolute:w,handleBounds:{source:Gi("source",g.nodeElement,v,f,p.id),target:Gi("target",g.nodeElement,v,f,p.id)}}};t.set(p.id,N),p.parentId&&Ur(N,t,n,{nodeOrigin:i,zIndexMode:a}),l=!0,b&&(u.push({id:p.id,type:"dimensions",dimensions:S}),p.expandParent&&p.parentId&&h.push({id:p.id,parentId:p.parentId,rect:_t(N,i)}))}}if(h.length>0){let g=Un(h,t,n,i);u.push(...g)}return{changes:u,updatedInternals:l}}o(Es,"updateNodeInternals");async function Cs({delta:e,panZoom:t,transform:n,translateExtent:r,width:i,height:s}){if(!t||!e.x&&!e.y)return!1;let a=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[i,s]],r);return!!a&&(a.x!==n[0]||a.y!==n[1]||a.k!==n[2])}o(Cs,"panBy");function os(e,t,n,r,i,s){let a=i,c=r.get(a)||new Map;r.set(a,c.set(n,t)),a=`${i}-${e}`;let l=r.get(a)||new Map;if(r.set(a,l.set(n,t)),s){a=`${i}-${e}-${s}`;let u=r.get(a)||new Map;r.set(a,u.set(n,t))}}o(os,"addConnectionToLookup");function qr(e,t,n){e.clear(),t.clear();for(let r of n){let{source:i,target:s,sourceHandle:a=null,targetHandle:c=null}=r,l={edgeId:r.id,source:i,target:s,sourceHandle:a,targetHandle:c},u=`${i}-${a}--${s}-${c}`,d=`${s}-${c}--${i}-${a}`;os("source",l,d,e,i,a),os("target",l,u,e,s,c),t.set(r.id,r)}}o(qr,"updateConnectionLookup");function _s(e,t){if(!e.parentId)return!1;let n=t.get(e.parentId);return n?n.selected?!0:_s(n,t):!1}o(_s,"isParentSelected");function rs(e,t,n){let r=e;do{if(r?.matches?.(t))return!0;if(r===n)return!1;r=r?.parentElement}while(r);return!1}o(rs,"hasSelector");function qd(e,t,n,r){let i=new Map;for(let[s,a]of e)if((a.selected||a.id===r)&&(!a.parentId||!_s(a,e))&&(a.draggable||t&&typeof a.draggable>"u")){let c=e.get(s);c&&i.set(s,{id:s,position:c.position||{x:0,y:0},distance:{x:n.x-c.internals.positionAbsolute.x,y:n.y-c.internals.positionAbsolute.y},extent:c.extent,parentId:c.parentId,origin:c.origin,expandParent:c.expandParent,internals:{positionAbsolute:c.internals.positionAbsolute||{x:0,y:0}},measured:{width:c.measured.width??0,height:c.measured.height??0}})}return i}o(qd,"getDragItems");function Cr({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){let i=[];for(let[a,c]of t){let l=n.get(a)?.internals.userNode;l&&i.push({...l,position:c.position,dragging:r})}if(!e)return[i[0],i];let s=n.get(e)?.internals.userNode;return[s?{...s,position:t.get(e)?.position||s.position,dragging:r}:i[0],i]}o(Cr,"getEventHandlerParams");function Kd({dragItems:e,snapGrid:t,x:n,y:r}){let i=e.values().next().value;if(!i)return null;let s={x:n-i.distance.x,y:r-i.distance.y},a=Nt(s,t);return{x:a.x-s.x,y:a.y-s.y}}o(Kd,"calculateSnapOffset");function Ns({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:i}){let s={x:null,y:null},a=0,c=new Map,l=!1,u={x:0,y:0},d=null,f=!1,h=null,g=!1,p=!1,S=null;function b({noDragClassName:v,handleSelector:m,domNode:w,isSelectable:N,nodeId:_,nodeClickDistance:P=0}){h=le(w);function I({x:H,y:O}){let{nodeLookup:x,nodeExtent:E,snapGrid:C,snapToGrid:M,nodeOrigin:R,onNodeDrag:D,onSelectionDrag:V,onError:B,updateNodePositions:L}=t();s={x:H,y:O};let U=!1,X=c.size>1,K=X&&E?Mr(Ct(c)):null,ee=X&&M?Kd({dragItems:c,snapGrid:C,x:H,y:O}):null;for(let[G,$]of c){if(!x.has(G))continue;let W={x:H-$.distance.x,y:O-$.distance.y};M&&(W=ee?{x:Math.round(W.x+ee.x),y:Math.round(W.y+ee.y)}:Nt(W,C));let j=null;if(X&&E&&!$.extent&&K){let{positionAbsolute:Q}=$.internals,ne=Q.x-K.x+E[0][0],oe=Q.x+$.measured.width-K.x2+E[1][0],se=Q.y-K.y+E[0][1],pe=Q.y+$.measured.height-K.y2+E[1][1];j=[[ne,se],[oe,pe]]}let{position:J,positionAbsolute:q}=Rr({nodeId:G,nextPosition:W,nodeLookup:x,nodeExtent:j||E,nodeOrigin:R,onError:B});U=U||$.position.x!==J.x||$.position.y!==J.y,$.position=J,$.internals.positionAbsolute=q}if(p=p||U,!!U&&(L(c,!0),S&&(r||D||!_&&V))){let[G,$]=Cr({nodeId:_,dragItems:c,nodeLookup:x});r?.(S,c,G,$),D?.(S,G,$),_||V?.(S,$)}}o(I,"updateNodes");async function T(){if(!d)return;let{transform:H,panBy:O,autoPanSpeed:x,autoPanOnNodeDrag:E}=t();if(!E){l=!1,cancelAnimationFrame(a);return}let[C,M]=$n(u,d,x);(C!==0||M!==0)&&(s.x=(s.x??0)-C/H[2],s.y=(s.y??0)-M/H[2],await O({x:C,y:M})&&I(s)),a=requestAnimationFrame(T)}o(T,"autoPan");function F(H){let{nodeLookup:O,multiSelectionActive:x,nodesDraggable:E,transform:C,snapGrid:M,snapToGrid:R,selectNodesOnDrag:D,onNodeDragStart:V,onSelectionDragStart:B,unselectNodesAndEdges:L}=t();f=!0,(!D||!N)&&!x&&_&&(O.get(_)?.selected||L()),N&&D&&_&&e?.(_);let U=cn(H.sourceEvent,{transform:C,snapGrid:M,snapToGrid:R,containerBounds:d});if(s=U,c=qd(O,E,U,_),c.size>0&&(n||V||!_&&B)){let[X,K]=Cr({nodeId:_,dragItems:c,nodeLookup:O});n?.(H.sourceEvent,c,X,K),V?.(H.sourceEvent,X,K),_||B?.(H.sourceEvent,K)}}o(F,"startDrag");let z=Ut().clickDistance(P).on("start",H=>{let{domNode:O,nodeDragThreshold:x,transform:E,snapGrid:C,snapToGrid:M}=t();d=O?.getBoundingClientRect()||null,g=!1,p=!1,S=H.sourceEvent,x===0&&F(H),s=cn(H.sourceEvent,{transform:E,snapGrid:C,snapToGrid:M,containerBounds:d}),u=be(H.sourceEvent,d)}).on("drag",H=>{let{autoPanOnNodeDrag:O,transform:x,snapGrid:E,snapToGrid:C,nodeDragThreshold:M,nodeLookup:R}=t(),D=cn(H.sourceEvent,{transform:x,snapGrid:E,snapToGrid:C,containerBounds:d});if(S=H.sourceEvent,(H.sourceEvent.type==="touchmove"&&H.sourceEvent.touches.length>1||_&&!R.has(_))&&(g=!0),!g){if(!l&&O&&f&&(l=!0,T()),!f){let V=be(H.sourceEvent,d),B=V.x-u.x,L=V.y-u.y;Math.sqrt(B*B+L*L)>M&&F(H)}(s.x!==D.xSnapped||s.y!==D.ySnapped)&&c&&f&&(u=be(H.sourceEvent,d),I(D))}}).on("end",H=>{if(!f||g){g&&c.size>0&&t().updateNodePositions(c,!1);return}if(l=!1,f=!1,cancelAnimationFrame(a),c.size>0){let{nodeLookup:O,updateNodePositions:x,onNodeDragStop:E,onSelectionDragStop:C}=t();if(p&&(x(c,!1),p=!1),i||E||!_&&C){let[M,R]=Cr({nodeId:_,dragItems:c,nodeLookup:O,dragging:!1});i?.(H.sourceEvent,c,M,R),E?.(H.sourceEvent,M,R),_||C?.(H.sourceEvent,R)}}}).filter(H=>{let O=H.target;return!H.button&&(!v||!rs(O,`.${v}`,w))&&(!m||rs(O,m,w))});h.call(z)}o(b,"update");function y(){h?.on(".drag",null)}return o(y,"destroy"),{update:b,destroy:y}}o(Ns,"XYDrag");function Gd(e,t,n){let r=[],i={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(let s of t.values())dn(i,_t(s))>0&&r.push(s);return r}o(Gd,"getNodesWithinDistance");var Qd=250;function Jd(e,t,n,r){let i=[],s=1/0,a=Gd(e,n,t+Qd);for(let c of a){let l=[...c.internals.handleBounds?.source??[],...c.internals.handleBounds?.target??[]];for(let u of l){if(r.nodeId===u.nodeId&&r.type===u.type&&r.id===u.id)continue;let{x:d,y:f}=Ye(c,u,u.position,!0),h=Math.sqrt(Math.pow(d-e.x,2)+Math.pow(f-e.y,2));h>t||(h<s?(i=[{...u,x:d,y:f}],s=h):h===s&&i.push({...u,x:d,y:f}))}}if(!i.length)return null;if(i.length>1){let c=r.type==="source"?"target":"source";return i.find(l=>l.type===c)??i[0]}return i[0]}o(Jd,"getClosestHandle");function Ms(e,t,n,r,i,s=!1){let a=r.get(e);if(!a)return null;let c=i==="strict"?a.internals.handleBounds?.[t]:[...a.internals.handleBounds?.source??[],...a.internals.handleBounds?.target??[]],l=(n?c?.find(u=>u.id===n):c?.[0])??null;return l&&s?{...l,...Ye(a,l,l.position,!0)}:l}o(Ms,"getHandle");function Is(e,t){return e||(t?.classList.contains("target")?"target":t?.classList.contains("source")?"source":null)}o(Is,"getHandleType");function jd(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}o(jd,"isConnectionValid");var Ps=o(()=>!0,"alwaysValid");function ef(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:i,edgeUpdaterType:s,isTarget:a,domNode:c,nodeLookup:l,lib:u,autoPanOnConnect:d,flowId:f,panBy:h,cancelConnection:g,onConnectStart:p,onConnect:S,onConnectEnd:b,isValidConnection:y=Ps,onReconnectEnd:v,updateConnection:m,getTransform:w,getFromHandle:N,autoPanSpeed:_,dragThreshold:P=1,handleDomNode:I}){let T=Br(e.target),F=0,z,{x:H,y:O}=be(e),x=Is(s,I),E=c?.getBoundingClientRect(),C=!1;if(!E||!x)return;let M=Ms(i,x,r,l,t);if(!M)return;let R=be(e,E),D=!1,V=null,B=!1,L=null;function U(){if(!d||!E)return;let[J,q]=$n(R,E,_);h({x:J,y:q}),F=requestAnimationFrame(U)}o(U,"autoPan");let X={...M,nodeId:i,type:x,position:M.position},K=l.get(i),G={inProgress:!0,isValid:null,from:Ye(K,X,Y.Left,!0),fromHandle:X,fromPosition:X.position,fromNode:K,to:R,toHandle:null,toPosition:qi[X.position],toNode:null,pointer:R};function $(){C=!0,m(G),p?.(e,{nodeId:i,handleId:r,handleType:x})}o($,"startConnection"),P===0&&$();function W(J){if(!C){let{x:pe,y:Pe}=be(J),_e=pe-H,Ne=Pe-O;if(!(_e*_e+Ne*Ne>P*P))return;$()}if(!N()||!X){j(J);return}let q=w();R=be(J,E),z=Jd(Mt(R,q,!1,[1,1]),n,l,X),D||(U(),D=!0);let Q=ks(J,{handle:z,connectionMode:t,fromNodeId:i,fromHandleId:r,fromType:a?"target":"source",isValidConnection:y,doc:T,lib:u,flowId:f,nodeLookup:l});L=Q.handleDomNode,V=Q.connection,B=jd(!!z,Q.isValid);let ne=l.get(i),oe=ne?Ye(ne,X,Y.Left,!0):G.from,se={...G,from:oe,isValid:B,to:Q.toHandle&&B?at({x:Q.toHandle.x,y:Q.toHandle.y},q):R,toHandle:Q.toHandle,toPosition:B&&Q.toHandle?Q.toHandle.position:qi[X.position],toNode:Q.toHandle?l.get(Q.toHandle.nodeId):null,pointer:R};m(se),G=se}o(W,"onPointerMove");function j(J){if(!("touches"in J&&J.touches.length>0)){if(C){(z||L)&&V&&B&&S?.(V);let{inProgress:q,...Q}=G,ne={...Q,toPosition:G.toHandle?G.toPosition:null};b?.(J,ne),s&&v?.(J,ne)}g(),cancelAnimationFrame(F),D=!1,B=!1,V=null,L=null,T.removeEventListener("mousemove",W),T.removeEventListener("mouseup",j),T.removeEventListener("touchmove",W),T.removeEventListener("touchend",j)}}o(j,"onPointerUp"),T.addEventListener("mousemove",W),T.addEventListener("mouseup",j),T.addEventListener("touchmove",W),T.addEventListener("touchend",j)}o(ef,"onPointerDown");function ks(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:s,doc:a,lib:c,flowId:l,isValidConnection:u=Ps,nodeLookup:d}){let f=s==="target",h=t?a.querySelector(`.${c}-flow__handle[data-id="${l}-${t?.nodeId}-${t?.id}-${t?.type}"]`):null,{x:g,y:p}=be(e),S=a.elementFromPoint(g,p),b=S?.classList.contains(`${c}-flow__handle`)?S:h,y={handleDomNode:b,isValid:!1,connection:null,toHandle:null};if(b){let v=Is(void 0,b),m=b.getAttribute("data-nodeid"),w=b.getAttribute("data-handleid"),N=b.classList.contains("connectable"),_=b.classList.contains("connectableend");if(!m||!v)return y;let P={source:f?m:r,sourceHandle:f?w:i,target:f?r:m,targetHandle:f?i:w};y.connection=P;let T=N&&_&&(n===Xe.Strict?f&&v==="source"||!f&&v==="target":m!==r||w!==i);y.isValid=T&&u(P),y.toHandle=Ms(m,v,w,d,n,!0)}return y}o(ks,"isValidHandle");var qn={onPointerDown:ef,isValid:ks};function As({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){let i=le(e);function s({translateExtent:c,width:l,height:u,zoomStep:d=1,pannable:f=!0,zoomable:h=!0,inversePan:g=!1}){let p=o(m=>{if(m.sourceEvent.type!=="wheel"||!t)return;let w=n(),N=m.sourceEvent.ctrlKey&&It()?10:1,_=-m.sourceEvent.deltaY*(m.sourceEvent.deltaMode===1?.05:m.sourceEvent.deltaMode?1:.002)*d,P=w[2]*Math.pow(2,_*N);t.scaleTo(P)},"zoomHandler"),S=[0,0],b=o(m=>{(m.sourceEvent.type==="mousedown"||m.sourceEvent.type==="touchstart")&&(S=[m.sourceEvent.clientX??m.sourceEvent.touches[0].clientX,m.sourceEvent.clientY??m.sourceEvent.touches[0].clientY])},"panStartHandler"),y=o(m=>{let w=n();if(m.sourceEvent.type!=="mousemove"&&m.sourceEvent.type!=="touchmove"||!t)return;let N=[m.sourceEvent.clientX??m.sourceEvent.touches[0].clientX,m.sourceEvent.clientY??m.sourceEvent.touches[0].clientY],_=[N[0]-S[0],N[1]-S[1]];S=N;let P=r()*Math.max(w[2],Math.log(w[2]))*(g?-1:1),I={x:w[0]-_[0]*P,y:w[1]-_[1]*P},T=[[0,0],[l,u]];t.setViewportConstrained({x:I.x,y:I.y,zoom:w[2]},T,c)},"panHandler"),v=an().on("start",b).on("zoom",f?y:null).on("zoom.wheel",h?p:null);i.call(v,{})}o(s,"update");function a(){i.on("zoom",null)}return o(a,"destroy"),{update:s,destroy:a,pointer:fe}}o(As,"XYMinimap");var Kn=o(e=>({x:e.x,y:e.y,zoom:e.k}),"transformToViewport"),_r=o(({x:e,y:t,zoom:n})=>ot.translate(e,t).scale(n),"viewportToTransform"),bt=o((e,t)=>e.target.closest(`.${t}`),"isWrappedWithClass"),Ts=o((e,t)=>t===2&&Array.isArray(e)&&e.includes(2),"isRightClickPan"),tf=o(e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,"defaultEase"),Nr=o((e,t=0,n=tf,r=()=>{})=>{let i=typeof t=="number"&&t>0;return i||r(),i?e.transition().duration(t).ease(n).on("end",r):e},"getD3Transition"),Ds=o(e=>{let t=e.ctrlKey&&It()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t},"wheelDelta");function nf({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:i,panOnScrollSpeed:s,zoomOnPinch:a,onPanZoomStart:c,onPanZoom:l,onPanZoomEnd:u}){return d=>{if(bt(d,t))return d.ctrlKey&&d.preventDefault(),!1;d.preventDefault(),d.stopImmediatePropagation();let f=n.property("__zoom").k||1;if(d.ctrlKey&&a){let b=fe(d),y=Ds(d),v=f*Math.pow(2,y);r.scaleTo(n,v,b,d);return}let h=d.deltaMode===1?20:1,g=i===$e.Vertical?0:d.deltaX*h,p=i===$e.Horizontal?0:d.deltaY*h;!It()&&d.shiftKey&&i!==$e.Vertical&&(g=d.deltaY*h,p=0),r.translateBy(n,-(g/f)*s,-(p/f)*s,{internal:!0});let S=Kn(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?l?.(d,S):(e.isPanScrolling=!0,c?.(d,S)),e.panScrollTimeout=setTimeout(()=>{u?.(d,S),e.isPanScrolling=!1},150)}}o(nf,"createPanOnScrollHandler");function of({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,i){let s=r.type==="wheel",a=!t&&s&&!r.ctrlKey,c=bt(r,e);if(r.ctrlKey&&s&&c&&r.preventDefault(),a||c)return null;r.preventDefault(),n.call(this,r,i)}}o(of,"createZoomOnScrollHandler");function rf({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{if(r.sourceEvent?.internal)return;let i=Kn(r.transform);e.mouseButton=r.sourceEvent?.button||0,e.isZoomingOrPanning=!0,e.prevViewport=i,r.sourceEvent?.type==="mousedown"&&t(!0),n&&n?.(r.sourceEvent,i)}}o(rf,"createPanZoomStartHandler");function sf({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:i}){return s=>{e.usedRightMouseButton=!!(n&&Ts(t,e.mouseButton??0)),s.sourceEvent?.sync||r([s.transform.x,s.transform.y,s.transform.k]),i&&!s.sourceEvent?.internal&&i?.(s.sourceEvent,Kn(s.transform))}}o(sf,"createPanZoomHandler");function af({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:i,onPaneContextMenu:s}){return a=>{if(!a.sourceEvent?.internal&&(e.isZoomingOrPanning=!1,s&&Ts(t,e.mouseButton??0)&&!e.usedRightMouseButton&&a.sourceEvent&&s(a.sourceEvent),e.usedRightMouseButton=!1,r(!1),i)){let c=Kn(a.transform);e.prevViewport=c,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{i?.(a.sourceEvent,c)},n?150:0)}}}o(af,"createPanZoomEndHandler");function cf({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:i,zoomOnDoubleClick:s,userSelectionActive:a,noWheelClassName:c,noPanClassName:l,lib:u,connectionInProgress:d}){return f=>{let h=e||t,g=n&&f.ctrlKey,p=f.type==="wheel";if(f.button===1&&f.type==="mousedown"&&(bt(f,`${u}-flow__node`)||bt(f,`${u}-flow__edge`)))return!0;if(!r&&!h&&!i&&!s&&!n||a||d&&!p||bt(f,c)&&p||bt(f,l)&&(!p||i&&p&&!e)||!n&&f.ctrlKey&&p)return!1;if(!n&&f.type==="touchstart"&&f.touches?.length>1)return f.preventDefault(),!1;if(!h&&!i&&!g&&p||!r&&(f.type==="mousedown"||f.type==="touchstart")||Array.isArray(r)&&!r.includes(f.button)&&f.type==="mousedown")return!1;let S=Array.isArray(r)&&r.includes(f.button)||!f.button||f.button<=1;return(!f.ctrlKey||p)&&S}}o(cf,"createFilter");function Rs({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:i,onPanZoom:s,onPanZoomStart:a,onPanZoomEnd:c,onDraggingChange:l}){let u={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},d=e.getBoundingClientRect(),f=[[0,0],[d.width,d.height]];(typeof ResizeObserver<"u"?new ResizeObserver(O=>{let x=O[0];x&&(f=[[0,0],[x.contentRect.width,x.contentRect.height]])}):null)?.observe(e);let g=an().extent(()=>f).scaleExtent([t,n]).translateExtent(r),p=le(e).call(g);w({x:i.x,y:i.y,zoom:vt(i.zoom,t,n)},[[0,0],[d.width,d.height]],r);let S=p.on("wheel.zoom"),b=p.on("dblclick.zoom");g.wheelDelta(Ds);async function y(O,x){return p?new Promise(E=>{g?.interpolate(x?.interpolate==="linear"?yn:ht).transform(Nr(p,x?.duration,x?.ease,()=>E(!0)),O)}):!1}o(y,"setTransform");function v({noWheelClassName:O,noPanClassName:x,onPaneContextMenu:E,userSelectionActive:C,panOnScroll:M,panOnDrag:R,panOnScrollMode:D,panOnScrollSpeed:V,preventScrolling:B,zoomOnPinch:L,zoomOnScroll:U,zoomOnDoubleClick:X,zoomActivationKeyPressed:K,lib:ee,onTransformChange:G,connectionInProgress:$,paneClickDistance:W,selectionOnDrag:j}){C&&!u.isZoomingOrPanning&&m();let J=M&&!K&&!C;g.clickDistance(j?1/0:!we(W)||W<0?0:W);let q=J?nf({zoomPanValues:u,noWheelClassName:O,d3Selection:p,d3Zoom:g,panOnScrollMode:D,panOnScrollSpeed:V,zoomOnPinch:L,onPanZoomStart:a,onPanZoom:s,onPanZoomEnd:c}):of({noWheelClassName:O,preventScrolling:B,d3ZoomHandler:S});p.on("wheel.zoom",q,{passive:!1});let Q=rf({zoomPanValues:u,onDraggingChange:l,onPanZoomStart:a});g.on("start",Q);let ne=sf({zoomPanValues:u,panOnDrag:R,onPaneContextMenu:!!E,onPanZoom:s,onTransformChange:G});g.on("zoom",ne);let oe=af({zoomPanValues:u,panOnDrag:R,panOnScroll:M,onPaneContextMenu:E,onPanZoomEnd:c,onDraggingChange:l});g.on("end",oe);let se=cf({zoomActivationKeyPressed:K,panOnDrag:R,zoomOnScroll:U,panOnScroll:M,zoomOnDoubleClick:X,zoomOnPinch:L,userSelectionActive:C,noPanClassName:x,noWheelClassName:O,lib:ee,connectionInProgress:$});g.filter(se),X?p.on("dblclick.zoom",b):p.on("dblclick.zoom",null)}o(v,"update");function m(){g.on("zoom",null)}o(m,"destroy");async function w(O,x,E){let C=_r(O),M=g?.constrain()(C,x,E);return M&&await y(M),M}o(w,"setViewportConstrained");async function N(O,x){let E=_r(O);return await y(E,x),E}o(N,"setViewport");function _(O){if(p){let x=_r(O),E=p.property("__zoom");(E.k!==O.zoom||E.x!==O.x||E.y!==O.y)&&g?.transform(p,x,null,{sync:!0})}}o(_,"syncViewport");function P(){let O=p?sn(p.node()):{x:0,y:0,k:1};return{x:O.x,y:O.y,zoom:O.k}}o(P,"getViewport");async function I(O,x){return p?new Promise(E=>{g?.interpolate(x?.interpolate==="linear"?yn:ht).scaleTo(Nr(p,x?.duration,x?.ease,()=>E(!0)),O)}):!1}o(I,"scaleTo");async function T(O,x){return p?new Promise(E=>{g?.interpolate(x?.interpolate==="linear"?yn:ht).scaleBy(Nr(p,x?.duration,x?.ease,()=>E(!0)),O)}):!1}o(T,"scaleBy");function F(O){g?.scaleExtent(O)}o(F,"setScaleExtent");function z(O){g?.translateExtent(O)}o(z,"setTranslateExtent");function H(O){let x=!we(O)||O<0?0:O;g?.clickDistance(x)}return o(H,"setClickDistance"),{update:v,destroy:m,setViewport:N,setViewportConstrained:w,getViewport:P,scaleTo:I,scaleBy:T,setScaleExtent:F,setTranslateExtent:z,syncViewport:_,setClickDistance:H}}o(Rs,"XYPanZoom");var Ze;(function(e){e.Line="line",e.Handle="handle"})(Ze||(Ze={}));function lf({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:i,affectsY:s}){let a=e-t,c=n-r,l=[a>0?1:a<0?-1:0,c>0?1:c<0?-1:0];return a&&i&&(l[0]=l[0]*-1),c&&s&&(l[1]=l[1]*-1),l}o(lf,"getResizeDirection");function is(e){let t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),r=e.includes("left"),i=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:r,affectsY:i}}o(is,"getControlDirection");function Fe(e,t){return Math.max(0,t-e)}o(Fe,"getLowerExtentClamp");function We(e,t){return Math.max(0,e-t)}o(We,"getUpperExtentClamp");function Rn(e,t,n){return Math.max(0,t-e,e-n)}o(Rn,"getSizeClamp");function ss(e,t){return e?!t:t}o(ss,"xor");function uf(e,t,n,r,i,s,a,c){let{affectsX:l,affectsY:u}=t,{isHorizontal:d,isVertical:f}=t,h=d&&f,{xSnapped:g,ySnapped:p}=n,{minWidth:S,maxWidth:b,minHeight:y,maxHeight:v}=r,{x:m,y:w,width:N,height:_,aspectRatio:P}=e,I=Math.floor(d?g-e.pointerX:0),T=Math.floor(f?p-e.pointerY:0),F=N+(l?-I:I),z=_+(u?-T:T),H=-s[0]*N,O=-s[1]*_,x=Rn(F,S,b),E=Rn(z,y,v);if(a){let R=0,D=0;l&&I<0?R=Fe(m+I+H,a[0][0]):!l&&I>0&&(R=We(m+F+H,a[1][0])),u&&T<0?D=Fe(w+T+O,a[0][1]):!u&&T>0&&(D=We(w+z+O,a[1][1])),x=Math.max(x,R),E=Math.max(E,D)}if(c){let R=0,D=0;l&&I>0?R=We(m+I,c[0][0]):!l&&I<0&&(R=Fe(m+F,c[1][0])),u&&T>0?D=We(w+T,c[0][1]):!u&&T<0&&(D=Fe(w+z,c[1][1])),x=Math.max(x,R),E=Math.max(E,D)}if(i){if(d){let R=Rn(F/P,y,v)*P;if(x=Math.max(x,R),a){let D=0;!l&&!u||l&&!u&&h?D=We(w+O+F/P,a[1][1])*P:D=Fe(w+O+(l?I:-I)/P,a[0][1])*P,x=Math.max(x,D)}if(c){let D=0;!l&&!u||l&&!u&&h?D=Fe(w+F/P,c[1][1])*P:D=We(w+(l?I:-I)/P,c[0][1])*P,x=Math.max(x,D)}}if(f){let R=Rn(z*P,S,b)/P;if(E=Math.max(E,R),a){let D=0;!l&&!u||u&&!l&&h?D=We(m+z*P+H,a[1][0])/P:D=Fe(m+(u?T:-T)*P+H,a[0][0])/P,E=Math.max(E,D)}if(c){let D=0;!l&&!u||u&&!l&&h?D=Fe(m+z*P,c[1][0])/P:D=We(m+(u?T:-T)*P,c[0][0])/P,E=Math.max(E,D)}}}T=T+(T<0?E:-E),I=I+(I<0?x:-x),i&&(h?F>z*P?T=(ss(l,u)?-I:I)/P:I=(ss(l,u)?-T:T)*P:d?(T=I/P,u=l):(I=T*P,l=u));let C=l?m+I:m,M=u?w+T:w;return{width:N+(l?-I:I),height:_+(u?-T:T),x:s[0]*I*(l?-1:1)+C,y:s[1]*T*(u?-1:1)+M}}o(uf,"getDimensionsAfterResize");var zs={width:0,height:0,x:0,y:0},df={...zs,pointerX:0,pointerY:0,aspectRatio:1};function ff(e,t,n){let r=t.position.x+e.position.x,i=t.position.y+e.position.y,s=e.measured.width??0,a=e.measured.height??0,c=n[0]*s,l=n[1]*a;return[[r-c,i-l],[r+s-c,i+a-l]]}o(ff,"nodeToChildExtent");function Os({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:i}){let s=le(e),a={controlDirection:is("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function c({controlPosition:u,boundaries:d,keepAspectRatio:f,resizeDirection:h,onResizeStart:g,onResize:p,onResizeEnd:S,shouldResize:b}){let y={...zs},v={...df};a={boundaries:d,resizeDirection:h,keepAspectRatio:f,controlDirection:is(u)};let m,w=null,N=[],_,P,I,T=!1,F=Ut().on("start",z=>{let{nodeLookup:H,transform:O,snapGrid:x,snapToGrid:E,nodeOrigin:C,paneDomNode:M}=n();if(m=H.get(t),!m)return;w=M?.getBoundingClientRect()??null;let{xSnapped:R,ySnapped:D}=cn(z.sourceEvent,{transform:O,snapGrid:x,snapToGrid:E,containerBounds:w});y={width:m.measured.width??0,height:m.measured.height??0,x:m.position.x??0,y:m.position.y??0},v={...y,pointerX:R,pointerY:D,aspectRatio:y.width/y.height},_=void 0,P=ct(m.extent)?m.extent:void 0,m.parentId&&(m.extent==="parent"||m.expandParent)&&(_=H.get(m.parentId)),_&&m.extent==="parent"&&(P=[[0,0],[_.measured.width,_.measured.height]]),N=[],I=void 0;for(let[V,B]of H)if(B.parentId===t&&(N.push({id:V,position:{...B.position},extent:B.extent}),B.extent==="parent"||B.expandParent)){let L=ff(B,m,B.origin??C);I?I=[[Math.min(L[0][0],I[0][0]),Math.min(L[0][1],I[0][1])],[Math.max(L[1][0],I[1][0]),Math.max(L[1][1],I[1][1])]]:I=L}g?.(z,{...y})}).on("drag",z=>{let{transform:H,snapGrid:O,snapToGrid:x,nodeOrigin:E}=n(),C=cn(z.sourceEvent,{transform:H,snapGrid:O,snapToGrid:x,containerBounds:w}),M=[];if(!m)return;let{x:R,y:D,width:V,height:B}=y,L={},U=m.origin??E,{width:X,height:K,x:ee,y:G}=uf(v,a.controlDirection,C,a.boundaries,a.keepAspectRatio,U,P,I),$=X!==V,W=K!==B,j=ee!==R&&$,J=G!==D&&W;if(!j&&!J&&!$&&!W)return;if((j||J||U[0]===1||U[1]===1)&&(L.x=j?ee:y.x,L.y=J?G:y.y,y.x=L.x,y.y=L.y,N.length>0)){let oe=ee-R,se=G-D;for(let pe of N)pe.position={x:pe.position.x-oe+U[0]*(X-V),y:pe.position.y-se+U[1]*(K-B)},M.push(pe)}if(($||W)&&(L.width=$&&(!a.resizeDirection||a.resizeDirection==="horizontal")?X:y.width,L.height=W&&(!a.resizeDirection||a.resizeDirection==="vertical")?K:y.height,y.width=L.width,y.height=L.height),_&&m.expandParent){let oe=U[0]*(L.width??0);L.x&&L.x<oe&&(y.x=oe,v.x=v.x-(L.x-oe));let se=U[1]*(L.height??0);L.y&&L.y<se&&(y.y=se,v.y=v.y-(L.y-se))}let q=lf({width:y.width,prevWidth:V,height:y.height,prevHeight:B,affectsX:a.controlDirection.affectsX,affectsY:a.controlDirection.affectsY}),Q={...y,direction:q};b?.(z,Q)!==!1&&(T=!0,p?.(z,Q),r(L,M))}).on("end",z=>{T&&(S?.(z,{...y}),i?.({...y}),T=!1)});s.call(F)}o(c,"update");function l(){s.on(".drag",null)}return o(l,"destroy"),{update:c,destroy:l}}o(Os,"XYResizer");var Bs=Le(lo(),1),Vs=Le(Ll(),1);var $s=o(e=>{let t,n=new Set,r=o((d,f)=>{let h=typeof d=="function"?d(t):d;if(!Object.is(h,t)){let g=t;t=f??(typeof h!="object"||h===null)?h:Object.assign({},t,h),n.forEach(p=>p(t,g))}},"setState"),i=o(()=>t,"getState"),l={setState:r,getState:i,getInitialState:o(()=>u,"getInitialState"),subscribe:o(d=>(n.add(d),()=>n.delete(d)),"subscribe"),destroy:o(()=>{(import.meta.env?import.meta.env.MODE:void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()},"destroy")},u=t=e(r,i,l);return l},"createStoreImpl"),Ls=o(e=>e?$s(e):$s,"createStore");var{useDebugValue:hf}=Bs.default,{useSyncExternalStoreWithSelector:pf}=Vs.default,gf=o(e=>e,"identity");function Kr(e,t=gf,n){let r=pf(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return hf(r),r}o(Kr,"useStoreWithEqualityFn");var Hs=o((e,t)=>{let n=Ls(e),r=o((i,s=t)=>Kr(n,i,s),"useBoundStoreWithEqualityFn");return Object.assign(r,n),r},"createWithEqualityFnImpl"),Fs=o((e,t)=>e?Hs(e,t):Hs,"createWithEqualityFn");function re(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(let[r,i]of e)if(!Object.is(i,t.get(r)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(let r of e)if(!t.has(r))return!1;return!0}let n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}o(re,"shallow$1");var mf=Le(Ol());var jn=(0,k.createContext)(null),yf=jn.Provider,ga=ye.error001("react");function te(e,t){let n=(0,k.useContext)(jn);if(n===null)throw new Error(ga);return Kr(n,e,t)}o(te,"useStore");function ie(){let e=(0,k.useContext)(jn);if(e===null)throw new Error(ga);return(0,k.useMemo)(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}o(ie,"useStoreApi");var Ws={display:"none"},xf={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},ma="react-flow__node-desc",ya="react-flow__edge-desc",wf="react-flow__aria-live",bf=o(e=>e.ariaLiveMessage,"ariaLiveSelector"),Sf=o(e=>e.ariaLabelConfig,"ariaLabelConfigSelector");function vf({rfId:e}){let t=te(bf);return(0,A.jsx)("div",{id:`${wf}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:xf,children:t})}o(vf,"AriaLiveMessage");function Ef({rfId:e,disableKeyboardA11y:t}){let n=te(Sf);return(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)("div",{id:`${ma}-${e}`,style:Ws,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),(0,A.jsx)("div",{id:`${ya}-${e}`,style:Ws,children:n["edge.a11yDescription.default"]}),!t&&(0,A.jsx)(vf,{rfId:e})]})}o(Ef,"A11yDescriptions");var qe=(0,k.forwardRef)(({position:e="top-left",children:t,className:n,style:r,...i},s)=>{let a=`${e}`.split("-");return(0,A.jsx)("div",{className:ae(["react-flow__panel",n,...a]),style:r,ref:s,...i,children:t})});qe.displayName="Panel";var Xs="https://reactflow.dev?utm_source=attribution";function Cf({proOptions:e,position:t="bottom-right"}){return e?.hideAttribution?null:(0,A.jsx)(qe,{position:t,className:"react-flow__attribution","data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: ${Xs}`,children:(0,A.jsx)("a",{href:Xs,target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}o(Cf,"Attribution");var _f=o(e=>{let t=[],n=[];for(let[,r]of e.nodeLookup)r.selected&&t.push(r.internals.userNode);for(let[,r]of e.edgeLookup)r.selected&&n.push(r);return{selectedNodes:t,selectedEdges:n}},"selector$l"),Gn=o(e=>e.id,"selectId");function Nf(e,t){return re(e.selectedNodes.map(Gn),t.selectedNodes.map(Gn))&&re(e.selectedEdges.map(Gn),t.selectedEdges.map(Gn))}o(Nf,"areEqual$1");function Mf({onSelectionChange:e}){let t=ie(),{selectedNodes:n,selectedEdges:r}=te(_f,Nf);return(0,k.useEffect)(()=>{let i={nodes:n,edges:r};e?.(i),t.getState().onSelectionChangeHandlers.forEach(s=>s(i))},[n,r,e]),null}o(Mf,"SelectionListenerInner");var If=o(e=>!!e.onSelectionChangeHandlers,"changeSelector");function Pf({onSelectionChange:e}){let t=te(If);return e||t?(0,A.jsx)(Mf,{onSelectionChange:e}):null}o(Pf,"SelectionListener");var xa=[0,0],kf={x:0,y:0,zoom:1},Af=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","ariaLabelConfig","zIndexMode"],Ys=[...Af,"rfId"],Tf=o(e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),"selector$k"),Zs={translateExtent:Et,nodeOrigin:xa,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function Df(e){let{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:i,setTranslateExtent:s,setNodeExtent:a,reset:c,setDefaultNodesAndEdges:l}=te(Tf,re),u=ie();(0,k.useEffect)(()=>(l(e.defaultNodes,e.defaultEdges),()=>{d.current=Zs,c()}),[]);let d=(0,k.useRef)(Zs);return(0,k.useEffect)(()=>{for(let f of Ys){let h=e[f],g=d.current[f];h!==g&&(typeof e[f]>"u"||(f==="nodes"?t(h):f==="edges"?n(h):f==="minZoom"?r(h):f==="maxZoom"?i(h):f==="translateExtent"?s(h):f==="nodeExtent"?a(h):f==="ariaLabelConfig"?u.setState({ariaLabelConfig:ps(h)}):f==="fitView"?u.setState({fitViewQueued:h}):f==="fitViewOptions"?u.setState({fitViewOptions:h}):u.setState({[f]:h})))}d.current=e},Ys.map(f=>e[f])),null}o(Df,"StoreUpdater");function Us(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}o(Us,"getMediaQuery");function Rf(e){let[t,n]=(0,k.useState)(e==="system"?null:e);return(0,k.useEffect)(()=>{if(e!=="system"){n(e);return}let r=Us(),i=o(()=>n(r?.matches?"dark":"light"),"updateColorModeClass");return i(),r?.addEventListener("change",i),()=>{r?.removeEventListener("change",i)}},[e]),t!==null?t:Us()?.matches?"dark":"light"}o(Rf,"useColorModeClass");var qs=typeof document<"u"?document:null;function hn(e=null,t={target:qs,actInsideInputWithModifier:!0}){let[n,r]=(0,k.useState)(!1),i=(0,k.useRef)(!1),s=(0,k.useRef)(new Set([])),[a,c]=(0,k.useMemo)(()=>{if(e!==null){let u=(Array.isArray(e)?e:[e]).filter(f=>typeof f=="string").map(f=>f.replace("+",`
|
|
2
2
|
`).replace(`
|
|
3
3
|
|
|
4
4
|
`,`
|