@ltm-blueverse/alpha-hub-studio 0.7.0 → 0.7.2
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/README.md +1 -20
- package/package.json +6 -17
- package/static/assets/DecisionWorkspace-BbxYoPCv.js +1 -0
- package/static/assets/{DiffMergeWorkspace-C8yIdDC7.js → DiffMergeWorkspace-I9BcvT3J.js} +1 -1
- package/static/assets/EntityResolutionTab-DZME6ngq.js +6 -0
- package/static/assets/{GraphInspectorPanel-Bbrbhd03.js → GraphInspectorPanel-ZkQtr_Oa.js} +1 -1
- package/static/assets/{GraphWorkspace-AxTFEhNP.js → GraphWorkspace-DjKI1vje.js} +37 -37
- package/static/assets/{ImportExportWorkspace-BK3TofDv.js → ImportExportWorkspace-FesluaxV.js} +2 -2
- package/static/assets/KGOverviewTab-CIuFOyUa.js +1 -0
- package/static/assets/LineageDiagram-BlTkwTG_.js +27 -0
- package/static/assets/{MarkdownContentViewer-Chx4ysCK.js → MarkdownContentViewer-B2I-lKUf.js} +4 -4
- package/static/assets/{MemoryWorkspace-CIjaTN_S.js → MemoryWorkspace-CbGHQGJQ.js} +2 -2
- package/static/assets/{OntologySummaryTab-NJ3ZrkoJ.js → OntologySummaryTab-Q3rXi9jh.js} +1 -1
- package/static/assets/{ReasoningWorkspace-B127Rd-S.js → ReasoningWorkspace-DSYffkef.js} +2 -2
- package/static/assets/RegistryTab-C9IfTx8j.js +11 -0
- package/static/assets/{SparqlWorkspace-RwPj2YK7.js → SparqlWorkspace-BHAlhIXU.js} +3 -3
- package/static/assets/{TimelinePanel-DmtiXgmN.js → TimelinePanel-D50aWGS7.js} +1 -1
- package/static/assets/{VocabularyWorkspace-YF9waL5N.js → VocabularyWorkspace-BUFmkjyq.js} +6 -6
- package/static/assets/{book-open-BqEIxx1e.js → book-open-CEYwt1ql.js} +1 -1
- package/static/assets/{chevron-right-CiEuNwKq.js → chevron-right-BnjhfQ0S.js} +1 -1
- package/static/assets/{circle-check-BToWKwbO.js → circle-check-CzC458Im.js} +1 -1
- package/static/assets/{copy-BfQXGhHP.js → copy-D1MBJLmb.js} +1 -1
- package/static/assets/{download-gQOgYz3q.js → download-BiH8WZKH.js} +1 -1
- package/static/assets/{external-link-DqNu6T-f.js → external-link-BRF01S2q.js} +1 -1
- package/static/assets/{file-text-Bbz-r0FQ.js → file-text-bY52r7Yt.js} +1 -1
- package/static/assets/{git-branch-B8yDcUSY.js → git-branch-apSLSDgQ.js} +1 -1
- package/static/assets/graphTheme-DCTRN8Qm.js +6 -0
- package/static/assets/{index-Bt8w1Tz_.css → index-3PtcB4_T.css} +1 -1
- package/static/assets/{index-DHWWI-uw.js → index-CVYHt6Z6.js} +81 -81
- package/static/assets/{index-Dli_3Iwd.js → index-D0ErQ1c2.js} +1 -1
- package/static/assets/{index-DtC_GayB.js → index-D1_G_our.js} +1 -1
- package/static/assets/index-DPG7Yem6.js +127 -0
- package/static/assets/{info-vaffNQOD.js → info-Bxj0ofiy.js} +1 -1
- package/static/assets/{layers-Cct6D_wK.js → layers-CXZNgF0V.js} +1 -1
- package/static/assets/{loader-circle-C8NUmtFx.js → loader-circle-CmyLCPAg.js} +1 -1
- package/static/assets/{neighborhoodPanelPlugin-w1yJlm0A.js → neighborhoodPanelPlugin-gLy7GAga.js} +1 -1
- package/static/assets/{pencil-DYlEC6ri.js → pencil-COLtDS12.js} +1 -1
- package/static/assets/{play-G1gyOk2a.js → play-CG0LOI9D.js} +1 -1
- package/static/assets/{queries-CYtdSB4H.js → queries-AYIcORqv.js} +1 -1
- package/static/assets/{refresh-cw-CL9OXZ89.js → refresh-cw-B1c5rNMc.js} +1 -1
- package/static/assets/{registryStore-MVt_NgVV.js → registryStore-BPopBcrC.js} +1 -1
- package/static/assets/{style-D8TqSrGs.js → style-DGS084C0.js} +1 -1
- package/static/assets/temporalOverlayPlugin-DzF7xO4p.js +1 -0
- package/static/assets/{trash-2-DiZNV6Gj.js → trash-2-CLBVEYNO.js} +1 -1
- package/static/assets/{x-DpqMYq96.js → x-lyk2jiOu.js} +1 -1
- package/static/index.html +3 -3
- package/static/assets/DecisionWorkspace-DG6zPNls.js +0 -1
- package/static/assets/EntityResolutionTab-RBysMLhB.js +0 -6
- package/static/assets/KGOverviewTab-D9EWKL_n.js +0 -1
- package/static/assets/LineageDiagram-XxBVa1Ij.js +0 -27
- package/static/assets/RegistryTab-BE2-yKLC.js +0 -11
- package/static/assets/graphTheme-DNKLxzKZ.js +0 -6
- package/static/assets/index-MVDNL3vw.js +0 -127
- package/static/assets/temporalOverlayPlugin-CRhLa1FU.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as ia,g as sa,R as aa,a as T,j as P}from"./query-vendor-BqVbYexz.js";import{r as ca}from"./index-C00aFykz.js";import{f as la}from"./index-DHWWI-uw.js";function ie(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,o;n<e.length;n++)(o=ie(e[n]))!==""&&(t+=(t&&" ")+o);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var ua={value:()=>{}};function Gt(){for(var e=0,t=arguments.length,n={},o;e<t;++e){if(!(o=arguments[e]+"")||o in n||/[\s.]/.test(o))throw new Error("illegal type: "+o);n[o]=[]}return new Pt(n)}function Pt(e){this._=e}function da(e,t){return e.trim().split(/^|\s+/).map(function(n){var o="",r=n.indexOf(".");if(r>=0&&(o=n.slice(r+1),n=n.slice(0,r)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:o}})}Pt.prototype=Gt.prototype={constructor:Pt,on:function(e,t){var n=this._,o=da(e+"",n),r,i=-1,s=o.length;if(arguments.length<2){for(;++i<s;)if((r=(e=o[i]).type)&&(r=fa(n[r],e.name)))return r;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++i<s;)if(r=(e=o[i]).type)n[r]=uo(n[r],e.name,t);else if(t==null)for(r in n)n[r]=uo(n[r],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Pt(e)},call:function(e,t){if((r=arguments.length-2)>0)for(var n=new Array(r),o=0,r,i;o<r;++o)n[o]=arguments[o+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(i=this._[e],o=0,r=i.length;o<r;++o)i[o].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var o=this._[e],r=0,i=o.length;r<i;++r)o[r].value.apply(t,n)}};function fa(e,t){for(var n=0,o=e.length,r;n<o;++n)if((r=e[n]).name===t)return r.value}function uo(e,t,n){for(var o=0,r=e.length;o<r;++o)if(e[o].name===t){e[o]=ua,e=e.slice(0,o).concat(e.slice(o+1));break}return n!=null&&e.push({name:t,value:n}),e}var _n="http://www.w3.org/1999/xhtml";const fo={svg:"http://www.w3.org/2000/svg",xhtml:_n,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Kt(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),fo.hasOwnProperty(t)?{space:fo[t],local:e}:e}function ha(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===_n&&t.documentElement.namespaceURI===_n?t.createElement(e):t.createElementNS(n,e)}}function ga(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function pr(e){var t=Kt(e);return(t.local?ga:ha)(t)}function pa(){}function Rn(e){return e==null?pa:function(){return this.querySelector(e)}}function ma(e){typeof e!="function"&&(e=Rn(e));for(var t=this._groups,n=t.length,o=new Array(n),r=0;r<n;++r)for(var i=t[r],s=i.length,a=o[r]=new Array(s),l,c,u=0;u<s;++u)(l=i[u])&&(c=e.call(l,l.__data__,u,i))&&("__data__"in l&&(c.__data__=l.__data__),a[u]=c);return new le(o,this._parents)}function ya(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function xa(){return[]}function mr(e){return e==null?xa:function(){return this.querySelectorAll(e)}}function wa(e){return function(){return ya(e.apply(this,arguments))}}function va(e){typeof e=="function"?e=wa(e):e=mr(e);for(var t=this._groups,n=t.length,o=[],r=[],i=0;i<n;++i)for(var s=t[i],a=s.length,l,c=0;c<a;++c)(l=s[c])&&(o.push(e.call(l,l.__data__,c,s)),r.push(l));return new le(o,r)}function yr(e){return function(){return this.matches(e)}}function xr(e){return function(t){return t.matches(e)}}var ba=Array.prototype.find;function _a(e){return function(){return ba.call(this.children,e)}}function Ea(){return this.firstElementChild}function Sa(e){return this.select(e==null?Ea:_a(typeof e=="function"?e:xr(e)))}var Na=Array.prototype.filter;function Ca(){return Array.from(this.children)}function Ma(e){return function(){return Na.call(this.children,e)}}function Ia(e){return this.selectAll(e==null?Ca:Ma(typeof e=="function"?e:xr(e)))}function ka(e){typeof e!="function"&&(e=yr(e));for(var t=this._groups,n=t.length,o=new Array(n),r=0;r<n;++r)for(var i=t[r],s=i.length,a=o[r]=[],l,c=0;c<s;++c)(l=i[c])&&e.call(l,l.__data__,c,i)&&a.push(l);return new le(o,this._parents)}function wr(e){return new Array(e.length)}function Aa(){return new le(this._enter||this._groups.map(wr),this._parents)}function Rt(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Rt.prototype={constructor:Rt,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function $a(e){return function(){return e}}function Pa(e,t,n,o,r,i){for(var s=0,a,l=t.length,c=i.length;s<c;++s)(a=t[s])?(a.__data__=i[s],o[s]=a):n[s]=new Rt(e,i[s]);for(;s<l;++s)(a=t[s])&&(r[s]=a)}function Da(e,t,n,o,r,i,s){var a,l,c=new Map,u=t.length,d=i.length,f=new Array(u),p;for(a=0;a<u;++a)(l=t[a])&&(f[a]=p=s.call(l,l.__data__,a,t)+"",c.has(p)?r[a]=l:c.set(p,l));for(a=0;a<d;++a)p=s.call(e,i[a],a,i)+"",(l=c.get(p))?(o[a]=l,l.__data__=i[a],c.delete(p)):n[a]=new Rt(e,i[a]);for(a=0;a<u;++a)(l=t[a])&&c.get(f[a])===l&&(r[a]=l)}function Ta(e){return e.__data__}function za(e,t){if(!arguments.length)return Array.from(this,Ta);var n=t?Da:Pa,o=this._parents,r=this._groups;typeof e!="function"&&(e=$a(e));for(var i=r.length,s=new Array(i),a=new Array(i),l=new Array(i),c=0;c<i;++c){var u=o[c],d=r[c],f=d.length,p=Ha(e.call(u,u&&u.__data__,c,o)),g=p.length,w=a[c]=new Array(g),x=s[c]=new Array(g),m=l[c]=new Array(f);n(u,d,w,x,m,p,t);for(var _=0,h=0,y,S;_<g;++_)if(y=w[_]){for(_>=h&&(h=_+1);!(S=x[h])&&++h<g;);y._next=S||null}}return s=new le(s,o),s._enter=a,s._exit=l,s}function Ha(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Ra(){return new le(this._exit||this._groups.map(wr),this._parents)}function La(e,t,n){var o=this.enter(),r=this,i=this.exit();return typeof e=="function"?(o=e(o),o&&(o=o.selection())):o=o.append(e+""),t!=null&&(r=t(r),r&&(r=r.selection())),n==null?i.remove():n(i),o&&r?o.merge(r).order():r}function Oa(e){for(var t=e.selection?e.selection():e,n=this._groups,o=t._groups,r=n.length,i=o.length,s=Math.min(r,i),a=new Array(r),l=0;l<s;++l)for(var c=n[l],u=o[l],d=c.length,f=a[l]=new Array(d),p,g=0;g<d;++g)(p=c[g]||u[g])&&(f[g]=p);for(;l<r;++l)a[l]=n[l];return new le(a,this._parents)}function Va(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var o=e[t],r=o.length-1,i=o[r],s;--r>=0;)(s=o[r])&&(i&&s.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(s,i),i=s);return this}function Ba(e){e||(e=Fa);function t(d,f){return d&&f?e(d.__data__,f.__data__):!d-!f}for(var n=this._groups,o=n.length,r=new Array(o),i=0;i<o;++i){for(var s=n[i],a=s.length,l=r[i]=new Array(a),c,u=0;u<a;++u)(c=s[u])&&(l[u]=c);l.sort(t)}return new le(r,this._parents).order()}function Fa(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function ja(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function Xa(){return Array.from(this)}function Ya(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var o=e[t],r=0,i=o.length;r<i;++r){var s=o[r];if(s)return s}return null}function Za(){let e=0;for(const t of this)++e;return e}function Wa(){return!this.node()}function qa(e){for(var t=this._groups,n=0,o=t.length;n<o;++n)for(var r=t[n],i=0,s=r.length,a;i<s;++i)(a=r[i])&&e.call(a,a.__data__,i,r);return this}function Ga(e){return function(){this.removeAttribute(e)}}function Ka(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Ua(e,t){return function(){this.setAttribute(e,t)}}function Qa(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function Ja(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function ec(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function tc(e,t){var n=Kt(e);if(arguments.length<2){var o=this.node();return n.local?o.getAttributeNS(n.space,n.local):o.getAttribute(n)}return this.each((t==null?n.local?Ka:Ga:typeof t=="function"?n.local?ec:Ja:n.local?Qa:Ua)(n,t))}function vr(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function nc(e){return function(){this.style.removeProperty(e)}}function oc(e,t,n){return function(){this.style.setProperty(e,t,n)}}function rc(e,t,n){return function(){var o=t.apply(this,arguments);o==null?this.style.removeProperty(e):this.style.setProperty(e,o,n)}}function ic(e,t,n){return arguments.length>1?this.each((t==null?nc:typeof t=="function"?rc:oc)(e,t,n??"")):Xe(this.node(),e)}function Xe(e,t){return e.style.getPropertyValue(t)||vr(e).getComputedStyle(e,null).getPropertyValue(t)}function sc(e){return function(){delete this[e]}}function ac(e,t){return function(){this[e]=t}}function cc(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function lc(e,t){return arguments.length>1?this.each((t==null?sc:typeof t=="function"?cc:ac)(e,t)):this.node()[e]}function br(e){return e.trim().split(/^|\s+/)}function Ln(e){return e.classList||new _r(e)}function _r(e){this._node=e,this._names=br(e.getAttribute("class")||"")}_r.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function Er(e,t){for(var n=Ln(e),o=-1,r=t.length;++o<r;)n.add(t[o])}function Sr(e,t){for(var n=Ln(e),o=-1,r=t.length;++o<r;)n.remove(t[o])}function uc(e){return function(){Er(this,e)}}function dc(e){return function(){Sr(this,e)}}function fc(e,t){return function(){(t.apply(this,arguments)?Er:Sr)(this,e)}}function hc(e,t){var n=br(e+"");if(arguments.length<2){for(var o=Ln(this.node()),r=-1,i=n.length;++r<i;)if(!o.contains(n[r]))return!1;return!0}return this.each((typeof t=="function"?fc:t?uc:dc)(n,t))}function gc(){this.textContent=""}function pc(e){return function(){this.textContent=e}}function mc(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function yc(e){return arguments.length?this.each(e==null?gc:(typeof e=="function"?mc:pc)(e)):this.node().textContent}function xc(){this.innerHTML=""}function wc(e){return function(){this.innerHTML=e}}function vc(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function bc(e){return arguments.length?this.each(e==null?xc:(typeof e=="function"?vc:wc)(e)):this.node().innerHTML}function _c(){this.nextSibling&&this.parentNode.appendChild(this)}function Ec(){return this.each(_c)}function Sc(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Nc(){return this.each(Sc)}function Cc(e){var t=typeof e=="function"?e:pr(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function Mc(){return null}function Ic(e,t){var n=typeof e=="function"?e:pr(e),o=t==null?Mc:typeof t=="function"?t:Rn(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),o.apply(this,arguments)||null)})}function kc(){var e=this.parentNode;e&&e.removeChild(this)}function Ac(){return this.each(kc)}function $c(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Pc(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Dc(e){return this.select(e?Pc:$c)}function Tc(e){return arguments.length?this.property("__data__",e):this.node().__data__}function zc(e){return function(t){e.call(this,t,this.__data__)}}function Hc(e){return e.trim().split(/^|\s+/).map(function(t){var n="",o=t.indexOf(".");return o>=0&&(n=t.slice(o+1),t=t.slice(0,o)),{type:t,name:n}})}function Rc(e){return function(){var t=this.__on;if(t){for(var n=0,o=-1,r=t.length,i;n<r;++n)i=t[n],(!e.type||i.type===e.type)&&i.name===e.name?this.removeEventListener(i.type,i.listener,i.options):t[++o]=i;++o?t.length=o:delete this.__on}}}function Lc(e,t,n){return function(){var o=this.__on,r,i=zc(t);if(o){for(var s=0,a=o.length;s<a;++s)if((r=o[s]).type===e.type&&r.name===e.name){this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=i,r.options=n),r.value=t;return}}this.addEventListener(e.type,i,n),r={type:e.type,name:e.name,value:t,listener:i,options:n},o?o.push(r):this.__on=[r]}}function Oc(e,t,n){var o=Hc(e+""),r,i=o.length,s;if(arguments.length<2){var a=this.node().__on;if(a){for(var l=0,c=a.length,u;l<c;++l)for(r=0,u=a[l];r<i;++r)if((s=o[r]).type===u.type&&s.name===u.name)return u.value}return}for(a=t?Lc:Rc,r=0;r<i;++r)this.each(a(o[r],t,n));return this}function Nr(e,t,n){var o=vr(e),r=o.CustomEvent;typeof r=="function"?r=new r(t,n):(r=o.document.createEvent("Event"),n?(r.initEvent(t,n.bubbles,n.cancelable),r.detail=n.detail):r.initEvent(t,!1,!1)),e.dispatchEvent(r)}function Vc(e,t){return function(){return Nr(this,e,t)}}function Bc(e,t){return function(){return Nr(this,e,t.apply(this,arguments))}}function Fc(e,t){return this.each((typeof t=="function"?Bc:Vc)(e,t))}function*jc(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var o=e[t],r=0,i=o.length,s;r<i;++r)(s=o[r])&&(yield s)}var Cr=[null];function le(e,t){this._groups=e,this._parents=t}function mt(){return new le([[document.documentElement]],Cr)}function Xc(){return this}le.prototype=mt.prototype={constructor:le,select:ma,selectAll:va,selectChild:Sa,selectChildren:Ia,filter:ka,data:za,enter:Aa,exit:Ra,join:La,merge:Oa,selection:Xc,order:Va,sort:Ba,call:ja,nodes:Xa,node:Ya,size:Za,empty:Wa,each:qa,attr:tc,style:ic,property:lc,classed:hc,text:yc,html:bc,raise:Ec,lower:Nc,append:Cc,insert:Ic,remove:Ac,clone:Dc,datum:Tc,on:Oc,dispatch:Fc,[Symbol.iterator]:jc};function ce(e){return typeof e=="string"?new le([[document.querySelector(e)]],[document.documentElement]):new le([[e]],Cr)}function Yc(e){let t;for(;t=e.sourceEvent;)e=t;return e}function de(e,t){if(e=Yc(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var o=n.createSVGPoint();return o.x=e.clientX,o.y=e.clientY,o=o.matrixTransform(t.getScreenCTM().inverse()),[o.x,o.y]}if(t.getBoundingClientRect){var r=t.getBoundingClientRect();return[e.clientX-r.left-t.clientLeft,e.clientY-r.top-t.clientTop]}}return[e.pageX,e.pageY]}const Zc={passive:!1},at={capture:!0,passive:!1};function dn(e){e.stopImmediatePropagation()}function Fe(e){e.preventDefault(),e.stopImmediatePropagation()}function Mr(e){var t=e.document.documentElement,n=ce(e).on("dragstart.drag",Fe,at);"onselectstart"in t?n.on("selectstart.drag",Fe,at):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function Ir(e,t){var n=e.document.documentElement,o=ce(e).on("dragstart.drag",null);t&&(o.on("click.drag",Fe,at),setTimeout(function(){o.on("click.drag",null)},0)),"onselectstart"in n?o.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const Et=e=>()=>e;function En(e,{sourceEvent:t,subject:n,target:o,identifier:r,active:i,x:s,y:a,dx:l,dy:c,dispatch:u}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:o,enumerable:!0,configurable:!0},identifier:{value:r,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:s,enumerable:!0,configurable:!0},y:{value:a,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:c,enumerable:!0,configurable:!0},_:{value:u}})}En.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function Wc(e){return!e.ctrlKey&&!e.button}function qc(){return this.parentNode}function Gc(e,t){return t??{x:e.x,y:e.y}}function Kc(){return navigator.maxTouchPoints||"ontouchstart"in this}function kr(){var e=Wc,t=qc,n=Gc,o=Kc,r={},i=Gt("start","drag","end"),s=0,a,l,c,u,d=0;function f(y){y.on("mousedown.drag",p).filter(o).on("touchstart.drag",x).on("touchmove.drag",m,Zc).on("touchend.drag touchcancel.drag",_).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function p(y,S){if(!(u||!e.call(this,y,S))){var b=h(this,t.call(this,y,S),y,S,"mouse");b&&(ce(y.view).on("mousemove.drag",g,at).on("mouseup.drag",w,at),Mr(y.view),dn(y),c=!1,a=y.clientX,l=y.clientY,b("start",y))}}function g(y){if(Fe(y),!c){var S=y.clientX-a,b=y.clientY-l;c=S*S+b*b>d}r.mouse("drag",y)}function w(y){ce(y.view).on("mousemove.drag mouseup.drag",null),Ir(y.view,c),Fe(y),r.mouse("end",y)}function x(y,S){if(e.call(this,y,S)){var b=y.changedTouches,C=t.call(this,y,S),A=b.length,$,V;for($=0;$<A;++$)(V=h(this,C,y,S,b[$].identifier,b[$]))&&(dn(y),V("start",y,b[$]))}}function m(y){var S=y.changedTouches,b=S.length,C,A;for(C=0;C<b;++C)(A=r[S[C].identifier])&&(Fe(y),A("drag",y,S[C]))}function _(y){var S=y.changedTouches,b=S.length,C,A;for(u&&clearTimeout(u),u=setTimeout(function(){u=null},500),C=0;C<b;++C)(A=r[S[C].identifier])&&(dn(y),A("end",y,S[C]))}function h(y,S,b,C,A,$){var V=i.copy(),k=de($||b,S),z,O,v;if((v=n.call(y,new En("beforestart",{sourceEvent:b,target:f,identifier:A,active:s,x:k[0],y:k[1],dx:0,dy:0,dispatch:V}),C))!=null)return z=v.x-k[0]||0,O=v.y-k[1]||0,function N(E,I,M){var D=k,H;switch(E){case"start":r[A]=N,H=s++;break;case"end":delete r[A],--s;case"drag":k=de(M||I,S),H=s;break}V.call(E,y,new En(E,{sourceEvent:I,subject:v,target:f,identifier:A,active:H,x:k[0]+z,y:k[1]+O,dx:k[0]-D[0],dy:k[1]-D[1],dispatch:V}),C)}}return f.filter=function(y){return arguments.length?(e=typeof y=="function"?y:Et(!!y),f):e},f.container=function(y){return arguments.length?(t=typeof y=="function"?y:Et(y),f):t},f.subject=function(y){return arguments.length?(n=typeof y=="function"?y:Et(y),f):n},f.touchable=function(y){return arguments.length?(o=typeof y=="function"?y:Et(!!y),f):o},f.on=function(){var y=i.on.apply(i,arguments);return y===i?f:y},f.clickDistance=function(y){return arguments.length?(d=(y=+y)*y,f):Math.sqrt(d)},f}function On(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Ar(e,t){var n=Object.create(e.prototype);for(var o in t)n[o]=t[o];return n}function yt(){}var ct=.7,Lt=1/ct,je="\\s*([+-]?\\d+)\\s*",lt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",ye="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Uc=/^#([0-9a-f]{3,8})$/,Qc=new RegExp(`^rgb\\(${je},${je},${je}\\)$`),Jc=new RegExp(`^rgb\\(${ye},${ye},${ye}\\)$`),el=new RegExp(`^rgba\\(${je},${je},${je},${lt}\\)$`),tl=new RegExp(`^rgba\\(${ye},${ye},${ye},${lt}\\)$`),nl=new RegExp(`^hsl\\(${lt},${ye},${ye}\\)$`),ol=new RegExp(`^hsla\\(${lt},${ye},${ye},${lt}\\)$`),ho={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};On(yt,Te,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:go,formatHex:go,formatHex8:rl,formatHsl:il,formatRgb:po,toString:po});function go(){return this.rgb().formatHex()}function rl(){return this.rgb().formatHex8()}function il(){return $r(this).formatHsl()}function po(){return this.rgb().formatRgb()}function Te(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Uc.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?mo(t):n===3?new ae(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?St(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?St(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=Qc.exec(e))?new ae(t[1],t[2],t[3],1):(t=Jc.exec(e))?new ae(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=el.exec(e))?St(t[1],t[2],t[3],t[4]):(t=tl.exec(e))?St(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=nl.exec(e))?wo(t[1],t[2]/100,t[3]/100,1):(t=ol.exec(e))?wo(t[1],t[2]/100,t[3]/100,t[4]):ho.hasOwnProperty(e)?mo(ho[e]):e==="transparent"?new ae(NaN,NaN,NaN,0):null}function mo(e){return new ae(e>>16&255,e>>8&255,e&255,1)}function St(e,t,n,o){return o<=0&&(e=t=n=NaN),new ae(e,t,n,o)}function sl(e){return e instanceof yt||(e=Te(e)),e?(e=e.rgb(),new ae(e.r,e.g,e.b,e.opacity)):new ae}function Sn(e,t,n,o){return arguments.length===1?sl(e):new ae(e,t,n,o??1)}function ae(e,t,n,o){this.r=+e,this.g=+t,this.b=+n,this.opacity=+o}On(ae,Sn,Ar(yt,{brighter(e){return e=e==null?Lt:Math.pow(Lt,e),new ae(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?ct:Math.pow(ct,e),new ae(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new ae(Pe(this.r),Pe(this.g),Pe(this.b),Ot(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:yo,formatHex:yo,formatHex8:al,formatRgb:xo,toString:xo}));function yo(){return`#${$e(this.r)}${$e(this.g)}${$e(this.b)}`}function al(){return`#${$e(this.r)}${$e(this.g)}${$e(this.b)}${$e((isNaN(this.opacity)?1:this.opacity)*255)}`}function xo(){const e=Ot(this.opacity);return`${e===1?"rgb(":"rgba("}${Pe(this.r)}, ${Pe(this.g)}, ${Pe(this.b)}${e===1?")":`, ${e})`}`}function Ot(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Pe(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function $e(e){return e=Pe(e),(e<16?"0":"")+e.toString(16)}function wo(e,t,n,o){return o<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new fe(e,t,n,o)}function $r(e){if(e instanceof fe)return new fe(e.h,e.s,e.l,e.opacity);if(e instanceof yt||(e=Te(e)),!e)return new fe;if(e instanceof fe)return e;e=e.rgb();var t=e.r/255,n=e.g/255,o=e.b/255,r=Math.min(t,n,o),i=Math.max(t,n,o),s=NaN,a=i-r,l=(i+r)/2;return a?(t===i?s=(n-o)/a+(n<o)*6:n===i?s=(o-t)/a+2:s=(t-n)/a+4,a/=l<.5?i+r:2-i-r,s*=60):a=l>0&&l<1?0:s,new fe(s,a,l,e.opacity)}function cl(e,t,n,o){return arguments.length===1?$r(e):new fe(e,t,n,o??1)}function fe(e,t,n,o){this.h=+e,this.s=+t,this.l=+n,this.opacity=+o}On(fe,cl,Ar(yt,{brighter(e){return e=e==null?Lt:Math.pow(Lt,e),new fe(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?ct:Math.pow(ct,e),new fe(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,o=n+(n<.5?n:1-n)*t,r=2*n-o;return new ae(fn(e>=240?e-240:e+120,r,o),fn(e,r,o),fn(e<120?e+240:e-120,r,o),this.opacity)},clamp(){return new fe(vo(this.h),Nt(this.s),Nt(this.l),Ot(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Ot(this.opacity);return`${e===1?"hsl(":"hsla("}${vo(this.h)}, ${Nt(this.s)*100}%, ${Nt(this.l)*100}%${e===1?")":`, ${e})`}`}}));function vo(e){return e=(e||0)%360,e<0?e+360:e}function Nt(e){return Math.max(0,Math.min(1,e||0))}function fn(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const Vn=e=>()=>e;function ll(e,t){return function(n){return e+n*t}}function ul(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(o){return Math.pow(e+o*t,n)}}function dl(e){return(e=+e)==1?Pr:function(t,n){return n-t?ul(t,n,e):Vn(isNaN(t)?n:t)}}function Pr(e,t){var n=t-e;return n?ll(e,n):Vn(isNaN(e)?t:e)}const Vt=(function e(t){var n=dl(t);function o(r,i){var s=n((r=Sn(r)).r,(i=Sn(i)).r),a=n(r.g,i.g),l=n(r.b,i.b),c=Pr(r.opacity,i.opacity);return function(u){return r.r=s(u),r.g=a(u),r.b=l(u),r.opacity=c(u),r+""}}return o.gamma=e,o})(1);function fl(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,o=t.slice(),r;return function(i){for(r=0;r<n;++r)o[r]=e[r]*(1-i)+t[r]*i;return o}}function hl(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function gl(e,t){var n=t?t.length:0,o=e?Math.min(n,e.length):0,r=new Array(o),i=new Array(n),s;for(s=0;s<o;++s)r[s]=it(e[s],t[s]);for(;s<n;++s)i[s]=t[s];return function(a){for(s=0;s<o;++s)i[s]=r[s](a);return i}}function pl(e,t){var n=new Date;return e=+e,t=+t,function(o){return n.setTime(e*(1-o)+t*o),n}}function me(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function ml(e,t){var n={},o={},r;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(r in t)r in e?n[r]=it(e[r],t[r]):o[r]=t[r];return function(i){for(r in n)o[r]=n[r](i);return o}}var Nn=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,hn=new RegExp(Nn.source,"g");function yl(e){return function(){return e}}function xl(e){return function(t){return e(t)+""}}function Dr(e,t){var n=Nn.lastIndex=hn.lastIndex=0,o,r,i,s=-1,a=[],l=[];for(e=e+"",t=t+"";(o=Nn.exec(e))&&(r=hn.exec(t));)(i=r.index)>n&&(i=t.slice(n,i),a[s]?a[s]+=i:a[++s]=i),(o=o[0])===(r=r[0])?a[s]?a[s]+=r:a[++s]=r:(a[++s]=null,l.push({i:s,x:me(o,r)})),n=hn.lastIndex;return n<t.length&&(i=t.slice(n),a[s]?a[s]+=i:a[++s]=i),a.length<2?l[0]?xl(l[0].x):yl(t):(t=l.length,function(c){for(var u=0,d;u<t;++u)a[(d=l[u]).i]=d.x(c);return a.join("")})}function it(e,t){var n=typeof t,o;return t==null||n==="boolean"?Vn(t):(n==="number"?me:n==="string"?(o=Te(t))?(t=o,Vt):Dr:t instanceof Te?Vt:t instanceof Date?pl:hl(t)?fl:Array.isArray(t)?gl:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?ml:me)(e,t)}var bo=180/Math.PI,Cn={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Tr(e,t,n,o,r,i){var s,a,l;return(s=Math.sqrt(e*e+t*t))&&(e/=s,t/=s),(l=e*n+t*o)&&(n-=e*l,o-=t*l),(a=Math.sqrt(n*n+o*o))&&(n/=a,o/=a,l/=a),e*o<t*n&&(e=-e,t=-t,l=-l,s=-s),{translateX:r,translateY:i,rotate:Math.atan2(t,e)*bo,skewX:Math.atan(l)*bo,scaleX:s,scaleY:a}}var Ct;function wl(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Cn:Tr(t.a,t.b,t.c,t.d,t.e,t.f)}function vl(e){return e==null||(Ct||(Ct=document.createElementNS("http://www.w3.org/2000/svg","g")),Ct.setAttribute("transform",e),!(e=Ct.transform.baseVal.consolidate()))?Cn:(e=e.matrix,Tr(e.a,e.b,e.c,e.d,e.e,e.f))}function zr(e,t,n,o){function r(c){return c.length?c.pop()+" ":""}function i(c,u,d,f,p,g){if(c!==d||u!==f){var w=p.push("translate(",null,t,null,n);g.push({i:w-4,x:me(c,d)},{i:w-2,x:me(u,f)})}else(d||f)&&p.push("translate("+d+t+f+n)}function s(c,u,d,f){c!==u?(c-u>180?u+=360:u-c>180&&(c+=360),f.push({i:d.push(r(d)+"rotate(",null,o)-2,x:me(c,u)})):u&&d.push(r(d)+"rotate("+u+o)}function a(c,u,d,f){c!==u?f.push({i:d.push(r(d)+"skewX(",null,o)-2,x:me(c,u)}):u&&d.push(r(d)+"skewX("+u+o)}function l(c,u,d,f,p,g){if(c!==d||u!==f){var w=p.push(r(p)+"scale(",null,",",null,")");g.push({i:w-4,x:me(c,d)},{i:w-2,x:me(u,f)})}else(d!==1||f!==1)&&p.push(r(p)+"scale("+d+","+f+")")}return function(c,u){var d=[],f=[];return c=e(c),u=e(u),i(c.translateX,c.translateY,u.translateX,u.translateY,d,f),s(c.rotate,u.rotate,d,f),a(c.skewX,u.skewX,d,f),l(c.scaleX,c.scaleY,u.scaleX,u.scaleY,d,f),c=u=null,function(p){for(var g=-1,w=f.length,x;++g<w;)d[(x=f[g]).i]=x.x(p);return d.join("")}}}var bl=zr(wl,"px, ","px)","deg)"),_l=zr(vl,", ",")",")"),El=1e-12;function _o(e){return((e=Math.exp(e))+1/e)/2}function Sl(e){return((e=Math.exp(e))-1/e)/2}function Nl(e){return((e=Math.exp(2*e))-1)/(e+1)}const Dt=(function e(t,n,o){function r(i,s){var a=i[0],l=i[1],c=i[2],u=s[0],d=s[1],f=s[2],p=u-a,g=d-l,w=p*p+g*g,x,m;if(w<El)m=Math.log(f/c)/t,x=function(C){return[a+C*p,l+C*g,c*Math.exp(t*C*m)]};else{var _=Math.sqrt(w),h=(f*f-c*c+o*w)/(2*c*n*_),y=(f*f-c*c-o*w)/(2*f*n*_),S=Math.log(Math.sqrt(h*h+1)-h),b=Math.log(Math.sqrt(y*y+1)-y);m=(b-S)/t,x=function(C){var A=C*m,$=_o(S),V=c/(n*_)*($*Nl(t*A+S)-Sl(S));return[a+V*p,l+V*g,c*$/_o(t*A+S)]}}return x.duration=m*1e3*t/Math.SQRT2,x}return r.rho=function(i){var s=Math.max(.001,+i),a=s*s,l=a*a;return e(s,a,l)},r})(Math.SQRT2,2,4);var Ye=0,ot=0,tt=0,Hr=1e3,Bt,rt,Ft=0,ze=0,Ut=0,ut=typeof performance=="object"&&performance.now?performance:Date,Rr=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Bn(){return ze||(Rr(Cl),ze=ut.now()+Ut)}function Cl(){ze=0}function jt(){this._call=this._time=this._next=null}jt.prototype=Lr.prototype={constructor:jt,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?Bn():+n)+(t==null?0:+t),!this._next&&rt!==this&&(rt?rt._next=this:Bt=this,rt=this),this._call=e,this._time=n,Mn()},stop:function(){this._call&&(this._call=null,this._time=1/0,Mn())}};function Lr(e,t,n){var o=new jt;return o.restart(e,t,n),o}function Ml(){Bn(),++Ye;for(var e=Bt,t;e;)(t=ze-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Ye}function Eo(){ze=(Ft=ut.now())+Ut,Ye=ot=0;try{Ml()}finally{Ye=0,kl(),ze=0}}function Il(){var e=ut.now(),t=e-Ft;t>Hr&&(Ut-=t,Ft=e)}function kl(){for(var e,t=Bt,n,o=1/0;t;)t._call?(o>t._time&&(o=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:Bt=n);rt=e,Mn(o)}function Mn(e){if(!Ye){ot&&(ot=clearTimeout(ot));var t=e-ze;t>24?(e<1/0&&(ot=setTimeout(Eo,e-ut.now()-Ut)),tt&&(tt=clearInterval(tt))):(tt||(Ft=ut.now(),tt=setInterval(Il,Hr)),Ye=1,Rr(Eo))}}function So(e,t,n){var o=new jt;return t=t==null?0:+t,o.restart(r=>{o.stop(),e(r+t)},t,n),o}var Al=Gt("start","end","cancel","interrupt"),$l=[],Or=0,No=1,In=2,Tt=3,Co=4,kn=5,zt=6;function Qt(e,t,n,o,r,i){var s=e.__transition;if(!s)e.__transition={};else if(n in s)return;Pl(e,n,{name:t,index:o,group:r,on:Al,tween:$l,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:Or})}function Fn(e,t){var n=pe(e,t);if(n.state>Or)throw new Error("too late; already scheduled");return n}function xe(e,t){var n=pe(e,t);if(n.state>Tt)throw new Error("too late; already running");return n}function pe(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function Pl(e,t,n){var o=e.__transition,r;o[t]=n,n.timer=Lr(i,0,n.time);function i(c){n.state=No,n.timer.restart(s,n.delay,n.time),n.delay<=c&&s(c-n.delay)}function s(c){var u,d,f,p;if(n.state!==No)return l();for(u in o)if(p=o[u],p.name===n.name){if(p.state===Tt)return So(s);p.state===Co?(p.state=zt,p.timer.stop(),p.on.call("interrupt",e,e.__data__,p.index,p.group),delete o[u]):+u<t&&(p.state=zt,p.timer.stop(),p.on.call("cancel",e,e.__data__,p.index,p.group),delete o[u])}if(So(function(){n.state===Tt&&(n.state=Co,n.timer.restart(a,n.delay,n.time),a(c))}),n.state=In,n.on.call("start",e,e.__data__,n.index,n.group),n.state===In){for(n.state=Tt,r=new Array(f=n.tween.length),u=0,d=-1;u<f;++u)(p=n.tween[u].value.call(e,e.__data__,n.index,n.group))&&(r[++d]=p);r.length=d+1}}function a(c){for(var u=c<n.duration?n.ease.call(null,c/n.duration):(n.timer.restart(l),n.state=kn,1),d=-1,f=r.length;++d<f;)r[d].call(e,u);n.state===kn&&(n.on.call("end",e,e.__data__,n.index,n.group),l())}function l(){n.state=zt,n.timer.stop(),delete o[t];for(var c in o)return;delete e.__transition}}function Ht(e,t){var n=e.__transition,o,r,i=!0,s;if(n){t=t==null?null:t+"";for(s in n){if((o=n[s]).name!==t){i=!1;continue}r=o.state>In&&o.state<kn,o.state=zt,o.timer.stop(),o.on.call(r?"interrupt":"cancel",e,e.__data__,o.index,o.group),delete n[s]}i&&delete e.__transition}}function Dl(e){return this.each(function(){Ht(this,e)})}function Tl(e,t){var n,o;return function(){var r=xe(this,e),i=r.tween;if(i!==n){o=n=i;for(var s=0,a=o.length;s<a;++s)if(o[s].name===t){o=o.slice(),o.splice(s,1);break}}r.tween=o}}function zl(e,t,n){var o,r;if(typeof n!="function")throw new Error;return function(){var i=xe(this,e),s=i.tween;if(s!==o){r=(o=s).slice();for(var a={name:t,value:n},l=0,c=r.length;l<c;++l)if(r[l].name===t){r[l]=a;break}l===c&&r.push(a)}i.tween=r}}function Hl(e,t){var n=this._id;if(e+="",arguments.length<2){for(var o=pe(this.node(),n).tween,r=0,i=o.length,s;r<i;++r)if((s=o[r]).name===e)return s.value;return null}return this.each((t==null?Tl:zl)(n,e,t))}function jn(e,t,n){var o=e._id;return e.each(function(){var r=xe(this,o);(r.value||(r.value={}))[t]=n.apply(this,arguments)}),function(r){return pe(r,o).value[t]}}function Vr(e,t){var n;return(typeof t=="number"?me:t instanceof Te?Vt:(n=Te(t))?(t=n,Vt):Dr)(e,t)}function Rl(e){return function(){this.removeAttribute(e)}}function Ll(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Ol(e,t,n){var o,r=n+"",i;return function(){var s=this.getAttribute(e);return s===r?null:s===o?i:i=t(o=s,n)}}function Vl(e,t,n){var o,r=n+"",i;return function(){var s=this.getAttributeNS(e.space,e.local);return s===r?null:s===o?i:i=t(o=s,n)}}function Bl(e,t,n){var o,r,i;return function(){var s,a=n(this),l;return a==null?void this.removeAttribute(e):(s=this.getAttribute(e),l=a+"",s===l?null:s===o&&l===r?i:(r=l,i=t(o=s,a)))}}function Fl(e,t,n){var o,r,i;return function(){var s,a=n(this),l;return a==null?void this.removeAttributeNS(e.space,e.local):(s=this.getAttributeNS(e.space,e.local),l=a+"",s===l?null:s===o&&l===r?i:(r=l,i=t(o=s,a)))}}function jl(e,t){var n=Kt(e),o=n==="transform"?_l:Vr;return this.attrTween(e,typeof t=="function"?(n.local?Fl:Bl)(n,o,jn(this,"attr."+e,t)):t==null?(n.local?Ll:Rl)(n):(n.local?Vl:Ol)(n,o,t))}function Xl(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function Yl(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function Zl(e,t){var n,o;function r(){var i=t.apply(this,arguments);return i!==o&&(n=(o=i)&&Yl(e,i)),n}return r._value=t,r}function Wl(e,t){var n,o;function r(){var i=t.apply(this,arguments);return i!==o&&(n=(o=i)&&Xl(e,i)),n}return r._value=t,r}function ql(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var o=Kt(e);return this.tween(n,(o.local?Zl:Wl)(o,t))}function Gl(e,t){return function(){Fn(this,e).delay=+t.apply(this,arguments)}}function Kl(e,t){return t=+t,function(){Fn(this,e).delay=t}}function Ul(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Gl:Kl)(t,e)):pe(this.node(),t).delay}function Ql(e,t){return function(){xe(this,e).duration=+t.apply(this,arguments)}}function Jl(e,t){return t=+t,function(){xe(this,e).duration=t}}function eu(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Ql:Jl)(t,e)):pe(this.node(),t).duration}function tu(e,t){if(typeof t!="function")throw new Error;return function(){xe(this,e).ease=t}}function nu(e){var t=this._id;return arguments.length?this.each(tu(t,e)):pe(this.node(),t).ease}function ou(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;xe(this,e).ease=n}}function ru(e){if(typeof e!="function")throw new Error;return this.each(ou(this._id,e))}function iu(e){typeof e!="function"&&(e=yr(e));for(var t=this._groups,n=t.length,o=new Array(n),r=0;r<n;++r)for(var i=t[r],s=i.length,a=o[r]=[],l,c=0;c<s;++c)(l=i[c])&&e.call(l,l.__data__,c,i)&&a.push(l);return new _e(o,this._parents,this._name,this._id)}function su(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,o=t.length,r=n.length,i=Math.min(o,r),s=new Array(o),a=0;a<i;++a)for(var l=t[a],c=n[a],u=l.length,d=s[a]=new Array(u),f,p=0;p<u;++p)(f=l[p]||c[p])&&(d[p]=f);for(;a<o;++a)s[a]=t[a];return new _e(s,this._parents,this._name,this._id)}function au(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function cu(e,t,n){var o,r,i=au(t)?Fn:xe;return function(){var s=i(this,e),a=s.on;a!==o&&(r=(o=a).copy()).on(t,n),s.on=r}}function lu(e,t){var n=this._id;return arguments.length<2?pe(this.node(),n).on.on(e):this.each(cu(n,e,t))}function uu(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function du(){return this.on("end.remove",uu(this._id))}function fu(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Rn(e));for(var o=this._groups,r=o.length,i=new Array(r),s=0;s<r;++s)for(var a=o[s],l=a.length,c=i[s]=new Array(l),u,d,f=0;f<l;++f)(u=a[f])&&(d=e.call(u,u.__data__,f,a))&&("__data__"in u&&(d.__data__=u.__data__),c[f]=d,Qt(c[f],t,n,f,c,pe(u,n)));return new _e(i,this._parents,t,n)}function hu(e){var t=this._name,n=this._id;typeof e!="function"&&(e=mr(e));for(var o=this._groups,r=o.length,i=[],s=[],a=0;a<r;++a)for(var l=o[a],c=l.length,u,d=0;d<c;++d)if(u=l[d]){for(var f=e.call(u,u.__data__,d,l),p,g=pe(u,n),w=0,x=f.length;w<x;++w)(p=f[w])&&Qt(p,t,n,w,f,g);i.push(f),s.push(u)}return new _e(i,s,t,n)}var gu=mt.prototype.constructor;function pu(){return new gu(this._groups,this._parents)}function mu(e,t){var n,o,r;return function(){var i=Xe(this,e),s=(this.style.removeProperty(e),Xe(this,e));return i===s?null:i===n&&s===o?r:r=t(n=i,o=s)}}function Br(e){return function(){this.style.removeProperty(e)}}function yu(e,t,n){var o,r=n+"",i;return function(){var s=Xe(this,e);return s===r?null:s===o?i:i=t(o=s,n)}}function xu(e,t,n){var o,r,i;return function(){var s=Xe(this,e),a=n(this),l=a+"";return a==null&&(l=a=(this.style.removeProperty(e),Xe(this,e))),s===l?null:s===o&&l===r?i:(r=l,i=t(o=s,a))}}function wu(e,t){var n,o,r,i="style."+t,s="end."+i,a;return function(){var l=xe(this,e),c=l.on,u=l.value[i]==null?a||(a=Br(t)):void 0;(c!==n||r!==u)&&(o=(n=c).copy()).on(s,r=u),l.on=o}}function vu(e,t,n){var o=(e+="")=="transform"?bl:Vr;return t==null?this.styleTween(e,mu(e,o)).on("end.style."+e,Br(e)):typeof t=="function"?this.styleTween(e,xu(e,o,jn(this,"style."+e,t))).each(wu(this._id,e)):this.styleTween(e,yu(e,o,t),n).on("end.style."+e,null)}function bu(e,t,n){return function(o){this.style.setProperty(e,t.call(this,o),n)}}function _u(e,t,n){var o,r;function i(){var s=t.apply(this,arguments);return s!==r&&(o=(r=s)&&bu(e,s,n)),o}return i._value=t,i}function Eu(e,t,n){var o="style."+(e+="");if(arguments.length<2)return(o=this.tween(o))&&o._value;if(t==null)return this.tween(o,null);if(typeof t!="function")throw new Error;return this.tween(o,_u(e,t,n??""))}function Su(e){return function(){this.textContent=e}}function Nu(e){return function(){var t=e(this);this.textContent=t??""}}function Cu(e){return this.tween("text",typeof e=="function"?Nu(jn(this,"text",e)):Su(e==null?"":e+""))}function Mu(e){return function(t){this.textContent=e.call(this,t)}}function Iu(e){var t,n;function o(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&Mu(r)),t}return o._value=e,o}function ku(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,Iu(e))}function Au(){for(var e=this._name,t=this._id,n=Fr(),o=this._groups,r=o.length,i=0;i<r;++i)for(var s=o[i],a=s.length,l,c=0;c<a;++c)if(l=s[c]){var u=pe(l,t);Qt(l,e,n,c,s,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new _e(o,this._parents,e,n)}function $u(){var e,t,n=this,o=n._id,r=n.size();return new Promise(function(i,s){var a={value:s},l={value:function(){--r===0&&i()}};n.each(function(){var c=xe(this,o),u=c.on;u!==e&&(t=(e=u).copy(),t._.cancel.push(a),t._.interrupt.push(a),t._.end.push(l)),c.on=t}),r===0&&i()})}var Pu=0;function _e(e,t,n,o){this._groups=e,this._parents=t,this._name=n,this._id=o}function Fr(){return++Pu}var ve=mt.prototype;_e.prototype={constructor:_e,select:fu,selectAll:hu,selectChild:ve.selectChild,selectChildren:ve.selectChildren,filter:iu,merge:su,selection:pu,transition:Au,call:ve.call,nodes:ve.nodes,node:ve.node,size:ve.size,empty:ve.empty,each:ve.each,on:lu,attr:jl,attrTween:ql,style:vu,styleTween:Eu,text:Cu,textTween:ku,remove:du,tween:Hl,delay:Ul,duration:eu,ease:nu,easeVarying:ru,end:$u,[Symbol.iterator]:ve[Symbol.iterator]};function Du(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var Tu={time:null,delay:0,duration:250,ease:Du};function zu(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function Hu(e){var t,n;e instanceof _e?(t=e._id,e=e._name):(t=Fr(),(n=Tu).time=Bn(),e=e==null?null:e+"");for(var o=this._groups,r=o.length,i=0;i<r;++i)for(var s=o[i],a=s.length,l,c=0;c<a;++c)(l=s[c])&&Qt(l,e,t,c,s,n||zu(l,t));return new _e(o,this._parents,e,t)}mt.prototype.interrupt=Dl;mt.prototype.transition=Hu;const Mt=e=>()=>e;function Ru(e,{sourceEvent:t,target:n,transform:o,dispatch:r}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:o,enumerable:!0,configurable:!0},_:{value:r}})}function be(e,t,n){this.k=e,this.x=t,this.y=n}be.prototype={constructor:be,scale:function(e){return e===1?this:new be(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new be(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Jt=new be(1,0,0);jr.prototype=be.prototype;function jr(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Jt;return e.__zoom}function gn(e){e.stopImmediatePropagation()}function nt(e){e.preventDefault(),e.stopImmediatePropagation()}function Lu(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function Ou(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function Mo(){return this.__zoom||Jt}function Vu(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function Bu(){return navigator.maxTouchPoints||"ontouchstart"in this}function Fu(e,t,n){var o=e.invertX(t[0][0])-n[0][0],r=e.invertX(t[1][0])-n[1][0],i=e.invertY(t[0][1])-n[0][1],s=e.invertY(t[1][1])-n[1][1];return e.translate(r>o?(o+r)/2:Math.min(0,o)||Math.max(0,r),s>i?(i+s)/2:Math.min(0,i)||Math.max(0,s))}function Xr(){var e=Lu,t=Ou,n=Fu,o=Vu,r=Bu,i=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],a=250,l=Dt,c=Gt("start","zoom","end"),u,d,f,p=500,g=150,w=0,x=10;function m(v){v.property("__zoom",Mo).on("wheel.zoom",A,{passive:!1}).on("mousedown.zoom",$).on("dblclick.zoom",V).filter(r).on("touchstart.zoom",k).on("touchmove.zoom",z).on("touchend.zoom touchcancel.zoom",O).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}m.transform=function(v,N,E,I){var M=v.selection?v.selection():v;M.property("__zoom",Mo),v!==M?S(v,N,E,I):M.interrupt().each(function(){b(this,arguments).event(I).start().zoom(null,typeof N=="function"?N.apply(this,arguments):N).end()})},m.scaleBy=function(v,N,E,I){m.scaleTo(v,function(){var M=this.__zoom.k,D=typeof N=="function"?N.apply(this,arguments):N;return M*D},E,I)},m.scaleTo=function(v,N,E,I){m.transform(v,function(){var M=t.apply(this,arguments),D=this.__zoom,H=E==null?y(M):typeof E=="function"?E.apply(this,arguments):E,L=D.invert(H),R=typeof N=="function"?N.apply(this,arguments):N;return n(h(_(D,R),H,L),M,s)},E,I)},m.translateBy=function(v,N,E,I){m.transform(v,function(){return n(this.__zoom.translate(typeof N=="function"?N.apply(this,arguments):N,typeof E=="function"?E.apply(this,arguments):E),t.apply(this,arguments),s)},null,I)},m.translateTo=function(v,N,E,I,M){m.transform(v,function(){var D=t.apply(this,arguments),H=this.__zoom,L=I==null?y(D):typeof I=="function"?I.apply(this,arguments):I;return n(Jt.translate(L[0],L[1]).scale(H.k).translate(typeof N=="function"?-N.apply(this,arguments):-N,typeof E=="function"?-E.apply(this,arguments):-E),D,s)},I,M)};function _(v,N){return N=Math.max(i[0],Math.min(i[1],N)),N===v.k?v:new be(N,v.x,v.y)}function h(v,N,E){var I=N[0]-E[0]*v.k,M=N[1]-E[1]*v.k;return I===v.x&&M===v.y?v:new be(v.k,I,M)}function y(v){return[(+v[0][0]+ +v[1][0])/2,(+v[0][1]+ +v[1][1])/2]}function S(v,N,E,I){v.on("start.zoom",function(){b(this,arguments).event(I).start()}).on("interrupt.zoom end.zoom",function(){b(this,arguments).event(I).end()}).tween("zoom",function(){var M=this,D=arguments,H=b(M,D).event(I),L=t.apply(M,D),R=E==null?y(L):typeof E=="function"?E.apply(M,D):E,j=Math.max(L[1][0]-L[0][0],L[1][1]-L[0][1]),F=M.__zoom,W=typeof N=="function"?N.apply(M,D):N,K=l(F.invert(R).concat(j/F.k),W.invert(R).concat(j/W.k));return function(Z){if(Z===1)Z=W;else{var B=K(Z),X=j/B[2];Z=new be(X,R[0]-B[0]*X,R[1]-B[1]*X)}H.zoom(null,Z)}})}function b(v,N,E){return!E&&v.__zooming||new C(v,N)}function C(v,N){this.that=v,this.args=N,this.active=0,this.sourceEvent=null,this.extent=t.apply(v,N),this.taps=0}C.prototype={event:function(v){return v&&(this.sourceEvent=v),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(v,N){return this.mouse&&v!=="mouse"&&(this.mouse[1]=N.invert(this.mouse[0])),this.touch0&&v!=="touch"&&(this.touch0[1]=N.invert(this.touch0[0])),this.touch1&&v!=="touch"&&(this.touch1[1]=N.invert(this.touch1[0])),this.that.__zoom=N,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(v){var N=ce(this.that).datum();c.call(v,this.that,new Ru(v,{sourceEvent:this.sourceEvent,target:m,transform:this.that.__zoom,dispatch:c}),N)}};function A(v,...N){if(!e.apply(this,arguments))return;var E=b(this,N).event(v),I=this.__zoom,M=Math.max(i[0],Math.min(i[1],I.k*Math.pow(2,o.apply(this,arguments)))),D=de(v);if(E.wheel)(E.mouse[0][0]!==D[0]||E.mouse[0][1]!==D[1])&&(E.mouse[1]=I.invert(E.mouse[0]=D)),clearTimeout(E.wheel);else{if(I.k===M)return;E.mouse=[D,I.invert(D)],Ht(this),E.start()}nt(v),E.wheel=setTimeout(H,g),E.zoom("mouse",n(h(_(I,M),E.mouse[0],E.mouse[1]),E.extent,s));function H(){E.wheel=null,E.end()}}function $(v,...N){if(f||!e.apply(this,arguments))return;var E=v.currentTarget,I=b(this,N,!0).event(v),M=ce(v.view).on("mousemove.zoom",R,!0).on("mouseup.zoom",j,!0),D=de(v,E),H=v.clientX,L=v.clientY;Mr(v.view),gn(v),I.mouse=[D,this.__zoom.invert(D)],Ht(this),I.start();function R(F){if(nt(F),!I.moved){var W=F.clientX-H,K=F.clientY-L;I.moved=W*W+K*K>w}I.event(F).zoom("mouse",n(h(I.that.__zoom,I.mouse[0]=de(F,E),I.mouse[1]),I.extent,s))}function j(F){M.on("mousemove.zoom mouseup.zoom",null),Ir(F.view,I.moved),nt(F),I.event(F).end()}}function V(v,...N){if(e.apply(this,arguments)){var E=this.__zoom,I=de(v.changedTouches?v.changedTouches[0]:v,this),M=E.invert(I),D=E.k*(v.shiftKey?.5:2),H=n(h(_(E,D),I,M),t.apply(this,N),s);nt(v),a>0?ce(this).transition().duration(a).call(S,H,I,v):ce(this).call(m.transform,H,I,v)}}function k(v,...N){if(e.apply(this,arguments)){var E=v.touches,I=E.length,M=b(this,N,v.changedTouches.length===I).event(v),D,H,L,R;for(gn(v),H=0;H<I;++H)L=E[H],R=de(L,this),R=[R,this.__zoom.invert(R),L.identifier],M.touch0?!M.touch1&&M.touch0[2]!==R[2]&&(M.touch1=R,M.taps=0):(M.touch0=R,D=!0,M.taps=1+!!u);u&&(u=clearTimeout(u)),D&&(M.taps<2&&(d=R[0],u=setTimeout(function(){u=null},p)),Ht(this),M.start())}}function z(v,...N){if(this.__zooming){var E=b(this,N).event(v),I=v.changedTouches,M=I.length,D,H,L,R;for(nt(v),D=0;D<M;++D)H=I[D],L=de(H,this),E.touch0&&E.touch0[2]===H.identifier?E.touch0[0]=L:E.touch1&&E.touch1[2]===H.identifier&&(E.touch1[0]=L);if(H=E.that.__zoom,E.touch1){var j=E.touch0[0],F=E.touch0[1],W=E.touch1[0],K=E.touch1[1],Z=(Z=W[0]-j[0])*Z+(Z=W[1]-j[1])*Z,B=(B=K[0]-F[0])*B+(B=K[1]-F[1])*B;H=_(H,Math.sqrt(Z/B)),L=[(j[0]+W[0])/2,(j[1]+W[1])/2],R=[(F[0]+K[0])/2,(F[1]+K[1])/2]}else if(E.touch0)L=E.touch0[0],R=E.touch0[1];else return;E.zoom("touch",n(h(H,L,R),E.extent,s))}}function O(v,...N){if(this.__zooming){var E=b(this,N).event(v),I=v.changedTouches,M=I.length,D,H;for(gn(v),f&&clearTimeout(f),f=setTimeout(function(){f=null},p),D=0;D<M;++D)H=I[D],E.touch0&&E.touch0[2]===H.identifier?delete E.touch0:E.touch1&&E.touch1[2]===H.identifier&&delete E.touch1;if(E.touch1&&!E.touch0&&(E.touch0=E.touch1,delete E.touch1),E.touch0)E.touch0[1]=this.__zoom.invert(E.touch0[0]);else if(E.end(),E.taps===2&&(H=de(H,this),Math.hypot(d[0]-H[0],d[1]-H[1])<x)){var L=ce(this).on("dblclick.zoom");L&&L.apply(this,arguments)}}}return m.wheelDelta=function(v){return arguments.length?(o=typeof v=="function"?v:Mt(+v),m):o},m.filter=function(v){return arguments.length?(e=typeof v=="function"?v:Mt(!!v),m):e},m.touchable=function(v){return arguments.length?(r=typeof v=="function"?v:Mt(!!v),m):r},m.extent=function(v){return arguments.length?(t=typeof v=="function"?v:Mt([[+v[0][0],+v[0][1]],[+v[1][0],+v[1][1]]]),m):t},m.scaleExtent=function(v){return arguments.length?(i[0]=+v[0],i[1]=+v[1],m):[i[0],i[1]]},m.translateExtent=function(v){return arguments.length?(s[0][0]=+v[0][0],s[1][0]=+v[1][0],s[0][1]=+v[0][1],s[1][1]=+v[1][1],m):[[s[0][0],s[0][1]],[s[1][0],s[1][1]]]},m.constrain=function(v){return arguments.length?(n=v,m):n},m.duration=function(v){return arguments.length?(a=+v,m):a},m.interpolate=function(v){return arguments.length?(l=v,m):l},m.on=function(){var v=c.on.apply(c,arguments);return v===c?m:v},m.clickDistance=function(v){return arguments.length?(w=(v=+v)*v,m):Math.sqrt(w)},m.tapDistance=function(v){return arguments.length?(x=+v,m):x},m}const ue={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"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.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:o})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:o}", edge id: ${t}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012: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.`,error013:(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.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs."},dt=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Yr=["Enter"," ","Escape"],Zr={"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":({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"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"};var Ze;(function(e){e.Strict="strict",e.Loose="loose"})(Ze||(Ze={}));var De;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(De||(De={}));var ft;(function(e){e.Partial="partial",e.Full="full"})(ft||(ft={}));const Wr={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var Me;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Me||(Me={}));var Xt;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Xt||(Xt={}));var Y;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Y||(Y={}));const Io={[Y.Left]:Y.Right,[Y.Right]:Y.Left,[Y.Top]:Y.Bottom,[Y.Bottom]:Y.Top};function qr(e){return e===null?null:e?"valid":"invalid"}const Gr=e=>"id"in e&&"source"in e&&"target"in e,ju=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),Xn=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),xt=(e,t=[0,0])=>{const{width:n,height:o}=Ee(e),r=e.origin??t,i=n*r[0],s=o*r[1];return{x:e.position.x-i,y:e.position.y-s}},Xu=(e,t={nodeOrigin:[0,0]})=>{if(t.nodeLookup||console.warn("Please use `getNodesBounds` from `useReactFlow`/`useSvelteFlow` hook to ensure correct values for sub flows. If not possible, you have to provide a nodeLookup to support sub flows."),e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((o,r)=>{const i=typeof r=="string";let s=!t.nodeLookup&&!i?r:void 0;t.nodeLookup&&(s=i?t.nodeLookup.get(r):Xn(r)?r:t.nodeLookup.get(r.id));const a=s?Yt(s,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return en(o,a)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return tn(n)},wt=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},o=!1;return e.forEach(r=>{(t.filter===void 0||t.filter(r))&&(n=en(n,Yt(r)),o=!0)}),o?tn(n):{x:0,y:0,width:0,height:0}},Yn=(e,t,[n,o,r]=[0,0,1],i=!1,s=!1)=>{const a={...bt(t,[n,o,r]),width:t.width/r,height:t.height/r},l=[];for(const c of e.values()){const{measured:u,selectable:d=!0,hidden:f=!1}=c;if(s&&!d||f)continue;const p=u.width??c.width??c.initialWidth??null,g=u.height??c.height??c.initialHeight??null,w=ht(a,qe(c)),x=(p??0)*(g??0),m=i&&w>0;(!c.internals.handleBounds||m||w>=x||c.dragging)&&l.push(c)}return l},Yu=(e,t)=>{const n=new Set;return e.forEach(o=>{n.add(o.id)}),t.filter(o=>n.has(o.source)||n.has(o.target))};function Zu(e,t){const n=new Map,o=t?.nodes?new Set(t.nodes.map(r=>r.id)):null;return e.forEach(r=>{r.measured.width&&r.measured.height&&(t?.includeHiddenNodes||!r.hidden)&&(!o||o.has(r.id))&&n.set(r.id,r)}),n}async function Wu({nodes:e,width:t,height:n,panZoom:o,minZoom:r,maxZoom:i},s){if(e.size===0)return Promise.resolve(!0);const a=Zu(e,s),l=wt(a),c=Zn(l,t,n,s?.minZoom??r,s?.maxZoom??i,s?.padding??.1);return await o.setViewport(c,{duration:s?.duration,ease:s?.ease,interpolate:s?.interpolate}),Promise.resolve(!0)}function Kr({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:o=[0,0],nodeExtent:r,onError:i}){const s=n.get(e),a=s.parentId?n.get(s.parentId):void 0,{x:l,y:c}=a?a.internals.positionAbsolute:{x:0,y:0},u=s.origin??o;let d=s.extent||r;if(s.extent==="parent"&&!s.expandParent)if(!a)i?.("005",ue.error005());else{const p=a.measured.width,g=a.measured.height;p&&g&&(d=[[l,c],[l+p,c+g]])}else a&&Ge(s.extent)&&(d=[[s.extent[0][0]+l,s.extent[0][1]+c],[s.extent[1][0]+l,s.extent[1][1]+c]]);const f=Ge(d)?He(t,d,s.measured):t;return(s.measured.width===void 0||s.measured.height===void 0)&&i?.("015",ue.error015()),{position:{x:f.x-l+(s.measured.width??0)*u[0],y:f.y-c+(s.measured.height??0)*u[1]},positionAbsolute:f}}async function qu({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:o,onBeforeDelete:r}){const i=new Set(e.map(f=>f.id)),s=[];for(const f of n){if(f.deletable===!1)continue;const p=i.has(f.id),g=!p&&f.parentId&&s.find(w=>w.id===f.parentId);(p||g)&&s.push(f)}const a=new Set(t.map(f=>f.id)),l=o.filter(f=>f.deletable!==!1),u=Yu(s,l);for(const f of l)a.has(f.id)&&!u.find(g=>g.id===f.id)&&u.push(f);if(!r)return{edges:u,nodes:s};const d=await r({nodes:s,edges:u});return typeof d=="boolean"?d?{edges:u,nodes:s}:{edges:[],nodes:[]}:d}const We=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),He=(e={x:0,y:0},t,n)=>({x:We(e.x,t[0][0],t[1][0]-(n?.width??0)),y:We(e.y,t[0][1],t[1][1]-(n?.height??0))});function Ur(e,t,n){const{width:o,height:r}=Ee(n),{x:i,y:s}=n.internals.positionAbsolute;return He(e,[[i,s],[i+o,s+r]],t)}const ko=(e,t,n)=>e<t?We(Math.abs(e-t),1,t)/t:e>n?-We(Math.abs(e-n),1,t)/t:0,Qr=(e,t,n=15,o=40)=>{const r=ko(e.x,o,t.width-o)*n,i=ko(e.y,o,t.height-o)*n;return[r,i]},en=(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)}),An=({x:e,y:t,width:n,height:o})=>({x:e,y:t,x2:e+n,y2:t+o}),tn=({x:e,y:t,x2:n,y2:o})=>({x:e,y:t,width:n-e,height:o-t}),qe=(e,t=[0,0])=>{const{x:n,y:o}=Xn(e)?e.internals.positionAbsolute:xt(e,t);return{x:n,y:o,width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}},Yt=(e,t=[0,0])=>{const{x:n,y:o}=Xn(e)?e.internals.positionAbsolute:xt(e,t);return{x:n,y:o,x2:n+(e.measured?.width??e.width??e.initialWidth??0),y2:o+(e.measured?.height??e.height??e.initialHeight??0)}},Jr=(e,t)=>tn(en(An(e),An(t))),ht=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),o=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*o)},Ao=e=>he(e.width)&&he(e.height)&&he(e.x)&&he(e.y),he=e=>!isNaN(e)&&isFinite(e),ei=(e,t)=>{console.warn(`[React Flow]: ${t} Help: https://reactflow.dev/error#${e}`)},vt=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),bt=({x:e,y:t},[n,o,r],i=!1,s=[1,1])=>{const a={x:(e-n)/r,y:(t-o)/r};return i?vt(a,s):a},Zt=({x:e,y:t},[n,o,r])=>({x:e*r+n,y:t*r+o});function Oe(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(n)}if(typeof e=="string"&&e.endsWith("%")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`[React Flow] The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function Gu(e,t,n){if(typeof e=="string"||typeof e=="number"){const o=Oe(e,n),r=Oe(e,t);return{top:o,right:r,bottom:o,left:r,x:r*2,y:o*2}}if(typeof e=="object"){const o=Oe(e.top??e.y??0,n),r=Oe(e.bottom??e.y??0,n),i=Oe(e.left??e.x??0,t),s=Oe(e.right??e.x??0,t);return{top:o,right:s,bottom:r,left:i,x:i+s,y:o+r}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function Ku(e,t,n,o,r,i){const{x:s,y:a}=Zt(e,[t,n,o]),{x:l,y:c}=Zt({x:e.x+e.width,y:e.y+e.height},[t,n,o]),u=r-l,d=i-c;return{left:Math.floor(s),top:Math.floor(a),right:Math.floor(u),bottom:Math.floor(d)}}const Zn=(e,t,n,o,r,i)=>{const s=Gu(i,t,n),a=(t-s.x)/e.width,l=(n-s.y)/e.height,c=Math.min(a,l),u=We(c,o,r),d=e.x+e.width/2,f=e.y+e.height/2,p=t/2-d*u,g=n/2-f*u,w=Ku(e,p,g,u,t,n),x={left:Math.min(w.left-s.left,0),top:Math.min(w.top-s.top,0),right:Math.min(w.right-s.right,0),bottom:Math.min(w.bottom-s.bottom,0)};return{x:p-x.left+x.right,y:g-x.top+x.bottom,zoom:u}},gt=()=>typeof navigator<"u"&&navigator?.userAgent?.indexOf("Mac")>=0;function Ge(e){return e!=null&&e!=="parent"}function Ee(e){return{width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}}function ti(e){return(e.measured?.width??e.width??e.initialWidth)!==void 0&&(e.measured?.height??e.height??e.initialHeight)!==void 0}function ni(e,t={width:0,height:0},n,o,r){const i={...e},s=o.get(n);if(s){const a=s.origin||r;i.x+=s.internals.positionAbsolute.x-(t.width??0)*a[0],i.y+=s.internals.positionAbsolute.y-(t.height??0)*a[1]}return i}function $o(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function Uu(){let e,t;return{promise:new Promise((o,r)=>{e=o,t=r}),resolve:e,reject:t}}function Qu(e){return{...Zr,...e||{}}}function st(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:o,containerBounds:r}){const{x:i,y:s}=ge(e),a=bt({x:i-(r?.left??0),y:s-(r?.top??0)},o),{x:l,y:c}=n?vt(a,t):a;return{xSnapped:l,ySnapped:c,...a}}const Wn=e=>({width:e.offsetWidth,height:e.offsetHeight}),oi=e=>e?.getRootNode?.()||window?.document,Ju=["INPUT","SELECT","TEXTAREA"];function ri(e){const t=e.composedPath?.()?.[0]||e.target;return t?.nodeType!==1?!1:Ju.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const ii=e=>"clientX"in e,ge=(e,t)=>{const n=ii(e),o=n?e.clientX:e.touches?.[0].clientX,r=n?e.clientY:e.touches?.[0].clientY;return{x:o-(t?.left??0),y:r-(t?.top??0)}},Po=(e,t,n,o,r)=>{const i=t.querySelectorAll(`.${e}`);return!i||!i.length?null:Array.from(i).map(s=>{const a=s.getBoundingClientRect();return{id:s.getAttribute("data-handleid"),type:e,nodeId:r,position:s.getAttribute("data-handlepos"),x:(a.left-n.left)/o,y:(a.top-n.top)/o,...Wn(s)}})};function si({sourceX:e,sourceY:t,targetX:n,targetY:o,sourceControlX:r,sourceControlY:i,targetControlX:s,targetControlY:a}){const l=e*.125+r*.375+s*.375+n*.125,c=t*.125+i*.375+a*.375+o*.125,u=Math.abs(l-e),d=Math.abs(c-t);return[l,c,u,d]}function It(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function Do({pos:e,x1:t,y1:n,x2:o,y2:r,c:i}){switch(e){case Y.Left:return[t-It(t-o,i),n];case Y.Right:return[t+It(o-t,i),n];case Y.Top:return[t,n-It(n-r,i)];case Y.Bottom:return[t,n+It(r-n,i)]}}function ai({sourceX:e,sourceY:t,sourcePosition:n=Y.Bottom,targetX:o,targetY:r,targetPosition:i=Y.Top,curvature:s=.25}){const[a,l]=Do({pos:n,x1:e,y1:t,x2:o,y2:r,c:s}),[c,u]=Do({pos:i,x1:o,y1:r,x2:e,y2:t,c:s}),[d,f,p,g]=si({sourceX:e,sourceY:t,targetX:o,targetY:r,sourceControlX:a,sourceControlY:l,targetControlX:c,targetControlY:u});return[`M${e},${t} C${a},${l} ${c},${u} ${o},${r}`,d,f,p,g]}function ci({sourceX:e,sourceY:t,targetX:n,targetY:o}){const r=Math.abs(n-e)/2,i=n<e?n+r:n-r,s=Math.abs(o-t)/2,a=o<t?o+s:o-s;return[i,a,r,s]}function ed({sourceNode:e,targetNode:t,selected:n=!1,zIndex:o=0,elevateOnSelect:r=!1,zIndexMode:i="basic"}){if(i==="manual")return o;const s=r&&n?o+1e3:o,a=Math.max(e.parentId||r&&e.selected?e.internals.z:0,t.parentId||r&&t.selected?t.internals.z:0);return s+a}function td({sourceNode:e,targetNode:t,width:n,height:o,transform:r}){const i=en(Yt(e),Yt(t));i.x===i.x2&&(i.x2+=1),i.y===i.y2&&(i.y2+=1);const s={x:-r[0]/r[2],y:-r[1]/r[2],width:n/r[2],height:o/r[2]};return ht(s,tn(i))>0}const nd=({source:e,sourceHandle:t,target:n,targetHandle:o})=>`xy-edge__${e}${t||""}-${n}${o||""}`,od=(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)),rd=(e,t,n={})=>{if(!e.source||!e.target)return ei("006",ue.error006()),t;const o=n.getEdgeId||nd;let r;return Gr(e)?r={...e}:r={...e,id:o(e)},od(r,t)?t:(r.sourceHandle===null&&delete r.sourceHandle,r.targetHandle===null&&delete r.targetHandle,t.concat(r))};function li({sourceX:e,sourceY:t,targetX:n,targetY:o}){const[r,i,s,a]=ci({sourceX:e,sourceY:t,targetX:n,targetY:o});return[`M ${e},${t}L ${n},${o}`,r,i,s,a]}const To={[Y.Left]:{x:-1,y:0},[Y.Right]:{x:1,y:0},[Y.Top]:{x:0,y:-1},[Y.Bottom]:{x:0,y:1}},id=({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},zo=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function sd({source:e,sourcePosition:t=Y.Bottom,target:n,targetPosition:o=Y.Top,center:r,offset:i,stepPosition:s}){const a=To[t],l=To[o],c={x:e.x+a.x*i,y:e.y+a.y*i},u={x:n.x+l.x*i,y:n.y+l.y*i},d=id({source:c,sourcePosition:t,target:u}),f=d.x!==0?"x":"y",p=d[f];let g=[],w,x;const m={x:0,y:0},_={x:0,y:0},[,,h,y]=ci({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(a[f]*l[f]===-1){f==="x"?(w=r.x??c.x+(u.x-c.x)*s,x=r.y??(c.y+u.y)/2):(w=r.x??(c.x+u.x)/2,x=r.y??c.y+(u.y-c.y)*s);const A=[{x:w,y:c.y},{x:w,y:u.y}],$=[{x:c.x,y:x},{x:u.x,y:x}];a[f]===p?g=f==="x"?A:$:g=f==="x"?$:A}else{const A=[{x:c.x,y:u.y}],$=[{x:u.x,y:c.y}];if(f==="x"?g=a.x===p?$:A:g=a.y===p?A:$,t===o){const v=Math.abs(e[f]-n[f]);if(v<=i){const N=Math.min(i-1,i-v);a[f]===p?m[f]=(c[f]>e[f]?-1:1)*N:_[f]=(u[f]>n[f]?-1:1)*N}}if(t!==o){const v=f==="x"?"y":"x",N=a[f]===l[v],E=c[v]>u[v],I=c[v]<u[v];(a[f]===1&&(!N&&E||N&&I)||a[f]!==1&&(!N&&I||N&&E))&&(g=f==="x"?A:$)}const V={x:c.x+m.x,y:c.y+m.y},k={x:u.x+_.x,y:u.y+_.y},z=Math.max(Math.abs(V.x-g[0].x),Math.abs(k.x-g[0].x)),O=Math.max(Math.abs(V.y-g[0].y),Math.abs(k.y-g[0].y));z>=O?(w=(V.x+k.x)/2,x=g[0].y):(w=g[0].x,x=(V.y+k.y)/2)}const S={x:c.x+m.x,y:c.y+m.y},b={x:u.x+_.x,y:u.y+_.y};return[[e,...S.x!==g[0].x||S.y!==g[0].y?[S]:[],...g,...b.x!==g[g.length-1].x||b.y!==g[g.length-1].y?[b]:[],n],w,x,h,y]}function ad(e,t,n,o){const r=Math.min(zo(e,t)/2,zo(t,n)/2,o),{x:i,y:s}=t;if(e.x===i&&i===n.x||e.y===s&&s===n.y)return`L${i} ${s}`;if(e.y===s){const c=e.x<n.x?-1:1,u=e.y<n.y?1:-1;return`L ${i+r*c},${s}Q ${i},${s} ${i},${s+r*u}`}const a=e.x<n.x?1:-1,l=e.y<n.y?-1:1;return`L ${i},${s+r*l}Q ${i},${s} ${i+r*a},${s}`}function $n({sourceX:e,sourceY:t,sourcePosition:n=Y.Bottom,targetX:o,targetY:r,targetPosition:i=Y.Top,borderRadius:s=5,centerX:a,centerY:l,offset:c=20,stepPosition:u=.5}){const[d,f,p,g,w]=sd({source:{x:e,y:t},sourcePosition:n,target:{x:o,y:r},targetPosition:i,center:{x:a,y:l},offset:c,stepPosition:u});let x=`M${d[0].x} ${d[0].y}`;for(let m=1;m<d.length-1;m++)x+=ad(d[m-1],d[m],d[m+1],s);return x+=`L${d[d.length-1].x} ${d[d.length-1].y}`,[x,f,p,g,w]}function Ho(e){return e&&!!(e.internals.handleBounds||e.handles?.length)&&!!(e.measured.width||e.width||e.initialWidth)}function cd(e){const{sourceNode:t,targetNode:n}=e;if(!Ho(t)||!Ho(n))return null;const o=t.internals.handleBounds||Ro(t.handles),r=n.internals.handleBounds||Ro(n.handles),i=Lo(o?.source??[],e.sourceHandle),s=Lo(e.connectionMode===Ze.Strict?r?.target??[]:(r?.target??[]).concat(r?.source??[]),e.targetHandle);if(!i||!s)return e.onError?.("008",ue.error008(i?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const a=i?.position||Y.Bottom,l=s?.position||Y.Top,c=Re(t,i,a),u=Re(n,s,l);return{sourceX:c.x,sourceY:c.y,targetX:u.x,targetY:u.y,sourcePosition:a,targetPosition:l}}function Ro(e){if(!e)return null;const t=[],n=[];for(const o of e)o.width=o.width??1,o.height=o.height??1,o.type==="source"?t.push(o):o.type==="target"&&n.push(o);return{source:t,target:n}}function Re(e,t,n=Y.Left,o=!1){const r=(t?.x??0)+e.internals.positionAbsolute.x,i=(t?.y??0)+e.internals.positionAbsolute.y,{width:s,height:a}=t??Ee(e);if(o)return{x:r+s/2,y:i+a/2};switch(t?.position??n){case Y.Top:return{x:r+s/2,y:i};case Y.Right:return{x:r+s,y:i+a/2};case Y.Bottom:return{x:r+s/2,y:i+a};case Y.Left:return{x:r,y:i+a/2}}}function Lo(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function Pn(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(o=>`${o}=${e[o]}`).join("&")}`:""}function ld(e,{id:t,defaultColor:n,defaultMarkerStart:o,defaultMarkerEnd:r}){const i=new Set;return e.reduce((s,a)=>([a.markerStart||o,a.markerEnd||r].forEach(l=>{if(l&&typeof l=="object"){const c=Pn(l,t);i.has(c)||(s.push({id:c,color:l.color||n,...l}),i.add(c))}}),s),[]).sort((s,a)=>s.id.localeCompare(a.id))}const ui=1e3,ud=10,qn={nodeOrigin:[0,0],nodeExtent:dt,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},dd={...qn,checkEquality:!0};function Gn(e,t){const n={...e};for(const o in t)t[o]!==void 0&&(n[o]=t[o]);return n}function fd(e,t,n){const o=Gn(qn,n);for(const r of e.values())if(r.parentId)Un(r,e,t,o);else{const i=xt(r,o.nodeOrigin),s=Ge(r.extent)?r.extent:o.nodeExtent,a=He(i,s,Ee(r));r.internals.positionAbsolute=a}}function hd(e,t){if(!e.handles)return e.measured?t?.internals.handleBounds:void 0;const n=[],o=[];for(const r of e.handles){const i={id:r.id,width:r.width??1,height:r.height??1,nodeId:e.id,x:r.x,y:r.y,position:r.position,type:r.type};r.type==="source"?n.push(i):r.type==="target"&&o.push(i)}return{source:n,target:o}}function Kn(e){return e==="manual"}function Dn(e,t,n,o={}){const r=Gn(dd,o),i={i:0},s=new Map(t),a=r?.elevateNodesOnSelect&&!Kn(r.zIndexMode)?ui:0;let l=e.length>0,c=!1;t.clear(),n.clear();for(const u of e){let d=s.get(u.id);if(r.checkEquality&&u===d?.internals.userNode)t.set(u.id,d);else{const f=xt(u,r.nodeOrigin),p=Ge(u.extent)?u.extent:r.nodeExtent,g=He(f,p,Ee(u));d={...r.defaults,...u,measured:{width:u.measured?.width,height:u.measured?.height},internals:{positionAbsolute:g,handleBounds:hd(u,d),z:di(u,a,r.zIndexMode),userNode:u}},t.set(u.id,d)}(d.measured===void 0||d.measured.width===void 0||d.measured.height===void 0)&&!d.hidden&&(l=!1),u.parentId&&Un(d,t,n,o,i),c||=u.selected??!1}return{nodesInitialized:l,hasSelectedNodes:c}}function gd(e,t){if(!e.parentId)return;const n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function Un(e,t,n,o,r){const{elevateNodesOnSelect:i,nodeOrigin:s,nodeExtent:a,zIndexMode:l}=Gn(qn,o),c=e.parentId,u=t.get(c);if(!u){console.warn(`Parent node ${c} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}gd(e,n),r&&!u.parentId&&u.internals.rootParentIndex===void 0&&l==="auto"&&(u.internals.rootParentIndex=++r.i,u.internals.z=u.internals.z+r.i*ud),r&&u.internals.rootParentIndex!==void 0&&(r.i=u.internals.rootParentIndex);const d=i&&!Kn(l)?ui:0,{x:f,y:p,z:g}=pd(e,u,s,a,d,l),{positionAbsolute:w}=e.internals,x=f!==w.x||p!==w.y;(x||g!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:x?{x:f,y:p}:w,z:g}})}function di(e,t,n){const o=he(e.zIndex)?e.zIndex:0;return Kn(n)?o:o+(e.selected?t:0)}function pd(e,t,n,o,r,i){const{x:s,y:a}=t.internals.positionAbsolute,l=Ee(e),c=xt(e,n),u=Ge(e.extent)?He(c,e.extent,l):c;let d=He({x:s+u.x,y:a+u.y},o,l);e.extent==="parent"&&(d=Ur(d,l,t));const f=di(e,r,i),p=t.internals.z??0;return{x:d.x,y:d.y,z:p>=f?p+1:f}}function Qn(e,t,n,o=[0,0]){const r=[],i=new Map;for(const s of e){const a=t.get(s.parentId);if(!a)continue;const l=i.get(s.parentId)?.expandedRect??qe(a),c=Jr(l,s.rect);i.set(s.parentId,{expandedRect:c,parent:a})}return i.size>0&&i.forEach(({expandedRect:s,parent:a},l)=>{const c=a.internals.positionAbsolute,u=Ee(a),d=a.origin??o,f=s.x<c.x?Math.round(Math.abs(c.x-s.x)):0,p=s.y<c.y?Math.round(Math.abs(c.y-s.y)):0,g=Math.max(u.width,Math.round(s.width)),w=Math.max(u.height,Math.round(s.height)),x=(g-u.width)*d[0],m=(w-u.height)*d[1];(f>0||p>0||x||m)&&(r.push({id:l,type:"position",position:{x:a.position.x-f+x,y:a.position.y-p+m}}),n.get(l)?.forEach(_=>{e.some(h=>h.id===_.id)||r.push({id:_.id,type:"position",position:{x:_.position.x+f,y:_.position.y+p}})})),(u.width<s.width||u.height<s.height||f||p)&&r.push({id:l,type:"dimensions",setAttributes:!0,dimensions:{width:g+(f?d[0]*f-x:0),height:w+(p?d[1]*p-m:0)}})}),r}function md(e,t,n,o,r,i,s){const a=o?.querySelector(".xyflow__viewport");let l=!1;if(!a)return{changes:[],updatedInternals:l};const c=[],u=window.getComputedStyle(a),{m22:d}=new window.DOMMatrixReadOnly(u.transform),f=[];for(const p of e.values()){const g=t.get(p.id);if(!g)continue;if(g.hidden){t.set(g.id,{...g,internals:{...g.internals,handleBounds:void 0}}),l=!0;continue}const w=Wn(p.nodeElement),x=g.measured.width!==w.width||g.measured.height!==w.height;if(!!(w.width&&w.height&&(x||!g.internals.handleBounds||p.force))){const _=p.nodeElement.getBoundingClientRect(),h=Ge(g.extent)?g.extent:i;let{positionAbsolute:y}=g.internals;g.parentId&&g.extent==="parent"?y=Ur(y,w,t.get(g.parentId)):h&&(y=He(y,h,w));const S={...g,measured:w,internals:{...g.internals,positionAbsolute:y,handleBounds:{source:Po("source",p.nodeElement,_,d,g.id),target:Po("target",p.nodeElement,_,d,g.id)}}};t.set(g.id,S),g.parentId&&Un(S,t,n,{nodeOrigin:r,zIndexMode:s}),l=!0,x&&(c.push({id:g.id,type:"dimensions",dimensions:w}),g.expandParent&&g.parentId&&f.push({id:g.id,parentId:g.parentId,rect:qe(S,r)}))}}if(f.length>0){const p=Qn(f,t,n,r);c.push(...p)}return{changes:c,updatedInternals:l}}async function yd({delta:e,panZoom:t,transform:n,translateExtent:o,width:r,height:i}){if(!t||!e.x&&!e.y)return Promise.resolve(!1);const s=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[r,i]],o),a=!!s&&(s.x!==n[0]||s.y!==n[1]||s.k!==n[2]);return Promise.resolve(a)}function Oo(e,t,n,o,r,i){let s=r;const a=o.get(s)||new Map;o.set(s,a.set(n,t)),s=`${r}-${e}`;const l=o.get(s)||new Map;if(o.set(s,l.set(n,t)),i){s=`${r}-${e}-${i}`;const c=o.get(s)||new Map;o.set(s,c.set(n,t))}}function fi(e,t,n){e.clear(),t.clear();for(const o of n){const{source:r,target:i,sourceHandle:s=null,targetHandle:a=null}=o,l={edgeId:o.id,source:r,target:i,sourceHandle:s,targetHandle:a},c=`${r}-${s}--${i}-${a}`,u=`${i}-${a}--${r}-${s}`;Oo("source",l,u,e,r,s),Oo("target",l,c,e,i,a),t.set(o.id,o)}}function hi(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:hi(n,t):!1}function Vo(e,t,n){let o=e;do{if(o?.matches?.(t))return!0;if(o===n)return!1;o=o?.parentElement}while(o);return!1}function xd(e,t,n,o){const r=new Map;for(const[i,s]of e)if((s.selected||s.id===o)&&(!s.parentId||!hi(s,e))&&(s.draggable||t&&typeof s.draggable>"u")){const a=e.get(i);a&&r.set(i,{id:i,position:a.position||{x:0,y:0},distance:{x:n.x-a.internals.positionAbsolute.x,y:n.y-a.internals.positionAbsolute.y},extent:a.extent,parentId:a.parentId,origin:a.origin,expandParent:a.expandParent,internals:{positionAbsolute:a.internals.positionAbsolute||{x:0,y:0}},measured:{width:a.measured.width??0,height:a.measured.height??0}})}return r}function pn({nodeId:e,dragItems:t,nodeLookup:n,dragging:o=!0}){const r=[];for(const[s,a]of t){const l=n.get(s)?.internals.userNode;l&&r.push({...l,position:a.position,dragging:o})}if(!e)return[r[0],r];const i=n.get(e)?.internals.userNode;return[i?{...i,position:t.get(e)?.position||i.position,dragging:o}:r[0],r]}function wd({dragItems:e,snapGrid:t,x:n,y:o}){const r=e.values().next().value;if(!r)return null;const i={x:n-r.distance.x,y:o-r.distance.y},s=vt(i,t);return{x:s.x-i.x,y:s.y-i.y}}function vd({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:o,onDragStop:r}){let i={x:null,y:null},s=0,a=new Map,l=!1,c={x:0,y:0},u=null,d=!1,f=null,p=!1,g=!1,w=null;function x({noDragClassName:_,handleSelector:h,domNode:y,isSelectable:S,nodeId:b,nodeClickDistance:C=0}){f=ce(y);function A({x:z,y:O}){const{nodeLookup:v,nodeExtent:N,snapGrid:E,snapToGrid:I,nodeOrigin:M,onNodeDrag:D,onSelectionDrag:H,onError:L,updateNodePositions:R}=t();i={x:z,y:O};let j=!1;const F=a.size>1,W=F&&N?An(wt(a)):null,K=F&&I?wd({dragItems:a,snapGrid:E,x:z,y:O}):null;for(const[Z,B]of a){if(!v.has(Z))continue;let X={x:z-B.distance.x,y:O-B.distance.y};I&&(X=K?{x:Math.round(X.x+K.x),y:Math.round(X.y+K.y)}:vt(X,E));let Q=null;if(F&&N&&!B.extent&&W){const{positionAbsolute:G}=B.internals,ee=G.x-W.x+N[0][0],ne=G.x+B.measured.width-W.x2+N[1][0],te=G.y-W.y+N[0][1],se=G.y+B.measured.height-W.y2+N[1][1];Q=[[ee,te],[ne,se]]}const{position:U,positionAbsolute:q}=Kr({nodeId:Z,nextPosition:X,nodeLookup:v,nodeExtent:Q||N,nodeOrigin:M,onError:L});j=j||B.position.x!==U.x||B.position.y!==U.y,B.position=U,B.internals.positionAbsolute=q}if(g=g||j,!!j&&(R(a,!0),w&&(o||D||!b&&H))){const[Z,B]=pn({nodeId:b,dragItems:a,nodeLookup:v});o?.(w,a,Z,B),D?.(w,Z,B),b||H?.(w,B)}}async function $(){if(!u)return;const{transform:z,panBy:O,autoPanSpeed:v,autoPanOnNodeDrag:N}=t();if(!N){l=!1,cancelAnimationFrame(s);return}const[E,I]=Qr(c,u,v);(E!==0||I!==0)&&(i.x=(i.x??0)-E/z[2],i.y=(i.y??0)-I/z[2],await O({x:E,y:I})&&A(i)),s=requestAnimationFrame($)}function V(z){const{nodeLookup:O,multiSelectionActive:v,nodesDraggable:N,transform:E,snapGrid:I,snapToGrid:M,selectNodesOnDrag:D,onNodeDragStart:H,onSelectionDragStart:L,unselectNodesAndEdges:R}=t();d=!0,(!D||!S)&&!v&&b&&(O.get(b)?.selected||R()),S&&D&&b&&e?.(b);const j=st(z.sourceEvent,{transform:E,snapGrid:I,snapToGrid:M,containerBounds:u});if(i=j,a=xd(O,N,j,b),a.size>0&&(n||H||!b&&L)){const[F,W]=pn({nodeId:b,dragItems:a,nodeLookup:O});n?.(z.sourceEvent,a,F,W),H?.(z.sourceEvent,F,W),b||L?.(z.sourceEvent,W)}}const k=kr().clickDistance(C).on("start",z=>{const{domNode:O,nodeDragThreshold:v,transform:N,snapGrid:E,snapToGrid:I}=t();u=O?.getBoundingClientRect()||null,p=!1,g=!1,w=z.sourceEvent,v===0&&V(z),i=st(z.sourceEvent,{transform:N,snapGrid:E,snapToGrid:I,containerBounds:u}),c=ge(z.sourceEvent,u)}).on("drag",z=>{const{autoPanOnNodeDrag:O,transform:v,snapGrid:N,snapToGrid:E,nodeDragThreshold:I,nodeLookup:M}=t(),D=st(z.sourceEvent,{transform:v,snapGrid:N,snapToGrid:E,containerBounds:u});if(w=z.sourceEvent,(z.sourceEvent.type==="touchmove"&&z.sourceEvent.touches.length>1||b&&!M.has(b))&&(p=!0),!p){if(!l&&O&&d&&(l=!0,$()),!d){const H=ge(z.sourceEvent,u),L=H.x-c.x,R=H.y-c.y;Math.sqrt(L*L+R*R)>I&&V(z)}(i.x!==D.xSnapped||i.y!==D.ySnapped)&&a&&d&&(c=ge(z.sourceEvent,u),A(D))}}).on("end",z=>{if(!(!d||p)&&(l=!1,d=!1,cancelAnimationFrame(s),a.size>0)){const{nodeLookup:O,updateNodePositions:v,onNodeDragStop:N,onSelectionDragStop:E}=t();if(g&&(v(a,!1),g=!1),r||N||!b&&E){const[I,M]=pn({nodeId:b,dragItems:a,nodeLookup:O,dragging:!1});r?.(z.sourceEvent,a,I,M),N?.(z.sourceEvent,I,M),b||E?.(z.sourceEvent,M)}}}).filter(z=>{const O=z.target;return!z.button&&(!_||!Vo(O,`.${_}`,y))&&(!h||Vo(O,h,y))});f.call(k)}function m(){f?.on(".drag",null)}return{update:x,destroy:m}}function bd(e,t,n){const o=[],r={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const i of t.values())ht(r,qe(i))>0&&o.push(i);return o}const _d=250;function Ed(e,t,n,o){let r=[],i=1/0;const s=bd(e,n,t+_d);for(const a of s){const l=[...a.internals.handleBounds?.source??[],...a.internals.handleBounds?.target??[]];for(const c of l){if(o.nodeId===c.nodeId&&o.type===c.type&&o.id===c.id)continue;const{x:u,y:d}=Re(a,c,c.position,!0),f=Math.sqrt(Math.pow(u-e.x,2)+Math.pow(d-e.y,2));f>t||(f<i?(r=[{...c,x:u,y:d}],i=f):f===i&&r.push({...c,x:u,y:d}))}}if(!r.length)return null;if(r.length>1){const a=o.type==="source"?"target":"source";return r.find(l=>l.type===a)??r[0]}return r[0]}function gi(e,t,n,o,r,i=!1){const s=o.get(e);if(!s)return null;const a=r==="strict"?s.internals.handleBounds?.[t]:[...s.internals.handleBounds?.source??[],...s.internals.handleBounds?.target??[]],l=(n?a?.find(c=>c.id===n):a?.[0])??null;return l&&i?{...l,...Re(s,l,l.position,!0)}:l}function pi(e,t){return e||(t?.classList.contains("target")?"target":t?.classList.contains("source")?"source":null)}function Sd(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const mi=()=>!0;function Nd(e,{connectionMode:t,connectionRadius:n,handleId:o,nodeId:r,edgeUpdaterType:i,isTarget:s,domNode:a,nodeLookup:l,lib:c,autoPanOnConnect:u,flowId:d,panBy:f,cancelConnection:p,onConnectStart:g,onConnect:w,onConnectEnd:x,isValidConnection:m=mi,onReconnectEnd:_,updateConnection:h,getTransform:y,getFromHandle:S,autoPanSpeed:b,dragThreshold:C=1,handleDomNode:A}){const $=oi(e.target);let V=0,k;const{x:z,y:O}=ge(e),v=pi(i,A),N=a?.getBoundingClientRect();let E=!1;if(!N||!v)return;const I=gi(r,v,o,l,t);if(!I)return;let M=ge(e,N),D=!1,H=null,L=!1,R=null;function j(){if(!u||!N)return;const[U,q]=Qr(M,N,b);f({x:U,y:q}),V=requestAnimationFrame(j)}const F={...I,nodeId:r,type:v,position:I.position},W=l.get(r);let Z={inProgress:!0,isValid:null,from:Re(W,F,Y.Left,!0),fromHandle:F,fromPosition:F.position,fromNode:W,to:M,toHandle:null,toPosition:Io[F.position],toNode:null,pointer:M};function B(){E=!0,h(Z),g?.(e,{nodeId:r,handleId:o,handleType:v})}C===0&&B();function X(U){if(!E){const{x:se,y:Se}=ge(U),we=se-z,ke=Se-O;if(!(we*we+ke*ke>C*C))return;B()}if(!S()||!F){Q(U);return}const q=y();M=ge(U,N),k=Ed(bt(M,q,!1,[1,1]),n,l,F),D||(j(),D=!0);const G=yi(U,{handle:k,connectionMode:t,fromNodeId:r,fromHandleId:o,fromType:s?"target":"source",isValidConnection:m,doc:$,lib:c,flowId:d,nodeLookup:l});R=G.handleDomNode,H=G.connection,L=Sd(!!k,G.isValid);const ee=l.get(r),ne=ee?Re(ee,F,Y.Left,!0):Z.from,te={...Z,from:ne,isValid:L,to:G.toHandle&&L?Zt({x:G.toHandle.x,y:G.toHandle.y},q):M,toHandle:G.toHandle,toPosition:L&&G.toHandle?G.toHandle.position:Io[F.position],toNode:G.toHandle?l.get(G.toHandle.nodeId):null,pointer:M};h(te),Z=te}function Q(U){if(!("touches"in U&&U.touches.length>0)){if(E){(k||R)&&H&&L&&w?.(H);const{inProgress:q,...G}=Z,ee={...G,toPosition:Z.toHandle?Z.toPosition:null};x?.(U,ee),i&&_?.(U,ee)}p(),cancelAnimationFrame(V),D=!1,L=!1,H=null,R=null,$.removeEventListener("mousemove",X),$.removeEventListener("mouseup",Q),$.removeEventListener("touchmove",X),$.removeEventListener("touchend",Q)}}$.addEventListener("mousemove",X),$.addEventListener("mouseup",Q),$.addEventListener("touchmove",X),$.addEventListener("touchend",Q)}function yi(e,{handle:t,connectionMode:n,fromNodeId:o,fromHandleId:r,fromType:i,doc:s,lib:a,flowId:l,isValidConnection:c=mi,nodeLookup:u}){const d=i==="target",f=t?s.querySelector(`.${a}-flow__handle[data-id="${l}-${t?.nodeId}-${t?.id}-${t?.type}"]`):null,{x:p,y:g}=ge(e),w=s.elementFromPoint(p,g),x=w?.classList.contains(`${a}-flow__handle`)?w:f,m={handleDomNode:x,isValid:!1,connection:null,toHandle:null};if(x){const _=pi(void 0,x),h=x.getAttribute("data-nodeid"),y=x.getAttribute("data-handleid"),S=x.classList.contains("connectable"),b=x.classList.contains("connectableend");if(!h||!_)return m;const C={source:d?h:o,sourceHandle:d?y:r,target:d?o:h,targetHandle:d?r:y};m.connection=C;const $=S&&b&&(n===Ze.Strict?d&&_==="source"||!d&&_==="target":h!==o||y!==r);m.isValid=$&&c(C),m.toHandle=gi(h,_,y,u,n,!0)}return m}const Tn={onPointerDown:Nd,isValid:yi};function Cd({domNode:e,panZoom:t,getTransform:n,getViewScale:o}){const r=ce(e);function i({translateExtent:a,width:l,height:c,zoomStep:u=1,pannable:d=!0,zoomable:f=!0,inversePan:p=!1}){const g=h=>{if(h.sourceEvent.type!=="wheel"||!t)return;const y=n(),S=h.sourceEvent.ctrlKey&>()?10:1,b=-h.sourceEvent.deltaY*(h.sourceEvent.deltaMode===1?.05:h.sourceEvent.deltaMode?1:.002)*u,C=y[2]*Math.pow(2,b*S);t.scaleTo(C)};let w=[0,0];const x=h=>{(h.sourceEvent.type==="mousedown"||h.sourceEvent.type==="touchstart")&&(w=[h.sourceEvent.clientX??h.sourceEvent.touches[0].clientX,h.sourceEvent.clientY??h.sourceEvent.touches[0].clientY])},m=h=>{const y=n();if(h.sourceEvent.type!=="mousemove"&&h.sourceEvent.type!=="touchmove"||!t)return;const S=[h.sourceEvent.clientX??h.sourceEvent.touches[0].clientX,h.sourceEvent.clientY??h.sourceEvent.touches[0].clientY],b=[S[0]-w[0],S[1]-w[1]];w=S;const C=o()*Math.max(y[2],Math.log(y[2]))*(p?-1:1),A={x:y[0]-b[0]*C,y:y[1]-b[1]*C},$=[[0,0],[l,c]];t.setViewportConstrained({x:A.x,y:A.y,zoom:y[2]},$,a)},_=Xr().on("start",x).on("zoom",d?m:null).on("zoom.wheel",f?g:null);r.call(_,{})}function s(){r.on("zoom",null)}return{update:i,destroy:s,pointer:de}}const nn=e=>({x:e.x,y:e.y,zoom:e.k}),mn=({x:e,y:t,zoom:n})=>Jt.translate(e,t).scale(n),Ve=(e,t)=>e.target.closest(`.${t}`),xi=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),Md=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,yn=(e,t=0,n=Md,o=()=>{})=>{const r=typeof t=="number"&&t>0;return r||o(),r?e.transition().duration(t).ease(n).on("end",o):e},wi=e=>{const t=e.ctrlKey&>()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function Id({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:o,panOnScrollMode:r,panOnScrollSpeed:i,zoomOnPinch:s,onPanZoomStart:a,onPanZoom:l,onPanZoomEnd:c}){return u=>{if(Ve(u,t))return u.ctrlKey&&u.preventDefault(),!1;u.preventDefault(),u.stopImmediatePropagation();const d=n.property("__zoom").k||1;if(u.ctrlKey&&s){const x=de(u),m=wi(u),_=d*Math.pow(2,m);o.scaleTo(n,_,x,u);return}const f=u.deltaMode===1?20:1;let p=r===De.Vertical?0:u.deltaX*f,g=r===De.Horizontal?0:u.deltaY*f;!gt()&&u.shiftKey&&r!==De.Vertical&&(p=u.deltaY*f,g=0),o.translateBy(n,-(p/d)*i,-(g/d)*i,{internal:!0});const w=nn(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(l?.(u,w),e.panScrollTimeout=setTimeout(()=>{c?.(u,w),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,a?.(u,w))}}function kd({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(o,r){const i=o.type==="wheel",s=!t&&i&&!o.ctrlKey,a=Ve(o,e);if(o.ctrlKey&&i&&a&&o.preventDefault(),s||a)return null;o.preventDefault(),n.call(this,o,r)}}function Ad({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return o=>{if(o.sourceEvent?.internal)return;const r=nn(o.transform);e.mouseButton=o.sourceEvent?.button||0,e.isZoomingOrPanning=!0,e.prevViewport=r,o.sourceEvent?.type==="mousedown"&&t(!0),n&&n?.(o.sourceEvent,r)}}function $d({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:o,onPanZoom:r}){return i=>{e.usedRightMouseButton=!!(n&&xi(t,e.mouseButton??0)),i.sourceEvent?.sync||o([i.transform.x,i.transform.y,i.transform.k]),r&&!i.sourceEvent?.internal&&r?.(i.sourceEvent,nn(i.transform))}}function Pd({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:o,onPanZoomEnd:r,onPaneContextMenu:i}){return s=>{if(!s.sourceEvent?.internal&&(e.isZoomingOrPanning=!1,i&&xi(t,e.mouseButton??0)&&!e.usedRightMouseButton&&s.sourceEvent&&i(s.sourceEvent),e.usedRightMouseButton=!1,o(!1),r)){const a=nn(s.transform);e.prevViewport=a,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{r?.(s.sourceEvent,a)},n?150:0)}}}function Dd({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:o,panOnScroll:r,zoomOnDoubleClick:i,userSelectionActive:s,noWheelClassName:a,noPanClassName:l,lib:c,connectionInProgress:u}){return d=>{const f=e||t,p=n&&d.ctrlKey,g=d.type==="wheel";if(d.button===1&&d.type==="mousedown"&&(Ve(d,`${c}-flow__node`)||Ve(d,`${c}-flow__edge`)))return!0;if(!o&&!f&&!r&&!i&&!n||s||u&&!g||Ve(d,a)&&g||Ve(d,l)&&(!g||r&&g&&!e)||!n&&d.ctrlKey&&g)return!1;if(!n&&d.type==="touchstart"&&d.touches?.length>1)return d.preventDefault(),!1;if(!f&&!r&&!p&&g||!o&&(d.type==="mousedown"||d.type==="touchstart")||Array.isArray(o)&&!o.includes(d.button)&&d.type==="mousedown")return!1;const w=Array.isArray(o)&&o.includes(d.button)||!d.button||d.button<=1;return(!d.ctrlKey||g)&&w}}function Td({domNode:e,minZoom:t,maxZoom:n,translateExtent:o,viewport:r,onPanZoom:i,onPanZoomStart:s,onPanZoomEnd:a,onDraggingChange:l}){const c={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},u=e.getBoundingClientRect(),d=Xr().scaleExtent([t,n]).translateExtent(o),f=ce(e).call(d);_({x:r.x,y:r.y,zoom:We(r.zoom,t,n)},[[0,0],[u.width,u.height]],o);const p=f.on("wheel.zoom"),g=f.on("dblclick.zoom");d.wheelDelta(wi);function w(k,z){return f?new Promise(O=>{d?.interpolate(z?.interpolate==="linear"?it:Dt).transform(yn(f,z?.duration,z?.ease,()=>O(!0)),k)}):Promise.resolve(!1)}function x({noWheelClassName:k,noPanClassName:z,onPaneContextMenu:O,userSelectionActive:v,panOnScroll:N,panOnDrag:E,panOnScrollMode:I,panOnScrollSpeed:M,preventScrolling:D,zoomOnPinch:H,zoomOnScroll:L,zoomOnDoubleClick:R,zoomActivationKeyPressed:j,lib:F,onTransformChange:W,connectionInProgress:K,paneClickDistance:Z,selectionOnDrag:B}){v&&!c.isZoomingOrPanning&&m();const X=N&&!j&&!v;d.clickDistance(B?1/0:!he(Z)||Z<0?0:Z);const Q=X?Id({zoomPanValues:c,noWheelClassName:k,d3Selection:f,d3Zoom:d,panOnScrollMode:I,panOnScrollSpeed:M,zoomOnPinch:H,onPanZoomStart:s,onPanZoom:i,onPanZoomEnd:a}):kd({noWheelClassName:k,preventScrolling:D,d3ZoomHandler:p});if(f.on("wheel.zoom",Q,{passive:!1}),!v){const q=Ad({zoomPanValues:c,onDraggingChange:l,onPanZoomStart:s});d.on("start",q);const G=$d({zoomPanValues:c,panOnDrag:E,onPaneContextMenu:!!O,onPanZoom:i,onTransformChange:W});d.on("zoom",G);const ee=Pd({zoomPanValues:c,panOnDrag:E,panOnScroll:N,onPaneContextMenu:O,onPanZoomEnd:a,onDraggingChange:l});d.on("end",ee)}const U=Dd({zoomActivationKeyPressed:j,panOnDrag:E,zoomOnScroll:L,panOnScroll:N,zoomOnDoubleClick:R,zoomOnPinch:H,userSelectionActive:v,noPanClassName:z,noWheelClassName:k,lib:F,connectionInProgress:K});d.filter(U),R?f.on("dblclick.zoom",g):f.on("dblclick.zoom",null)}function m(){d.on("zoom",null)}async function _(k,z,O){const v=mn(k),N=d?.constrain()(v,z,O);return N&&await w(N),new Promise(E=>E(N))}async function h(k,z){const O=mn(k);return await w(O,z),new Promise(v=>v(O))}function y(k){if(f){const z=mn(k),O=f.property("__zoom");(O.k!==k.zoom||O.x!==k.x||O.y!==k.y)&&d?.transform(f,z,null,{sync:!0})}}function S(){const k=f?jr(f.node()):{x:0,y:0,k:1};return{x:k.x,y:k.y,zoom:k.k}}function b(k,z){return f?new Promise(O=>{d?.interpolate(z?.interpolate==="linear"?it:Dt).scaleTo(yn(f,z?.duration,z?.ease,()=>O(!0)),k)}):Promise.resolve(!1)}function C(k,z){return f?new Promise(O=>{d?.interpolate(z?.interpolate==="linear"?it:Dt).scaleBy(yn(f,z?.duration,z?.ease,()=>O(!0)),k)}):Promise.resolve(!1)}function A(k){d?.scaleExtent(k)}function $(k){d?.translateExtent(k)}function V(k){const z=!he(k)||k<0?0:k;d?.clickDistance(z)}return{update:x,destroy:m,setViewport:h,setViewportConstrained:_,getViewport:S,scaleTo:b,scaleBy:C,setScaleExtent:A,setTranslateExtent:$,syncViewport:y,setClickDistance:V}}var Ke;(function(e){e.Line="line",e.Handle="handle"})(Ke||(Ke={}));function zd({width:e,prevWidth:t,height:n,prevHeight:o,affectsX:r,affectsY:i}){const s=e-t,a=n-o,l=[s>0?1:s<0?-1:0,a>0?1:a<0?-1:0];return s&&r&&(l[0]=l[0]*-1),a&&i&&(l[1]=l[1]*-1),l}function Bo(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),o=e.includes("left"),r=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:o,affectsY:r}}function Ne(e,t){return Math.max(0,t-e)}function Ce(e,t){return Math.max(0,e-t)}function kt(e,t,n){return Math.max(0,t-e,e-n)}function Fo(e,t){return e?!t:t}function Hd(e,t,n,o,r,i,s,a){let{affectsX:l,affectsY:c}=t;const{isHorizontal:u,isVertical:d}=t,f=u&&d,{xSnapped:p,ySnapped:g}=n,{minWidth:w,maxWidth:x,minHeight:m,maxHeight:_}=o,{x:h,y,width:S,height:b,aspectRatio:C}=e;let A=Math.floor(u?p-e.pointerX:0),$=Math.floor(d?g-e.pointerY:0);const V=S+(l?-A:A),k=b+(c?-$:$),z=-i[0]*S,O=-i[1]*b;let v=kt(V,w,x),N=kt(k,m,_);if(s){let M=0,D=0;l&&A<0?M=Ne(h+A+z,s[0][0]):!l&&A>0&&(M=Ce(h+V+z,s[1][0])),c&&$<0?D=Ne(y+$+O,s[0][1]):!c&&$>0&&(D=Ce(y+k+O,s[1][1])),v=Math.max(v,M),N=Math.max(N,D)}if(a){let M=0,D=0;l&&A>0?M=Ce(h+A,a[0][0]):!l&&A<0&&(M=Ne(h+V,a[1][0])),c&&$>0?D=Ce(y+$,a[0][1]):!c&&$<0&&(D=Ne(y+k,a[1][1])),v=Math.max(v,M),N=Math.max(N,D)}if(r){if(u){const M=kt(V/C,m,_)*C;if(v=Math.max(v,M),s){let D=0;!l&&!c||l&&!c&&f?D=Ce(y+O+V/C,s[1][1])*C:D=Ne(y+O+(l?A:-A)/C,s[0][1])*C,v=Math.max(v,D)}if(a){let D=0;!l&&!c||l&&!c&&f?D=Ne(y+V/C,a[1][1])*C:D=Ce(y+(l?A:-A)/C,a[0][1])*C,v=Math.max(v,D)}}if(d){const M=kt(k*C,w,x)/C;if(N=Math.max(N,M),s){let D=0;!l&&!c||c&&!l&&f?D=Ce(h+k*C+z,s[1][0])/C:D=Ne(h+(c?$:-$)*C+z,s[0][0])/C,N=Math.max(N,D)}if(a){let D=0;!l&&!c||c&&!l&&f?D=Ne(h+k*C,a[1][0])/C:D=Ce(h+(c?$:-$)*C,a[0][0])/C,N=Math.max(N,D)}}}$=$+($<0?N:-N),A=A+(A<0?v:-v),r&&(f?V>k*C?$=(Fo(l,c)?-A:A)/C:A=(Fo(l,c)?-$:$)*C:u?($=A/C,c=l):(A=$*C,l=c));const E=l?h+A:h,I=c?y+$:y;return{width:S+(l?-A:A),height:b+(c?-$:$),x:i[0]*A*(l?-1:1)+E,y:i[1]*$*(c?-1:1)+I}}const vi={width:0,height:0,x:0,y:0},Rd={...vi,pointerX:0,pointerY:0,aspectRatio:1};function Ld(e){return[[0,0],[e.measured.width,e.measured.height]]}function Od(e,t,n){const o=t.position.x+e.position.x,r=t.position.y+e.position.y,i=e.measured.width??0,s=e.measured.height??0,a=n[0]*i,l=n[1]*s;return[[o-a,r-l],[o+i-a,r+s-l]]}function Vd({domNode:e,nodeId:t,getStoreItems:n,onChange:o,onEnd:r}){const i=ce(e);let s={controlDirection:Bo("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function a({controlPosition:c,boundaries:u,keepAspectRatio:d,resizeDirection:f,onResizeStart:p,onResize:g,onResizeEnd:w,shouldResize:x}){let m={...vi},_={...Rd};s={boundaries:u,resizeDirection:f,keepAspectRatio:d,controlDirection:Bo(c)};let h,y=null,S=[],b,C,A,$=!1;const V=kr().on("start",k=>{const{nodeLookup:z,transform:O,snapGrid:v,snapToGrid:N,nodeOrigin:E,paneDomNode:I}=n();if(h=z.get(t),!h)return;y=I?.getBoundingClientRect()??null;const{xSnapped:M,ySnapped:D}=st(k.sourceEvent,{transform:O,snapGrid:v,snapToGrid:N,containerBounds:y});m={width:h.measured.width??0,height:h.measured.height??0,x:h.position.x??0,y:h.position.y??0},_={...m,pointerX:M,pointerY:D,aspectRatio:m.width/m.height},b=void 0,h.parentId&&(h.extent==="parent"||h.expandParent)&&(b=z.get(h.parentId),C=b&&h.extent==="parent"?Ld(b):void 0),S=[],A=void 0;for(const[H,L]of z)if(L.parentId===t&&(S.push({id:H,position:{...L.position},extent:L.extent}),L.extent==="parent"||L.expandParent)){const R=Od(L,h,L.origin??E);A?A=[[Math.min(R[0][0],A[0][0]),Math.min(R[0][1],A[0][1])],[Math.max(R[1][0],A[1][0]),Math.max(R[1][1],A[1][1])]]:A=R}p?.(k,{...m})}).on("drag",k=>{const{transform:z,snapGrid:O,snapToGrid:v,nodeOrigin:N}=n(),E=st(k.sourceEvent,{transform:z,snapGrid:O,snapToGrid:v,containerBounds:y}),I=[];if(!h)return;const{x:M,y:D,width:H,height:L}=m,R={},j=h.origin??N,{width:F,height:W,x:K,y:Z}=Hd(_,s.controlDirection,E,s.boundaries,s.keepAspectRatio,j,C,A),B=F!==H,X=W!==L,Q=K!==M&&B,U=Z!==D&&X;if(!Q&&!U&&!B&&!X)return;if((Q||U||j[0]===1||j[1]===1)&&(R.x=Q?K:m.x,R.y=U?Z:m.y,m.x=R.x,m.y=R.y,S.length>0)){const ne=K-M,te=Z-D;for(const se of S)se.position={x:se.position.x-ne+j[0]*(F-H),y:se.position.y-te+j[1]*(W-L)},I.push(se)}if((B||X)&&(R.width=B&&(!s.resizeDirection||s.resizeDirection==="horizontal")?F:m.width,R.height=X&&(!s.resizeDirection||s.resizeDirection==="vertical")?W:m.height,m.width=R.width,m.height=R.height),b&&h.expandParent){const ne=j[0]*(R.width??0);R.x&&R.x<ne&&(m.x=ne,_.x=_.x-(R.x-ne));const te=j[1]*(R.height??0);R.y&&R.y<te&&(m.y=te,_.y=_.y-(R.y-te))}const q=zd({width:m.width,prevWidth:H,height:m.height,prevHeight:L,affectsX:s.controlDirection.affectsX,affectsY:s.controlDirection.affectsY}),G={...m,direction:q};x?.(k,G)!==!1&&($=!0,g?.(k,G),o(R,I))}).on("end",k=>{$&&(w?.(k,{...m}),r?.({...m}),$=!1)});i.call(V)}function l(){i.on(".drag",null)}return{update:a,destroy:l}}var xn={exports:{}},wn={},jo;function Bd(){if(jo)return wn;jo=1;/**
|
|
1
|
+
import{r as ia,g as sa,R as aa,a as T,j as P}from"./query-vendor-BqVbYexz.js";import{r as ca}from"./index-C00aFykz.js";import{f as la}from"./index-CVYHt6Z6.js";function ie(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,o;n<e.length;n++)(o=ie(e[n]))!==""&&(t+=(t&&" ")+o);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var ua={value:()=>{}};function Gt(){for(var e=0,t=arguments.length,n={},o;e<t;++e){if(!(o=arguments[e]+"")||o in n||/[\s.]/.test(o))throw new Error("illegal type: "+o);n[o]=[]}return new Pt(n)}function Pt(e){this._=e}function da(e,t){return e.trim().split(/^|\s+/).map(function(n){var o="",r=n.indexOf(".");if(r>=0&&(o=n.slice(r+1),n=n.slice(0,r)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:o}})}Pt.prototype=Gt.prototype={constructor:Pt,on:function(e,t){var n=this._,o=da(e+"",n),r,i=-1,s=o.length;if(arguments.length<2){for(;++i<s;)if((r=(e=o[i]).type)&&(r=fa(n[r],e.name)))return r;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++i<s;)if(r=(e=o[i]).type)n[r]=uo(n[r],e.name,t);else if(t==null)for(r in n)n[r]=uo(n[r],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Pt(e)},call:function(e,t){if((r=arguments.length-2)>0)for(var n=new Array(r),o=0,r,i;o<r;++o)n[o]=arguments[o+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(i=this._[e],o=0,r=i.length;o<r;++o)i[o].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var o=this._[e],r=0,i=o.length;r<i;++r)o[r].value.apply(t,n)}};function fa(e,t){for(var n=0,o=e.length,r;n<o;++n)if((r=e[n]).name===t)return r.value}function uo(e,t,n){for(var o=0,r=e.length;o<r;++o)if(e[o].name===t){e[o]=ua,e=e.slice(0,o).concat(e.slice(o+1));break}return n!=null&&e.push({name:t,value:n}),e}var _n="http://www.w3.org/1999/xhtml";const fo={svg:"http://www.w3.org/2000/svg",xhtml:_n,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Kt(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),fo.hasOwnProperty(t)?{space:fo[t],local:e}:e}function ha(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===_n&&t.documentElement.namespaceURI===_n?t.createElement(e):t.createElementNS(n,e)}}function ga(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function pr(e){var t=Kt(e);return(t.local?ga:ha)(t)}function pa(){}function Rn(e){return e==null?pa:function(){return this.querySelector(e)}}function ma(e){typeof e!="function"&&(e=Rn(e));for(var t=this._groups,n=t.length,o=new Array(n),r=0;r<n;++r)for(var i=t[r],s=i.length,a=o[r]=new Array(s),l,c,u=0;u<s;++u)(l=i[u])&&(c=e.call(l,l.__data__,u,i))&&("__data__"in l&&(c.__data__=l.__data__),a[u]=c);return new le(o,this._parents)}function ya(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function xa(){return[]}function mr(e){return e==null?xa:function(){return this.querySelectorAll(e)}}function wa(e){return function(){return ya(e.apply(this,arguments))}}function va(e){typeof e=="function"?e=wa(e):e=mr(e);for(var t=this._groups,n=t.length,o=[],r=[],i=0;i<n;++i)for(var s=t[i],a=s.length,l,c=0;c<a;++c)(l=s[c])&&(o.push(e.call(l,l.__data__,c,s)),r.push(l));return new le(o,r)}function yr(e){return function(){return this.matches(e)}}function xr(e){return function(t){return t.matches(e)}}var ba=Array.prototype.find;function _a(e){return function(){return ba.call(this.children,e)}}function Ea(){return this.firstElementChild}function Sa(e){return this.select(e==null?Ea:_a(typeof e=="function"?e:xr(e)))}var Na=Array.prototype.filter;function Ca(){return Array.from(this.children)}function Ma(e){return function(){return Na.call(this.children,e)}}function Ia(e){return this.selectAll(e==null?Ca:Ma(typeof e=="function"?e:xr(e)))}function ka(e){typeof e!="function"&&(e=yr(e));for(var t=this._groups,n=t.length,o=new Array(n),r=0;r<n;++r)for(var i=t[r],s=i.length,a=o[r]=[],l,c=0;c<s;++c)(l=i[c])&&e.call(l,l.__data__,c,i)&&a.push(l);return new le(o,this._parents)}function wr(e){return new Array(e.length)}function Aa(){return new le(this._enter||this._groups.map(wr),this._parents)}function Rt(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Rt.prototype={constructor:Rt,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function $a(e){return function(){return e}}function Pa(e,t,n,o,r,i){for(var s=0,a,l=t.length,c=i.length;s<c;++s)(a=t[s])?(a.__data__=i[s],o[s]=a):n[s]=new Rt(e,i[s]);for(;s<l;++s)(a=t[s])&&(r[s]=a)}function Da(e,t,n,o,r,i,s){var a,l,c=new Map,u=t.length,d=i.length,f=new Array(u),p;for(a=0;a<u;++a)(l=t[a])&&(f[a]=p=s.call(l,l.__data__,a,t)+"",c.has(p)?r[a]=l:c.set(p,l));for(a=0;a<d;++a)p=s.call(e,i[a],a,i)+"",(l=c.get(p))?(o[a]=l,l.__data__=i[a],c.delete(p)):n[a]=new Rt(e,i[a]);for(a=0;a<u;++a)(l=t[a])&&c.get(f[a])===l&&(r[a]=l)}function Ta(e){return e.__data__}function za(e,t){if(!arguments.length)return Array.from(this,Ta);var n=t?Da:Pa,o=this._parents,r=this._groups;typeof e!="function"&&(e=$a(e));for(var i=r.length,s=new Array(i),a=new Array(i),l=new Array(i),c=0;c<i;++c){var u=o[c],d=r[c],f=d.length,p=Ha(e.call(u,u&&u.__data__,c,o)),g=p.length,w=a[c]=new Array(g),x=s[c]=new Array(g),m=l[c]=new Array(f);n(u,d,w,x,m,p,t);for(var _=0,h=0,y,S;_<g;++_)if(y=w[_]){for(_>=h&&(h=_+1);!(S=x[h])&&++h<g;);y._next=S||null}}return s=new le(s,o),s._enter=a,s._exit=l,s}function Ha(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Ra(){return new le(this._exit||this._groups.map(wr),this._parents)}function La(e,t,n){var o=this.enter(),r=this,i=this.exit();return typeof e=="function"?(o=e(o),o&&(o=o.selection())):o=o.append(e+""),t!=null&&(r=t(r),r&&(r=r.selection())),n==null?i.remove():n(i),o&&r?o.merge(r).order():r}function Oa(e){for(var t=e.selection?e.selection():e,n=this._groups,o=t._groups,r=n.length,i=o.length,s=Math.min(r,i),a=new Array(r),l=0;l<s;++l)for(var c=n[l],u=o[l],d=c.length,f=a[l]=new Array(d),p,g=0;g<d;++g)(p=c[g]||u[g])&&(f[g]=p);for(;l<r;++l)a[l]=n[l];return new le(a,this._parents)}function Va(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var o=e[t],r=o.length-1,i=o[r],s;--r>=0;)(s=o[r])&&(i&&s.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(s,i),i=s);return this}function Ba(e){e||(e=Fa);function t(d,f){return d&&f?e(d.__data__,f.__data__):!d-!f}for(var n=this._groups,o=n.length,r=new Array(o),i=0;i<o;++i){for(var s=n[i],a=s.length,l=r[i]=new Array(a),c,u=0;u<a;++u)(c=s[u])&&(l[u]=c);l.sort(t)}return new le(r,this._parents).order()}function Fa(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function ja(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function Xa(){return Array.from(this)}function Ya(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var o=e[t],r=0,i=o.length;r<i;++r){var s=o[r];if(s)return s}return null}function Za(){let e=0;for(const t of this)++e;return e}function Wa(){return!this.node()}function qa(e){for(var t=this._groups,n=0,o=t.length;n<o;++n)for(var r=t[n],i=0,s=r.length,a;i<s;++i)(a=r[i])&&e.call(a,a.__data__,i,r);return this}function Ga(e){return function(){this.removeAttribute(e)}}function Ka(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Ua(e,t){return function(){this.setAttribute(e,t)}}function Qa(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function Ja(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function ec(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function tc(e,t){var n=Kt(e);if(arguments.length<2){var o=this.node();return n.local?o.getAttributeNS(n.space,n.local):o.getAttribute(n)}return this.each((t==null?n.local?Ka:Ga:typeof t=="function"?n.local?ec:Ja:n.local?Qa:Ua)(n,t))}function vr(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function nc(e){return function(){this.style.removeProperty(e)}}function oc(e,t,n){return function(){this.style.setProperty(e,t,n)}}function rc(e,t,n){return function(){var o=t.apply(this,arguments);o==null?this.style.removeProperty(e):this.style.setProperty(e,o,n)}}function ic(e,t,n){return arguments.length>1?this.each((t==null?nc:typeof t=="function"?rc:oc)(e,t,n??"")):Xe(this.node(),e)}function Xe(e,t){return e.style.getPropertyValue(t)||vr(e).getComputedStyle(e,null).getPropertyValue(t)}function sc(e){return function(){delete this[e]}}function ac(e,t){return function(){this[e]=t}}function cc(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function lc(e,t){return arguments.length>1?this.each((t==null?sc:typeof t=="function"?cc:ac)(e,t)):this.node()[e]}function br(e){return e.trim().split(/^|\s+/)}function Ln(e){return e.classList||new _r(e)}function _r(e){this._node=e,this._names=br(e.getAttribute("class")||"")}_r.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function Er(e,t){for(var n=Ln(e),o=-1,r=t.length;++o<r;)n.add(t[o])}function Sr(e,t){for(var n=Ln(e),o=-1,r=t.length;++o<r;)n.remove(t[o])}function uc(e){return function(){Er(this,e)}}function dc(e){return function(){Sr(this,e)}}function fc(e,t){return function(){(t.apply(this,arguments)?Er:Sr)(this,e)}}function hc(e,t){var n=br(e+"");if(arguments.length<2){for(var o=Ln(this.node()),r=-1,i=n.length;++r<i;)if(!o.contains(n[r]))return!1;return!0}return this.each((typeof t=="function"?fc:t?uc:dc)(n,t))}function gc(){this.textContent=""}function pc(e){return function(){this.textContent=e}}function mc(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function yc(e){return arguments.length?this.each(e==null?gc:(typeof e=="function"?mc:pc)(e)):this.node().textContent}function xc(){this.innerHTML=""}function wc(e){return function(){this.innerHTML=e}}function vc(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function bc(e){return arguments.length?this.each(e==null?xc:(typeof e=="function"?vc:wc)(e)):this.node().innerHTML}function _c(){this.nextSibling&&this.parentNode.appendChild(this)}function Ec(){return this.each(_c)}function Sc(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Nc(){return this.each(Sc)}function Cc(e){var t=typeof e=="function"?e:pr(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function Mc(){return null}function Ic(e,t){var n=typeof e=="function"?e:pr(e),o=t==null?Mc:typeof t=="function"?t:Rn(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),o.apply(this,arguments)||null)})}function kc(){var e=this.parentNode;e&&e.removeChild(this)}function Ac(){return this.each(kc)}function $c(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Pc(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Dc(e){return this.select(e?Pc:$c)}function Tc(e){return arguments.length?this.property("__data__",e):this.node().__data__}function zc(e){return function(t){e.call(this,t,this.__data__)}}function Hc(e){return e.trim().split(/^|\s+/).map(function(t){var n="",o=t.indexOf(".");return o>=0&&(n=t.slice(o+1),t=t.slice(0,o)),{type:t,name:n}})}function Rc(e){return function(){var t=this.__on;if(t){for(var n=0,o=-1,r=t.length,i;n<r;++n)i=t[n],(!e.type||i.type===e.type)&&i.name===e.name?this.removeEventListener(i.type,i.listener,i.options):t[++o]=i;++o?t.length=o:delete this.__on}}}function Lc(e,t,n){return function(){var o=this.__on,r,i=zc(t);if(o){for(var s=0,a=o.length;s<a;++s)if((r=o[s]).type===e.type&&r.name===e.name){this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=i,r.options=n),r.value=t;return}}this.addEventListener(e.type,i,n),r={type:e.type,name:e.name,value:t,listener:i,options:n},o?o.push(r):this.__on=[r]}}function Oc(e,t,n){var o=Hc(e+""),r,i=o.length,s;if(arguments.length<2){var a=this.node().__on;if(a){for(var l=0,c=a.length,u;l<c;++l)for(r=0,u=a[l];r<i;++r)if((s=o[r]).type===u.type&&s.name===u.name)return u.value}return}for(a=t?Lc:Rc,r=0;r<i;++r)this.each(a(o[r],t,n));return this}function Nr(e,t,n){var o=vr(e),r=o.CustomEvent;typeof r=="function"?r=new r(t,n):(r=o.document.createEvent("Event"),n?(r.initEvent(t,n.bubbles,n.cancelable),r.detail=n.detail):r.initEvent(t,!1,!1)),e.dispatchEvent(r)}function Vc(e,t){return function(){return Nr(this,e,t)}}function Bc(e,t){return function(){return Nr(this,e,t.apply(this,arguments))}}function Fc(e,t){return this.each((typeof t=="function"?Bc:Vc)(e,t))}function*jc(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var o=e[t],r=0,i=o.length,s;r<i;++r)(s=o[r])&&(yield s)}var Cr=[null];function le(e,t){this._groups=e,this._parents=t}function mt(){return new le([[document.documentElement]],Cr)}function Xc(){return this}le.prototype=mt.prototype={constructor:le,select:ma,selectAll:va,selectChild:Sa,selectChildren:Ia,filter:ka,data:za,enter:Aa,exit:Ra,join:La,merge:Oa,selection:Xc,order:Va,sort:Ba,call:ja,nodes:Xa,node:Ya,size:Za,empty:Wa,each:qa,attr:tc,style:ic,property:lc,classed:hc,text:yc,html:bc,raise:Ec,lower:Nc,append:Cc,insert:Ic,remove:Ac,clone:Dc,datum:Tc,on:Oc,dispatch:Fc,[Symbol.iterator]:jc};function ce(e){return typeof e=="string"?new le([[document.querySelector(e)]],[document.documentElement]):new le([[e]],Cr)}function Yc(e){let t;for(;t=e.sourceEvent;)e=t;return e}function de(e,t){if(e=Yc(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var o=n.createSVGPoint();return o.x=e.clientX,o.y=e.clientY,o=o.matrixTransform(t.getScreenCTM().inverse()),[o.x,o.y]}if(t.getBoundingClientRect){var r=t.getBoundingClientRect();return[e.clientX-r.left-t.clientLeft,e.clientY-r.top-t.clientTop]}}return[e.pageX,e.pageY]}const Zc={passive:!1},at={capture:!0,passive:!1};function dn(e){e.stopImmediatePropagation()}function Fe(e){e.preventDefault(),e.stopImmediatePropagation()}function Mr(e){var t=e.document.documentElement,n=ce(e).on("dragstart.drag",Fe,at);"onselectstart"in t?n.on("selectstart.drag",Fe,at):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function Ir(e,t){var n=e.document.documentElement,o=ce(e).on("dragstart.drag",null);t&&(o.on("click.drag",Fe,at),setTimeout(function(){o.on("click.drag",null)},0)),"onselectstart"in n?o.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const Et=e=>()=>e;function En(e,{sourceEvent:t,subject:n,target:o,identifier:r,active:i,x:s,y:a,dx:l,dy:c,dispatch:u}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:o,enumerable:!0,configurable:!0},identifier:{value:r,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:s,enumerable:!0,configurable:!0},y:{value:a,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:c,enumerable:!0,configurable:!0},_:{value:u}})}En.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function Wc(e){return!e.ctrlKey&&!e.button}function qc(){return this.parentNode}function Gc(e,t){return t??{x:e.x,y:e.y}}function Kc(){return navigator.maxTouchPoints||"ontouchstart"in this}function kr(){var e=Wc,t=qc,n=Gc,o=Kc,r={},i=Gt("start","drag","end"),s=0,a,l,c,u,d=0;function f(y){y.on("mousedown.drag",p).filter(o).on("touchstart.drag",x).on("touchmove.drag",m,Zc).on("touchend.drag touchcancel.drag",_).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function p(y,S){if(!(u||!e.call(this,y,S))){var b=h(this,t.call(this,y,S),y,S,"mouse");b&&(ce(y.view).on("mousemove.drag",g,at).on("mouseup.drag",w,at),Mr(y.view),dn(y),c=!1,a=y.clientX,l=y.clientY,b("start",y))}}function g(y){if(Fe(y),!c){var S=y.clientX-a,b=y.clientY-l;c=S*S+b*b>d}r.mouse("drag",y)}function w(y){ce(y.view).on("mousemove.drag mouseup.drag",null),Ir(y.view,c),Fe(y),r.mouse("end",y)}function x(y,S){if(e.call(this,y,S)){var b=y.changedTouches,C=t.call(this,y,S),A=b.length,$,V;for($=0;$<A;++$)(V=h(this,C,y,S,b[$].identifier,b[$]))&&(dn(y),V("start",y,b[$]))}}function m(y){var S=y.changedTouches,b=S.length,C,A;for(C=0;C<b;++C)(A=r[S[C].identifier])&&(Fe(y),A("drag",y,S[C]))}function _(y){var S=y.changedTouches,b=S.length,C,A;for(u&&clearTimeout(u),u=setTimeout(function(){u=null},500),C=0;C<b;++C)(A=r[S[C].identifier])&&(dn(y),A("end",y,S[C]))}function h(y,S,b,C,A,$){var V=i.copy(),k=de($||b,S),z,O,v;if((v=n.call(y,new En("beforestart",{sourceEvent:b,target:f,identifier:A,active:s,x:k[0],y:k[1],dx:0,dy:0,dispatch:V}),C))!=null)return z=v.x-k[0]||0,O=v.y-k[1]||0,function N(E,I,M){var D=k,H;switch(E){case"start":r[A]=N,H=s++;break;case"end":delete r[A],--s;case"drag":k=de(M||I,S),H=s;break}V.call(E,y,new En(E,{sourceEvent:I,subject:v,target:f,identifier:A,active:H,x:k[0]+z,y:k[1]+O,dx:k[0]-D[0],dy:k[1]-D[1],dispatch:V}),C)}}return f.filter=function(y){return arguments.length?(e=typeof y=="function"?y:Et(!!y),f):e},f.container=function(y){return arguments.length?(t=typeof y=="function"?y:Et(y),f):t},f.subject=function(y){return arguments.length?(n=typeof y=="function"?y:Et(y),f):n},f.touchable=function(y){return arguments.length?(o=typeof y=="function"?y:Et(!!y),f):o},f.on=function(){var y=i.on.apply(i,arguments);return y===i?f:y},f.clickDistance=function(y){return arguments.length?(d=(y=+y)*y,f):Math.sqrt(d)},f}function On(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Ar(e,t){var n=Object.create(e.prototype);for(var o in t)n[o]=t[o];return n}function yt(){}var ct=.7,Lt=1/ct,je="\\s*([+-]?\\d+)\\s*",lt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",ye="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Uc=/^#([0-9a-f]{3,8})$/,Qc=new RegExp(`^rgb\\(${je},${je},${je}\\)$`),Jc=new RegExp(`^rgb\\(${ye},${ye},${ye}\\)$`),el=new RegExp(`^rgba\\(${je},${je},${je},${lt}\\)$`),tl=new RegExp(`^rgba\\(${ye},${ye},${ye},${lt}\\)$`),nl=new RegExp(`^hsl\\(${lt},${ye},${ye}\\)$`),ol=new RegExp(`^hsla\\(${lt},${ye},${ye},${lt}\\)$`),ho={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};On(yt,Te,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:go,formatHex:go,formatHex8:rl,formatHsl:il,formatRgb:po,toString:po});function go(){return this.rgb().formatHex()}function rl(){return this.rgb().formatHex8()}function il(){return $r(this).formatHsl()}function po(){return this.rgb().formatRgb()}function Te(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Uc.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?mo(t):n===3?new ae(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?St(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?St(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=Qc.exec(e))?new ae(t[1],t[2],t[3],1):(t=Jc.exec(e))?new ae(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=el.exec(e))?St(t[1],t[2],t[3],t[4]):(t=tl.exec(e))?St(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=nl.exec(e))?wo(t[1],t[2]/100,t[3]/100,1):(t=ol.exec(e))?wo(t[1],t[2]/100,t[3]/100,t[4]):ho.hasOwnProperty(e)?mo(ho[e]):e==="transparent"?new ae(NaN,NaN,NaN,0):null}function mo(e){return new ae(e>>16&255,e>>8&255,e&255,1)}function St(e,t,n,o){return o<=0&&(e=t=n=NaN),new ae(e,t,n,o)}function sl(e){return e instanceof yt||(e=Te(e)),e?(e=e.rgb(),new ae(e.r,e.g,e.b,e.opacity)):new ae}function Sn(e,t,n,o){return arguments.length===1?sl(e):new ae(e,t,n,o??1)}function ae(e,t,n,o){this.r=+e,this.g=+t,this.b=+n,this.opacity=+o}On(ae,Sn,Ar(yt,{brighter(e){return e=e==null?Lt:Math.pow(Lt,e),new ae(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?ct:Math.pow(ct,e),new ae(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new ae(Pe(this.r),Pe(this.g),Pe(this.b),Ot(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:yo,formatHex:yo,formatHex8:al,formatRgb:xo,toString:xo}));function yo(){return`#${$e(this.r)}${$e(this.g)}${$e(this.b)}`}function al(){return`#${$e(this.r)}${$e(this.g)}${$e(this.b)}${$e((isNaN(this.opacity)?1:this.opacity)*255)}`}function xo(){const e=Ot(this.opacity);return`${e===1?"rgb(":"rgba("}${Pe(this.r)}, ${Pe(this.g)}, ${Pe(this.b)}${e===1?")":`, ${e})`}`}function Ot(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Pe(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function $e(e){return e=Pe(e),(e<16?"0":"")+e.toString(16)}function wo(e,t,n,o){return o<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new fe(e,t,n,o)}function $r(e){if(e instanceof fe)return new fe(e.h,e.s,e.l,e.opacity);if(e instanceof yt||(e=Te(e)),!e)return new fe;if(e instanceof fe)return e;e=e.rgb();var t=e.r/255,n=e.g/255,o=e.b/255,r=Math.min(t,n,o),i=Math.max(t,n,o),s=NaN,a=i-r,l=(i+r)/2;return a?(t===i?s=(n-o)/a+(n<o)*6:n===i?s=(o-t)/a+2:s=(t-n)/a+4,a/=l<.5?i+r:2-i-r,s*=60):a=l>0&&l<1?0:s,new fe(s,a,l,e.opacity)}function cl(e,t,n,o){return arguments.length===1?$r(e):new fe(e,t,n,o??1)}function fe(e,t,n,o){this.h=+e,this.s=+t,this.l=+n,this.opacity=+o}On(fe,cl,Ar(yt,{brighter(e){return e=e==null?Lt:Math.pow(Lt,e),new fe(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?ct:Math.pow(ct,e),new fe(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,o=n+(n<.5?n:1-n)*t,r=2*n-o;return new ae(fn(e>=240?e-240:e+120,r,o),fn(e,r,o),fn(e<120?e+240:e-120,r,o),this.opacity)},clamp(){return new fe(vo(this.h),Nt(this.s),Nt(this.l),Ot(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Ot(this.opacity);return`${e===1?"hsl(":"hsla("}${vo(this.h)}, ${Nt(this.s)*100}%, ${Nt(this.l)*100}%${e===1?")":`, ${e})`}`}}));function vo(e){return e=(e||0)%360,e<0?e+360:e}function Nt(e){return Math.max(0,Math.min(1,e||0))}function fn(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const Vn=e=>()=>e;function ll(e,t){return function(n){return e+n*t}}function ul(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(o){return Math.pow(e+o*t,n)}}function dl(e){return(e=+e)==1?Pr:function(t,n){return n-t?ul(t,n,e):Vn(isNaN(t)?n:t)}}function Pr(e,t){var n=t-e;return n?ll(e,n):Vn(isNaN(e)?t:e)}const Vt=(function e(t){var n=dl(t);function o(r,i){var s=n((r=Sn(r)).r,(i=Sn(i)).r),a=n(r.g,i.g),l=n(r.b,i.b),c=Pr(r.opacity,i.opacity);return function(u){return r.r=s(u),r.g=a(u),r.b=l(u),r.opacity=c(u),r+""}}return o.gamma=e,o})(1);function fl(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,o=t.slice(),r;return function(i){for(r=0;r<n;++r)o[r]=e[r]*(1-i)+t[r]*i;return o}}function hl(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function gl(e,t){var n=t?t.length:0,o=e?Math.min(n,e.length):0,r=new Array(o),i=new Array(n),s;for(s=0;s<o;++s)r[s]=it(e[s],t[s]);for(;s<n;++s)i[s]=t[s];return function(a){for(s=0;s<o;++s)i[s]=r[s](a);return i}}function pl(e,t){var n=new Date;return e=+e,t=+t,function(o){return n.setTime(e*(1-o)+t*o),n}}function me(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function ml(e,t){var n={},o={},r;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(r in t)r in e?n[r]=it(e[r],t[r]):o[r]=t[r];return function(i){for(r in n)o[r]=n[r](i);return o}}var Nn=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,hn=new RegExp(Nn.source,"g");function yl(e){return function(){return e}}function xl(e){return function(t){return e(t)+""}}function Dr(e,t){var n=Nn.lastIndex=hn.lastIndex=0,o,r,i,s=-1,a=[],l=[];for(e=e+"",t=t+"";(o=Nn.exec(e))&&(r=hn.exec(t));)(i=r.index)>n&&(i=t.slice(n,i),a[s]?a[s]+=i:a[++s]=i),(o=o[0])===(r=r[0])?a[s]?a[s]+=r:a[++s]=r:(a[++s]=null,l.push({i:s,x:me(o,r)})),n=hn.lastIndex;return n<t.length&&(i=t.slice(n),a[s]?a[s]+=i:a[++s]=i),a.length<2?l[0]?xl(l[0].x):yl(t):(t=l.length,function(c){for(var u=0,d;u<t;++u)a[(d=l[u]).i]=d.x(c);return a.join("")})}function it(e,t){var n=typeof t,o;return t==null||n==="boolean"?Vn(t):(n==="number"?me:n==="string"?(o=Te(t))?(t=o,Vt):Dr:t instanceof Te?Vt:t instanceof Date?pl:hl(t)?fl:Array.isArray(t)?gl:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?ml:me)(e,t)}var bo=180/Math.PI,Cn={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Tr(e,t,n,o,r,i){var s,a,l;return(s=Math.sqrt(e*e+t*t))&&(e/=s,t/=s),(l=e*n+t*o)&&(n-=e*l,o-=t*l),(a=Math.sqrt(n*n+o*o))&&(n/=a,o/=a,l/=a),e*o<t*n&&(e=-e,t=-t,l=-l,s=-s),{translateX:r,translateY:i,rotate:Math.atan2(t,e)*bo,skewX:Math.atan(l)*bo,scaleX:s,scaleY:a}}var Ct;function wl(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Cn:Tr(t.a,t.b,t.c,t.d,t.e,t.f)}function vl(e){return e==null||(Ct||(Ct=document.createElementNS("http://www.w3.org/2000/svg","g")),Ct.setAttribute("transform",e),!(e=Ct.transform.baseVal.consolidate()))?Cn:(e=e.matrix,Tr(e.a,e.b,e.c,e.d,e.e,e.f))}function zr(e,t,n,o){function r(c){return c.length?c.pop()+" ":""}function i(c,u,d,f,p,g){if(c!==d||u!==f){var w=p.push("translate(",null,t,null,n);g.push({i:w-4,x:me(c,d)},{i:w-2,x:me(u,f)})}else(d||f)&&p.push("translate("+d+t+f+n)}function s(c,u,d,f){c!==u?(c-u>180?u+=360:u-c>180&&(c+=360),f.push({i:d.push(r(d)+"rotate(",null,o)-2,x:me(c,u)})):u&&d.push(r(d)+"rotate("+u+o)}function a(c,u,d,f){c!==u?f.push({i:d.push(r(d)+"skewX(",null,o)-2,x:me(c,u)}):u&&d.push(r(d)+"skewX("+u+o)}function l(c,u,d,f,p,g){if(c!==d||u!==f){var w=p.push(r(p)+"scale(",null,",",null,")");g.push({i:w-4,x:me(c,d)},{i:w-2,x:me(u,f)})}else(d!==1||f!==1)&&p.push(r(p)+"scale("+d+","+f+")")}return function(c,u){var d=[],f=[];return c=e(c),u=e(u),i(c.translateX,c.translateY,u.translateX,u.translateY,d,f),s(c.rotate,u.rotate,d,f),a(c.skewX,u.skewX,d,f),l(c.scaleX,c.scaleY,u.scaleX,u.scaleY,d,f),c=u=null,function(p){for(var g=-1,w=f.length,x;++g<w;)d[(x=f[g]).i]=x.x(p);return d.join("")}}}var bl=zr(wl,"px, ","px)","deg)"),_l=zr(vl,", ",")",")"),El=1e-12;function _o(e){return((e=Math.exp(e))+1/e)/2}function Sl(e){return((e=Math.exp(e))-1/e)/2}function Nl(e){return((e=Math.exp(2*e))-1)/(e+1)}const Dt=(function e(t,n,o){function r(i,s){var a=i[0],l=i[1],c=i[2],u=s[0],d=s[1],f=s[2],p=u-a,g=d-l,w=p*p+g*g,x,m;if(w<El)m=Math.log(f/c)/t,x=function(C){return[a+C*p,l+C*g,c*Math.exp(t*C*m)]};else{var _=Math.sqrt(w),h=(f*f-c*c+o*w)/(2*c*n*_),y=(f*f-c*c-o*w)/(2*f*n*_),S=Math.log(Math.sqrt(h*h+1)-h),b=Math.log(Math.sqrt(y*y+1)-y);m=(b-S)/t,x=function(C){var A=C*m,$=_o(S),V=c/(n*_)*($*Nl(t*A+S)-Sl(S));return[a+V*p,l+V*g,c*$/_o(t*A+S)]}}return x.duration=m*1e3*t/Math.SQRT2,x}return r.rho=function(i){var s=Math.max(.001,+i),a=s*s,l=a*a;return e(s,a,l)},r})(Math.SQRT2,2,4);var Ye=0,ot=0,tt=0,Hr=1e3,Bt,rt,Ft=0,ze=0,Ut=0,ut=typeof performance=="object"&&performance.now?performance:Date,Rr=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Bn(){return ze||(Rr(Cl),ze=ut.now()+Ut)}function Cl(){ze=0}function jt(){this._call=this._time=this._next=null}jt.prototype=Lr.prototype={constructor:jt,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?Bn():+n)+(t==null?0:+t),!this._next&&rt!==this&&(rt?rt._next=this:Bt=this,rt=this),this._call=e,this._time=n,Mn()},stop:function(){this._call&&(this._call=null,this._time=1/0,Mn())}};function Lr(e,t,n){var o=new jt;return o.restart(e,t,n),o}function Ml(){Bn(),++Ye;for(var e=Bt,t;e;)(t=ze-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Ye}function Eo(){ze=(Ft=ut.now())+Ut,Ye=ot=0;try{Ml()}finally{Ye=0,kl(),ze=0}}function Il(){var e=ut.now(),t=e-Ft;t>Hr&&(Ut-=t,Ft=e)}function kl(){for(var e,t=Bt,n,o=1/0;t;)t._call?(o>t._time&&(o=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:Bt=n);rt=e,Mn(o)}function Mn(e){if(!Ye){ot&&(ot=clearTimeout(ot));var t=e-ze;t>24?(e<1/0&&(ot=setTimeout(Eo,e-ut.now()-Ut)),tt&&(tt=clearInterval(tt))):(tt||(Ft=ut.now(),tt=setInterval(Il,Hr)),Ye=1,Rr(Eo))}}function So(e,t,n){var o=new jt;return t=t==null?0:+t,o.restart(r=>{o.stop(),e(r+t)},t,n),o}var Al=Gt("start","end","cancel","interrupt"),$l=[],Or=0,No=1,In=2,Tt=3,Co=4,kn=5,zt=6;function Qt(e,t,n,o,r,i){var s=e.__transition;if(!s)e.__transition={};else if(n in s)return;Pl(e,n,{name:t,index:o,group:r,on:Al,tween:$l,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:Or})}function Fn(e,t){var n=pe(e,t);if(n.state>Or)throw new Error("too late; already scheduled");return n}function xe(e,t){var n=pe(e,t);if(n.state>Tt)throw new Error("too late; already running");return n}function pe(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function Pl(e,t,n){var o=e.__transition,r;o[t]=n,n.timer=Lr(i,0,n.time);function i(c){n.state=No,n.timer.restart(s,n.delay,n.time),n.delay<=c&&s(c-n.delay)}function s(c){var u,d,f,p;if(n.state!==No)return l();for(u in o)if(p=o[u],p.name===n.name){if(p.state===Tt)return So(s);p.state===Co?(p.state=zt,p.timer.stop(),p.on.call("interrupt",e,e.__data__,p.index,p.group),delete o[u]):+u<t&&(p.state=zt,p.timer.stop(),p.on.call("cancel",e,e.__data__,p.index,p.group),delete o[u])}if(So(function(){n.state===Tt&&(n.state=Co,n.timer.restart(a,n.delay,n.time),a(c))}),n.state=In,n.on.call("start",e,e.__data__,n.index,n.group),n.state===In){for(n.state=Tt,r=new Array(f=n.tween.length),u=0,d=-1;u<f;++u)(p=n.tween[u].value.call(e,e.__data__,n.index,n.group))&&(r[++d]=p);r.length=d+1}}function a(c){for(var u=c<n.duration?n.ease.call(null,c/n.duration):(n.timer.restart(l),n.state=kn,1),d=-1,f=r.length;++d<f;)r[d].call(e,u);n.state===kn&&(n.on.call("end",e,e.__data__,n.index,n.group),l())}function l(){n.state=zt,n.timer.stop(),delete o[t];for(var c in o)return;delete e.__transition}}function Ht(e,t){var n=e.__transition,o,r,i=!0,s;if(n){t=t==null?null:t+"";for(s in n){if((o=n[s]).name!==t){i=!1;continue}r=o.state>In&&o.state<kn,o.state=zt,o.timer.stop(),o.on.call(r?"interrupt":"cancel",e,e.__data__,o.index,o.group),delete n[s]}i&&delete e.__transition}}function Dl(e){return this.each(function(){Ht(this,e)})}function Tl(e,t){var n,o;return function(){var r=xe(this,e),i=r.tween;if(i!==n){o=n=i;for(var s=0,a=o.length;s<a;++s)if(o[s].name===t){o=o.slice(),o.splice(s,1);break}}r.tween=o}}function zl(e,t,n){var o,r;if(typeof n!="function")throw new Error;return function(){var i=xe(this,e),s=i.tween;if(s!==o){r=(o=s).slice();for(var a={name:t,value:n},l=0,c=r.length;l<c;++l)if(r[l].name===t){r[l]=a;break}l===c&&r.push(a)}i.tween=r}}function Hl(e,t){var n=this._id;if(e+="",arguments.length<2){for(var o=pe(this.node(),n).tween,r=0,i=o.length,s;r<i;++r)if((s=o[r]).name===e)return s.value;return null}return this.each((t==null?Tl:zl)(n,e,t))}function jn(e,t,n){var o=e._id;return e.each(function(){var r=xe(this,o);(r.value||(r.value={}))[t]=n.apply(this,arguments)}),function(r){return pe(r,o).value[t]}}function Vr(e,t){var n;return(typeof t=="number"?me:t instanceof Te?Vt:(n=Te(t))?(t=n,Vt):Dr)(e,t)}function Rl(e){return function(){this.removeAttribute(e)}}function Ll(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Ol(e,t,n){var o,r=n+"",i;return function(){var s=this.getAttribute(e);return s===r?null:s===o?i:i=t(o=s,n)}}function Vl(e,t,n){var o,r=n+"",i;return function(){var s=this.getAttributeNS(e.space,e.local);return s===r?null:s===o?i:i=t(o=s,n)}}function Bl(e,t,n){var o,r,i;return function(){var s,a=n(this),l;return a==null?void this.removeAttribute(e):(s=this.getAttribute(e),l=a+"",s===l?null:s===o&&l===r?i:(r=l,i=t(o=s,a)))}}function Fl(e,t,n){var o,r,i;return function(){var s,a=n(this),l;return a==null?void this.removeAttributeNS(e.space,e.local):(s=this.getAttributeNS(e.space,e.local),l=a+"",s===l?null:s===o&&l===r?i:(r=l,i=t(o=s,a)))}}function jl(e,t){var n=Kt(e),o=n==="transform"?_l:Vr;return this.attrTween(e,typeof t=="function"?(n.local?Fl:Bl)(n,o,jn(this,"attr."+e,t)):t==null?(n.local?Ll:Rl)(n):(n.local?Vl:Ol)(n,o,t))}function Xl(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function Yl(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function Zl(e,t){var n,o;function r(){var i=t.apply(this,arguments);return i!==o&&(n=(o=i)&&Yl(e,i)),n}return r._value=t,r}function Wl(e,t){var n,o;function r(){var i=t.apply(this,arguments);return i!==o&&(n=(o=i)&&Xl(e,i)),n}return r._value=t,r}function ql(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var o=Kt(e);return this.tween(n,(o.local?Zl:Wl)(o,t))}function Gl(e,t){return function(){Fn(this,e).delay=+t.apply(this,arguments)}}function Kl(e,t){return t=+t,function(){Fn(this,e).delay=t}}function Ul(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Gl:Kl)(t,e)):pe(this.node(),t).delay}function Ql(e,t){return function(){xe(this,e).duration=+t.apply(this,arguments)}}function Jl(e,t){return t=+t,function(){xe(this,e).duration=t}}function eu(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Ql:Jl)(t,e)):pe(this.node(),t).duration}function tu(e,t){if(typeof t!="function")throw new Error;return function(){xe(this,e).ease=t}}function nu(e){var t=this._id;return arguments.length?this.each(tu(t,e)):pe(this.node(),t).ease}function ou(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;xe(this,e).ease=n}}function ru(e){if(typeof e!="function")throw new Error;return this.each(ou(this._id,e))}function iu(e){typeof e!="function"&&(e=yr(e));for(var t=this._groups,n=t.length,o=new Array(n),r=0;r<n;++r)for(var i=t[r],s=i.length,a=o[r]=[],l,c=0;c<s;++c)(l=i[c])&&e.call(l,l.__data__,c,i)&&a.push(l);return new _e(o,this._parents,this._name,this._id)}function su(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,o=t.length,r=n.length,i=Math.min(o,r),s=new Array(o),a=0;a<i;++a)for(var l=t[a],c=n[a],u=l.length,d=s[a]=new Array(u),f,p=0;p<u;++p)(f=l[p]||c[p])&&(d[p]=f);for(;a<o;++a)s[a]=t[a];return new _e(s,this._parents,this._name,this._id)}function au(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function cu(e,t,n){var o,r,i=au(t)?Fn:xe;return function(){var s=i(this,e),a=s.on;a!==o&&(r=(o=a).copy()).on(t,n),s.on=r}}function lu(e,t){var n=this._id;return arguments.length<2?pe(this.node(),n).on.on(e):this.each(cu(n,e,t))}function uu(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function du(){return this.on("end.remove",uu(this._id))}function fu(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Rn(e));for(var o=this._groups,r=o.length,i=new Array(r),s=0;s<r;++s)for(var a=o[s],l=a.length,c=i[s]=new Array(l),u,d,f=0;f<l;++f)(u=a[f])&&(d=e.call(u,u.__data__,f,a))&&("__data__"in u&&(d.__data__=u.__data__),c[f]=d,Qt(c[f],t,n,f,c,pe(u,n)));return new _e(i,this._parents,t,n)}function hu(e){var t=this._name,n=this._id;typeof e!="function"&&(e=mr(e));for(var o=this._groups,r=o.length,i=[],s=[],a=0;a<r;++a)for(var l=o[a],c=l.length,u,d=0;d<c;++d)if(u=l[d]){for(var f=e.call(u,u.__data__,d,l),p,g=pe(u,n),w=0,x=f.length;w<x;++w)(p=f[w])&&Qt(p,t,n,w,f,g);i.push(f),s.push(u)}return new _e(i,s,t,n)}var gu=mt.prototype.constructor;function pu(){return new gu(this._groups,this._parents)}function mu(e,t){var n,o,r;return function(){var i=Xe(this,e),s=(this.style.removeProperty(e),Xe(this,e));return i===s?null:i===n&&s===o?r:r=t(n=i,o=s)}}function Br(e){return function(){this.style.removeProperty(e)}}function yu(e,t,n){var o,r=n+"",i;return function(){var s=Xe(this,e);return s===r?null:s===o?i:i=t(o=s,n)}}function xu(e,t,n){var o,r,i;return function(){var s=Xe(this,e),a=n(this),l=a+"";return a==null&&(l=a=(this.style.removeProperty(e),Xe(this,e))),s===l?null:s===o&&l===r?i:(r=l,i=t(o=s,a))}}function wu(e,t){var n,o,r,i="style."+t,s="end."+i,a;return function(){var l=xe(this,e),c=l.on,u=l.value[i]==null?a||(a=Br(t)):void 0;(c!==n||r!==u)&&(o=(n=c).copy()).on(s,r=u),l.on=o}}function vu(e,t,n){var o=(e+="")=="transform"?bl:Vr;return t==null?this.styleTween(e,mu(e,o)).on("end.style."+e,Br(e)):typeof t=="function"?this.styleTween(e,xu(e,o,jn(this,"style."+e,t))).each(wu(this._id,e)):this.styleTween(e,yu(e,o,t),n).on("end.style."+e,null)}function bu(e,t,n){return function(o){this.style.setProperty(e,t.call(this,o),n)}}function _u(e,t,n){var o,r;function i(){var s=t.apply(this,arguments);return s!==r&&(o=(r=s)&&bu(e,s,n)),o}return i._value=t,i}function Eu(e,t,n){var o="style."+(e+="");if(arguments.length<2)return(o=this.tween(o))&&o._value;if(t==null)return this.tween(o,null);if(typeof t!="function")throw new Error;return this.tween(o,_u(e,t,n??""))}function Su(e){return function(){this.textContent=e}}function Nu(e){return function(){var t=e(this);this.textContent=t??""}}function Cu(e){return this.tween("text",typeof e=="function"?Nu(jn(this,"text",e)):Su(e==null?"":e+""))}function Mu(e){return function(t){this.textContent=e.call(this,t)}}function Iu(e){var t,n;function o(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&Mu(r)),t}return o._value=e,o}function ku(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,Iu(e))}function Au(){for(var e=this._name,t=this._id,n=Fr(),o=this._groups,r=o.length,i=0;i<r;++i)for(var s=o[i],a=s.length,l,c=0;c<a;++c)if(l=s[c]){var u=pe(l,t);Qt(l,e,n,c,s,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new _e(o,this._parents,e,n)}function $u(){var e,t,n=this,o=n._id,r=n.size();return new Promise(function(i,s){var a={value:s},l={value:function(){--r===0&&i()}};n.each(function(){var c=xe(this,o),u=c.on;u!==e&&(t=(e=u).copy(),t._.cancel.push(a),t._.interrupt.push(a),t._.end.push(l)),c.on=t}),r===0&&i()})}var Pu=0;function _e(e,t,n,o){this._groups=e,this._parents=t,this._name=n,this._id=o}function Fr(){return++Pu}var ve=mt.prototype;_e.prototype={constructor:_e,select:fu,selectAll:hu,selectChild:ve.selectChild,selectChildren:ve.selectChildren,filter:iu,merge:su,selection:pu,transition:Au,call:ve.call,nodes:ve.nodes,node:ve.node,size:ve.size,empty:ve.empty,each:ve.each,on:lu,attr:jl,attrTween:ql,style:vu,styleTween:Eu,text:Cu,textTween:ku,remove:du,tween:Hl,delay:Ul,duration:eu,ease:nu,easeVarying:ru,end:$u,[Symbol.iterator]:ve[Symbol.iterator]};function Du(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var Tu={time:null,delay:0,duration:250,ease:Du};function zu(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function Hu(e){var t,n;e instanceof _e?(t=e._id,e=e._name):(t=Fr(),(n=Tu).time=Bn(),e=e==null?null:e+"");for(var o=this._groups,r=o.length,i=0;i<r;++i)for(var s=o[i],a=s.length,l,c=0;c<a;++c)(l=s[c])&&Qt(l,e,t,c,s,n||zu(l,t));return new _e(o,this._parents,e,t)}mt.prototype.interrupt=Dl;mt.prototype.transition=Hu;const Mt=e=>()=>e;function Ru(e,{sourceEvent:t,target:n,transform:o,dispatch:r}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:o,enumerable:!0,configurable:!0},_:{value:r}})}function be(e,t,n){this.k=e,this.x=t,this.y=n}be.prototype={constructor:be,scale:function(e){return e===1?this:new be(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new be(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Jt=new be(1,0,0);jr.prototype=be.prototype;function jr(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Jt;return e.__zoom}function gn(e){e.stopImmediatePropagation()}function nt(e){e.preventDefault(),e.stopImmediatePropagation()}function Lu(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function Ou(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function Mo(){return this.__zoom||Jt}function Vu(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function Bu(){return navigator.maxTouchPoints||"ontouchstart"in this}function Fu(e,t,n){var o=e.invertX(t[0][0])-n[0][0],r=e.invertX(t[1][0])-n[1][0],i=e.invertY(t[0][1])-n[0][1],s=e.invertY(t[1][1])-n[1][1];return e.translate(r>o?(o+r)/2:Math.min(0,o)||Math.max(0,r),s>i?(i+s)/2:Math.min(0,i)||Math.max(0,s))}function Xr(){var e=Lu,t=Ou,n=Fu,o=Vu,r=Bu,i=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],a=250,l=Dt,c=Gt("start","zoom","end"),u,d,f,p=500,g=150,w=0,x=10;function m(v){v.property("__zoom",Mo).on("wheel.zoom",A,{passive:!1}).on("mousedown.zoom",$).on("dblclick.zoom",V).filter(r).on("touchstart.zoom",k).on("touchmove.zoom",z).on("touchend.zoom touchcancel.zoom",O).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}m.transform=function(v,N,E,I){var M=v.selection?v.selection():v;M.property("__zoom",Mo),v!==M?S(v,N,E,I):M.interrupt().each(function(){b(this,arguments).event(I).start().zoom(null,typeof N=="function"?N.apply(this,arguments):N).end()})},m.scaleBy=function(v,N,E,I){m.scaleTo(v,function(){var M=this.__zoom.k,D=typeof N=="function"?N.apply(this,arguments):N;return M*D},E,I)},m.scaleTo=function(v,N,E,I){m.transform(v,function(){var M=t.apply(this,arguments),D=this.__zoom,H=E==null?y(M):typeof E=="function"?E.apply(this,arguments):E,L=D.invert(H),R=typeof N=="function"?N.apply(this,arguments):N;return n(h(_(D,R),H,L),M,s)},E,I)},m.translateBy=function(v,N,E,I){m.transform(v,function(){return n(this.__zoom.translate(typeof N=="function"?N.apply(this,arguments):N,typeof E=="function"?E.apply(this,arguments):E),t.apply(this,arguments),s)},null,I)},m.translateTo=function(v,N,E,I,M){m.transform(v,function(){var D=t.apply(this,arguments),H=this.__zoom,L=I==null?y(D):typeof I=="function"?I.apply(this,arguments):I;return n(Jt.translate(L[0],L[1]).scale(H.k).translate(typeof N=="function"?-N.apply(this,arguments):-N,typeof E=="function"?-E.apply(this,arguments):-E),D,s)},I,M)};function _(v,N){return N=Math.max(i[0],Math.min(i[1],N)),N===v.k?v:new be(N,v.x,v.y)}function h(v,N,E){var I=N[0]-E[0]*v.k,M=N[1]-E[1]*v.k;return I===v.x&&M===v.y?v:new be(v.k,I,M)}function y(v){return[(+v[0][0]+ +v[1][0])/2,(+v[0][1]+ +v[1][1])/2]}function S(v,N,E,I){v.on("start.zoom",function(){b(this,arguments).event(I).start()}).on("interrupt.zoom end.zoom",function(){b(this,arguments).event(I).end()}).tween("zoom",function(){var M=this,D=arguments,H=b(M,D).event(I),L=t.apply(M,D),R=E==null?y(L):typeof E=="function"?E.apply(M,D):E,j=Math.max(L[1][0]-L[0][0],L[1][1]-L[0][1]),F=M.__zoom,W=typeof N=="function"?N.apply(M,D):N,K=l(F.invert(R).concat(j/F.k),W.invert(R).concat(j/W.k));return function(Z){if(Z===1)Z=W;else{var B=K(Z),X=j/B[2];Z=new be(X,R[0]-B[0]*X,R[1]-B[1]*X)}H.zoom(null,Z)}})}function b(v,N,E){return!E&&v.__zooming||new C(v,N)}function C(v,N){this.that=v,this.args=N,this.active=0,this.sourceEvent=null,this.extent=t.apply(v,N),this.taps=0}C.prototype={event:function(v){return v&&(this.sourceEvent=v),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(v,N){return this.mouse&&v!=="mouse"&&(this.mouse[1]=N.invert(this.mouse[0])),this.touch0&&v!=="touch"&&(this.touch0[1]=N.invert(this.touch0[0])),this.touch1&&v!=="touch"&&(this.touch1[1]=N.invert(this.touch1[0])),this.that.__zoom=N,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(v){var N=ce(this.that).datum();c.call(v,this.that,new Ru(v,{sourceEvent:this.sourceEvent,target:m,transform:this.that.__zoom,dispatch:c}),N)}};function A(v,...N){if(!e.apply(this,arguments))return;var E=b(this,N).event(v),I=this.__zoom,M=Math.max(i[0],Math.min(i[1],I.k*Math.pow(2,o.apply(this,arguments)))),D=de(v);if(E.wheel)(E.mouse[0][0]!==D[0]||E.mouse[0][1]!==D[1])&&(E.mouse[1]=I.invert(E.mouse[0]=D)),clearTimeout(E.wheel);else{if(I.k===M)return;E.mouse=[D,I.invert(D)],Ht(this),E.start()}nt(v),E.wheel=setTimeout(H,g),E.zoom("mouse",n(h(_(I,M),E.mouse[0],E.mouse[1]),E.extent,s));function H(){E.wheel=null,E.end()}}function $(v,...N){if(f||!e.apply(this,arguments))return;var E=v.currentTarget,I=b(this,N,!0).event(v),M=ce(v.view).on("mousemove.zoom",R,!0).on("mouseup.zoom",j,!0),D=de(v,E),H=v.clientX,L=v.clientY;Mr(v.view),gn(v),I.mouse=[D,this.__zoom.invert(D)],Ht(this),I.start();function R(F){if(nt(F),!I.moved){var W=F.clientX-H,K=F.clientY-L;I.moved=W*W+K*K>w}I.event(F).zoom("mouse",n(h(I.that.__zoom,I.mouse[0]=de(F,E),I.mouse[1]),I.extent,s))}function j(F){M.on("mousemove.zoom mouseup.zoom",null),Ir(F.view,I.moved),nt(F),I.event(F).end()}}function V(v,...N){if(e.apply(this,arguments)){var E=this.__zoom,I=de(v.changedTouches?v.changedTouches[0]:v,this),M=E.invert(I),D=E.k*(v.shiftKey?.5:2),H=n(h(_(E,D),I,M),t.apply(this,N),s);nt(v),a>0?ce(this).transition().duration(a).call(S,H,I,v):ce(this).call(m.transform,H,I,v)}}function k(v,...N){if(e.apply(this,arguments)){var E=v.touches,I=E.length,M=b(this,N,v.changedTouches.length===I).event(v),D,H,L,R;for(gn(v),H=0;H<I;++H)L=E[H],R=de(L,this),R=[R,this.__zoom.invert(R),L.identifier],M.touch0?!M.touch1&&M.touch0[2]!==R[2]&&(M.touch1=R,M.taps=0):(M.touch0=R,D=!0,M.taps=1+!!u);u&&(u=clearTimeout(u)),D&&(M.taps<2&&(d=R[0],u=setTimeout(function(){u=null},p)),Ht(this),M.start())}}function z(v,...N){if(this.__zooming){var E=b(this,N).event(v),I=v.changedTouches,M=I.length,D,H,L,R;for(nt(v),D=0;D<M;++D)H=I[D],L=de(H,this),E.touch0&&E.touch0[2]===H.identifier?E.touch0[0]=L:E.touch1&&E.touch1[2]===H.identifier&&(E.touch1[0]=L);if(H=E.that.__zoom,E.touch1){var j=E.touch0[0],F=E.touch0[1],W=E.touch1[0],K=E.touch1[1],Z=(Z=W[0]-j[0])*Z+(Z=W[1]-j[1])*Z,B=(B=K[0]-F[0])*B+(B=K[1]-F[1])*B;H=_(H,Math.sqrt(Z/B)),L=[(j[0]+W[0])/2,(j[1]+W[1])/2],R=[(F[0]+K[0])/2,(F[1]+K[1])/2]}else if(E.touch0)L=E.touch0[0],R=E.touch0[1];else return;E.zoom("touch",n(h(H,L,R),E.extent,s))}}function O(v,...N){if(this.__zooming){var E=b(this,N).event(v),I=v.changedTouches,M=I.length,D,H;for(gn(v),f&&clearTimeout(f),f=setTimeout(function(){f=null},p),D=0;D<M;++D)H=I[D],E.touch0&&E.touch0[2]===H.identifier?delete E.touch0:E.touch1&&E.touch1[2]===H.identifier&&delete E.touch1;if(E.touch1&&!E.touch0&&(E.touch0=E.touch1,delete E.touch1),E.touch0)E.touch0[1]=this.__zoom.invert(E.touch0[0]);else if(E.end(),E.taps===2&&(H=de(H,this),Math.hypot(d[0]-H[0],d[1]-H[1])<x)){var L=ce(this).on("dblclick.zoom");L&&L.apply(this,arguments)}}}return m.wheelDelta=function(v){return arguments.length?(o=typeof v=="function"?v:Mt(+v),m):o},m.filter=function(v){return arguments.length?(e=typeof v=="function"?v:Mt(!!v),m):e},m.touchable=function(v){return arguments.length?(r=typeof v=="function"?v:Mt(!!v),m):r},m.extent=function(v){return arguments.length?(t=typeof v=="function"?v:Mt([[+v[0][0],+v[0][1]],[+v[1][0],+v[1][1]]]),m):t},m.scaleExtent=function(v){return arguments.length?(i[0]=+v[0],i[1]=+v[1],m):[i[0],i[1]]},m.translateExtent=function(v){return arguments.length?(s[0][0]=+v[0][0],s[1][0]=+v[1][0],s[0][1]=+v[0][1],s[1][1]=+v[1][1],m):[[s[0][0],s[0][1]],[s[1][0],s[1][1]]]},m.constrain=function(v){return arguments.length?(n=v,m):n},m.duration=function(v){return arguments.length?(a=+v,m):a},m.interpolate=function(v){return arguments.length?(l=v,m):l},m.on=function(){var v=c.on.apply(c,arguments);return v===c?m:v},m.clickDistance=function(v){return arguments.length?(w=(v=+v)*v,m):Math.sqrt(w)},m.tapDistance=function(v){return arguments.length?(x=+v,m):x},m}const ue={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"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.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:o})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:o}", edge id: ${t}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012: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.`,error013:(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.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs."},dt=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Yr=["Enter"," ","Escape"],Zr={"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":({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"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"};var Ze;(function(e){e.Strict="strict",e.Loose="loose"})(Ze||(Ze={}));var De;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(De||(De={}));var ft;(function(e){e.Partial="partial",e.Full="full"})(ft||(ft={}));const Wr={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var Me;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Me||(Me={}));var Xt;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Xt||(Xt={}));var Y;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Y||(Y={}));const Io={[Y.Left]:Y.Right,[Y.Right]:Y.Left,[Y.Top]:Y.Bottom,[Y.Bottom]:Y.Top};function qr(e){return e===null?null:e?"valid":"invalid"}const Gr=e=>"id"in e&&"source"in e&&"target"in e,ju=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),Xn=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),xt=(e,t=[0,0])=>{const{width:n,height:o}=Ee(e),r=e.origin??t,i=n*r[0],s=o*r[1];return{x:e.position.x-i,y:e.position.y-s}},Xu=(e,t={nodeOrigin:[0,0]})=>{if(t.nodeLookup||console.warn("Please use `getNodesBounds` from `useReactFlow`/`useSvelteFlow` hook to ensure correct values for sub flows. If not possible, you have to provide a nodeLookup to support sub flows."),e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((o,r)=>{const i=typeof r=="string";let s=!t.nodeLookup&&!i?r:void 0;t.nodeLookup&&(s=i?t.nodeLookup.get(r):Xn(r)?r:t.nodeLookup.get(r.id));const a=s?Yt(s,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return en(o,a)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return tn(n)},wt=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},o=!1;return e.forEach(r=>{(t.filter===void 0||t.filter(r))&&(n=en(n,Yt(r)),o=!0)}),o?tn(n):{x:0,y:0,width:0,height:0}},Yn=(e,t,[n,o,r]=[0,0,1],i=!1,s=!1)=>{const a={...bt(t,[n,o,r]),width:t.width/r,height:t.height/r},l=[];for(const c of e.values()){const{measured:u,selectable:d=!0,hidden:f=!1}=c;if(s&&!d||f)continue;const p=u.width??c.width??c.initialWidth??null,g=u.height??c.height??c.initialHeight??null,w=ht(a,qe(c)),x=(p??0)*(g??0),m=i&&w>0;(!c.internals.handleBounds||m||w>=x||c.dragging)&&l.push(c)}return l},Yu=(e,t)=>{const n=new Set;return e.forEach(o=>{n.add(o.id)}),t.filter(o=>n.has(o.source)||n.has(o.target))};function Zu(e,t){const n=new Map,o=t?.nodes?new Set(t.nodes.map(r=>r.id)):null;return e.forEach(r=>{r.measured.width&&r.measured.height&&(t?.includeHiddenNodes||!r.hidden)&&(!o||o.has(r.id))&&n.set(r.id,r)}),n}async function Wu({nodes:e,width:t,height:n,panZoom:o,minZoom:r,maxZoom:i},s){if(e.size===0)return Promise.resolve(!0);const a=Zu(e,s),l=wt(a),c=Zn(l,t,n,s?.minZoom??r,s?.maxZoom??i,s?.padding??.1);return await o.setViewport(c,{duration:s?.duration,ease:s?.ease,interpolate:s?.interpolate}),Promise.resolve(!0)}function Kr({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:o=[0,0],nodeExtent:r,onError:i}){const s=n.get(e),a=s.parentId?n.get(s.parentId):void 0,{x:l,y:c}=a?a.internals.positionAbsolute:{x:0,y:0},u=s.origin??o;let d=s.extent||r;if(s.extent==="parent"&&!s.expandParent)if(!a)i?.("005",ue.error005());else{const p=a.measured.width,g=a.measured.height;p&&g&&(d=[[l,c],[l+p,c+g]])}else a&&Ge(s.extent)&&(d=[[s.extent[0][0]+l,s.extent[0][1]+c],[s.extent[1][0]+l,s.extent[1][1]+c]]);const f=Ge(d)?He(t,d,s.measured):t;return(s.measured.width===void 0||s.measured.height===void 0)&&i?.("015",ue.error015()),{position:{x:f.x-l+(s.measured.width??0)*u[0],y:f.y-c+(s.measured.height??0)*u[1]},positionAbsolute:f}}async function qu({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:o,onBeforeDelete:r}){const i=new Set(e.map(f=>f.id)),s=[];for(const f of n){if(f.deletable===!1)continue;const p=i.has(f.id),g=!p&&f.parentId&&s.find(w=>w.id===f.parentId);(p||g)&&s.push(f)}const a=new Set(t.map(f=>f.id)),l=o.filter(f=>f.deletable!==!1),u=Yu(s,l);for(const f of l)a.has(f.id)&&!u.find(g=>g.id===f.id)&&u.push(f);if(!r)return{edges:u,nodes:s};const d=await r({nodes:s,edges:u});return typeof d=="boolean"?d?{edges:u,nodes:s}:{edges:[],nodes:[]}:d}const We=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),He=(e={x:0,y:0},t,n)=>({x:We(e.x,t[0][0],t[1][0]-(n?.width??0)),y:We(e.y,t[0][1],t[1][1]-(n?.height??0))});function Ur(e,t,n){const{width:o,height:r}=Ee(n),{x:i,y:s}=n.internals.positionAbsolute;return He(e,[[i,s],[i+o,s+r]],t)}const ko=(e,t,n)=>e<t?We(Math.abs(e-t),1,t)/t:e>n?-We(Math.abs(e-n),1,t)/t:0,Qr=(e,t,n=15,o=40)=>{const r=ko(e.x,o,t.width-o)*n,i=ko(e.y,o,t.height-o)*n;return[r,i]},en=(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)}),An=({x:e,y:t,width:n,height:o})=>({x:e,y:t,x2:e+n,y2:t+o}),tn=({x:e,y:t,x2:n,y2:o})=>({x:e,y:t,width:n-e,height:o-t}),qe=(e,t=[0,0])=>{const{x:n,y:o}=Xn(e)?e.internals.positionAbsolute:xt(e,t);return{x:n,y:o,width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}},Yt=(e,t=[0,0])=>{const{x:n,y:o}=Xn(e)?e.internals.positionAbsolute:xt(e,t);return{x:n,y:o,x2:n+(e.measured?.width??e.width??e.initialWidth??0),y2:o+(e.measured?.height??e.height??e.initialHeight??0)}},Jr=(e,t)=>tn(en(An(e),An(t))),ht=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),o=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*o)},Ao=e=>he(e.width)&&he(e.height)&&he(e.x)&&he(e.y),he=e=>!isNaN(e)&&isFinite(e),ei=(e,t)=>{console.warn(`[React Flow]: ${t} Help: https://reactflow.dev/error#${e}`)},vt=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),bt=({x:e,y:t},[n,o,r],i=!1,s=[1,1])=>{const a={x:(e-n)/r,y:(t-o)/r};return i?vt(a,s):a},Zt=({x:e,y:t},[n,o,r])=>({x:e*r+n,y:t*r+o});function Oe(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(n)}if(typeof e=="string"&&e.endsWith("%")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`[React Flow] The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function Gu(e,t,n){if(typeof e=="string"||typeof e=="number"){const o=Oe(e,n),r=Oe(e,t);return{top:o,right:r,bottom:o,left:r,x:r*2,y:o*2}}if(typeof e=="object"){const o=Oe(e.top??e.y??0,n),r=Oe(e.bottom??e.y??0,n),i=Oe(e.left??e.x??0,t),s=Oe(e.right??e.x??0,t);return{top:o,right:s,bottom:r,left:i,x:i+s,y:o+r}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function Ku(e,t,n,o,r,i){const{x:s,y:a}=Zt(e,[t,n,o]),{x:l,y:c}=Zt({x:e.x+e.width,y:e.y+e.height},[t,n,o]),u=r-l,d=i-c;return{left:Math.floor(s),top:Math.floor(a),right:Math.floor(u),bottom:Math.floor(d)}}const Zn=(e,t,n,o,r,i)=>{const s=Gu(i,t,n),a=(t-s.x)/e.width,l=(n-s.y)/e.height,c=Math.min(a,l),u=We(c,o,r),d=e.x+e.width/2,f=e.y+e.height/2,p=t/2-d*u,g=n/2-f*u,w=Ku(e,p,g,u,t,n),x={left:Math.min(w.left-s.left,0),top:Math.min(w.top-s.top,0),right:Math.min(w.right-s.right,0),bottom:Math.min(w.bottom-s.bottom,0)};return{x:p-x.left+x.right,y:g-x.top+x.bottom,zoom:u}},gt=()=>typeof navigator<"u"&&navigator?.userAgent?.indexOf("Mac")>=0;function Ge(e){return e!=null&&e!=="parent"}function Ee(e){return{width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}}function ti(e){return(e.measured?.width??e.width??e.initialWidth)!==void 0&&(e.measured?.height??e.height??e.initialHeight)!==void 0}function ni(e,t={width:0,height:0},n,o,r){const i={...e},s=o.get(n);if(s){const a=s.origin||r;i.x+=s.internals.positionAbsolute.x-(t.width??0)*a[0],i.y+=s.internals.positionAbsolute.y-(t.height??0)*a[1]}return i}function $o(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function Uu(){let e,t;return{promise:new Promise((o,r)=>{e=o,t=r}),resolve:e,reject:t}}function Qu(e){return{...Zr,...e||{}}}function st(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:o,containerBounds:r}){const{x:i,y:s}=ge(e),a=bt({x:i-(r?.left??0),y:s-(r?.top??0)},o),{x:l,y:c}=n?vt(a,t):a;return{xSnapped:l,ySnapped:c,...a}}const Wn=e=>({width:e.offsetWidth,height:e.offsetHeight}),oi=e=>e?.getRootNode?.()||window?.document,Ju=["INPUT","SELECT","TEXTAREA"];function ri(e){const t=e.composedPath?.()?.[0]||e.target;return t?.nodeType!==1?!1:Ju.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const ii=e=>"clientX"in e,ge=(e,t)=>{const n=ii(e),o=n?e.clientX:e.touches?.[0].clientX,r=n?e.clientY:e.touches?.[0].clientY;return{x:o-(t?.left??0),y:r-(t?.top??0)}},Po=(e,t,n,o,r)=>{const i=t.querySelectorAll(`.${e}`);return!i||!i.length?null:Array.from(i).map(s=>{const a=s.getBoundingClientRect();return{id:s.getAttribute("data-handleid"),type:e,nodeId:r,position:s.getAttribute("data-handlepos"),x:(a.left-n.left)/o,y:(a.top-n.top)/o,...Wn(s)}})};function si({sourceX:e,sourceY:t,targetX:n,targetY:o,sourceControlX:r,sourceControlY:i,targetControlX:s,targetControlY:a}){const l=e*.125+r*.375+s*.375+n*.125,c=t*.125+i*.375+a*.375+o*.125,u=Math.abs(l-e),d=Math.abs(c-t);return[l,c,u,d]}function It(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function Do({pos:e,x1:t,y1:n,x2:o,y2:r,c:i}){switch(e){case Y.Left:return[t-It(t-o,i),n];case Y.Right:return[t+It(o-t,i),n];case Y.Top:return[t,n-It(n-r,i)];case Y.Bottom:return[t,n+It(r-n,i)]}}function ai({sourceX:e,sourceY:t,sourcePosition:n=Y.Bottom,targetX:o,targetY:r,targetPosition:i=Y.Top,curvature:s=.25}){const[a,l]=Do({pos:n,x1:e,y1:t,x2:o,y2:r,c:s}),[c,u]=Do({pos:i,x1:o,y1:r,x2:e,y2:t,c:s}),[d,f,p,g]=si({sourceX:e,sourceY:t,targetX:o,targetY:r,sourceControlX:a,sourceControlY:l,targetControlX:c,targetControlY:u});return[`M${e},${t} C${a},${l} ${c},${u} ${o},${r}`,d,f,p,g]}function ci({sourceX:e,sourceY:t,targetX:n,targetY:o}){const r=Math.abs(n-e)/2,i=n<e?n+r:n-r,s=Math.abs(o-t)/2,a=o<t?o+s:o-s;return[i,a,r,s]}function ed({sourceNode:e,targetNode:t,selected:n=!1,zIndex:o=0,elevateOnSelect:r=!1,zIndexMode:i="basic"}){if(i==="manual")return o;const s=r&&n?o+1e3:o,a=Math.max(e.parentId||r&&e.selected?e.internals.z:0,t.parentId||r&&t.selected?t.internals.z:0);return s+a}function td({sourceNode:e,targetNode:t,width:n,height:o,transform:r}){const i=en(Yt(e),Yt(t));i.x===i.x2&&(i.x2+=1),i.y===i.y2&&(i.y2+=1);const s={x:-r[0]/r[2],y:-r[1]/r[2],width:n/r[2],height:o/r[2]};return ht(s,tn(i))>0}const nd=({source:e,sourceHandle:t,target:n,targetHandle:o})=>`xy-edge__${e}${t||""}-${n}${o||""}`,od=(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)),rd=(e,t,n={})=>{if(!e.source||!e.target)return ei("006",ue.error006()),t;const o=n.getEdgeId||nd;let r;return Gr(e)?r={...e}:r={...e,id:o(e)},od(r,t)?t:(r.sourceHandle===null&&delete r.sourceHandle,r.targetHandle===null&&delete r.targetHandle,t.concat(r))};function li({sourceX:e,sourceY:t,targetX:n,targetY:o}){const[r,i,s,a]=ci({sourceX:e,sourceY:t,targetX:n,targetY:o});return[`M ${e},${t}L ${n},${o}`,r,i,s,a]}const To={[Y.Left]:{x:-1,y:0},[Y.Right]:{x:1,y:0},[Y.Top]:{x:0,y:-1},[Y.Bottom]:{x:0,y:1}},id=({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},zo=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function sd({source:e,sourcePosition:t=Y.Bottom,target:n,targetPosition:o=Y.Top,center:r,offset:i,stepPosition:s}){const a=To[t],l=To[o],c={x:e.x+a.x*i,y:e.y+a.y*i},u={x:n.x+l.x*i,y:n.y+l.y*i},d=id({source:c,sourcePosition:t,target:u}),f=d.x!==0?"x":"y",p=d[f];let g=[],w,x;const m={x:0,y:0},_={x:0,y:0},[,,h,y]=ci({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(a[f]*l[f]===-1){f==="x"?(w=r.x??c.x+(u.x-c.x)*s,x=r.y??(c.y+u.y)/2):(w=r.x??(c.x+u.x)/2,x=r.y??c.y+(u.y-c.y)*s);const A=[{x:w,y:c.y},{x:w,y:u.y}],$=[{x:c.x,y:x},{x:u.x,y:x}];a[f]===p?g=f==="x"?A:$:g=f==="x"?$:A}else{const A=[{x:c.x,y:u.y}],$=[{x:u.x,y:c.y}];if(f==="x"?g=a.x===p?$:A:g=a.y===p?A:$,t===o){const v=Math.abs(e[f]-n[f]);if(v<=i){const N=Math.min(i-1,i-v);a[f]===p?m[f]=(c[f]>e[f]?-1:1)*N:_[f]=(u[f]>n[f]?-1:1)*N}}if(t!==o){const v=f==="x"?"y":"x",N=a[f]===l[v],E=c[v]>u[v],I=c[v]<u[v];(a[f]===1&&(!N&&E||N&&I)||a[f]!==1&&(!N&&I||N&&E))&&(g=f==="x"?A:$)}const V={x:c.x+m.x,y:c.y+m.y},k={x:u.x+_.x,y:u.y+_.y},z=Math.max(Math.abs(V.x-g[0].x),Math.abs(k.x-g[0].x)),O=Math.max(Math.abs(V.y-g[0].y),Math.abs(k.y-g[0].y));z>=O?(w=(V.x+k.x)/2,x=g[0].y):(w=g[0].x,x=(V.y+k.y)/2)}const S={x:c.x+m.x,y:c.y+m.y},b={x:u.x+_.x,y:u.y+_.y};return[[e,...S.x!==g[0].x||S.y!==g[0].y?[S]:[],...g,...b.x!==g[g.length-1].x||b.y!==g[g.length-1].y?[b]:[],n],w,x,h,y]}function ad(e,t,n,o){const r=Math.min(zo(e,t)/2,zo(t,n)/2,o),{x:i,y:s}=t;if(e.x===i&&i===n.x||e.y===s&&s===n.y)return`L${i} ${s}`;if(e.y===s){const c=e.x<n.x?-1:1,u=e.y<n.y?1:-1;return`L ${i+r*c},${s}Q ${i},${s} ${i},${s+r*u}`}const a=e.x<n.x?1:-1,l=e.y<n.y?-1:1;return`L ${i},${s+r*l}Q ${i},${s} ${i+r*a},${s}`}function $n({sourceX:e,sourceY:t,sourcePosition:n=Y.Bottom,targetX:o,targetY:r,targetPosition:i=Y.Top,borderRadius:s=5,centerX:a,centerY:l,offset:c=20,stepPosition:u=.5}){const[d,f,p,g,w]=sd({source:{x:e,y:t},sourcePosition:n,target:{x:o,y:r},targetPosition:i,center:{x:a,y:l},offset:c,stepPosition:u});let x=`M${d[0].x} ${d[0].y}`;for(let m=1;m<d.length-1;m++)x+=ad(d[m-1],d[m],d[m+1],s);return x+=`L${d[d.length-1].x} ${d[d.length-1].y}`,[x,f,p,g,w]}function Ho(e){return e&&!!(e.internals.handleBounds||e.handles?.length)&&!!(e.measured.width||e.width||e.initialWidth)}function cd(e){const{sourceNode:t,targetNode:n}=e;if(!Ho(t)||!Ho(n))return null;const o=t.internals.handleBounds||Ro(t.handles),r=n.internals.handleBounds||Ro(n.handles),i=Lo(o?.source??[],e.sourceHandle),s=Lo(e.connectionMode===Ze.Strict?r?.target??[]:(r?.target??[]).concat(r?.source??[]),e.targetHandle);if(!i||!s)return e.onError?.("008",ue.error008(i?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const a=i?.position||Y.Bottom,l=s?.position||Y.Top,c=Re(t,i,a),u=Re(n,s,l);return{sourceX:c.x,sourceY:c.y,targetX:u.x,targetY:u.y,sourcePosition:a,targetPosition:l}}function Ro(e){if(!e)return null;const t=[],n=[];for(const o of e)o.width=o.width??1,o.height=o.height??1,o.type==="source"?t.push(o):o.type==="target"&&n.push(o);return{source:t,target:n}}function Re(e,t,n=Y.Left,o=!1){const r=(t?.x??0)+e.internals.positionAbsolute.x,i=(t?.y??0)+e.internals.positionAbsolute.y,{width:s,height:a}=t??Ee(e);if(o)return{x:r+s/2,y:i+a/2};switch(t?.position??n){case Y.Top:return{x:r+s/2,y:i};case Y.Right:return{x:r+s,y:i+a/2};case Y.Bottom:return{x:r+s/2,y:i+a};case Y.Left:return{x:r,y:i+a/2}}}function Lo(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function Pn(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(o=>`${o}=${e[o]}`).join("&")}`:""}function ld(e,{id:t,defaultColor:n,defaultMarkerStart:o,defaultMarkerEnd:r}){const i=new Set;return e.reduce((s,a)=>([a.markerStart||o,a.markerEnd||r].forEach(l=>{if(l&&typeof l=="object"){const c=Pn(l,t);i.has(c)||(s.push({id:c,color:l.color||n,...l}),i.add(c))}}),s),[]).sort((s,a)=>s.id.localeCompare(a.id))}const ui=1e3,ud=10,qn={nodeOrigin:[0,0],nodeExtent:dt,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},dd={...qn,checkEquality:!0};function Gn(e,t){const n={...e};for(const o in t)t[o]!==void 0&&(n[o]=t[o]);return n}function fd(e,t,n){const o=Gn(qn,n);for(const r of e.values())if(r.parentId)Un(r,e,t,o);else{const i=xt(r,o.nodeOrigin),s=Ge(r.extent)?r.extent:o.nodeExtent,a=He(i,s,Ee(r));r.internals.positionAbsolute=a}}function hd(e,t){if(!e.handles)return e.measured?t?.internals.handleBounds:void 0;const n=[],o=[];for(const r of e.handles){const i={id:r.id,width:r.width??1,height:r.height??1,nodeId:e.id,x:r.x,y:r.y,position:r.position,type:r.type};r.type==="source"?n.push(i):r.type==="target"&&o.push(i)}return{source:n,target:o}}function Kn(e){return e==="manual"}function Dn(e,t,n,o={}){const r=Gn(dd,o),i={i:0},s=new Map(t),a=r?.elevateNodesOnSelect&&!Kn(r.zIndexMode)?ui:0;let l=e.length>0,c=!1;t.clear(),n.clear();for(const u of e){let d=s.get(u.id);if(r.checkEquality&&u===d?.internals.userNode)t.set(u.id,d);else{const f=xt(u,r.nodeOrigin),p=Ge(u.extent)?u.extent:r.nodeExtent,g=He(f,p,Ee(u));d={...r.defaults,...u,measured:{width:u.measured?.width,height:u.measured?.height},internals:{positionAbsolute:g,handleBounds:hd(u,d),z:di(u,a,r.zIndexMode),userNode:u}},t.set(u.id,d)}(d.measured===void 0||d.measured.width===void 0||d.measured.height===void 0)&&!d.hidden&&(l=!1),u.parentId&&Un(d,t,n,o,i),c||=u.selected??!1}return{nodesInitialized:l,hasSelectedNodes:c}}function gd(e,t){if(!e.parentId)return;const n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function Un(e,t,n,o,r){const{elevateNodesOnSelect:i,nodeOrigin:s,nodeExtent:a,zIndexMode:l}=Gn(qn,o),c=e.parentId,u=t.get(c);if(!u){console.warn(`Parent node ${c} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}gd(e,n),r&&!u.parentId&&u.internals.rootParentIndex===void 0&&l==="auto"&&(u.internals.rootParentIndex=++r.i,u.internals.z=u.internals.z+r.i*ud),r&&u.internals.rootParentIndex!==void 0&&(r.i=u.internals.rootParentIndex);const d=i&&!Kn(l)?ui:0,{x:f,y:p,z:g}=pd(e,u,s,a,d,l),{positionAbsolute:w}=e.internals,x=f!==w.x||p!==w.y;(x||g!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:x?{x:f,y:p}:w,z:g}})}function di(e,t,n){const o=he(e.zIndex)?e.zIndex:0;return Kn(n)?o:o+(e.selected?t:0)}function pd(e,t,n,o,r,i){const{x:s,y:a}=t.internals.positionAbsolute,l=Ee(e),c=xt(e,n),u=Ge(e.extent)?He(c,e.extent,l):c;let d=He({x:s+u.x,y:a+u.y},o,l);e.extent==="parent"&&(d=Ur(d,l,t));const f=di(e,r,i),p=t.internals.z??0;return{x:d.x,y:d.y,z:p>=f?p+1:f}}function Qn(e,t,n,o=[0,0]){const r=[],i=new Map;for(const s of e){const a=t.get(s.parentId);if(!a)continue;const l=i.get(s.parentId)?.expandedRect??qe(a),c=Jr(l,s.rect);i.set(s.parentId,{expandedRect:c,parent:a})}return i.size>0&&i.forEach(({expandedRect:s,parent:a},l)=>{const c=a.internals.positionAbsolute,u=Ee(a),d=a.origin??o,f=s.x<c.x?Math.round(Math.abs(c.x-s.x)):0,p=s.y<c.y?Math.round(Math.abs(c.y-s.y)):0,g=Math.max(u.width,Math.round(s.width)),w=Math.max(u.height,Math.round(s.height)),x=(g-u.width)*d[0],m=(w-u.height)*d[1];(f>0||p>0||x||m)&&(r.push({id:l,type:"position",position:{x:a.position.x-f+x,y:a.position.y-p+m}}),n.get(l)?.forEach(_=>{e.some(h=>h.id===_.id)||r.push({id:_.id,type:"position",position:{x:_.position.x+f,y:_.position.y+p}})})),(u.width<s.width||u.height<s.height||f||p)&&r.push({id:l,type:"dimensions",setAttributes:!0,dimensions:{width:g+(f?d[0]*f-x:0),height:w+(p?d[1]*p-m:0)}})}),r}function md(e,t,n,o,r,i,s){const a=o?.querySelector(".xyflow__viewport");let l=!1;if(!a)return{changes:[],updatedInternals:l};const c=[],u=window.getComputedStyle(a),{m22:d}=new window.DOMMatrixReadOnly(u.transform),f=[];for(const p of e.values()){const g=t.get(p.id);if(!g)continue;if(g.hidden){t.set(g.id,{...g,internals:{...g.internals,handleBounds:void 0}}),l=!0;continue}const w=Wn(p.nodeElement),x=g.measured.width!==w.width||g.measured.height!==w.height;if(!!(w.width&&w.height&&(x||!g.internals.handleBounds||p.force))){const _=p.nodeElement.getBoundingClientRect(),h=Ge(g.extent)?g.extent:i;let{positionAbsolute:y}=g.internals;g.parentId&&g.extent==="parent"?y=Ur(y,w,t.get(g.parentId)):h&&(y=He(y,h,w));const S={...g,measured:w,internals:{...g.internals,positionAbsolute:y,handleBounds:{source:Po("source",p.nodeElement,_,d,g.id),target:Po("target",p.nodeElement,_,d,g.id)}}};t.set(g.id,S),g.parentId&&Un(S,t,n,{nodeOrigin:r,zIndexMode:s}),l=!0,x&&(c.push({id:g.id,type:"dimensions",dimensions:w}),g.expandParent&&g.parentId&&f.push({id:g.id,parentId:g.parentId,rect:qe(S,r)}))}}if(f.length>0){const p=Qn(f,t,n,r);c.push(...p)}return{changes:c,updatedInternals:l}}async function yd({delta:e,panZoom:t,transform:n,translateExtent:o,width:r,height:i}){if(!t||!e.x&&!e.y)return Promise.resolve(!1);const s=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[r,i]],o),a=!!s&&(s.x!==n[0]||s.y!==n[1]||s.k!==n[2]);return Promise.resolve(a)}function Oo(e,t,n,o,r,i){let s=r;const a=o.get(s)||new Map;o.set(s,a.set(n,t)),s=`${r}-${e}`;const l=o.get(s)||new Map;if(o.set(s,l.set(n,t)),i){s=`${r}-${e}-${i}`;const c=o.get(s)||new Map;o.set(s,c.set(n,t))}}function fi(e,t,n){e.clear(),t.clear();for(const o of n){const{source:r,target:i,sourceHandle:s=null,targetHandle:a=null}=o,l={edgeId:o.id,source:r,target:i,sourceHandle:s,targetHandle:a},c=`${r}-${s}--${i}-${a}`,u=`${i}-${a}--${r}-${s}`;Oo("source",l,u,e,r,s),Oo("target",l,c,e,i,a),t.set(o.id,o)}}function hi(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:hi(n,t):!1}function Vo(e,t,n){let o=e;do{if(o?.matches?.(t))return!0;if(o===n)return!1;o=o?.parentElement}while(o);return!1}function xd(e,t,n,o){const r=new Map;for(const[i,s]of e)if((s.selected||s.id===o)&&(!s.parentId||!hi(s,e))&&(s.draggable||t&&typeof s.draggable>"u")){const a=e.get(i);a&&r.set(i,{id:i,position:a.position||{x:0,y:0},distance:{x:n.x-a.internals.positionAbsolute.x,y:n.y-a.internals.positionAbsolute.y},extent:a.extent,parentId:a.parentId,origin:a.origin,expandParent:a.expandParent,internals:{positionAbsolute:a.internals.positionAbsolute||{x:0,y:0}},measured:{width:a.measured.width??0,height:a.measured.height??0}})}return r}function pn({nodeId:e,dragItems:t,nodeLookup:n,dragging:o=!0}){const r=[];for(const[s,a]of t){const l=n.get(s)?.internals.userNode;l&&r.push({...l,position:a.position,dragging:o})}if(!e)return[r[0],r];const i=n.get(e)?.internals.userNode;return[i?{...i,position:t.get(e)?.position||i.position,dragging:o}:r[0],r]}function wd({dragItems:e,snapGrid:t,x:n,y:o}){const r=e.values().next().value;if(!r)return null;const i={x:n-r.distance.x,y:o-r.distance.y},s=vt(i,t);return{x:s.x-i.x,y:s.y-i.y}}function vd({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:o,onDragStop:r}){let i={x:null,y:null},s=0,a=new Map,l=!1,c={x:0,y:0},u=null,d=!1,f=null,p=!1,g=!1,w=null;function x({noDragClassName:_,handleSelector:h,domNode:y,isSelectable:S,nodeId:b,nodeClickDistance:C=0}){f=ce(y);function A({x:z,y:O}){const{nodeLookup:v,nodeExtent:N,snapGrid:E,snapToGrid:I,nodeOrigin:M,onNodeDrag:D,onSelectionDrag:H,onError:L,updateNodePositions:R}=t();i={x:z,y:O};let j=!1;const F=a.size>1,W=F&&N?An(wt(a)):null,K=F&&I?wd({dragItems:a,snapGrid:E,x:z,y:O}):null;for(const[Z,B]of a){if(!v.has(Z))continue;let X={x:z-B.distance.x,y:O-B.distance.y};I&&(X=K?{x:Math.round(X.x+K.x),y:Math.round(X.y+K.y)}:vt(X,E));let Q=null;if(F&&N&&!B.extent&&W){const{positionAbsolute:G}=B.internals,ee=G.x-W.x+N[0][0],ne=G.x+B.measured.width-W.x2+N[1][0],te=G.y-W.y+N[0][1],se=G.y+B.measured.height-W.y2+N[1][1];Q=[[ee,te],[ne,se]]}const{position:U,positionAbsolute:q}=Kr({nodeId:Z,nextPosition:X,nodeLookup:v,nodeExtent:Q||N,nodeOrigin:M,onError:L});j=j||B.position.x!==U.x||B.position.y!==U.y,B.position=U,B.internals.positionAbsolute=q}if(g=g||j,!!j&&(R(a,!0),w&&(o||D||!b&&H))){const[Z,B]=pn({nodeId:b,dragItems:a,nodeLookup:v});o?.(w,a,Z,B),D?.(w,Z,B),b||H?.(w,B)}}async function $(){if(!u)return;const{transform:z,panBy:O,autoPanSpeed:v,autoPanOnNodeDrag:N}=t();if(!N){l=!1,cancelAnimationFrame(s);return}const[E,I]=Qr(c,u,v);(E!==0||I!==0)&&(i.x=(i.x??0)-E/z[2],i.y=(i.y??0)-I/z[2],await O({x:E,y:I})&&A(i)),s=requestAnimationFrame($)}function V(z){const{nodeLookup:O,multiSelectionActive:v,nodesDraggable:N,transform:E,snapGrid:I,snapToGrid:M,selectNodesOnDrag:D,onNodeDragStart:H,onSelectionDragStart:L,unselectNodesAndEdges:R}=t();d=!0,(!D||!S)&&!v&&b&&(O.get(b)?.selected||R()),S&&D&&b&&e?.(b);const j=st(z.sourceEvent,{transform:E,snapGrid:I,snapToGrid:M,containerBounds:u});if(i=j,a=xd(O,N,j,b),a.size>0&&(n||H||!b&&L)){const[F,W]=pn({nodeId:b,dragItems:a,nodeLookup:O});n?.(z.sourceEvent,a,F,W),H?.(z.sourceEvent,F,W),b||L?.(z.sourceEvent,W)}}const k=kr().clickDistance(C).on("start",z=>{const{domNode:O,nodeDragThreshold:v,transform:N,snapGrid:E,snapToGrid:I}=t();u=O?.getBoundingClientRect()||null,p=!1,g=!1,w=z.sourceEvent,v===0&&V(z),i=st(z.sourceEvent,{transform:N,snapGrid:E,snapToGrid:I,containerBounds:u}),c=ge(z.sourceEvent,u)}).on("drag",z=>{const{autoPanOnNodeDrag:O,transform:v,snapGrid:N,snapToGrid:E,nodeDragThreshold:I,nodeLookup:M}=t(),D=st(z.sourceEvent,{transform:v,snapGrid:N,snapToGrid:E,containerBounds:u});if(w=z.sourceEvent,(z.sourceEvent.type==="touchmove"&&z.sourceEvent.touches.length>1||b&&!M.has(b))&&(p=!0),!p){if(!l&&O&&d&&(l=!0,$()),!d){const H=ge(z.sourceEvent,u),L=H.x-c.x,R=H.y-c.y;Math.sqrt(L*L+R*R)>I&&V(z)}(i.x!==D.xSnapped||i.y!==D.ySnapped)&&a&&d&&(c=ge(z.sourceEvent,u),A(D))}}).on("end",z=>{if(!(!d||p)&&(l=!1,d=!1,cancelAnimationFrame(s),a.size>0)){const{nodeLookup:O,updateNodePositions:v,onNodeDragStop:N,onSelectionDragStop:E}=t();if(g&&(v(a,!1),g=!1),r||N||!b&&E){const[I,M]=pn({nodeId:b,dragItems:a,nodeLookup:O,dragging:!1});r?.(z.sourceEvent,a,I,M),N?.(z.sourceEvent,I,M),b||E?.(z.sourceEvent,M)}}}).filter(z=>{const O=z.target;return!z.button&&(!_||!Vo(O,`.${_}`,y))&&(!h||Vo(O,h,y))});f.call(k)}function m(){f?.on(".drag",null)}return{update:x,destroy:m}}function bd(e,t,n){const o=[],r={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const i of t.values())ht(r,qe(i))>0&&o.push(i);return o}const _d=250;function Ed(e,t,n,o){let r=[],i=1/0;const s=bd(e,n,t+_d);for(const a of s){const l=[...a.internals.handleBounds?.source??[],...a.internals.handleBounds?.target??[]];for(const c of l){if(o.nodeId===c.nodeId&&o.type===c.type&&o.id===c.id)continue;const{x:u,y:d}=Re(a,c,c.position,!0),f=Math.sqrt(Math.pow(u-e.x,2)+Math.pow(d-e.y,2));f>t||(f<i?(r=[{...c,x:u,y:d}],i=f):f===i&&r.push({...c,x:u,y:d}))}}if(!r.length)return null;if(r.length>1){const a=o.type==="source"?"target":"source";return r.find(l=>l.type===a)??r[0]}return r[0]}function gi(e,t,n,o,r,i=!1){const s=o.get(e);if(!s)return null;const a=r==="strict"?s.internals.handleBounds?.[t]:[...s.internals.handleBounds?.source??[],...s.internals.handleBounds?.target??[]],l=(n?a?.find(c=>c.id===n):a?.[0])??null;return l&&i?{...l,...Re(s,l,l.position,!0)}:l}function pi(e,t){return e||(t?.classList.contains("target")?"target":t?.classList.contains("source")?"source":null)}function Sd(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const mi=()=>!0;function Nd(e,{connectionMode:t,connectionRadius:n,handleId:o,nodeId:r,edgeUpdaterType:i,isTarget:s,domNode:a,nodeLookup:l,lib:c,autoPanOnConnect:u,flowId:d,panBy:f,cancelConnection:p,onConnectStart:g,onConnect:w,onConnectEnd:x,isValidConnection:m=mi,onReconnectEnd:_,updateConnection:h,getTransform:y,getFromHandle:S,autoPanSpeed:b,dragThreshold:C=1,handleDomNode:A}){const $=oi(e.target);let V=0,k;const{x:z,y:O}=ge(e),v=pi(i,A),N=a?.getBoundingClientRect();let E=!1;if(!N||!v)return;const I=gi(r,v,o,l,t);if(!I)return;let M=ge(e,N),D=!1,H=null,L=!1,R=null;function j(){if(!u||!N)return;const[U,q]=Qr(M,N,b);f({x:U,y:q}),V=requestAnimationFrame(j)}const F={...I,nodeId:r,type:v,position:I.position},W=l.get(r);let Z={inProgress:!0,isValid:null,from:Re(W,F,Y.Left,!0),fromHandle:F,fromPosition:F.position,fromNode:W,to:M,toHandle:null,toPosition:Io[F.position],toNode:null,pointer:M};function B(){E=!0,h(Z),g?.(e,{nodeId:r,handleId:o,handleType:v})}C===0&&B();function X(U){if(!E){const{x:se,y:Se}=ge(U),we=se-z,ke=Se-O;if(!(we*we+ke*ke>C*C))return;B()}if(!S()||!F){Q(U);return}const q=y();M=ge(U,N),k=Ed(bt(M,q,!1,[1,1]),n,l,F),D||(j(),D=!0);const G=yi(U,{handle:k,connectionMode:t,fromNodeId:r,fromHandleId:o,fromType:s?"target":"source",isValidConnection:m,doc:$,lib:c,flowId:d,nodeLookup:l});R=G.handleDomNode,H=G.connection,L=Sd(!!k,G.isValid);const ee=l.get(r),ne=ee?Re(ee,F,Y.Left,!0):Z.from,te={...Z,from:ne,isValid:L,to:G.toHandle&&L?Zt({x:G.toHandle.x,y:G.toHandle.y},q):M,toHandle:G.toHandle,toPosition:L&&G.toHandle?G.toHandle.position:Io[F.position],toNode:G.toHandle?l.get(G.toHandle.nodeId):null,pointer:M};h(te),Z=te}function Q(U){if(!("touches"in U&&U.touches.length>0)){if(E){(k||R)&&H&&L&&w?.(H);const{inProgress:q,...G}=Z,ee={...G,toPosition:Z.toHandle?Z.toPosition:null};x?.(U,ee),i&&_?.(U,ee)}p(),cancelAnimationFrame(V),D=!1,L=!1,H=null,R=null,$.removeEventListener("mousemove",X),$.removeEventListener("mouseup",Q),$.removeEventListener("touchmove",X),$.removeEventListener("touchend",Q)}}$.addEventListener("mousemove",X),$.addEventListener("mouseup",Q),$.addEventListener("touchmove",X),$.addEventListener("touchend",Q)}function yi(e,{handle:t,connectionMode:n,fromNodeId:o,fromHandleId:r,fromType:i,doc:s,lib:a,flowId:l,isValidConnection:c=mi,nodeLookup:u}){const d=i==="target",f=t?s.querySelector(`.${a}-flow__handle[data-id="${l}-${t?.nodeId}-${t?.id}-${t?.type}"]`):null,{x:p,y:g}=ge(e),w=s.elementFromPoint(p,g),x=w?.classList.contains(`${a}-flow__handle`)?w:f,m={handleDomNode:x,isValid:!1,connection:null,toHandle:null};if(x){const _=pi(void 0,x),h=x.getAttribute("data-nodeid"),y=x.getAttribute("data-handleid"),S=x.classList.contains("connectable"),b=x.classList.contains("connectableend");if(!h||!_)return m;const C={source:d?h:o,sourceHandle:d?y:r,target:d?o:h,targetHandle:d?r:y};m.connection=C;const $=S&&b&&(n===Ze.Strict?d&&_==="source"||!d&&_==="target":h!==o||y!==r);m.isValid=$&&c(C),m.toHandle=gi(h,_,y,u,n,!0)}return m}const Tn={onPointerDown:Nd,isValid:yi};function Cd({domNode:e,panZoom:t,getTransform:n,getViewScale:o}){const r=ce(e);function i({translateExtent:a,width:l,height:c,zoomStep:u=1,pannable:d=!0,zoomable:f=!0,inversePan:p=!1}){const g=h=>{if(h.sourceEvent.type!=="wheel"||!t)return;const y=n(),S=h.sourceEvent.ctrlKey&>()?10:1,b=-h.sourceEvent.deltaY*(h.sourceEvent.deltaMode===1?.05:h.sourceEvent.deltaMode?1:.002)*u,C=y[2]*Math.pow(2,b*S);t.scaleTo(C)};let w=[0,0];const x=h=>{(h.sourceEvent.type==="mousedown"||h.sourceEvent.type==="touchstart")&&(w=[h.sourceEvent.clientX??h.sourceEvent.touches[0].clientX,h.sourceEvent.clientY??h.sourceEvent.touches[0].clientY])},m=h=>{const y=n();if(h.sourceEvent.type!=="mousemove"&&h.sourceEvent.type!=="touchmove"||!t)return;const S=[h.sourceEvent.clientX??h.sourceEvent.touches[0].clientX,h.sourceEvent.clientY??h.sourceEvent.touches[0].clientY],b=[S[0]-w[0],S[1]-w[1]];w=S;const C=o()*Math.max(y[2],Math.log(y[2]))*(p?-1:1),A={x:y[0]-b[0]*C,y:y[1]-b[1]*C},$=[[0,0],[l,c]];t.setViewportConstrained({x:A.x,y:A.y,zoom:y[2]},$,a)},_=Xr().on("start",x).on("zoom",d?m:null).on("zoom.wheel",f?g:null);r.call(_,{})}function s(){r.on("zoom",null)}return{update:i,destroy:s,pointer:de}}const nn=e=>({x:e.x,y:e.y,zoom:e.k}),mn=({x:e,y:t,zoom:n})=>Jt.translate(e,t).scale(n),Ve=(e,t)=>e.target.closest(`.${t}`),xi=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),Md=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,yn=(e,t=0,n=Md,o=()=>{})=>{const r=typeof t=="number"&&t>0;return r||o(),r?e.transition().duration(t).ease(n).on("end",o):e},wi=e=>{const t=e.ctrlKey&>()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function Id({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:o,panOnScrollMode:r,panOnScrollSpeed:i,zoomOnPinch:s,onPanZoomStart:a,onPanZoom:l,onPanZoomEnd:c}){return u=>{if(Ve(u,t))return u.ctrlKey&&u.preventDefault(),!1;u.preventDefault(),u.stopImmediatePropagation();const d=n.property("__zoom").k||1;if(u.ctrlKey&&s){const x=de(u),m=wi(u),_=d*Math.pow(2,m);o.scaleTo(n,_,x,u);return}const f=u.deltaMode===1?20:1;let p=r===De.Vertical?0:u.deltaX*f,g=r===De.Horizontal?0:u.deltaY*f;!gt()&&u.shiftKey&&r!==De.Vertical&&(p=u.deltaY*f,g=0),o.translateBy(n,-(p/d)*i,-(g/d)*i,{internal:!0});const w=nn(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(l?.(u,w),e.panScrollTimeout=setTimeout(()=>{c?.(u,w),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,a?.(u,w))}}function kd({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(o,r){const i=o.type==="wheel",s=!t&&i&&!o.ctrlKey,a=Ve(o,e);if(o.ctrlKey&&i&&a&&o.preventDefault(),s||a)return null;o.preventDefault(),n.call(this,o,r)}}function Ad({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return o=>{if(o.sourceEvent?.internal)return;const r=nn(o.transform);e.mouseButton=o.sourceEvent?.button||0,e.isZoomingOrPanning=!0,e.prevViewport=r,o.sourceEvent?.type==="mousedown"&&t(!0),n&&n?.(o.sourceEvent,r)}}function $d({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:o,onPanZoom:r}){return i=>{e.usedRightMouseButton=!!(n&&xi(t,e.mouseButton??0)),i.sourceEvent?.sync||o([i.transform.x,i.transform.y,i.transform.k]),r&&!i.sourceEvent?.internal&&r?.(i.sourceEvent,nn(i.transform))}}function Pd({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:o,onPanZoomEnd:r,onPaneContextMenu:i}){return s=>{if(!s.sourceEvent?.internal&&(e.isZoomingOrPanning=!1,i&&xi(t,e.mouseButton??0)&&!e.usedRightMouseButton&&s.sourceEvent&&i(s.sourceEvent),e.usedRightMouseButton=!1,o(!1),r)){const a=nn(s.transform);e.prevViewport=a,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{r?.(s.sourceEvent,a)},n?150:0)}}}function Dd({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:o,panOnScroll:r,zoomOnDoubleClick:i,userSelectionActive:s,noWheelClassName:a,noPanClassName:l,lib:c,connectionInProgress:u}){return d=>{const f=e||t,p=n&&d.ctrlKey,g=d.type==="wheel";if(d.button===1&&d.type==="mousedown"&&(Ve(d,`${c}-flow__node`)||Ve(d,`${c}-flow__edge`)))return!0;if(!o&&!f&&!r&&!i&&!n||s||u&&!g||Ve(d,a)&&g||Ve(d,l)&&(!g||r&&g&&!e)||!n&&d.ctrlKey&&g)return!1;if(!n&&d.type==="touchstart"&&d.touches?.length>1)return d.preventDefault(),!1;if(!f&&!r&&!p&&g||!o&&(d.type==="mousedown"||d.type==="touchstart")||Array.isArray(o)&&!o.includes(d.button)&&d.type==="mousedown")return!1;const w=Array.isArray(o)&&o.includes(d.button)||!d.button||d.button<=1;return(!d.ctrlKey||g)&&w}}function Td({domNode:e,minZoom:t,maxZoom:n,translateExtent:o,viewport:r,onPanZoom:i,onPanZoomStart:s,onPanZoomEnd:a,onDraggingChange:l}){const c={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},u=e.getBoundingClientRect(),d=Xr().scaleExtent([t,n]).translateExtent(o),f=ce(e).call(d);_({x:r.x,y:r.y,zoom:We(r.zoom,t,n)},[[0,0],[u.width,u.height]],o);const p=f.on("wheel.zoom"),g=f.on("dblclick.zoom");d.wheelDelta(wi);function w(k,z){return f?new Promise(O=>{d?.interpolate(z?.interpolate==="linear"?it:Dt).transform(yn(f,z?.duration,z?.ease,()=>O(!0)),k)}):Promise.resolve(!1)}function x({noWheelClassName:k,noPanClassName:z,onPaneContextMenu:O,userSelectionActive:v,panOnScroll:N,panOnDrag:E,panOnScrollMode:I,panOnScrollSpeed:M,preventScrolling:D,zoomOnPinch:H,zoomOnScroll:L,zoomOnDoubleClick:R,zoomActivationKeyPressed:j,lib:F,onTransformChange:W,connectionInProgress:K,paneClickDistance:Z,selectionOnDrag:B}){v&&!c.isZoomingOrPanning&&m();const X=N&&!j&&!v;d.clickDistance(B?1/0:!he(Z)||Z<0?0:Z);const Q=X?Id({zoomPanValues:c,noWheelClassName:k,d3Selection:f,d3Zoom:d,panOnScrollMode:I,panOnScrollSpeed:M,zoomOnPinch:H,onPanZoomStart:s,onPanZoom:i,onPanZoomEnd:a}):kd({noWheelClassName:k,preventScrolling:D,d3ZoomHandler:p});if(f.on("wheel.zoom",Q,{passive:!1}),!v){const q=Ad({zoomPanValues:c,onDraggingChange:l,onPanZoomStart:s});d.on("start",q);const G=$d({zoomPanValues:c,panOnDrag:E,onPaneContextMenu:!!O,onPanZoom:i,onTransformChange:W});d.on("zoom",G);const ee=Pd({zoomPanValues:c,panOnDrag:E,panOnScroll:N,onPaneContextMenu:O,onPanZoomEnd:a,onDraggingChange:l});d.on("end",ee)}const U=Dd({zoomActivationKeyPressed:j,panOnDrag:E,zoomOnScroll:L,panOnScroll:N,zoomOnDoubleClick:R,zoomOnPinch:H,userSelectionActive:v,noPanClassName:z,noWheelClassName:k,lib:F,connectionInProgress:K});d.filter(U),R?f.on("dblclick.zoom",g):f.on("dblclick.zoom",null)}function m(){d.on("zoom",null)}async function _(k,z,O){const v=mn(k),N=d?.constrain()(v,z,O);return N&&await w(N),new Promise(E=>E(N))}async function h(k,z){const O=mn(k);return await w(O,z),new Promise(v=>v(O))}function y(k){if(f){const z=mn(k),O=f.property("__zoom");(O.k!==k.zoom||O.x!==k.x||O.y!==k.y)&&d?.transform(f,z,null,{sync:!0})}}function S(){const k=f?jr(f.node()):{x:0,y:0,k:1};return{x:k.x,y:k.y,zoom:k.k}}function b(k,z){return f?new Promise(O=>{d?.interpolate(z?.interpolate==="linear"?it:Dt).scaleTo(yn(f,z?.duration,z?.ease,()=>O(!0)),k)}):Promise.resolve(!1)}function C(k,z){return f?new Promise(O=>{d?.interpolate(z?.interpolate==="linear"?it:Dt).scaleBy(yn(f,z?.duration,z?.ease,()=>O(!0)),k)}):Promise.resolve(!1)}function A(k){d?.scaleExtent(k)}function $(k){d?.translateExtent(k)}function V(k){const z=!he(k)||k<0?0:k;d?.clickDistance(z)}return{update:x,destroy:m,setViewport:h,setViewportConstrained:_,getViewport:S,scaleTo:b,scaleBy:C,setScaleExtent:A,setTranslateExtent:$,syncViewport:y,setClickDistance:V}}var Ke;(function(e){e.Line="line",e.Handle="handle"})(Ke||(Ke={}));function zd({width:e,prevWidth:t,height:n,prevHeight:o,affectsX:r,affectsY:i}){const s=e-t,a=n-o,l=[s>0?1:s<0?-1:0,a>0?1:a<0?-1:0];return s&&r&&(l[0]=l[0]*-1),a&&i&&(l[1]=l[1]*-1),l}function Bo(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),o=e.includes("left"),r=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:o,affectsY:r}}function Ne(e,t){return Math.max(0,t-e)}function Ce(e,t){return Math.max(0,e-t)}function kt(e,t,n){return Math.max(0,t-e,e-n)}function Fo(e,t){return e?!t:t}function Hd(e,t,n,o,r,i,s,a){let{affectsX:l,affectsY:c}=t;const{isHorizontal:u,isVertical:d}=t,f=u&&d,{xSnapped:p,ySnapped:g}=n,{minWidth:w,maxWidth:x,minHeight:m,maxHeight:_}=o,{x:h,y,width:S,height:b,aspectRatio:C}=e;let A=Math.floor(u?p-e.pointerX:0),$=Math.floor(d?g-e.pointerY:0);const V=S+(l?-A:A),k=b+(c?-$:$),z=-i[0]*S,O=-i[1]*b;let v=kt(V,w,x),N=kt(k,m,_);if(s){let M=0,D=0;l&&A<0?M=Ne(h+A+z,s[0][0]):!l&&A>0&&(M=Ce(h+V+z,s[1][0])),c&&$<0?D=Ne(y+$+O,s[0][1]):!c&&$>0&&(D=Ce(y+k+O,s[1][1])),v=Math.max(v,M),N=Math.max(N,D)}if(a){let M=0,D=0;l&&A>0?M=Ce(h+A,a[0][0]):!l&&A<0&&(M=Ne(h+V,a[1][0])),c&&$>0?D=Ce(y+$,a[0][1]):!c&&$<0&&(D=Ne(y+k,a[1][1])),v=Math.max(v,M),N=Math.max(N,D)}if(r){if(u){const M=kt(V/C,m,_)*C;if(v=Math.max(v,M),s){let D=0;!l&&!c||l&&!c&&f?D=Ce(y+O+V/C,s[1][1])*C:D=Ne(y+O+(l?A:-A)/C,s[0][1])*C,v=Math.max(v,D)}if(a){let D=0;!l&&!c||l&&!c&&f?D=Ne(y+V/C,a[1][1])*C:D=Ce(y+(l?A:-A)/C,a[0][1])*C,v=Math.max(v,D)}}if(d){const M=kt(k*C,w,x)/C;if(N=Math.max(N,M),s){let D=0;!l&&!c||c&&!l&&f?D=Ce(h+k*C+z,s[1][0])/C:D=Ne(h+(c?$:-$)*C+z,s[0][0])/C,N=Math.max(N,D)}if(a){let D=0;!l&&!c||c&&!l&&f?D=Ne(h+k*C,a[1][0])/C:D=Ce(h+(c?$:-$)*C,a[0][0])/C,N=Math.max(N,D)}}}$=$+($<0?N:-N),A=A+(A<0?v:-v),r&&(f?V>k*C?$=(Fo(l,c)?-A:A)/C:A=(Fo(l,c)?-$:$)*C:u?($=A/C,c=l):(A=$*C,l=c));const E=l?h+A:h,I=c?y+$:y;return{width:S+(l?-A:A),height:b+(c?-$:$),x:i[0]*A*(l?-1:1)+E,y:i[1]*$*(c?-1:1)+I}}const vi={width:0,height:0,x:0,y:0},Rd={...vi,pointerX:0,pointerY:0,aspectRatio:1};function Ld(e){return[[0,0],[e.measured.width,e.measured.height]]}function Od(e,t,n){const o=t.position.x+e.position.x,r=t.position.y+e.position.y,i=e.measured.width??0,s=e.measured.height??0,a=n[0]*i,l=n[1]*s;return[[o-a,r-l],[o+i-a,r+s-l]]}function Vd({domNode:e,nodeId:t,getStoreItems:n,onChange:o,onEnd:r}){const i=ce(e);let s={controlDirection:Bo("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function a({controlPosition:c,boundaries:u,keepAspectRatio:d,resizeDirection:f,onResizeStart:p,onResize:g,onResizeEnd:w,shouldResize:x}){let m={...vi},_={...Rd};s={boundaries:u,resizeDirection:f,keepAspectRatio:d,controlDirection:Bo(c)};let h,y=null,S=[],b,C,A,$=!1;const V=kr().on("start",k=>{const{nodeLookup:z,transform:O,snapGrid:v,snapToGrid:N,nodeOrigin:E,paneDomNode:I}=n();if(h=z.get(t),!h)return;y=I?.getBoundingClientRect()??null;const{xSnapped:M,ySnapped:D}=st(k.sourceEvent,{transform:O,snapGrid:v,snapToGrid:N,containerBounds:y});m={width:h.measured.width??0,height:h.measured.height??0,x:h.position.x??0,y:h.position.y??0},_={...m,pointerX:M,pointerY:D,aspectRatio:m.width/m.height},b=void 0,h.parentId&&(h.extent==="parent"||h.expandParent)&&(b=z.get(h.parentId),C=b&&h.extent==="parent"?Ld(b):void 0),S=[],A=void 0;for(const[H,L]of z)if(L.parentId===t&&(S.push({id:H,position:{...L.position},extent:L.extent}),L.extent==="parent"||L.expandParent)){const R=Od(L,h,L.origin??E);A?A=[[Math.min(R[0][0],A[0][0]),Math.min(R[0][1],A[0][1])],[Math.max(R[1][0],A[1][0]),Math.max(R[1][1],A[1][1])]]:A=R}p?.(k,{...m})}).on("drag",k=>{const{transform:z,snapGrid:O,snapToGrid:v,nodeOrigin:N}=n(),E=st(k.sourceEvent,{transform:z,snapGrid:O,snapToGrid:v,containerBounds:y}),I=[];if(!h)return;const{x:M,y:D,width:H,height:L}=m,R={},j=h.origin??N,{width:F,height:W,x:K,y:Z}=Hd(_,s.controlDirection,E,s.boundaries,s.keepAspectRatio,j,C,A),B=F!==H,X=W!==L,Q=K!==M&&B,U=Z!==D&&X;if(!Q&&!U&&!B&&!X)return;if((Q||U||j[0]===1||j[1]===1)&&(R.x=Q?K:m.x,R.y=U?Z:m.y,m.x=R.x,m.y=R.y,S.length>0)){const ne=K-M,te=Z-D;for(const se of S)se.position={x:se.position.x-ne+j[0]*(F-H),y:se.position.y-te+j[1]*(W-L)},I.push(se)}if((B||X)&&(R.width=B&&(!s.resizeDirection||s.resizeDirection==="horizontal")?F:m.width,R.height=X&&(!s.resizeDirection||s.resizeDirection==="vertical")?W:m.height,m.width=R.width,m.height=R.height),b&&h.expandParent){const ne=j[0]*(R.width??0);R.x&&R.x<ne&&(m.x=ne,_.x=_.x-(R.x-ne));const te=j[1]*(R.height??0);R.y&&R.y<te&&(m.y=te,_.y=_.y-(R.y-te))}const q=zd({width:m.width,prevWidth:H,height:m.height,prevHeight:L,affectsX:s.controlDirection.affectsX,affectsY:s.controlDirection.affectsY}),G={...m,direction:q};x?.(k,G)!==!1&&($=!0,g?.(k,G),o(R,I))}).on("end",k=>{$&&(w?.(k,{...m}),r?.({...m}),$=!1)});i.call(V)}function l(){i.on(".drag",null)}return{update:a,destroy:l}}var xn={exports:{}},wn={},jo;function Bd(){if(jo)return wn;jo=1;/**
|
|
2
2
|
* @license React
|
|
3
3
|
* use-sync-external-store-shim/with-selector.development.js
|
|
4
4
|
*
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e}from"./index-CVYHt6Z6.js";import"./query-vendor-BqVbYexz.js";const a="temporal-panel";function s(r){return r?`${r.getFullYear()}/${String(r.getMonth()+1).padStart(2,"0")}`:"No time selected"}const d={id:"temporal-overlay",mount:()=>{},unmount:()=>{},onStateChange:()=>{},toolbarItems:r=>[{id:"temporal-toggle",label:"Temporal",title:"Toggle temporal context panel",active:r.isPanelOpen(a),order:40,onClick:()=>r.dispatchAction({type:"togglePanel",panelId:a})}],renderOverlay:r=>{const n=r.getTemporalState();if(!n?.currentTime)return null;const i=s(n.currentTime);return{id:"temporal-overlay-chip",layer:1,order:10,element:e.jsxDEV("div",{style:{position:"absolute",left:140,bottom:26,display:"inline-flex",alignItems:"center",gap:10,padding:"8px 12px",borderRadius:999,border:"1px solid rgba(255, 107, 129, 0.18)",background:"linear-gradient(135deg, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.76))",boxShadow:"0 12px 30px rgba(0, 0, 0, 0.28)",color:"#2e161a",fontSize:11,letterSpacing:"0.05em",textTransform:"uppercase",pointerEvents:"none"},children:[e.jsxDEV("span",{style:{color:"#2f7fd6",fontWeight:700},children:"Temporal"},void 0,!1,{fileName:"/Users/deepjoy/Documents/Alpha Semantic Hub/Alpha Semantic Hub Logo and Icon/explorer/src/workspaces/GraphWorkspace/plugins/temporalOverlayPlugin.tsx",lineNumber:54,columnNumber:11},void 0),e.jsxDEV("span",{children:i},void 0,!1,{fileName:"/Users/deepjoy/Documents/Alpha Semantic Hub/Alpha Semantic Hub Logo and Icon/explorer/src/workspaces/GraphWorkspace/plugins/temporalOverlayPlugin.tsx",lineNumber:58,columnNumber:11},void 0),typeof n.activeNodeCount=="number"?e.jsxDEV("span",{style:{color:"#aa485b"},children:[n.activeNodeCount.toLocaleString()," active"]},void 0,!0,{fileName:"/Users/deepjoy/Documents/Alpha Semantic Hub/Alpha Semantic Hub Logo and Icon/explorer/src/workspaces/GraphWorkspace/plugins/temporalOverlayPlugin.tsx",lineNumber:59,columnNumber:59},void 0):null]},void 0,!0,{fileName:"/Users/deepjoy/Documents/Alpha Semantic Hub/Alpha Semantic Hub Logo and Icon/explorer/src/workspaces/GraphWorkspace/plugins/temporalOverlayPlugin.tsx",lineNumber:36,columnNumber:16},void 0)}},renderPanel:r=>{if(!r.isPanelOpen(a))return null;const n=r.getTemporalState();return{id:a,title:"Temporal Context",placement:"bottom",order:30,defaultOpen:!1,preferredWidth:320,preferredHeight:220,content:e.jsxDEV("div",{style:p,children:[e.jsxDEV("div",{style:c,children:"Current scrubber state"},void 0,!1,{fileName:"/Users/deepjoy/Documents/Alpha Semantic Hub/Alpha Semantic Hub Logo and Icon/explorer/src/workspaces/GraphWorkspace/plugins/temporalOverlayPlugin.tsx",lineNumber:79,columnNumber:11},void 0),e.jsxDEV("div",{style:l,children:[e.jsxDEV("span",{style:o,children:"Current"},void 0,!1,{fileName:"/Users/deepjoy/Documents/Alpha Semantic Hub/Alpha Semantic Hub Logo and Icon/explorer/src/workspaces/GraphWorkspace/plugins/temporalOverlayPlugin.tsx",lineNumber:81,columnNumber:13},void 0),e.jsxDEV("span",{style:t,children:s(n?.currentTime??null)},void 0,!1,{fileName:"/Users/deepjoy/Documents/Alpha Semantic Hub/Alpha Semantic Hub Logo and Icon/explorer/src/workspaces/GraphWorkspace/plugins/temporalOverlayPlugin.tsx",lineNumber:82,columnNumber:13},void 0)]},void 0,!0,{fileName:"/Users/deepjoy/Documents/Alpha Semantic Hub/Alpha Semantic Hub Logo and Icon/explorer/src/workspaces/GraphWorkspace/plugins/temporalOverlayPlugin.tsx",lineNumber:80,columnNumber:11},void 0),e.jsxDEV("div",{style:l,children:[e.jsxDEV("span",{style:o,children:"Bounds"},void 0,!1,{fileName:"/Users/deepjoy/Documents/Alpha Semantic Hub/Alpha Semantic Hub Logo and Icon/explorer/src/workspaces/GraphWorkspace/plugins/temporalOverlayPlugin.tsx",lineNumber:85,columnNumber:13},void 0),e.jsxDEV("span",{style:t,children:[n?.minDate??"1970"," → ",n?.maxDate??"now"]},void 0,!0,{fileName:"/Users/deepjoy/Documents/Alpha Semantic Hub/Alpha Semantic Hub Logo and Icon/explorer/src/workspaces/GraphWorkspace/plugins/temporalOverlayPlugin.tsx",lineNumber:86,columnNumber:13},void 0)]},void 0,!0,{fileName:"/Users/deepjoy/Documents/Alpha Semantic Hub/Alpha Semantic Hub Logo and Icon/explorer/src/workspaces/GraphWorkspace/plugins/temporalOverlayPlugin.tsx",lineNumber:84,columnNumber:11},void 0),e.jsxDEV("div",{style:l,children:[e.jsxDEV("span",{style:o,children:"Active nodes"},void 0,!1,{fileName:"/Users/deepjoy/Documents/Alpha Semantic Hub/Alpha Semantic Hub Logo and Icon/explorer/src/workspaces/GraphWorkspace/plugins/temporalOverlayPlugin.tsx",lineNumber:91,columnNumber:13},void 0),e.jsxDEV("span",{style:t,children:typeof n?.activeNodeCount=="number"?n.activeNodeCount.toLocaleString():"All"},void 0,!1,{fileName:"/Users/deepjoy/Documents/Alpha Semantic Hub/Alpha Semantic Hub Logo and Icon/explorer/src/workspaces/GraphWorkspace/plugins/temporalOverlayPlugin.tsx",lineNumber:92,columnNumber:13},void 0)]},void 0,!0,{fileName:"/Users/deepjoy/Documents/Alpha Semantic Hub/Alpha Semantic Hub Logo and Icon/explorer/src/workspaces/GraphWorkspace/plugins/temporalOverlayPlugin.tsx",lineNumber:90,columnNumber:11},void 0)]},void 0,!0,{fileName:"/Users/deepjoy/Documents/Alpha Semantic Hub/Alpha Semantic Hub Logo and Icon/explorer/src/workspaces/GraphWorkspace/plugins/temporalOverlayPlugin.tsx",lineNumber:78,columnNumber:16},void 0)}}},p={display:"flex",flexDirection:"column",gap:10},c={color:"#aa485b",fontSize:11,fontWeight:700,letterSpacing:"0.08em",textTransform:"uppercase"},l={display:"flex",justifyContent:"space-between",gap:16,padding:"8px 10px",borderRadius:12,border:"1px solid rgba(28, 20, 24,0.06)",background:"rgba(28, 20, 24,0.025)"},o={color:"#aa485b",fontSize:12},t={color:"#2d1619",fontSize:12,fontWeight:600};export{d as temporalOverlayPlugin};
|
package/static/index.html
CHANGED
|
@@ -5,12 +5,12 @@
|
|
|
5
5
|
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
|
6
6
|
<link rel="apple-touch-icon" href="/apple-touch-icon.png" />
|
|
7
7
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
8
|
-
<meta name="theme-color" content="#
|
|
8
|
+
<meta name="theme-color" content="#ffffff" />
|
|
9
9
|
<meta name="description" content="Alpha Semantic Hub Studio — graph-native context, decision intelligence, and provenance for accountable AI systems." />
|
|
10
10
|
<title>Alpha Semantic Hub Studio</title>
|
|
11
|
-
<script type="module" crossorigin src="/assets/index-
|
|
11
|
+
<script type="module" crossorigin src="/assets/index-CVYHt6Z6.js"></script>
|
|
12
12
|
<link rel="modulepreload" crossorigin href="/assets/query-vendor-BqVbYexz.js">
|
|
13
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
13
|
+
<link rel="stylesheet" crossorigin href="/assets/index-3PtcB4_T.css">
|
|
14
14
|
</head>
|
|
15
15
|
<body>
|
|
16
16
|
<div id="root"></div>
|