@alepha/devtools 0.13.8 → 0.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/assets/devtools/{chunk.Cw2RCl4F.js → chunk.4uk7i9-q.js} +1 -1
  2. package/assets/devtools/{chunk.17gtbQUO.js → chunk.69EpOqBb.js} +1 -1
  3. package/assets/devtools/{chunk.BULoWCgJ.js → chunk.Ahe7TOrT.js} +1 -1
  4. package/assets/devtools/{chunk.CyQeq1kA.js → chunk.BOmhpMQZ.js} +1 -1
  5. package/assets/devtools/{chunk.BmJ7-uBd.js → chunk.BPR3Fzfi.js} +1 -1
  6. package/assets/devtools/{chunk.Ct58VlQl.js → chunk.BY1cUJeA.js} +1 -1
  7. package/assets/devtools/{chunk.DooL4OcT.js → chunk.BiZFFFTD.js} +1 -1
  8. package/assets/devtools/{chunk.DJJIo7HU.js → chunk.Bmb3xtb6.js} +1 -1
  9. package/assets/devtools/{chunk.DHWcJNNS.js → chunk.BumKuBFW.js} +1 -1
  10. package/assets/devtools/{chunk.CHRbA_gU.js → chunk.BzgsKQoC.js} +1 -1
  11. package/assets/devtools/{chunk.1mem8WHh.js → chunk.C2hdXZn7.js} +1 -1
  12. package/assets/devtools/{chunk.OlMI8g2F.js → chunk.CKmrGczh.js} +1 -1
  13. package/assets/devtools/{chunk.DR0SHXXd.js → chunk.CLi65HO4.js} +1 -1
  14. package/assets/devtools/{chunk.DEUHUxKv.js → chunk.CUTV1O_R.js} +1 -1
  15. package/assets/devtools/{chunk.CBGZOsrp.js → chunk.CaPSIJzT.js} +1 -1
  16. package/assets/devtools/{chunk.DJOi4_So.js → chunk.ChHWktn9.js} +1 -1
  17. package/assets/devtools/{chunk.DGW-W4Kc.js → chunk.ChW-mtOy.js} +1 -1
  18. package/assets/devtools/{chunk.fpKvkQeU.js → chunk.CkWIENRP.js} +1 -1
  19. package/assets/devtools/{chunk.CzbujtK7.js → chunk.CvqDfxXu.js} +1 -1
  20. package/assets/devtools/{chunk.Pj_uCbSv.js → chunk.CyVfOtMH.js} +1 -1
  21. package/assets/devtools/{chunk.IVvrfXp1.js → chunk.D4LcKiGJ.js} +1 -1
  22. package/assets/devtools/{chunk.DinJSUfH.js → chunk.D4_B6m39.js} +1 -1
  23. package/assets/devtools/{chunk.B0aYes_4.js → chunk.D7T7GuJQ.js} +1 -1
  24. package/assets/devtools/{chunk.YXYL4YAO.js → chunk.DD8gLmva.js} +1 -1
  25. package/assets/devtools/{chunk.RTodzvo0.js → chunk.DFYPFYhv.js} +1 -1
  26. package/assets/devtools/{chunk.Dry2LXOT.js → chunk.DUAYORVN.js} +1 -1
  27. package/assets/devtools/{chunk.BYrPfJRg.js → chunk.DXpU07Gr.js} +1 -1
  28. package/assets/devtools/{chunk.DIfRZc20.js → chunk.DknkYaMA.js} +1 -1
  29. package/assets/devtools/{chunk.DA9XnVAa.js → chunk.K3IQQCLu.js} +1 -1
  30. package/assets/devtools/{chunk.qDx9cjbN.js → chunk.KBmIO7L9.js} +1 -1
  31. package/assets/devtools/{chunk.BzE7YYkj.js → chunk.RI-cVyH7.js} +1 -1
  32. package/assets/devtools/{chunk.rJToME5k.js → chunk.humlEV7p.js} +1 -1
  33. package/assets/devtools/{chunk.C49FcqzR.js → chunk.iXAb6asG.js} +1 -1
  34. package/assets/devtools/{chunk.rohGhT-A.js → chunk.qynByvMI.js} +1 -1
  35. package/assets/devtools/entry.Bkwg306k.js +75 -0
  36. package/assets/devtools/index.html +1 -1
  37. package/dist/index.d.ts +31 -28
  38. package/package.json +6 -6
  39. package/assets/devtools/entry.BY4L2Uc6.js +0 -75
@@ -1 +1 @@
1
- import{ap as t}from"./entry.BY4L2Uc6.js";const e=t.object({name:t.text(),group:t.text(),method:t.text(),path:t.text(),prefix:t.text(),fullPath:t.text(),description:t.optional(t.text()),summary:t.optional(t.text()),disabled:t.optional(t.boolean()),secure:t.optional(t.boolean()),hide:t.optional(t.boolean()),body:t.optional(t.any()),params:t.optional(t.any()),query:t.optional(t.any()),response:t.optional(t.any()),bodyContentType:t.optional(t.text())}),a=t.object({name:t.text(),description:t.optional(t.text()),schema:t.any(),defaultValue:t.optional(t.any()),currentValue:t.optional(t.any())}),o=t.object({name:t.text(),description:t.optional(t.text()),mimeTypes:t.optional(t.array(t.text())),maxSize:t.optional(t.number()),provider:t.text()}),n=t.object({name:t.text(),ttl:t.optional(t.any()),disabled:t.optional(t.boolean()),provider:t.text()}),r=t.object({name:t.text(),description:t.optional(t.text()),hidden:t.optional(t.boolean())}),i=t.object({name:t.text(),type:t.text(),nullable:t.boolean(),primaryKey:t.boolean(),identity:t.boolean(),createdAt:t.boolean(),updatedAt:t.boolean(),deletedAt:t.boolean(),version:t.boolean(),hasDefault:t.boolean(),ref:t.optional(t.object({entity:t.text(),column:t.text(),onUpdate:t.optional(t.text()),onDelete:t.optional(t.text())}))}),l=t.object({name:t.optional(t.text()),columns:t.array(t.text()),unique:t.boolean()}),c=t.object({name:t.optional(t.text()),columns:t.array(t.text()),foreignEntity:t.text(),foreignColumns:t.array(t.text())}),s=t.object({name:t.optional(t.text()),columns:t.array(t.text()),unique:t.boolean(),hasCheck:t.boolean()}),p=t.object({name:t.text(),provider:t.text(),columns:t.array(i),indexes:t.array(l),foreignKeys:t.array(c),constraints:t.array(s)}),d=t.object({propertyKey:t.text(),schema:t.any(),values:t.record(t.text(),t.any()),serviceName:t.optional(t.text())}),m=t.object({name:t.text(),providers:t.array(t.text())}),y=t.object({name:t.text(),description:t.optional(t.text()),path:t.optional(t.text()),params:t.optional(t.any()),query:t.optional(t.any()),hasComponent:t.boolean(),hasLazy:t.boolean(),hasResolve:t.boolean(),hasChildren:t.boolean(),hasParent:t.boolean(),hasErrorHandler:t.boolean(),static:t.optional(t.boolean()),cache:t.optional(t.any()),client:t.optional(t.any()),animation:t.optional(t.any())}),x=t.object({name:t.text(),module:t.optional(t.text()),dependencies:t.array(t.text()),aliases:t.optional(t.array(t.text()))}),b=t.object({name:t.text(),description:t.optional(t.text()),schema:t.optional(t.any()),provider:t.text()}),h=t.object({name:t.text(),description:t.optional(t.text()),roles:t.optional(t.array(t.any())),type:t.enum(["internal","external"]),settings:t.optional(t.object({accessTokenExpiration:t.optional(t.any()),refreshTokenExpiration:t.optional(t.any()),hasOnCreateSession:t.boolean(),hasOnRefreshSession:t.boolean(),hasOnDeleteSession:t.boolean()}))}),u=t.object({method:t.text(),path:t.text()}),v=t.object({name:t.text(),description:t.optional(t.text()),cron:t.optional(t.text()),interval:t.optional(t.any()),lock:t.optional(t.boolean())}),S=t.object({name:t.text(),description:t.optional(t.text()),schema:t.optional(t.any()),provider:t.text()}),M=t.object({actions:t.array(e),queues:t.array(b),schedulers:t.array(v),topics:t.array(S),buckets:t.array(o),realms:t.array(h),caches:t.array(n),pages:t.array(y),providers:t.array(x),modules:t.array(m),entities:t.array(p),commands:t.array(r),routes:t.array(u),envs:t.array(d),atoms:t.array(a)});export{M as d};
1
+ import{ap as t}from"./entry.Bkwg306k.js";const e=t.object({name:t.text(),group:t.text(),method:t.text(),path:t.text(),prefix:t.text(),fullPath:t.text(),description:t.optional(t.text()),summary:t.optional(t.text()),disabled:t.optional(t.boolean()),secure:t.optional(t.boolean()),hide:t.optional(t.boolean()),body:t.optional(t.any()),params:t.optional(t.any()),query:t.optional(t.any()),response:t.optional(t.any()),bodyContentType:t.optional(t.text())}),a=t.object({name:t.text(),description:t.optional(t.text()),schema:t.any(),defaultValue:t.optional(t.any()),currentValue:t.optional(t.any())}),o=t.object({name:t.text(),description:t.optional(t.text()),mimeTypes:t.optional(t.array(t.text())),maxSize:t.optional(t.number()),provider:t.text()}),n=t.object({name:t.text(),ttl:t.optional(t.any()),disabled:t.optional(t.boolean()),provider:t.text()}),r=t.object({name:t.text(),description:t.optional(t.text()),hidden:t.optional(t.boolean())}),i=t.object({name:t.text(),type:t.text(),nullable:t.boolean(),primaryKey:t.boolean(),identity:t.boolean(),createdAt:t.boolean(),updatedAt:t.boolean(),deletedAt:t.boolean(),version:t.boolean(),hasDefault:t.boolean(),ref:t.optional(t.object({entity:t.text(),column:t.text(),onUpdate:t.optional(t.text()),onDelete:t.optional(t.text())}))}),l=t.object({name:t.optional(t.text()),columns:t.array(t.text()),unique:t.boolean()}),c=t.object({name:t.optional(t.text()),columns:t.array(t.text()),foreignEntity:t.text(),foreignColumns:t.array(t.text())}),s=t.object({name:t.optional(t.text()),columns:t.array(t.text()),unique:t.boolean(),hasCheck:t.boolean()}),p=t.object({name:t.text(),provider:t.text(),columns:t.array(i),indexes:t.array(l),foreignKeys:t.array(c),constraints:t.array(s)}),d=t.object({propertyKey:t.text(),schema:t.any(),values:t.record(t.text(),t.any()),serviceName:t.optional(t.text())}),m=t.object({name:t.text(),providers:t.array(t.text())}),y=t.object({name:t.text(),description:t.optional(t.text()),path:t.optional(t.text()),params:t.optional(t.any()),query:t.optional(t.any()),hasComponent:t.boolean(),hasLazy:t.boolean(),hasResolve:t.boolean(),hasChildren:t.boolean(),hasParent:t.boolean(),hasErrorHandler:t.boolean(),static:t.optional(t.boolean()),cache:t.optional(t.any()),client:t.optional(t.any()),animation:t.optional(t.any())}),x=t.object({name:t.text(),module:t.optional(t.text()),dependencies:t.array(t.text()),aliases:t.optional(t.array(t.text()))}),b=t.object({name:t.text(),description:t.optional(t.text()),schema:t.optional(t.any()),provider:t.text()}),h=t.object({name:t.text(),description:t.optional(t.text()),roles:t.optional(t.array(t.any())),type:t.enum(["internal","external"]),settings:t.optional(t.object({accessTokenExpiration:t.optional(t.any()),refreshTokenExpiration:t.optional(t.any()),hasOnCreateSession:t.boolean(),hasOnRefreshSession:t.boolean(),hasOnDeleteSession:t.boolean()}))}),u=t.object({method:t.text(),path:t.text()}),v=t.object({name:t.text(),description:t.optional(t.text()),cron:t.optional(t.text()),interval:t.optional(t.any()),lock:t.optional(t.boolean())}),S=t.object({name:t.text(),description:t.optional(t.text()),schema:t.optional(t.any()),provider:t.text()}),M=t.object({actions:t.array(e),queues:t.array(b),schedulers:t.array(v),topics:t.array(S),buckets:t.array(o),realms:t.array(h),caches:t.array(n),pages:t.array(y),providers:t.array(x),modules:t.array(m),entities:t.array(p),commands:t.array(r),routes:t.array(u),envs:t.array(d),atoms:t.array(a)});export{M as d};
@@ -1 +1 @@
1
- import{b9 as o}from"./entry.BY4L2Uc6.js";function a(t,r){return t in r?o(r[t]):o(t)}function s(t,r){const n=t.map(e=>({value:e,px:a(e,r)}));return n.sort((e,u)=>e.px-u.px),n}export{s as a,a as g};
1
+ import{b9 as o}from"./entry.Bkwg306k.js";function a(t,r){return t in r?o(r[t]):o(t)}function s(t,r){const n=t.map(e=>({value:e,px:a(e,r)}));return n.sort((e,u)=>e.px-u.px),n}export{s as a,a as g};
@@ -1,4 +1,4 @@
1
- import{f as za,b as Aa,q as $a,s as Pa,$ as Da,j as y,B as qe,ak as Ta,a1 as Ha,w as Pe,al as Tr,am as ja,an as Ra,r as P,F as fe,ad as ye,ae as La,z as Oa,W as Hr,a4 as jn,a9 as Ye,a7 as Va,H as $e,T as se,ag as Ba,ac as No,Y as Fa,Z as Xa,a6 as Ya,ao as Wa}from"./entry.BY4L2Uc6.js";import{d as Za}from"./chunk.Cw2RCl4F.js";import{S as Mo}from"./chunk.BmJ7-uBd.js";import{S as qa,C as Ga,I as Ua,a as Ka,b as Qa}from"./chunk.CzbujtK7.js";import{B as Ke,S as ft}from"./chunk.Dry2LXOT.js";import{D as _n}from"./chunk.fpKvkQeU.js";import{I as Ja}from"./chunk.BYrPfJRg.js";import"./chunk.uyVen0u2.js";import"./chunk.qDx9cjbN.js";import"./chunk.BjFrJKj1.js";var jr={root:"m_66836ed3",wrapper:"m_a5d60502",body:"m_667c2793",title:"m_6a03f287",label:"m_698f4f23",icon:"m_667f2a6a",message:"m_7fa78076",closeButton:"m_87f54839"};const ec=Pa((e,{radius:t,color:n,variant:o,autoContrast:r})=>{const i=e.variantColorResolver({color:n||e.primaryColor,theme:e,variant:o||"light",autoContrast:r});return{root:{"--alert-radius":t===void 0?void 0:Ha(t),"--alert-bg":n||o?i.background:void 0,"--alert-color":i.color,"--alert-bd":n||o?i.border:void 0}}}),Qn=za((e,t)=>{const n=Aa("Alert",null,e),{classNames:o,className:r,style:i,styles:s,unstyled:a,vars:l,radius:c,color:u,title:d,children:f,id:g,icon:p,withCloseButton:m,onClose:v,closeButtonLabel:x,variant:_,autoContrast:h,role:w,attributes:C,...E}=n,S=$a({name:"Alert",classes:jr,props:n,className:r,style:i,classNames:o,styles:s,unstyled:a,attributes:C,vars:l,varsResolver:ec}),M=Da(g),z=d&&`${M}-title`||void 0,O=`${M}-body`;return y.jsx(qe,{id:M,...S("root",{variant:_}),variant:_,ref:t,role:w||"alert",...E,"aria-describedby":f?O:void 0,"aria-labelledby":d?z:void 0,children:y.jsxs("div",{...S("wrapper"),children:[p&&y.jsx("div",{...S("icon"),children:p}),y.jsxs("div",{...S("body"),children:[d&&y.jsx("div",{...S("title"),"data-with-close-button":m||void 0,children:y.jsx("span",{id:z,...S("label"),children:d})}),f&&y.jsx("div",{id:O,...S("message"),"data-variant":_,children:f})]}),m&&y.jsx(Ta,{...S("closeButton"),onClick:v,variant:"transparent",size:16,iconSize:16,"aria-label":x,unstyled:a})]})})});Qn.classes=jr;Qn.displayName="@mantine/core/Alert";const tc=[["path",{d:"M7 3m0 2a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v10a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2z",key:"svg-0"}],["path",{d:"M17 17v2a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2v-10a2 2 0 0 1 2 -2h2",key:"svg-1"}]],nc=Pe("outline","box-multiple","BoxMultiple",tc);const oc=[["path",{d:"M12 3l8 4.5l0 9l-8 4.5l-8 -4.5l0 -9l8 -4.5",key:"svg-0"}],["path",{d:"M12 12l8 -4.5",key:"svg-1"}],["path",{d:"M12 12l0 9",key:"svg-2"}],["path",{d:"M12 12l-8 -4.5",key:"svg-3"}]],Rr=Pe("outline","box","Box",oc);const rc=[["path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2",key:"svg-0"}],["path",{d:"M7 11l5 5l5 -5",key:"svg-1"}],["path",{d:"M12 4l0 12",key:"svg-2"}]],ic=Pe("outline","download","Download",rc);const sc=[["path",{d:"M12 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-0"}],["path",{d:"M4 8v-2a2 2 0 0 1 2 -2h2",key:"svg-1"}],["path",{d:"M4 16v2a2 2 0 0 0 2 2h2",key:"svg-2"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v2",key:"svg-3"}],["path",{d:"M16 20h2a2 2 0 0 0 2 -2v-2",key:"svg-4"}]],ac=Pe("outline","focus-centered","FocusCentered",sc);const cc=[["path",{d:"M4 4l16 0",key:"svg-0"}],["path",{d:"M4 20l16 0",key:"svg-1"}],["path",{d:"M6 9m0 2a2 2 0 0 1 2 -2h8a2 2 0 0 1 2 2v2a2 2 0 0 1 -2 2h-8a2 2 0 0 1 -2 -2z",key:"svg-2"}]],lc=Pe("outline","layout-distribute-horizontal","LayoutDistributeHorizontal",cc);const uc=[["path",{d:"M4 4l0 16",key:"svg-0"}],["path",{d:"M20 4l0 16",key:"svg-1"}],["path",{d:"M9 6m0 2a2 2 0 0 1 2 -2h2a2 2 0 0 1 2 2v8a2 2 0 0 1 -2 2h-2a2 2 0 0 1 -2 -2z",key:"svg-2"}]],dc=Pe("outline","layout-distribute-vertical","LayoutDistributeVertical",uc);const fc=[["path",{d:"M5 11m0 2a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v6a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2z",key:"svg-0"}],["path",{d:"M12 16m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-1"}],["path",{d:"M8 11v-5a4 4 0 0 1 8 0",key:"svg-2"}]],hc=Pe("outline","lock-open","LockOpen",fc);const gc=[["path",{d:"M5 12l14 0",key:"svg-0"}]],pc=Pe("outline","minus","Minus",gc);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 mc={value:()=>{}};function sn(){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 Bt(n)}function Bt(e){this._=e}function yc(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}})}Bt.prototype=sn.prototype={constructor:Bt,on:function(e,t){var n=this._,o=yc(e+"",n),r,i=-1,s=o.length;if(arguments.length<2){for(;++i<s;)if((r=(e=o[i]).type)&&(r=xc(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]=ko(n[r],e.name,t);else if(t==null)for(r in n)n[r]=ko(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 Bt(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 xc(e,t){for(var n=0,o=e.length,r;n<o;++n)if((r=e[n]).name===t)return r.value}function ko(e,t,n){for(var o=0,r=e.length;o<r;++o)if(e[o].name===t){e[o]=mc,e=e.slice(0,o).concat(e.slice(o+1));break}return n!=null&&e.push({name:t,value:n}),e}var Rn="http://www.w3.org/1999/xhtml";const Io={svg:"http://www.w3.org/2000/svg",xhtml:Rn,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function an(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),Io.hasOwnProperty(t)?{space:Io[t],local:e}:e}function wc(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Rn&&t.documentElement.namespaceURI===Rn?t.createElement(e):t.createElementNS(n,e)}}function vc(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Lr(e){var t=an(e);return(t.local?vc:wc)(t)}function bc(){}function Jn(e){return e==null?bc:function(){return this.querySelector(e)}}function _c(e){typeof e!="function"&&(e=Jn(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 ue(o,this._parents)}function Sc(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function Ec(){return[]}function Or(e){return e==null?Ec:function(){return this.querySelectorAll(e)}}function Cc(e){return function(){return Sc(e.apply(this,arguments))}}function Nc(e){typeof e=="function"?e=Cc(e):e=Or(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 ue(o,r)}function Vr(e){return function(){return this.matches(e)}}function Br(e){return function(t){return t.matches(e)}}var Mc=Array.prototype.find;function kc(e){return function(){return Mc.call(this.children,e)}}function Ic(){return this.firstElementChild}function zc(e){return this.select(e==null?Ic:kc(typeof e=="function"?e:Br(e)))}var Ac=Array.prototype.filter;function $c(){return Array.from(this.children)}function Pc(e){return function(){return Ac.call(this.children,e)}}function Dc(e){return this.selectAll(e==null?$c:Pc(typeof e=="function"?e:Br(e)))}function Tc(e){typeof e!="function"&&(e=Vr(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 ue(o,this._parents)}function Fr(e){return new Array(e.length)}function Hc(){return new ue(this._enter||this._groups.map(Fr),this._parents)}function Zt(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Zt.prototype={constructor:Zt,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 jc(e){return function(){return e}}function Rc(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 Zt(e,i[s]);for(;s<l;++s)(a=t[s])&&(r[s]=a)}function Lc(e,t,n,o,r,i,s){var a,l,c=new Map,u=t.length,d=i.length,f=new Array(u),g;for(a=0;a<u;++a)(l=t[a])&&(f[a]=g=s.call(l,l.__data__,a,t)+"",c.has(g)?r[a]=l:c.set(g,l));for(a=0;a<d;++a)g=s.call(e,i[a],a,i)+"",(l=c.get(g))?(o[a]=l,l.__data__=i[a],c.delete(g)):n[a]=new Zt(e,i[a]);for(a=0;a<u;++a)(l=t[a])&&c.get(f[a])===l&&(r[a]=l)}function Oc(e){return e.__data__}function Vc(e,t){if(!arguments.length)return Array.from(this,Oc);var n=t?Lc:Rc,o=this._parents,r=this._groups;typeof e!="function"&&(e=jc(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,g=Bc(e.call(u,u&&u.__data__,c,o)),p=g.length,m=a[c]=new Array(p),v=s[c]=new Array(p),x=l[c]=new Array(f);n(u,d,m,v,x,g,t);for(var _=0,h=0,w,C;_<p;++_)if(w=m[_]){for(_>=h&&(h=_+1);!(C=v[h])&&++h<p;);w._next=C||null}}return s=new ue(s,o),s._enter=a,s._exit=l,s}function Bc(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Fc(){return new ue(this._exit||this._groups.map(Fr),this._parents)}function Xc(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 Yc(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),g,p=0;p<d;++p)(g=c[p]||u[p])&&(f[p]=g);for(;l<r;++l)a[l]=n[l];return new ue(a,this._parents)}function Wc(){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 Zc(e){e||(e=qc);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 ue(r,this._parents).order()}function qc(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function Gc(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function Uc(){return Array.from(this)}function Kc(){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 Qc(){let e=0;for(const t of this)++e;return e}function Jc(){return!this.node()}function el(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 tl(e){return function(){this.removeAttribute(e)}}function nl(e){return function(){this.removeAttributeNS(e.space,e.local)}}function ol(e,t){return function(){this.setAttribute(e,t)}}function rl(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function il(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function sl(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 al(e,t){var n=an(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?nl:tl:typeof t=="function"?n.local?sl:il:n.local?rl:ol)(n,t))}function Xr(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function cl(e){return function(){this.style.removeProperty(e)}}function ll(e,t,n){return function(){this.style.setProperty(e,t,n)}}function ul(e,t,n){return function(){var o=t.apply(this,arguments);o==null?this.style.removeProperty(e):this.style.setProperty(e,o,n)}}function dl(e,t,n){return arguments.length>1?this.each((t==null?cl:typeof t=="function"?ul:ll)(e,t,n??"")):Qe(this.node(),e)}function Qe(e,t){return e.style.getPropertyValue(t)||Xr(e).getComputedStyle(e,null).getPropertyValue(t)}function fl(e){return function(){delete this[e]}}function hl(e,t){return function(){this[e]=t}}function gl(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function pl(e,t){return arguments.length>1?this.each((t==null?fl:typeof t=="function"?gl:hl)(e,t)):this.node()[e]}function Yr(e){return e.trim().split(/^|\s+/)}function eo(e){return e.classList||new Wr(e)}function Wr(e){this._node=e,this._names=Yr(e.getAttribute("class")||"")}Wr.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 Zr(e,t){for(var n=eo(e),o=-1,r=t.length;++o<r;)n.add(t[o])}function qr(e,t){for(var n=eo(e),o=-1,r=t.length;++o<r;)n.remove(t[o])}function ml(e){return function(){Zr(this,e)}}function yl(e){return function(){qr(this,e)}}function xl(e,t){return function(){(t.apply(this,arguments)?Zr:qr)(this,e)}}function wl(e,t){var n=Yr(e+"");if(arguments.length<2){for(var o=eo(this.node()),r=-1,i=n.length;++r<i;)if(!o.contains(n[r]))return!1;return!0}return this.each((typeof t=="function"?xl:t?ml:yl)(n,t))}function vl(){this.textContent=""}function bl(e){return function(){this.textContent=e}}function _l(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function Sl(e){return arguments.length?this.each(e==null?vl:(typeof e=="function"?_l:bl)(e)):this.node().textContent}function El(){this.innerHTML=""}function Cl(e){return function(){this.innerHTML=e}}function Nl(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function Ml(e){return arguments.length?this.each(e==null?El:(typeof e=="function"?Nl:Cl)(e)):this.node().innerHTML}function kl(){this.nextSibling&&this.parentNode.appendChild(this)}function Il(){return this.each(kl)}function zl(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Al(){return this.each(zl)}function $l(e){var t=typeof e=="function"?e:Lr(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function Pl(){return null}function Dl(e,t){var n=typeof e=="function"?e:Lr(e),o=t==null?Pl:typeof t=="function"?t:Jn(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),o.apply(this,arguments)||null)})}function Tl(){var e=this.parentNode;e&&e.removeChild(this)}function Hl(){return this.each(Tl)}function jl(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Rl(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Ll(e){return this.select(e?Rl:jl)}function Ol(e){return arguments.length?this.property("__data__",e):this.node().__data__}function Vl(e){return function(t){e.call(this,t,this.__data__)}}function Bl(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 Fl(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 Xl(e,t,n){return function(){var o=this.__on,r,i=Vl(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 Yl(e,t,n){var o=Bl(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?Xl:Fl,r=0;r<i;++r)this.each(a(o[r],t,n));return this}function Gr(e,t,n){var o=Xr(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 Wl(e,t){return function(){return Gr(this,e,t)}}function Zl(e,t){return function(){return Gr(this,e,t.apply(this,arguments))}}function ql(e,t){return this.each((typeof t=="function"?Zl:Wl)(e,t))}function*Gl(){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 Ur=[null];function ue(e,t){this._groups=e,this._parents=t}function Nt(){return new ue([[document.documentElement]],Ur)}function Ul(){return this}ue.prototype=Nt.prototype={constructor:ue,select:_c,selectAll:Nc,selectChild:zc,selectChildren:Dc,filter:Tc,data:Vc,enter:Hc,exit:Fc,join:Xc,merge:Yc,selection:Ul,order:Wc,sort:Zc,call:Gc,nodes:Uc,node:Kc,size:Qc,empty:Jc,each:el,attr:al,style:dl,property:pl,classed:wl,text:Sl,html:Ml,raise:Il,lower:Al,append:$l,insert:Dl,remove:Hl,clone:Ll,datum:Ol,on:Yl,dispatch:ql,[Symbol.iterator]:Gl};function le(e){return typeof e=="string"?new ue([[document.querySelector(e)]],[document.documentElement]):new ue([[e]],Ur)}function Kl(e){let t;for(;t=e.sourceEvent;)e=t;return e}function de(e,t){if(e=Kl(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 Ql={passive:!1},yt={capture:!0,passive:!1};function Sn(e){e.stopImmediatePropagation()}function Ge(e){e.preventDefault(),e.stopImmediatePropagation()}function Kr(e){var t=e.document.documentElement,n=le(e).on("dragstart.drag",Ge,yt);"onselectstart"in t?n.on("selectstart.drag",Ge,yt):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function Qr(e,t){var n=e.document.documentElement,o=le(e).on("dragstart.drag",null);t&&(o.on("click.drag",Ge,yt),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 Pt=e=>()=>e;function Ln(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}})}Ln.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function Jl(e){return!e.ctrlKey&&!e.button}function eu(){return this.parentNode}function tu(e,t){return t??{x:e.x,y:e.y}}function nu(){return navigator.maxTouchPoints||"ontouchstart"in this}function Jr(){var e=Jl,t=eu,n=tu,o=nu,r={},i=sn("start","drag","end"),s=0,a,l,c,u,d=0;function f(w){w.on("mousedown.drag",g).filter(o).on("touchstart.drag",v).on("touchmove.drag",x,Ql).on("touchend.drag touchcancel.drag",_).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function g(w,C){if(!(u||!e.call(this,w,C))){var E=h(this,t.call(this,w,C),w,C,"mouse");E&&(le(w.view).on("mousemove.drag",p,yt).on("mouseup.drag",m,yt),Kr(w.view),Sn(w),c=!1,a=w.clientX,l=w.clientY,E("start",w))}}function p(w){if(Ge(w),!c){var C=w.clientX-a,E=w.clientY-l;c=C*C+E*E>d}r.mouse("drag",w)}function m(w){le(w.view).on("mousemove.drag mouseup.drag",null),Qr(w.view,c),Ge(w),r.mouse("end",w)}function v(w,C){if(e.call(this,w,C)){var E=w.changedTouches,S=t.call(this,w,C),M=E.length,z,O;for(z=0;z<M;++z)(O=h(this,S,w,C,E[z].identifier,E[z]))&&(Sn(w),O("start",w,E[z]))}}function x(w){var C=w.changedTouches,E=C.length,S,M;for(S=0;S<E;++S)(M=r[C[S].identifier])&&(Ge(w),M("drag",w,C[S]))}function _(w){var C=w.changedTouches,E=C.length,S,M;for(u&&clearTimeout(u),u=setTimeout(function(){u=null},500),S=0;S<E;++S)(M=r[C[S].identifier])&&(Sn(w),M("end",w,C[S]))}function h(w,C,E,S,M,z){var O=i.copy(),k=de(z||E,C),T,j,b;if((b=n.call(w,new Ln("beforestart",{sourceEvent:E,target:f,identifier:M,active:s,x:k[0],y:k[1],dx:0,dy:0,dispatch:O}),S))!=null)return T=b.x-k[0]||0,j=b.y-k[1]||0,function I(N,$,A){var D=k,H;switch(N){case"start":r[M]=I,H=s++;break;case"end":delete r[M],--s;case"drag":k=de(A||$,C),H=s;break}O.call(N,w,new Ln(N,{sourceEvent:$,subject:b,target:f,identifier:M,active:H,x:k[0]+T,y:k[1]+j,dx:k[0]-D[0],dy:k[1]-D[1],dispatch:O}),S)}}return f.filter=function(w){return arguments.length?(e=typeof w=="function"?w:Pt(!!w),f):e},f.container=function(w){return arguments.length?(t=typeof w=="function"?w:Pt(w),f):t},f.subject=function(w){return arguments.length?(n=typeof w=="function"?w:Pt(w),f):n},f.touchable=function(w){return arguments.length?(o=typeof w=="function"?w:Pt(!!w),f):o},f.on=function(){var w=i.on.apply(i,arguments);return w===i?f:w},f.clickDistance=function(w){return arguments.length?(d=(w=+w)*w,f):Math.sqrt(d)},f}function to(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function ei(e,t){var n=Object.create(e.prototype);for(var o in t)n[o]=t[o];return n}function Mt(){}var xt=.7,qt=1/xt,Ue="\\s*([+-]?\\d+)\\s*",wt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",we="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",ou=/^#([0-9a-f]{3,8})$/,ru=new RegExp(`^rgb\\(${Ue},${Ue},${Ue}\\)$`),iu=new RegExp(`^rgb\\(${we},${we},${we}\\)$`),su=new RegExp(`^rgba\\(${Ue},${Ue},${Ue},${wt}\\)$`),au=new RegExp(`^rgba\\(${we},${we},${we},${wt}\\)$`),cu=new RegExp(`^hsl\\(${wt},${we},${we}\\)$`),lu=new RegExp(`^hsla\\(${wt},${we},${we},${wt}\\)$`),zo={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};to(Mt,Le,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Ao,formatHex:Ao,formatHex8:uu,formatHsl:du,formatRgb:$o,toString:$o});function Ao(){return this.rgb().formatHex()}function uu(){return this.rgb().formatHex8()}function du(){return ti(this).formatHsl()}function $o(){return this.rgb().formatRgb()}function Le(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=ou.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?Po(t):n===3?new ce(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Dt(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Dt(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=ru.exec(e))?new ce(t[1],t[2],t[3],1):(t=iu.exec(e))?new ce(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=su.exec(e))?Dt(t[1],t[2],t[3],t[4]):(t=au.exec(e))?Dt(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=cu.exec(e))?Ho(t[1],t[2]/100,t[3]/100,1):(t=lu.exec(e))?Ho(t[1],t[2]/100,t[3]/100,t[4]):zo.hasOwnProperty(e)?Po(zo[e]):e==="transparent"?new ce(NaN,NaN,NaN,0):null}function Po(e){return new ce(e>>16&255,e>>8&255,e&255,1)}function Dt(e,t,n,o){return o<=0&&(e=t=n=NaN),new ce(e,t,n,o)}function fu(e){return e instanceof Mt||(e=Le(e)),e?(e=e.rgb(),new ce(e.r,e.g,e.b,e.opacity)):new ce}function On(e,t,n,o){return arguments.length===1?fu(e):new ce(e,t,n,o??1)}function ce(e,t,n,o){this.r=+e,this.g=+t,this.b=+n,this.opacity=+o}to(ce,On,ei(Mt,{brighter(e){return e=e==null?qt:Math.pow(qt,e),new ce(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?xt:Math.pow(xt,e),new ce(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new ce(je(this.r),je(this.g),je(this.b),Gt(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:Do,formatHex:Do,formatHex8:hu,formatRgb:To,toString:To}));function Do(){return`#${He(this.r)}${He(this.g)}${He(this.b)}`}function hu(){return`#${He(this.r)}${He(this.g)}${He(this.b)}${He((isNaN(this.opacity)?1:this.opacity)*255)}`}function To(){const e=Gt(this.opacity);return`${e===1?"rgb(":"rgba("}${je(this.r)}, ${je(this.g)}, ${je(this.b)}${e===1?")":`, ${e})`}`}function Gt(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function je(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function He(e){return e=je(e),(e<16?"0":"")+e.toString(16)}function Ho(e,t,n,o){return o<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new he(e,t,n,o)}function ti(e){if(e instanceof he)return new he(e.h,e.s,e.l,e.opacity);if(e instanceof Mt||(e=Le(e)),!e)return new he;if(e instanceof he)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 he(s,a,l,e.opacity)}function gu(e,t,n,o){return arguments.length===1?ti(e):new he(e,t,n,o??1)}function he(e,t,n,o){this.h=+e,this.s=+t,this.l=+n,this.opacity=+o}to(he,gu,ei(Mt,{brighter(e){return e=e==null?qt:Math.pow(qt,e),new he(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?xt:Math.pow(xt,e),new he(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 ce(En(e>=240?e-240:e+120,r,o),En(e,r,o),En(e<120?e+240:e-120,r,o),this.opacity)},clamp(){return new he(jo(this.h),Tt(this.s),Tt(this.l),Gt(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=Gt(this.opacity);return`${e===1?"hsl(":"hsla("}${jo(this.h)}, ${Tt(this.s)*100}%, ${Tt(this.l)*100}%${e===1?")":`, ${e})`}`}}));function jo(e){return e=(e||0)%360,e<0?e+360:e}function Tt(e){return Math.max(0,Math.min(1,e||0))}function En(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 no=e=>()=>e;function pu(e,t){return function(n){return e+n*t}}function mu(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 yu(e){return(e=+e)==1?ni:function(t,n){return n-t?mu(t,n,e):no(isNaN(t)?n:t)}}function ni(e,t){var n=t-e;return n?pu(e,n):no(isNaN(e)?t:e)}const Ut=(function e(t){var n=yu(t);function o(r,i){var s=n((r=On(r)).r,(i=On(i)).r),a=n(r.g,i.g),l=n(r.b,i.b),c=ni(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 xu(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 wu(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function vu(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]=pt(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 bu(e,t){var n=new Date;return e=+e,t=+t,function(o){return n.setTime(e*(1-o)+t*o),n}}function xe(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function _u(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]=pt(e[r],t[r]):o[r]=t[r];return function(i){for(r in n)o[r]=n[r](i);return o}}var Vn=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Cn=new RegExp(Vn.source,"g");function Su(e){return function(){return e}}function Eu(e){return function(t){return e(t)+""}}function oi(e,t){var n=Vn.lastIndex=Cn.lastIndex=0,o,r,i,s=-1,a=[],l=[];for(e=e+"",t=t+"";(o=Vn.exec(e))&&(r=Cn.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:xe(o,r)})),n=Cn.lastIndex;return n<t.length&&(i=t.slice(n),a[s]?a[s]+=i:a[++s]=i),a.length<2?l[0]?Eu(l[0].x):Su(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 pt(e,t){var n=typeof t,o;return t==null||n==="boolean"?no(t):(n==="number"?xe:n==="string"?(o=Le(t))?(t=o,Ut):oi:t instanceof Le?Ut:t instanceof Date?bu:wu(t)?xu:Array.isArray(t)?vu:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?_u:xe)(e,t)}var Ro=180/Math.PI,Bn={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function ri(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)*Ro,skewX:Math.atan(l)*Ro,scaleX:s,scaleY:a}}var Ht;function Cu(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Bn:ri(t.a,t.b,t.c,t.d,t.e,t.f)}function Nu(e){return e==null||(Ht||(Ht=document.createElementNS("http://www.w3.org/2000/svg","g")),Ht.setAttribute("transform",e),!(e=Ht.transform.baseVal.consolidate()))?Bn:(e=e.matrix,ri(e.a,e.b,e.c,e.d,e.e,e.f))}function ii(e,t,n,o){function r(c){return c.length?c.pop()+" ":""}function i(c,u,d,f,g,p){if(c!==d||u!==f){var m=g.push("translate(",null,t,null,n);p.push({i:m-4,x:xe(c,d)},{i:m-2,x:xe(u,f)})}else(d||f)&&g.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:xe(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:xe(c,u)}):u&&d.push(r(d)+"skewX("+u+o)}function l(c,u,d,f,g,p){if(c!==d||u!==f){var m=g.push(r(g)+"scale(",null,",",null,")");p.push({i:m-4,x:xe(c,d)},{i:m-2,x:xe(u,f)})}else(d!==1||f!==1)&&g.push(r(g)+"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(g){for(var p=-1,m=f.length,v;++p<m;)d[(v=f[p]).i]=v.x(g);return d.join("")}}}var Mu=ii(Cu,"px, ","px)","deg)"),ku=ii(Nu,", ",")",")"),Iu=1e-12;function Lo(e){return((e=Math.exp(e))+1/e)/2}function zu(e){return((e=Math.exp(e))-1/e)/2}function Au(e){return((e=Math.exp(2*e))-1)/(e+1)}const Ft=(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],g=u-a,p=d-l,m=g*g+p*p,v,x;if(m<Iu)x=Math.log(f/c)/t,v=function(S){return[a+S*g,l+S*p,c*Math.exp(t*S*x)]};else{var _=Math.sqrt(m),h=(f*f-c*c+o*m)/(2*c*n*_),w=(f*f-c*c-o*m)/(2*f*n*_),C=Math.log(Math.sqrt(h*h+1)-h),E=Math.log(Math.sqrt(w*w+1)-w);x=(E-C)/t,v=function(S){var M=S*x,z=Lo(C),O=c/(n*_)*(z*Au(t*M+C)-zu(C));return[a+O*g,l+O*p,c*z/Lo(t*M+C)]}}return v.duration=x*1e3*t/Math.SQRT2,v}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 Je=0,ht=0,ut=0,si=1e3,Kt,gt,Qt=0,Oe=0,cn=0,vt=typeof performance=="object"&&performance.now?performance:Date,ai=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function oo(){return Oe||(ai($u),Oe=vt.now()+cn)}function $u(){Oe=0}function Jt(){this._call=this._time=this._next=null}Jt.prototype=ci.prototype={constructor:Jt,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?oo():+n)+(t==null?0:+t),!this._next&&gt!==this&&(gt?gt._next=this:Kt=this,gt=this),this._call=e,this._time=n,Fn()},stop:function(){this._call&&(this._call=null,this._time=1/0,Fn())}};function ci(e,t,n){var o=new Jt;return o.restart(e,t,n),o}function Pu(){oo(),++Je;for(var e=Kt,t;e;)(t=Oe-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Je}function Oo(){Oe=(Qt=vt.now())+cn,Je=ht=0;try{Pu()}finally{Je=0,Tu(),Oe=0}}function Du(){var e=vt.now(),t=e-Qt;t>si&&(cn-=t,Qt=e)}function Tu(){for(var e,t=Kt,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:Kt=n);gt=e,Fn(o)}function Fn(e){if(!Je){ht&&(ht=clearTimeout(ht));var t=e-Oe;t>24?(e<1/0&&(ht=setTimeout(Oo,e-vt.now()-cn)),ut&&(ut=clearInterval(ut))):(ut||(Qt=vt.now(),ut=setInterval(Du,si)),Je=1,ai(Oo))}}function Vo(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 Hu=sn("start","end","cancel","interrupt"),ju=[],li=0,Bo=1,Xn=2,Xt=3,Fo=4,Yn=5,Yt=6;function ln(e,t,n,o,r,i){var s=e.__transition;if(!s)e.__transition={};else if(n in s)return;Ru(e,n,{name:t,index:o,group:r,on:Hu,tween:ju,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:li})}function ro(e,t){var n=me(e,t);if(n.state>li)throw new Error("too late; already scheduled");return n}function be(e,t){var n=me(e,t);if(n.state>Xt)throw new Error("too late; already running");return n}function me(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function Ru(e,t,n){var o=e.__transition,r;o[t]=n,n.timer=ci(i,0,n.time);function i(c){n.state=Bo,n.timer.restart(s,n.delay,n.time),n.delay<=c&&s(c-n.delay)}function s(c){var u,d,f,g;if(n.state!==Bo)return l();for(u in o)if(g=o[u],g.name===n.name){if(g.state===Xt)return Vo(s);g.state===Fo?(g.state=Yt,g.timer.stop(),g.on.call("interrupt",e,e.__data__,g.index,g.group),delete o[u]):+u<t&&(g.state=Yt,g.timer.stop(),g.on.call("cancel",e,e.__data__,g.index,g.group),delete o[u])}if(Vo(function(){n.state===Xt&&(n.state=Fo,n.timer.restart(a,n.delay,n.time),a(c))}),n.state=Xn,n.on.call("start",e,e.__data__,n.index,n.group),n.state===Xn){for(n.state=Xt,r=new Array(f=n.tween.length),u=0,d=-1;u<f;++u)(g=n.tween[u].value.call(e,e.__data__,n.index,n.group))&&(r[++d]=g);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=Yn,1),d=-1,f=r.length;++d<f;)r[d].call(e,u);n.state===Yn&&(n.on.call("end",e,e.__data__,n.index,n.group),l())}function l(){n.state=Yt,n.timer.stop(),delete o[t];for(var c in o)return;delete e.__transition}}function Wt(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>Xn&&o.state<Yn,o.state=Yt,o.timer.stop(),o.on.call(r?"interrupt":"cancel",e,e.__data__,o.index,o.group),delete n[s]}i&&delete e.__transition}}function Lu(e){return this.each(function(){Wt(this,e)})}function Ou(e,t){var n,o;return function(){var r=be(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 Vu(e,t,n){var o,r;if(typeof n!="function")throw new Error;return function(){var i=be(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 Bu(e,t){var n=this._id;if(e+="",arguments.length<2){for(var o=me(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?Ou:Vu)(n,e,t))}function io(e,t,n){var o=e._id;return e.each(function(){var r=be(this,o);(r.value||(r.value={}))[t]=n.apply(this,arguments)}),function(r){return me(r,o).value[t]}}function ui(e,t){var n;return(typeof t=="number"?xe:t instanceof Le?Ut:(n=Le(t))?(t=n,Ut):oi)(e,t)}function Fu(e){return function(){this.removeAttribute(e)}}function Xu(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Yu(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 Wu(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 Zu(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 qu(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 Gu(e,t){var n=an(e),o=n==="transform"?ku:ui;return this.attrTween(e,typeof t=="function"?(n.local?qu:Zu)(n,o,io(this,"attr."+e,t)):t==null?(n.local?Xu:Fu)(n):(n.local?Wu:Yu)(n,o,t))}function Uu(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function Ku(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function Qu(e,t){var n,o;function r(){var i=t.apply(this,arguments);return i!==o&&(n=(o=i)&&Ku(e,i)),n}return r._value=t,r}function Ju(e,t){var n,o;function r(){var i=t.apply(this,arguments);return i!==o&&(n=(o=i)&&Uu(e,i)),n}return r._value=t,r}function ed(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=an(e);return this.tween(n,(o.local?Qu:Ju)(o,t))}function td(e,t){return function(){ro(this,e).delay=+t.apply(this,arguments)}}function nd(e,t){return t=+t,function(){ro(this,e).delay=t}}function od(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?td:nd)(t,e)):me(this.node(),t).delay}function rd(e,t){return function(){be(this,e).duration=+t.apply(this,arguments)}}function id(e,t){return t=+t,function(){be(this,e).duration=t}}function sd(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?rd:id)(t,e)):me(this.node(),t).duration}function ad(e,t){if(typeof t!="function")throw new Error;return function(){be(this,e).ease=t}}function cd(e){var t=this._id;return arguments.length?this.each(ad(t,e)):me(this.node(),t).ease}function ld(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;be(this,e).ease=n}}function ud(e){if(typeof e!="function")throw new Error;return this.each(ld(this._id,e))}function dd(e){typeof e!="function"&&(e=Vr(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 Ne(o,this._parents,this._name,this._id)}function fd(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,g=0;g<u;++g)(f=l[g]||c[g])&&(d[g]=f);for(;a<o;++a)s[a]=t[a];return new Ne(s,this._parents,this._name,this._id)}function hd(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 gd(e,t,n){var o,r,i=hd(t)?ro:be;return function(){var s=i(this,e),a=s.on;a!==o&&(r=(o=a).copy()).on(t,n),s.on=r}}function pd(e,t){var n=this._id;return arguments.length<2?me(this.node(),n).on.on(e):this.each(gd(n,e,t))}function md(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function yd(){return this.on("end.remove",md(this._id))}function xd(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Jn(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,ln(c[f],t,n,f,c,me(u,n)));return new Ne(i,this._parents,t,n)}function wd(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Or(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),g,p=me(u,n),m=0,v=f.length;m<v;++m)(g=f[m])&&ln(g,t,n,m,f,p);i.push(f),s.push(u)}return new Ne(i,s,t,n)}var vd=Nt.prototype.constructor;function bd(){return new vd(this._groups,this._parents)}function _d(e,t){var n,o,r;return function(){var i=Qe(this,e),s=(this.style.removeProperty(e),Qe(this,e));return i===s?null:i===n&&s===o?r:r=t(n=i,o=s)}}function di(e){return function(){this.style.removeProperty(e)}}function Sd(e,t,n){var o,r=n+"",i;return function(){var s=Qe(this,e);return s===r?null:s===o?i:i=t(o=s,n)}}function Ed(e,t,n){var o,r,i;return function(){var s=Qe(this,e),a=n(this),l=a+"";return a==null&&(l=a=(this.style.removeProperty(e),Qe(this,e))),s===l?null:s===o&&l===r?i:(r=l,i=t(o=s,a))}}function Cd(e,t){var n,o,r,i="style."+t,s="end."+i,a;return function(){var l=be(this,e),c=l.on,u=l.value[i]==null?a||(a=di(t)):void 0;(c!==n||r!==u)&&(o=(n=c).copy()).on(s,r=u),l.on=o}}function Nd(e,t,n){var o=(e+="")=="transform"?Mu:ui;return t==null?this.styleTween(e,_d(e,o)).on("end.style."+e,di(e)):typeof t=="function"?this.styleTween(e,Ed(e,o,io(this,"style."+e,t))).each(Cd(this._id,e)):this.styleTween(e,Sd(e,o,t),n).on("end.style."+e,null)}function Md(e,t,n){return function(o){this.style.setProperty(e,t.call(this,o),n)}}function kd(e,t,n){var o,r;function i(){var s=t.apply(this,arguments);return s!==r&&(o=(r=s)&&Md(e,s,n)),o}return i._value=t,i}function Id(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,kd(e,t,n??""))}function zd(e){return function(){this.textContent=e}}function Ad(e){return function(){var t=e(this);this.textContent=t??""}}function $d(e){return this.tween("text",typeof e=="function"?Ad(io(this,"text",e)):zd(e==null?"":e+""))}function Pd(e){return function(t){this.textContent=e.call(this,t)}}function Dd(e){var t,n;function o(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&Pd(r)),t}return o._value=e,o}function Td(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,Dd(e))}function Hd(){for(var e=this._name,t=this._id,n=fi(),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=me(l,t);ln(l,e,n,c,s,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new Ne(o,this._parents,e,n)}function jd(){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=be(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 Rd=0;function Ne(e,t,n,o){this._groups=e,this._parents=t,this._name=n,this._id=o}function fi(){return++Rd}var Se=Nt.prototype;Ne.prototype={constructor:Ne,select:xd,selectAll:wd,selectChild:Se.selectChild,selectChildren:Se.selectChildren,filter:dd,merge:fd,selection:bd,transition:Hd,call:Se.call,nodes:Se.nodes,node:Se.node,size:Se.size,empty:Se.empty,each:Se.each,on:pd,attr:Gu,attrTween:ed,style:Nd,styleTween:Id,text:$d,textTween:Td,remove:yd,tween:Bu,delay:od,duration:sd,ease:cd,easeVarying:ud,end:jd,[Symbol.iterator]:Se[Symbol.iterator]};function Ld(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var Od={time:null,delay:0,duration:250,ease:Ld};function Vd(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 Bd(e){var t,n;e instanceof Ne?(t=e._id,e=e._name):(t=fi(),(n=Od).time=oo(),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])&&ln(l,e,t,c,s,n||Vd(l,t));return new Ne(o,this._parents,e,t)}Nt.prototype.interrupt=Lu;Nt.prototype.transition=Bd;const jt=e=>()=>e;function Fd(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 Ee(e,t,n){this.k=e,this.x=t,this.y=n}Ee.prototype={constructor:Ee,scale:function(e){return e===1?this:new Ee(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Ee(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 un=new Ee(1,0,0);hi.prototype=Ee.prototype;function hi(e){for(;!e.__zoom;)if(!(e=e.parentNode))return un;return e.__zoom}function Nn(e){e.stopImmediatePropagation()}function dt(e){e.preventDefault(),e.stopImmediatePropagation()}function Xd(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function Yd(){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 Xo(){return this.__zoom||un}function Wd(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function Zd(){return navigator.maxTouchPoints||"ontouchstart"in this}function qd(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 gi(){var e=Xd,t=Yd,n=qd,o=Wd,r=Zd,i=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],a=250,l=Ft,c=sn("start","zoom","end"),u,d,f,g=500,p=150,m=0,v=10;function x(b){b.property("__zoom",Xo).on("wheel.zoom",M,{passive:!1}).on("mousedown.zoom",z).on("dblclick.zoom",O).filter(r).on("touchstart.zoom",k).on("touchmove.zoom",T).on("touchend.zoom touchcancel.zoom",j).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}x.transform=function(b,I,N,$){var A=b.selection?b.selection():b;A.property("__zoom",Xo),b!==A?C(b,I,N,$):A.interrupt().each(function(){E(this,arguments).event($).start().zoom(null,typeof I=="function"?I.apply(this,arguments):I).end()})},x.scaleBy=function(b,I,N,$){x.scaleTo(b,function(){var A=this.__zoom.k,D=typeof I=="function"?I.apply(this,arguments):I;return A*D},N,$)},x.scaleTo=function(b,I,N,$){x.transform(b,function(){var A=t.apply(this,arguments),D=this.__zoom,H=N==null?w(A):typeof N=="function"?N.apply(this,arguments):N,L=D.invert(H),R=typeof I=="function"?I.apply(this,arguments):I;return n(h(_(D,R),H,L),A,s)},N,$)},x.translateBy=function(b,I,N,$){x.transform(b,function(){return n(this.__zoom.translate(typeof I=="function"?I.apply(this,arguments):I,typeof N=="function"?N.apply(this,arguments):N),t.apply(this,arguments),s)},null,$)},x.translateTo=function(b,I,N,$,A){x.transform(b,function(){var D=t.apply(this,arguments),H=this.__zoom,L=$==null?w(D):typeof $=="function"?$.apply(this,arguments):$;return n(un.translate(L[0],L[1]).scale(H.k).translate(typeof I=="function"?-I.apply(this,arguments):-I,typeof N=="function"?-N.apply(this,arguments):-N),D,s)},$,A)};function _(b,I){return I=Math.max(i[0],Math.min(i[1],I)),I===b.k?b:new Ee(I,b.x,b.y)}function h(b,I,N){var $=I[0]-N[0]*b.k,A=I[1]-N[1]*b.k;return $===b.x&&A===b.y?b:new Ee(b.k,$,A)}function w(b){return[(+b[0][0]+ +b[1][0])/2,(+b[0][1]+ +b[1][1])/2]}function C(b,I,N,$){b.on("start.zoom",function(){E(this,arguments).event($).start()}).on("interrupt.zoom end.zoom",function(){E(this,arguments).event($).end()}).tween("zoom",function(){var A=this,D=arguments,H=E(A,D).event($),L=t.apply(A,D),R=N==null?w(L):typeof N=="function"?N.apply(A,D):N,F=Math.max(L[1][0]-L[0][0],L[1][1]-L[0][1]),B=A.__zoom,Z=typeof I=="function"?I.apply(A,D):I,U=l(B.invert(R).concat(F/B.k),Z.invert(R).concat(F/Z.k));return function(W){if(W===1)W=Z;else{var V=U(W),Y=F/V[2];W=new Ee(Y,R[0]-V[0]*Y,R[1]-V[1]*Y)}H.zoom(null,W)}})}function E(b,I,N){return!N&&b.__zooming||new S(b,I)}function S(b,I){this.that=b,this.args=I,this.active=0,this.sourceEvent=null,this.extent=t.apply(b,I),this.taps=0}S.prototype={event:function(b){return b&&(this.sourceEvent=b),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(b,I){return this.mouse&&b!=="mouse"&&(this.mouse[1]=I.invert(this.mouse[0])),this.touch0&&b!=="touch"&&(this.touch0[1]=I.invert(this.touch0[0])),this.touch1&&b!=="touch"&&(this.touch1[1]=I.invert(this.touch1[0])),this.that.__zoom=I,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(b){var I=le(this.that).datum();c.call(b,this.that,new Fd(b,{sourceEvent:this.sourceEvent,target:x,transform:this.that.__zoom,dispatch:c}),I)}};function M(b,...I){if(!e.apply(this,arguments))return;var N=E(this,I).event(b),$=this.__zoom,A=Math.max(i[0],Math.min(i[1],$.k*Math.pow(2,o.apply(this,arguments)))),D=de(b);if(N.wheel)(N.mouse[0][0]!==D[0]||N.mouse[0][1]!==D[1])&&(N.mouse[1]=$.invert(N.mouse[0]=D)),clearTimeout(N.wheel);else{if($.k===A)return;N.mouse=[D,$.invert(D)],Wt(this),N.start()}dt(b),N.wheel=setTimeout(H,p),N.zoom("mouse",n(h(_($,A),N.mouse[0],N.mouse[1]),N.extent,s));function H(){N.wheel=null,N.end()}}function z(b,...I){if(f||!e.apply(this,arguments))return;var N=b.currentTarget,$=E(this,I,!0).event(b),A=le(b.view).on("mousemove.zoom",R,!0).on("mouseup.zoom",F,!0),D=de(b,N),H=b.clientX,L=b.clientY;Kr(b.view),Nn(b),$.mouse=[D,this.__zoom.invert(D)],Wt(this),$.start();function R(B){if(dt(B),!$.moved){var Z=B.clientX-H,U=B.clientY-L;$.moved=Z*Z+U*U>m}$.event(B).zoom("mouse",n(h($.that.__zoom,$.mouse[0]=de(B,N),$.mouse[1]),$.extent,s))}function F(B){A.on("mousemove.zoom mouseup.zoom",null),Qr(B.view,$.moved),dt(B),$.event(B).end()}}function O(b,...I){if(e.apply(this,arguments)){var N=this.__zoom,$=de(b.changedTouches?b.changedTouches[0]:b,this),A=N.invert($),D=N.k*(b.shiftKey?.5:2),H=n(h(_(N,D),$,A),t.apply(this,I),s);dt(b),a>0?le(this).transition().duration(a).call(C,H,$,b):le(this).call(x.transform,H,$,b)}}function k(b,...I){if(e.apply(this,arguments)){var N=b.touches,$=N.length,A=E(this,I,b.changedTouches.length===$).event(b),D,H,L,R;for(Nn(b),H=0;H<$;++H)L=N[H],R=de(L,this),R=[R,this.__zoom.invert(R),L.identifier],A.touch0?!A.touch1&&A.touch0[2]!==R[2]&&(A.touch1=R,A.taps=0):(A.touch0=R,D=!0,A.taps=1+!!u);u&&(u=clearTimeout(u)),D&&(A.taps<2&&(d=R[0],u=setTimeout(function(){u=null},g)),Wt(this),A.start())}}function T(b,...I){if(this.__zooming){var N=E(this,I).event(b),$=b.changedTouches,A=$.length,D,H,L,R;for(dt(b),D=0;D<A;++D)H=$[D],L=de(H,this),N.touch0&&N.touch0[2]===H.identifier?N.touch0[0]=L:N.touch1&&N.touch1[2]===H.identifier&&(N.touch1[0]=L);if(H=N.that.__zoom,N.touch1){var F=N.touch0[0],B=N.touch0[1],Z=N.touch1[0],U=N.touch1[1],W=(W=Z[0]-F[0])*W+(W=Z[1]-F[1])*W,V=(V=U[0]-B[0])*V+(V=U[1]-B[1])*V;H=_(H,Math.sqrt(W/V)),L=[(F[0]+Z[0])/2,(F[1]+Z[1])/2],R=[(B[0]+U[0])/2,(B[1]+U[1])/2]}else if(N.touch0)L=N.touch0[0],R=N.touch0[1];else return;N.zoom("touch",n(h(H,L,R),N.extent,s))}}function j(b,...I){if(this.__zooming){var N=E(this,I).event(b),$=b.changedTouches,A=$.length,D,H;for(Nn(b),f&&clearTimeout(f),f=setTimeout(function(){f=null},g),D=0;D<A;++D)H=$[D],N.touch0&&N.touch0[2]===H.identifier?delete N.touch0:N.touch1&&N.touch1[2]===H.identifier&&delete N.touch1;if(N.touch1&&!N.touch0&&(N.touch0=N.touch1,delete N.touch1),N.touch0)N.touch0[1]=this.__zoom.invert(N.touch0[0]);else if(N.end(),N.taps===2&&(H=de(H,this),Math.hypot(d[0]-H[0],d[1]-H[1])<v)){var L=le(this).on("dblclick.zoom");L&&L.apply(this,arguments)}}}return x.wheelDelta=function(b){return arguments.length?(o=typeof b=="function"?b:jt(+b),x):o},x.filter=function(b){return arguments.length?(e=typeof b=="function"?b:jt(!!b),x):e},x.touchable=function(b){return arguments.length?(r=typeof b=="function"?b:jt(!!b),x):r},x.extent=function(b){return arguments.length?(t=typeof b=="function"?b:jt([[+b[0][0],+b[0][1]],[+b[1][0],+b[1][1]]]),x):t},x.scaleExtent=function(b){return arguments.length?(i[0]=+b[0],i[1]=+b[1],x):[i[0],i[1]]},x.translateExtent=function(b){return arguments.length?(s[0][0]=+b[0][0],s[1][0]=+b[1][0],s[0][1]=+b[0][1],s[1][1]=+b[1][1],x):[[s[0][0],s[0][1]],[s[1][0],s[1][1]]]},x.constrain=function(b){return arguments.length?(n=b,x):n},x.duration=function(b){return arguments.length?(a=+b,x):a},x.interpolate=function(b){return arguments.length?(l=b,x):l},x.on=function(){var b=c.on.apply(c,arguments);return b===c?x:b},x.clickDistance=function(b){return arguments.length?(m=(b=+b)*b,x):Math.sqrt(m)},x.tapDistance=function(b){return arguments.length?(v=+b,x):v},x}const ve={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."},bt=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],pi=["Enter"," ","Escape"],mi={"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 et;(function(e){e.Strict="strict",e.Loose="loose"})(et||(et={}));var Re;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(Re||(Re={}));var _t;(function(e){e.Partial="partial",e.Full="full"})(_t||(_t={}));const yi={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var Ae;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Ae||(Ae={}));var en;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(en||(en={}));var X;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(X||(X={}));const Yo={[X.Left]:X.Right,[X.Right]:X.Left,[X.Top]:X.Bottom,[X.Bottom]:X.Top};function xi(e){return e===null?null:e?"valid":"invalid"}const wi=e=>"id"in e&&"source"in e&&"target"in e,Gd=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),so=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),kt=(e,t=[0,0])=>{const{width:n,height:o}=Me(e),r=e.origin??t,i=n*r[0],s=o*r[1];return{x:e.position.x-i,y:e.position.y-s}},Ud=(e,t={nodeOrigin:[0,0]})=>{if(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):so(r)?r:t.nodeLookup.get(r.id));const a=s?tn(s,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return dn(o,a)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return fn(n)},It=(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=dn(n,tn(r)),o=!0)}),o?fn(n):{x:0,y:0,width:0,height:0}},ao=(e,t,[n,o,r]=[0,0,1],i=!1,s=!1)=>{const a={...At(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 g=u.width??c.width??c.initialWidth??null,p=u.height??c.height??c.initialHeight??null,m=St(a,nt(c)),v=(g??0)*(p??0),x=i&&m>0;(!c.internals.handleBounds||x||m>=v||c.dragging)&&l.push(c)}return l},Kd=(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 Qd(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 Jd({nodes:e,width:t,height:n,panZoom:o,minZoom:r,maxZoom:i},s){if(e.size===0)return Promise.resolve(!0);const a=Qd(e,s),l=It(a),c=co(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 vi({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",ve.error005());else{const g=a.measured.width,p=a.measured.height;g&&p&&(d=[[l,c],[l+g,c+p]])}else a&&ot(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=ot(d)?Ve(t,d,s.measured):t;return(s.measured.width===void 0||s.measured.height===void 0)&&i?.("015",ve.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 ef({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 g=i.has(f.id),p=!g&&f.parentId&&s.find(m=>m.id===f.parentId);(g||p)&&s.push(f)}const a=new Set(t.map(f=>f.id)),l=o.filter(f=>f.deletable!==!1),u=Kd(s,l);for(const f of l)a.has(f.id)&&!u.find(p=>p.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 tt=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),Ve=(e={x:0,y:0},t,n)=>({x:tt(e.x,t[0][0],t[1][0]-(n?.width??0)),y:tt(e.y,t[0][1],t[1][1]-(n?.height??0))});function bi(e,t,n){const{width:o,height:r}=Me(n),{x:i,y:s}=n.internals.positionAbsolute;return Ve(e,[[i,s],[i+o,s+r]],t)}const Wo=(e,t,n)=>e<t?tt(Math.abs(e-t),1,t)/t:e>n?-tt(Math.abs(e-n),1,t)/t:0,_i=(e,t,n=15,o=40)=>{const r=Wo(e.x,o,t.width-o)*n,i=Wo(e.y,o,t.height-o)*n;return[r,i]},dn=(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)}),Wn=({x:e,y:t,width:n,height:o})=>({x:e,y:t,x2:e+n,y2:t+o}),fn=({x:e,y:t,x2:n,y2:o})=>({x:e,y:t,width:n-e,height:o-t}),nt=(e,t=[0,0])=>{const{x:n,y:o}=so(e)?e.internals.positionAbsolute:kt(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}},tn=(e,t=[0,0])=>{const{x:n,y:o}=so(e)?e.internals.positionAbsolute:kt(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)}},Si=(e,t)=>fn(dn(Wn(e),Wn(t))),St=(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)},Zo=e=>ge(e.width)&&ge(e.height)&&ge(e.x)&&ge(e.y),ge=e=>!isNaN(e)&&isFinite(e),tf=(e,t)=>{},zt=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),At=({x:e,y:t},[n,o,r],i=!1,s=[1,1])=>{const a={x:(e-n)/r,y:(t-o)/r};return i?zt(a,s):a},nn=({x:e,y:t},[n,o,r])=>({x:e*r+n,y:t*r+o});function Xe(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 nf(e,t,n){if(typeof e=="string"||typeof e=="number"){const o=Xe(e,n),r=Xe(e,t);return{top:o,right:r,bottom:o,left:r,x:r*2,y:o*2}}if(typeof e=="object"){const o=Xe(e.top??e.y??0,n),r=Xe(e.bottom??e.y??0,n),i=Xe(e.left??e.x??0,t),s=Xe(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 of(e,t,n,o,r,i){const{x:s,y:a}=nn(e,[t,n,o]),{x:l,y:c}=nn({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 co=(e,t,n,o,r,i)=>{const s=nf(i,t,n),a=(t-s.x)/e.width,l=(n-s.y)/e.height,c=Math.min(a,l),u=tt(c,o,r),d=e.x+e.width/2,f=e.y+e.height/2,g=t/2-d*u,p=n/2-f*u,m=of(e,g,p,u,t,n),v={left:Math.min(m.left-s.left,0),top:Math.min(m.top-s.top,0),right:Math.min(m.right-s.right,0),bottom:Math.min(m.bottom-s.bottom,0)};return{x:g-v.left+v.right,y:p-v.top+v.bottom,zoom:u}},Et=()=>typeof navigator<"u"&&navigator?.userAgent?.indexOf("Mac")>=0;function ot(e){return e!=null&&e!=="parent"}function Me(e){return{width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}}function Ei(e){return(e.measured?.width??e.width??e.initialWidth)!==void 0&&(e.measured?.height??e.height??e.initialHeight)!==void 0}function Ci(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 qo(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function rf(){let e,t;return{promise:new Promise((o,r)=>{e=o,t=r}),resolve:e,reject:t}}function sf(e){return{...mi,...e||{}}}function mt(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:o,containerBounds:r}){const{x:i,y:s}=pe(e),a=At({x:i-(r?.left??0),y:s-(r?.top??0)},o),{x:l,y:c}=n?zt(a,t):a;return{xSnapped:l,ySnapped:c,...a}}const lo=e=>({width:e.offsetWidth,height:e.offsetHeight}),Ni=e=>e?.getRootNode?.()||window?.document,af=["INPUT","SELECT","TEXTAREA"];function Mi(e){const t=e.composedPath?.()?.[0]||e.target;return t?.nodeType!==1?!1:af.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const ki=e=>"clientX"in e,pe=(e,t)=>{const n=ki(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)}},Go=(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,...lo(s)}})};function Ii({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 Rt(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function Uo({pos:e,x1:t,y1:n,x2:o,y2:r,c:i}){switch(e){case X.Left:return[t-Rt(t-o,i),n];case X.Right:return[t+Rt(o-t,i),n];case X.Top:return[t,n-Rt(n-r,i)];case X.Bottom:return[t,n+Rt(r-n,i)]}}function zi({sourceX:e,sourceY:t,sourcePosition:n=X.Bottom,targetX:o,targetY:r,targetPosition:i=X.Top,curvature:s=.25}){const[a,l]=Uo({pos:n,x1:e,y1:t,x2:o,y2:r,c:s}),[c,u]=Uo({pos:i,x1:o,y1:r,x2:e,y2:t,c:s}),[d,f,g,p]=Ii({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,g,p]}function Ai({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 cf({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 lf({sourceNode:e,targetNode:t,width:n,height:o,transform:r}){const i=dn(tn(e),tn(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 St(s,fn(i))>0}const uf=({source:e,sourceHandle:t,target:n,targetHandle:o})=>`xy-edge__${e}${t||""}-${n}${o||""}`,df=(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)),ff=(e,t,n={})=>{if(!e.source||!e.target)return t;const o=n.getEdgeId||uf;let r;return wi(e)?r={...e}:r={...e,id:o(e)},df(r,t)?t:(r.sourceHandle===null&&delete r.sourceHandle,r.targetHandle===null&&delete r.targetHandle,t.concat(r))};function $i({sourceX:e,sourceY:t,targetX:n,targetY:o}){const[r,i,s,a]=Ai({sourceX:e,sourceY:t,targetX:n,targetY:o});return[`M ${e},${t}L ${n},${o}`,r,i,s,a]}const Ko={[X.Left]:{x:-1,y:0},[X.Right]:{x:1,y:0},[X.Top]:{x:0,y:-1},[X.Bottom]:{x:0,y:1}},hf=({source:e,sourcePosition:t=X.Bottom,target:n})=>t===X.Left||t===X.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},Qo=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function gf({source:e,sourcePosition:t=X.Bottom,target:n,targetPosition:o=X.Top,center:r,offset:i,stepPosition:s}){const a=Ko[t],l=Ko[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=hf({source:c,sourcePosition:t,target:u}),f=d.x!==0?"x":"y",g=d[f];let p=[],m,v;const x={x:0,y:0},_={x:0,y:0},[,,h,w]=Ai({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(a[f]*l[f]===-1){f==="x"?(m=r.x??c.x+(u.x-c.x)*s,v=r.y??(c.y+u.y)/2):(m=r.x??(c.x+u.x)/2,v=r.y??c.y+(u.y-c.y)*s);const E=[{x:m,y:c.y},{x:m,y:u.y}],S=[{x:c.x,y:v},{x:u.x,y:v}];a[f]===g?p=f==="x"?E:S:p=f==="x"?S:E}else{const E=[{x:c.x,y:u.y}],S=[{x:u.x,y:c.y}];if(f==="x"?p=a.x===g?S:E:p=a.y===g?E:S,t===o){const T=Math.abs(e[f]-n[f]);if(T<=i){const j=Math.min(i-1,i-T);a[f]===g?x[f]=(c[f]>e[f]?-1:1)*j:_[f]=(u[f]>n[f]?-1:1)*j}}if(t!==o){const T=f==="x"?"y":"x",j=a[f]===l[T],b=c[T]>u[T],I=c[T]<u[T];(a[f]===1&&(!j&&b||j&&I)||a[f]!==1&&(!j&&I||j&&b))&&(p=f==="x"?E:S)}const M={x:c.x+x.x,y:c.y+x.y},z={x:u.x+_.x,y:u.y+_.y},O=Math.max(Math.abs(M.x-p[0].x),Math.abs(z.x-p[0].x)),k=Math.max(Math.abs(M.y-p[0].y),Math.abs(z.y-p[0].y));O>=k?(m=(M.x+z.x)/2,v=p[0].y):(m=p[0].x,v=(M.y+z.y)/2)}return[[e,{x:c.x+x.x,y:c.y+x.y},...p,{x:u.x+_.x,y:u.y+_.y},n],m,v,h,w]}function pf(e,t,n,o){const r=Math.min(Qo(e,t)/2,Qo(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 Zn({sourceX:e,sourceY:t,sourcePosition:n=X.Bottom,targetX:o,targetY:r,targetPosition:i=X.Top,borderRadius:s=5,centerX:a,centerY:l,offset:c=20,stepPosition:u=.5}){const[d,f,g,p,m]=gf({source:{x:e,y:t},sourcePosition:n,target:{x:o,y:r},targetPosition:i,center:{x:a,y:l},offset:c,stepPosition:u});return[d.reduce((x,_,h)=>{let w="";return h>0&&h<d.length-1?w=pf(d[h-1],_,d[h+1],s):w=`${h===0?"M":"L"}${_.x} ${_.y}`,x+=w,x},""),f,g,p,m]}function Jo(e){return e&&!!(e.internals.handleBounds||e.handles?.length)&&!!(e.measured.width||e.width||e.initialWidth)}function mf(e){const{sourceNode:t,targetNode:n}=e;if(!Jo(t)||!Jo(n))return null;const o=t.internals.handleBounds||er(t.handles),r=n.internals.handleBounds||er(n.handles),i=tr(o?.source??[],e.sourceHandle),s=tr(e.connectionMode===et.Strict?r?.target??[]:(r?.target??[]).concat(r?.source??[]),e.targetHandle);if(!i||!s)return e.onError?.("008",ve.error008(i?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const a=i?.position||X.Bottom,l=s?.position||X.Top,c=Be(t,i,a),u=Be(n,s,l);return{sourceX:c.x,sourceY:c.y,targetX:u.x,targetY:u.y,sourcePosition:a,targetPosition:l}}function er(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 Be(e,t,n=X.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??Me(e);if(o)return{x:r+s/2,y:i+a/2};switch(t?.position??n){case X.Top:return{x:r+s/2,y:i};case X.Right:return{x:r+s,y:i+a/2};case X.Bottom:return{x:r+s/2,y:i+a};case X.Left:return{x:r,y:i+a/2}}}function tr(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function qn(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(o=>`${o}=${e[o]}`).join("&")}`:""}function yf(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=qn(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 Pi=1e3,xf=10,uo={nodeOrigin:[0,0],nodeExtent:bt,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},wf={...uo,checkEquality:!0};function fo(e,t){const n={...e};for(const o in t)t[o]!==void 0&&(n[o]=t[o]);return n}function vf(e,t,n){const o=fo(uo,n);for(const r of e.values())if(r.parentId)go(r,e,t,o);else{const i=kt(r,o.nodeOrigin),s=ot(r.extent)?r.extent:o.nodeExtent,a=Ve(i,s,Me(r));r.internals.positionAbsolute=a}}function bf(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 ho(e){return e==="manual"}function Gn(e,t,n,o={}){const r=fo(wf,o),i={i:0},s=new Map(t),a=r?.elevateNodesOnSelect&&!ho(r.zIndexMode)?Pi:0;let l=e.length>0;t.clear(),n.clear();for(const c of e){let u=s.get(c.id);if(r.checkEquality&&c===u?.internals.userNode)t.set(c.id,u);else{const d=kt(c,r.nodeOrigin),f=ot(c.extent)?c.extent:r.nodeExtent,g=Ve(d,f,Me(c));u={...r.defaults,...c,measured:{width:c.measured?.width,height:c.measured?.height},internals:{positionAbsolute:g,handleBounds:bf(c,u),z:Di(c,a,r.zIndexMode),userNode:c}},t.set(c.id,u)}(u.measured===void 0||u.measured.width===void 0||u.measured.height===void 0)&&!u.hidden&&(l=!1),c.parentId&&go(u,t,n,o,i)}return l}function _f(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 go(e,t,n,o,r){const{elevateNodesOnSelect:i,nodeOrigin:s,nodeExtent:a,zIndexMode:l}=fo(uo,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}_f(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*xf),r&&u.internals.rootParentIndex!==void 0&&(r.i=u.internals.rootParentIndex);const d=i&&!ho(l)?Pi:0,{x:f,y:g,z:p}=Sf(e,u,s,a,d,l),{positionAbsolute:m}=e.internals,v=f!==m.x||g!==m.y;(v||p!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:v?{x:f,y:g}:m,z:p}})}function Di(e,t,n){const o=ge(e.zIndex)?e.zIndex:0;return ho(n)?o:o+(e.selected?t:0)}function Sf(e,t,n,o,r,i){const{x:s,y:a}=t.internals.positionAbsolute,l=Me(e),c=kt(e,n),u=ot(e.extent)?Ve(c,e.extent,l):c;let d=Ve({x:s+u.x,y:a+u.y},o,l);e.extent==="parent"&&(d=bi(d,l,t));const f=Di(e,r,i),g=t.internals.z??0;return{x:d.x,y:d.y,z:g>=f?g+1:f}}function po(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??nt(a),c=Si(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=Me(a),d=a.origin??o,f=s.x<c.x?Math.round(Math.abs(c.x-s.x)):0,g=s.y<c.y?Math.round(Math.abs(c.y-s.y)):0,p=Math.max(u.width,Math.round(s.width)),m=Math.max(u.height,Math.round(s.height)),v=(p-u.width)*d[0],x=(m-u.height)*d[1];(f>0||g>0||v||x)&&(r.push({id:l,type:"position",position:{x:a.position.x-f+v,y:a.position.y-g+x}}),n.get(l)?.forEach(_=>{e.some(h=>h.id===_.id)||r.push({id:_.id,type:"position",position:{x:_.position.x+f,y:_.position.y+g}})})),(u.width<s.width||u.height<s.height||f||g)&&r.push({id:l,type:"dimensions",setAttributes:!0,dimensions:{width:p+(f?d[0]*f-v:0),height:m+(g?d[1]*g-x:0)}})}),r}function Ef(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 g of e.values()){const p=t.get(g.id);if(!p)continue;if(p.hidden){t.set(p.id,{...p,internals:{...p.internals,handleBounds:void 0}}),l=!0;continue}const m=lo(g.nodeElement),v=p.measured.width!==m.width||p.measured.height!==m.height;if(!!(m.width&&m.height&&(v||!p.internals.handleBounds||g.force))){const _=g.nodeElement.getBoundingClientRect(),h=ot(p.extent)?p.extent:i;let{positionAbsolute:w}=p.internals;p.parentId&&p.extent==="parent"?w=bi(w,m,t.get(p.parentId)):h&&(w=Ve(w,h,m));const C={...p,measured:m,internals:{...p.internals,positionAbsolute:w,handleBounds:{source:Go("source",g.nodeElement,_,d,p.id),target:Go("target",g.nodeElement,_,d,p.id)}}};t.set(p.id,C),p.parentId&&go(C,t,n,{nodeOrigin:r,zIndexMode:s}),l=!0,v&&(c.push({id:p.id,type:"dimensions",dimensions:m}),p.expandParent&&p.parentId&&f.push({id:p.id,parentId:p.parentId,rect:nt(C,r)}))}}if(f.length>0){const g=po(f,t,n,r);c.push(...g)}return{changes:c,updatedInternals:l}}async function Cf({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 nr(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 Ti(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}`;nr("source",l,u,e,r,s),nr("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 or(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 Nf(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 Mn({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 Mf({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=zt(i,t);return{x:s.x-i.x,y:s.y-i.y}}function kf({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,g=!1,p=!1,m=null;function v({noDragClassName:_,handleSelector:h,domNode:w,isSelectable:C,nodeId:E,nodeClickDistance:S=0}){f=le(w);function M({x:T,y:j}){const{nodeLookup:b,nodeExtent:I,snapGrid:N,snapToGrid:$,nodeOrigin:A,onNodeDrag:D,onSelectionDrag:H,onError:L,updateNodePositions:R}=t();i={x:T,y:j};let F=!1;const B=a.size>1,Z=B&&I?Wn(It(a)):null,U=B&&$?Mf({dragItems:a,snapGrid:N,x:T,y:j}):null;for(const[W,V]of a){if(!b.has(W))continue;let Y={x:T-V.distance.x,y:j-V.distance.y};$&&(Y=U?{x:Math.round(Y.x+U.x),y:Math.round(Y.y+U.y)}:zt(Y,N));let Q=null;if(B&&I&&!V.extent&&Z){const{positionAbsolute:G}=V.internals,ee=G.x-Z.x+I[0][0],ne=G.x+V.measured.width-Z.x2+I[1][0],te=G.y-Z.y+I[0][1],ae=G.y+V.measured.height-Z.y2+I[1][1];Q=[[ee,te],[ne,ae]]}const{position:K,positionAbsolute:q}=vi({nodeId:W,nextPosition:Y,nodeLookup:b,nodeExtent:Q||I,nodeOrigin:A,onError:L});F=F||V.position.x!==K.x||V.position.y!==K.y,V.position=K,V.internals.positionAbsolute=q}if(p=p||F,!!F&&(R(a,!0),m&&(o||D||!E&&H))){const[W,V]=Mn({nodeId:E,dragItems:a,nodeLookup:b});o?.(m,a,W,V),D?.(m,W,V),E||H?.(m,V)}}async function z(){if(!u)return;const{transform:T,panBy:j,autoPanSpeed:b,autoPanOnNodeDrag:I}=t();if(!I){l=!1,cancelAnimationFrame(s);return}const[N,$]=_i(c,u,b);(N!==0||$!==0)&&(i.x=(i.x??0)-N/T[2],i.y=(i.y??0)-$/T[2],await j({x:N,y:$})&&M(i)),s=requestAnimationFrame(z)}function O(T){const{nodeLookup:j,multiSelectionActive:b,nodesDraggable:I,transform:N,snapGrid:$,snapToGrid:A,selectNodesOnDrag:D,onNodeDragStart:H,onSelectionDragStart:L,unselectNodesAndEdges:R}=t();d=!0,(!D||!C)&&!b&&E&&(j.get(E)?.selected||R()),C&&D&&E&&e?.(E);const F=mt(T.sourceEvent,{transform:N,snapGrid:$,snapToGrid:A,containerBounds:u});if(i=F,a=Nf(j,I,F,E),a.size>0&&(n||H||!E&&L)){const[B,Z]=Mn({nodeId:E,dragItems:a,nodeLookup:j});n?.(T.sourceEvent,a,B,Z),H?.(T.sourceEvent,B,Z),E||L?.(T.sourceEvent,Z)}}const k=Jr().clickDistance(S).on("start",T=>{const{domNode:j,nodeDragThreshold:b,transform:I,snapGrid:N,snapToGrid:$}=t();u=j?.getBoundingClientRect()||null,g=!1,p=!1,m=T.sourceEvent,b===0&&O(T),i=mt(T.sourceEvent,{transform:I,snapGrid:N,snapToGrid:$,containerBounds:u}),c=pe(T.sourceEvent,u)}).on("drag",T=>{const{autoPanOnNodeDrag:j,transform:b,snapGrid:I,snapToGrid:N,nodeDragThreshold:$,nodeLookup:A}=t(),D=mt(T.sourceEvent,{transform:b,snapGrid:I,snapToGrid:N,containerBounds:u});if(m=T.sourceEvent,(T.sourceEvent.type==="touchmove"&&T.sourceEvent.touches.length>1||E&&!A.has(E))&&(g=!0),!g){if(!l&&j&&d&&(l=!0,z()),!d){const H=pe(T.sourceEvent,u),L=H.x-c.x,R=H.y-c.y;Math.sqrt(L*L+R*R)>$&&O(T)}(i.x!==D.xSnapped||i.y!==D.ySnapped)&&a&&d&&(c=pe(T.sourceEvent,u),M(D))}}).on("end",T=>{if(!(!d||g)&&(l=!1,d=!1,cancelAnimationFrame(s),a.size>0)){const{nodeLookup:j,updateNodePositions:b,onNodeDragStop:I,onSelectionDragStop:N}=t();if(p&&(b(a,!1),p=!1),r||I||!E&&N){const[$,A]=Mn({nodeId:E,dragItems:a,nodeLookup:j,dragging:!1});r?.(T.sourceEvent,a,$,A),I?.(T.sourceEvent,$,A),E||N?.(T.sourceEvent,A)}}}).filter(T=>{const j=T.target;return!T.button&&(!_||!or(j,`.${_}`,w))&&(!h||or(j,h,w))});f.call(k)}function x(){f?.on(".drag",null)}return{update:v,destroy:x}}function If(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())St(r,nt(i))>0&&o.push(i);return o}const zf=250;function Af(e,t,n,o){let r=[],i=1/0;const s=If(e,n,t+zf);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}=Be(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 ji(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,...Be(s,l,l.position,!0)}:l}function Ri(e,t){return e||(t?.classList.contains("target")?"target":t?.classList.contains("source")?"source":null)}function $f(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const Li=()=>!0;function Pf(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:g,onConnectStart:p,onConnect:m,onConnectEnd:v,isValidConnection:x=Li,onReconnectEnd:_,updateConnection:h,getTransform:w,getFromHandle:C,autoPanSpeed:E,dragThreshold:S=1,handleDomNode:M}){const z=Ni(e.target);let O=0,k;const{x:T,y:j}=pe(e),b=Ri(i,M),I=a?.getBoundingClientRect();let N=!1;if(!I||!b)return;const $=ji(r,b,o,l,t);if(!$)return;let A=pe(e,I),D=!1,H=null,L=!1,R=null;function F(){if(!u||!I)return;const[K,q]=_i(A,I,E);f({x:K,y:q}),O=requestAnimationFrame(F)}const B={...$,nodeId:r,type:b,position:$.position},Z=l.get(r);let W={inProgress:!0,isValid:null,from:Be(Z,B,X.Left,!0),fromHandle:B,fromPosition:B.position,fromNode:Z,to:A,toHandle:null,toPosition:Yo[B.position],toNode:null,pointer:A};function V(){N=!0,h(W),p?.(e,{nodeId:r,handleId:o,handleType:b})}S===0&&V();function Y(K){if(!N){const{x:ae,y:ke}=pe(K),_e=ae-T,De=ke-j;if(!(_e*_e+De*De>S*S))return;V()}if(!C()||!B){Q(K);return}const q=w();A=pe(K,I),k=Af(At(A,q,!1,[1,1]),n,l,B),D||(F(),D=!0);const G=Oi(K,{handle:k,connectionMode:t,fromNodeId:r,fromHandleId:o,fromType:s?"target":"source",isValidConnection:x,doc:z,lib:c,flowId:d,nodeLookup:l});R=G.handleDomNode,H=G.connection,L=$f(!!k,G.isValid);const ee=l.get(r),ne=ee?Be(ee,B,X.Left,!0):W.from,te={...W,from:ne,isValid:L,to:G.toHandle&&L?nn({x:G.toHandle.x,y:G.toHandle.y},q):A,toHandle:G.toHandle,toPosition:L&&G.toHandle?G.toHandle.position:Yo[B.position],toNode:G.toHandle?l.get(G.toHandle.nodeId):null,pointer:A};h(te),W=te}function Q(K){if(!("touches"in K&&K.touches.length>0)){if(N){(k||R)&&H&&L&&m?.(H);const{inProgress:q,...G}=W,ee={...G,toPosition:W.toHandle?W.toPosition:null};v?.(K,ee),i&&_?.(K,ee)}g(),cancelAnimationFrame(O),D=!1,L=!1,H=null,R=null,z.removeEventListener("mousemove",Y),z.removeEventListener("mouseup",Q),z.removeEventListener("touchmove",Y),z.removeEventListener("touchend",Q)}}z.addEventListener("mousemove",Y),z.addEventListener("mouseup",Q),z.addEventListener("touchmove",Y),z.addEventListener("touchend",Q)}function Oi(e,{handle:t,connectionMode:n,fromNodeId:o,fromHandleId:r,fromType:i,doc:s,lib:a,flowId:l,isValidConnection:c=Li,nodeLookup:u}){const d=i==="target",f=t?s.querySelector(`.${a}-flow__handle[data-id="${l}-${t?.nodeId}-${t?.id}-${t?.type}"]`):null,{x:g,y:p}=pe(e),m=s.elementFromPoint(g,p),v=m?.classList.contains(`${a}-flow__handle`)?m:f,x={handleDomNode:v,isValid:!1,connection:null,toHandle:null};if(v){const _=Ri(void 0,v),h=v.getAttribute("data-nodeid"),w=v.getAttribute("data-handleid"),C=v.classList.contains("connectable"),E=v.classList.contains("connectableend");if(!h||!_)return x;const S={source:d?h:o,sourceHandle:d?w:r,target:d?o:h,targetHandle:d?r:w};x.connection=S;const z=C&&E&&(n===et.Strict?d&&_==="source"||!d&&_==="target":h!==o||w!==r);x.isValid=z&&c(S),x.toHandle=ji(h,_,w,u,n,!0)}return x}const Un={onPointerDown:Pf,isValid:Oi};function Df({domNode:e,panZoom:t,getTransform:n,getViewScale:o}){const r=le(e);function i({translateExtent:a,width:l,height:c,zoomStep:u=1,pannable:d=!0,zoomable:f=!0,inversePan:g=!1}){const p=h=>{if(h.sourceEvent.type!=="wheel"||!t)return;const w=n(),C=h.sourceEvent.ctrlKey&&Et()?10:1,E=-h.sourceEvent.deltaY*(h.sourceEvent.deltaMode===1?.05:h.sourceEvent.deltaMode?1:.002)*u,S=w[2]*Math.pow(2,E*C);t.scaleTo(S)};let m=[0,0];const v=h=>{(h.sourceEvent.type==="mousedown"||h.sourceEvent.type==="touchstart")&&(m=[h.sourceEvent.clientX??h.sourceEvent.touches[0].clientX,h.sourceEvent.clientY??h.sourceEvent.touches[0].clientY])},x=h=>{const w=n();if(h.sourceEvent.type!=="mousemove"&&h.sourceEvent.type!=="touchmove"||!t)return;const C=[h.sourceEvent.clientX??h.sourceEvent.touches[0].clientX,h.sourceEvent.clientY??h.sourceEvent.touches[0].clientY],E=[C[0]-m[0],C[1]-m[1]];m=C;const S=o()*Math.max(w[2],Math.log(w[2]))*(g?-1:1),M={x:w[0]-E[0]*S,y:w[1]-E[1]*S},z=[[0,0],[l,c]];t.setViewportConstrained({x:M.x,y:M.y,zoom:w[2]},z,a)},_=gi().on("start",v).on("zoom",d?x:null).on("zoom.wheel",f?p:null);r.call(_,{})}function s(){r.on("zoom",null)}return{update:i,destroy:s,pointer:de}}const hn=e=>({x:e.x,y:e.y,zoom:e.k}),kn=({x:e,y:t,zoom:n})=>un.translate(e,t).scale(n),We=(e,t)=>e.target.closest(`.${t}`),Vi=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),Tf=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,In=(e,t=0,n=Tf,o=()=>{})=>{const r=typeof t=="number"&&t>0;return r||o(),r?e.transition().duration(t).ease(n).on("end",o):e},Bi=e=>{const t=e.ctrlKey&&Et()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function Hf({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:o,panOnScrollMode:r,panOnScrollSpeed:i,zoomOnPinch:s,onPanZoomStart:a,onPanZoom:l,onPanZoomEnd:c}){return u=>{if(We(u,t))return u.ctrlKey&&u.preventDefault(),!1;u.preventDefault(),u.stopImmediatePropagation();const d=n.property("__zoom").k||1;if(u.ctrlKey&&s){const v=de(u),x=Bi(u),_=d*Math.pow(2,x);o.scaleTo(n,_,v,u);return}const f=u.deltaMode===1?20:1;let g=r===Re.Vertical?0:u.deltaX*f,p=r===Re.Horizontal?0:u.deltaY*f;!Et()&&u.shiftKey&&r!==Re.Vertical&&(g=u.deltaY*f,p=0),o.translateBy(n,-(g/d)*i,-(p/d)*i,{internal:!0});const m=hn(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(l?.(u,m),e.panScrollTimeout=setTimeout(()=>{c?.(u,m),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,a?.(u,m))}}function jf({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(o,r){const i=o.type==="wheel",s=!t&&i&&!o.ctrlKey,a=We(o,e);if(o.ctrlKey&&i&&a&&o.preventDefault(),s||a)return null;o.preventDefault(),n.call(this,o,r)}}function Rf({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return o=>{if(o.sourceEvent?.internal)return;const r=hn(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 Lf({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:o,onPanZoom:r}){return i=>{e.usedRightMouseButton=!!(n&&Vi(t,e.mouseButton??0)),i.sourceEvent?.sync||o([i.transform.x,i.transform.y,i.transform.k]),r&&!i.sourceEvent?.internal&&r?.(i.sourceEvent,hn(i.transform))}}function Of({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:o,onPanZoomEnd:r,onPaneContextMenu:i}){return s=>{if(!s.sourceEvent?.internal&&(e.isZoomingOrPanning=!1,i&&Vi(t,e.mouseButton??0)&&!e.usedRightMouseButton&&s.sourceEvent&&i(s.sourceEvent),e.usedRightMouseButton=!1,o(!1),r)){const a=hn(s.transform);e.prevViewport=a,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{r?.(s.sourceEvent,a)},n?150:0)}}}function Vf({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,g=n&&d.ctrlKey,p=d.type==="wheel";if(d.button===1&&d.type==="mousedown"&&(We(d,`${c}-flow__node`)||We(d,`${c}-flow__edge`)))return!0;if(!o&&!f&&!r&&!i&&!n||s||u&&!p||We(d,a)&&p||We(d,l)&&(!p||r&&p&&!e)||!n&&d.ctrlKey&&p)return!1;if(!n&&d.type==="touchstart"&&d.touches?.length>1)return d.preventDefault(),!1;if(!f&&!r&&!g&&p||!o&&(d.type==="mousedown"||d.type==="touchstart")||Array.isArray(o)&&!o.includes(d.button)&&d.type==="mousedown")return!1;const m=Array.isArray(o)&&o.includes(d.button)||!d.button||d.button<=1;return(!d.ctrlKey||p)&&m}}function Bf({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=gi().scaleExtent([t,n]).translateExtent(o),f=le(e).call(d);_({x:r.x,y:r.y,zoom:tt(r.zoom,t,n)},[[0,0],[u.width,u.height]],o);const g=f.on("wheel.zoom"),p=f.on("dblclick.zoom");d.wheelDelta(Bi);function m(k,T){return f?new Promise(j=>{d?.interpolate(T?.interpolate==="linear"?pt:Ft).transform(In(f,T?.duration,T?.ease,()=>j(!0)),k)}):Promise.resolve(!1)}function v({noWheelClassName:k,noPanClassName:T,onPaneContextMenu:j,userSelectionActive:b,panOnScroll:I,panOnDrag:N,panOnScrollMode:$,panOnScrollSpeed:A,preventScrolling:D,zoomOnPinch:H,zoomOnScroll:L,zoomOnDoubleClick:R,zoomActivationKeyPressed:F,lib:B,onTransformChange:Z,connectionInProgress:U,paneClickDistance:W,selectionOnDrag:V}){b&&!c.isZoomingOrPanning&&x();const Y=I&&!F&&!b;d.clickDistance(V?1/0:!ge(W)||W<0?0:W);const Q=Y?Hf({zoomPanValues:c,noWheelClassName:k,d3Selection:f,d3Zoom:d,panOnScrollMode:$,panOnScrollSpeed:A,zoomOnPinch:H,onPanZoomStart:s,onPanZoom:i,onPanZoomEnd:a}):jf({noWheelClassName:k,preventScrolling:D,d3ZoomHandler:g});if(f.on("wheel.zoom",Q,{passive:!1}),!b){const q=Rf({zoomPanValues:c,onDraggingChange:l,onPanZoomStart:s});d.on("start",q);const G=Lf({zoomPanValues:c,panOnDrag:N,onPaneContextMenu:!!j,onPanZoom:i,onTransformChange:Z});d.on("zoom",G);const ee=Of({zoomPanValues:c,panOnDrag:N,panOnScroll:I,onPaneContextMenu:j,onPanZoomEnd:a,onDraggingChange:l});d.on("end",ee)}const K=Vf({zoomActivationKeyPressed:F,panOnDrag:N,zoomOnScroll:L,panOnScroll:I,zoomOnDoubleClick:R,zoomOnPinch:H,userSelectionActive:b,noPanClassName:T,noWheelClassName:k,lib:B,connectionInProgress:U});d.filter(K),R?f.on("dblclick.zoom",p):f.on("dblclick.zoom",null)}function x(){d.on("zoom",null)}async function _(k,T,j){const b=kn(k),I=d?.constrain()(b,T,j);return I&&await m(I),new Promise(N=>N(I))}async function h(k,T){const j=kn(k);return await m(j,T),new Promise(b=>b(j))}function w(k){if(f){const T=kn(k),j=f.property("__zoom");(j.k!==k.zoom||j.x!==k.x||j.y!==k.y)&&d?.transform(f,T,null,{sync:!0})}}function C(){const k=f?hi(f.node()):{x:0,y:0,k:1};return{x:k.x,y:k.y,zoom:k.k}}function E(k,T){return f?new Promise(j=>{d?.interpolate(T?.interpolate==="linear"?pt:Ft).scaleTo(In(f,T?.duration,T?.ease,()=>j(!0)),k)}):Promise.resolve(!1)}function S(k,T){return f?new Promise(j=>{d?.interpolate(T?.interpolate==="linear"?pt:Ft).scaleBy(In(f,T?.duration,T?.ease,()=>j(!0)),k)}):Promise.resolve(!1)}function M(k){d?.scaleExtent(k)}function z(k){d?.translateExtent(k)}function O(k){const T=!ge(k)||k<0?0:k;d?.clickDistance(T)}return{update:v,destroy:x,setViewport:h,setViewportConstrained:_,getViewport:C,scaleTo:E,scaleBy:S,setScaleExtent:M,setTranslateExtent:z,syncViewport:w,setClickDistance:O}}var rt;(function(e){e.Line="line",e.Handle="handle"})(rt||(rt={}));function Ff({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 rr(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 Ie(e,t){return Math.max(0,t-e)}function ze(e,t){return Math.max(0,e-t)}function Lt(e,t,n){return Math.max(0,t-e,e-n)}function ir(e,t){return e?!t:t}function Xf(e,t,n,o,r,i,s,a){let{affectsX:l,affectsY:c}=t;const{isHorizontal:u,isVertical:d}=t,f=u&&d,{xSnapped:g,ySnapped:p}=n,{minWidth:m,maxWidth:v,minHeight:x,maxHeight:_}=o,{x:h,y:w,width:C,height:E,aspectRatio:S}=e;let M=Math.floor(u?g-e.pointerX:0),z=Math.floor(d?p-e.pointerY:0);const O=C+(l?-M:M),k=E+(c?-z:z),T=-i[0]*C,j=-i[1]*E;let b=Lt(O,m,v),I=Lt(k,x,_);if(s){let A=0,D=0;l&&M<0?A=Ie(h+M+T,s[0][0]):!l&&M>0&&(A=ze(h+O+T,s[1][0])),c&&z<0?D=Ie(w+z+j,s[0][1]):!c&&z>0&&(D=ze(w+k+j,s[1][1])),b=Math.max(b,A),I=Math.max(I,D)}if(a){let A=0,D=0;l&&M>0?A=ze(h+M,a[0][0]):!l&&M<0&&(A=Ie(h+O,a[1][0])),c&&z>0?D=ze(w+z,a[0][1]):!c&&z<0&&(D=Ie(w+k,a[1][1])),b=Math.max(b,A),I=Math.max(I,D)}if(r){if(u){const A=Lt(O/S,x,_)*S;if(b=Math.max(b,A),s){let D=0;!l&&!c||l&&!c&&f?D=ze(w+j+O/S,s[1][1])*S:D=Ie(w+j+(l?M:-M)/S,s[0][1])*S,b=Math.max(b,D)}if(a){let D=0;!l&&!c||l&&!c&&f?D=Ie(w+O/S,a[1][1])*S:D=ze(w+(l?M:-M)/S,a[0][1])*S,b=Math.max(b,D)}}if(d){const A=Lt(k*S,m,v)/S;if(I=Math.max(I,A),s){let D=0;!l&&!c||c&&!l&&f?D=ze(h+k*S+T,s[1][0])/S:D=Ie(h+(c?z:-z)*S+T,s[0][0])/S,I=Math.max(I,D)}if(a){let D=0;!l&&!c||c&&!l&&f?D=Ie(h+k*S,a[1][0])/S:D=ze(h+(c?z:-z)*S,a[0][0])/S,I=Math.max(I,D)}}}z=z+(z<0?I:-I),M=M+(M<0?b:-b),r&&(f?O>k*S?z=(ir(l,c)?-M:M)/S:M=(ir(l,c)?-z:z)*S:u?(z=M/S,c=l):(M=z*S,l=c));const N=l?h+M:h,$=c?w+z:w;return{width:C+(l?-M:M),height:E+(c?-z:z),x:i[0]*M*(l?-1:1)+N,y:i[1]*z*(c?-1:1)+$}}const Fi={width:0,height:0,x:0,y:0},Yf={...Fi,pointerX:0,pointerY:0,aspectRatio:1};function Wf(e){return[[0,0],[e.measured.width,e.measured.height]]}function Zf(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 qf({domNode:e,nodeId:t,getStoreItems:n,onChange:o,onEnd:r}){const i=le(e);let s={controlDirection:rr("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:g,onResize:p,onResizeEnd:m,shouldResize:v}){let x={...Fi},_={...Yf};s={boundaries:u,resizeDirection:f,keepAspectRatio:d,controlDirection:rr(c)};let h,w=null,C=[],E,S,M,z=!1;const O=Jr().on("start",k=>{const{nodeLookup:T,transform:j,snapGrid:b,snapToGrid:I,nodeOrigin:N,paneDomNode:$}=n();if(h=T.get(t),!h)return;w=$?.getBoundingClientRect()??null;const{xSnapped:A,ySnapped:D}=mt(k.sourceEvent,{transform:j,snapGrid:b,snapToGrid:I,containerBounds:w});x={width:h.measured.width??0,height:h.measured.height??0,x:h.position.x??0,y:h.position.y??0},_={...x,pointerX:A,pointerY:D,aspectRatio:x.width/x.height},E=void 0,h.parentId&&(h.extent==="parent"||h.expandParent)&&(E=T.get(h.parentId),S=E&&h.extent==="parent"?Wf(E):void 0),C=[],M=void 0;for(const[H,L]of T)if(L.parentId===t&&(C.push({id:H,position:{...L.position},extent:L.extent}),L.extent==="parent"||L.expandParent)){const R=Zf(L,h,L.origin??N);M?M=[[Math.min(R[0][0],M[0][0]),Math.min(R[0][1],M[0][1])],[Math.max(R[1][0],M[1][0]),Math.max(R[1][1],M[1][1])]]:M=R}g?.(k,{...x})}).on("drag",k=>{const{transform:T,snapGrid:j,snapToGrid:b,nodeOrigin:I}=n(),N=mt(k.sourceEvent,{transform:T,snapGrid:j,snapToGrid:b,containerBounds:w}),$=[];if(!h)return;const{x:A,y:D,width:H,height:L}=x,R={},F=h.origin??I,{width:B,height:Z,x:U,y:W}=Xf(_,s.controlDirection,N,s.boundaries,s.keepAspectRatio,F,S,M),V=B!==H,Y=Z!==L,Q=U!==A&&V,K=W!==D&&Y;if(!Q&&!K&&!V&&!Y)return;if((Q||K||F[0]===1||F[1]===1)&&(R.x=Q?U:x.x,R.y=K?W:x.y,x.x=R.x,x.y=R.y,C.length>0)){const ne=U-A,te=W-D;for(const ae of C)ae.position={x:ae.position.x-ne+F[0]*(B-H),y:ae.position.y-te+F[1]*(Z-L)},$.push(ae)}if((V||Y)&&(R.width=V&&(!s.resizeDirection||s.resizeDirection==="horizontal")?B:x.width,R.height=Y&&(!s.resizeDirection||s.resizeDirection==="vertical")?Z:x.height,x.width=R.width,x.height=R.height),E&&h.expandParent){const ne=F[0]*(R.width??0);R.x&&R.x<ne&&(x.x=ne,_.x=_.x-(R.x-ne));const te=F[1]*(R.height??0);R.y&&R.y<te&&(x.y=te,_.y=_.y-(R.y-te))}const q=Ff({width:x.width,prevWidth:H,height:x.height,prevHeight:L,affectsX:s.controlDirection.affectsX,affectsY:s.controlDirection.affectsY}),G={...x,direction:q};v?.(k,G)!==!1&&(z=!0,p?.(k,G),o(R,$))}).on("end",k=>{z&&(m?.(k,{...x}),r?.({...x}),z=!1)});i.call(O)}function l(){i.on(".drag",null)}return{update:a,destroy:l}}var zn={exports:{}},An={},$n={exports:{}},Pn={};var sr;function Gf(){if(sr)return Pn;sr=1;var e=Tr();function t(d,f){return d===f&&(d!==0||1/d===1/f)||d!==d&&f!==f}var n=typeof Object.is=="function"?Object.is:t,o=e.useState,r=e.useEffect,i=e.useLayoutEffect,s=e.useDebugValue;function a(d,f){var g=f(),p=o({inst:{value:g,getSnapshot:f}}),m=p[0].inst,v=p[1];return i(function(){m.value=g,m.getSnapshot=f,l(m)&&v({inst:m})},[d,g,f]),r(function(){return l(m)&&v({inst:m}),d(function(){l(m)&&v({inst:m})})},[d]),s(g),g}function l(d){var f=d.getSnapshot;d=d.value;try{var g=f();return!n(d,g)}catch{return!0}}function c(d,f){return f()}var u=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?c:a;return Pn.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:u,Pn}var ar;function Uf(){return ar||(ar=1,$n.exports=Gf()),$n.exports}var cr;function Kf(){if(cr)return An;cr=1;var e=Tr(),t=Uf();function n(c,u){return c===u&&(c!==0||1/c===1/u)||c!==c&&u!==u}var o=typeof Object.is=="function"?Object.is:n,r=t.useSyncExternalStore,i=e.useRef,s=e.useEffect,a=e.useMemo,l=e.useDebugValue;return An.useSyncExternalStoreWithSelector=function(c,u,d,f,g){var p=i(null);if(p.current===null){var m={hasValue:!1,value:null};p.current=m}else m=p.current;p=a(function(){function x(E){if(!_){if(_=!0,h=E,E=f(E),g!==void 0&&m.hasValue){var S=m.value;if(g(S,E))return w=S}return w=E}if(S=w,o(h,E))return S;var M=f(E);return g!==void 0&&g(S,M)?(h=E,S):(h=E,w=M)}var _=!1,h,w,C=d===void 0?null:d;return[function(){return x(u())},C===null?void 0:function(){return x(C())}]},[u,d,f,g]);var v=r(c,p[0],p[1]);return s(function(){m.hasValue=!0,m.value=v},[v]),l(v),v},An}var lr;function Qf(){return lr||(lr=1,zn.exports=Kf()),zn.exports}var Jf=Qf();const eh=ja(Jf),th={},ur=e=>{let t;const n=new Set,o=(u,d)=>{const f=typeof u=="function"?u(t):u;if(!Object.is(f,t)){const g=t;t=d??(typeof f!="object"||f===null)?f:Object.assign({},t,f),n.forEach(p=>p(t,g))}},r=()=>t,l={setState:o,getState:r,getInitialState:()=>c,subscribe:u=>(n.add(u),()=>n.delete(u)),destroy:()=>{(th?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},c=t=e(o,r,l);return l},nh=e=>e?ur(e):ur,{useDebugValue:oh}=Ra,{useSyncExternalStoreWithSelector:rh}=eh,ih=e=>e;function Xi(e,t=ih,n){const o=rh(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return oh(o),o}const dr=(e,t)=>{const n=nh(e),o=(r,i=t)=>Xi(n,r,i);return Object.assign(o,n),o},sh=(e,t)=>e?dr(e,t):dr;function oe(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[o,r]of e)if(!Object.is(r,t.get(o)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const o of e)if(!t.has(o))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const o of n)if(!Object.prototype.hasOwnProperty.call(t,o)||!Object.is(e[o],t[o]))return!1;return!0}const gn=P.createContext(null),ah=gn.Provider,Yi=ve.error001();function J(e,t){const n=P.useContext(gn);if(n===null)throw new Error(Yi);return Xi(n,e,t)}function re(){const e=P.useContext(gn);if(e===null)throw new Error(Yi);return P.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const fr={display:"none"},ch={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},Wi="react-flow__node-desc",Zi="react-flow__edge-desc",lh="react-flow__aria-live",uh=e=>e.ariaLiveMessage,dh=e=>e.ariaLabelConfig;function fh({rfId:e}){const t=J(uh);return y.jsx("div",{id:`${lh}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:ch,children:t})}function hh({rfId:e,disableKeyboardA11y:t}){const n=J(dh);return y.jsxs(y.Fragment,{children:[y.jsx("div",{id:`${Wi}-${e}`,style:fr,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),y.jsx("div",{id:`${Zi}-${e}`,style:fr,children:n["edge.a11yDescription.default"]}),!t&&y.jsx(fh,{rfId:e})]})}const pn=P.forwardRef(({position:e="top-left",children:t,className:n,style:o,...r},i)=>{const s=`${e}`.split("-");return y.jsx("div",{className:ie(["react-flow__panel",n,...s]),style:o,ref:i,...r,children:t})});pn.displayName="Panel";function gh({proOptions:e,position:t="bottom-right"}){return e?.hideAttribution?null:y.jsx(pn,{position:t,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:y.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const ph=e=>{const t=[],n=[];for(const[,o]of e.nodeLookup)o.selected&&t.push(o.internals.userNode);for(const[,o]of e.edgeLookup)o.selected&&n.push(o);return{selectedNodes:t,selectedEdges:n}},Ot=e=>e.id;function mh(e,t){return oe(e.selectedNodes.map(Ot),t.selectedNodes.map(Ot))&&oe(e.selectedEdges.map(Ot),t.selectedEdges.map(Ot))}function yh({onSelectionChange:e}){const t=re(),{selectedNodes:n,selectedEdges:o}=J(ph,mh);return P.useEffect(()=>{const r={nodes:n,edges:o};e?.(r),t.getState().onSelectionChangeHandlers.forEach(i=>i(r))},[n,o,e]),null}const xh=e=>!!e.onSelectionChangeHandlers;function wh({onSelectionChange:e}){const t=J(xh);return e||t?y.jsx(yh,{onSelectionChange:e}):null}const qi=[0,0],vh={x:0,y:0,zoom:1},bh=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","ariaLabelConfig","zIndexMode"],hr=[...bh,"rfId"],_h=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),gr={translateExtent:bt,nodeOrigin:qi,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function Sh(e){const{setNodes:t,setEdges:n,setMinZoom:o,setMaxZoom:r,setTranslateExtent:i,setNodeExtent:s,reset:a,setDefaultNodesAndEdges:l}=J(_h,oe),c=re();P.useEffect(()=>(l(e.defaultNodes,e.defaultEdges),()=>{u.current=gr,a()}),[]);const u=P.useRef(gr);return P.useEffect(()=>{for(const d of hr){const f=e[d],g=u.current[d];f!==g&&(typeof e[d]>"u"||(d==="nodes"?t(f):d==="edges"?n(f):d==="minZoom"?o(f):d==="maxZoom"?r(f):d==="translateExtent"?i(f):d==="nodeExtent"?s(f):d==="ariaLabelConfig"?c.setState({ariaLabelConfig:sf(f)}):d==="fitView"?c.setState({fitViewQueued:f}):d==="fitViewOptions"?c.setState({fitViewOptions:f}):c.setState({[d]:f})))}u.current=e},hr.map(d=>e[d])),null}function pr(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function Eh(e){const[t,n]=P.useState(e==="system"?null:e);return P.useEffect(()=>{if(e!=="system"){n(e);return}const o=pr(),r=()=>n(o?.matches?"dark":"light");return r(),o?.addEventListener("change",r),()=>{o?.removeEventListener("change",r)}},[e]),t!==null?t:pr()?.matches?"dark":"light"}const mr=typeof document<"u"?document:null;function Ct(e=null,t={target:mr,actInsideInputWithModifier:!0}){const[n,o]=P.useState(!1),r=P.useRef(!1),i=P.useRef(new Set([])),[s,a]=P.useMemo(()=>{if(e!==null){const c=(Array.isArray(e)?e:[e]).filter(d=>typeof d=="string").map(d=>d.replace("+",`
1
+ import{f as za,b as Aa,q as $a,s as Pa,$ as Da,j as y,B as qe,ak as Ta,a1 as Ha,w as Pe,al as Tr,am as ja,an as Ra,r as P,F as fe,ad as ye,ae as La,z as Oa,W as Hr,a4 as jn,a9 as Ye,a7 as Va,H as $e,T as se,ag as Ba,ac as No,Y as Fa,Z as Xa,a6 as Ya,ao as Wa}from"./entry.Bkwg306k.js";import{d as Za}from"./chunk.4uk7i9-q.js";import{S as Mo}from"./chunk.BPR3Fzfi.js";import{S as qa,C as Ga,I as Ua,a as Ka,b as Qa}from"./chunk.CvqDfxXu.js";import{B as Ke,S as ft}from"./chunk.DUAYORVN.js";import{D as _n}from"./chunk.CkWIENRP.js";import{I as Ja}from"./chunk.DXpU07Gr.js";import"./chunk.uyVen0u2.js";import"./chunk.KBmIO7L9.js";import"./chunk.BjFrJKj1.js";var jr={root:"m_66836ed3",wrapper:"m_a5d60502",body:"m_667c2793",title:"m_6a03f287",label:"m_698f4f23",icon:"m_667f2a6a",message:"m_7fa78076",closeButton:"m_87f54839"};const ec=Pa((e,{radius:t,color:n,variant:o,autoContrast:r})=>{const i=e.variantColorResolver({color:n||e.primaryColor,theme:e,variant:o||"light",autoContrast:r});return{root:{"--alert-radius":t===void 0?void 0:Ha(t),"--alert-bg":n||o?i.background:void 0,"--alert-color":i.color,"--alert-bd":n||o?i.border:void 0}}}),Qn=za((e,t)=>{const n=Aa("Alert",null,e),{classNames:o,className:r,style:i,styles:s,unstyled:a,vars:l,radius:c,color:u,title:d,children:f,id:g,icon:p,withCloseButton:m,onClose:v,closeButtonLabel:x,variant:_,autoContrast:h,role:w,attributes:C,...E}=n,S=$a({name:"Alert",classes:jr,props:n,className:r,style:i,classNames:o,styles:s,unstyled:a,attributes:C,vars:l,varsResolver:ec}),M=Da(g),z=d&&`${M}-title`||void 0,O=`${M}-body`;return y.jsx(qe,{id:M,...S("root",{variant:_}),variant:_,ref:t,role:w||"alert",...E,"aria-describedby":f?O:void 0,"aria-labelledby":d?z:void 0,children:y.jsxs("div",{...S("wrapper"),children:[p&&y.jsx("div",{...S("icon"),children:p}),y.jsxs("div",{...S("body"),children:[d&&y.jsx("div",{...S("title"),"data-with-close-button":m||void 0,children:y.jsx("span",{id:z,...S("label"),children:d})}),f&&y.jsx("div",{id:O,...S("message"),"data-variant":_,children:f})]}),m&&y.jsx(Ta,{...S("closeButton"),onClick:v,variant:"transparent",size:16,iconSize:16,"aria-label":x,unstyled:a})]})})});Qn.classes=jr;Qn.displayName="@mantine/core/Alert";const tc=[["path",{d:"M7 3m0 2a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v10a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2z",key:"svg-0"}],["path",{d:"M17 17v2a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2v-10a2 2 0 0 1 2 -2h2",key:"svg-1"}]],nc=Pe("outline","box-multiple","BoxMultiple",tc);const oc=[["path",{d:"M12 3l8 4.5l0 9l-8 4.5l-8 -4.5l0 -9l8 -4.5",key:"svg-0"}],["path",{d:"M12 12l8 -4.5",key:"svg-1"}],["path",{d:"M12 12l0 9",key:"svg-2"}],["path",{d:"M12 12l-8 -4.5",key:"svg-3"}]],Rr=Pe("outline","box","Box",oc);const rc=[["path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2",key:"svg-0"}],["path",{d:"M7 11l5 5l5 -5",key:"svg-1"}],["path",{d:"M12 4l0 12",key:"svg-2"}]],ic=Pe("outline","download","Download",rc);const sc=[["path",{d:"M12 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-0"}],["path",{d:"M4 8v-2a2 2 0 0 1 2 -2h2",key:"svg-1"}],["path",{d:"M4 16v2a2 2 0 0 0 2 2h2",key:"svg-2"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v2",key:"svg-3"}],["path",{d:"M16 20h2a2 2 0 0 0 2 -2v-2",key:"svg-4"}]],ac=Pe("outline","focus-centered","FocusCentered",sc);const cc=[["path",{d:"M4 4l16 0",key:"svg-0"}],["path",{d:"M4 20l16 0",key:"svg-1"}],["path",{d:"M6 9m0 2a2 2 0 0 1 2 -2h8a2 2 0 0 1 2 2v2a2 2 0 0 1 -2 2h-8a2 2 0 0 1 -2 -2z",key:"svg-2"}]],lc=Pe("outline","layout-distribute-horizontal","LayoutDistributeHorizontal",cc);const uc=[["path",{d:"M4 4l0 16",key:"svg-0"}],["path",{d:"M20 4l0 16",key:"svg-1"}],["path",{d:"M9 6m0 2a2 2 0 0 1 2 -2h2a2 2 0 0 1 2 2v8a2 2 0 0 1 -2 2h-2a2 2 0 0 1 -2 -2z",key:"svg-2"}]],dc=Pe("outline","layout-distribute-vertical","LayoutDistributeVertical",uc);const fc=[["path",{d:"M5 11m0 2a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v6a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2z",key:"svg-0"}],["path",{d:"M12 16m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-1"}],["path",{d:"M8 11v-5a4 4 0 0 1 8 0",key:"svg-2"}]],hc=Pe("outline","lock-open","LockOpen",fc);const gc=[["path",{d:"M5 12l14 0",key:"svg-0"}]],pc=Pe("outline","minus","Minus",gc);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 mc={value:()=>{}};function sn(){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 Bt(n)}function Bt(e){this._=e}function yc(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}})}Bt.prototype=sn.prototype={constructor:Bt,on:function(e,t){var n=this._,o=yc(e+"",n),r,i=-1,s=o.length;if(arguments.length<2){for(;++i<s;)if((r=(e=o[i]).type)&&(r=xc(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]=ko(n[r],e.name,t);else if(t==null)for(r in n)n[r]=ko(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 Bt(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 xc(e,t){for(var n=0,o=e.length,r;n<o;++n)if((r=e[n]).name===t)return r.value}function ko(e,t,n){for(var o=0,r=e.length;o<r;++o)if(e[o].name===t){e[o]=mc,e=e.slice(0,o).concat(e.slice(o+1));break}return n!=null&&e.push({name:t,value:n}),e}var Rn="http://www.w3.org/1999/xhtml";const Io={svg:"http://www.w3.org/2000/svg",xhtml:Rn,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function an(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),Io.hasOwnProperty(t)?{space:Io[t],local:e}:e}function wc(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Rn&&t.documentElement.namespaceURI===Rn?t.createElement(e):t.createElementNS(n,e)}}function vc(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Lr(e){var t=an(e);return(t.local?vc:wc)(t)}function bc(){}function Jn(e){return e==null?bc:function(){return this.querySelector(e)}}function _c(e){typeof e!="function"&&(e=Jn(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 ue(o,this._parents)}function Sc(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function Ec(){return[]}function Or(e){return e==null?Ec:function(){return this.querySelectorAll(e)}}function Cc(e){return function(){return Sc(e.apply(this,arguments))}}function Nc(e){typeof e=="function"?e=Cc(e):e=Or(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 ue(o,r)}function Vr(e){return function(){return this.matches(e)}}function Br(e){return function(t){return t.matches(e)}}var Mc=Array.prototype.find;function kc(e){return function(){return Mc.call(this.children,e)}}function Ic(){return this.firstElementChild}function zc(e){return this.select(e==null?Ic:kc(typeof e=="function"?e:Br(e)))}var Ac=Array.prototype.filter;function $c(){return Array.from(this.children)}function Pc(e){return function(){return Ac.call(this.children,e)}}function Dc(e){return this.selectAll(e==null?$c:Pc(typeof e=="function"?e:Br(e)))}function Tc(e){typeof e!="function"&&(e=Vr(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 ue(o,this._parents)}function Fr(e){return new Array(e.length)}function Hc(){return new ue(this._enter||this._groups.map(Fr),this._parents)}function Zt(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Zt.prototype={constructor:Zt,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 jc(e){return function(){return e}}function Rc(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 Zt(e,i[s]);for(;s<l;++s)(a=t[s])&&(r[s]=a)}function Lc(e,t,n,o,r,i,s){var a,l,c=new Map,u=t.length,d=i.length,f=new Array(u),g;for(a=0;a<u;++a)(l=t[a])&&(f[a]=g=s.call(l,l.__data__,a,t)+"",c.has(g)?r[a]=l:c.set(g,l));for(a=0;a<d;++a)g=s.call(e,i[a],a,i)+"",(l=c.get(g))?(o[a]=l,l.__data__=i[a],c.delete(g)):n[a]=new Zt(e,i[a]);for(a=0;a<u;++a)(l=t[a])&&c.get(f[a])===l&&(r[a]=l)}function Oc(e){return e.__data__}function Vc(e,t){if(!arguments.length)return Array.from(this,Oc);var n=t?Lc:Rc,o=this._parents,r=this._groups;typeof e!="function"&&(e=jc(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,g=Bc(e.call(u,u&&u.__data__,c,o)),p=g.length,m=a[c]=new Array(p),v=s[c]=new Array(p),x=l[c]=new Array(f);n(u,d,m,v,x,g,t);for(var _=0,h=0,w,C;_<p;++_)if(w=m[_]){for(_>=h&&(h=_+1);!(C=v[h])&&++h<p;);w._next=C||null}}return s=new ue(s,o),s._enter=a,s._exit=l,s}function Bc(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Fc(){return new ue(this._exit||this._groups.map(Fr),this._parents)}function Xc(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 Yc(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),g,p=0;p<d;++p)(g=c[p]||u[p])&&(f[p]=g);for(;l<r;++l)a[l]=n[l];return new ue(a,this._parents)}function Wc(){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 Zc(e){e||(e=qc);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 ue(r,this._parents).order()}function qc(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function Gc(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function Uc(){return Array.from(this)}function Kc(){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 Qc(){let e=0;for(const t of this)++e;return e}function Jc(){return!this.node()}function el(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 tl(e){return function(){this.removeAttribute(e)}}function nl(e){return function(){this.removeAttributeNS(e.space,e.local)}}function ol(e,t){return function(){this.setAttribute(e,t)}}function rl(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function il(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function sl(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 al(e,t){var n=an(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?nl:tl:typeof t=="function"?n.local?sl:il:n.local?rl:ol)(n,t))}function Xr(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function cl(e){return function(){this.style.removeProperty(e)}}function ll(e,t,n){return function(){this.style.setProperty(e,t,n)}}function ul(e,t,n){return function(){var o=t.apply(this,arguments);o==null?this.style.removeProperty(e):this.style.setProperty(e,o,n)}}function dl(e,t,n){return arguments.length>1?this.each((t==null?cl:typeof t=="function"?ul:ll)(e,t,n??"")):Qe(this.node(),e)}function Qe(e,t){return e.style.getPropertyValue(t)||Xr(e).getComputedStyle(e,null).getPropertyValue(t)}function fl(e){return function(){delete this[e]}}function hl(e,t){return function(){this[e]=t}}function gl(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function pl(e,t){return arguments.length>1?this.each((t==null?fl:typeof t=="function"?gl:hl)(e,t)):this.node()[e]}function Yr(e){return e.trim().split(/^|\s+/)}function eo(e){return e.classList||new Wr(e)}function Wr(e){this._node=e,this._names=Yr(e.getAttribute("class")||"")}Wr.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 Zr(e,t){for(var n=eo(e),o=-1,r=t.length;++o<r;)n.add(t[o])}function qr(e,t){for(var n=eo(e),o=-1,r=t.length;++o<r;)n.remove(t[o])}function ml(e){return function(){Zr(this,e)}}function yl(e){return function(){qr(this,e)}}function xl(e,t){return function(){(t.apply(this,arguments)?Zr:qr)(this,e)}}function wl(e,t){var n=Yr(e+"");if(arguments.length<2){for(var o=eo(this.node()),r=-1,i=n.length;++r<i;)if(!o.contains(n[r]))return!1;return!0}return this.each((typeof t=="function"?xl:t?ml:yl)(n,t))}function vl(){this.textContent=""}function bl(e){return function(){this.textContent=e}}function _l(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function Sl(e){return arguments.length?this.each(e==null?vl:(typeof e=="function"?_l:bl)(e)):this.node().textContent}function El(){this.innerHTML=""}function Cl(e){return function(){this.innerHTML=e}}function Nl(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function Ml(e){return arguments.length?this.each(e==null?El:(typeof e=="function"?Nl:Cl)(e)):this.node().innerHTML}function kl(){this.nextSibling&&this.parentNode.appendChild(this)}function Il(){return this.each(kl)}function zl(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Al(){return this.each(zl)}function $l(e){var t=typeof e=="function"?e:Lr(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function Pl(){return null}function Dl(e,t){var n=typeof e=="function"?e:Lr(e),o=t==null?Pl:typeof t=="function"?t:Jn(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),o.apply(this,arguments)||null)})}function Tl(){var e=this.parentNode;e&&e.removeChild(this)}function Hl(){return this.each(Tl)}function jl(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Rl(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Ll(e){return this.select(e?Rl:jl)}function Ol(e){return arguments.length?this.property("__data__",e):this.node().__data__}function Vl(e){return function(t){e.call(this,t,this.__data__)}}function Bl(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 Fl(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 Xl(e,t,n){return function(){var o=this.__on,r,i=Vl(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 Yl(e,t,n){var o=Bl(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?Xl:Fl,r=0;r<i;++r)this.each(a(o[r],t,n));return this}function Gr(e,t,n){var o=Xr(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 Wl(e,t){return function(){return Gr(this,e,t)}}function Zl(e,t){return function(){return Gr(this,e,t.apply(this,arguments))}}function ql(e,t){return this.each((typeof t=="function"?Zl:Wl)(e,t))}function*Gl(){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 Ur=[null];function ue(e,t){this._groups=e,this._parents=t}function Nt(){return new ue([[document.documentElement]],Ur)}function Ul(){return this}ue.prototype=Nt.prototype={constructor:ue,select:_c,selectAll:Nc,selectChild:zc,selectChildren:Dc,filter:Tc,data:Vc,enter:Hc,exit:Fc,join:Xc,merge:Yc,selection:Ul,order:Wc,sort:Zc,call:Gc,nodes:Uc,node:Kc,size:Qc,empty:Jc,each:el,attr:al,style:dl,property:pl,classed:wl,text:Sl,html:Ml,raise:Il,lower:Al,append:$l,insert:Dl,remove:Hl,clone:Ll,datum:Ol,on:Yl,dispatch:ql,[Symbol.iterator]:Gl};function le(e){return typeof e=="string"?new ue([[document.querySelector(e)]],[document.documentElement]):new ue([[e]],Ur)}function Kl(e){let t;for(;t=e.sourceEvent;)e=t;return e}function de(e,t){if(e=Kl(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 Ql={passive:!1},yt={capture:!0,passive:!1};function Sn(e){e.stopImmediatePropagation()}function Ge(e){e.preventDefault(),e.stopImmediatePropagation()}function Kr(e){var t=e.document.documentElement,n=le(e).on("dragstart.drag",Ge,yt);"onselectstart"in t?n.on("selectstart.drag",Ge,yt):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function Qr(e,t){var n=e.document.documentElement,o=le(e).on("dragstart.drag",null);t&&(o.on("click.drag",Ge,yt),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 Pt=e=>()=>e;function Ln(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}})}Ln.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function Jl(e){return!e.ctrlKey&&!e.button}function eu(){return this.parentNode}function tu(e,t){return t??{x:e.x,y:e.y}}function nu(){return navigator.maxTouchPoints||"ontouchstart"in this}function Jr(){var e=Jl,t=eu,n=tu,o=nu,r={},i=sn("start","drag","end"),s=0,a,l,c,u,d=0;function f(w){w.on("mousedown.drag",g).filter(o).on("touchstart.drag",v).on("touchmove.drag",x,Ql).on("touchend.drag touchcancel.drag",_).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function g(w,C){if(!(u||!e.call(this,w,C))){var E=h(this,t.call(this,w,C),w,C,"mouse");E&&(le(w.view).on("mousemove.drag",p,yt).on("mouseup.drag",m,yt),Kr(w.view),Sn(w),c=!1,a=w.clientX,l=w.clientY,E("start",w))}}function p(w){if(Ge(w),!c){var C=w.clientX-a,E=w.clientY-l;c=C*C+E*E>d}r.mouse("drag",w)}function m(w){le(w.view).on("mousemove.drag mouseup.drag",null),Qr(w.view,c),Ge(w),r.mouse("end",w)}function v(w,C){if(e.call(this,w,C)){var E=w.changedTouches,S=t.call(this,w,C),M=E.length,z,O;for(z=0;z<M;++z)(O=h(this,S,w,C,E[z].identifier,E[z]))&&(Sn(w),O("start",w,E[z]))}}function x(w){var C=w.changedTouches,E=C.length,S,M;for(S=0;S<E;++S)(M=r[C[S].identifier])&&(Ge(w),M("drag",w,C[S]))}function _(w){var C=w.changedTouches,E=C.length,S,M;for(u&&clearTimeout(u),u=setTimeout(function(){u=null},500),S=0;S<E;++S)(M=r[C[S].identifier])&&(Sn(w),M("end",w,C[S]))}function h(w,C,E,S,M,z){var O=i.copy(),k=de(z||E,C),T,j,b;if((b=n.call(w,new Ln("beforestart",{sourceEvent:E,target:f,identifier:M,active:s,x:k[0],y:k[1],dx:0,dy:0,dispatch:O}),S))!=null)return T=b.x-k[0]||0,j=b.y-k[1]||0,function I(N,$,A){var D=k,H;switch(N){case"start":r[M]=I,H=s++;break;case"end":delete r[M],--s;case"drag":k=de(A||$,C),H=s;break}O.call(N,w,new Ln(N,{sourceEvent:$,subject:b,target:f,identifier:M,active:H,x:k[0]+T,y:k[1]+j,dx:k[0]-D[0],dy:k[1]-D[1],dispatch:O}),S)}}return f.filter=function(w){return arguments.length?(e=typeof w=="function"?w:Pt(!!w),f):e},f.container=function(w){return arguments.length?(t=typeof w=="function"?w:Pt(w),f):t},f.subject=function(w){return arguments.length?(n=typeof w=="function"?w:Pt(w),f):n},f.touchable=function(w){return arguments.length?(o=typeof w=="function"?w:Pt(!!w),f):o},f.on=function(){var w=i.on.apply(i,arguments);return w===i?f:w},f.clickDistance=function(w){return arguments.length?(d=(w=+w)*w,f):Math.sqrt(d)},f}function to(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function ei(e,t){var n=Object.create(e.prototype);for(var o in t)n[o]=t[o];return n}function Mt(){}var xt=.7,qt=1/xt,Ue="\\s*([+-]?\\d+)\\s*",wt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",we="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",ou=/^#([0-9a-f]{3,8})$/,ru=new RegExp(`^rgb\\(${Ue},${Ue},${Ue}\\)$`),iu=new RegExp(`^rgb\\(${we},${we},${we}\\)$`),su=new RegExp(`^rgba\\(${Ue},${Ue},${Ue},${wt}\\)$`),au=new RegExp(`^rgba\\(${we},${we},${we},${wt}\\)$`),cu=new RegExp(`^hsl\\(${wt},${we},${we}\\)$`),lu=new RegExp(`^hsla\\(${wt},${we},${we},${wt}\\)$`),zo={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};to(Mt,Le,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Ao,formatHex:Ao,formatHex8:uu,formatHsl:du,formatRgb:$o,toString:$o});function Ao(){return this.rgb().formatHex()}function uu(){return this.rgb().formatHex8()}function du(){return ti(this).formatHsl()}function $o(){return this.rgb().formatRgb()}function Le(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=ou.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?Po(t):n===3?new ce(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Dt(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Dt(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=ru.exec(e))?new ce(t[1],t[2],t[3],1):(t=iu.exec(e))?new ce(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=su.exec(e))?Dt(t[1],t[2],t[3],t[4]):(t=au.exec(e))?Dt(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=cu.exec(e))?Ho(t[1],t[2]/100,t[3]/100,1):(t=lu.exec(e))?Ho(t[1],t[2]/100,t[3]/100,t[4]):zo.hasOwnProperty(e)?Po(zo[e]):e==="transparent"?new ce(NaN,NaN,NaN,0):null}function Po(e){return new ce(e>>16&255,e>>8&255,e&255,1)}function Dt(e,t,n,o){return o<=0&&(e=t=n=NaN),new ce(e,t,n,o)}function fu(e){return e instanceof Mt||(e=Le(e)),e?(e=e.rgb(),new ce(e.r,e.g,e.b,e.opacity)):new ce}function On(e,t,n,o){return arguments.length===1?fu(e):new ce(e,t,n,o??1)}function ce(e,t,n,o){this.r=+e,this.g=+t,this.b=+n,this.opacity=+o}to(ce,On,ei(Mt,{brighter(e){return e=e==null?qt:Math.pow(qt,e),new ce(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?xt:Math.pow(xt,e),new ce(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new ce(je(this.r),je(this.g),je(this.b),Gt(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:Do,formatHex:Do,formatHex8:hu,formatRgb:To,toString:To}));function Do(){return`#${He(this.r)}${He(this.g)}${He(this.b)}`}function hu(){return`#${He(this.r)}${He(this.g)}${He(this.b)}${He((isNaN(this.opacity)?1:this.opacity)*255)}`}function To(){const e=Gt(this.opacity);return`${e===1?"rgb(":"rgba("}${je(this.r)}, ${je(this.g)}, ${je(this.b)}${e===1?")":`, ${e})`}`}function Gt(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function je(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function He(e){return e=je(e),(e<16?"0":"")+e.toString(16)}function Ho(e,t,n,o){return o<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new he(e,t,n,o)}function ti(e){if(e instanceof he)return new he(e.h,e.s,e.l,e.opacity);if(e instanceof Mt||(e=Le(e)),!e)return new he;if(e instanceof he)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 he(s,a,l,e.opacity)}function gu(e,t,n,o){return arguments.length===1?ti(e):new he(e,t,n,o??1)}function he(e,t,n,o){this.h=+e,this.s=+t,this.l=+n,this.opacity=+o}to(he,gu,ei(Mt,{brighter(e){return e=e==null?qt:Math.pow(qt,e),new he(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?xt:Math.pow(xt,e),new he(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 ce(En(e>=240?e-240:e+120,r,o),En(e,r,o),En(e<120?e+240:e-120,r,o),this.opacity)},clamp(){return new he(jo(this.h),Tt(this.s),Tt(this.l),Gt(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=Gt(this.opacity);return`${e===1?"hsl(":"hsla("}${jo(this.h)}, ${Tt(this.s)*100}%, ${Tt(this.l)*100}%${e===1?")":`, ${e})`}`}}));function jo(e){return e=(e||0)%360,e<0?e+360:e}function Tt(e){return Math.max(0,Math.min(1,e||0))}function En(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 no=e=>()=>e;function pu(e,t){return function(n){return e+n*t}}function mu(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 yu(e){return(e=+e)==1?ni:function(t,n){return n-t?mu(t,n,e):no(isNaN(t)?n:t)}}function ni(e,t){var n=t-e;return n?pu(e,n):no(isNaN(e)?t:e)}const Ut=(function e(t){var n=yu(t);function o(r,i){var s=n((r=On(r)).r,(i=On(i)).r),a=n(r.g,i.g),l=n(r.b,i.b),c=ni(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 xu(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 wu(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function vu(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]=pt(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 bu(e,t){var n=new Date;return e=+e,t=+t,function(o){return n.setTime(e*(1-o)+t*o),n}}function xe(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function _u(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]=pt(e[r],t[r]):o[r]=t[r];return function(i){for(r in n)o[r]=n[r](i);return o}}var Vn=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Cn=new RegExp(Vn.source,"g");function Su(e){return function(){return e}}function Eu(e){return function(t){return e(t)+""}}function oi(e,t){var n=Vn.lastIndex=Cn.lastIndex=0,o,r,i,s=-1,a=[],l=[];for(e=e+"",t=t+"";(o=Vn.exec(e))&&(r=Cn.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:xe(o,r)})),n=Cn.lastIndex;return n<t.length&&(i=t.slice(n),a[s]?a[s]+=i:a[++s]=i),a.length<2?l[0]?Eu(l[0].x):Su(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 pt(e,t){var n=typeof t,o;return t==null||n==="boolean"?no(t):(n==="number"?xe:n==="string"?(o=Le(t))?(t=o,Ut):oi:t instanceof Le?Ut:t instanceof Date?bu:wu(t)?xu:Array.isArray(t)?vu:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?_u:xe)(e,t)}var Ro=180/Math.PI,Bn={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function ri(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)*Ro,skewX:Math.atan(l)*Ro,scaleX:s,scaleY:a}}var Ht;function Cu(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Bn:ri(t.a,t.b,t.c,t.d,t.e,t.f)}function Nu(e){return e==null||(Ht||(Ht=document.createElementNS("http://www.w3.org/2000/svg","g")),Ht.setAttribute("transform",e),!(e=Ht.transform.baseVal.consolidate()))?Bn:(e=e.matrix,ri(e.a,e.b,e.c,e.d,e.e,e.f))}function ii(e,t,n,o){function r(c){return c.length?c.pop()+" ":""}function i(c,u,d,f,g,p){if(c!==d||u!==f){var m=g.push("translate(",null,t,null,n);p.push({i:m-4,x:xe(c,d)},{i:m-2,x:xe(u,f)})}else(d||f)&&g.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:xe(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:xe(c,u)}):u&&d.push(r(d)+"skewX("+u+o)}function l(c,u,d,f,g,p){if(c!==d||u!==f){var m=g.push(r(g)+"scale(",null,",",null,")");p.push({i:m-4,x:xe(c,d)},{i:m-2,x:xe(u,f)})}else(d!==1||f!==1)&&g.push(r(g)+"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(g){for(var p=-1,m=f.length,v;++p<m;)d[(v=f[p]).i]=v.x(g);return d.join("")}}}var Mu=ii(Cu,"px, ","px)","deg)"),ku=ii(Nu,", ",")",")"),Iu=1e-12;function Lo(e){return((e=Math.exp(e))+1/e)/2}function zu(e){return((e=Math.exp(e))-1/e)/2}function Au(e){return((e=Math.exp(2*e))-1)/(e+1)}const Ft=(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],g=u-a,p=d-l,m=g*g+p*p,v,x;if(m<Iu)x=Math.log(f/c)/t,v=function(S){return[a+S*g,l+S*p,c*Math.exp(t*S*x)]};else{var _=Math.sqrt(m),h=(f*f-c*c+o*m)/(2*c*n*_),w=(f*f-c*c-o*m)/(2*f*n*_),C=Math.log(Math.sqrt(h*h+1)-h),E=Math.log(Math.sqrt(w*w+1)-w);x=(E-C)/t,v=function(S){var M=S*x,z=Lo(C),O=c/(n*_)*(z*Au(t*M+C)-zu(C));return[a+O*g,l+O*p,c*z/Lo(t*M+C)]}}return v.duration=x*1e3*t/Math.SQRT2,v}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 Je=0,ht=0,ut=0,si=1e3,Kt,gt,Qt=0,Oe=0,cn=0,vt=typeof performance=="object"&&performance.now?performance:Date,ai=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function oo(){return Oe||(ai($u),Oe=vt.now()+cn)}function $u(){Oe=0}function Jt(){this._call=this._time=this._next=null}Jt.prototype=ci.prototype={constructor:Jt,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?oo():+n)+(t==null?0:+t),!this._next&&gt!==this&&(gt?gt._next=this:Kt=this,gt=this),this._call=e,this._time=n,Fn()},stop:function(){this._call&&(this._call=null,this._time=1/0,Fn())}};function ci(e,t,n){var o=new Jt;return o.restart(e,t,n),o}function Pu(){oo(),++Je;for(var e=Kt,t;e;)(t=Oe-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Je}function Oo(){Oe=(Qt=vt.now())+cn,Je=ht=0;try{Pu()}finally{Je=0,Tu(),Oe=0}}function Du(){var e=vt.now(),t=e-Qt;t>si&&(cn-=t,Qt=e)}function Tu(){for(var e,t=Kt,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:Kt=n);gt=e,Fn(o)}function Fn(e){if(!Je){ht&&(ht=clearTimeout(ht));var t=e-Oe;t>24?(e<1/0&&(ht=setTimeout(Oo,e-vt.now()-cn)),ut&&(ut=clearInterval(ut))):(ut||(Qt=vt.now(),ut=setInterval(Du,si)),Je=1,ai(Oo))}}function Vo(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 Hu=sn("start","end","cancel","interrupt"),ju=[],li=0,Bo=1,Xn=2,Xt=3,Fo=4,Yn=5,Yt=6;function ln(e,t,n,o,r,i){var s=e.__transition;if(!s)e.__transition={};else if(n in s)return;Ru(e,n,{name:t,index:o,group:r,on:Hu,tween:ju,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:li})}function ro(e,t){var n=me(e,t);if(n.state>li)throw new Error("too late; already scheduled");return n}function be(e,t){var n=me(e,t);if(n.state>Xt)throw new Error("too late; already running");return n}function me(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function Ru(e,t,n){var o=e.__transition,r;o[t]=n,n.timer=ci(i,0,n.time);function i(c){n.state=Bo,n.timer.restart(s,n.delay,n.time),n.delay<=c&&s(c-n.delay)}function s(c){var u,d,f,g;if(n.state!==Bo)return l();for(u in o)if(g=o[u],g.name===n.name){if(g.state===Xt)return Vo(s);g.state===Fo?(g.state=Yt,g.timer.stop(),g.on.call("interrupt",e,e.__data__,g.index,g.group),delete o[u]):+u<t&&(g.state=Yt,g.timer.stop(),g.on.call("cancel",e,e.__data__,g.index,g.group),delete o[u])}if(Vo(function(){n.state===Xt&&(n.state=Fo,n.timer.restart(a,n.delay,n.time),a(c))}),n.state=Xn,n.on.call("start",e,e.__data__,n.index,n.group),n.state===Xn){for(n.state=Xt,r=new Array(f=n.tween.length),u=0,d=-1;u<f;++u)(g=n.tween[u].value.call(e,e.__data__,n.index,n.group))&&(r[++d]=g);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=Yn,1),d=-1,f=r.length;++d<f;)r[d].call(e,u);n.state===Yn&&(n.on.call("end",e,e.__data__,n.index,n.group),l())}function l(){n.state=Yt,n.timer.stop(),delete o[t];for(var c in o)return;delete e.__transition}}function Wt(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>Xn&&o.state<Yn,o.state=Yt,o.timer.stop(),o.on.call(r?"interrupt":"cancel",e,e.__data__,o.index,o.group),delete n[s]}i&&delete e.__transition}}function Lu(e){return this.each(function(){Wt(this,e)})}function Ou(e,t){var n,o;return function(){var r=be(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 Vu(e,t,n){var o,r;if(typeof n!="function")throw new Error;return function(){var i=be(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 Bu(e,t){var n=this._id;if(e+="",arguments.length<2){for(var o=me(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?Ou:Vu)(n,e,t))}function io(e,t,n){var o=e._id;return e.each(function(){var r=be(this,o);(r.value||(r.value={}))[t]=n.apply(this,arguments)}),function(r){return me(r,o).value[t]}}function ui(e,t){var n;return(typeof t=="number"?xe:t instanceof Le?Ut:(n=Le(t))?(t=n,Ut):oi)(e,t)}function Fu(e){return function(){this.removeAttribute(e)}}function Xu(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Yu(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 Wu(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 Zu(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 qu(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 Gu(e,t){var n=an(e),o=n==="transform"?ku:ui;return this.attrTween(e,typeof t=="function"?(n.local?qu:Zu)(n,o,io(this,"attr."+e,t)):t==null?(n.local?Xu:Fu)(n):(n.local?Wu:Yu)(n,o,t))}function Uu(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function Ku(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function Qu(e,t){var n,o;function r(){var i=t.apply(this,arguments);return i!==o&&(n=(o=i)&&Ku(e,i)),n}return r._value=t,r}function Ju(e,t){var n,o;function r(){var i=t.apply(this,arguments);return i!==o&&(n=(o=i)&&Uu(e,i)),n}return r._value=t,r}function ed(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=an(e);return this.tween(n,(o.local?Qu:Ju)(o,t))}function td(e,t){return function(){ro(this,e).delay=+t.apply(this,arguments)}}function nd(e,t){return t=+t,function(){ro(this,e).delay=t}}function od(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?td:nd)(t,e)):me(this.node(),t).delay}function rd(e,t){return function(){be(this,e).duration=+t.apply(this,arguments)}}function id(e,t){return t=+t,function(){be(this,e).duration=t}}function sd(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?rd:id)(t,e)):me(this.node(),t).duration}function ad(e,t){if(typeof t!="function")throw new Error;return function(){be(this,e).ease=t}}function cd(e){var t=this._id;return arguments.length?this.each(ad(t,e)):me(this.node(),t).ease}function ld(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;be(this,e).ease=n}}function ud(e){if(typeof e!="function")throw new Error;return this.each(ld(this._id,e))}function dd(e){typeof e!="function"&&(e=Vr(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 Ne(o,this._parents,this._name,this._id)}function fd(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,g=0;g<u;++g)(f=l[g]||c[g])&&(d[g]=f);for(;a<o;++a)s[a]=t[a];return new Ne(s,this._parents,this._name,this._id)}function hd(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 gd(e,t,n){var o,r,i=hd(t)?ro:be;return function(){var s=i(this,e),a=s.on;a!==o&&(r=(o=a).copy()).on(t,n),s.on=r}}function pd(e,t){var n=this._id;return arguments.length<2?me(this.node(),n).on.on(e):this.each(gd(n,e,t))}function md(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function yd(){return this.on("end.remove",md(this._id))}function xd(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Jn(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,ln(c[f],t,n,f,c,me(u,n)));return new Ne(i,this._parents,t,n)}function wd(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Or(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),g,p=me(u,n),m=0,v=f.length;m<v;++m)(g=f[m])&&ln(g,t,n,m,f,p);i.push(f),s.push(u)}return new Ne(i,s,t,n)}var vd=Nt.prototype.constructor;function bd(){return new vd(this._groups,this._parents)}function _d(e,t){var n,o,r;return function(){var i=Qe(this,e),s=(this.style.removeProperty(e),Qe(this,e));return i===s?null:i===n&&s===o?r:r=t(n=i,o=s)}}function di(e){return function(){this.style.removeProperty(e)}}function Sd(e,t,n){var o,r=n+"",i;return function(){var s=Qe(this,e);return s===r?null:s===o?i:i=t(o=s,n)}}function Ed(e,t,n){var o,r,i;return function(){var s=Qe(this,e),a=n(this),l=a+"";return a==null&&(l=a=(this.style.removeProperty(e),Qe(this,e))),s===l?null:s===o&&l===r?i:(r=l,i=t(o=s,a))}}function Cd(e,t){var n,o,r,i="style."+t,s="end."+i,a;return function(){var l=be(this,e),c=l.on,u=l.value[i]==null?a||(a=di(t)):void 0;(c!==n||r!==u)&&(o=(n=c).copy()).on(s,r=u),l.on=o}}function Nd(e,t,n){var o=(e+="")=="transform"?Mu:ui;return t==null?this.styleTween(e,_d(e,o)).on("end.style."+e,di(e)):typeof t=="function"?this.styleTween(e,Ed(e,o,io(this,"style."+e,t))).each(Cd(this._id,e)):this.styleTween(e,Sd(e,o,t),n).on("end.style."+e,null)}function Md(e,t,n){return function(o){this.style.setProperty(e,t.call(this,o),n)}}function kd(e,t,n){var o,r;function i(){var s=t.apply(this,arguments);return s!==r&&(o=(r=s)&&Md(e,s,n)),o}return i._value=t,i}function Id(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,kd(e,t,n??""))}function zd(e){return function(){this.textContent=e}}function Ad(e){return function(){var t=e(this);this.textContent=t??""}}function $d(e){return this.tween("text",typeof e=="function"?Ad(io(this,"text",e)):zd(e==null?"":e+""))}function Pd(e){return function(t){this.textContent=e.call(this,t)}}function Dd(e){var t,n;function o(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&Pd(r)),t}return o._value=e,o}function Td(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,Dd(e))}function Hd(){for(var e=this._name,t=this._id,n=fi(),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=me(l,t);ln(l,e,n,c,s,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new Ne(o,this._parents,e,n)}function jd(){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=be(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 Rd=0;function Ne(e,t,n,o){this._groups=e,this._parents=t,this._name=n,this._id=o}function fi(){return++Rd}var Se=Nt.prototype;Ne.prototype={constructor:Ne,select:xd,selectAll:wd,selectChild:Se.selectChild,selectChildren:Se.selectChildren,filter:dd,merge:fd,selection:bd,transition:Hd,call:Se.call,nodes:Se.nodes,node:Se.node,size:Se.size,empty:Se.empty,each:Se.each,on:pd,attr:Gu,attrTween:ed,style:Nd,styleTween:Id,text:$d,textTween:Td,remove:yd,tween:Bu,delay:od,duration:sd,ease:cd,easeVarying:ud,end:jd,[Symbol.iterator]:Se[Symbol.iterator]};function Ld(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var Od={time:null,delay:0,duration:250,ease:Ld};function Vd(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 Bd(e){var t,n;e instanceof Ne?(t=e._id,e=e._name):(t=fi(),(n=Od).time=oo(),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])&&ln(l,e,t,c,s,n||Vd(l,t));return new Ne(o,this._parents,e,t)}Nt.prototype.interrupt=Lu;Nt.prototype.transition=Bd;const jt=e=>()=>e;function Fd(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 Ee(e,t,n){this.k=e,this.x=t,this.y=n}Ee.prototype={constructor:Ee,scale:function(e){return e===1?this:new Ee(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Ee(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 un=new Ee(1,0,0);hi.prototype=Ee.prototype;function hi(e){for(;!e.__zoom;)if(!(e=e.parentNode))return un;return e.__zoom}function Nn(e){e.stopImmediatePropagation()}function dt(e){e.preventDefault(),e.stopImmediatePropagation()}function Xd(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function Yd(){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 Xo(){return this.__zoom||un}function Wd(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function Zd(){return navigator.maxTouchPoints||"ontouchstart"in this}function qd(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 gi(){var e=Xd,t=Yd,n=qd,o=Wd,r=Zd,i=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],a=250,l=Ft,c=sn("start","zoom","end"),u,d,f,g=500,p=150,m=0,v=10;function x(b){b.property("__zoom",Xo).on("wheel.zoom",M,{passive:!1}).on("mousedown.zoom",z).on("dblclick.zoom",O).filter(r).on("touchstart.zoom",k).on("touchmove.zoom",T).on("touchend.zoom touchcancel.zoom",j).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}x.transform=function(b,I,N,$){var A=b.selection?b.selection():b;A.property("__zoom",Xo),b!==A?C(b,I,N,$):A.interrupt().each(function(){E(this,arguments).event($).start().zoom(null,typeof I=="function"?I.apply(this,arguments):I).end()})},x.scaleBy=function(b,I,N,$){x.scaleTo(b,function(){var A=this.__zoom.k,D=typeof I=="function"?I.apply(this,arguments):I;return A*D},N,$)},x.scaleTo=function(b,I,N,$){x.transform(b,function(){var A=t.apply(this,arguments),D=this.__zoom,H=N==null?w(A):typeof N=="function"?N.apply(this,arguments):N,L=D.invert(H),R=typeof I=="function"?I.apply(this,arguments):I;return n(h(_(D,R),H,L),A,s)},N,$)},x.translateBy=function(b,I,N,$){x.transform(b,function(){return n(this.__zoom.translate(typeof I=="function"?I.apply(this,arguments):I,typeof N=="function"?N.apply(this,arguments):N),t.apply(this,arguments),s)},null,$)},x.translateTo=function(b,I,N,$,A){x.transform(b,function(){var D=t.apply(this,arguments),H=this.__zoom,L=$==null?w(D):typeof $=="function"?$.apply(this,arguments):$;return n(un.translate(L[0],L[1]).scale(H.k).translate(typeof I=="function"?-I.apply(this,arguments):-I,typeof N=="function"?-N.apply(this,arguments):-N),D,s)},$,A)};function _(b,I){return I=Math.max(i[0],Math.min(i[1],I)),I===b.k?b:new Ee(I,b.x,b.y)}function h(b,I,N){var $=I[0]-N[0]*b.k,A=I[1]-N[1]*b.k;return $===b.x&&A===b.y?b:new Ee(b.k,$,A)}function w(b){return[(+b[0][0]+ +b[1][0])/2,(+b[0][1]+ +b[1][1])/2]}function C(b,I,N,$){b.on("start.zoom",function(){E(this,arguments).event($).start()}).on("interrupt.zoom end.zoom",function(){E(this,arguments).event($).end()}).tween("zoom",function(){var A=this,D=arguments,H=E(A,D).event($),L=t.apply(A,D),R=N==null?w(L):typeof N=="function"?N.apply(A,D):N,F=Math.max(L[1][0]-L[0][0],L[1][1]-L[0][1]),B=A.__zoom,Z=typeof I=="function"?I.apply(A,D):I,U=l(B.invert(R).concat(F/B.k),Z.invert(R).concat(F/Z.k));return function(W){if(W===1)W=Z;else{var V=U(W),Y=F/V[2];W=new Ee(Y,R[0]-V[0]*Y,R[1]-V[1]*Y)}H.zoom(null,W)}})}function E(b,I,N){return!N&&b.__zooming||new S(b,I)}function S(b,I){this.that=b,this.args=I,this.active=0,this.sourceEvent=null,this.extent=t.apply(b,I),this.taps=0}S.prototype={event:function(b){return b&&(this.sourceEvent=b),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(b,I){return this.mouse&&b!=="mouse"&&(this.mouse[1]=I.invert(this.mouse[0])),this.touch0&&b!=="touch"&&(this.touch0[1]=I.invert(this.touch0[0])),this.touch1&&b!=="touch"&&(this.touch1[1]=I.invert(this.touch1[0])),this.that.__zoom=I,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(b){var I=le(this.that).datum();c.call(b,this.that,new Fd(b,{sourceEvent:this.sourceEvent,target:x,transform:this.that.__zoom,dispatch:c}),I)}};function M(b,...I){if(!e.apply(this,arguments))return;var N=E(this,I).event(b),$=this.__zoom,A=Math.max(i[0],Math.min(i[1],$.k*Math.pow(2,o.apply(this,arguments)))),D=de(b);if(N.wheel)(N.mouse[0][0]!==D[0]||N.mouse[0][1]!==D[1])&&(N.mouse[1]=$.invert(N.mouse[0]=D)),clearTimeout(N.wheel);else{if($.k===A)return;N.mouse=[D,$.invert(D)],Wt(this),N.start()}dt(b),N.wheel=setTimeout(H,p),N.zoom("mouse",n(h(_($,A),N.mouse[0],N.mouse[1]),N.extent,s));function H(){N.wheel=null,N.end()}}function z(b,...I){if(f||!e.apply(this,arguments))return;var N=b.currentTarget,$=E(this,I,!0).event(b),A=le(b.view).on("mousemove.zoom",R,!0).on("mouseup.zoom",F,!0),D=de(b,N),H=b.clientX,L=b.clientY;Kr(b.view),Nn(b),$.mouse=[D,this.__zoom.invert(D)],Wt(this),$.start();function R(B){if(dt(B),!$.moved){var Z=B.clientX-H,U=B.clientY-L;$.moved=Z*Z+U*U>m}$.event(B).zoom("mouse",n(h($.that.__zoom,$.mouse[0]=de(B,N),$.mouse[1]),$.extent,s))}function F(B){A.on("mousemove.zoom mouseup.zoom",null),Qr(B.view,$.moved),dt(B),$.event(B).end()}}function O(b,...I){if(e.apply(this,arguments)){var N=this.__zoom,$=de(b.changedTouches?b.changedTouches[0]:b,this),A=N.invert($),D=N.k*(b.shiftKey?.5:2),H=n(h(_(N,D),$,A),t.apply(this,I),s);dt(b),a>0?le(this).transition().duration(a).call(C,H,$,b):le(this).call(x.transform,H,$,b)}}function k(b,...I){if(e.apply(this,arguments)){var N=b.touches,$=N.length,A=E(this,I,b.changedTouches.length===$).event(b),D,H,L,R;for(Nn(b),H=0;H<$;++H)L=N[H],R=de(L,this),R=[R,this.__zoom.invert(R),L.identifier],A.touch0?!A.touch1&&A.touch0[2]!==R[2]&&(A.touch1=R,A.taps=0):(A.touch0=R,D=!0,A.taps=1+!!u);u&&(u=clearTimeout(u)),D&&(A.taps<2&&(d=R[0],u=setTimeout(function(){u=null},g)),Wt(this),A.start())}}function T(b,...I){if(this.__zooming){var N=E(this,I).event(b),$=b.changedTouches,A=$.length,D,H,L,R;for(dt(b),D=0;D<A;++D)H=$[D],L=de(H,this),N.touch0&&N.touch0[2]===H.identifier?N.touch0[0]=L:N.touch1&&N.touch1[2]===H.identifier&&(N.touch1[0]=L);if(H=N.that.__zoom,N.touch1){var F=N.touch0[0],B=N.touch0[1],Z=N.touch1[0],U=N.touch1[1],W=(W=Z[0]-F[0])*W+(W=Z[1]-F[1])*W,V=(V=U[0]-B[0])*V+(V=U[1]-B[1])*V;H=_(H,Math.sqrt(W/V)),L=[(F[0]+Z[0])/2,(F[1]+Z[1])/2],R=[(B[0]+U[0])/2,(B[1]+U[1])/2]}else if(N.touch0)L=N.touch0[0],R=N.touch0[1];else return;N.zoom("touch",n(h(H,L,R),N.extent,s))}}function j(b,...I){if(this.__zooming){var N=E(this,I).event(b),$=b.changedTouches,A=$.length,D,H;for(Nn(b),f&&clearTimeout(f),f=setTimeout(function(){f=null},g),D=0;D<A;++D)H=$[D],N.touch0&&N.touch0[2]===H.identifier?delete N.touch0:N.touch1&&N.touch1[2]===H.identifier&&delete N.touch1;if(N.touch1&&!N.touch0&&(N.touch0=N.touch1,delete N.touch1),N.touch0)N.touch0[1]=this.__zoom.invert(N.touch0[0]);else if(N.end(),N.taps===2&&(H=de(H,this),Math.hypot(d[0]-H[0],d[1]-H[1])<v)){var L=le(this).on("dblclick.zoom");L&&L.apply(this,arguments)}}}return x.wheelDelta=function(b){return arguments.length?(o=typeof b=="function"?b:jt(+b),x):o},x.filter=function(b){return arguments.length?(e=typeof b=="function"?b:jt(!!b),x):e},x.touchable=function(b){return arguments.length?(r=typeof b=="function"?b:jt(!!b),x):r},x.extent=function(b){return arguments.length?(t=typeof b=="function"?b:jt([[+b[0][0],+b[0][1]],[+b[1][0],+b[1][1]]]),x):t},x.scaleExtent=function(b){return arguments.length?(i[0]=+b[0],i[1]=+b[1],x):[i[0],i[1]]},x.translateExtent=function(b){return arguments.length?(s[0][0]=+b[0][0],s[1][0]=+b[1][0],s[0][1]=+b[0][1],s[1][1]=+b[1][1],x):[[s[0][0],s[0][1]],[s[1][0],s[1][1]]]},x.constrain=function(b){return arguments.length?(n=b,x):n},x.duration=function(b){return arguments.length?(a=+b,x):a},x.interpolate=function(b){return arguments.length?(l=b,x):l},x.on=function(){var b=c.on.apply(c,arguments);return b===c?x:b},x.clickDistance=function(b){return arguments.length?(m=(b=+b)*b,x):Math.sqrt(m)},x.tapDistance=function(b){return arguments.length?(v=+b,x):v},x}const ve={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."},bt=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],pi=["Enter"," ","Escape"],mi={"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 et;(function(e){e.Strict="strict",e.Loose="loose"})(et||(et={}));var Re;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(Re||(Re={}));var _t;(function(e){e.Partial="partial",e.Full="full"})(_t||(_t={}));const yi={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var Ae;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Ae||(Ae={}));var en;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(en||(en={}));var X;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(X||(X={}));const Yo={[X.Left]:X.Right,[X.Right]:X.Left,[X.Top]:X.Bottom,[X.Bottom]:X.Top};function xi(e){return e===null?null:e?"valid":"invalid"}const wi=e=>"id"in e&&"source"in e&&"target"in e,Gd=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),so=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),kt=(e,t=[0,0])=>{const{width:n,height:o}=Me(e),r=e.origin??t,i=n*r[0],s=o*r[1];return{x:e.position.x-i,y:e.position.y-s}},Ud=(e,t={nodeOrigin:[0,0]})=>{if(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):so(r)?r:t.nodeLookup.get(r.id));const a=s?tn(s,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return dn(o,a)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return fn(n)},It=(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=dn(n,tn(r)),o=!0)}),o?fn(n):{x:0,y:0,width:0,height:0}},ao=(e,t,[n,o,r]=[0,0,1],i=!1,s=!1)=>{const a={...At(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 g=u.width??c.width??c.initialWidth??null,p=u.height??c.height??c.initialHeight??null,m=St(a,nt(c)),v=(g??0)*(p??0),x=i&&m>0;(!c.internals.handleBounds||x||m>=v||c.dragging)&&l.push(c)}return l},Kd=(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 Qd(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 Jd({nodes:e,width:t,height:n,panZoom:o,minZoom:r,maxZoom:i},s){if(e.size===0)return Promise.resolve(!0);const a=Qd(e,s),l=It(a),c=co(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 vi({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",ve.error005());else{const g=a.measured.width,p=a.measured.height;g&&p&&(d=[[l,c],[l+g,c+p]])}else a&&ot(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=ot(d)?Ve(t,d,s.measured):t;return(s.measured.width===void 0||s.measured.height===void 0)&&i?.("015",ve.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 ef({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 g=i.has(f.id),p=!g&&f.parentId&&s.find(m=>m.id===f.parentId);(g||p)&&s.push(f)}const a=new Set(t.map(f=>f.id)),l=o.filter(f=>f.deletable!==!1),u=Kd(s,l);for(const f of l)a.has(f.id)&&!u.find(p=>p.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 tt=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),Ve=(e={x:0,y:0},t,n)=>({x:tt(e.x,t[0][0],t[1][0]-(n?.width??0)),y:tt(e.y,t[0][1],t[1][1]-(n?.height??0))});function bi(e,t,n){const{width:o,height:r}=Me(n),{x:i,y:s}=n.internals.positionAbsolute;return Ve(e,[[i,s],[i+o,s+r]],t)}const Wo=(e,t,n)=>e<t?tt(Math.abs(e-t),1,t)/t:e>n?-tt(Math.abs(e-n),1,t)/t:0,_i=(e,t,n=15,o=40)=>{const r=Wo(e.x,o,t.width-o)*n,i=Wo(e.y,o,t.height-o)*n;return[r,i]},dn=(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)}),Wn=({x:e,y:t,width:n,height:o})=>({x:e,y:t,x2:e+n,y2:t+o}),fn=({x:e,y:t,x2:n,y2:o})=>({x:e,y:t,width:n-e,height:o-t}),nt=(e,t=[0,0])=>{const{x:n,y:o}=so(e)?e.internals.positionAbsolute:kt(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}},tn=(e,t=[0,0])=>{const{x:n,y:o}=so(e)?e.internals.positionAbsolute:kt(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)}},Si=(e,t)=>fn(dn(Wn(e),Wn(t))),St=(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)},Zo=e=>ge(e.width)&&ge(e.height)&&ge(e.x)&&ge(e.y),ge=e=>!isNaN(e)&&isFinite(e),tf=(e,t)=>{},zt=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),At=({x:e,y:t},[n,o,r],i=!1,s=[1,1])=>{const a={x:(e-n)/r,y:(t-o)/r};return i?zt(a,s):a},nn=({x:e,y:t},[n,o,r])=>({x:e*r+n,y:t*r+o});function Xe(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 nf(e,t,n){if(typeof e=="string"||typeof e=="number"){const o=Xe(e,n),r=Xe(e,t);return{top:o,right:r,bottom:o,left:r,x:r*2,y:o*2}}if(typeof e=="object"){const o=Xe(e.top??e.y??0,n),r=Xe(e.bottom??e.y??0,n),i=Xe(e.left??e.x??0,t),s=Xe(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 of(e,t,n,o,r,i){const{x:s,y:a}=nn(e,[t,n,o]),{x:l,y:c}=nn({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 co=(e,t,n,o,r,i)=>{const s=nf(i,t,n),a=(t-s.x)/e.width,l=(n-s.y)/e.height,c=Math.min(a,l),u=tt(c,o,r),d=e.x+e.width/2,f=e.y+e.height/2,g=t/2-d*u,p=n/2-f*u,m=of(e,g,p,u,t,n),v={left:Math.min(m.left-s.left,0),top:Math.min(m.top-s.top,0),right:Math.min(m.right-s.right,0),bottom:Math.min(m.bottom-s.bottom,0)};return{x:g-v.left+v.right,y:p-v.top+v.bottom,zoom:u}},Et=()=>typeof navigator<"u"&&navigator?.userAgent?.indexOf("Mac")>=0;function ot(e){return e!=null&&e!=="parent"}function Me(e){return{width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}}function Ei(e){return(e.measured?.width??e.width??e.initialWidth)!==void 0&&(e.measured?.height??e.height??e.initialHeight)!==void 0}function Ci(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 qo(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function rf(){let e,t;return{promise:new Promise((o,r)=>{e=o,t=r}),resolve:e,reject:t}}function sf(e){return{...mi,...e||{}}}function mt(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:o,containerBounds:r}){const{x:i,y:s}=pe(e),a=At({x:i-(r?.left??0),y:s-(r?.top??0)},o),{x:l,y:c}=n?zt(a,t):a;return{xSnapped:l,ySnapped:c,...a}}const lo=e=>({width:e.offsetWidth,height:e.offsetHeight}),Ni=e=>e?.getRootNode?.()||window?.document,af=["INPUT","SELECT","TEXTAREA"];function Mi(e){const t=e.composedPath?.()?.[0]||e.target;return t?.nodeType!==1?!1:af.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const ki=e=>"clientX"in e,pe=(e,t)=>{const n=ki(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)}},Go=(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,...lo(s)}})};function Ii({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 Rt(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function Uo({pos:e,x1:t,y1:n,x2:o,y2:r,c:i}){switch(e){case X.Left:return[t-Rt(t-o,i),n];case X.Right:return[t+Rt(o-t,i),n];case X.Top:return[t,n-Rt(n-r,i)];case X.Bottom:return[t,n+Rt(r-n,i)]}}function zi({sourceX:e,sourceY:t,sourcePosition:n=X.Bottom,targetX:o,targetY:r,targetPosition:i=X.Top,curvature:s=.25}){const[a,l]=Uo({pos:n,x1:e,y1:t,x2:o,y2:r,c:s}),[c,u]=Uo({pos:i,x1:o,y1:r,x2:e,y2:t,c:s}),[d,f,g,p]=Ii({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,g,p]}function Ai({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 cf({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 lf({sourceNode:e,targetNode:t,width:n,height:o,transform:r}){const i=dn(tn(e),tn(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 St(s,fn(i))>0}const uf=({source:e,sourceHandle:t,target:n,targetHandle:o})=>`xy-edge__${e}${t||""}-${n}${o||""}`,df=(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)),ff=(e,t,n={})=>{if(!e.source||!e.target)return t;const o=n.getEdgeId||uf;let r;return wi(e)?r={...e}:r={...e,id:o(e)},df(r,t)?t:(r.sourceHandle===null&&delete r.sourceHandle,r.targetHandle===null&&delete r.targetHandle,t.concat(r))};function $i({sourceX:e,sourceY:t,targetX:n,targetY:o}){const[r,i,s,a]=Ai({sourceX:e,sourceY:t,targetX:n,targetY:o});return[`M ${e},${t}L ${n},${o}`,r,i,s,a]}const Ko={[X.Left]:{x:-1,y:0},[X.Right]:{x:1,y:0},[X.Top]:{x:0,y:-1},[X.Bottom]:{x:0,y:1}},hf=({source:e,sourcePosition:t=X.Bottom,target:n})=>t===X.Left||t===X.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},Qo=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function gf({source:e,sourcePosition:t=X.Bottom,target:n,targetPosition:o=X.Top,center:r,offset:i,stepPosition:s}){const a=Ko[t],l=Ko[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=hf({source:c,sourcePosition:t,target:u}),f=d.x!==0?"x":"y",g=d[f];let p=[],m,v;const x={x:0,y:0},_={x:0,y:0},[,,h,w]=Ai({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(a[f]*l[f]===-1){f==="x"?(m=r.x??c.x+(u.x-c.x)*s,v=r.y??(c.y+u.y)/2):(m=r.x??(c.x+u.x)/2,v=r.y??c.y+(u.y-c.y)*s);const E=[{x:m,y:c.y},{x:m,y:u.y}],S=[{x:c.x,y:v},{x:u.x,y:v}];a[f]===g?p=f==="x"?E:S:p=f==="x"?S:E}else{const E=[{x:c.x,y:u.y}],S=[{x:u.x,y:c.y}];if(f==="x"?p=a.x===g?S:E:p=a.y===g?E:S,t===o){const T=Math.abs(e[f]-n[f]);if(T<=i){const j=Math.min(i-1,i-T);a[f]===g?x[f]=(c[f]>e[f]?-1:1)*j:_[f]=(u[f]>n[f]?-1:1)*j}}if(t!==o){const T=f==="x"?"y":"x",j=a[f]===l[T],b=c[T]>u[T],I=c[T]<u[T];(a[f]===1&&(!j&&b||j&&I)||a[f]!==1&&(!j&&I||j&&b))&&(p=f==="x"?E:S)}const M={x:c.x+x.x,y:c.y+x.y},z={x:u.x+_.x,y:u.y+_.y},O=Math.max(Math.abs(M.x-p[0].x),Math.abs(z.x-p[0].x)),k=Math.max(Math.abs(M.y-p[0].y),Math.abs(z.y-p[0].y));O>=k?(m=(M.x+z.x)/2,v=p[0].y):(m=p[0].x,v=(M.y+z.y)/2)}return[[e,{x:c.x+x.x,y:c.y+x.y},...p,{x:u.x+_.x,y:u.y+_.y},n],m,v,h,w]}function pf(e,t,n,o){const r=Math.min(Qo(e,t)/2,Qo(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 Zn({sourceX:e,sourceY:t,sourcePosition:n=X.Bottom,targetX:o,targetY:r,targetPosition:i=X.Top,borderRadius:s=5,centerX:a,centerY:l,offset:c=20,stepPosition:u=.5}){const[d,f,g,p,m]=gf({source:{x:e,y:t},sourcePosition:n,target:{x:o,y:r},targetPosition:i,center:{x:a,y:l},offset:c,stepPosition:u});return[d.reduce((x,_,h)=>{let w="";return h>0&&h<d.length-1?w=pf(d[h-1],_,d[h+1],s):w=`${h===0?"M":"L"}${_.x} ${_.y}`,x+=w,x},""),f,g,p,m]}function Jo(e){return e&&!!(e.internals.handleBounds||e.handles?.length)&&!!(e.measured.width||e.width||e.initialWidth)}function mf(e){const{sourceNode:t,targetNode:n}=e;if(!Jo(t)||!Jo(n))return null;const o=t.internals.handleBounds||er(t.handles),r=n.internals.handleBounds||er(n.handles),i=tr(o?.source??[],e.sourceHandle),s=tr(e.connectionMode===et.Strict?r?.target??[]:(r?.target??[]).concat(r?.source??[]),e.targetHandle);if(!i||!s)return e.onError?.("008",ve.error008(i?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const a=i?.position||X.Bottom,l=s?.position||X.Top,c=Be(t,i,a),u=Be(n,s,l);return{sourceX:c.x,sourceY:c.y,targetX:u.x,targetY:u.y,sourcePosition:a,targetPosition:l}}function er(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 Be(e,t,n=X.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??Me(e);if(o)return{x:r+s/2,y:i+a/2};switch(t?.position??n){case X.Top:return{x:r+s/2,y:i};case X.Right:return{x:r+s,y:i+a/2};case X.Bottom:return{x:r+s/2,y:i+a};case X.Left:return{x:r,y:i+a/2}}}function tr(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function qn(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(o=>`${o}=${e[o]}`).join("&")}`:""}function yf(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=qn(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 Pi=1e3,xf=10,uo={nodeOrigin:[0,0],nodeExtent:bt,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},wf={...uo,checkEquality:!0};function fo(e,t){const n={...e};for(const o in t)t[o]!==void 0&&(n[o]=t[o]);return n}function vf(e,t,n){const o=fo(uo,n);for(const r of e.values())if(r.parentId)go(r,e,t,o);else{const i=kt(r,o.nodeOrigin),s=ot(r.extent)?r.extent:o.nodeExtent,a=Ve(i,s,Me(r));r.internals.positionAbsolute=a}}function bf(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 ho(e){return e==="manual"}function Gn(e,t,n,o={}){const r=fo(wf,o),i={i:0},s=new Map(t),a=r?.elevateNodesOnSelect&&!ho(r.zIndexMode)?Pi:0;let l=e.length>0;t.clear(),n.clear();for(const c of e){let u=s.get(c.id);if(r.checkEquality&&c===u?.internals.userNode)t.set(c.id,u);else{const d=kt(c,r.nodeOrigin),f=ot(c.extent)?c.extent:r.nodeExtent,g=Ve(d,f,Me(c));u={...r.defaults,...c,measured:{width:c.measured?.width,height:c.measured?.height},internals:{positionAbsolute:g,handleBounds:bf(c,u),z:Di(c,a,r.zIndexMode),userNode:c}},t.set(c.id,u)}(u.measured===void 0||u.measured.width===void 0||u.measured.height===void 0)&&!u.hidden&&(l=!1),c.parentId&&go(u,t,n,o,i)}return l}function _f(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 go(e,t,n,o,r){const{elevateNodesOnSelect:i,nodeOrigin:s,nodeExtent:a,zIndexMode:l}=fo(uo,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}_f(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*xf),r&&u.internals.rootParentIndex!==void 0&&(r.i=u.internals.rootParentIndex);const d=i&&!ho(l)?Pi:0,{x:f,y:g,z:p}=Sf(e,u,s,a,d,l),{positionAbsolute:m}=e.internals,v=f!==m.x||g!==m.y;(v||p!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:v?{x:f,y:g}:m,z:p}})}function Di(e,t,n){const o=ge(e.zIndex)?e.zIndex:0;return ho(n)?o:o+(e.selected?t:0)}function Sf(e,t,n,o,r,i){const{x:s,y:a}=t.internals.positionAbsolute,l=Me(e),c=kt(e,n),u=ot(e.extent)?Ve(c,e.extent,l):c;let d=Ve({x:s+u.x,y:a+u.y},o,l);e.extent==="parent"&&(d=bi(d,l,t));const f=Di(e,r,i),g=t.internals.z??0;return{x:d.x,y:d.y,z:g>=f?g+1:f}}function po(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??nt(a),c=Si(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=Me(a),d=a.origin??o,f=s.x<c.x?Math.round(Math.abs(c.x-s.x)):0,g=s.y<c.y?Math.round(Math.abs(c.y-s.y)):0,p=Math.max(u.width,Math.round(s.width)),m=Math.max(u.height,Math.round(s.height)),v=(p-u.width)*d[0],x=(m-u.height)*d[1];(f>0||g>0||v||x)&&(r.push({id:l,type:"position",position:{x:a.position.x-f+v,y:a.position.y-g+x}}),n.get(l)?.forEach(_=>{e.some(h=>h.id===_.id)||r.push({id:_.id,type:"position",position:{x:_.position.x+f,y:_.position.y+g}})})),(u.width<s.width||u.height<s.height||f||g)&&r.push({id:l,type:"dimensions",setAttributes:!0,dimensions:{width:p+(f?d[0]*f-v:0),height:m+(g?d[1]*g-x:0)}})}),r}function Ef(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 g of e.values()){const p=t.get(g.id);if(!p)continue;if(p.hidden){t.set(p.id,{...p,internals:{...p.internals,handleBounds:void 0}}),l=!0;continue}const m=lo(g.nodeElement),v=p.measured.width!==m.width||p.measured.height!==m.height;if(!!(m.width&&m.height&&(v||!p.internals.handleBounds||g.force))){const _=g.nodeElement.getBoundingClientRect(),h=ot(p.extent)?p.extent:i;let{positionAbsolute:w}=p.internals;p.parentId&&p.extent==="parent"?w=bi(w,m,t.get(p.parentId)):h&&(w=Ve(w,h,m));const C={...p,measured:m,internals:{...p.internals,positionAbsolute:w,handleBounds:{source:Go("source",g.nodeElement,_,d,p.id),target:Go("target",g.nodeElement,_,d,p.id)}}};t.set(p.id,C),p.parentId&&go(C,t,n,{nodeOrigin:r,zIndexMode:s}),l=!0,v&&(c.push({id:p.id,type:"dimensions",dimensions:m}),p.expandParent&&p.parentId&&f.push({id:p.id,parentId:p.parentId,rect:nt(C,r)}))}}if(f.length>0){const g=po(f,t,n,r);c.push(...g)}return{changes:c,updatedInternals:l}}async function Cf({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 nr(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 Ti(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}`;nr("source",l,u,e,r,s),nr("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 or(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 Nf(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 Mn({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 Mf({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=zt(i,t);return{x:s.x-i.x,y:s.y-i.y}}function kf({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,g=!1,p=!1,m=null;function v({noDragClassName:_,handleSelector:h,domNode:w,isSelectable:C,nodeId:E,nodeClickDistance:S=0}){f=le(w);function M({x:T,y:j}){const{nodeLookup:b,nodeExtent:I,snapGrid:N,snapToGrid:$,nodeOrigin:A,onNodeDrag:D,onSelectionDrag:H,onError:L,updateNodePositions:R}=t();i={x:T,y:j};let F=!1;const B=a.size>1,Z=B&&I?Wn(It(a)):null,U=B&&$?Mf({dragItems:a,snapGrid:N,x:T,y:j}):null;for(const[W,V]of a){if(!b.has(W))continue;let Y={x:T-V.distance.x,y:j-V.distance.y};$&&(Y=U?{x:Math.round(Y.x+U.x),y:Math.round(Y.y+U.y)}:zt(Y,N));let Q=null;if(B&&I&&!V.extent&&Z){const{positionAbsolute:G}=V.internals,ee=G.x-Z.x+I[0][0],ne=G.x+V.measured.width-Z.x2+I[1][0],te=G.y-Z.y+I[0][1],ae=G.y+V.measured.height-Z.y2+I[1][1];Q=[[ee,te],[ne,ae]]}const{position:K,positionAbsolute:q}=vi({nodeId:W,nextPosition:Y,nodeLookup:b,nodeExtent:Q||I,nodeOrigin:A,onError:L});F=F||V.position.x!==K.x||V.position.y!==K.y,V.position=K,V.internals.positionAbsolute=q}if(p=p||F,!!F&&(R(a,!0),m&&(o||D||!E&&H))){const[W,V]=Mn({nodeId:E,dragItems:a,nodeLookup:b});o?.(m,a,W,V),D?.(m,W,V),E||H?.(m,V)}}async function z(){if(!u)return;const{transform:T,panBy:j,autoPanSpeed:b,autoPanOnNodeDrag:I}=t();if(!I){l=!1,cancelAnimationFrame(s);return}const[N,$]=_i(c,u,b);(N!==0||$!==0)&&(i.x=(i.x??0)-N/T[2],i.y=(i.y??0)-$/T[2],await j({x:N,y:$})&&M(i)),s=requestAnimationFrame(z)}function O(T){const{nodeLookup:j,multiSelectionActive:b,nodesDraggable:I,transform:N,snapGrid:$,snapToGrid:A,selectNodesOnDrag:D,onNodeDragStart:H,onSelectionDragStart:L,unselectNodesAndEdges:R}=t();d=!0,(!D||!C)&&!b&&E&&(j.get(E)?.selected||R()),C&&D&&E&&e?.(E);const F=mt(T.sourceEvent,{transform:N,snapGrid:$,snapToGrid:A,containerBounds:u});if(i=F,a=Nf(j,I,F,E),a.size>0&&(n||H||!E&&L)){const[B,Z]=Mn({nodeId:E,dragItems:a,nodeLookup:j});n?.(T.sourceEvent,a,B,Z),H?.(T.sourceEvent,B,Z),E||L?.(T.sourceEvent,Z)}}const k=Jr().clickDistance(S).on("start",T=>{const{domNode:j,nodeDragThreshold:b,transform:I,snapGrid:N,snapToGrid:$}=t();u=j?.getBoundingClientRect()||null,g=!1,p=!1,m=T.sourceEvent,b===0&&O(T),i=mt(T.sourceEvent,{transform:I,snapGrid:N,snapToGrid:$,containerBounds:u}),c=pe(T.sourceEvent,u)}).on("drag",T=>{const{autoPanOnNodeDrag:j,transform:b,snapGrid:I,snapToGrid:N,nodeDragThreshold:$,nodeLookup:A}=t(),D=mt(T.sourceEvent,{transform:b,snapGrid:I,snapToGrid:N,containerBounds:u});if(m=T.sourceEvent,(T.sourceEvent.type==="touchmove"&&T.sourceEvent.touches.length>1||E&&!A.has(E))&&(g=!0),!g){if(!l&&j&&d&&(l=!0,z()),!d){const H=pe(T.sourceEvent,u),L=H.x-c.x,R=H.y-c.y;Math.sqrt(L*L+R*R)>$&&O(T)}(i.x!==D.xSnapped||i.y!==D.ySnapped)&&a&&d&&(c=pe(T.sourceEvent,u),M(D))}}).on("end",T=>{if(!(!d||g)&&(l=!1,d=!1,cancelAnimationFrame(s),a.size>0)){const{nodeLookup:j,updateNodePositions:b,onNodeDragStop:I,onSelectionDragStop:N}=t();if(p&&(b(a,!1),p=!1),r||I||!E&&N){const[$,A]=Mn({nodeId:E,dragItems:a,nodeLookup:j,dragging:!1});r?.(T.sourceEvent,a,$,A),I?.(T.sourceEvent,$,A),E||N?.(T.sourceEvent,A)}}}).filter(T=>{const j=T.target;return!T.button&&(!_||!or(j,`.${_}`,w))&&(!h||or(j,h,w))});f.call(k)}function x(){f?.on(".drag",null)}return{update:v,destroy:x}}function If(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())St(r,nt(i))>0&&o.push(i);return o}const zf=250;function Af(e,t,n,o){let r=[],i=1/0;const s=If(e,n,t+zf);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}=Be(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 ji(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,...Be(s,l,l.position,!0)}:l}function Ri(e,t){return e||(t?.classList.contains("target")?"target":t?.classList.contains("source")?"source":null)}function $f(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const Li=()=>!0;function Pf(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:g,onConnectStart:p,onConnect:m,onConnectEnd:v,isValidConnection:x=Li,onReconnectEnd:_,updateConnection:h,getTransform:w,getFromHandle:C,autoPanSpeed:E,dragThreshold:S=1,handleDomNode:M}){const z=Ni(e.target);let O=0,k;const{x:T,y:j}=pe(e),b=Ri(i,M),I=a?.getBoundingClientRect();let N=!1;if(!I||!b)return;const $=ji(r,b,o,l,t);if(!$)return;let A=pe(e,I),D=!1,H=null,L=!1,R=null;function F(){if(!u||!I)return;const[K,q]=_i(A,I,E);f({x:K,y:q}),O=requestAnimationFrame(F)}const B={...$,nodeId:r,type:b,position:$.position},Z=l.get(r);let W={inProgress:!0,isValid:null,from:Be(Z,B,X.Left,!0),fromHandle:B,fromPosition:B.position,fromNode:Z,to:A,toHandle:null,toPosition:Yo[B.position],toNode:null,pointer:A};function V(){N=!0,h(W),p?.(e,{nodeId:r,handleId:o,handleType:b})}S===0&&V();function Y(K){if(!N){const{x:ae,y:ke}=pe(K),_e=ae-T,De=ke-j;if(!(_e*_e+De*De>S*S))return;V()}if(!C()||!B){Q(K);return}const q=w();A=pe(K,I),k=Af(At(A,q,!1,[1,1]),n,l,B),D||(F(),D=!0);const G=Oi(K,{handle:k,connectionMode:t,fromNodeId:r,fromHandleId:o,fromType:s?"target":"source",isValidConnection:x,doc:z,lib:c,flowId:d,nodeLookup:l});R=G.handleDomNode,H=G.connection,L=$f(!!k,G.isValid);const ee=l.get(r),ne=ee?Be(ee,B,X.Left,!0):W.from,te={...W,from:ne,isValid:L,to:G.toHandle&&L?nn({x:G.toHandle.x,y:G.toHandle.y},q):A,toHandle:G.toHandle,toPosition:L&&G.toHandle?G.toHandle.position:Yo[B.position],toNode:G.toHandle?l.get(G.toHandle.nodeId):null,pointer:A};h(te),W=te}function Q(K){if(!("touches"in K&&K.touches.length>0)){if(N){(k||R)&&H&&L&&m?.(H);const{inProgress:q,...G}=W,ee={...G,toPosition:W.toHandle?W.toPosition:null};v?.(K,ee),i&&_?.(K,ee)}g(),cancelAnimationFrame(O),D=!1,L=!1,H=null,R=null,z.removeEventListener("mousemove",Y),z.removeEventListener("mouseup",Q),z.removeEventListener("touchmove",Y),z.removeEventListener("touchend",Q)}}z.addEventListener("mousemove",Y),z.addEventListener("mouseup",Q),z.addEventListener("touchmove",Y),z.addEventListener("touchend",Q)}function Oi(e,{handle:t,connectionMode:n,fromNodeId:o,fromHandleId:r,fromType:i,doc:s,lib:a,flowId:l,isValidConnection:c=Li,nodeLookup:u}){const d=i==="target",f=t?s.querySelector(`.${a}-flow__handle[data-id="${l}-${t?.nodeId}-${t?.id}-${t?.type}"]`):null,{x:g,y:p}=pe(e),m=s.elementFromPoint(g,p),v=m?.classList.contains(`${a}-flow__handle`)?m:f,x={handleDomNode:v,isValid:!1,connection:null,toHandle:null};if(v){const _=Ri(void 0,v),h=v.getAttribute("data-nodeid"),w=v.getAttribute("data-handleid"),C=v.classList.contains("connectable"),E=v.classList.contains("connectableend");if(!h||!_)return x;const S={source:d?h:o,sourceHandle:d?w:r,target:d?o:h,targetHandle:d?r:w};x.connection=S;const z=C&&E&&(n===et.Strict?d&&_==="source"||!d&&_==="target":h!==o||w!==r);x.isValid=z&&c(S),x.toHandle=ji(h,_,w,u,n,!0)}return x}const Un={onPointerDown:Pf,isValid:Oi};function Df({domNode:e,panZoom:t,getTransform:n,getViewScale:o}){const r=le(e);function i({translateExtent:a,width:l,height:c,zoomStep:u=1,pannable:d=!0,zoomable:f=!0,inversePan:g=!1}){const p=h=>{if(h.sourceEvent.type!=="wheel"||!t)return;const w=n(),C=h.sourceEvent.ctrlKey&&Et()?10:1,E=-h.sourceEvent.deltaY*(h.sourceEvent.deltaMode===1?.05:h.sourceEvent.deltaMode?1:.002)*u,S=w[2]*Math.pow(2,E*C);t.scaleTo(S)};let m=[0,0];const v=h=>{(h.sourceEvent.type==="mousedown"||h.sourceEvent.type==="touchstart")&&(m=[h.sourceEvent.clientX??h.sourceEvent.touches[0].clientX,h.sourceEvent.clientY??h.sourceEvent.touches[0].clientY])},x=h=>{const w=n();if(h.sourceEvent.type!=="mousemove"&&h.sourceEvent.type!=="touchmove"||!t)return;const C=[h.sourceEvent.clientX??h.sourceEvent.touches[0].clientX,h.sourceEvent.clientY??h.sourceEvent.touches[0].clientY],E=[C[0]-m[0],C[1]-m[1]];m=C;const S=o()*Math.max(w[2],Math.log(w[2]))*(g?-1:1),M={x:w[0]-E[0]*S,y:w[1]-E[1]*S},z=[[0,0],[l,c]];t.setViewportConstrained({x:M.x,y:M.y,zoom:w[2]},z,a)},_=gi().on("start",v).on("zoom",d?x:null).on("zoom.wheel",f?p:null);r.call(_,{})}function s(){r.on("zoom",null)}return{update:i,destroy:s,pointer:de}}const hn=e=>({x:e.x,y:e.y,zoom:e.k}),kn=({x:e,y:t,zoom:n})=>un.translate(e,t).scale(n),We=(e,t)=>e.target.closest(`.${t}`),Vi=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),Tf=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,In=(e,t=0,n=Tf,o=()=>{})=>{const r=typeof t=="number"&&t>0;return r||o(),r?e.transition().duration(t).ease(n).on("end",o):e},Bi=e=>{const t=e.ctrlKey&&Et()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function Hf({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:o,panOnScrollMode:r,panOnScrollSpeed:i,zoomOnPinch:s,onPanZoomStart:a,onPanZoom:l,onPanZoomEnd:c}){return u=>{if(We(u,t))return u.ctrlKey&&u.preventDefault(),!1;u.preventDefault(),u.stopImmediatePropagation();const d=n.property("__zoom").k||1;if(u.ctrlKey&&s){const v=de(u),x=Bi(u),_=d*Math.pow(2,x);o.scaleTo(n,_,v,u);return}const f=u.deltaMode===1?20:1;let g=r===Re.Vertical?0:u.deltaX*f,p=r===Re.Horizontal?0:u.deltaY*f;!Et()&&u.shiftKey&&r!==Re.Vertical&&(g=u.deltaY*f,p=0),o.translateBy(n,-(g/d)*i,-(p/d)*i,{internal:!0});const m=hn(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(l?.(u,m),e.panScrollTimeout=setTimeout(()=>{c?.(u,m),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,a?.(u,m))}}function jf({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(o,r){const i=o.type==="wheel",s=!t&&i&&!o.ctrlKey,a=We(o,e);if(o.ctrlKey&&i&&a&&o.preventDefault(),s||a)return null;o.preventDefault(),n.call(this,o,r)}}function Rf({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return o=>{if(o.sourceEvent?.internal)return;const r=hn(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 Lf({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:o,onPanZoom:r}){return i=>{e.usedRightMouseButton=!!(n&&Vi(t,e.mouseButton??0)),i.sourceEvent?.sync||o([i.transform.x,i.transform.y,i.transform.k]),r&&!i.sourceEvent?.internal&&r?.(i.sourceEvent,hn(i.transform))}}function Of({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:o,onPanZoomEnd:r,onPaneContextMenu:i}){return s=>{if(!s.sourceEvent?.internal&&(e.isZoomingOrPanning=!1,i&&Vi(t,e.mouseButton??0)&&!e.usedRightMouseButton&&s.sourceEvent&&i(s.sourceEvent),e.usedRightMouseButton=!1,o(!1),r)){const a=hn(s.transform);e.prevViewport=a,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{r?.(s.sourceEvent,a)},n?150:0)}}}function Vf({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,g=n&&d.ctrlKey,p=d.type==="wheel";if(d.button===1&&d.type==="mousedown"&&(We(d,`${c}-flow__node`)||We(d,`${c}-flow__edge`)))return!0;if(!o&&!f&&!r&&!i&&!n||s||u&&!p||We(d,a)&&p||We(d,l)&&(!p||r&&p&&!e)||!n&&d.ctrlKey&&p)return!1;if(!n&&d.type==="touchstart"&&d.touches?.length>1)return d.preventDefault(),!1;if(!f&&!r&&!g&&p||!o&&(d.type==="mousedown"||d.type==="touchstart")||Array.isArray(o)&&!o.includes(d.button)&&d.type==="mousedown")return!1;const m=Array.isArray(o)&&o.includes(d.button)||!d.button||d.button<=1;return(!d.ctrlKey||p)&&m}}function Bf({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=gi().scaleExtent([t,n]).translateExtent(o),f=le(e).call(d);_({x:r.x,y:r.y,zoom:tt(r.zoom,t,n)},[[0,0],[u.width,u.height]],o);const g=f.on("wheel.zoom"),p=f.on("dblclick.zoom");d.wheelDelta(Bi);function m(k,T){return f?new Promise(j=>{d?.interpolate(T?.interpolate==="linear"?pt:Ft).transform(In(f,T?.duration,T?.ease,()=>j(!0)),k)}):Promise.resolve(!1)}function v({noWheelClassName:k,noPanClassName:T,onPaneContextMenu:j,userSelectionActive:b,panOnScroll:I,panOnDrag:N,panOnScrollMode:$,panOnScrollSpeed:A,preventScrolling:D,zoomOnPinch:H,zoomOnScroll:L,zoomOnDoubleClick:R,zoomActivationKeyPressed:F,lib:B,onTransformChange:Z,connectionInProgress:U,paneClickDistance:W,selectionOnDrag:V}){b&&!c.isZoomingOrPanning&&x();const Y=I&&!F&&!b;d.clickDistance(V?1/0:!ge(W)||W<0?0:W);const Q=Y?Hf({zoomPanValues:c,noWheelClassName:k,d3Selection:f,d3Zoom:d,panOnScrollMode:$,panOnScrollSpeed:A,zoomOnPinch:H,onPanZoomStart:s,onPanZoom:i,onPanZoomEnd:a}):jf({noWheelClassName:k,preventScrolling:D,d3ZoomHandler:g});if(f.on("wheel.zoom",Q,{passive:!1}),!b){const q=Rf({zoomPanValues:c,onDraggingChange:l,onPanZoomStart:s});d.on("start",q);const G=Lf({zoomPanValues:c,panOnDrag:N,onPaneContextMenu:!!j,onPanZoom:i,onTransformChange:Z});d.on("zoom",G);const ee=Of({zoomPanValues:c,panOnDrag:N,panOnScroll:I,onPaneContextMenu:j,onPanZoomEnd:a,onDraggingChange:l});d.on("end",ee)}const K=Vf({zoomActivationKeyPressed:F,panOnDrag:N,zoomOnScroll:L,panOnScroll:I,zoomOnDoubleClick:R,zoomOnPinch:H,userSelectionActive:b,noPanClassName:T,noWheelClassName:k,lib:B,connectionInProgress:U});d.filter(K),R?f.on("dblclick.zoom",p):f.on("dblclick.zoom",null)}function x(){d.on("zoom",null)}async function _(k,T,j){const b=kn(k),I=d?.constrain()(b,T,j);return I&&await m(I),new Promise(N=>N(I))}async function h(k,T){const j=kn(k);return await m(j,T),new Promise(b=>b(j))}function w(k){if(f){const T=kn(k),j=f.property("__zoom");(j.k!==k.zoom||j.x!==k.x||j.y!==k.y)&&d?.transform(f,T,null,{sync:!0})}}function C(){const k=f?hi(f.node()):{x:0,y:0,k:1};return{x:k.x,y:k.y,zoom:k.k}}function E(k,T){return f?new Promise(j=>{d?.interpolate(T?.interpolate==="linear"?pt:Ft).scaleTo(In(f,T?.duration,T?.ease,()=>j(!0)),k)}):Promise.resolve(!1)}function S(k,T){return f?new Promise(j=>{d?.interpolate(T?.interpolate==="linear"?pt:Ft).scaleBy(In(f,T?.duration,T?.ease,()=>j(!0)),k)}):Promise.resolve(!1)}function M(k){d?.scaleExtent(k)}function z(k){d?.translateExtent(k)}function O(k){const T=!ge(k)||k<0?0:k;d?.clickDistance(T)}return{update:v,destroy:x,setViewport:h,setViewportConstrained:_,getViewport:C,scaleTo:E,scaleBy:S,setScaleExtent:M,setTranslateExtent:z,syncViewport:w,setClickDistance:O}}var rt;(function(e){e.Line="line",e.Handle="handle"})(rt||(rt={}));function Ff({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 rr(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 Ie(e,t){return Math.max(0,t-e)}function ze(e,t){return Math.max(0,e-t)}function Lt(e,t,n){return Math.max(0,t-e,e-n)}function ir(e,t){return e?!t:t}function Xf(e,t,n,o,r,i,s,a){let{affectsX:l,affectsY:c}=t;const{isHorizontal:u,isVertical:d}=t,f=u&&d,{xSnapped:g,ySnapped:p}=n,{minWidth:m,maxWidth:v,minHeight:x,maxHeight:_}=o,{x:h,y:w,width:C,height:E,aspectRatio:S}=e;let M=Math.floor(u?g-e.pointerX:0),z=Math.floor(d?p-e.pointerY:0);const O=C+(l?-M:M),k=E+(c?-z:z),T=-i[0]*C,j=-i[1]*E;let b=Lt(O,m,v),I=Lt(k,x,_);if(s){let A=0,D=0;l&&M<0?A=Ie(h+M+T,s[0][0]):!l&&M>0&&(A=ze(h+O+T,s[1][0])),c&&z<0?D=Ie(w+z+j,s[0][1]):!c&&z>0&&(D=ze(w+k+j,s[1][1])),b=Math.max(b,A),I=Math.max(I,D)}if(a){let A=0,D=0;l&&M>0?A=ze(h+M,a[0][0]):!l&&M<0&&(A=Ie(h+O,a[1][0])),c&&z>0?D=ze(w+z,a[0][1]):!c&&z<0&&(D=Ie(w+k,a[1][1])),b=Math.max(b,A),I=Math.max(I,D)}if(r){if(u){const A=Lt(O/S,x,_)*S;if(b=Math.max(b,A),s){let D=0;!l&&!c||l&&!c&&f?D=ze(w+j+O/S,s[1][1])*S:D=Ie(w+j+(l?M:-M)/S,s[0][1])*S,b=Math.max(b,D)}if(a){let D=0;!l&&!c||l&&!c&&f?D=Ie(w+O/S,a[1][1])*S:D=ze(w+(l?M:-M)/S,a[0][1])*S,b=Math.max(b,D)}}if(d){const A=Lt(k*S,m,v)/S;if(I=Math.max(I,A),s){let D=0;!l&&!c||c&&!l&&f?D=ze(h+k*S+T,s[1][0])/S:D=Ie(h+(c?z:-z)*S+T,s[0][0])/S,I=Math.max(I,D)}if(a){let D=0;!l&&!c||c&&!l&&f?D=Ie(h+k*S,a[1][0])/S:D=ze(h+(c?z:-z)*S,a[0][0])/S,I=Math.max(I,D)}}}z=z+(z<0?I:-I),M=M+(M<0?b:-b),r&&(f?O>k*S?z=(ir(l,c)?-M:M)/S:M=(ir(l,c)?-z:z)*S:u?(z=M/S,c=l):(M=z*S,l=c));const N=l?h+M:h,$=c?w+z:w;return{width:C+(l?-M:M),height:E+(c?-z:z),x:i[0]*M*(l?-1:1)+N,y:i[1]*z*(c?-1:1)+$}}const Fi={width:0,height:0,x:0,y:0},Yf={...Fi,pointerX:0,pointerY:0,aspectRatio:1};function Wf(e){return[[0,0],[e.measured.width,e.measured.height]]}function Zf(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 qf({domNode:e,nodeId:t,getStoreItems:n,onChange:o,onEnd:r}){const i=le(e);let s={controlDirection:rr("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:g,onResize:p,onResizeEnd:m,shouldResize:v}){let x={...Fi},_={...Yf};s={boundaries:u,resizeDirection:f,keepAspectRatio:d,controlDirection:rr(c)};let h,w=null,C=[],E,S,M,z=!1;const O=Jr().on("start",k=>{const{nodeLookup:T,transform:j,snapGrid:b,snapToGrid:I,nodeOrigin:N,paneDomNode:$}=n();if(h=T.get(t),!h)return;w=$?.getBoundingClientRect()??null;const{xSnapped:A,ySnapped:D}=mt(k.sourceEvent,{transform:j,snapGrid:b,snapToGrid:I,containerBounds:w});x={width:h.measured.width??0,height:h.measured.height??0,x:h.position.x??0,y:h.position.y??0},_={...x,pointerX:A,pointerY:D,aspectRatio:x.width/x.height},E=void 0,h.parentId&&(h.extent==="parent"||h.expandParent)&&(E=T.get(h.parentId),S=E&&h.extent==="parent"?Wf(E):void 0),C=[],M=void 0;for(const[H,L]of T)if(L.parentId===t&&(C.push({id:H,position:{...L.position},extent:L.extent}),L.extent==="parent"||L.expandParent)){const R=Zf(L,h,L.origin??N);M?M=[[Math.min(R[0][0],M[0][0]),Math.min(R[0][1],M[0][1])],[Math.max(R[1][0],M[1][0]),Math.max(R[1][1],M[1][1])]]:M=R}g?.(k,{...x})}).on("drag",k=>{const{transform:T,snapGrid:j,snapToGrid:b,nodeOrigin:I}=n(),N=mt(k.sourceEvent,{transform:T,snapGrid:j,snapToGrid:b,containerBounds:w}),$=[];if(!h)return;const{x:A,y:D,width:H,height:L}=x,R={},F=h.origin??I,{width:B,height:Z,x:U,y:W}=Xf(_,s.controlDirection,N,s.boundaries,s.keepAspectRatio,F,S,M),V=B!==H,Y=Z!==L,Q=U!==A&&V,K=W!==D&&Y;if(!Q&&!K&&!V&&!Y)return;if((Q||K||F[0]===1||F[1]===1)&&(R.x=Q?U:x.x,R.y=K?W:x.y,x.x=R.x,x.y=R.y,C.length>0)){const ne=U-A,te=W-D;for(const ae of C)ae.position={x:ae.position.x-ne+F[0]*(B-H),y:ae.position.y-te+F[1]*(Z-L)},$.push(ae)}if((V||Y)&&(R.width=V&&(!s.resizeDirection||s.resizeDirection==="horizontal")?B:x.width,R.height=Y&&(!s.resizeDirection||s.resizeDirection==="vertical")?Z:x.height,x.width=R.width,x.height=R.height),E&&h.expandParent){const ne=F[0]*(R.width??0);R.x&&R.x<ne&&(x.x=ne,_.x=_.x-(R.x-ne));const te=F[1]*(R.height??0);R.y&&R.y<te&&(x.y=te,_.y=_.y-(R.y-te))}const q=Ff({width:x.width,prevWidth:H,height:x.height,prevHeight:L,affectsX:s.controlDirection.affectsX,affectsY:s.controlDirection.affectsY}),G={...x,direction:q};v?.(k,G)!==!1&&(z=!0,p?.(k,G),o(R,$))}).on("end",k=>{z&&(m?.(k,{...x}),r?.({...x}),z=!1)});i.call(O)}function l(){i.on(".drag",null)}return{update:a,destroy:l}}var zn={exports:{}},An={},$n={exports:{}},Pn={};var sr;function Gf(){if(sr)return Pn;sr=1;var e=Tr();function t(d,f){return d===f&&(d!==0||1/d===1/f)||d!==d&&f!==f}var n=typeof Object.is=="function"?Object.is:t,o=e.useState,r=e.useEffect,i=e.useLayoutEffect,s=e.useDebugValue;function a(d,f){var g=f(),p=o({inst:{value:g,getSnapshot:f}}),m=p[0].inst,v=p[1];return i(function(){m.value=g,m.getSnapshot=f,l(m)&&v({inst:m})},[d,g,f]),r(function(){return l(m)&&v({inst:m}),d(function(){l(m)&&v({inst:m})})},[d]),s(g),g}function l(d){var f=d.getSnapshot;d=d.value;try{var g=f();return!n(d,g)}catch{return!0}}function c(d,f){return f()}var u=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?c:a;return Pn.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:u,Pn}var ar;function Uf(){return ar||(ar=1,$n.exports=Gf()),$n.exports}var cr;function Kf(){if(cr)return An;cr=1;var e=Tr(),t=Uf();function n(c,u){return c===u&&(c!==0||1/c===1/u)||c!==c&&u!==u}var o=typeof Object.is=="function"?Object.is:n,r=t.useSyncExternalStore,i=e.useRef,s=e.useEffect,a=e.useMemo,l=e.useDebugValue;return An.useSyncExternalStoreWithSelector=function(c,u,d,f,g){var p=i(null);if(p.current===null){var m={hasValue:!1,value:null};p.current=m}else m=p.current;p=a(function(){function x(E){if(!_){if(_=!0,h=E,E=f(E),g!==void 0&&m.hasValue){var S=m.value;if(g(S,E))return w=S}return w=E}if(S=w,o(h,E))return S;var M=f(E);return g!==void 0&&g(S,M)?(h=E,S):(h=E,w=M)}var _=!1,h,w,C=d===void 0?null:d;return[function(){return x(u())},C===null?void 0:function(){return x(C())}]},[u,d,f,g]);var v=r(c,p[0],p[1]);return s(function(){m.hasValue=!0,m.value=v},[v]),l(v),v},An}var lr;function Qf(){return lr||(lr=1,zn.exports=Kf()),zn.exports}var Jf=Qf();const eh=ja(Jf),th={},ur=e=>{let t;const n=new Set,o=(u,d)=>{const f=typeof u=="function"?u(t):u;if(!Object.is(f,t)){const g=t;t=d??(typeof f!="object"||f===null)?f:Object.assign({},t,f),n.forEach(p=>p(t,g))}},r=()=>t,l={setState:o,getState:r,getInitialState:()=>c,subscribe:u=>(n.add(u),()=>n.delete(u)),destroy:()=>{(th?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},c=t=e(o,r,l);return l},nh=e=>e?ur(e):ur,{useDebugValue:oh}=Ra,{useSyncExternalStoreWithSelector:rh}=eh,ih=e=>e;function Xi(e,t=ih,n){const o=rh(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return oh(o),o}const dr=(e,t)=>{const n=nh(e),o=(r,i=t)=>Xi(n,r,i);return Object.assign(o,n),o},sh=(e,t)=>e?dr(e,t):dr;function oe(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[o,r]of e)if(!Object.is(r,t.get(o)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const o of e)if(!t.has(o))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const o of n)if(!Object.prototype.hasOwnProperty.call(t,o)||!Object.is(e[o],t[o]))return!1;return!0}const gn=P.createContext(null),ah=gn.Provider,Yi=ve.error001();function J(e,t){const n=P.useContext(gn);if(n===null)throw new Error(Yi);return Xi(n,e,t)}function re(){const e=P.useContext(gn);if(e===null)throw new Error(Yi);return P.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const fr={display:"none"},ch={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},Wi="react-flow__node-desc",Zi="react-flow__edge-desc",lh="react-flow__aria-live",uh=e=>e.ariaLiveMessage,dh=e=>e.ariaLabelConfig;function fh({rfId:e}){const t=J(uh);return y.jsx("div",{id:`${lh}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:ch,children:t})}function hh({rfId:e,disableKeyboardA11y:t}){const n=J(dh);return y.jsxs(y.Fragment,{children:[y.jsx("div",{id:`${Wi}-${e}`,style:fr,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),y.jsx("div",{id:`${Zi}-${e}`,style:fr,children:n["edge.a11yDescription.default"]}),!t&&y.jsx(fh,{rfId:e})]})}const pn=P.forwardRef(({position:e="top-left",children:t,className:n,style:o,...r},i)=>{const s=`${e}`.split("-");return y.jsx("div",{className:ie(["react-flow__panel",n,...s]),style:o,ref:i,...r,children:t})});pn.displayName="Panel";function gh({proOptions:e,position:t="bottom-right"}){return e?.hideAttribution?null:y.jsx(pn,{position:t,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:y.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const ph=e=>{const t=[],n=[];for(const[,o]of e.nodeLookup)o.selected&&t.push(o.internals.userNode);for(const[,o]of e.edgeLookup)o.selected&&n.push(o);return{selectedNodes:t,selectedEdges:n}},Ot=e=>e.id;function mh(e,t){return oe(e.selectedNodes.map(Ot),t.selectedNodes.map(Ot))&&oe(e.selectedEdges.map(Ot),t.selectedEdges.map(Ot))}function yh({onSelectionChange:e}){const t=re(),{selectedNodes:n,selectedEdges:o}=J(ph,mh);return P.useEffect(()=>{const r={nodes:n,edges:o};e?.(r),t.getState().onSelectionChangeHandlers.forEach(i=>i(r))},[n,o,e]),null}const xh=e=>!!e.onSelectionChangeHandlers;function wh({onSelectionChange:e}){const t=J(xh);return e||t?y.jsx(yh,{onSelectionChange:e}):null}const qi=[0,0],vh={x:0,y:0,zoom:1},bh=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","ariaLabelConfig","zIndexMode"],hr=[...bh,"rfId"],_h=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),gr={translateExtent:bt,nodeOrigin:qi,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function Sh(e){const{setNodes:t,setEdges:n,setMinZoom:o,setMaxZoom:r,setTranslateExtent:i,setNodeExtent:s,reset:a,setDefaultNodesAndEdges:l}=J(_h,oe),c=re();P.useEffect(()=>(l(e.defaultNodes,e.defaultEdges),()=>{u.current=gr,a()}),[]);const u=P.useRef(gr);return P.useEffect(()=>{for(const d of hr){const f=e[d],g=u.current[d];f!==g&&(typeof e[d]>"u"||(d==="nodes"?t(f):d==="edges"?n(f):d==="minZoom"?o(f):d==="maxZoom"?r(f):d==="translateExtent"?i(f):d==="nodeExtent"?s(f):d==="ariaLabelConfig"?c.setState({ariaLabelConfig:sf(f)}):d==="fitView"?c.setState({fitViewQueued:f}):d==="fitViewOptions"?c.setState({fitViewOptions:f}):c.setState({[d]:f})))}u.current=e},hr.map(d=>e[d])),null}function pr(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function Eh(e){const[t,n]=P.useState(e==="system"?null:e);return P.useEffect(()=>{if(e!=="system"){n(e);return}const o=pr(),r=()=>n(o?.matches?"dark":"light");return r(),o?.addEventListener("change",r),()=>{o?.removeEventListener("change",r)}},[e]),t!==null?t:pr()?.matches?"dark":"light"}const mr=typeof document<"u"?document:null;function Ct(e=null,t={target:mr,actInsideInputWithModifier:!0}){const[n,o]=P.useState(!1),r=P.useRef(!1),i=P.useRef(new Set([])),[s,a]=P.useMemo(()=>{if(e!==null){const c=(Array.isArray(e)?e:[e]).filter(d=>typeof d=="string").map(d=>d.replace("+",`
2
2
  `).replace(`
3
3
 
4
4
  `,`
@@ -1 +1 @@
1
- import{f as b,b as x,q as f,s as g,j,B as N,v as R}from"./entry.BY4L2Uc6.js";var a={root:"m_b183c0a2"};const h=g((e,{color:s})=>({root:{"--code-bg":s?R(s,e):void 0}})),r=b((e,s)=>{const o=x("Code",null,e),{classNames:c,className:l,style:n,styles:m,unstyled:d,vars:p,color:B,block:t,variant:i,mod:v,attributes:u,...y}=o,C=f({name:"Code",props:o,classes:a,className:l,style:n,classNames:c,styles:m,unstyled:d,attributes:u,vars:p,varsResolver:h});return j.jsx(N,{component:t?"pre":"code",variant:i,ref:s,mod:[{block:t},v],...C("root"),...y,dir:"ltr"})});r.classes=a;r.displayName="@mantine/core/Code";export{r as C};
1
+ import{f as b,b as x,q as f,s as g,j,B as N,v as R}from"./entry.Bkwg306k.js";var a={root:"m_b183c0a2"};const h=g((e,{color:s})=>({root:{"--code-bg":s?R(s,e):void 0}})),r=b((e,s)=>{const o=x("Code",null,e),{classNames:c,className:l,style:n,styles:m,unstyled:d,vars:p,color:B,block:t,variant:i,mod:v,attributes:u,...y}=o,C=f({name:"Code",props:o,classes:a,className:l,style:n,classNames:c,styles:m,unstyled:d,attributes:u,vars:p,varsResolver:h});return j.jsx(N,{component:t?"pre":"code",variant:i,ref:s,mod:[{block:t},v],...C("root"),...y,dir:"ltr"})});r.classes=a;r.displayName="@mantine/core/Code";export{r as C};