zen-gitsync 2.17.8 → 2.17.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -0
- package/package.json +2 -1
- package/src/cli/ai/agent.js +210 -58
- package/src/cli/ai/context.js +58 -0
- package/src/cli/ai/context.test.js +117 -0
- package/src/cli/ai/extensions.js +131 -0
- package/src/cli/ai/extensions.test.js +158 -0
- package/src/cli/ai/mcp.js +498 -0
- package/src/cli/ai/mcp.test.js +275 -0
- package/src/cli/ai/runtime.test.js +32 -0
- package/src/cli/ai/skills.js +207 -0
- package/src/cli/ai/skills.test.js +126 -0
- package/src/cli/ai/termui.js +1 -0
- package/src/cli/ai/tools.js +94 -3
- package/src/cli/ai/tools.test.js +82 -0
- package/src/cli/ai/transport.js +18 -4
- package/src/cli/ai/turn.js +21 -5
- package/src/config.js +27 -3
- package/src/paths.js +11 -0
- package/src/ui/public/assets/AgentView-BV15UtEF.css +1 -0
- package/src/ui/public/assets/AgentView-C-AJo7KS.js +5 -0
- package/src/ui/public/assets/AppVersionBadge-B6R6eN2N.js +2 -0
- package/src/ui/public/assets/BranchSelector-Cj3kMWON.js +1 -0
- package/src/ui/public/assets/CommitForm-DpXuFG-F.js +6 -0
- package/src/ui/public/assets/CommonDialog-BLPHDsn0.js +1 -0
- package/src/ui/public/assets/EditorView-B1OnoXXf.js +1 -0
- package/src/ui/public/assets/FileDiffViewer-BQl0JcWd.js +14 -0
- package/src/ui/public/assets/{FlowExecutionViewer-uXrzZjsW.js → FlowExecutionViewer-BgEt5_Hz.js} +1 -1
- package/src/ui/public/assets/FlowOrchestrationWorkspace-CbLmsSF8.js +21 -0
- package/src/ui/public/assets/IconButton-aM3vaSIN.js +1 -0
- package/src/ui/public/assets/LogList-UjoVFZ-H.js +7 -0
- package/src/ui/public/assets/MindmapView-D_04v0n4.js +1 -0
- package/src/ui/public/assets/MonitorView-BD1_uzq7.js +1 -0
- package/src/ui/public/assets/ProjectStartupButton-BTYlVvzh.js +1 -0
- package/src/ui/public/assets/RemoteManagerDialog-20mpQMwu.js +1 -0
- package/src/ui/public/assets/RemoteRepoCard-DOrm17Xd.js +1 -0
- package/src/ui/public/assets/SourceMapView-nUU9bYPh.js +3 -0
- package/src/ui/public/assets/SvgIcon-LUynX3Iq.js +1 -0
- package/src/ui/public/assets/TemplateManager-Bo3Q7J9Y.js +1 -0
- package/src/ui/public/assets/UserInputNode-D5tSXiJz.js +1 -0
- package/src/ui/public/assets/{WorkbenchView-v3QFn6Ln.css → WorkbenchView-C_Gmzvj1.css} +1 -1
- package/src/ui/public/assets/WorkbenchView-UGC334JL.js +13 -0
- package/src/ui/public/assets/_plugin-vue_export-helper-D-D9qkRz.js +19 -0
- package/src/ui/public/assets/configStore-BLRcYJdf.js +1 -0
- package/src/ui/public/assets/{element-plus-KTmRV-so.js → element-plus-DcZ-TVp6.js} +3 -3
- package/src/ui/public/assets/flow-mindmap-D1VTkZh3.js +139 -0
- package/src/ui/public/assets/{gitStore-CpcS-MzM.js → gitStore-DMEDMZMk.js} +4 -4
- package/src/ui/public/assets/index-CW3xs-af.css +1 -0
- package/src/ui/public/assets/index-S0_gRyiO.js +26 -0
- package/src/ui/public/assets/{office-docx-BfSBpdBv.js → office-docx-C0g5Oepv.js} +5 -5
- package/src/ui/public/assets/{office-excel-S95W2mv4.js → office-excel-D-uYLKaA.js} +1 -1
- package/src/ui/public/assets/{office-pptx-DFFarGrk.js → office-pptx-De3fnc6M.js} +1 -1
- package/src/ui/public/assets/previewSandbox-DXAxqDVu.js +0 -0
- package/src/ui/public/assets/toolsStore-CpImRUhI.js +1 -0
- package/src/ui/public/assets/{useThemeObserver-B01D-Vl6.js → useThemeObserver-CG8k8U18.js} +1 -1
- package/src/ui/public/assets/{vendor-dO4B7wQf.js → vendor-BIgZEtkx.js} +27 -27
- package/src/ui/public/assets/vue-flow-CPCFgenl.js +39 -0
- package/src/ui/public/index.html +17 -17
- package/src/ui/server/index.js +4 -0
- package/src/ui/server/routes/config.js +16 -3
- package/src/ui/server/routes/exec.js +19 -11
- package/src/ui/server/routes/fileOpen.js +142 -2
- package/src/ui/server/routes/remoteRepos.js +604 -0
- package/src/ui/server/routes/remoteRepos.test.js +386 -0
- package/src/ui/server/routes/workbench/agentChat.js +86 -180
- package/src/ui/server/routes/workbench/agentChatShared.test.js +151 -0
- package/src/ui/server/routes/workbench/agentMarketplace.js +986 -0
- package/src/ui/server/routes/workbench/agentMarketplace.test.js +306 -0
- package/src/ui/server/routes/workbench/agentParity.test.js +167 -0
- package/src/ui/server/routes/workbench/agentRoutes.js +86 -1
- package/src/ui/server/routes/workbench/agentRoutes.test.js +50 -1
- package/src/ui/server/routes/workbench/jobStore.js +17 -3
- package/src/ui/server/routes/workbench/orchestratorStore.js +42 -2
- package/src/ui/server/routes/workbench/projectRegistry.js +6 -0
- package/src/ui/server/routes/workbench/projectRegistry.test.js +70 -0
- package/src/ui/server/routes/workbench/projectTool.js +198 -0
- package/src/ui/server/routes/workbench/projectTool.test.js +152 -0
- package/src/ui/server/routes/workbench/remoteCliPromptParity.test.js +177 -0
- package/src/ui/server/routes/workbench/taskRunner.js +269 -12
- package/src/ui/server/routes/workbench/taskRunner.toolcalls.test.js +307 -0
- package/src/ui/server/socket/registerUiSocketHandlers.js +18 -11
- package/src/utils/shellPath.js +253 -0
- package/src/utils/shellPath.test.js +221 -0
- package/src/ui/public/assets/AgentView-CdJaeRh0.js +0 -5
- package/src/ui/public/assets/AgentView-DAY4S5WN.css +0 -1
- package/src/ui/public/assets/AppVersionBadge-CiijSYfM.js +0 -2
- package/src/ui/public/assets/BranchSelector-BS7ajwvv.js +0 -1
- package/src/ui/public/assets/CommitForm-CEOSqXCA.js +0 -6
- package/src/ui/public/assets/CommonDialog-CAaEi-4T.js +0 -1
- package/src/ui/public/assets/EditorView-DyaFyRDD.js +0 -1
- package/src/ui/public/assets/FileDiffViewer-BvX9cQjR.js +0 -14
- package/src/ui/public/assets/FlowOrchestrationWorkspace-DIBpUSt_.js +0 -21
- package/src/ui/public/assets/IconButton-CnoW2on6.js +0 -1
- package/src/ui/public/assets/LogList-D2espSVo.js +0 -7
- package/src/ui/public/assets/MindmapView-CZF-rZVs.js +0 -1
- package/src/ui/public/assets/MonitorView-DjLr7qOG.js +0 -1
- package/src/ui/public/assets/ProjectStartupButton-DzsU-QIO.js +0 -1
- package/src/ui/public/assets/RemoteManagerDialog-CuuG2ucT.js +0 -1
- package/src/ui/public/assets/RemoteRepoCard-BGf8L0of.js +0 -1
- package/src/ui/public/assets/SourceMapView-CFb02m6z.js +0 -3
- package/src/ui/public/assets/SvgIcon-SRAeYjnN.js +0 -1
- package/src/ui/public/assets/TemplateManager-gedqAXl8.js +0 -1
- package/src/ui/public/assets/UserInputNode-BOCuMQW6.js +0 -1
- package/src/ui/public/assets/WorkbenchView-CRoR21LQ.js +0 -13
- package/src/ui/public/assets/_plugin-vue_export-helper-C8OE7U9H.js +0 -19
- package/src/ui/public/assets/configStore-CuMElTgV.js +0 -1
- package/src/ui/public/assets/flow-mindmap-CurCIiCp.js +0 -139
- package/src/ui/public/assets/index-cApp6w0b.css +0 -1
- package/src/ui/public/assets/index-yXm9JLGv.js +0 -24
- package/src/ui/public/assets/previewSandbox-DkXYEpLP.js +0 -0
- package/src/ui/public/assets/toolsStore-DGxlRe3Y.js +0 -1
- package/src/ui/public/assets/vue-flow-CsvDD38k.js +0 -39
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{br as e,pr as t}from"./element-plus-KTmRV-so.js";import{m as n}from"./vendor-dO4B7wQf.js";t();var r=6e5,i=n(`tools`,()=>{let t=e(!1),n=e(!1),i=e(!1),a=e(!1),o=e(!1),s=e(!1),c=e(!1),l=e(null),u=e(!1),d=e(``),f=e({}),p=e({}),m=e({}),h=e(!1),g=0,_=null;function v(e=!1){return!e&&Date.now()-g<3e5?Promise.resolve():_||(h.value=!0,_=(async()=>{try{let e=await(await fetch(`/api/latest-tool-versions`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({})})).json();e.success&&e.latest&&typeof e.latest==`object`&&(m.value=e.latest,g=Date.now())}catch{}finally{h.value=!1,_=null}})(),_)}let y=null;function b(){return y||(u.value=!0,y=(async()=>{try{let e=await(await fetch(`/api/check-tools`)).json();e.success&&(t.value=!!e.vscode,n.value=!!e.claude,i.value=!!e.codex,a.value=!!e.opencode,o.value=!!e.kimi,s.value=!!e.zcode,c.value=!!e.dsh,d.value=typeof e.platform==`string`?e.platform:``,f.value=e.installers&&typeof e.installers==`object`?e.installers:{},p.value=e.versions&&typeof e.versions==`object`?e.versions:{},l.value=Date.now())}catch{}finally{u.value=!1,y=null}})(),y)}function x(e){switch(e){case`vscode`:return t.value;case`claude`:return n.value;case`codex`:return i.value;case`opencode`:return a.value;case`kimi`:return o.value;case`zcode`:return s.value;case`dsh`:return c.value}}let S=null;function C(){S||=(b(),setInterval(()=>{b()},r))}function w(){S&&=(clearInterval(S),null)}return{vscodeAvailable:t,claudeAvailable:n,codexAvailable:i,opencodeAvailable:a,kimiAvailable:o,zcodeAvailable:s,dshAvailable:c,lastCheckedAt:l,isChecking:u,platform:d,installers:f,versions:p,latestVersions:m,isFetchingLatest:h,isToolAvailable:x,checkTools:b,fetchLatestVersions:v,startPolling:C,stopPolling:w}});export{i as t};
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import{$n as e,An as t,Bn as n,Cr as r,Dn as i,En as a,Er as o,Hn as s,In as c,Jr as l,Kn as u,Ln as d,Nn as f,On as p,Pn as m,Pr as h,Qn as g,Qr as _,Rn as v,Tn as y,Tr as b,Un as x,Vn as S,Wn as C,Xn as w,Yn as T,Yr as E,Zn as D,_r as O,ar as k,br as A,cr as j,dr as M,er as N,fr as P,gr as F,hr as I,kn as L,nr as R,or as z,pr as B,qn as V,qr as H,rr as U,sr as W,tr as ee,ur as G,vr as te,wr as ne,xn as K,xr as q,yr as re}from"./element-plus-KTmRV-so.js";B(),n(),h();function ie(e){return P()?(O(e),!0):!1}function ae(e){return typeof e==`function`?e():o(e)}var oe=typeof window<`u`&&typeof document<`u`,se=e=>e!==void 0,ce=Object.prototype.toString,le=e=>ce.call(e)===`[object Object]`,ue=()=>{};function de(e,t){function n(...n){return new Promise((r,i)=>{Promise.resolve(e(()=>t.apply(this,n),{fn:t,thisArg:this,args:n})).then(r).catch(i)})}return n}var fe=e=>e();function pe(e=fe){let t=A(!0);function n(){t.value=!1}function r(){t.value=!0}return{isActive:re(t),pause:n,resume:r,eventFilter:(...n)=>{t.value&&e(...n)}}}function me(e,t=!1,n=`Timeout`){return new Promise((r,i)=>{setTimeout(t?()=>i(n):r,e)})}function he(e,t,n={}){let{eventFilter:r=fe,...i}=n;return z(e,de(r,t),i)}function ge(e,t,n={}){let{eventFilter:r,...i}=n,{eventFilter:a,pause:o,resume:s,isActive:c}=pe(r);return{stop:he(e,t,{...i,eventFilter:a}),pause:o,resume:s,isActive:c}}function _e(e,t={}){if(!I(e))return ne(e);let n=Array.isArray(e.value)?Array.from({length:e.value.length}):{};for(let r in e.value)n[r]=G(()=>({get(){return e.value[r]},set(n){if(ae(t.replaceRef)??!0){if(Array.isArray(e.value)){let t=[...e.value];t[r]=n,e.value=t}else{let t={...e.value,[r]:n};Object.setPrototypeOf(t,Object.getPrototypeOf(e.value)),e.value=t}}else e.value[r]=n}}));return n}function ve(e,t=!1){function n(n,{flush:r=`sync`,deep:i=!1,timeout:a,throwOnTimeout:o}={}){let s=null,c=[new Promise(a=>{s=z(e,e=>{n(e)!==t&&(s?.(),a(e))},{flush:r,deep:i,immediate:!0})})];return a!=null&&c.push(me(a,o).then(()=>ae(e)).finally(()=>s?.())),Promise.race(c)}function r(r,i){if(!I(r))return n(e=>e===r,i);let{flush:a=`sync`,deep:o=!1,timeout:s,throwOnTimeout:c}=i??{},l=null,u=[new Promise(n=>{l=z([e,r],([e,r])=>{t!==(e===r)&&(l?.(),n(e))},{flush:a,deep:o,immediate:!0})})];return s!=null&&u.push(me(s,c).then(()=>ae(e)).finally(()=>(l?.(),ae(e)))),Promise.race(u)}function i(e){return n(e=>!!e,e)}function a(e){return r(null,e)}function o(e){return r(void 0,e)}function s(e){return n(Number.isNaN,e)}function c(e,t){return n(t=>{let n=Array.from(t);return n.includes(e)||n.includes(ae(e))},t)}function l(e){return u(1,e)}function u(e=1,t){let r=-1;return n(()=>(r+=1,r>=e),t)}return Array.isArray(ae(e))?{toMatch:n,toContains:c,changed:l,changedTimes:u,get not(){return ve(e,!t)}}:{toMatch:n,toBe:r,toBeTruthy:i,toBeNull:a,toBeNaN:s,toBeUndefined:o,changed:l,changedTimes:u,get not(){return ve(e,!t)}}}function ye(e){return ve(e)}function be(e){let t=ae(e);return t?.$el??t}var xe=oe?window:void 0;function Se(...e){let t,n,r,i;if(typeof e[0]==`string`||Array.isArray(e[0])?([n,r,i]=e,t=xe):[t,n,r,i]=e,!t)return ue;Array.isArray(n)||(n=[n]),Array.isArray(r)||(r=[r]);let a=[],o=()=>{a.forEach(e=>e()),a.length=0},s=(e,t,n,r)=>(e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)),c=z(()=>[be(t),ae(i)],([e,t])=>{if(o(),!e)return;let i=le(t)?{...t}:t;a.push(...n.flatMap(t=>r.map(n=>s(e,t,n,i))))},{immediate:!0,flush:`post`}),l=()=>{c(),o()};return ie(l),l}function Ce(e){return typeof e==`function`?e:typeof e==`string`?t=>t.key===e:Array.isArray(e)?t=>e.includes(t.key):()=>!0}function we(...e){let t,n,r={};e.length===3?(t=e[0],n=e[1],r=e[2]):e.length===2?typeof e[1]==`object`?(t=!0,n=e[0],r=e[1]):(t=e[0],n=e[1]):(t=!0,n=e[0]);let{target:i=xe,eventName:a=`keydown`,passive:o=!1,dedupe:s=!1}=r,c=Ce(t);return Se(i,a,e=>{e.repeat&&ae(s)||c(e)&&n(e)},o)}function Te(e){return JSON.parse(JSON.stringify(e))}function Ee(e,t,n,r={}){let{clone:i=!1,passive:a=!1,eventName:o,deep:s=!1,defaultValue:c,shouldEmit:l}=r,u=d(),f=n||u?.emit||(u?.$emit)?.bind(u)||(u?.proxy?.$emit)?.bind(u?.proxy),p=o;t||=`modelValue`,p||=`update:${t.toString()}`;let m=e=>i?typeof i==`function`?i(e):Te(e):e,h=()=>se(e[t])?m(e[t]):c,g=e=>{l?l(e)&&f(p,e):f(p,e)};if(a){let n=h(),r=A(n),i=!1;return z(()=>e[t],e=>{i||(i=!0,r.value=m(e),C(()=>i=!1))}),z(r,n=>{!i&&(n!==e[t]||s)&&g(n)},{deep:s}),r}return y({get(){return h()},set(e){g(e)}})}var De={value:()=>{}};function Oe(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+``)||r in n||/[\s.]/.test(r))throw Error(`illegal type: `+r);n[r]=[]}return new ke(n)}function ke(e){this._=e}function Ae(e,t){return e.trim().split(/^|\s+/).map(function(e){var n=``,r=e.indexOf(`.`);if(r>=0&&(n=e.slice(r+1),e=e.slice(0,r)),e&&!t.hasOwnProperty(e))throw Error(`unknown type: `+e);return{type:e,name:n}})}ke.prototype=Oe.prototype={constructor:ke,on:function(e,t){var n=this._,r=Ae(e+``,n),i,a=-1,o=r.length;if(arguments.length<2){for(;++a<o;)if((i=(e=r[a]).type)&&(i=je(n[i],e.name)))return i;return}if(t!=null&&typeof t!=`function`)throw Error(`invalid callback: `+t);for(;++a<o;)if(i=(e=r[a]).type)n[i]=Me(n[i],e.name,t);else if(t==null)for(i in n)n[i]=Me(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new ke(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=Array(i),r=0,i,a;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw Error(`unknown type: `+e);for(a=this._[e],r=0,i=a.length;r<i;++r)a[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw Error(`unknown type: `+e);for(var r=this._[e],i=0,a=r.length;i<a;++i)r[i].value.apply(t,n)}};function je(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function Me(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=De,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var Ne=`http://www.w3.org/1999/xhtml`,Pe={svg:`http://www.w3.org/2000/svg`,xhtml:Ne,xlink:`http://www.w3.org/1999/xlink`,xml:`http://www.w3.org/XML/1998/namespace`,xmlns:`http://www.w3.org/2000/xmlns/`};function Fe(e){var t=e+=``,n=t.indexOf(`:`);return n>=0&&(t=e.slice(0,n))!==`xmlns`&&(e=e.slice(n+1)),Pe.hasOwnProperty(t)?{space:Pe[t],local:e}:e}function Ie(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Ne&&t.documentElement.namespaceURI===Ne?t.createElement(e):t.createElementNS(n,e)}}function Le(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Re(e){var t=Fe(e);return(t.local?Le:Ie)(t)}function ze(){}function Be(e){return e==null?ze:function(){return this.querySelector(e)}}function Ve(e){typeof e!=`function`&&(e=Be(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=Array(o),c,l,u=0;u<o;++u)(c=a[u])&&(l=e.call(c,c.__data__,u,a))&&(`__data__`in c&&(l.__data__=c.__data__),s[u]=l);return new An(r,this._parents)}function He(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function Ue(){return[]}function We(e){return e==null?Ue:function(){return this.querySelectorAll(e)}}function Ge(e){return function(){return He(e.apply(this,arguments))}}function Ke(e){e=typeof e==`function`?Ge(e):We(e);for(var t=this._groups,n=t.length,r=[],i=[],a=0;a<n;++a)for(var o=t[a],s=o.length,c,l=0;l<s;++l)(c=o[l])&&(r.push(e.call(c,c.__data__,l,o)),i.push(c));return new An(r,i)}function qe(e){return function(){return this.matches(e)}}function Je(e){return function(t){return t.matches(e)}}var Ye=Array.prototype.find;function Xe(e){return function(){return Ye.call(this.children,e)}}function Ze(){return this.firstElementChild}function Qe(e){return this.select(e==null?Ze:Xe(typeof e==`function`?e:Je(e)))}var $e=Array.prototype.filter;function et(){return Array.from(this.children)}function tt(e){return function(){return $e.call(this.children,e)}}function nt(e){return this.selectAll(e==null?et:tt(typeof e==`function`?e:Je(e)))}function rt(e){typeof e!=`function`&&(e=qe(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=[],c,l=0;l<o;++l)(c=a[l])&&e.call(c,c.__data__,l,a)&&s.push(c);return new An(r,this._parents)}function it(e){return Array(e.length)}function at(){return new An(this._enter||this._groups.map(it),this._parents)}function ot(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}ot.prototype={constructor:ot,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 st(e){return function(){return e}}function ct(e,t,n,r,i,a){for(var o=0,s,c=t.length,l=a.length;o<l;++o)(s=t[o])?(s.__data__=a[o],r[o]=s):n[o]=new ot(e,a[o]);for(;o<c;++o)(s=t[o])&&(i[o]=s)}function lt(e,t,n,r,i,a,o){var s,c,l=new Map,u=t.length,d=a.length,f=Array(u),p;for(s=0;s<u;++s)(c=t[s])&&(f[s]=p=o.call(c,c.__data__,s,t)+``,l.has(p)?i[s]=c:l.set(p,c));for(s=0;s<d;++s)p=o.call(e,a[s],s,a)+``,(c=l.get(p))?(r[s]=c,c.__data__=a[s],l.delete(p)):n[s]=new ot(e,a[s]);for(s=0;s<u;++s)(c=t[s])&&l.get(f[s])===c&&(i[s]=c)}function ut(e){return e.__data__}function dt(e,t){if(!arguments.length)return Array.from(this,ut);var n=t?lt:ct,r=this._parents,i=this._groups;typeof e!=`function`&&(e=st(e));for(var a=i.length,o=Array(a),s=Array(a),c=Array(a),l=0;l<a;++l){var u=r[l],d=i[l],f=d.length,p=ft(e.call(u,u&&u.__data__,l,r)),m=p.length,h=s[l]=Array(m),g=o[l]=Array(m);n(u,d,h,g,c[l]=Array(f),p,t);for(var _=0,v=0,y,b;_<m;++_)if(y=h[_]){for(_>=v&&(v=_+1);!(b=g[v])&&++v<m;);y._next=b||null}}return o=new An(o,r),o._enter=s,o._exit=c,o}function ft(e){return typeof e==`object`&&`length`in e?e:Array.from(e)}function pt(){return new An(this._exit||this._groups.map(it),this._parents)}function mt(e,t,n){var r=this.enter(),i=this,a=this.exit();return typeof e==`function`?(r=e(r),r&&=r.selection()):r=r.append(e+``),t!=null&&(i=t(i),i&&=i.selection()),n==null?a.remove():n(a),r&&i?r.merge(i).order():i}function ht(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,a=r.length,o=Math.min(i,a),s=Array(i),c=0;c<o;++c)for(var l=n[c],u=r[c],d=l.length,f=s[c]=Array(d),p,m=0;m<d;++m)(p=l[m]||u[m])&&(f[m]=p);for(;c<i;++c)s[c]=n[c];return new An(s,this._parents)}function gt(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],i=r.length-1,a=r[i],o;--i>=0;)(o=r[i])&&(a&&o.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(o,a),a=o);return this}function _t(e){e||=vt;function t(t,n){return t&&n?e(t.__data__,n.__data__):!t-!n}for(var n=this._groups,r=n.length,i=Array(r),a=0;a<r;++a){for(var o=n[a],s=o.length,c=i[a]=Array(s),l,u=0;u<s;++u)(l=o[u])&&(c[u]=l);c.sort(t)}return new An(i,this._parents).order()}function vt(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function yt(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function bt(){return Array.from(this)}function xt(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length;i<a;++i){var o=r[i];if(o)return o}return null}function St(){let e=0;for(let t of this)++e;return e}function Ct(){return!this.node()}function wt(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i=t[n],a=0,o=i.length,s;a<o;++a)(s=i[a])&&e.call(s,s.__data__,a,i);return this}function Tt(e){return function(){this.removeAttribute(e)}}function Et(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Dt(e,t){return function(){this.setAttribute(e,t)}}function Ot(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function kt(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function At(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 jt(e,t){var n=Fe(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?Et:Tt:typeof t==`function`?n.local?At:kt:n.local?Ot:Dt)(n,t))}function Mt(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function Nt(e){return function(){this.style.removeProperty(e)}}function Pt(e,t,n){return function(){this.style.setProperty(e,t,n)}}function Ft(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function It(e,t,n){return arguments.length>1?this.each((t==null?Nt:typeof t==`function`?Ft:Pt)(e,t,n??``)):Lt(this.node(),e)}function Lt(e,t){return e.style.getPropertyValue(t)||Mt(e).getComputedStyle(e,null).getPropertyValue(t)}function Rt(e){return function(){delete this[e]}}function zt(e,t){return function(){this[e]=t}}function Bt(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function Vt(e,t){return arguments.length>1?this.each((t==null?Rt:typeof t==`function`?Bt:zt)(e,t)):this.node()[e]}function Ht(e){return e.trim().split(/^|\s+/)}function Ut(e){return e.classList||new Wt(e)}function Wt(e){this._node=e,this._names=Ht(e.getAttribute(`class`)||``)}Wt.prototype={add:function(e){this._names.indexOf(e)<0&&(this._names.push(e),this._node.setAttribute(`class`,this._names.join(` `)))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute(`class`,this._names.join(` `)))},contains:function(e){return this._names.indexOf(e)>=0}};function Gt(e,t){for(var n=Ut(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function Kt(e,t){for(var n=Ut(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function qt(e){return function(){Gt(this,e)}}function Jt(e){return function(){Kt(this,e)}}function Yt(e,t){return function(){(t.apply(this,arguments)?Gt:Kt)(this,e)}}function Xt(e,t){var n=Ht(e+``);if(arguments.length<2){for(var r=Ut(this.node()),i=-1,a=n.length;++i<a;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t==`function`?Yt:t?qt:Jt)(n,t))}function Zt(){this.textContent=``}function Qt(e){return function(){this.textContent=e}}function $t(e){return function(){var t=e.apply(this,arguments);this.textContent=t??``}}function en(e){return arguments.length?this.each(e==null?Zt:(typeof e==`function`?$t:Qt)(e)):this.node().textContent}function tn(){this.innerHTML=``}function nn(e){return function(){this.innerHTML=e}}function rn(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??``}}function an(e){return arguments.length?this.each(e==null?tn:(typeof e==`function`?rn:nn)(e)):this.node().innerHTML}function on(){this.nextSibling&&this.parentNode.appendChild(this)}function sn(){return this.each(on)}function cn(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function ln(){return this.each(cn)}function un(e){var t=typeof e==`function`?e:Re(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function dn(){return null}function fn(e,t){var n=typeof e==`function`?e:Re(e),r=t==null?dn:typeof t==`function`?t:Be(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function pn(){var e=this.parentNode;e&&e.removeChild(this)}function mn(){return this.each(pn)}function hn(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function gn(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function _n(e){return this.select(e?gn:hn)}function vn(e){return arguments.length?this.property(`__data__`,e):this.node().__data__}function yn(e){return function(t){e.call(this,t,this.__data__)}}function bn(e){return e.trim().split(/^|\s+/).map(function(e){var t=``,n=e.indexOf(`.`);return n>=0&&(t=e.slice(n+1),e=e.slice(0,n)),{type:e,name:t}})}function xn(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,a;n<i;++n)a=t[n],(!e.type||a.type===e.type)&&a.name===e.name?this.removeEventListener(a.type,a.listener,a.options):t[++r]=a;++r?t.length=r:delete this.__on}}}function Sn(e,t,n){return function(){var r=this.__on,i,a=yn(t);if(r){for(var o=0,s=r.length;o<s;++o)if((i=r[o]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=a,i.options=n),i.value=t;return}}this.addEventListener(e.type,a,n),i={type:e.type,name:e.name,value:t,listener:a,options:n},r?r.push(i):this.__on=[i]}}function Cn(e,t,n){var r=bn(e+``),i,a=r.length,o;if(arguments.length<2){var s=this.node().__on;if(s){for(var c=0,l=s.length,u;c<l;++c)for(i=0,u=s[c];i<a;++i)if((o=r[i]).type===u.type&&o.name===u.name)return u.value}return}for(s=t?Sn:xn,i=0;i<a;++i)this.each(s(r[i],t,n));return this}function wn(e,t,n){var r=Mt(e),i=r.CustomEvent;typeof i==`function`?i=new i(t,n):(i=r.document.createEvent(`Event`),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function Tn(e,t){return function(){return wn(this,e,t)}}function En(e,t){return function(){return wn(this,e,t.apply(this,arguments))}}function Dn(e,t){return this.each((typeof t==`function`?En:Tn)(e,t))}function*On(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length,o;i<a;++i)(o=r[i])&&(yield o)}var kn=[null];function An(e,t){this._groups=e,this._parents=t}function jn(){return new An([[document.documentElement]],kn)}function Mn(){return this}An.prototype=jn.prototype={constructor:An,select:Ve,selectAll:Ke,selectChild:Qe,selectChildren:nt,filter:rt,data:dt,enter:at,exit:pt,join:mt,merge:ht,selection:Mn,order:gt,sort:_t,call:yt,nodes:bt,node:xt,size:St,empty:Ct,each:wt,attr:jt,style:It,property:Vt,classed:Xt,text:en,html:an,raise:sn,lower:ln,append:un,insert:fn,remove:mn,clone:_n,datum:vn,on:Cn,dispatch:Dn,[Symbol.iterator]:On};function Nn(e){return typeof e==`string`?new An([[document.querySelector(e)]],[document.documentElement]):new An([[e]],kn)}function Pn(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Fn(e,t){if(e=Pn(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}var In={passive:!1},Ln={capture:!0,passive:!1};function Rn(e){e.stopImmediatePropagation()}function zn(e){e.preventDefault(),e.stopImmediatePropagation()}function Bn(e){var t=e.document.documentElement,n=Nn(e).on(`dragstart.drag`,zn,Ln);`onselectstart`in t?n.on(`selectstart.drag`,zn,Ln):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect=`none`)}function Vn(e,t){var n=e.document.documentElement,r=Nn(e).on(`dragstart.drag`,null);t&&(r.on(`click.drag`,zn,Ln),setTimeout(function(){r.on(`click.drag`,null)},0)),`onselectstart`in n?r.on(`selectstart.drag`,null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}var Hn=e=>()=>e;function Un(e,{sourceEvent:t,subject:n,target:r,identifier:i,active:a,x:o,y:s,dx:c,dy:l,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:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:a,enumerable:!0,configurable:!0},x:{value:o,enumerable:!0,configurable:!0},y:{value:s,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:l,enumerable:!0,configurable:!0},_:{value:u}})}Un.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function Wn(e){return!e.ctrlKey&&!e.button}function Gn(){return this.parentNode}function Kn(e,t){return t??{x:e.x,y:e.y}}function qn(){return navigator.maxTouchPoints||`ontouchstart`in this}function Jn(){var e=Wn,t=Gn,n=Kn,r=qn,i={},a=Oe(`start`,`drag`,`end`),o=0,s,c,l,u,d=0;function f(e){e.on(`mousedown.drag`,p).filter(r).on(`touchstart.drag`,g).on(`touchmove.drag`,_,In).on(`touchend.drag touchcancel.drag`,v).style(`touch-action`,`none`).style(`-webkit-tap-highlight-color`,`rgba(0,0,0,0)`)}function p(n,r){if(!u&&e.call(this,n,r)){var i=y(this,t.call(this,n,r),n,r,`mouse`);i&&(Nn(n.view).on(`mousemove.drag`,m,Ln).on(`mouseup.drag`,h,Ln),Bn(n.view),Rn(n),l=!1,s=n.clientX,c=n.clientY,i(`start`,n))}}function m(e){if(zn(e),!l){var t=e.clientX-s,n=e.clientY-c;l=t*t+n*n>d}i.mouse(`drag`,e)}function h(e){Nn(e.view).on(`mousemove.drag mouseup.drag`,null),Vn(e.view,l),zn(e),i.mouse(`end`,e)}function g(n,r){if(e.call(this,n,r))for(var i=n.changedTouches,a=t.call(this,n,r),o=i.length,s=0,c;s<o;++s)(c=y(this,a,n,r,i[s].identifier,i[s]))&&(Rn(n),c(`start`,n,i[s]))}function _(e){for(var t=e.changedTouches,n=t.length,r=0,a;r<n;++r)(a=i[t[r].identifier])&&(zn(e),a(`drag`,e,t[r]))}function v(e){var t=e.changedTouches,n=t.length,r,a;for(u&&clearTimeout(u),u=setTimeout(function(){u=null},500),r=0;r<n;++r)(a=i[t[r].identifier])&&(Rn(e),a(`end`,e,t[r]))}function y(e,t,r,s,c,l){var u=a.copy(),d=Fn(l||r,t),p,m,h;if((h=n.call(e,new Un(`beforestart`,{sourceEvent:r,target:f,identifier:c,active:o,x:d[0],y:d[1],dx:0,dy:0,dispatch:u}),s))!=null)return p=h.x-d[0]||0,m=h.y-d[1]||0,function n(r,a,l){var g=d,_;switch(r){case`start`:i[c]=n,_=o++;break;case`end`:delete i[c],--o;case`drag`:d=Fn(l||a,t),_=o}u.call(r,e,new Un(r,{sourceEvent:a,subject:h,target:f,identifier:c,active:_,x:d[0]+p,y:d[1]+m,dx:d[0]-g[0],dy:d[1]-g[1],dispatch:u}),s)}}return f.filter=function(t){return arguments.length?(e=typeof t==`function`?t:Hn(!!t),f):e},f.container=function(e){return arguments.length?(t=typeof e==`function`?e:Hn(e),f):t},f.subject=function(e){return arguments.length?(n=typeof e==`function`?e:Hn(e),f):n},f.touchable=function(e){return arguments.length?(r=typeof e==`function`?e:Hn(!!e),f):r},f.on=function(){var e=a.on.apply(a,arguments);return e===a?f:e},f.clickDistance=function(e){return arguments.length?(d=(e=+e)*e,f):Math.sqrt(d)},f}function Yn(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Xn(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Zn(){}var Qn=.7,$n=1/Qn,er=`\\s*([+-]?\\d+)\\s*`,tr=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*`,nr=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*`,rr=/^#([0-9a-f]{3,8})$/,ir=RegExp(`^rgb\\(${er},${er},${er}\\)$`),ar=RegExp(`^rgb\\(${nr},${nr},${nr}\\)$`),or=RegExp(`^rgba\\(${er},${er},${er},${tr}\\)$`),sr=RegExp(`^rgba\\(${nr},${nr},${nr},${tr}\\)$`),cr=RegExp(`^hsl\\(${tr},${nr},${nr}\\)$`),lr=RegExp(`^hsla\\(${tr},${nr},${nr},${tr}\\)$`),ur={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};Yn(Zn,hr,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:dr,formatHex:dr,formatHex8:fr,formatHsl:pr,formatRgb:mr,toString:mr});function dr(){return this.rgb().formatHex()}function fr(){return this.rgb().formatHex8()}function pr(){return Or(this).formatHsl()}function mr(){return this.rgb().formatRgb()}function hr(e){var t,n;return e=(e+``).trim().toLowerCase(),(t=rr.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?gr(t):n===3?new br(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?_r(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?_r(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=ir.exec(e))?new br(t[1],t[2],t[3],1):(t=ar.exec(e))?new br(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=or.exec(e))?_r(t[1],t[2],t[3],t[4]):(t=sr.exec(e))?_r(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=cr.exec(e))?Dr(t[1],t[2]/100,t[3]/100,1):(t=lr.exec(e))?Dr(t[1],t[2]/100,t[3]/100,t[4]):ur.hasOwnProperty(e)?gr(ur[e]):e===`transparent`?new br(NaN,NaN,NaN,0):null}function gr(e){return new br(e>>16&255,e>>8&255,e&255,1)}function _r(e,t,n,r){return r<=0&&(e=t=n=NaN),new br(e,t,n,r)}function vr(e){return e instanceof Zn||(e=hr(e)),e?(e=e.rgb(),new br(e.r,e.g,e.b,e.opacity)):new br}function yr(e,t,n,r){return arguments.length===1?vr(e):new br(e,t,n,r??1)}function br(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Yn(br,yr,Xn(Zn,{brighter(e){return e=e==null?$n:$n**+e,new br(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Qn:Qn**+e,new br(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new br(Tr(this.r),Tr(this.g),Tr(this.b),wr(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:xr,formatHex:xr,formatHex8:Sr,formatRgb:Cr,toString:Cr}));function xr(){return`#${Er(this.r)}${Er(this.g)}${Er(this.b)}`}function Sr(){return`#${Er(this.r)}${Er(this.g)}${Er(this.b)}${Er((isNaN(this.opacity)?1:this.opacity)*255)}`}function Cr(){let e=wr(this.opacity);return`${e===1?`rgb(`:`rgba(`}${Tr(this.r)}, ${Tr(this.g)}, ${Tr(this.b)}${e===1?`)`:`, ${e})`}`}function wr(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Tr(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Er(e){return e=Tr(e),(e<16?`0`:``)+e.toString(16)}function Dr(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Ar(e,t,n,r)}function Or(e){if(e instanceof Ar)return new Ar(e.h,e.s,e.l,e.opacity);if(e instanceof Zn||(e=hr(e)),!e)return new Ar;if(e instanceof Ar)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=NaN,s=a-i,c=(a+i)/2;return s?(o=t===a?(n-r)/s+(n<r)*6:n===a?(r-t)/s+2:(t-n)/s+4,s/=c<.5?a+i:2-a-i,o*=60):s=c>0&&c<1?0:o,new Ar(o,s,c,e.opacity)}function kr(e,t,n,r){return arguments.length===1?Or(e):new Ar(e,t,n,r??1)}function Ar(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Yn(Ar,kr,Xn(Zn,{brighter(e){return e=e==null?$n:$n**+e,new Ar(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Qn:Qn**+e,new Ar(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,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new br(Nr(e>=240?e-240:e+120,i,r),Nr(e,i,r),Nr(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Ar(jr(this.h),Mr(this.s),Mr(this.l),wr(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(){let e=wr(this.opacity);return`${e===1?`hsl(`:`hsla(`}${jr(this.h)}, ${Mr(this.s)*100}%, ${Mr(this.l)*100}%${e===1?`)`:`, ${e})`}`}}));function jr(e){return e=(e||0)%360,e<0?e+360:e}function Mr(e){return Math.max(0,Math.min(1,e||0))}function Nr(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}var Pr=e=>()=>e;function Fr(e,t){return function(n){return e+n*t}}function Ir(e,t,n){return e**=+n,t=t**+n-e,n=1/n,function(r){return(e+r*t)**+n}}function Lr(e){return(e=+e)==1?Rr:function(t,n){return n-t?Ir(t,n,e):Pr(isNaN(t)?n:t)}}function Rr(e,t){var n=t-e;return n?Fr(e,n):Pr(isNaN(e)?t:e)}var zr=function e(t){var n=Lr(t);function r(e,t){var r=n((e=yr(e)).r,(t=yr(t)).r),i=n(e.g,t.g),a=n(e.b,t.b),o=Rr(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=a(t),e.opacity=o(t),e+``}}return r.gamma=e,r}(1);function Br(e,t){t||=[];var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(a){for(i=0;i<n;++i)r[i]=e[i]*(1-a)+t[i]*a;return r}}function Vr(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Hr(e,t){for(var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=Array(r),a=Array(n),o=0;o<r;++o)i[o]=Zr(e[o],t[o]);for(;o<n;++o)a[o]=t[o];return function(e){for(o=0;o<r;++o)a[o]=i[o](e);return a}}function Ur(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function Wr(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function Gr(e,t){var n={},r={},i;for(i in(typeof e!=`object`||!e)&&(e={}),(typeof t!=`object`||!t)&&(t={}),t)i in e?n[i]=Zr(e[i],t[i]):r[i]=t[i];return function(e){for(i in n)r[i]=n[i](e);return r}}var Kr=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,qr=new RegExp(Kr.source,`g`);function Jr(e){return function(){return e}}function Yr(e){return function(t){return e(t)+``}}function Xr(e,t){var n=Kr.lastIndex=qr.lastIndex=0,r,i,a,o=-1,s=[],c=[];for(e+=``,t+=``;(r=Kr.exec(e))&&(i=qr.exec(t));)(a=i.index)>n&&(a=t.slice(n,a),s[o]?s[o]+=a:s[++o]=a),(r=r[0])===(i=i[0])?s[o]?s[o]+=i:s[++o]=i:(s[++o]=null,c.push({i:o,x:Wr(r,i)})),n=qr.lastIndex;return n<t.length&&(a=t.slice(n),s[o]?s[o]+=a:s[++o]=a),s.length<2?c[0]?Yr(c[0].x):Jr(t):(t=c.length,function(e){for(var n=0,r;n<t;++n)s[(r=c[n]).i]=r.x(e);return s.join(``)})}function Zr(e,t){var n=typeof t,r;return t==null||n===`boolean`?Pr(t):(n===`number`?Wr:n===`string`?(r=hr(t))?(t=r,zr):Xr:t instanceof hr?zr:t instanceof Date?Ur:Vr(t)?Br:Array.isArray(t)?Hr:typeof t.valueOf!=`function`&&typeof t.toString!=`function`||isNaN(t)?Gr:Wr)(e,t)}var Qr=180/Math.PI,$r={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function ei(e,t,n,r,i,a){var o,s,c;return(o=Math.sqrt(e*e+t*t))&&(e/=o,t/=o),(c=e*n+t*r)&&(n-=e*c,r-=t*c),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,c/=s),e*r<t*n&&(e=-e,t=-t,c=-c,o=-o),{translateX:i,translateY:a,rotate:Math.atan2(t,e)*Qr,skewX:Math.atan(c)*Qr,scaleX:o,scaleY:s}}var ti;function ni(e){let t=new(typeof DOMMatrix==`function`?DOMMatrix:WebKitCSSMatrix)(e+``);return t.isIdentity?$r:ei(t.a,t.b,t.c,t.d,t.e,t.f)}function ri(e){return e==null||(ti||=document.createElementNS(`http://www.w3.org/2000/svg`,`g`),ti.setAttribute(`transform`,e),!(e=ti.transform.baseVal.consolidate()))?$r:(e=e.matrix,ei(e.a,e.b,e.c,e.d,e.e,e.f))}function ii(e,t,n,r){function i(e){return e.length?e.pop()+` `:``}function a(e,r,i,a,o,s){if(e!==i||r!==a){var c=o.push(`translate(`,null,t,null,n);s.push({i:c-4,x:Wr(e,i)},{i:c-2,x:Wr(r,a)})}else(i||a)&&o.push(`translate(`+i+t+a+n)}function o(e,t,n,a){e===t?t&&n.push(i(n)+`rotate(`+t+r):(e-t>180?t+=360:t-e>180&&(e+=360),a.push({i:n.push(i(n)+`rotate(`,null,r)-2,x:Wr(e,t)}))}function s(e,t,n,a){e===t?t&&n.push(i(n)+`skewX(`+t+r):a.push({i:n.push(i(n)+`skewX(`,null,r)-2,x:Wr(e,t)})}function c(e,t,n,r,a,o){if(e!==n||t!==r){var s=a.push(i(a)+`scale(`,null,`,`,null,`)`);o.push({i:s-4,x:Wr(e,n)},{i:s-2,x:Wr(t,r)})}else(n!==1||r!==1)&&a.push(i(a)+`scale(`+n+`,`+r+`)`)}return function(t,n){var r=[],i=[];return t=e(t),n=e(n),a(t.translateX,t.translateY,n.translateX,n.translateY,r,i),o(t.rotate,n.rotate,r,i),s(t.skewX,n.skewX,r,i),c(t.scaleX,t.scaleY,n.scaleX,n.scaleY,r,i),t=n=null,function(e){for(var t=-1,n=i.length,a;++t<n;)r[(a=i[t]).i]=a.x(e);return r.join(``)}}}var ai=ii(ni,`px, `,`px)`,`deg)`),oi=ii(ri,`, `,`)`,`)`),si=1e-12;function ci(e){return((e=Math.exp(e))+1/e)/2}function li(e){return((e=Math.exp(e))-1/e)/2}function ui(e){return((e=Math.exp(2*e))-1)/(e+1)}var di=function e(t,n,r){function i(e,i){var a=e[0],o=e[1],s=e[2],c=i[0],l=i[1],u=i[2],d=c-a,f=l-o,p=d*d+f*f,m,h;if(p<si)h=Math.log(u/s)/t,m=function(e){return[a+e*d,o+e*f,s*Math.exp(t*e*h)]};else{var g=Math.sqrt(p),_=(u*u-s*s+r*p)/(2*s*n*g),v=(u*u-s*s-r*p)/(2*u*n*g),y=Math.log(Math.sqrt(_*_+1)-_);h=(Math.log(Math.sqrt(v*v+1)-v)-y)/t,m=function(e){var r=e*h,i=ci(y),c=s/(n*g)*(i*ui(t*r+y)-li(y));return[a+c*d,o+c*f,s*i/ci(t*r+y)]}}return m.duration=h*1e3*t/Math.SQRT2,m}return i.rho=function(t){var n=Math.max(.001,+t),r=n*n;return e(n,r,r*r)},i}(Math.SQRT2,2,4),fi=0,pi=0,mi=0,hi=1e3,gi,_i,vi=0,yi=0,bi=0,xi=typeof performance==`object`&&performance.now?performance:Date,Si=typeof window==`object`&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Ci(){return yi||=(Si(wi),xi.now()+bi)}function wi(){yi=0}function Ti(){this._call=this._time=this._next=null}Ti.prototype=Ei.prototype={constructor:Ti,restart:function(e,t,n){if(typeof e!=`function`)throw TypeError(`callback is not a function`);n=(n==null?Ci():+n)+(t==null?0:+t),!this._next&&_i!==this&&(_i?_i._next=this:gi=this,_i=this),this._call=e,this._time=n,ji()},stop:function(){this._call&&(this._call=null,this._time=1/0,ji())}};function Ei(e,t,n){var r=new Ti;return r.restart(e,t,n),r}function Di(){Ci(),++fi;for(var e=gi,t;e;)(t=yi-e._time)>=0&&e._call.call(void 0,t),e=e._next;--fi}function Oi(){yi=(vi=xi.now())+bi,fi=pi=0;try{Di()}finally{fi=0,Ai(),yi=0}}function ki(){var e=xi.now(),t=e-vi;t>hi&&(bi-=t,vi=e)}function Ai(){for(var e,t=gi,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:gi=n);_i=e,ji(r)}function ji(e){fi||(pi&&=clearTimeout(pi),e-yi>24?(e<1/0&&(pi=setTimeout(Oi,e-xi.now()-bi)),mi&&=clearInterval(mi)):(mi||=(vi=xi.now(),setInterval(ki,hi)),fi=1,Si(Oi)))}function Mi(e,t,n){var r=new Ti;return t=t==null?0:+t,r.restart(n=>{r.stop(),e(n+t)},t,n),r}var Ni=Oe(`start`,`end`,`cancel`,`interrupt`),Pi=[],Fi=0,Ii=1,Li=2,Ri=3,zi=4,Bi=5,Vi=6;function Hi(e,t,n,r,i,a){var o=e.__transition;if(!o)e.__transition={};else if(n in o)return;Ki(e,n,{name:t,index:r,group:i,on:Ni,tween:Pi,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:Fi})}function Ui(e,t){var n=Gi(e,t);if(n.state>Fi)throw Error(`too late; already scheduled`);return n}function Wi(e,t){var n=Gi(e,t);if(n.state>Ri)throw Error(`too late; already running`);return n}function Gi(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw Error(`transition not found`);return n}function Ki(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=Ei(a,0,n.time);function a(e){n.state=Ii,n.timer.restart(o,n.delay,n.time),n.delay<=e&&o(e-n.delay)}function o(a){var l,u,d,f;if(n.state!==Ii)return c();for(l in r)if(f=r[l],f.name===n.name){if(f.state===Ri)return Mi(o);f.state===zi?(f.state=Vi,f.timer.stop(),f.on.call(`interrupt`,e,e.__data__,f.index,f.group),delete r[l]):+l<t&&(f.state=Vi,f.timer.stop(),f.on.call(`cancel`,e,e.__data__,f.index,f.group),delete r[l])}if(Mi(function(){n.state===Ri&&(n.state=zi,n.timer.restart(s,n.delay,n.time),s(a))}),n.state=Li,n.on.call(`start`,e,e.__data__,n.index,n.group),n.state===Li){for(n.state=Ri,i=Array(d=n.tween.length),l=0,u=-1;l<d;++l)(f=n.tween[l].value.call(e,e.__data__,n.index,n.group))&&(i[++u]=f);i.length=u+1}}function s(t){for(var r=t<n.duration?n.ease.call(null,t/n.duration):(n.timer.restart(c),n.state=Bi,1),a=-1,o=i.length;++a<o;)i[a].call(e,r);n.state===Bi&&(n.on.call(`end`,e,e.__data__,n.index,n.group),c())}function c(){for(var i in n.state=Vi,n.timer.stop(),delete r[t],r)return;delete e.__transition}}function qi(e,t){var n=e.__transition,r,i,a=!0,o;if(n){for(o in t=t==null?null:t+``,n){if((r=n[o]).name!==t){a=!1;continue}i=r.state>Li&&r.state<Bi,r.state=Vi,r.timer.stop(),r.on.call(i?`interrupt`:`cancel`,e,e.__data__,r.index,r.group),delete n[o]}a&&delete e.__transition}}function Ji(e){return this.each(function(){qi(this,e)})}function Yi(e,t){var n,r;return function(){var i=Wi(this,e),a=i.tween;if(a!==n){r=n=a;for(var o=0,s=r.length;o<s;++o)if(r[o].name===t){r=r.slice(),r.splice(o,1);break}}i.tween=r}}function Xi(e,t,n){var r,i;if(typeof n!=`function`)throw Error();return function(){var a=Wi(this,e),o=a.tween;if(o!==r){i=(r=o).slice();for(var s={name:t,value:n},c=0,l=i.length;c<l;++c)if(i[c].name===t){i[c]=s;break}c===l&&i.push(s)}a.tween=i}}function Zi(e,t){var n=this._id;if(e+=``,arguments.length<2){for(var r=Gi(this.node(),n).tween,i=0,a=r.length,o;i<a;++i)if((o=r[i]).name===e)return o.value;return null}return this.each((t==null?Yi:Xi)(n,e,t))}function Qi(e,t,n){var r=e._id;return e.each(function(){var e=Wi(this,r);(e.value||={})[t]=n.apply(this,arguments)}),function(e){return Gi(e,r).value[t]}}function $i(e,t){var n;return(typeof t==`number`?Wr:t instanceof hr?zr:(n=hr(t))?(t=n,zr):Xr)(e,t)}function ea(e){return function(){this.removeAttribute(e)}}function ta(e){return function(){this.removeAttributeNS(e.space,e.local)}}function na(e,t,n){var r,i=n+``,a;return function(){var o=this.getAttribute(e);return o===i?null:o===r?a:a=t(r=o,n)}}function ra(e,t,n){var r,i=n+``,a;return function(){var o=this.getAttributeNS(e.space,e.local);return o===i?null:o===r?a:a=t(r=o,n)}}function ia(e,t,n){var r,i,a;return function(){var o,s=n(this),c;return s==null?void this.removeAttribute(e):(o=this.getAttribute(e),c=s+``,o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s)))}}function aa(e,t,n){var r,i,a;return function(){var o,s=n(this),c;return s==null?void this.removeAttributeNS(e.space,e.local):(o=this.getAttributeNS(e.space,e.local),c=s+``,o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s)))}}function oa(e,t){var n=Fe(e),r=n===`transform`?oi:$i;return this.attrTween(e,typeof t==`function`?(n.local?aa:ia)(n,r,Qi(this,`attr.`+e,t)):t==null?(n.local?ta:ea)(n):(n.local?ra:na)(n,r,t))}function sa(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function ca(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function la(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&ca(e,i)),n}return i._value=t,i}function ua(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&sa(e,i)),n}return i._value=t,i}function da(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 Error();var r=Fe(e);return this.tween(n,(r.local?la:ua)(r,t))}function fa(e,t){return function(){Ui(this,e).delay=+t.apply(this,arguments)}}function pa(e,t){return t=+t,function(){Ui(this,e).delay=t}}function ma(e){var t=this._id;return arguments.length?this.each((typeof e==`function`?fa:pa)(t,e)):Gi(this.node(),t).delay}function ha(e,t){return function(){Wi(this,e).duration=+t.apply(this,arguments)}}function ga(e,t){return t=+t,function(){Wi(this,e).duration=t}}function _a(e){var t=this._id;return arguments.length?this.each((typeof e==`function`?ha:ga)(t,e)):Gi(this.node(),t).duration}function va(e,t){if(typeof t!=`function`)throw Error();return function(){Wi(this,e).ease=t}}function ya(e){var t=this._id;return arguments.length?this.each(va(t,e)):Gi(this.node(),t).ease}function ba(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!=`function`)throw Error();Wi(this,e).ease=n}}function xa(e){if(typeof e!=`function`)throw Error();return this.each(ba(this._id,e))}function Sa(e){typeof e!=`function`&&(e=qe(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=[],c,l=0;l<o;++l)(c=a[l])&&e.call(c,c.__data__,l,a)&&s.push(c);return new Za(r,this._parents,this._name,this._id)}function Ca(e){if(e._id!==this._id)throw Error();for(var t=this._groups,n=e._groups,r=t.length,i=n.length,a=Math.min(r,i),o=Array(r),s=0;s<a;++s)for(var c=t[s],l=n[s],u=c.length,d=o[s]=Array(u),f,p=0;p<u;++p)(f=c[p]||l[p])&&(d[p]=f);for(;s<r;++s)o[s]=t[s];return new Za(o,this._parents,this._name,this._id)}function wa(e){return(e+``).trim().split(/^|\s+/).every(function(e){var t=e.indexOf(`.`);return t>=0&&(e=e.slice(0,t)),!e||e===`start`})}function Ta(e,t,n){var r,i,a=wa(t)?Ui:Wi;return function(){var o=a(this,e),s=o.on;s!==r&&(i=(r=s).copy()).on(t,n),o.on=i}}function Ea(e,t){var n=this._id;return arguments.length<2?Gi(this.node(),n).on.on(e):this.each(Ta(n,e,t))}function Da(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function Oa(){return this.on(`end.remove`,Da(this._id))}function ka(e){var t=this._name,n=this._id;typeof e!=`function`&&(e=Be(e));for(var r=this._groups,i=r.length,a=Array(i),o=0;o<i;++o)for(var s=r[o],c=s.length,l=a[o]=Array(c),u,d,f=0;f<c;++f)(u=s[f])&&(d=e.call(u,u.__data__,f,s))&&(`__data__`in u&&(d.__data__=u.__data__),l[f]=d,Hi(l[f],t,n,f,l,Gi(u,n)));return new Za(a,this._parents,t,n)}function Aa(e){var t=this._name,n=this._id;typeof e!=`function`&&(e=We(e));for(var r=this._groups,i=r.length,a=[],o=[],s=0;s<i;++s)for(var c=r[s],l=c.length,u,d=0;d<l;++d)if(u=c[d]){for(var f=e.call(u,u.__data__,d,c),p,m=Gi(u,n),h=0,g=f.length;h<g;++h)(p=f[h])&&Hi(p,t,n,h,f,m);a.push(f),o.push(u)}return new Za(a,o,t,n)}var ja=jn.prototype.constructor;function Ma(){return new ja(this._groups,this._parents)}function Na(e,t){var n,r,i;return function(){var a=Lt(this,e),o=(this.style.removeProperty(e),Lt(this,e));return a===o?null:a===n&&o===r?i:i=t(n=a,r=o)}}function Pa(e){return function(){this.style.removeProperty(e)}}function Fa(e,t,n){var r,i=n+``,a;return function(){var o=Lt(this,e);return o===i?null:o===r?a:a=t(r=o,n)}}function Ia(e,t,n){var r,i,a;return function(){var o=Lt(this,e),s=n(this),c=s+``;return s??(c=s=(this.style.removeProperty(e),Lt(this,e))),o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s))}}function La(e,t){var n,r,i,a=`style.`+t,o=`end.`+a,s;return function(){var c=Wi(this,e),l=c.on,u=c.value[a]==null?s||=Pa(t):void 0;(l!==n||i!==u)&&(r=(n=l).copy()).on(o,i=u),c.on=r}}function Ra(e,t,n){var r=(e+=``)==`transform`?ai:$i;return t==null?this.styleTween(e,Na(e,r)).on(`end.style.`+e,Pa(e)):typeof t==`function`?this.styleTween(e,Ia(e,r,Qi(this,`style.`+e,t))).each(La(this._id,e)):this.styleTween(e,Fa(e,r,t),n).on(`end.style.`+e,null)}function za(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function Ba(e,t,n){var r,i;function a(){var a=t.apply(this,arguments);return a!==i&&(r=(i=a)&&za(e,a,n)),r}return a._value=t,a}function Va(e,t,n){var r=`style.`+(e+=``);if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!=`function`)throw Error();return this.tween(r,Ba(e,t,n??``))}function Ha(e){return function(){this.textContent=e}}function Ua(e){return function(){var t=e(this);this.textContent=t??``}}function Wa(e){return this.tween(`text`,typeof e==`function`?Ua(Qi(this,`text`,e)):Ha(e==null?``:e+``))}function Ga(e){return function(t){this.textContent=e.call(this,t)}}function Ka(e){var t,n;function r(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&Ga(r)),t}return r._value=e,r}function qa(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 Error();return this.tween(t,Ka(e))}function Ja(){for(var e=this._name,t=this._id,n=Qa(),r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],s=o.length,c,l=0;l<s;++l)if(c=o[l]){var u=Gi(c,t);Hi(c,e,n,l,o,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new Za(r,this._parents,e,n)}function Ya(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(a,o){var s={value:o},c={value:function(){--i===0&&a()}};n.each(function(){var n=Wi(this,r),i=n.on;i!==e&&(t=(e=i).copy(),t._.cancel.push(s),t._.interrupt.push(s),t._.end.push(c)),n.on=t}),i===0&&a()})}var Xa=0;function Za(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function Qa(){return++Xa}var $a=jn.prototype;Za.prototype={constructor:Za,select:ka,selectAll:Aa,selectChild:$a.selectChild,selectChildren:$a.selectChildren,filter:Sa,merge:Ca,selection:Ma,transition:Ja,call:$a.call,nodes:$a.nodes,node:$a.node,size:$a.size,empty:$a.empty,each:$a.each,on:Ea,attr:oa,attrTween:da,style:Ra,styleTween:Va,text:Wa,textTween:qa,remove:Oa,tween:Zi,delay:ma,duration:_a,ease:ya,easeVarying:xa,end:Ya,[Symbol.iterator]:$a[Symbol.iterator]};function eo(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var to={time:null,delay:0,duration:250,ease:eo};function no(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw Error(`transition ${t} not found`);return n}function ro(e){var t,n;e instanceof Za?(t=e._id,e=e._name):(t=Qa(),(n=to).time=Ci(),e=e==null?null:e+``);for(var r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],s=o.length,c,l=0;l<s;++l)(c=o[l])&&Hi(c,e,t,l,o,n||no(c,t));return new Za(r,this._parents,e,t)}jn.prototype.interrupt=Ji,jn.prototype.transition=ro;var io=e=>()=>e;function ao(e,{sourceEvent:t,target:n,transform:r,dispatch:i}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:i}})}function oo(e,t,n){this.k=e,this.x=t,this.y=n}oo.prototype={constructor:oo,scale:function(e){return e===1?this:new oo(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new oo(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 so=new oo(1,0,0);oo.prototype;function co(e){e.stopImmediatePropagation()}function lo(e){e.preventDefault(),e.stopImmediatePropagation()}function uo(e){return(!e.ctrlKey||e.type===`wheel`)&&!e.button}function fo(){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 po(){return this.__zoom||so}function mo(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function ho(){return navigator.maxTouchPoints||`ontouchstart`in this}function go(e,t,n){var r=e.invertX(t[0][0])-n[0][0],i=e.invertX(t[1][0])-n[1][0],a=e.invertY(t[0][1])-n[0][1],o=e.invertY(t[1][1])-n[1][1];return e.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),o>a?(a+o)/2:Math.min(0,a)||Math.max(0,o))}function _o(){var e=uo,t=fo,n=go,r=mo,i=ho,a=[0,1/0],o=[[-1/0,-1/0],[1/0,1/0]],s=250,c=di,l=Oe(`start`,`zoom`,`end`),u,d,f,p=500,m=150,h=0,g=10;function _(e){e.property(`__zoom`,po).on(`wheel.zoom`,w,{passive:!1}).on(`mousedown.zoom`,T).on(`dblclick.zoom`,E).filter(i).on(`touchstart.zoom`,D).on(`touchmove.zoom`,O).on(`touchend.zoom touchcancel.zoom`,k).style(`-webkit-tap-highlight-color`,`rgba(0,0,0,0)`)}_.transform=function(e,t,n,r){var i=e.selection?e.selection():e;i.property(`__zoom`,po),e===i?i.interrupt().each(function(){S(this,arguments).event(r).start().zoom(null,typeof t==`function`?t.apply(this,arguments):t).end()}):x(e,t,n,r)},_.scaleBy=function(e,t,n,r){_.scaleTo(e,function(){return this.__zoom.k*(typeof t==`function`?t.apply(this,arguments):t)},n,r)},_.scaleTo=function(e,r,i,a){_.transform(e,function(){var e=t.apply(this,arguments),a=this.__zoom,s=i==null?b(e):typeof i==`function`?i.apply(this,arguments):i,c=a.invert(s),l=typeof r==`function`?r.apply(this,arguments):r;return n(y(v(a,l),s,c),e,o)},i,a)},_.translateBy=function(e,r,i,a){_.transform(e,function(){return n(this.__zoom.translate(typeof r==`function`?r.apply(this,arguments):r,typeof i==`function`?i.apply(this,arguments):i),t.apply(this,arguments),o)},null,a)},_.translateTo=function(e,r,i,a,s){_.transform(e,function(){var e=t.apply(this,arguments),s=this.__zoom,c=a==null?b(e):typeof a==`function`?a.apply(this,arguments):a;return n(so.translate(c[0],c[1]).scale(s.k).translate(typeof r==`function`?-r.apply(this,arguments):-r,typeof i==`function`?-i.apply(this,arguments):-i),e,o)},a,s)};function v(e,t){return t=Math.max(a[0],Math.min(a[1],t)),t===e.k?e:new oo(t,e.x,e.y)}function y(e,t,n){var r=t[0]-n[0]*e.k,i=t[1]-n[1]*e.k;return r===e.x&&i===e.y?e:new oo(e.k,r,i)}function b(e){return[(+e[0][0]+ +e[1][0])/2,(+e[0][1]+ +e[1][1])/2]}function x(e,n,r,i){e.on(`start.zoom`,function(){S(this,arguments).event(i).start()}).on(`interrupt.zoom end.zoom`,function(){S(this,arguments).event(i).end()}).tween(`zoom`,function(){var e=this,a=arguments,o=S(e,a).event(i),s=t.apply(e,a),l=r==null?b(s):typeof r==`function`?r.apply(e,a):r,u=Math.max(s[1][0]-s[0][0],s[1][1]-s[0][1]),d=e.__zoom,f=typeof n==`function`?n.apply(e,a):n,p=c(d.invert(l).concat(u/d.k),f.invert(l).concat(u/f.k));return function(e){if(e===1)e=f;else{var t=p(e),n=u/t[2];e=new oo(n,l[0]-t[0]*n,l[1]-t[1]*n)}o.zoom(null,e)}})}function S(e,t,n){return!n&&e.__zooming||new C(e,t)}function C(e,n){this.that=e,this.args=n,this.active=0,this.sourceEvent=null,this.extent=t.apply(e,n),this.taps=0}C.prototype={event:function(e){return e&&(this.sourceEvent=e),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit(`start`)),this},zoom:function(e,t){return this.mouse&&e!==`mouse`&&(this.mouse[1]=t.invert(this.mouse[0])),this.touch0&&e!==`touch`&&(this.touch0[1]=t.invert(this.touch0[0])),this.touch1&&e!==`touch`&&(this.touch1[1]=t.invert(this.touch1[0])),this.that.__zoom=t,this.emit(`zoom`),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit(`end`)),this},emit:function(e){var t=Nn(this.that).datum();l.call(e,this.that,new ao(e,{sourceEvent:this.sourceEvent,target:_,type:e,transform:this.that.__zoom,dispatch:l}),t)}};function w(t,...i){if(!e.apply(this,arguments))return;var s=S(this,i).event(t),c=this.__zoom,l=Math.max(a[0],Math.min(a[1],c.k*2**r.apply(this,arguments))),u=Fn(t);if(s.wheel)(s.mouse[0][0]!==u[0]||s.mouse[0][1]!==u[1])&&(s.mouse[1]=c.invert(s.mouse[0]=u)),clearTimeout(s.wheel);else if(c.k===l)return;else s.mouse=[u,c.invert(u)],qi(this),s.start();lo(t),s.wheel=setTimeout(d,m),s.zoom(`mouse`,n(y(v(c,l),s.mouse[0],s.mouse[1]),s.extent,o));function d(){s.wheel=null,s.end()}}function T(t,...r){if(f||!e.apply(this,arguments))return;var i=t.currentTarget,a=S(this,r,!0).event(t),s=Nn(t.view).on(`mousemove.zoom`,d,!0).on(`mouseup.zoom`,p,!0),c=Fn(t,i),l=t.clientX,u=t.clientY;Bn(t.view),co(t),a.mouse=[c,this.__zoom.invert(c)],qi(this),a.start();function d(e){if(lo(e),!a.moved){var t=e.clientX-l,r=e.clientY-u;a.moved=t*t+r*r>h}a.event(e).zoom(`mouse`,n(y(a.that.__zoom,a.mouse[0]=Fn(e,i),a.mouse[1]),a.extent,o))}function p(e){s.on(`mousemove.zoom mouseup.zoom`,null),Vn(e.view,a.moved),lo(e),a.event(e).end()}}function E(r,...i){if(e.apply(this,arguments)){var a=this.__zoom,c=Fn(r.changedTouches?r.changedTouches[0]:r,this),l=a.invert(c),u=a.k*(r.shiftKey?.5:2),d=n(y(v(a,u),c,l),t.apply(this,i),o);lo(r),s>0?Nn(this).transition().duration(s).call(x,d,c,r):Nn(this).call(_.transform,d,c,r)}}function D(t,...n){if(e.apply(this,arguments)){var r=t.touches,i=r.length,a=S(this,n,t.changedTouches.length===i).event(t),o,s,c,l;for(co(t),s=0;s<i;++s)c=r[s],l=Fn(c,this),l=[l,this.__zoom.invert(l),c.identifier],a.touch0?!a.touch1&&a.touch0[2]!==l[2]&&(a.touch1=l,a.taps=0):(a.touch0=l,o=!0,a.taps=1+!!u);u&&=clearTimeout(u),o&&(a.taps<2&&(d=l[0],u=setTimeout(function(){u=null},p)),qi(this),a.start())}}function O(e,...t){if(this.__zooming){var r=S(this,t).event(e),i=e.changedTouches,a=i.length,s,c,l,u;for(lo(e),s=0;s<a;++s)c=i[s],l=Fn(c,this),r.touch0&&r.touch0[2]===c.identifier?r.touch0[0]=l:r.touch1&&r.touch1[2]===c.identifier&&(r.touch1[0]=l);if(c=r.that.__zoom,r.touch1){var d=r.touch0[0],f=r.touch0[1],p=r.touch1[0],m=r.touch1[1],h=(h=p[0]-d[0])*h+(h=p[1]-d[1])*h,g=(g=m[0]-f[0])*g+(g=m[1]-f[1])*g;c=v(c,Math.sqrt(h/g)),l=[(d[0]+p[0])/2,(d[1]+p[1])/2],u=[(f[0]+m[0])/2,(f[1]+m[1])/2]}else if(r.touch0)l=r.touch0[0],u=r.touch0[1];else return;r.zoom(`touch`,n(y(c,l,u),r.extent,o))}}function k(e,...t){if(this.__zooming){var n=S(this,t).event(e),r=e.changedTouches,i=r.length,a,o;for(co(e),f&&clearTimeout(f),f=setTimeout(function(){f=null},p),a=0;a<i;++a)o=r[a],n.touch0&&n.touch0[2]===o.identifier?delete n.touch0:n.touch1&&n.touch1[2]===o.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&&(o=Fn(o,this),Math.hypot(d[0]-o[0],d[1]-o[1])<g)){var s=Nn(this).on(`dblclick.zoom`);s&&s.apply(this,arguments)}}}return _.wheelDelta=function(e){return arguments.length?(r=typeof e==`function`?e:io(+e),_):r},_.filter=function(t){return arguments.length?(e=typeof t==`function`?t:io(!!t),_):e},_.touchable=function(e){return arguments.length?(i=typeof e==`function`?e:io(!!e),_):i},_.extent=function(e){return arguments.length?(t=typeof e==`function`?e:io([[+e[0][0],+e[0][1]],[+e[1][0],+e[1][1]]]),_):t},_.scaleExtent=function(e){return arguments.length?(a[0]=+e[0],a[1]=+e[1],_):[a[0],a[1]]},_.translateExtent=function(e){return arguments.length?(o[0][0]=+e[0][0],o[1][0]=+e[1][0],o[0][1]=+e[0][1],o[1][1]=+e[1][1],_):[[o[0][0],o[0][1]],[o[1][0],o[1][1]]]},_.constrain=function(e){return arguments.length?(n=e,_):n},_.duration=function(e){return arguments.length?(s=+e,_):s},_.interpolate=function(e){return arguments.length?(c=e,_):c},_.on=function(){var e=l.on.apply(l,arguments);return e===l?_:e},_.clickDistance=function(e){return arguments.length?(h=(e=+e)*e,_):Math.sqrt(h)},_.tapDistance=function(e){return arguments.length?(g=+e,_):g},_}var J=(e=>(e.Left=`left`,e.Top=`top`,e.Right=`right`,e.Bottom=`bottom`,e))(J||{}),vo=(e=>(e.Partial=`partial`,e.Full=`full`,e))(vo||{}),yo=(e=>(e.Bezier=`default`,e.SimpleBezier=`simple-bezier`,e.Straight=`straight`,e.Step=`step`,e.SmoothStep=`smoothstep`,e))(yo||{}),bo=(e=>(e.Strict=`strict`,e.Loose=`loose`,e))(bo||{}),xo=(e=>(e.Arrow=`arrow`,e.ArrowClosed=`arrowclosed`,e))(xo||{}),So=(e=>(e.Free=`free`,e.Vertical=`vertical`,e.Horizontal=`horizontal`,e))(So||{}),Co=(e=>(e.TopLeft=`top-left`,e.TopCenter=`top-center`,e.TopRight=`top-right`,e.BottomLeft=`bottom-left`,e.BottomCenter=`bottom-center`,e.BottomRight=`bottom-right`,e))(Co||{}),wo=[`INPUT`,`SELECT`,`TEXTAREA`],To=typeof document<`u`?document:null;function Eo(e){let t=e.composedPath?.call(e)?.[0]||e.target,n=typeof t?.hasAttribute==`function`&&t.hasAttribute(`contenteditable`),r=typeof t?.closest==`function`?t.closest(`.nokey`):null;return wo.includes(t?.nodeName)||n||!!r}function Do(e){return e.ctrlKey||e.metaKey||e.shiftKey||e.altKey}function Oo(e,t,n,r){let i=t.replace(`+`,`
|
|
2
|
-
`).replace(`
|
|
3
|
-
|
|
4
|
-
`,`
|
|
5
|
-
+`).split(`
|
|
6
|
-
`).map(e=>e.trim().toLowerCase());if(i.length===1)return e.toLowerCase()===t.toLowerCase();r||n.add(e.toLowerCase());let a=i.every((e,t)=>n.has(e)&&Array.from(n.values())[t]===i[t]);return r&&n.delete(e.toLowerCase()),a}function ko(e,t){return n=>{if(!n.code&&!n.key)return!1;let r=Ao(n.code,e);return Array.isArray(e)?e.some(e=>Oo(n[r],e,t,n.type===`keyup`)):Oo(n[r],e,t,n.type===`keyup`)}}function Ao(e,t){return t.includes(e)?`code`:`key`}function jo(e,t){let n=y(()=>b(t?.target)??To),r=q(b(e)===!0),i=!1,a=new Set,o=c(b(e));z(()=>b(e),(e,t)=>{typeof t==`boolean`&&typeof e!=`boolean`&&s(),o=c(e)},{immediate:!0}),Se([`blur`,`contextmenu`],s),we((...e)=>o(...e),e=>{let n=b(t?.actInsideInputWithModifier)??!0,a=b(t?.preventDefault)??!1;if(i=Do(e),(!i||i&&!n)&&Eo(e))return;let o=e.composedPath?.call(e)?.[0]||e.target,s=o?.nodeName===`BUTTON`||o?.nodeName===`A`;!a&&(i||!s)&&e.preventDefault(),r.value=!0},{eventName:`keydown`,target:n}),we((...e)=>o(...e),e=>{let n=b(t?.actInsideInputWithModifier)??!0;if(r.value){if((!i||i&&!n)&&Eo(e))return;i=!1,r.value=!1}},{eventName:`keyup`,target:n});function s(){i=!1,a.clear(),r.value=b(e)===!0}function c(e){return e===null?(s(),()=>!1):typeof e==`boolean`?(s(),r.value=e,()=>!1):Array.isArray(e)||typeof e==`string`?ko(e,a):e}return r}var Mo=`vue-flow__node-desc`,No=`vue-flow__edge-desc`,Po=`vue-flow__aria-live`,Fo=[`Enter`,` `,`Escape`],Io={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};function Lo(e){return{...e.computedPosition||{x:0,y:0},width:e.dimensions.width||0,height:e.dimensions.height||0}}function Ro(e,t){let n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),r=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*r)}function zo(e){return{width:e.offsetWidth,height:e.offsetHeight}}function Bo(e,t=0,n=1){return Math.min(Math.max(e,t),n)}function Vo(e,t){return{x:Bo(e.x,t[0][0],t[1][0]),y:Bo(e.y,t[0][1],t[1][1])}}function Ho(e){let t=e.getRootNode();return`elementFromPoint`in t?t:window.document}function Uo(e){return e&&typeof e==`object`&&`id`in e&&`source`in e&&`target`in e}function Wo(e){return e&&typeof e==`object`&&`id`in e&&`position`in e&&!Uo(e)}function Go(e){return Wo(e)&&`computedPosition`in e}function Ko(e){return!Number.isNaN(e)&&Number.isFinite(e)}function qo(e){return Ko(e.width)&&Ko(e.height)&&Ko(e.x)&&Ko(e.y)}function Jo(e,t,n){let r={id:e.id.toString(),type:e.type??`default`,dimensions:F({width:0,height:0}),computedPosition:F({z:0,...e.position}),handleBounds:{source:[],target:[]},draggable:void 0,selectable:void 0,connectable:void 0,focusable:void 0,selected:!1,dragging:!1,resizing:!1,initialized:!1,isParent:!1,position:{x:0,y:0},data:Q(e.data)?e.data:{},events:F(Q(e.events)?e.events:{})};return Object.assign(t??r,e,{id:e.id.toString(),parentNode:n})}function Yo(e,t,n){let r={id:e.id.toString(),type:e.type??t?.type??`default`,source:e.source.toString(),target:e.target.toString(),sourceHandle:e.sourceHandle?.toString(),targetHandle:e.targetHandle?.toString(),updatable:e.updatable??n?.updatable,selectable:e.selectable??n?.selectable,focusable:e.focusable??n?.focusable,data:Q(e.data)?e.data:{},events:F(Q(e.events)?e.events:{}),label:e.label??``,interactionWidth:e.interactionWidth??n?.interactionWidth,...n??{}};return Object.assign(t??r,e,{id:e.id.toString()})}function Xo(e,t,n,r){let i=typeof e==`string`?e:e.id,a=new Set,o=r===`source`?`target`:`source`;for(let e of n)e[o]===i&&a.add(e[r]);return t.filter(e=>a.has(e.id))}function Zo(...e){if(e.length===3){let[t,n,r]=e;return Xo(t,n,r,`target`)}let[t,n]=e,r=typeof t==`string`?t:t.id;return n.filter(e=>Uo(e)&&e.source===r).map(e=>n.find(t=>Wo(t)&&t.id===e.target))}function Qo(...e){if(e.length===3){let[t,n,r]=e;return Xo(t,n,r,`source`)}let[t,n]=e,r=typeof t==`string`?t:t.id;return n.filter(e=>Uo(e)&&e.target===r).map(e=>n.find(t=>Wo(t)&&t.id===e.source))}function $o({source:e,sourceHandle:t,target:n,targetHandle:r}){return`vueflow__edge-${e}${t??``}-${n}${r??``}`}function es(e,t){return t.some(t=>Uo(t)&&t.source===e.source&&t.target===e.target&&(t.sourceHandle===e.sourceHandle||!t.sourceHandle&&!e.sourceHandle)&&(t.targetHandle===e.targetHandle||!t.targetHandle&&!e.targetHandle))}function ts({x:e,y:t},{x:n,y:r,zoom:i}){return{x:e*i+n,y:t*i+r}}function ns({x:e,y:t},{x:n,y:r,zoom:i},a=!1,o=[1,1]){let s={x:(e-n)/i,y:(t-r)/i};return a?Ks(s,o):s}function rs(e,t){return{x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}}function is({x:e,y:t,width:n,height:r}){return{x:e,y:t,x2:e+n,y2:t+r}}function as({x:e,y:t,x2:n,y2:r}){return{x:e,y:t,width:n-e,height:r-t}}function os(e,t){return as(rs(is(e),is(t)))}function ss(e){let t={x:1/0,y:1/0,x2:-1/0,y2:-1/0};for(let n=0;n<e.length;n++){let r=e[n];t=rs(t,is({...r.computedPosition,...r.dimensions}))}return as(t)}function cs(e,t,n={x:0,y:0,zoom:1},r=!1,i=!1){let a={...ns(t,n),width:t.width/n.zoom,height:t.height/n.zoom},o=[];for(let t of e){let{dimensions:e,selectable:n=!0,hidden:s=!1}=t,c=e.width??t.width??null,l=e.height??t.height??null;if(i&&!n||s)continue;let u=Ro(a,Lo(t)),d=c===null||l===null,f=r&&u>0,p=(c??0)*(l??0);(d||f||u>=p||t.dragging)&&o.push(t)}return o}function ls(e,t){let n=new Set;if(typeof e==`string`)n.add(e);else if(e.length>=1)for(let t of e)n.add(t.id);return t.filter(e=>n.has(e.source)||n.has(e.target))}function us(e,t){if(typeof e==`number`)return Math.floor((t-t/(1+e))*.5);if(typeof e==`string`&&e.endsWith(`px`)){let t=Number.parseFloat(e);if(!Number.isNaN(t))return Math.floor(t)}if(typeof e==`string`&&e.endsWith(`%`)){let n=Number.parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return ac(`The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function ds(e,t,n){if(typeof e==`string`||typeof e==`number`){let r=us(e,n),i=us(e,t);return{top:r,right:i,bottom:r,left:i,x:i*2,y:r*2}}if(typeof e==`object`){let r=us(e.top??e.y??0,n),i=us(e.bottom??e.y??0,n),a=us(e.left??e.x??0,t),o=us(e.right??e.x??0,t);return{top:r,right:o,bottom:i,left:a,x:a+o,y:r+i}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function fs(e,t,n,r,i,a){let{x:o,y:s}=ts(e,{x:t,y:n,zoom:r}),{x:c,y:l}=ts({x:e.x+e.width,y:e.y+e.height},{x:t,y:n,zoom:r}),u=i-c,d=a-l;return{left:Math.floor(o),top:Math.floor(s),right:Math.floor(u),bottom:Math.floor(d)}}function ps(e,t,n,r,i,a=.1){let o=ds(a,t,n),s=(t-o.x)/e.width,c=(n-o.y)/e.height,l=Bo(Math.min(s,c),r,i),u=e.x+e.width/2,d=e.y+e.height/2,f=t/2-u*l,p=n/2-d*l,m=fs(e,f,p,l,t,n),h={left:Math.min(m.left-o.left,0),top:Math.min(m.top-o.top,0),right:Math.min(m.right-o.right,0),bottom:Math.min(m.bottom-o.bottom,0)};return{x:f-h.left+h.right,y:p-h.top+h.bottom,zoom:l}}function ms(e,t){return{x:t.x+e.x,y:t.y+e.y,z:(e.z>t.z?e.z:t.z)+1}}function hs(e,t){if(!e.parentNode)return!1;let n=t.get(e.parentNode);return n?n.selected?!0:hs(n,t):!1}function gs(e,t){return e===void 0?``:typeof e==`string`?e:`${t?`${t}__`:``}${Object.keys(e).sort().map(t=>`${t}=${e[t]}`).join(`&`)}`}function _s(e){let t=e.ctrlKey&&Ws()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t}function vs(e,t,n){return e<t?Bo(Math.abs(e-t),1,t)/t:e>n?-Bo(Math.abs(e-n),1,t)/t:0}function ys(e,t,n=15,r=40){return[vs(e.x,r,t.width-r)*n,vs(e.y,r,t.height-r)*n]}function bs(e,t){if(t){let n=e.position.x+e.dimensions.width-t.dimensions.width,r=e.position.y+e.dimensions.height-t.dimensions.height;if(n>0||r>0||e.position.x<0||e.position.y<0){let i={};if(typeof t.style==`function`?i={...t.style(t)}:t.style&&(i={...t.style}),i.width=i.width??`${t.dimensions.width}px`,i.height=i.height??`${t.dimensions.height}px`,n>0){if(typeof i.width==`string`){let e=Number(i.width.replace(`px`,``));i.width=`${e+n}px`}else i.width+=n}if(r>0){if(typeof i.height==`string`){let e=Number(i.height.replace(`px`,``));i.height=`${e+r}px`}else i.height+=r}if(e.position.x<0){let n=Math.abs(e.position.x);if(t.position.x=t.position.x-n,typeof i.width==`string`){let e=Number(i.width.replace(`px`,``));i.width=`${e+n}px`}else i.width+=n;e.position.x=0}if(e.position.y<0){let n=Math.abs(e.position.y);if(t.position.y=t.position.y-n,typeof i.height==`string`){let e=Number(i.height.replace(`px`,``));i.height=`${e+n}px`}else i.height+=n;e.position.y=0}t.dimensions.width=Number(i.width.toString().replace(`px`,``)),t.dimensions.height=Number(i.height.toString().replace(`px`,``)),t.style=typeof t.style==`function`?e=>{let n=t.style;return{...n(e),...i}}:{...t.style,...i}}}}function xs(e,t){let n=e.filter(e=>e.type===`add`||e.type===`remove`);for(let e of n)if(e.type===`add`)t.findIndex(t=>t.id===e.item.id)===-1&&t.push(e.item);else if(e.type===`remove`){let n=t.findIndex(t=>t.id===e.id);n!==-1&&t.splice(n,1)}let r=t.map(e=>e.id);for(let n of t)for(let i of e)if(i.id===n.id)switch(i.type){case`select`:n.selected=i.selected;break;case`position`:if(Go(n)&&(i.position!==void 0&&(n.position=i.position),i.dragging!==void 0&&(n.dragging=i.dragging),n.expandParent&&n.parentNode)){let e=t[r.indexOf(n.parentNode)];e&&Go(e)&&bs(n,e)}break;case`dimensions`:if(Go(n)&&(i.dimensions!==void 0&&(n.dimensions=i.dimensions),i.updateStyle!==void 0&&i.updateStyle&&(n.style={...n.style||{},width:`${i.dimensions?.width}px`,height:`${i.dimensions?.height}px`}),i.resizing!==void 0&&(n.resizing=i.resizing),n.expandParent&&n.parentNode)){let e=t[r.indexOf(n.parentNode)];e&&Go(e)&&(e.dimensions.width&&e.dimensions.height?bs(n,e):C(()=>{bs(n,e)}))}}return t}function Ss(e,t){return{id:e,type:`select`,selected:t}}function Cs(e){return{item:e,type:`add`}}function ws(e){return{id:e,type:`remove`}}function Ts(e,t,n,r,i){return{id:e,source:t,target:n,sourceHandle:r||null,targetHandle:i||null,type:`remove`}}function Es(e,t=new Set,n=!1){let r=[];for(let[i,a]of e){let e=t.has(i);(a.selected!==void 0||e)&&a.selected!==e&&(n&&(a.selected=e),r.push(Ss(a.id,e)))}return r}var Ds=()=>{};function Y(e){let t=new Set,n=Ds,r=()=>!1,i=()=>t.size>0||r(),a=e=>{n=e},o=()=>{n=Ds},s=e=>{r=e},c=()=>{r=()=>!1},l=e=>{t.delete(e)};return{on:e=>{t.add(e);let n=()=>l(e);return ie(n),{off:n}},off:l,trigger:r=>{let a=[n];return i()?a.push(...t):e&&a.push(e),Promise.allSettled(a.map(e=>e(r)))},hasListeners:i,listeners:t,setEmitter:a,removeEmitter:o,setHasEmitListeners:s,removeHasEmitListeners:c}}function Os(e,t,n){let r=e;do{if(r&&r.matches(t))return!0;if(r===n)return!1;r=r.parentElement}while(r);return!1}function ks(e,t,n,r){let i=new Map;for(let[a,o]of e)(o.selected||o.id===r)&&(!o.parentNode||!hs(o,e))&&(o.draggable||t&&o.draggable===void 0)&&e.get(a)&&i.set(a,{id:o.id,position:o.position||{x:0,y:0},distance:{x:n.x-o.computedPosition?.x||0,y:n.y-o.computedPosition?.y||0},from:{x:o.computedPosition.x,y:o.computedPosition.y},extent:o.extent,parentNode:o.parentNode,dimensions:{...o.dimensions},expandParent:o.expandParent});return Array.from(i.values())}function As({id:e,dragItems:t,findNode:n}){let r=[];for(let e of t){let t=n(e.id);t&&r.push(t)}return[e?r.find(t=>t.id===e):r[0],r]}function js(e){if(Array.isArray(e))switch(e.length){case 1:return[e[0],e[0],e[0],e[0]];case 2:return[e[0],e[1],e[0],e[1]];case 3:return[e[0],e[1],e[2],e[1]];case 4:return e;default:return[0,0,0,0]}return[e,e,e,e]}function Ms(e,t,n){let[r,i,a,o]=typeof e==`string`?[0,0,0,0]:js(e.padding);return n&&n.computedPosition.x!==void 0&&n.computedPosition.y!==void 0&&n.dimensions.width!==void 0&&n.dimensions.height!==void 0?[[n.computedPosition.x+o,n.computedPosition.y+r],[n.computedPosition.x+n.dimensions.width-i,n.computedPosition.y+n.dimensions.height-a]]:!1}function Ns(e,t,n,r){let i=e.extent||n;if((i===`parent`||!Array.isArray(i)&&i?.range===`parent`)&&!e.expandParent){if(e.parentNode&&r&&e.dimensions.width&&e.dimensions.height){let t=Ms(i,e,r);t&&(i=t)}else t(new Z(X.NODE_EXTENT_INVALID,e.id)),i=n}else if(Array.isArray(i)){let e=r?.computedPosition.x||0,t=r?.computedPosition.y||0;i=[[i[0][0]+e,i[0][1]+t],[i[1][0]+e,i[1][1]+t]]}else if(i!==`parent`&&i?.range&&Array.isArray(i.range)){let[e,t,n,a]=js(i.padding),o=r?.computedPosition.x||0,s=r?.computedPosition.y||0;i=[[i.range[0][0]+o+a,i.range[0][1]+s+e],[i.range[1][0]+o-t,i.range[1][1]+s-n]]}return i===`parent`?[[-1/0,-1/0],[1/0,1/0]]:i}function Ps({width:e,height:t},n){return[n[0],[n[1][0]-(e||0),n[1][1]-(t||0)]]}function Fs(e,t,n,r,i){let a=Vo(t,Ps(e.dimensions,Ns(e,n,r,i)));return{position:{x:a.x-(i?.computedPosition.x||0),y:a.y-(i?.computedPosition.y||0)},computedPosition:a}}function Is(e,t,n=J.Left,r=!1){let i=(t?.x??0)+e.computedPosition.x,a=(t?.y??0)+e.computedPosition.y,{width:o,height:s}=t??Gs(e);if(r)return{x:i+o/2,y:a+s/2};switch(t?.position??n){case J.Top:return{x:i+o/2,y:a};case J.Right:return{x:i+o,y:a+s/2};case J.Bottom:return{x:i+o/2,y:a+s};case J.Left:return{x:i,y:a+s/2}}}function Ls(e,t){return e&&(t?e.find(e=>e.id===t):e[0])||null}function Rs({sourcePos:e,targetPos:t,sourceWidth:n,sourceHeight:r,targetWidth:i,targetHeight:a,width:o,height:s,viewport:c}){let l={x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x+n,t.x+i),y2:Math.max(e.y+r,t.y+a)};l.x===l.x2&&(l.x2+=1),l.y===l.y2&&(l.y2+=1);let u=is({x:(0-c.x)/c.zoom,y:(0-c.y)/c.zoom,width:o/c.zoom,height:s/c.zoom}),d=Math.max(0,Math.min(u.x2,l.x2)-Math.max(u.x,l.x)),f=Math.max(0,Math.min(u.y2,l.y2)-Math.max(u.y,l.y));return Math.ceil(d*f)>0}function zs(e,t,n=!1){let r=typeof e.zIndex==`number`,i=r?e.zIndex:0,a=t(e.source),o=t(e.target);return!a||!o?0:(n&&(i=r?e.zIndex:Math.max(a.computedPosition.z||0,o.computedPosition.z||0)),i)}var X=(e=>(e.MISSING_STYLES=`MISSING_STYLES`,e.MISSING_VIEWPORT_DIMENSIONS=`MISSING_VIEWPORT_DIMENSIONS`,e.NODE_INVALID=`NODE_INVALID`,e.NODE_NOT_FOUND=`NODE_NOT_FOUND`,e.NODE_MISSING_PARENT=`NODE_MISSING_PARENT`,e.NODE_TYPE_MISSING=`NODE_TYPE_MISSING`,e.NODE_EXTENT_INVALID=`NODE_EXTENT_INVALID`,e.EDGE_INVALID=`EDGE_INVALID`,e.EDGE_NOT_FOUND=`EDGE_NOT_FOUND`,e.EDGE_SOURCE_MISSING=`EDGE_SOURCE_MISSING`,e.EDGE_TARGET_MISSING=`EDGE_TARGET_MISSING`,e.EDGE_TYPE_MISSING=`EDGE_TYPE_MISSING`,e.EDGE_SOURCE_TARGET_SAME=`EDGE_SOURCE_TARGET_SAME`,e.EDGE_SOURCE_TARGET_MISSING=`EDGE_SOURCE_TARGET_MISSING`,e.EDGE_ORPHANED=`EDGE_ORPHANED`,e.USEVUEFLOW_OPTIONS=`USEVUEFLOW_OPTIONS`,e))(X||{}),Bs={MISSING_STYLES:()=>`It seems that you haven't loaded the necessary styles. Please import '@vue-flow/core/dist/style.css' to ensure that the graph is rendered correctly`,MISSING_VIEWPORT_DIMENSIONS:()=>`The Vue Flow parent container needs a width and a height to render the graph`,NODE_INVALID:e=>`Node is invalid
|
|
7
|
-
Node: ${e}`,NODE_NOT_FOUND:e=>`Node not found
|
|
8
|
-
Node: ${e}`,NODE_MISSING_PARENT:(e,t)=>`Node is missing a parent
|
|
9
|
-
Node: ${e}
|
|
10
|
-
Parent: ${t}`,NODE_TYPE_MISSING:e=>`Node type is missing
|
|
11
|
-
Type: ${e}`,NODE_EXTENT_INVALID:e=>`Only child nodes can use a parent extent
|
|
12
|
-
Node: ${e}`,EDGE_INVALID:e=>`An edge needs a source and a target
|
|
13
|
-
Edge: ${e}`,EDGE_SOURCE_MISSING:(e,t)=>`Edge source is missing
|
|
14
|
-
Edge: ${e}
|
|
15
|
-
Source: ${t}`,EDGE_TARGET_MISSING:(e,t)=>`Edge target is missing
|
|
16
|
-
Edge: ${e}
|
|
17
|
-
Target: ${t}`,EDGE_TYPE_MISSING:e=>`Edge type is missing
|
|
18
|
-
Type: ${e}`,EDGE_SOURCE_TARGET_SAME:(e,t,n)=>`Edge source and target are the same
|
|
19
|
-
Edge: ${e}
|
|
20
|
-
Source: ${t}
|
|
21
|
-
Target: ${n}`,EDGE_SOURCE_TARGET_MISSING:(e,t,n)=>`Edge source or target is missing
|
|
22
|
-
Edge: ${e}
|
|
23
|
-
Source: ${t}
|
|
24
|
-
Target: ${n}`,EDGE_ORPHANED:e=>`Edge was orphaned (suddenly missing source or target) and has been removed
|
|
25
|
-
Edge: ${e}`,EDGE_NOT_FOUND:e=>`Edge not found
|
|
26
|
-
Edge: ${e}`,USEVUEFLOW_OPTIONS:()=>`The options parameter is deprecated and will be removed in the next major version. Please use the id parameter instead`},Z=class extends Error{constructor(e,...t){super(Bs[e]?.call(Bs,...t)),this.name=`VueFlowError`,this.code=e,this.args=t}};function Vs(e){return`clientX`in e}function Hs(e){return`sourceEvent`in e}function Us(e,t){let n=Vs(e),r,i;return n?(r=e.clientX,i=e.clientY):`touches`in e&&e.touches.length>0?(r=e.touches[0].clientX,i=e.touches[0].clientY):`changedTouches`in e&&e.changedTouches.length>0?(r=e.changedTouches[0].clientX,i=e.changedTouches[0].clientY):(r=0,i=0),{x:r-(t?.left??0),y:i-(t?.top??0)}}var Ws=()=>typeof navigator<`u`&&(navigator==null?void 0:navigator.userAgent)?.indexOf(`Mac`)>=0;function Gs(e){return{width:e.dimensions?.width??e.width??0,height:e.dimensions?.height??e.height??0}}function Ks(e,t=[1,1]){return{x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}}var qs=()=>!0;function Js(e){e?.classList.remove(`valid`,`connecting`,`vue-flow__handle-valid`,`vue-flow__handle-connecting`)}function Ys(e,t,n){let r=[],i={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(let e of t.values())Ro(i,Lo(e))>0&&r.push(e);return r}var Xs=250;function Zs(e,t,n,r){let i=[],a=1/0,o=Ys(e,n,t+Xs);for(let n of o){let o=[...n.handleBounds?.source??[],...n.handleBounds?.target??[]];for(let s of o){if(r.nodeId===s.nodeId&&r.type===s.type&&r.id===s.id)continue;let{x:o,y:c}=Is(n,s,s.position,!0),l=Math.sqrt((o-e.x)**2+(c-e.y)**2);l>t||(l<a?(i=[{...s,x:o,y:c}],a=l):l===a&&i.push({...s,x:o,y:c}))}}if(!i.length)return null;if(i.length>1){let e=r.type===`source`?`target`:`source`;return i.find(t=>t.type===e)??i[0]}return i[0]}function Qs(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:a,doc:o,lib:s,flowId:c,isValidConnection:l=qs},u,d,f,p){let m=a===`target`,h=t?o.querySelector(`.${s}-flow__handle[data-id="${c}-${t?.nodeId}-${t?.id}-${t?.type}"]`):null,{x:g,y:_}=Us(e),v=o.elementFromPoint(g,_),y=v?.classList.contains(`${s}-flow__handle`)?v:h,b={handleDomNode:y,isValid:!1,connection:null,toHandle:null};if(y){let e=$s(void 0,y),t=y.getAttribute(`data-nodeid`),a=y.getAttribute(`data-handleid`),o=y.classList.contains(`connectable`),s=y.classList.contains(`connectableend`);if(!t||!e)return b;let c={source:m?t:r,sourceHandle:m?a:i,target:m?r:t,targetHandle:m?i:a};b.connection=c,b.isValid=o&&s&&(n===bo.Strict?m&&e===`source`||!m&&e===`target`:t!==r||a!==i)&&l(c,{nodes:d,edges:u,sourceNode:f(c.source),targetNode:f(c.target)}),b.toHandle=nc(t,e,a,p,n,!0)}return b}function $s(e,t){return e||(t?.classList.contains(`target`)?`target`:t?.classList.contains(`source`)?`source`:null)}function ec(e,t){let n=null;return t?n=`valid`:e&&!t&&(n=`invalid`),n}function tc(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}function nc(e,t,n,r,i,a=!1){let o=r.get(e);if(!o)return null;let s=i===bo.Strict?o.handleBounds?.[t]:[...o.handleBounds?.source??[],...o.handleBounds?.target??[]],c=(n?s?.find(e=>e.id===n):s?.[0])??null;return c&&a?{...c,...Is(o,c,c.position,!0)}:c}var rc={[J.Left]:J.Right,[J.Right]:J.Left,[J.Top]:J.Bottom,[J.Bottom]:J.Top},ic=[`production`,`prod`];function ac(e,...t){oc()&&console.warn(`[Vue Flow]: ${e}`,...t)}function oc(){return!ic.includes(`production`)}function sc(e,t,n,r,i){let a=t.querySelectorAll(`.vue-flow__handle.${e}`);return a?.length?Array.from(a).map(t=>{let a=t.getBoundingClientRect();return{id:t.getAttribute(`data-handleid`),type:e,nodeId:i,position:t.getAttribute(`data-handlepos`),x:(a.left-n.left)/r,y:(a.top-n.top)/r,...zo(t)}}):null}function cc(e,t,n,r,i,a=!1,o){i.value=!1,e.selected?(a||e.selected&&t)&&(r([e]),C(()=>{o.blur()})):n([e])}function Q(e){return o(e)!==void 0}function lc(e,t,n,r){if(!e||!e.source||!e.target)return n(new Z(X.EDGE_INVALID,e?.id??`[ID UNKNOWN]`)),!1;let i;return i=Uo(e)?e:{...e,id:$o(e)},i=Yo(i,void 0,r),!es(i,t)&&i}function uc(e,t,n,r,i){if(!t.source||!t.target)return i(new Z(X.EDGE_INVALID,e.id)),!1;if(!n)return i(new Z(X.EDGE_NOT_FOUND,e.id)),!1;let{id:a,...o}=e;return{...o,id:r?$o(t):a,source:t.source,target:t.target,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle}}function dc(e,t,n){let r={},i=[];for(let a=0;a<e.length;++a){let o=e[a];if(!Wo(o)){n(new Z(X.NODE_INVALID,o?.id));continue}let s=Jo(o,t(o.id),o.parentNode);o.parentNode&&(r[o.parentNode]=!0),i[a]=s}for(let e of i){let a=t(e.parentNode)||i.find(t=>t.id===e.parentNode);e.parentNode&&!a&&n(new Z(X.NODE_MISSING_PARENT,e.id,e.parentNode)),(e.parentNode||r[e.id])&&(r[e.id]&&(e.isParent=!0),a&&(a.isParent=!0))}return i}function fc(e,t,n,r,i,a){let o=i,s=r.get(o)||new Map;r.set(o,s.set(n,t)),o=`${i}-${e}`;let c=r.get(o)||new Map;if(r.set(o,c.set(n,t)),a){o=`${i}-${e}-${a}`;let s=r.get(o)||new Map;r.set(o,s.set(n,t))}}function pc(e,t,n){e.clear();for(let t of n){let{source:n,target:r,sourceHandle:i=null,targetHandle:a=null}=t,o={edgeId:t.id,source:n,target:r,sourceHandle:i,targetHandle:a},s=`${n}-${i}--${r}-${a}`;fc(`source`,o,`${r}-${a}--${n}-${i}`,e,n,i),fc(`target`,o,s,e,r,a)}}function mc(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function hc(e,t,n,r,i,a,o,s){let c=[];for(let l of e){let e=Uo(l)?l:lc(l,s,i,a);if(!e)continue;let u=n(e.source),d=n(e.target);if(!u||!d){i(new Z(X.EDGE_SOURCE_TARGET_MISSING,e.id,e.source,e.target));continue}if(!u){i(new Z(X.EDGE_SOURCE_MISSING,e.id,e.source));continue}if(!d){i(new Z(X.EDGE_TARGET_MISSING,e.id,e.target));continue}if(t&&!t(e,{edges:s,nodes:o,sourceNode:u,targetNode:d})){i(new Z(X.EDGE_INVALID,e.id));continue}let f=r(e.id);c.push({...Yo(e,f,a),sourceNode:u,targetNode:d})}return c}var gc=Symbol(`vueFlow`),_c=Symbol(`nodeId`),vc=Symbol(`nodeRef`),yc=Symbol(`edgeId`),bc=Symbol(`edgeRef`),xc=Symbol(`slots`);function Sc(e){let{vueFlowRef:t,snapToGrid:n,snapGrid:r,noDragClassName:i,nodeLookup:a,nodeExtent:o,nodeDragThreshold:s,viewport:c,autoPanOnNodeDrag:l,autoPanSpeed:u,nodesDraggable:d,panBy:f,findNode:p,multiSelectionActive:m,nodesSelectionActive:h,selectNodesOnDrag:g,removeSelectedElements:_,addSelectedNodes:v,updateNodePositions:y,emits:x}=$(),{onStart:S,onDrag:C,onStop:w,onClick:T,el:E,disabled:D,id:O,selectable:k,dragHandle:A}=e,j=q(!1),M=[],N,P=null,F={x:void 0,y:void 0},I={x:0,y:0},L=null,R=!1,B=!1,V=0,H=!1,U=Tc(),W=({x:e,y:t})=>{F={x:e,y:t};let i=!1;if(M=M.map(a=>{let s={x:e-a.distance.x,y:t-a.distance.y},{computedPosition:c}=Fs(a,n.value?Ks(s,r.value):s,x.error,o.value,a.parentNode?p(a.parentNode):void 0);return i=i||a.position.x!==c.x||a.position.y!==c.y,a.position=c,a}),B||=i,i&&(y(M,!0,!0),j.value=!0,L)){let[e,t]=As({id:O,dragItems:M,findNode:p});C({event:L,node:e,nodes:t})}},ee=()=>{if(!P)return;let[e,t]=ys(I,P,u.value);if(e!==0||t!==0){let n={x:(F.x??0)-e/c.value.zoom,y:(F.y??0)-t/c.value.zoom};f({x:e,y:t})&&W(n)}V=requestAnimationFrame(ee)},G=(e,t)=>{R=!0;let n=p(O);!g.value&&!m.value&&n&&(n.selected||_()),n&&b(k)&&g.value&&cc(n,m.value,v,_,h,!1,t);let r=U(e.sourceEvent);if(F=r,M=ks(a.value,d.value,r,O),M.length){let[t,n]=As({id:O,dragItems:M,findNode:p});S({event:e.sourceEvent,node:t,nodes:n})}},te=(e,n)=>{e.sourceEvent.type===`touchmove`&&e.sourceEvent.touches.length>1||(B=!1,s.value===0&&G(e,n),F=U(e.sourceEvent),P=t.value?.getBoundingClientRect()||null,I=Us(e.sourceEvent,P))},ne=(e,t)=>{let n=U(e.sourceEvent);if(!H&&R&&l.value&&(H=!0,ee()),!R){let r=n.xSnapped-(F.x??0),i=n.ySnapped-(F.y??0);Math.sqrt(r*r+i*i)>s.value&&G(e,t)}(F.x!==n.xSnapped||F.y!==n.ySnapped)&&M.length&&R&&(L=e.sourceEvent,I=Us(e.sourceEvent,P),W(n))},K=e=>{let t=!1;if(!R&&!j.value&&!m.value){let n=e.sourceEvent,r=U(n),i=r.xSnapped-(F.x??0),a=r.ySnapped-(F.y??0),o=Math.sqrt(i*i+a*a);o!==0&&o<=s.value&&(T?.(n),t=!0)}if(M.length&&!t){B&&=(y(M,!1,!1),!1);let[t,n]=As({id:O,dragItems:M,findNode:p});w({event:e.sourceEvent,node:t,nodes:n})}M=[],j.value=!1,H=!1,R=!1,F={x:void 0,y:void 0},cancelAnimationFrame(V)};return z([()=>b(D),E],([e,t],n,r)=>{if(t){let n=Nn(t);e||(N=Jn().on(`start`,e=>te(e,t)).on(`drag`,e=>ne(e,t)).on(`end`,e=>K(e)).filter(e=>{let n=e.target,r=b(A);return!e.button&&(!i.value||!Os(n,`.${i.value}`,t)&&(!r||Os(n,r,t)))}),n.call(N)),r(()=>{n.on(`.drag`,null),N&&(N.on(`start`,null),N.on(`drag`,null),N.on(`end`,null))})}}),j}function Cc(){return{doubleClick:Y(),click:Y(),mouseEnter:Y(),mouseMove:Y(),mouseLeave:Y(),contextMenu:Y(),updateStart:Y(),update:Y(),updateEnd:Y()}}function wc(e,t){let n=Cc();return n.doubleClick.on(n=>{var r,i;t.edgeDoubleClick(n),(i=(r=e.events)?.doubleClick)==null||i.call(r,n)}),n.click.on(n=>{var r,i;t.edgeClick(n),(i=(r=e.events)?.click)==null||i.call(r,n)}),n.mouseEnter.on(n=>{var r,i;t.edgeMouseEnter(n),(i=(r=e.events)?.mouseEnter)==null||i.call(r,n)}),n.mouseMove.on(n=>{var r,i;t.edgeMouseMove(n),(i=(r=e.events)?.mouseMove)==null||i.call(r,n)}),n.mouseLeave.on(n=>{var r,i;t.edgeMouseLeave(n),(i=(r=e.events)?.mouseLeave)==null||i.call(r,n)}),n.contextMenu.on(n=>{var r,i;t.edgeContextMenu(n),(i=(r=e.events)?.contextMenu)==null||i.call(r,n)}),n.updateStart.on(n=>{var r,i;t.edgeUpdateStart(n),(i=(r=e.events)?.updateStart)==null||i.call(r,n)}),n.update.on(n=>{var r,i;t.edgeUpdate(n),(i=(r=e.events)?.update)==null||i.call(r,n)}),n.updateEnd.on(n=>{var r,i;t.edgeUpdateEnd(n),(i=(r=e.events)?.updateEnd)==null||i.call(r,n)}),Object.entries(n).reduce((e,[t,n])=>(e.emit[t]=n.trigger,e.on[t]=n.on,e),{emit:{},on:{}})}function Tc(){let{viewport:e,snapGrid:t,snapToGrid:n,vueFlowRef:r}=$();return i=>{let a=r.value?.getBoundingClientRect()??{left:0,top:0},{x:o,y:s}=Us(Hs(i)?i.sourceEvent:i,a),c=ns({x:o,y:s},e.value),{x:l,y:u}=n.value?Ks(c,t.value):c;return{xSnapped:l,ySnapped:u,...c}}}function Ec(){return!0}function Dc({handleId:e,nodeId:t,type:n,isValidConnection:r,edgeUpdaterType:i,onEdgeUpdate:a,onEdgeUpdateEnd:o}){let{id:s,vueFlowRef:c,connectionMode:l,connectionRadius:u,connectOnClick:d,connectionClickStartHandle:f,nodesConnectable:p,autoPanOnConnect:m,autoPanSpeed:h,findNode:g,panBy:_,startConnection:v,updateConnection:y,endConnection:x,emits:S,viewport:C,edges:w,nodes:T,isValidConnection:E,nodeLookup:D}=$(),O=null,k=!1,A=null;function j(d){let f=b(n)===`target`,p=Vs(d),j=Ho(d.target),M=d.currentTarget;if(M&&(p&&d.button===0||!p)){let n=function(n){U=Us(n,B),F=Zs(ns(U,C.value,!1,[1,1]),u.value,D.value,G),W||=(ee(),!0);let r=Qs(n,{handle:F,connectionMode:l.value,fromNodeId:b(t),fromHandleId:b(e),fromType:f?`target`:`source`,isValidConnection:P,doc:j,lib:`vue`,flowId:s,nodeLookup:D.value},w.value,T.value,g,D.value);A=r.handleDomNode,O=r.connection,k=tc(!!F,r.isValid);let i={...K,isValid:k,to:r.toHandle&&k?ts({x:r.toHandle.x,y:r.toHandle.y},C.value):U,toHandle:r.toHandle,toPosition:k&&r.toHandle?r.toHandle.position:rc[G.position],toNode:r.toHandle?D.value.get(r.toHandle.nodeId):null};if(k&&F&&K?.toHandle&&i.toHandle&&K.toHandle.type===i.toHandle.type&&K.toHandle.nodeId===i.toHandle.nodeId&&K.toHandle.id===i.toHandle.id&&K.to.x===i.to.x&&K.to.y===i.to.y)return;let a=F??r.toHandle;if(y(a&&k?ts({x:a.x,y:a.y},C.value):U,a,ec(!!a,k)),K=i,!F&&!k&&!A)return Js(H);O&&O.source!==O.target&&A&&(Js(H),H=A,A.classList.add(`connecting`,`vue-flow__handle-connecting`),A.classList.toggle(`valid`,!!k),A.classList.toggle(`vue-flow__handle-valid`,!!k))},p=function(e){`touches`in e&&e.touches.length>0||((F||A)&&O&&k&&(a?a(e,O):S.connect(O)),S.connectEnd(e),i&&o?.(e),Js(H),cancelAnimationFrame(I),x(e),W=!1,k=!1,O=null,A=null,j.removeEventListener(`mousemove`,n),j.removeEventListener(`mouseup`,p),j.removeEventListener(`touchmove`,n),j.removeEventListener(`touchend`,p))},N=g(b(t)),P=b(r)||E.value||Ec;!P&&N&&(P=(f?N.isValidSourcePos:N.isValidTargetPos)||Ec);let F,I=0,{x:L,y:R}=Us(d),z=$s(b(i),M),B=c.value?.getBoundingClientRect();if(!B||!z)return;let V=nc(b(t),z,b(e),D.value,l.value);if(!V)return;let H,U=Us(d,B),W=!1,ee=()=>{if(!m.value)return;let[e,t]=ys(U,B,h.value);_({x:e,y:t}),I=requestAnimationFrame(ee)},G={...V,nodeId:b(t),type:z,position:V.position},te=D.value.get(b(t)),ne={inProgress:!0,isValid:null,from:Is(te,G,J.Left,!0),fromHandle:G,fromPosition:G.position,fromNode:te,to:U,toHandle:null,toPosition:rc[G.position],toNode:null};v({nodeId:b(t),id:b(e),type:z,position:M?.getAttribute(`data-handlepos`)||J.Top,...U},{x:L-B.left,y:R-B.top}),S.connectStart({event:d,nodeId:b(t),handleId:b(e),handleType:z});let K=ne;j.addEventListener(`mousemove`,n),j.addEventListener(`mouseup`,p),j.addEventListener(`touchmove`,n),j.addEventListener(`touchend`,p)}}function M(i){if(!d.value)return;let a=b(n)===`target`;if(!f.value){S.clickConnectStart({event:i,nodeId:b(t),handleId:b(e)}),v({nodeId:b(t),type:b(n),id:b(e),position:J.Top,...Us(i)},void 0,!0);return}let o=b(r)||E.value||Ec,c=g(b(t));if(!o&&c&&(o=(a?c.isValidSourcePos:c.isValidTargetPos)||Ec),c&&(c.connectable===void 0?p.value:c.connectable)===!1)return;let u=Ho(i.target),m=Qs(i,{handle:{nodeId:b(t),id:b(e),type:b(n),position:J.Top,...Us(i)},connectionMode:l.value,fromNodeId:f.value.nodeId,fromHandleId:f.value.id??null,fromType:f.value.type,isValidConnection:o,doc:u,lib:`vue`,flowId:s,nodeLookup:D.value},w.value,T.value,g,D.value),h=m.connection?.source===m.connection?.target;m.isValid&&m.connection&&!h&&S.connect(m.connection),S.clickConnectEnd(i),x(i,!0)}return{handlePointerDown:j,handleClick:M}}function Oc(){return S(_c,``)}function kc(e){let t=e??Oc()??``,n=S(vc,A(null)),{findNode:r,edges:i,emits:a}=$(),o=r(t);return o||a.error(new Z(X.NODE_NOT_FOUND,t)),{id:t,nodeEl:n,node:o,parentNode:y(()=>r(o.parentNode)),connectedEdges:y(()=>ls([o],i.value))}}function Ac(){return{doubleClick:Y(),click:Y(),mouseEnter:Y(),mouseMove:Y(),mouseLeave:Y(),contextMenu:Y(),dragStart:Y(),drag:Y(),dragStop:Y()}}function jc(e,t){let n=Ac();return n.doubleClick.on(n=>{var r,i;t.nodeDoubleClick(n),(i=(r=e.events)?.doubleClick)==null||i.call(r,n)}),n.click.on(n=>{var r,i;t.nodeClick(n),(i=(r=e.events)?.click)==null||i.call(r,n)}),n.mouseEnter.on(n=>{var r,i;t.nodeMouseEnter(n),(i=(r=e.events)?.mouseEnter)==null||i.call(r,n)}),n.mouseMove.on(n=>{var r,i;t.nodeMouseMove(n),(i=(r=e.events)?.mouseMove)==null||i.call(r,n)}),n.mouseLeave.on(n=>{var r,i;t.nodeMouseLeave(n),(i=(r=e.events)?.mouseLeave)==null||i.call(r,n)}),n.contextMenu.on(n=>{var r,i;t.nodeContextMenu(n),(i=(r=e.events)?.contextMenu)==null||i.call(r,n)}),n.dragStart.on(n=>{var r,i;t.nodeDragStart(n),(i=(r=e.events)?.dragStart)==null||i.call(r,n)}),n.drag.on(n=>{var r,i;t.nodeDrag(n),(i=(r=e.events)?.drag)==null||i.call(r,n)}),n.dragStop.on(n=>{var r,i;t.nodeDragStop(n),(i=(r=e.events)?.dragStop)==null||i.call(r,n)}),Object.entries(n).reduce((e,[t,n])=>(e.emit[t]=n.trigger,e.on[t]=n.on,e),{emit:{},on:{}})}function Mc(){let{getSelectedNodes:e,nodeExtent:t,updateNodePositions:n,findNode:r,snapGrid:i,snapToGrid:a,nodesDraggable:o,emits:s}=$();return(c,l=!1)=>{let u=a.value?i.value[0]:5,d=a.value?i.value[1]:5,f=l?4:1,p=c.x*u*f,m=c.y*d*f,h=[];for(let n of e.value)if(n.draggable||o&&n.draggable===void 0){let{position:e}=Fs(n,{x:n.computedPosition.x+p,y:n.computedPosition.y+m},s.error,t.value,n.parentNode?r(n.parentNode):void 0);h.push({id:n.id,position:e,from:n.position,distance:{x:c.x,y:c.y},dimensions:n.dimensions})}n(h,!0,!1)}}var Nc=.1,Pc=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2;function Fc(){return ac(`Viewport not initialized yet.`),Promise.resolve(!1)}var Ic={zoomIn:Fc,zoomOut:Fc,zoomTo:Fc,fitView:Fc,setCenter:Fc,fitBounds:Fc,project:e=>e,screenToFlowCoordinate:e=>e,flowToScreenCoordinate:e=>e,setViewport:Fc,setTransform:Fc,getViewport:()=>({x:0,y:0,zoom:1}),getTransform:()=>({x:0,y:0,zoom:1}),viewportInitialized:!1};function Lc(e){function t(t,n){return new Promise(r=>{e.d3Selection&&e.d3Zoom?e.d3Zoom.interpolate(n?.interpolate===`linear`?Zr:di).scaleBy(Rc(e.d3Selection,n?.duration,n?.ease,()=>{r(!0)}),t):r(!1)})}function n(t,n,r,i){return new Promise(a=>{var o;let{x:s,y:c}=Vo({x:-t,y:-n},e.translateExtent),l=so.translate(-s,-c).scale(r);e.d3Selection&&e.d3Zoom?(o=e.d3Zoom)==null||o.interpolate(i?.interpolate===`linear`?Zr:di).transform(Rc(e.d3Selection,i?.duration,i?.ease,()=>{a(!0)}),l):a(!1)})}return y(()=>e.d3Zoom&&e.d3Selection&&e.dimensions.width&&e.dimensions.height?{viewportInitialized:!0,zoomIn:e=>t(1.2,e),zoomOut:e=>t(1/1.2,e),zoomTo:(t,n)=>new Promise(r=>{e.d3Selection&&e.d3Zoom?e.d3Zoom.interpolate(n?.interpolate===`linear`?Zr:di).scaleTo(Rc(e.d3Selection,n?.duration,n?.ease,()=>{r(!0)}),t):r(!1)}),setViewport:(e,t)=>n(e.x,e.y,e.zoom,t),setTransform:(e,t)=>n(e.x,e.y,e.zoom,t),getViewport:()=>({x:e.viewport.x,y:e.viewport.y,zoom:e.viewport.zoom}),getTransform:()=>({x:e.viewport.x,y:e.viewport.y,zoom:e.viewport.zoom}),fitView:(t={padding:Nc,includeHiddenNodes:!1,duration:0})=>{let r=[];for(let n of e.nodes)n.dimensions.width&&n.dimensions.height&&(t?.includeHiddenNodes||!n.hidden)&&(!t.nodes?.length||t.nodes?.length&&t.nodes.includes(n.id))&&r.push(n);if(!r.length)return Promise.resolve(!1);let{x:i,y:a,zoom:o}=ps(ss(r),e.dimensions.width,e.dimensions.height,t.minZoom??e.minZoom,t.maxZoom??e.maxZoom,t.padding??Nc);return n(i,a,o,t)},setCenter:(t,r,i)=>{let a=i?.zoom===void 0?e.maxZoom:i.zoom;return n(e.dimensions.width/2-t*a,e.dimensions.height/2-r*a,a,i)},fitBounds:(t,r={padding:Nc})=>{let{x:i,y:a,zoom:o}=ps(t,e.dimensions.width,e.dimensions.height,e.minZoom,e.maxZoom,r.padding??Nc);return n(i,a,o,r)},project:t=>ns(t,e.viewport,e.snapToGrid,e.snapGrid),screenToFlowCoordinate:t=>{if(e.vueFlowRef){let{x:n,y:r}=e.vueFlowRef.getBoundingClientRect();return ns({x:t.x-n,y:t.y-r},e.viewport,e.snapToGrid,e.snapGrid)}return{x:0,y:0}},flowToScreenCoordinate:t=>{if(e.vueFlowRef){let{x:n,y:r}=e.vueFlowRef.getBoundingClientRect();return ts({x:t.x+n,y:t.y+r},e.viewport)}return{x:0,y:0}}}:Ic)}function Rc(e,t=0,n=Pc,r=()=>{}){let i=typeof t==`number`&&t>0;return i||r(),i?e.transition().duration(t).ease(n).on(`end`,r):e}function zc(e,t,n){let i=M(!0);return i.run(()=>{i.run(()=>{let t,r,i=!!(n.nodes.value.length||n.edges.value.length);t=ge([e.modelValue,()=>e.modelValue?.value?.length],([e])=>{e&&Array.isArray(e)&&(r?.pause(),n.setElements(e),!r&&!i&&e.length?i=!0:r?.resume())}),r=ge([n.nodes,n.edges,()=>n.edges.value.length,()=>n.nodes.value.length],([n,r])=>{e.modelValue?.value&&Array.isArray(e.modelValue.value)&&(t?.pause(),e.modelValue.value=[...n,...r],C(()=>{t?.resume()}))},{immediate:i}),O(()=>{t?.stop(),r?.stop()})}),i.run(()=>{let t,r,i=!!n.nodes.value.length;t=ge([e.nodes,()=>e.nodes?.value?.length],([e])=>{e&&Array.isArray(e)&&(r?.pause(),n.setNodes(e),!r&&!i&&e.length?i=!0:r?.resume())}),r=ge([n.nodes,()=>n.nodes.value.length],([n])=>{e.nodes?.value&&Array.isArray(e.nodes.value)&&(t?.pause(),e.nodes.value=[...n],C(()=>{t?.resume()}))},{immediate:i}),O(()=>{t?.stop(),r?.stop()})}),i.run(()=>{let t,r,i=!!n.edges.value.length;t=ge([e.edges,()=>e.edges?.value?.length],([e])=>{e&&Array.isArray(e)&&(r?.pause(),n.setEdges(e),!r&&!i&&e.length?i=!0:r?.resume())}),r=ge([n.edges,()=>n.edges.value.length],([n])=>{e.edges?.value&&Array.isArray(e.edges.value)&&(t?.pause(),e.edges.value=[...n],C(()=>{t?.resume()}))},{immediate:i}),O(()=>{t?.stop(),r?.stop()})}),i.run(()=>{z(()=>t.minZoom,()=>{t.minZoom&&Q(t.minZoom)&&n.setMinZoom(t.minZoom)},{immediate:!0})}),i.run(()=>{z(()=>t.maxZoom,()=>{t.maxZoom&&Q(t.maxZoom)&&n.setMaxZoom(t.maxZoom)},{immediate:!0})}),i.run(()=>{z(()=>t.translateExtent,()=>{t.translateExtent&&Q(t.translateExtent)&&n.setTranslateExtent(t.translateExtent)},{immediate:!0})}),i.run(()=>{z(()=>t.nodeExtent,()=>{t.nodeExtent&&Q(t.nodeExtent)&&n.setNodeExtent(t.nodeExtent)},{immediate:!0})}),i.run(()=>{z(()=>t.applyDefault,()=>{Q(t.applyDefault)&&(n.applyDefault.value=t.applyDefault)},{immediate:!0})}),i.run(()=>{let e=async e=>{let r=e;typeof t.autoConnect==`function`&&(r=await t.autoConnect(e)),r!==!1&&n.addEdges([r])};z(()=>t.autoConnect,()=>{Q(t.autoConnect)&&(n.autoConnect.value=t.autoConnect)},{immediate:!0}),z(n.autoConnect,(t,r,i)=>{t?n.onConnect(e):n.hooks.value.connect.off(e),i(()=>{n.hooks.value.connect.off(e)})},{immediate:!0})}),(()=>{let e=[`id`,`modelValue`,`translateExtent`,`nodeExtent`,`edges`,`nodes`,`maxZoom`,`minZoom`,`applyDefault`,`autoConnect`];for(let a of Object.keys(t)){let o=a;if(!e.includes(o)){let e=r(()=>t[o]),a=n[o];I(a)&&i.run(()=>{z(e,e=>{Q(e)&&(a.value=e)},{immediate:!0})})}}})()}),()=>i.stop()}function Bc(){return{edgesChange:Y(),nodesChange:Y(),nodeDoubleClick:Y(),nodeClick:Y(),nodeMouseEnter:Y(),nodeMouseMove:Y(),nodeMouseLeave:Y(),nodeContextMenu:Y(),nodeDragStart:Y(),nodeDrag:Y(),nodeDragStop:Y(),nodesInitialized:Y(),miniMapNodeClick:Y(),miniMapNodeDoubleClick:Y(),miniMapNodeMouseEnter:Y(),miniMapNodeMouseMove:Y(),miniMapNodeMouseLeave:Y(),connect:Y(),connectStart:Y(),connectEnd:Y(),clickConnectStart:Y(),clickConnectEnd:Y(),paneReady:Y(),init:Y(),move:Y(),moveStart:Y(),moveEnd:Y(),selectionDragStart:Y(),selectionDrag:Y(),selectionDragStop:Y(),selectionContextMenu:Y(),selectionStart:Y(),selectionEnd:Y(),viewportChangeStart:Y(),viewportChange:Y(),viewportChangeEnd:Y(),paneScroll:Y(),paneClick:Y(),paneContextMenu:Y(),paneMouseEnter:Y(),paneMouseMove:Y(),paneMouseLeave:Y(),edgeContextMenu:Y(),edgeMouseEnter:Y(),edgeMouseMove:Y(),edgeMouseLeave:Y(),edgeDoubleClick:Y(),edgeClick:Y(),edgeUpdateStart:Y(),edgeUpdate:Y(),edgeUpdateEnd:Y(),updateNodeInternals:Y(),error:Y(e=>ac(e.message))}}function Vc(e,t){let n=d();u(()=>{for(let[n,i]of Object.entries(t.value))i.setEmitter(t=>{e(n,t)}),ie(i.removeEmitter),i.setHasEmitListeners(()=>r(n)),ie(i.removeHasEmitListeners)});function r(e){let t=Hc(e);return!!n?.vnode.props?.[t]}}function Hc(e){let[t,...n]=e.split(`:`);return`on${t.replace(/(?:^|-)(\w)/g,(e,t)=>t.toUpperCase())}${n.length?`:${n.join(`:`)}`:``}`}function Uc(){return{vueFlowRef:null,viewportRef:null,nodes:[],edges:[],connectionLookup:new Map,nodeTypes:{},edgeTypes:{},initialized:!1,dimensions:{width:0,height:0},viewport:{x:0,y:0,zoom:1},d3Zoom:null,d3Selection:null,d3ZoomHandler:null,minZoom:.5,maxZoom:2,translateExtent:[[-1/0,-1/0],[1/0,1/0]],nodeExtent:[[-1/0,-1/0],[1/0,1/0]],selectionMode:vo.Full,paneDragging:!1,preventScrolling:!0,zoomOnScroll:!0,zoomOnPinch:!0,zoomOnDoubleClick:!0,panOnScroll:!1,panOnScrollSpeed:.5,panOnScrollMode:So.Free,paneClickDistance:0,panOnDrag:!0,edgeUpdaterRadius:10,onlyRenderVisibleElements:!1,defaultViewport:{x:0,y:0,zoom:1},nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,defaultMarkerColor:`#b1b1b7`,connectionLineStyle:{},connectionLineType:null,connectionLineOptions:{type:yo.Bezier,style:{}},connectionMode:bo.Loose,connectionStartHandle:null,connectionEndHandle:null,connectionClickStartHandle:null,connectionPosition:{x:NaN,y:NaN},connectionRadius:20,connectOnClick:!0,connectionStatus:null,isValidConnection:null,snapGrid:[15,15],snapToGrid:!1,edgesUpdatable:!1,edgesFocusable:!0,nodesFocusable:!0,nodesConnectable:!0,nodesDraggable:!0,nodeDragThreshold:1,elementsSelectable:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,selectionKeyCode:`Shift`,multiSelectionKeyCode:Ws()?`Meta`:`Control`,zoomActivationKeyCode:Ws()?`Meta`:`Control`,deleteKeyCode:`Backspace`,panActivationKeyCode:`Space`,hooks:Bc(),applyDefault:!0,autoConnect:!1,fitViewOnInit:!1,fitViewOnInitDone:!1,noDragClassName:`nodrag`,noWheelClassName:`nowheel`,noPanClassName:`nopan`,defaultEdgeOptions:void 0,elevateEdgesOnSelect:!1,elevateNodesOnSelect:!0,autoPanOnNodeDrag:!0,autoPanOnConnect:!0,autoPanSpeed:15,disableKeyboardA11y:!1,ariaLiveMessage:``}}var Wc=[`id`,`vueFlowRef`,`viewportRef`,`initialized`,`modelValue`,`nodes`,`edges`,`maxZoom`,`minZoom`,`translateExtent`,`hooks`,`defaultEdgeOptions`];function Gc(e,t,n){let r=Lc(e),i=t=>{let n=t??[];e.hooks.updateNodeInternals.trigger(n)},a=t=>Qo(t,e.nodes,e.edges),o=t=>Zo(t,e.nodes,e.edges),s=t=>ls(t,e.edges),c=({id:t,type:n,nodeId:r})=>{let i=t?`-${n}-${t}`:`-${n}`;return Array.from(e.connectionLookup.get(`${r}${i}`)?.values()??[])},l=e=>{if(e)return t.value.get(e)},u=e=>{if(e)return n.value.get(e)},d=(t,n,r)=>{let i=[];for(let e of t){let t={id:e.id,type:`position`,dragging:r,from:e.from};if(n&&(t.position=e.position,e.parentNode)){let n=l(e.parentNode);t.position={x:t.position.x-(n?.computedPosition?.x??0),y:t.position.y-(n?.computedPosition?.y??0)}}i.push(t)}i?.length&&e.hooks.nodesChange.trigger(i)},f=t=>{if(!e.vueFlowRef)return;let n=e.vueFlowRef.querySelector(`.vue-flow__transformationpane`);if(!n)return;let i=window.getComputedStyle(n),{m22:a}=new window.DOMMatrixReadOnly(i.transform),o=[];for(let e of t){let t=e,n=l(t.id);if(n){let e=zo(t.nodeElement);if(e.width&&e.height&&(n.dimensions.width!==e.width||n.dimensions.height!==e.height||t.forceUpdate)){let r=t.nodeElement.getBoundingClientRect();n.dimensions=e,n.handleBounds.source=sc(`source`,t.nodeElement,r,a,n.id),n.handleBounds.target=sc(`target`,t.nodeElement,r,a,n.id),o.push({id:n.id,type:`dimensions`,dimensions:e})}}}!e.fitViewOnInitDone&&e.fitViewOnInit&&r.value.fitView().then(()=>{e.fitViewOnInitDone=!0}),o.length&&e.hooks.nodesChange.trigger(o)},p=(r,i)=>{let a=new Set,o=new Set;for(let e of r)Wo(e)?a.add(e.id):Uo(e)&&o.add(e.id);let s=Es(t.value,a,!0),c=Es(n.value,o);if(e.multiSelectionActive){for(let e of a)s.push(Ss(e,i));for(let e of o)c.push(Ss(e,i))}s.length&&e.hooks.nodesChange.trigger(s),c.length&&e.hooks.edgesChange.trigger(c)},m=r=>{if(e.multiSelectionActive){let t=r.map(e=>Ss(e.id,!0));e.hooks.nodesChange.trigger(t);return}e.hooks.nodesChange.trigger(Es(t.value,new Set(r.map(e=>e.id)),!0)),e.hooks.edgesChange.trigger(Es(n.value))},h=r=>{if(e.multiSelectionActive){let t=r.map(e=>Ss(e.id,!0));e.hooks.edgesChange.trigger(t);return}e.hooks.edgesChange.trigger(Es(n.value,new Set(r.map(e=>e.id)))),e.hooks.nodesChange.trigger(Es(t.value,new Set,!0))},g=e=>{p(e,!0)},_=t=>{let n=(t||e.nodes).map(e=>(e.selected=!1,Ss(e.id,!1)));e.hooks.nodesChange.trigger(n)},v=t=>{let n=(t||e.edges).map(e=>(e.selected=!1,Ss(e.id,!1)));e.hooks.edgesChange.trigger(n)},y=t=>{if(!t||!t.length)return p([],!1);let n=t.reduce((e,t)=>{let n=Ss(t.id,!1);return Wo(t)?e.nodes.push(n):e.edges.push(n),e},{nodes:[],edges:[]});n.nodes.length&&e.hooks.nodesChange.trigger(n.nodes),n.edges.length&&e.hooks.edgesChange.trigger(n.edges)},b=t=>{var n;(n=e.d3Zoom)==null||n.scaleExtent([t,e.maxZoom]),e.minZoom=t},x=t=>{var n;(n=e.d3Zoom)==null||n.scaleExtent([e.minZoom,t]),e.maxZoom=t},S=t=>{var n;(n=e.d3Zoom)==null||n.translateExtent(t),e.translateExtent=t},C=t=>{e.nodeExtent=t,i()},w=t=>{var n;(n=e.d3Zoom)==null||n.clickDistance(t)},T=t=>{e.nodesDraggable=t,e.nodesConnectable=t,e.elementsSelectable=t},E=t=>{let n=t instanceof Function?t(e.nodes):t;(e.initialized||n.length)&&(e.nodes=dc(n,l,e.hooks.error.trigger))},D=t=>{let r=t instanceof Function?t(e.edges):t;if(!e.initialized&&!r.length)return;let i=hc(r,e.isValidConnection,l,u,e.hooks.error.trigger,e.defaultEdgeOptions,e.nodes,e.edges);pc(e.connectionLookup,n.value,i),e.edges=i},O=t=>{let n=t instanceof Function?t([...e.nodes,...e.edges]):t;(e.initialized||n.length)&&(E(n.filter(Wo)),D(n.filter(Uo)))},k=t=>{let n=t instanceof Function?t(e.nodes):t;n=Array.isArray(n)?n:[n];let r=dc(n,l,e.hooks.error.trigger),i=[];for(let e of r)i.push(Cs(e));i.length&&e.hooks.nodesChange.trigger(i)},A=t=>{let n=t instanceof Function?t(e.edges):t;n=Array.isArray(n)?n:[n];let r=hc(n,e.isValidConnection,l,u,e.hooks.error.trigger,e.defaultEdgeOptions,e.nodes,e.edges),i=[];for(let e of r)i.push(Cs(e));i.length&&e.hooks.edgesChange.trigger(i)},j=(t,n=!0,r=!1)=>{let i=t instanceof Function?t(e.nodes):t,a=Array.isArray(i)?i:[i],o=[],c=[];function u(e){let t=s(e);for(let e of t)(!Q(e.deletable)||e.deletable)&&c.push(Ts(e.id,e.source,e.target,e.sourceHandle,e.targetHandle))}function d(t){let r=[];for(let n of e.nodes)n.parentNode===t&&r.push(n);if(r.length){for(let e of r)o.push(ws(e.id));n&&u(r);for(let e of r)d(e.id)}}for(let e of a){let t=typeof e==`string`?l(e):e;t&&(!Q(t.deletable)||t.deletable)&&(o.push(ws(t.id)),n&&u([t]),r&&d(t.id))}c.length&&e.hooks.edgesChange.trigger(c),o.length&&e.hooks.nodesChange.trigger(o)},M=t=>{let n=t instanceof Function?t(e.edges):t,r=Array.isArray(n)?n:[n],i=[];for(let e of r){let t=typeof e==`string`?u(e):e;t&&(!Q(t.deletable)||t.deletable)&&i.push(Ts(typeof e==`string`?e:e.id,t.source,t.target,t.sourceHandle,t.targetHandle))}e.hooks.edgesChange.trigger(i)},N=(t,r,i=!0)=>{let a=u(t.id);if(!a)return!1;let o=e.edges.indexOf(a),s=uc(t,r,a,i,e.hooks.error.trigger);if(s){let[t]=hc([s],e.isValidConnection,l,u,e.hooks.error.trigger,e.defaultEdgeOptions,e.nodes,e.edges);return e.edges=e.edges.map((e,n)=>n===o?t:e),pc(e.connectionLookup,n.value,[t]),t}return!1},P=(e,t,n={replace:!1})=>{let r=u(e);if(!r)return;let i=typeof t==`function`?t(r):t;r.data=n.replace?i:{...r.data,...i}},F=t=>xs(t,e.nodes),I=t=>{let r=xs(t,e.edges);return pc(e.connectionLookup,n.value,r),r},L=(t,n,r={replace:!1})=>{let i=l(t);if(!i)return;let a=typeof n==`function`?n(i):n;r.replace?e.nodes.splice(e.nodes.indexOf(i),1,a):Object.assign(i,a)},R=(e,t,n={replace:!1})=>{let r=l(e);if(!r)return;let i=typeof t==`function`?t(r):t;r.data=n.replace?i:{...r.data,...i}},z=(t,n,r=!1)=>{r?e.connectionClickStartHandle=t:e.connectionStartHandle=t,e.connectionEndHandle=null,e.connectionStatus=null,n&&(e.connectionPosition=n)},B=(t,n=null,r=null)=>{e.connectionStartHandle&&(e.connectionPosition=t,e.connectionEndHandle=n,e.connectionStatus=r)},V=(t,n)=>{e.connectionPosition={x:NaN,y:NaN},e.connectionEndHandle=null,e.connectionStatus=null,n?e.connectionClickStartHandle=null:e.connectionStartHandle=null},H=e=>{let t=qo(e),n=t?null:Go(e)?e:l(e.id);return!t&&!n?[null,null,t]:[t?e:Lo(n),n,t]},U=(t,n=!0,r=e.nodes)=>{let[i,a,o]=H(t);if(!i)return[];let s=[];for(let t of r||e.nodes){if(!o&&(t.id===a.id||!t.computedPosition))continue;let e=Lo(t),r=Ro(e,i);(n&&r>0||r>=e.width*e.height||r>=Number(i.width)*Number(i.height))&&s.push(t)}return s},W=(e,t,n=!0)=>{let[r]=H(e);if(!r)return!1;let i=Ro(r,t);return n&&i>0||i>=Number(r.width)*Number(r.height)},ee=t=>{let{viewport:n,dimensions:r,d3Zoom:i,d3Selection:a,translateExtent:o}=e;if(!i||!a||!t.x&&!t.y)return!1;let s=so.translate(n.x+t.x,n.y+t.y).scale(n.zoom),c=[[0,0],[r.width,r.height]],l=i.constrain()(s,c,o),u=e.viewport.x!==l.x||e.viewport.y!==l.y||e.viewport.zoom!==l.k;return i.transform(a,l),u},G=t=>{let n=t instanceof Function?t(e):t,r=[`d3Zoom`,`d3Selection`,`d3ZoomHandler`,`viewportRef`,`vueFlowRef`,`dimensions`,`hooks`];Q(n.defaultEdgeOptions)&&(e.defaultEdgeOptions=n.defaultEdgeOptions);let i=n.modelValue||n.nodes||n.edges?[]:void 0;i&&(n.modelValue&&i.push(...n.modelValue),n.nodes&&i.push(...n.nodes),n.edges&&i.push(...n.edges),O(i));let a=()=>{Q(n.maxZoom)&&x(n.maxZoom),Q(n.minZoom)&&b(n.minZoom),Q(n.translateExtent)&&S(n.translateExtent)};for(let t of Object.keys(n)){let i=t,a=n[i];![...Wc,...r].includes(i)&&Q(a)&&(e[i]=a)}ye(()=>e.d3Zoom).not.toBeNull().then(a),e.initialized||=!0};return{updateNodePositions:d,updateNodeDimensions:f,setElements:O,setNodes:E,setEdges:D,addNodes:k,addEdges:A,removeNodes:j,removeEdges:M,findNode:l,findEdge:u,updateEdge:N,updateEdgeData:P,updateNode:L,updateNodeData:R,applyEdgeChanges:I,applyNodeChanges:F,addSelectedElements:g,addSelectedNodes:m,addSelectedEdges:h,setMinZoom:b,setMaxZoom:x,setTranslateExtent:S,setNodeExtent:C,setPaneClickDistance:w,removeSelectedElements:y,removeSelectedNodes:_,removeSelectedEdges:v,startConnection:z,updateConnection:B,endConnection:V,setInteractive:T,setState:G,getIntersectingNodes:U,getIncomers:a,getOutgoers:o,getConnectedEdges:s,getHandleConnections:c,isNodeIntersecting:W,panBy:ee,fitView:e=>r.value.fitView(e),zoomIn:e=>r.value.zoomIn(e),zoomOut:e=>r.value.zoomOut(e),zoomTo:(e,t)=>r.value.zoomTo(e,t),setViewport:(e,t)=>r.value.setViewport(e,t),setTransform:(e,t)=>r.value.setTransform(e,t),getViewport:()=>r.value.getViewport(),getTransform:()=>r.value.getTransform(),setCenter:(e,t,n)=>r.value.setCenter(e,t,n),fitBounds:(e,t)=>r.value.fitBounds(e,t),project:e=>r.value.project(e),screenToFlowCoordinate:e=>r.value.screenToFlowCoordinate(e),flowToScreenCoordinate:e=>r.value.flowToScreenCoordinate(e),toObject:()=>{let t=[],n=[];for(let n of e.nodes){let{computedPosition:e,handleBounds:r,selected:i,dimensions:a,isParent:o,resizing:s,dragging:c,events:l,...u}=n;t.push(u)}for(let t of e.edges){let{selected:e,sourceNode:r,targetNode:i,events:a,...o}=t;n.push(o)}return JSON.parse(JSON.stringify({nodes:t,edges:n,position:[e.viewport.x,e.viewport.y],zoom:e.viewport.zoom,viewport:e.viewport}))},fromObject:t=>new Promise(n=>{let{nodes:i,edges:a,position:o,zoom:s,viewport:c}=t;i&&E(i),a&&D(a);let[l,u]=c?.x&&c?.y?[c.x,c.y]:o??[null,null];if(l&&u){let t=c?.zoom||s||e.viewport.zoom;return ye(()=>r.value.viewportInitialized).toBe(!0).then(()=>{r.value.setViewport({x:l,y:u,zoom:t}).then(()=>{n(!0)})})}n(!0)}),updateNodeInternals:i,viewportHelper:r,$reset:()=>{let t=Uc();if(e.edges=[],e.nodes=[],e.d3Zoom&&e.d3Selection){let n=so.translate(t.defaultViewport.x??0,t.defaultViewport.y??0).scale(Bo(t.defaultViewport.zoom??1,t.minZoom,t.maxZoom)),r=e.viewportRef.getBoundingClientRect(),i=[[0,0],[r.width,r.height]],a=e.d3Zoom.constrain()(n,i,t.translateExtent);e.d3Zoom.transform(e.d3Selection,a)}G(t)},$destroy:()=>{}}}var Kc=[`data-id`,`data-handleid`,`data-nodeid`,`data-handlepos`],qc=c({name:`Handle`,compatConfig:{MODE:3},props:{id:{default:null},type:{},position:{default:()=>J.Top},isValidConnection:{type:Function},connectable:{type:[Boolean,Number,String,Function],default:void 0},connectableStart:{type:Boolean,default:!0},connectableEnd:{type:Boolean,default:!0}},setup(e,{expose:n}){let i=t(e,[`position`,`connectable`,`connectableStart`,`connectableEnd`,`id`]),a=r(()=>i.type??`source`),s=r(()=>i.isValidConnection??null),{id:c,connectionStartHandle:l,connectionClickStartHandle:u,connectionEndHandle:d,vueFlowRef:f,nodesConnectable:p,noDragClassName:m,noPanClassName:h}=$(),{id:g,node:_,nodeEl:v,connectedEdges:b}=kc(),x=A(),S=r(()=>e.connectableStart===void 0||e.connectableStart),C=r(()=>e.connectableEnd===void 0||e.connectableEnd),w=r(()=>l.value?.nodeId===g&&l.value?.id===e.id&&l.value?.type===a.value||d.value?.nodeId===g&&d.value?.id===e.id&&d.value?.type===a.value),E=r(()=>u.value?.nodeId===g&&u.value?.id===e.id&&u.value?.type===a.value),{handlePointerDown:O,handleClick:k}=Dc({nodeId:g,handleId:e.id,isValidConnection:s,type:a}),j=y(()=>typeof e.connectable==`string`&&e.connectable===`single`?!b.value.some(t=>{let n=t[`${a.value}Handle`];return t[a.value]===g?!n||n===e.id:!1}):typeof e.connectable==`number`?b.value.filter(t=>{let n=t[`${a.value}Handle`];return t[a.value]===g?!n||n===e.id:!1}).length<e.connectable:typeof e.connectable==`function`?e.connectable(_,b.value):Q(e.connectable)?e.connectable:p.value);T(()=>{if(!_.dimensions.width||!_.dimensions.height)return;let t=_.handleBounds[a.value]?.find(t=>t.id===e.id);if(!f.value||t)return;let n=f.value.querySelector(`.vue-flow__transformationpane`);if(!v.value||!x.value||!n||!e.id)return;let r=v.value.getBoundingClientRect(),i=x.value.getBoundingClientRect(),o=window.getComputedStyle(n),{m22:s}=new window.DOMMatrixReadOnly(o.transform),c={id:e.id,position:e.position,x:(i.left-r.left)/s,y:(i.top-r.top)/s,type:a.value,nodeId:g,...zo(x.value)};_.handleBounds[a.value]=[..._.handleBounds[a.value]??[],c]});function M(e){let t=Vs(e);j.value&&S.value&&(t&&e.button===0||!t)&&O(e)}function P(e){g&&(u.value||S.value)&&j.value&&k(e)}return n({handleClick:k,handlePointerDown:O,onClick:P,onPointerDown:M}),(t,n)=>(D(),L(`div`,{ref_key:`handle`,ref:x,"data-id":`${o(c)}-${o(g)}-${e.id}-${a.value}`,"data-handleid":e.id,"data-nodeid":o(g),"data-handlepos":t.position,class:H([`vue-flow__handle`,[`vue-flow__handle-${t.position}`,`vue-flow__handle-${e.id}`,o(m),o(h),a.value,{connectable:j.value,connecting:E.value,connectablestart:S.value,connectableend:C.value,connectionindicator:j.value&&(S.value&&!w.value||C.value&&w.value)}]]),onMousedown:M,onTouchstartPassive:M,onClick:P},[N(t.$slots,`default`,{id:t.id})],42,Kc))}}),Jc=function({sourcePosition:e=J.Bottom,targetPosition:t=J.Top,label:n,connectable:r=!0,isValidTargetPos:i,isValidSourcePos:a,data:o}){let s=o.label??n;return[v(qc,{type:`target`,position:t,connectable:r,isValidConnection:i}),typeof s!=`string`&&s?v(s):v(K,[s]),v(qc,{type:`source`,position:e,connectable:r,isValidConnection:a})]};Jc.props=[`sourcePosition`,`targetPosition`,`label`,`isValidTargetPos`,`isValidSourcePos`,`connectable`,`data`],Jc.inheritAttrs=!1,Jc.compatConfig={MODE:3};var Yc=Jc,Xc=function({targetPosition:e=J.Top,label:t,connectable:n=!0,isValidTargetPos:r,data:i}){let a=i.label??t;return[v(qc,{type:`target`,position:e,connectable:n,isValidConnection:r}),typeof a!=`string`&&a?v(a):v(K,[a])]};Xc.props=[`targetPosition`,`label`,`isValidTargetPos`,`connectable`,`data`],Xc.inheritAttrs=!1,Xc.compatConfig={MODE:3};var Zc=Xc,Qc=function({sourcePosition:e=J.Bottom,label:t,connectable:n=!0,isValidSourcePos:r,data:i}){let a=i.label??t;return[typeof a!=`string`&&a?v(a):v(K,[a]),v(qc,{type:`source`,position:e,connectable:n,isValidConnection:r})]};Qc.props=[`sourcePosition`,`label`,`isValidSourcePos`,`connectable`,`data`],Qc.inheritAttrs=!1,Qc.compatConfig={MODE:3};var $c=Qc,el=[`transform`],tl=[`width`,`height`,`x`,`y`,`rx`,`ry`],nl=[`y`],rl=c({name:`EdgeText`,compatConfig:{MODE:3},props:{x:{},y:{},label:{},labelStyle:{default:()=>({})},labelShowBg:{type:Boolean,default:!0},labelBgStyle:{default:()=>({})},labelBgPadding:{default:()=>[2,4]},labelBgBorderRadius:{default:2}},setup(e){let t=A({x:0,y:0,width:0,height:0}),n=A(null),r=y(()=>`translate(${e.x-t.value.width/2} ${e.y-t.value.height/2})`);T(o),z([()=>e.x,()=>e.y,n,()=>e.label],o);function o(){if(!n.value)return;let e=n.value.getBBox();(e.width!==t.value.width||e.height!==t.value.height)&&(t.value=e)}return(e,o)=>(D(),L(`g`,{transform:r.value,class:`vue-flow__edge-textwrapper`},[e.labelShowBg?(D(),L(`rect`,{key:0,class:`vue-flow__edge-textbg`,width:`${t.value.width+2*e.labelBgPadding[0]}px`,height:`${t.value.height+2*e.labelBgPadding[1]}px`,x:-e.labelBgPadding[0],y:-e.labelBgPadding[1],style:E(e.labelBgStyle),rx:e.labelBgBorderRadius,ry:e.labelBgBorderRadius},null,12,tl)):p(``,!0),a(`text`,x(e.$attrs,{ref_key:`el`,ref:n,class:`vue-flow__edge-text`,y:t.value.height/2,dy:`0.3em`,style:e.labelStyle}),[N(e.$slots,`default`,{},()=>[typeof e.label==`string`?(D(),L(K,{key:1},[f(_(e.label),1)],64)):(D(),i(R(e.label),{key:0}))])],16,nl)],8,el))}}),il=[`id`,`d`,`marker-end`,`marker-start`],al=[`d`,`stroke-width`],ol=c({name:`BaseEdge`,inheritAttrs:!1,compatConfig:{MODE:3},props:{id:{},labelX:{},labelY:{},path:{},label:{},markerStart:{},markerEnd:{},interactionWidth:{default:20},labelStyle:{},labelShowBg:{type:Boolean},labelBgStyle:{},labelBgPadding:{},labelBgBorderRadius:{}},setup(e,{expose:t}){let n=A(null),r=A(null),s=A(null),c=U();return t({pathEl:n,interactionEl:r,labelEl:s}),(e,t)=>(D(),L(K,null,[a(`path`,x(o(c),{id:e.id,ref_key:`pathEl`,ref:n,d:e.path,class:`vue-flow__edge-path`,"marker-end":e.markerEnd,"marker-start":e.markerStart}),null,16,il),e.interactionWidth?(D(),L(`path`,{key:0,ref_key:`interactionEl`,ref:r,fill:`none`,d:e.path,"stroke-width":e.interactionWidth,"stroke-opacity":0,class:`vue-flow__edge-interaction`},null,8,al)):p(``,!0),e.label&&e.labelX&&e.labelY?(D(),i(rl,{key:1,ref_key:`labelEl`,ref:s,x:e.labelX,y:e.labelY,label:e.label,"label-show-bg":e.labelShowBg,"label-bg-style":e.labelBgStyle,"label-bg-padding":e.labelBgPadding,"label-bg-border-radius":e.labelBgBorderRadius,"label-style":e.labelStyle},null,8,[`x`,`y`,`label`,`label-show-bg`,`label-bg-style`,`label-bg-padding`,`label-bg-border-radius`,`label-style`])):p(``,!0)],64))}});function sl({sourceX:e,sourceY:t,targetX:n,targetY:r}){let i=Math.abs(n-e)/2,a=n<e?n+i:n-i,o=Math.abs(r-t)/2;return[a,r<t?r+o:r-o,i,o]}function cl({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:i,sourceControlY:a,targetControlX:o,targetControlY:s}){let c=e*.125+i*.375+o*.375+n*.125,l=t*.125+a*.375+s*.375+r*.125;return[c,l,Math.abs(c-e),Math.abs(l-t)]}function ll(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function ul({pos:e,x1:t,y1:n,x2:r,y2:i,c:a}){let o,s;switch(e){case J.Left:o=t-ll(t-r,a),s=n;break;case J.Right:o=t+ll(r-t,a),s=n;break;case J.Top:o=t,s=n-ll(n-i,a);break;case J.Bottom:o=t,s=n+ll(i-n,a)}return[o,s]}function dl(e){let{sourceX:t,sourceY:n,sourcePosition:r=J.Bottom,targetX:i,targetY:a,targetPosition:o=J.Top,curvature:s=.25}=e,[c,l]=ul({pos:r,x1:t,y1:n,x2:i,y2:a,c:s}),[u,d]=ul({pos:o,x1:i,y1:a,x2:t,y2:n,c:s}),[f,p,m,h]=cl({sourceX:t,sourceY:n,targetX:i,targetY:a,sourceControlX:c,sourceControlY:l,targetControlX:u,targetControlY:d});return[`M${t},${n} C${c},${l} ${u},${d} ${i},${a}`,f,p,m,h]}function fl({pos:e,x1:t,y1:n,x2:r,y2:i}){let a,o;switch(e){case J.Left:case J.Right:a=.5*(t+r),o=n;break;case J.Top:case J.Bottom:a=t,o=.5*(n+i)}return[a,o]}function pl(e){let{sourceX:t,sourceY:n,sourcePosition:r=J.Bottom,targetX:i,targetY:a,targetPosition:o=J.Top}=e,[s,c]=fl({pos:r,x1:t,y1:n,x2:i,y2:a}),[l,u]=fl({pos:o,x1:i,y1:a,x2:t,y2:n}),[d,f,p,m]=cl({sourceX:t,sourceY:n,targetX:i,targetY:a,sourceControlX:s,sourceControlY:c,targetControlX:l,targetControlY:u});return[`M${t},${n} C${s},${c} ${l},${u} ${i},${a}`,d,f,p,m]}var ml={[J.Left]:{x:-1,y:0},[J.Right]:{x:1,y:0},[J.Top]:{x:0,y:-1},[J.Bottom]:{x:0,y:1}};function hl({source:e,sourcePosition:t=J.Bottom,target:n}){return t===J.Left||t===J.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1}}function gl(e,t){return Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2)}function _l({source:e,sourcePosition:t=J.Bottom,target:n,targetPosition:r=J.Top,center:i,offset:a}){let o=ml[t],s=ml[r],c={x:e.x+o.x*a,y:e.y+o.y*a},l={x:n.x+s.x*a,y:n.y+s.y*a},u=hl({source:c,sourcePosition:t,target:l}),d=u.x===0?`y`:`x`,f=u[d],p,m,h,g={x:0,y:0},_={x:0,y:0},[v,y,b,x]=sl({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(o[d]*s[d]===-1){m=i.x??v,h=i.y??y;let e=[{x:m,y:c.y},{x:m,y:l.y}],t=[{x:c.x,y:h},{x:l.x,y:h}];p=o[d]===f?d===`x`?e:t:d===`x`?t:e}else{let i=[{x:c.x,y:l.y}],u=[{x:l.x,y:c.y}];if(p=d===`x`?o.x===f?u:i:o.y===f?i:u,t===r){let t=Math.abs(e[d]-n[d]);if(t<=a){let r=Math.min(a-1,a-t);o[d]===f?g[d]=(c[d]>e[d]?-1:1)*r:_[d]=(l[d]>n[d]?-1:1)*r}}if(t!==r){let e=d===`x`?`y`:`x`,t=o[d]===s[e],n=c[e]>l[e],r=c[e]<l[e];(o[d]===1&&(!t&&n||t&&r)||o[d]!==1&&(!t&&r||t&&n))&&(p=d===`x`?i:u)}let v={x:c.x+g.x,y:c.y+g.y},y={x:l.x+_.x,y:l.y+_.y};Math.max(Math.abs(v.x-p[0].x),Math.abs(y.x-p[0].x))>=Math.max(Math.abs(v.y-p[0].y),Math.abs(y.y-p[0].y))?(m=(v.x+y.x)/2,h=p[0].y):(m=p[0].x,h=(v.y+y.y)/2)}return[[e,{x:c.x+g.x,y:c.y+g.y},...p,{x:l.x+_.x,y:l.y+_.y},n],m,h,b,x]}function vl(e,t,n,r){let i=Math.min(gl(e,t)/2,gl(t,n)/2,r),{x:a,y:o}=t;if(e.x===a&&a===n.x||e.y===o&&o===n.y)return`L${a} ${o}`;if(e.y===o){let t=e.x<n.x?-1:1,r=e.y<n.y?1:-1;return`L ${a+i*t},${o}Q ${a},${o} ${a},${o+i*r}`}let s=e.x<n.x?1:-1;return`L ${a},${o+i*(e.y<n.y?-1:1)}Q ${a},${o} ${a+i*s},${o}`}function yl(e){let{sourceX:t,sourceY:n,sourcePosition:r=J.Bottom,targetX:i,targetY:a,targetPosition:o=J.Top,borderRadius:s=5,centerX:c,centerY:l,offset:u=20}=e,[d,f,p,m,h]=_l({source:{x:t,y:n},sourcePosition:r,target:{x:i,y:a},targetPosition:o,center:{x:c,y:l},offset:u});return[d.reduce((e,t,n)=>{let r;return r=n>0&&n<d.length-1?vl(d[n-1],t,d[n+1],s):`${n===0?`M`:`L`}${t.x} ${t.y}`,e+=r,e},``),f,p,m,h]}function bl(e){let{sourceX:t,sourceY:n,targetX:r,targetY:i}=e,[a,o,s,c]=sl({sourceX:t,sourceY:n,targetX:r,targetY:i});return[`M ${t},${n}L ${r},${i}`,a,o,s,c]}var xl=c({name:`StraightEdge`,props:[`label`,`labelStyle`,`labelShowBg`,`labelBgStyle`,`labelBgPadding`,`labelBgBorderRadius`,`sourceY`,`sourceX`,`targetX`,`targetY`,`markerEnd`,`markerStart`,`interactionWidth`],compatConfig:{MODE:3},setup(e,{attrs:t}){return()=>{let[n,r,i]=bl(e);return v(ol,{path:n,labelX:r,labelY:i,...t,...e})}}}),Sl=c({name:`SmoothStepEdge`,props:[`sourcePosition`,`targetPosition`,`label`,`labelStyle`,`labelShowBg`,`labelBgStyle`,`labelBgPadding`,`labelBgBorderRadius`,`sourceY`,`sourceX`,`targetX`,`targetY`,`borderRadius`,`markerEnd`,`markerStart`,`interactionWidth`,`offset`],compatConfig:{MODE:3},setup(e,{attrs:t}){return()=>{let[n,r,i]=yl({...e,sourcePosition:e.sourcePosition??J.Bottom,targetPosition:e.targetPosition??J.Top});return v(ol,{path:n,labelX:r,labelY:i,...t,...e})}}}),Cl=c({name:`StepEdge`,props:[`sourcePosition`,`targetPosition`,`label`,`labelStyle`,`labelShowBg`,`labelBgStyle`,`labelBgPadding`,`labelBgBorderRadius`,`sourceY`,`sourceX`,`targetX`,`targetY`,`markerEnd`,`markerStart`,`interactionWidth`],setup(e,{attrs:t}){return()=>v(Sl,{...e,...t,borderRadius:0})}}),wl=c({name:`BezierEdge`,props:[`sourcePosition`,`targetPosition`,`label`,`labelStyle`,`labelShowBg`,`labelBgStyle`,`labelBgPadding`,`labelBgBorderRadius`,`sourceY`,`sourceX`,`targetX`,`targetY`,`curvature`,`markerEnd`,`markerStart`,`interactionWidth`],compatConfig:{MODE:3},setup(e,{attrs:t}){return()=>{let[n,r,i]=dl({...e,sourcePosition:e.sourcePosition??J.Bottom,targetPosition:e.targetPosition??J.Top});return v(ol,{path:n,labelX:r,labelY:i,...t,...e})}}}),Tl=c({name:`SimpleBezierEdge`,props:[`sourcePosition`,`targetPosition`,`label`,`labelStyle`,`labelShowBg`,`labelBgStyle`,`labelBgPadding`,`labelBgBorderRadius`,`sourceY`,`sourceX`,`targetX`,`targetY`,`markerEnd`,`markerStart`,`interactionWidth`],compatConfig:{MODE:3},setup(e,{attrs:t}){return()=>{let[n,r,i]=pl({...e,sourcePosition:e.sourcePosition??J.Bottom,targetPosition:e.targetPosition??J.Top});return v(ol,{path:n,labelX:r,labelY:i,...t,...e})}}}),El={input:$c,default:Yc,output:Zc},Dl={default:wl,straight:xl,step:Cl,smoothstep:Sl,simplebezier:Tl};function Ol(e,t,n){let r=y(()=>e=>t.value.get(e)),i=y(()=>e=>n.value.get(e)),a=y(()=>{let t={...Dl,...e.edgeTypes},n=Object.keys(t);for(let r of e.edges)r.type&&!n.includes(r.type)&&(t[r.type]=r.type);return t}),o=y(()=>{let t={...El,...e.nodeTypes},n=Object.keys(t);for(let r of e.nodes)r.type&&!n.includes(r.type)&&(t[r.type]=r.type);return t}),s=y(()=>e.onlyRenderVisibleElements?cs(e.nodes,{x:0,y:0,width:e.dimensions.width,height:e.dimensions.height},e.viewport,!0):e.nodes),c=y(()=>{if(e.onlyRenderVisibleElements){let n=[];for(let r of e.edges){let i=t.value.get(r.source),a=t.value.get(r.target);Rs({sourcePos:i.computedPosition||{x:0,y:0},targetPos:a.computedPosition||{x:0,y:0},sourceWidth:i.dimensions.width,sourceHeight:i.dimensions.height,targetWidth:a.dimensions.width,targetHeight:a.dimensions.height,width:e.dimensions.width,height:e.dimensions.height,viewport:e.viewport})&&n.push(r)}return n}return e.edges}),l=y(()=>[...s.value,...c.value]),u=y(()=>{let t=[];for(let n of e.nodes)n.selected&&t.push(n);return t}),d=y(()=>{let t=[];for(let n of e.edges)n.selected&&t.push(n);return t}),f=y(()=>[...u.value,...d.value]),p=y(()=>{let t=[];for(let n of e.nodes)n.dimensions.width&&n.dimensions.height&&n.handleBounds!==void 0&&t.push(n);return t});return{getNode:r,getEdge:i,getElements:l,getEdgeTypes:a,getNodeTypes:o,getEdges:c,getNodes:s,getSelectedElements:f,getSelectedNodes:u,getSelectedEdges:d,getNodesInitialized:p,areNodesInitialized:y(()=>s.value.length>0&&p.value.length===s.value.length)}}var kl=class e{constructor(){this.currentId=0,this.flows=new Map}static getInstance(){let t=d()?.appContext.app,n=t?.config.globalProperties.$vueFlowStorage??e.instance;return e.instance=n??new e,t&&(t.config.globalProperties.$vueFlowStorage=e.instance),e.instance}set(e,t){return this.flows.set(e,t)}get(e){return this.flows.get(e)}remove(e){return this.flows.delete(e)}create(e,t){let n=Uc(),r=te(n),i={};for(let[e,t]of Object.entries(r.hooks)){let n=`on${e.charAt(0).toUpperCase()+e.slice(1)}`;i[n]=t.on}let a={};for(let[e,t]of Object.entries(r.hooks))a[e]=t.trigger;let o=y(()=>{let e=new Map;for(let t of r.nodes)e.set(t.id,t);return e}),s=y(()=>{let e=new Map;for(let t of r.edges)e.set(t.id,t);return e}),c=Ol(r,o,s),l=Gc(r,o,s);l.setState({...r,...t});let u={...i,...c,...l,..._e(r),nodeLookup:o,edgeLookup:s,emits:a,id:e,vueFlowVersion:`1.48.2`,$destroy:()=>{this.remove(e)}};return this.set(e,u),u}getId(){return`vue-flow-${this.currentId++}`}};function $(e){let t=kl.getInstance(),n=P(),r=typeof e==`object`,i=r?e:{id:e},a=i.id,o=a??n?.vueFlowId,s;if(n){let e=S(gc,null);e!=null&&(!o||e.id===o)&&(s=e)}if(s||o&&(s=t.get(o)),!s||o&&s.id!==o){let e=a??t.getId(),r=t.create(e,i);s=r,(n??M(!0)).run(()=>{z(r.applyDefault,(e,t,n)=>{let i=e=>{r.applyNodeChanges(e)},a=e=>{r.applyEdgeChanges(e)};e?(r.onNodesChange(i),r.onEdgesChange(a)):(r.hooks.value.nodesChange.off(i),r.hooks.value.edgesChange.off(a)),n(()=>{r.hooks.value.nodesChange.off(i),r.hooks.value.edgesChange.off(a)})},{immediate:!0}),ie(()=>{if(s){let e=t.get(s.id);e?e.$destroy():ac(`No store instance found for id ${s.id} in storage.`)}})})}else r&&s.setState(i);return n&&(g(gc,s),n.vueFlowId=s.id),r&&d()?.type.name!==`VueFlow`&&s.emits.error(new Z(X.USEVUEFLOW_OPTIONS)),s}function Al(e){let{emits:t,dimensions:n}=$(),r;T(()=>{let i=()=>{var r;if(!e.value||!((r=e.value).checkVisibility?.call(r)??!0))return;let i=zo(e.value);(i.width===0||i.height===0)&&t.error(new Z(X.MISSING_VIEWPORT_DIMENSIONS)),n.value={width:i.width||500,height:i.height||500}};i(),window.addEventListener(`resize`,i),e.value&&(r=new ResizeObserver(()=>i()),r.observe(e.value)),V(()=>{window.removeEventListener(`resize`,i),r&&e.value&&r.unobserve(e.value)})})}var jl=c({name:`UserSelection`,compatConfig:{MODE:3},props:{userSelectionRect:{}},setup(e){return(e,t)=>(D(),L(`div`,{class:`vue-flow__selection vue-flow__container`,style:E({width:`${e.userSelectionRect.width}px`,height:`${e.userSelectionRect.height}px`,transform:`translate(${e.userSelectionRect.x}px, ${e.userSelectionRect.y}px)`})},null,4))}}),Ml=[`tabIndex`],Nl=c({name:`NodesSelection`,compatConfig:{MODE:3},setup(e){let{emits:t,viewport:n,getSelectedNodes:r,noPanClassName:i,disableKeyboardA11y:s,userSelectionActive:c}=$(),l=Mc(),u=A(null),d=Sc({el:u,onStart(e){t.selectionDragStart(e),t.nodeDragStart(e)},onDrag(e){t.selectionDrag(e),t.nodeDrag(e)},onStop(e){t.selectionDragStop(e),t.nodeDragStop(e)}});T(()=>{var e;s.value||(e=u.value)==null||e.focus({preventScroll:!0})});let f=y(()=>ss(r.value)),m=y(()=>({width:`${f.value.width}px`,height:`${f.value.height}px`,top:`${f.value.y}px`,left:`${f.value.x}px`}));function h(e){t.selectionContextMenu({event:e,nodes:r.value})}function g(e){s.value||Io[e.key]&&(e.preventDefault(),l({x:Io[e.key].x,y:Io[e.key].y},e.shiftKey))}return(e,t)=>!o(c)&&f.value.width&&f.value.height?(D(),L(`div`,{key:0,class:H([`vue-flow__nodesselection vue-flow__container`,o(i)]),style:E({transform:`translate(${o(n).x}px,${o(n).y}px) scale(${o(n).zoom})`})},[a(`div`,{ref_key:`el`,ref:u,class:H([{dragging:o(d)},`vue-flow__nodesselection-rect`]),style:E(m.value),tabIndex:o(s)?void 0:-1,onContextmenu:h,onKeydown:g},null,46,Ml)],6)):p(``,!0)}});function Pl(e,t){return{x:e.clientX-t.left,y:e.clientY-t.top}}var Fl=c({name:`Pane`,compatConfig:{MODE:3},props:{isSelecting:{type:Boolean},selectionKeyPressed:{type:Boolean}},setup(e){let{vueFlowRef:t,nodes:n,viewport:a,emits:s,userSelectionActive:c,removeSelectedElements:l,userSelectionRect:u,elementsSelectable:d,nodesSelectionActive:f,getSelectedEdges:m,getSelectedNodes:h,removeNodes:g,removeEdges:_,selectionMode:v,deleteKeyCode:y,multiSelectionKeyCode:b,multiSelectionActive:x,edgeLookup:S,nodeLookup:C,connectionLookup:w,defaultEdgeOptions:T,connectionStartHandle:E,panOnDrag:O}=$(),k=q(null),A=q(new Set),j=q(new Set),M=q(null),P=r(()=>d.value&&(e.isSelecting||c.value)),F=r(()=>E.value!==null),I=!1,R=!1,B=jo(y,{actInsideInputWithModifier:!1}),V=jo(b);z(B,e=>{e&&(g(h.value),_(m.value),f.value=!1)}),z(V,e=>{x.value=e});function U(e,t){return n=>{n.target===t&&e?.(n)}}function W(e){if(I||F.value){I=!1;return}s.paneClick(e),l(),f.value=!1}function ee(e){if(Array.isArray(O.value)&&O.value?.includes(2)){e.preventDefault();return}s.paneContextMenu(e)}function G(e){s.paneScroll(e)}function te(n){var r,i;if(M.value=t.value?.getBoundingClientRect()??null,!d.value||!e.isSelecting||n.button!==0||n.target!==k.value||!M.value)return;(i=(r=n.target)?.setPointerCapture)==null||i.call(r,n.pointerId);let{x:a,y:o}=Pl(n,M.value);R=!0,I=!1,l(),u.value={width:0,height:0,startX:a,startY:o,x:a,y:o},s.selectionStart(n)}function ne(e){if(!M.value||!u.value)return;I=!0;let{x:t,y:r}=Us(e,M.value),{startX:i=0,startY:o=0}=u.value,l={startX:i,startY:o,x:t<i?t:i,y:r<o?r:o,width:Math.abs(t-i),height:Math.abs(r-o)},d=A.value,p=j.value;A.value=new Set(cs(n.value,l,a.value,v.value===vo.Partial,!0).map(e=>e.id)),j.value=new Set;let m=T.value?.selectable??!0;for(let e of A.value){let t=w.value.get(e);if(t)for(let{edgeId:e}of t.values()){let t=S.value.get(e);t&&(t.selectable??m)&&j.value.add(e)}}if(!mc(d,A.value)){let e=Es(C.value,A.value,!0);s.nodesChange(e)}if(!mc(p,j.value)){let e=Es(S.value,j.value);s.edgesChange(e)}u.value=l,c.value=!0,f.value=!1}function K(t){var n;t.button===0&&R&&((n=t.target)==null||n.releasePointerCapture(t.pointerId),!c.value&&u.value&&t.target===k.value&&W(t),c.value=!1,u.value=null,f.value=A.value.size>0,s.selectionEnd(t),e.selectionKeyPressed&&(I=!1),R=!1)}return(e,t)=>(D(),L(`div`,{ref_key:`container`,ref:k,class:H([`vue-flow__pane vue-flow__container`,{selection:e.isSelecting}]),onClick:t[0]||=e=>P.value?void 0:U(W,k.value)(e),onContextmenu:t[1]||=e=>U(ee,k.value)(e),onWheelPassive:t[2]||=e=>U(G,k.value)(e),onPointerenter:t[3]||=e=>P.value?void 0:o(s).paneMouseEnter(e),onPointerdown:t[4]||=e=>P.value?te(e):o(s).paneMouseMove(e),onPointermove:t[5]||=e=>P.value?ne(e):o(s).paneMouseMove(e),onPointerup:t[6]||=e=>P.value?K(e):void 0,onPointerleave:t[7]||=e=>o(s).paneMouseLeave(e)},[N(e.$slots,`default`),o(c)&&o(u)?(D(),i(jl,{key:0,"user-selection-rect":o(u)},null,8,[`user-selection-rect`])):p(``,!0),o(f)&&o(h).length?(D(),i(Nl,{key:1})):p(``,!0)],34))}}),Il=c({name:`Transform`,compatConfig:{MODE:3},setup(e){let{viewport:t,fitViewOnInit:n,fitViewOnInitDone:r}=$(),i=y(()=>n.value?!r.value:!1),a=y(()=>`translate(${t.value.x}px,${t.value.y}px) scale(${t.value.zoom})`);return(e,t)=>(D(),L(`div`,{class:`vue-flow__transformationpane vue-flow__container`,style:E({transform:a.value,opacity:i.value?0:void 0})},[N(e.$slots,`default`)],4))}}),Ll=c({name:`Viewport`,compatConfig:{MODE:3},setup(e){let{minZoom:t,maxZoom:n,defaultViewport:i,translateExtent:a,zoomActivationKeyCode:s,selectionKeyCode:c,panActivationKeyCode:l,panOnScroll:u,panOnScrollMode:d,panOnScrollSpeed:f,panOnDrag:p,zoomOnDoubleClick:h,zoomOnPinch:g,zoomOnScroll:_,preventScrolling:v,noWheelClassName:y,noPanClassName:b,emits:x,connectionStartHandle:S,userSelectionActive:C,paneDragging:w,d3Zoom:E,d3Selection:O,d3ZoomHandler:k,viewport:A,viewportRef:M,paneClickDistance:P}=$();Al(M);let F=q(!1),I=q(!1),R=null,B=!1,V=0,U={x:0,y:0,zoom:0},W=jo(l),ee=jo(c),G=jo(s),te=r(()=>(!ee.value||ee.value&&c.value===!0)&&(W.value||p.value)),ne=r(()=>W.value||u.value),K=r(()=>c.value===!0&&te.value!==!0),re=r(()=>ee.value&&c.value!==!0||C.value||K.value),ie=r(()=>S.value!==null);T(()=>{if(!M.value){ac(`Viewport element is missing`);return}let e=M.value,r=e.getBoundingClientRect(),o=_o().clickDistance(P.value).scaleExtent([t.value,n.value]).translateExtent(a.value),s=Nn(e).call(o),l=s.on(`wheel.zoom`),m=so.translate(i.value.x??0,i.value.y??0).scale(Bo(i.value.zoom??1,t.value,n.value)),S=[[0,0],[r.width,r.height]],T=o.constrain()(m,S,a.value);o.transform(s,T),o.wheelDelta(_s),E.value=o,O.value=s,k.value=l,A.value={x:T.x,y:T.y,zoom:T.k},o.on(`start`,e=>{if(!e.sourceEvent)return null;V=e.sourceEvent.button,F.value=!0;let t=se(e.transform);e.sourceEvent?.type===`mousedown`&&(w.value=!0),U=t,x.viewportChangeStart(t),x.moveStart({event:e,flowTransform:t})}),o.on(`end`,e=>{if(!e.sourceEvent)return null;if(F.value=!1,w.value=!1,ae(te.value,V??0)&&!B&&x.paneContextMenu(e.sourceEvent),B=!1,oe(U,e.transform)){let t=se(e.transform);U=t,x.viewportChangeEnd(t),x.moveEnd({event:e,flowTransform:t})}}),o.filter(e=>{let t=G.value||_.value,n=g.value&&e.ctrlKey,r=e.button,i=e.type===`wheel`;if(r===1&&e.type===`mousedown`&&(ce(e,`vue-flow__node`)||ce(e,`vue-flow__edge`)))return!0;if(!te.value&&!t&&!ne.value&&!h.value&&!g.value||C.value||ie.value&&!i||!h.value&&e.type===`dblclick`||ce(e,y.value)&&i||ce(e,b.value)&&(!i||ne.value&&i&&!G.value)||!g.value&&e.ctrlKey&&i||!t&&!ne.value&&!n&&i)return!1;if(!g&&e.type===`touchstart`&&e.touches?.length>1)return e.preventDefault(),!1;if(!te.value&&(e.type===`mousedown`||e.type===`touchstart`)||K.value&&Array.isArray(p.value)&&p.value.includes(0)&&r===0||Array.isArray(p.value)&&!p.value.includes(r)&&(e.type===`mousedown`||e.type===`touchstart`))return!1;let a=Array.isArray(p.value)&&p.value.includes(r)||c.value===!0&&Array.isArray(p.value)&&!p.value.includes(0)||!r||r<=1;return(!e.ctrlKey||W.value||i)&&a}),z([C,te],()=>{C.value&&!F.value?o.on(`zoom`,null):C.value||o.on(`zoom`,e=>{A.value={x:e.transform.x,y:e.transform.y,zoom:e.transform.k};let t=se(e.transform);B=ae(te.value,V??0),x.viewportChange(t),x.move({event:e,flowTransform:t})})},{immediate:!0}),z([C,ne,d,G,g,v,y],()=>{ne.value&&!G.value&&!C.value?s.on(`wheel.zoom`,e=>{if(ce(e,y.value))return!1;let t=G.value||_.value,n=g.value&&e.ctrlKey;if(!(!v.value||ne.value||t||n))return!1;e.preventDefault(),e.stopImmediatePropagation();let r=s.property(`__zoom`).k||1,i=Ws();if(!W.value&&e.ctrlKey&&g.value&&i){let t=Fn(e),n=r*2**_s(e);o.scaleTo(s,n,t,e);return}let a=e.deltaMode===1?20:1,c=d.value===So.Vertical?0:e.deltaX*a,l=d.value===So.Horizontal?0:e.deltaY*a;!i&&e.shiftKey&&d.value!==So.Vertical&&!c&&l&&(c=l,l=0),o.translateBy(s,-(c/r)*f.value,-(l/r)*f.value);let u=se(s.property(`__zoom`));R&&clearTimeout(R),I.value?(x.move({event:e,flowTransform:u}),x.viewportChange(u),R=setTimeout(()=>{x.moveEnd({event:e,flowTransform:u}),x.viewportChangeEnd(u),I.value=!1},150)):(I.value=!0,x.moveStart({event:e,flowTransform:u}),x.viewportChangeStart(u))},{passive:!1}):l!==void 0&&s.on(`wheel.zoom`,function(e,t){let n=!v.value&&e.type===`wheel`&&!e.ctrlKey,r=G.value||_.value,i=g.value&&e.ctrlKey;if(!r&&!u.value&&!i&&e.type===`wheel`||n||ce(e,y.value))return null;e.preventDefault(),l.call(this,e,t)},{passive:!1})},{immediate:!0})});function ae(e,t){return t===2&&Array.isArray(e)&&e.includes(2)}function oe(e,t){return e.x!==t.x&&!Number.isNaN(t.x)||e.y!==t.y&&!Number.isNaN(t.y)||e.zoom!==t.k&&!Number.isNaN(t.k)}function se(e){return{x:e.x,y:e.y,zoom:e.k}}function ce(e,t){return e.target.closest(`.${t}`)}return(e,t)=>(D(),L(`div`,{ref_key:`viewportRef`,ref:M,class:`vue-flow__viewport vue-flow__container`},[m(Fl,{"is-selecting":re.value,"selection-key-pressed":o(ee),class:H({connecting:ie.value,dragging:o(w),draggable:o(p)===!0||Array.isArray(o(p))&&o(p).includes(0)})},{default:j(()=>[m(Il,null,{default:j(()=>[N(e.$slots,`default`)]),_:3})]),_:3},8,[`is-selecting`,`selection-key-pressed`,`class`])],512))}}),Rl=[`id`],zl=[`id`],Bl=[`id`],Vl=c({name:`A11yDescriptions`,compatConfig:{MODE:3},setup(e){let{id:t,disableKeyboardA11y:n,ariaLiveMessage:r}=$();return(e,i)=>(D(),L(K,null,[a(`div`,{id:`${o(Mo)}-${o(t)}`,style:{display:`none`}},` Press enter or space to select a node. `+_(o(n)?``:`You can then use the arrow keys to move the node around.`)+` You can then use the arrow keys to move the node around, press delete to remove it and press escape to cancel. `,9,Rl),a(`div`,{id:`${o(No)}-${o(t)}`,style:{display:`none`}},` Press enter or space to select an edge. You can then press delete to remove it or press escape to cancel. `,8,zl),o(n)?p(``,!0):(D(),L(`div`,{key:0,id:`${o(Po)}-${o(t)}`,"aria-live":`assertive`,"aria-atomic":`true`,style:{position:`absolute`,width:`1px`,height:`1px`,margin:`-1px`,border:`0`,padding:`0`,overflow:`hidden`,clip:`rect(0px, 0px, 0px, 0px)`,"clip-path":`inset(100%)`}},_(o(r)),9,Bl))],64))}});function Hl(){let e=$();z(()=>e.viewportHelper.value.viewportInitialized,t=>{t&&setTimeout(()=>{e.emits.init(e),e.emits.paneReady(e)},1)})}function Ul(e,t,n){return n===J.Left?e-t:n===J.Right?e+t:e}function Wl(e,t,n){return n===J.Top?e-t:n===J.Bottom?e+t:e}var Gl=function({radius:e=10,centerX:t=0,centerY:n=0,position:r=J.Top,type:i}){return v(`circle`,{class:`vue-flow__edgeupdater vue-flow__edgeupdater-${i}`,cx:Ul(t,e,r),cy:Wl(n,e,r),r:e,stroke:`transparent`,fill:`transparent`})};Gl.props=[`radius`,`centerX`,`centerY`,`position`,`type`],Gl.compatConfig={MODE:3};var Kl=Gl,ql=c({name:`Edge`,compatConfig:{MODE:3},props:[`id`],setup(e){let{id:t,addSelectedEdges:n,connectionMode:i,edgeUpdaterRadius:a,emits:o,nodesSelectionActive:s,noPanClassName:c,getEdgeTypes:l,removeSelectedEdges:u,findEdge:f,findNode:p,isValidConnection:m,multiSelectionActive:h,disableKeyboardA11y:_,elementsSelectable:b,edgesUpdatable:x,edgesFocusable:C,hooks:w}=$(),T=y(()=>f(e.id)),{emit:E,on:D}=wc(T.value,o),O=S(xc),k=d(),j=A(!1),M=A(!1),N=A(``),P=A(null),F=A(`source`),I=A(null),L=r(()=>T.value.selectable===void 0?b.value:T.value.selectable),R=r(()=>T.value.updatable===void 0?x.value:T.value.updatable),z=r(()=>T.value.focusable===void 0?C.value:T.value.focusable);g(yc,e.id),g(bc,I);let B=y(()=>T.value.class instanceof Function?T.value.class(T.value):T.value.class),V=y(()=>T.value.style instanceof Function?T.value.style(T.value):T.value.style),H=y(()=>{let e=T.value.type||`default`,t=O?.[`edge-${e}`];if(t)return t;let n=T.value.template??l.value[e];if(typeof n==`string`&&k){let t=Object.keys(k.appContext.components);t&&t.includes(e)&&(n=ee(e,!1))}return n&&typeof n!=`string`?n:(o.error(new Z(X.EDGE_TYPE_MISSING,n)),!1)}),{handlePointerDown:U}=Dc({nodeId:N,handleId:P,type:F,isValidConnection:m,edgeUpdaterType:F,onEdgeUpdate:te,onEdgeUpdateEnd:ne});return()=>{let n=p(T.value.source),r=p(T.value.target),s=`pathOptions`in T.value?T.value.pathOptions:{};if(!n&&!r)return o.error(new Z(X.EDGE_SOURCE_TARGET_MISSING,T.value.id,T.value.source,T.value.target)),null;if(!n)return o.error(new Z(X.EDGE_SOURCE_MISSING,T.value.id,T.value.source)),null;if(!r)return o.error(new Z(X.EDGE_TARGET_MISSING,T.value.id,T.value.target)),null;if(!T.value||T.value.hidden||n.hidden||r.hidden)return null;let u;u=i.value===bo.Strict?n.handleBounds.source:[...n.handleBounds.source||[],...n.handleBounds.target||[]];let d=Ls(u,T.value.sourceHandle),f;f=i.value===bo.Strict?r.handleBounds.target:[...r.handleBounds.target||[],...r.handleBounds.source||[]];let m=Ls(f,T.value.targetHandle),h=d?.position||J.Bottom,g=m?.position||J.Top,{x:_,y}=Is(n,d,h),{x:b,y:x}=Is(r,m,g);return T.value.sourceX=_,T.value.sourceY=y,T.value.targetX=b,T.value.targetY=x,v(`g`,{ref:I,key:e.id,"data-id":e.id,class:[`vue-flow__edge`,`vue-flow__edge-${H.value===!1?`default`:T.value.type||`default`}`,c.value,B.value,{updating:j.value,selected:T.value.selected,animated:T.value.animated,inactive:!L.value&&!w.value.edgeClick.hasListeners()}],tabIndex:z.value?0:void 0,"aria-label":T.value.ariaLabel===null?void 0:T.value.ariaLabel??`Edge from ${T.value.source} to ${T.value.target}`,"aria-describedby":z.value?`${No}-${t}`:void 0,"aria-roledescription":`edge`,role:z.value?`group`:`img`,...T.value.domAttributes,onClick:q,onContextmenu:re,onDblclick:ie,onMouseenter:ae,onMousemove:oe,onMouseleave:se,onKeyDown:z.value?ue:void 0},[M.value?null:v(H.value===!1?l.value.default:H.value,{id:e.id,sourceNode:n,targetNode:r,source:T.value.source,target:T.value.target,type:T.value.type,updatable:R.value,selected:T.value.selected,animated:T.value.animated,label:T.value.label,labelStyle:T.value.labelStyle,labelShowBg:T.value.labelShowBg,labelBgStyle:T.value.labelBgStyle,labelBgPadding:T.value.labelBgPadding,labelBgBorderRadius:T.value.labelBgBorderRadius,data:T.value.data,events:{...T.value.events,...D},style:V.value,markerStart:`url('#${gs(T.value.markerStart,t)}')`,markerEnd:`url('#${gs(T.value.markerEnd,t)}')`,sourcePosition:h,targetPosition:g,sourceX:_,sourceY:y,targetX:b,targetY:x,sourceHandleId:T.value.sourceHandle,targetHandleId:T.value.targetHandle,interactionWidth:T.value.interactionWidth,...s}),[R.value===`source`||R.value===!0?[v(`g`,{onMousedown:ce,onMouseenter:W,onMouseout:G},v(Kl,{position:h,centerX:_,centerY:y,radius:a.value,type:`source`,"data-type":`source`}))]:null,R.value===`target`||R.value===!0?[v(`g`,{onMousedown:le,onMouseenter:W,onMouseout:G},v(Kl,{position:g,centerX:b,centerY:x,radius:a.value,type:`target`,"data-type":`target`}))]:null]])};function W(){j.value=!0}function G(){j.value=!1}function te(e,t){E.update({event:e,edge:T.value,connection:t})}function ne(e){E.updateEnd({event:e,edge:T.value}),M.value=!1}function K(e,t){e.button===0&&(M.value=!0,N.value=t?T.value.target:T.value.source,P.value=(t?T.value.targetHandle:T.value.sourceHandle)??null,F.value=t?`target`:`source`,E.updateStart({event:e,edge:T.value}),U(e))}function q(e){var t;let r={event:e,edge:T.value};L.value&&(s.value=!1,T.value.selected&&h.value?(u([T.value]),(t=I.value)==null||t.blur()):n([T.value])),E.click(r)}function re(e){E.contextMenu({event:e,edge:T.value})}function ie(e){E.doubleClick({event:e,edge:T.value})}function ae(e){E.mouseEnter({event:e,edge:T.value})}function oe(e){E.mouseMove({event:e,edge:T.value})}function se(e){E.mouseLeave({event:e,edge:T.value})}function ce(e){K(e,!0)}function le(e){K(e,!1)}function ue(t){var r;!_.value&&Fo.includes(t.key)&&L.value&&(t.key===`Escape`?((r=I.value)==null||r.blur(),u([f(e.id)])):n([f(e.id)]))}}}),Jl=c({name:`ConnectionLine`,compatConfig:{MODE:3},setup(){let{id:e,connectionMode:t,connectionStartHandle:n,connectionEndHandle:r,connectionPosition:i,connectionLineType:a,connectionLineStyle:o,connectionLineOptions:s,connectionStatus:c,viewport:l,findNode:u}=$(),d=S(xc)?.[`connection-line`],f=y(()=>u(n.value?.nodeId)),p=y(()=>u(r.value?.nodeId)??null),m=y(()=>({x:(i.value.x-l.value.x)/l.value.zoom,y:(i.value.y-l.value.y)/l.value.zoom})),h=y(()=>s.value.markerStart?`url(#${gs(s.value.markerStart,e)})`:``),g=y(()=>s.value.markerEnd?`url(#${gs(s.value.markerEnd,e)})`:``);return()=>{if(!f.value||!n.value)return null;let e=n.value.id,i=n.value.type,l=f.value.handleBounds,u=l?.[i]??[];if(t.value===bo.Loose){let e=l?.[i===`source`?`target`:`source`]??[];u=[...u,...e]}if(!u)return null;let _=(e?u.find(t=>t.id===e):u[0])??null,y=_?.position??J.Top,{x:b,y:x}=Is(f.value,_,y),S=null;p.value&&(S=t.value===bo.Strict?p.value.handleBounds[i===`source`?`target`:`source`]?.find(e=>e.id===r.value?.id)||null:[...p.value.handleBounds.source??[],...p.value.handleBounds.target??[]].find(e=>e.id===r.value?.id)||null);let C=r.value?.position??(y?rc[y]:null);if(!y||!C)return null;let w=a.value??s.value.type??yo.Bezier,T=``,E={sourceX:b,sourceY:x,sourcePosition:y,targetX:m.value.x,targetY:m.value.y,targetPosition:C};return w===yo.Bezier?[T]=dl(E):w===yo.Step?[T]=yl({...E,borderRadius:0}):w===yo.SmoothStep?[T]=yl(E):w===yo.SimpleBezier?[T]=pl(E):T=`M${b},${x} ${m.value.x},${m.value.y}`,v(`svg`,{class:`vue-flow__edges vue-flow__connectionline vue-flow__container`},v(`g`,{class:`vue-flow__connection`},d?v(d,{sourceX:b,sourceY:x,sourcePosition:y,targetX:m.value.x,targetY:m.value.y,targetPosition:C,sourceNode:f.value,sourceHandle:_,targetNode:p.value,targetHandle:S,markerEnd:g.value,markerStart:h.value,connectionStatus:c.value}):v(`path`,{d:T,class:[s.value.class,c.value,`vue-flow__connection-path`],style:{...o.value,...s.value.style},"marker-end":g.value,"marker-start":h.value})))}}}),Yl=[`id`,`markerWidth`,`markerHeight`,`markerUnits`,`orient`],Xl=c({name:`MarkerType`,compatConfig:{MODE:3},props:{id:{},type:{},color:{default:`none`},width:{default:12.5},height:{default:12.5},markerUnits:{default:`strokeWidth`},orient:{default:`auto-start-reverse`},strokeWidth:{default:1}},setup(e){return(e,t)=>(D(),L(`marker`,{id:e.id,class:`vue-flow__arrowhead`,viewBox:`-10 -10 20 20`,refX:`0`,refY:`0`,markerWidth:`${e.width}`,markerHeight:`${e.height}`,markerUnits:e.markerUnits,orient:e.orient},[e.type===o(xo).ArrowClosed?(D(),L(`polyline`,{key:0,style:E({stroke:e.color,fill:e.color,strokeWidth:e.strokeWidth}),"stroke-linecap":`round`,"stroke-linejoin":`round`,points:`-5,-4 0,0 -5,4 -5,-4`},null,4)):p(``,!0),e.type===o(xo).Arrow?(D(),L(`polyline`,{key:1,style:E({stroke:e.color,strokeWidth:e.strokeWidth}),"stroke-linecap":`round`,"stroke-linejoin":`round`,fill:`none`,points:`-5,-4 0,0 -5,4`},null,4)):p(``,!0)],8,Yl))}}),Zl={class:`vue-flow__marker vue-flow__container`,"aria-hidden":`true`},Ql=c({name:`MarkerDefinitions`,compatConfig:{MODE:3},setup(t){let{id:n,edges:r,connectionLineOptions:o,defaultMarkerColor:s}=$(),c=y(()=>{let e=new Set,t=[],i=r=>{if(r){let i=gs(r,n);e.has(i)||(typeof r==`object`?t.push({...r,id:i,color:r.color||s.value}):t.push({id:i,color:s.value,type:r}),e.add(i))}};for(let e of[o.value.markerEnd,o.value.markerStart])i(e);for(let e of r.value)for(let t of[e.markerStart,e.markerEnd])i(t);return t.sort((e,t)=>e.id.localeCompare(t.id))});return(t,n)=>(D(),L(`svg`,Zl,[a(`defs`,null,[(D(!0),L(K,null,e(c.value,e=>(D(),i(Xl,{id:e.id,key:e.id,type:e.type,color:e.color,width:e.width,height:e.height,markerUnits:e.markerUnits,"stroke-width":e.strokeWidth,orient:e.orient},null,8,[`id`,`type`,`color`,`width`,`height`,`markerUnits`,`stroke-width`,`orient`]))),128))])]))}}),$l=c({name:`Edges`,compatConfig:{MODE:3},setup(t){let{findNode:n,getEdges:r,elevateEdgesOnSelect:i}=$();return(t,a)=>(D(),L(K,null,[m(Ql),(D(!0),L(K,null,e(o(r),e=>(D(),L(`svg`,{key:e.id,class:`vue-flow__edges vue-flow__container`,style:E({zIndex:o(zs)(e,o(n),o(i))})},[m(o(ql),{id:e.id},null,8,[`id`])],4))),128)),m(o(Jl))],64))}}),eu=c({name:`Node`,compatConfig:{MODE:3},props:[`id`,`resizeObserver`],setup(e){let{id:t,noPanClassName:n,selectNodesOnDrag:i,nodesSelectionActive:a,multiSelectionActive:o,emits:s,removeSelectedNodes:c,addSelectedNodes:l,updateNodeDimensions:u,onUpdateNodeInternals:f,getNodeTypes:p,nodeExtent:m,elevateNodesOnSelect:h,disableKeyboardA11y:_,ariaLiveMessage:b,snapToGrid:x,snapGrid:w,nodeDragThreshold:E,nodesDraggable:D,elementsSelectable:O,nodesConnectable:k,nodesFocusable:j,hooks:M}=$(),N=A(null);g(vc,N),g(_c,e.id);let P=S(xc),F=d(),I=Mc(),{node:L,parentNode:R}=kc(e.id),{emit:B,on:V}=jc(L,s),H=r(()=>L.draggable===void 0?D.value:L.draggable),U=r(()=>L.selectable===void 0?O.value:L.selectable),W=r(()=>L.connectable===void 0?k.value:L.connectable),G=r(()=>L.focusable===void 0?j.value:L.focusable),te=y(()=>U.value||H.value||M.value.nodeClick.hasListeners()||M.value.nodeDoubleClick.hasListeners()||M.value.nodeMouseEnter.hasListeners()||M.value.nodeMouseMove.hasListeners()||M.value.nodeMouseLeave.hasListeners()),ne=r(()=>!!L.dimensions.width&&!!L.dimensions.height),K=y(()=>{let e=L.type||`default`,t=P?.[`node-${e}`];if(t)return t;let n=L.template||p.value[e];if(typeof n==`string`&&F){let t=Object.keys(F.appContext.components);t&&t.includes(e)&&(n=ee(e,!1))}return n&&typeof n!=`string`?n:(s.error(new Z(X.NODE_TYPE_MISSING,n)),!1)}),q=Sc({id:e.id,el:N,disabled:()=>!H.value,selectable:U,dragHandle:()=>L.dragHandle,onStart(e){B.dragStart(e)},onDrag(e){B.drag(e)},onStop(e){B.dragStop(e)},onClick(e){pe(e)}}),re=y(()=>L.class instanceof Function?L.class(L):L.class),ie=y(()=>{let e=(L.style instanceof Function?L.style(L):L.style)||{},t=L.width instanceof Function?L.width(L):L.width,n=L.height instanceof Function?L.height(L):L.height;return!e.width&&t&&(e.width=typeof t==`string`?t:`${t}px`),!e.height&&n&&(e.height=typeof n==`string`?n:`${n}px`),e}),ae=r(()=>Number(L.zIndex??ie.value.zIndex??0));return f(t=>{(t.includes(e.id)||!t.length)&&se()}),T(()=>{z(()=>L.hidden,(t=!1,n,r)=>{!t&&N.value&&(e.resizeObserver.observe(N.value),r(()=>{N.value&&e.resizeObserver.unobserve(N.value)}))},{immediate:!0,flush:`post`})}),z([()=>L.type,()=>L.sourcePosition,()=>L.targetPosition],()=>{C(()=>{u([{id:e.id,nodeElement:N.value,forceUpdate:!0}])})}),z([()=>L.position.x,()=>L.position.y,()=>R.value?.computedPosition.x,()=>R.value?.computedPosition.y,()=>R.value?.computedPosition.z,ae,()=>L.selected,()=>L.dimensions.height,()=>L.dimensions.width,()=>R.value?.dimensions.height,()=>R.value?.dimensions.width],([e,t,n,r,i,a])=>{let o={x:e,y:t,z:a+(h.value&&L.selected?1e3:0)};n!==void 0&&r!==void 0?L.computedPosition=ms({x:n,y:r,z:i},o):L.computedPosition=o},{flush:`post`,immediate:!0}),z([()=>L.extent,m],([e,t],[n,r])=>{(e!==n||t!==r)&&oe()}),L.extent===`parent`||typeof L.extent==`object`&&`range`in L.extent&&L.extent.range===`parent`?ye(()=>ne).toBe(!0).then(oe):oe(),()=>L.hidden?null:v(`div`,{ref:N,"data-id":L.id,class:[`vue-flow__node`,`vue-flow__node-${K.value===!1?`default`:L.type||`default`}`,{[n.value]:H.value,dragging:q?.value,draggable:H.value,selected:L.selected,selectable:U.value,parent:L.isParent},re.value],style:{visibility:ne.value?`visible`:`hidden`,zIndex:L.computedPosition.z??ae.value,transform:`translate(${L.computedPosition.x}px,${L.computedPosition.y}px)`,pointerEvents:te.value?`all`:`none`,...ie.value},tabIndex:G.value?0:void 0,role:G.value?`group`:void 0,"aria-describedby":_.value?void 0:`${Mo}-${t}`,"aria-label":L.ariaLabel,"aria-roledescription":`node`,...L.domAttributes,onMouseenter:ce,onMousemove:le,onMouseleave:ue,onContextmenu:de,onClick:pe,onDblclick:fe,onKeydown:me},[v(K.value===!1?p.value.default:K.value,{id:L.id,type:L.type,data:L.data,events:{...L.events,...V},selected:L.selected,resizing:L.resizing,dragging:q.value,connectable:W.value,position:L.computedPosition,dimensions:L.dimensions,isValidTargetPos:L.isValidTargetPos,isValidSourcePos:L.isValidSourcePos,parent:L.parentNode,parentNodeId:L.parentNode,zIndex:L.computedPosition.z??ae.value,targetPosition:L.targetPosition,sourcePosition:L.sourcePosition,label:L.label,dragHandle:L.dragHandle,onUpdateNodeInternals:se})]);function oe(){let e=L.computedPosition,{computedPosition:t,position:n}=Fs(L,x.value?Ks(e,w.value):e,s.error,m.value,R.value);(L.computedPosition.x!==t.x||L.computedPosition.y!==t.y)&&(L.computedPosition={...L.computedPosition,...t}),(L.position.x!==n.x||L.position.y!==n.y)&&(L.position=n)}function se(){N.value&&u([{id:e.id,nodeElement:N.value,forceUpdate:!0}])}function ce(e){q?.value||B.mouseEnter({event:e,node:L})}function le(e){q?.value||B.mouseMove({event:e,node:L})}function ue(e){q?.value||B.mouseLeave({event:e,node:L})}function de(e){return B.contextMenu({event:e,node:L})}function fe(e){return B.doubleClick({event:e,node:L})}function pe(e){U.value&&(!i.value||!H.value||E.value>0)&&cc(L,o.value,l,c,a,!1,N.value),B.click({event:e,node:L})}function me(e){if(!(Eo(e)||_.value)){if(Fo.includes(e.key)&&U.value){let t=e.key===`Escape`;cc(L,o.value,l,c,a,t,N.value)}else H.value&&L.selected&&Io[e.key]&&(e.preventDefault(),b.value=`Moved selected node ${e.key.replace(`Arrow`,``).toLowerCase()}. New position, x: ${~~L.position.x}, y: ${~~L.position.y}`,I({x:Io[e.key].x,y:Io[e.key].y},e.shiftKey))}}}});function tu(e={includeHiddenNodes:!1}){let{nodes:t}=$();return y(()=>{if(t.value.length===0)return!1;for(let n of t.value)if((e.includeHiddenNodes||!n.hidden)&&(n?.handleBounds===void 0||n.dimensions.width===0||n.dimensions.height===0))return!1;return!0})}var nu={class:`vue-flow__nodes vue-flow__container`},ru=c({name:`Nodes`,compatConfig:{MODE:3},setup(t){let{getNodes:n,updateNodeDimensions:r,emits:a}=$(),c=tu(),l=A();return z(c,e=>{e&&C(()=>{a.nodesInitialized(n.value)})},{immediate:!0}),T(()=>{l.value=new ResizeObserver(e=>{let t=e.map(e=>({id:e.target.getAttribute(`data-id`),nodeElement:e.target,forceUpdate:!0}));C(()=>r(t))})}),V(()=>l.value?.disconnect()),(t,r)=>(D(),L(`div`,nu,[l.value?(D(!0),L(K,{key:0},e(o(n),(e,t,n,r)=>{let a=[e.id];if(r&&r.key===e.id&&s(r,a))return r;let c=(D(),i(o(eu),{id:e.id,key:e.id,"resize-observer":l.value},null,8,[`id`,`resize-observer`]));return c.memo=a,c},r,0),128)):p(``,!0)]))}});function iu(){let{emits:e}=$();T(()=>{if(oc()){let t=document.querySelector(`.vue-flow__pane`);t&&window.getComputedStyle(t).zIndex!==`1`&&e.error(new Z(X.MISSING_STYLES))}})}var au=a(`div`,{class:`vue-flow__edge-labels`},null,-1),ou=c({name:`VueFlow`,compatConfig:{MODE:3},props:{id:{},modelValue:{},nodes:{},edges:{},edgeTypes:{},nodeTypes:{},connectionMode:{},connectionLineType:{},connectionLineStyle:{default:void 0},connectionLineOptions:{default:void 0},connectionRadius:{},isValidConnection:{type:[Function,null],default:void 0},deleteKeyCode:{default:void 0},selectionKeyCode:{type:[Boolean,null],default:void 0},multiSelectionKeyCode:{default:void 0},zoomActivationKeyCode:{default:void 0},panActivationKeyCode:{default:void 0},snapToGrid:{type:Boolean,default:void 0},snapGrid:{},onlyRenderVisibleElements:{type:Boolean,default:void 0},edgesUpdatable:{type:[Boolean,String],default:void 0},nodesDraggable:{type:Boolean,default:void 0},nodesConnectable:{type:Boolean,default:void 0},nodeDragThreshold:{},elementsSelectable:{type:Boolean,default:void 0},selectNodesOnDrag:{type:Boolean,default:void 0},panOnDrag:{type:[Boolean,Array],default:void 0},minZoom:{},maxZoom:{},defaultViewport:{},translateExtent:{},nodeExtent:{},defaultMarkerColor:{},zoomOnScroll:{type:Boolean,default:void 0},zoomOnPinch:{type:Boolean,default:void 0},panOnScroll:{type:Boolean,default:void 0},panOnScrollSpeed:{},panOnScrollMode:{},paneClickDistance:{},zoomOnDoubleClick:{type:Boolean,default:void 0},preventScrolling:{type:Boolean,default:void 0},selectionMode:{},edgeUpdaterRadius:{},fitViewOnInit:{type:Boolean,default:void 0},connectOnClick:{type:Boolean,default:void 0},applyDefault:{type:Boolean,default:void 0},autoConnect:{type:[Boolean,Function],default:void 0},noDragClassName:{},noWheelClassName:{},noPanClassName:{},defaultEdgeOptions:{},elevateEdgesOnSelect:{type:Boolean,default:void 0},elevateNodesOnSelect:{type:Boolean,default:void 0},disableKeyboardA11y:{type:Boolean,default:void 0},edgesFocusable:{type:Boolean,default:void 0},nodesFocusable:{type:Boolean,default:void 0},autoPanOnConnect:{type:Boolean,default:void 0},autoPanOnNodeDrag:{type:Boolean,default:void 0},autoPanSpeed:{}},emits:`nodesChange.edgesChange.nodesInitialized.paneReady.init.updateNodeInternals.error.connect.connectStart.connectEnd.clickConnectStart.clickConnectEnd.moveStart.move.moveEnd.selectionDragStart.selectionDrag.selectionDragStop.selectionContextMenu.selectionStart.selectionEnd.viewportChangeStart.viewportChange.viewportChangeEnd.paneScroll.paneClick.paneContextMenu.paneMouseEnter.paneMouseMove.paneMouseLeave.edgeUpdate.edgeContextMenu.edgeMouseEnter.edgeMouseMove.edgeMouseLeave.edgeDoubleClick.edgeClick.edgeUpdateStart.edgeUpdateEnd.nodeContextMenu.nodeMouseEnter.nodeMouseMove.nodeMouseLeave.nodeDoubleClick.nodeClick.nodeDragStart.nodeDrag.nodeDragStop.miniMapNodeClick.miniMapNodeDoubleClick.miniMapNodeMouseEnter.miniMapNodeMouseMove.miniMapNodeMouseLeave.update:modelValue.update:nodes.update:edges`.split(`.`),setup(e,{expose:t,emit:n}){let r=e,i=k(),a=Ee(r,`modelValue`,n),s=Ee(r,`nodes`,n),c=Ee(r,`edges`,n),l=$(r),u=zc({modelValue:a,nodes:s,edges:c},r,l);return Vc(n,l.hooks),Hl(),iu(),g(xc,i),w(u),t(l),(e,t)=>(D(),L(`div`,{ref:o(l).vueFlowRef,class:`vue-flow`},[m(Ll,null,{default:j(()=>[m($l),au,m(ru),N(e.$slots,`zoom-pane`)]),_:3}),N(e.$slots,`default`),m(Vl)],512))}}),su=c({name:`Panel`,compatConfig:{MODE:3},props:{position:{}},setup(e){let t=e,{userSelectionActive:n}=$(),r=y(()=>`${t.position}`.split(`-`));return(e,t)=>(D(),L(`div`,{class:H([`vue-flow__panel`,r.value]),style:E({pointerEvents:o(n)?`none`:`all`})},[N(e.$slots,`default`)],6))}});n(),B(),h();var cu=(e=>(e.Lines=`lines`,e.Dots=`dots`,e))(cu||{}),lu=function({dimensions:e,size:t,color:n}){return v(`path`,{stroke:n,"stroke-width":t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`})},uu=function({radius:e,color:t}){return v(`circle`,{cx:e,cy:e,r:e,fill:t})};cu.Lines,cu.Dots;var du={[cu.Dots]:`#81818a`,[cu.Lines]:`#eee`},fu=[`id`,`x`,`y`,`width`,`height`,`patternTransform`],pu={key:2,height:`100`,width:`100`},mu=[`fill`],hu=[`x`,`y`,`fill`],gu=c({name:`Background`,compatConfig:{MODE:3},props:{id:{},variant:{default:()=>cu.Dots},gap:{default:20},size:{default:1},lineWidth:{default:1},patternColor:{},color:{},bgColor:{},height:{default:100},width:{default:100},x:{default:0},y:{default:0},offset:{default:0}},setup(e){let{id:t,viewport:n}=$(),s=y(()=>{let t=n.value.zoom,[r,i]=Array.isArray(e.gap)?e.gap:[e.gap,e.gap],a=[r*t||1,i*t||1],o=e.size*t,[s,c]=Array.isArray(e.offset)?e.offset:[e.offset,e.offset];return{scaledGap:a,offset:[s*t||1+a[0]/2,c*t||1+a[1]/2],size:o}}),c=r(()=>`pattern-${t}${e.id?`-${e.id}`:``}`),l=r(()=>e.color||e.patternColor||du[e.variant||cu.Dots]);return(e,t)=>(D(),L(`svg`,{class:`vue-flow__background vue-flow__container`,style:E({height:`${e.height>100?100:e.height}%`,width:`${e.width>100?100:e.width}%`})},[N(e.$slots,`pattern-container`,{id:c.value},()=>[a(`pattern`,{id:c.value,x:o(n).x%s.value.scaledGap[0],y:o(n).y%s.value.scaledGap[1],width:s.value.scaledGap[0],height:s.value.scaledGap[1],patternTransform:`translate(-${s.value.offset[0]},-${s.value.offset[1]})`,patternUnits:`userSpaceOnUse`},[N(e.$slots,`pattern`,{},()=>[e.variant===o(cu).Lines?(D(),i(o(lu),{key:0,size:e.lineWidth,color:l.value,dimensions:s.value.scaledGap},null,8,[`size`,`color`,`dimensions`])):e.variant===o(cu).Dots?(D(),i(o(uu),{key:1,color:l.value,radius:s.value.size/2},null,8,[`color`,`radius`])):p(``,!0),e.bgColor?(D(),L(`svg`,pu,[a(`rect`,{width:`100%`,height:`100%`,fill:e.bgColor},null,8,mu)])):p(``,!0)])],8,fu)]),a(`rect`,{x:e.x,y:e.y,width:`100%`,height:`100%`,fill:`url(#${c.value})`},null,8,hu),N(e.$slots,`default`,{id:c.value})],4))}});n(),B();var _u={name:`ControlButton`,compatConfig:{MODE:3}},vu=(e,t)=>{let n=e.__vccOpts||e;for(let[e,r]of t)n[e]=r;return n},yu={type:`button`,class:`vue-flow__controls-button`};function bu(e,t,n,r,i,a){return D(),L(`button`,yu,[N(e.$slots,`default`)])}var xu=vu(_u,[[`render`,bu]]),Su={xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 32 32`},Cu=[a(`path`,{d:`M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z`},null,-1)];function wu(e,t){return D(),L(`svg`,Su,Cu)}var Tu={render:wu},Eu={xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 32 5`},Du=[a(`path`,{d:`M0 0h32v4.2H0z`},null,-1)];function Ou(e,t){return D(),L(`svg`,Eu,Du)}var ku={render:Ou},Au={xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 32 30`},ju=[a(`path`,{d:`M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0 0 27.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94a.919.919 0 0 1-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z`},null,-1)];function Mu(e,t){return D(),L(`svg`,Au,ju)}var Nu={render:Mu},Pu={xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 25 32`},Fu=[a(`path`,{d:`M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 0 0 0 13.714v15.238A3.056 3.056 0 0 0 3.048 32h18.285a3.056 3.056 0 0 0 3.048-3.048V13.714a3.056 3.056 0 0 0-3.048-3.047zM12.19 24.533a3.056 3.056 0 0 1-3.047-3.047 3.056 3.056 0 0 1 3.047-3.048 3.056 3.056 0 0 1 3.048 3.048 3.056 3.056 0 0 1-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z`},null,-1)];function Iu(e,t){return D(),L(`svg`,Pu,Fu)}var Lu={render:Iu},Ru={xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 25 32`},zu=[a(`path`,{d:`M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 0 0 0 13.714v15.238A3.056 3.056 0 0 0 3.048 32h18.285a3.056 3.056 0 0 0 3.048-3.048V13.714a3.056 3.056 0 0 0-3.048-3.047zM12.19 24.533a3.056 3.056 0 0 1-3.047-3.047 3.056 3.056 0 0 1 3.047-3.048 3.056 3.056 0 0 1 3.048 3.048 3.056 3.056 0 0 1-3.048 3.047z`},null,-1)];function Bu(e,t){return D(),L(`svg`,Ru,zu)}var Vu={render:Bu},Hu=c({name:`Controls`,compatConfig:{MODE:3},props:{showZoom:{type:Boolean,default:!0},showFitView:{type:Boolean,default:!0},showInteractive:{type:Boolean,default:!0},fitViewParams:{},position:{default:()=>Co.BottomLeft}},emits:[`zoomIn`,`zoomOut`,`fitView`,`interactionChange`],setup(e,{emit:t}){let{nodesDraggable:n,nodesConnectable:a,elementsSelectable:s,setInteractive:c,zoomIn:l,zoomOut:u,fitView:d,viewport:f,minZoom:h,maxZoom:g}=$(),_=r(()=>n.value||a.value||s.value),v=r(()=>f.value.zoom<=h.value),y=r(()=>f.value.zoom>=g.value);function b(){l(),t(`zoomIn`)}function x(){u(),t(`zoomOut`)}function S(){d(e.fitViewParams),t(`fitView`)}function C(){c(!_.value),t(`interactionChange`,!_.value)}return(e,t)=>(D(),i(o(su),{class:`vue-flow__controls`,position:e.position},{default:j(()=>[N(e.$slots,`top`),e.showZoom?(D(),L(K,{key:0},[N(e.$slots,`control-zoom-in`,{},()=>[m(xu,{class:`vue-flow__controls-zoomin`,disabled:y.value,onClick:b},{default:j(()=>[N(e.$slots,`icon-zoom-in`,{},()=>[(D(),i(R(o(Tu))))])]),_:3},8,[`disabled`])]),N(e.$slots,`control-zoom-out`,{},()=>[m(xu,{class:`vue-flow__controls-zoomout`,disabled:v.value,onClick:x},{default:j(()=>[N(e.$slots,`icon-zoom-out`,{},()=>[(D(),i(R(o(ku))))])]),_:3},8,[`disabled`])])],64)):p(``,!0),e.showFitView?N(e.$slots,`control-fit-view`,{key:1},()=>[m(xu,{class:`vue-flow__controls-fitview`,onClick:S},{default:j(()=>[N(e.$slots,`icon-fit-view`,{},()=>[(D(),i(R(o(Nu))))])]),_:3})]):p(``,!0),e.showInteractive?N(e.$slots,`control-interactive`,{key:2},()=>[e.showInteractive?(D(),i(xu,{key:0,class:`vue-flow__controls-interactive`,onClick:C},{default:j(()=>[_.value?N(e.$slots,`icon-unlock`,{key:0},()=>[(D(),i(R(o(Vu))))]):p(``,!0),_.value?p(``,!0):N(e.$slots,`icon-lock`,{key:1},()=>[(D(),i(R(o(Lu))))])]),_:3})):p(``,!0)]):p(``,!0),N(e.$slots,`default`)]),_:3},8,[`position`]))}});n(),B(),h();var Uu={value:()=>{}};function Wu(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+``)||r in n||/[\s.]/.test(r))throw Error(`illegal type: `+r);n[r]=[]}return new Gu(n)}function Gu(e){this._=e}function Ku(e,t){return e.trim().split(/^|\s+/).map(function(e){var n=``,r=e.indexOf(`.`);if(r>=0&&(n=e.slice(r+1),e=e.slice(0,r)),e&&!t.hasOwnProperty(e))throw Error(`unknown type: `+e);return{type:e,name:n}})}Gu.prototype=Wu.prototype={constructor:Gu,on:function(e,t){var n=this._,r=Ku(e+``,n),i,a=-1,o=r.length;if(arguments.length<2){for(;++a<o;)if((i=(e=r[a]).type)&&(i=qu(n[i],e.name)))return i;return}if(t!=null&&typeof t!=`function`)throw Error(`invalid callback: `+t);for(;++a<o;)if(i=(e=r[a]).type)n[i]=Ju(n[i],e.name,t);else if(t==null)for(i in n)n[i]=Ju(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Gu(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=Array(i),r=0,i,a;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw Error(`unknown type: `+e);for(a=this._[e],r=0,i=a.length;r<i;++r)a[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw Error(`unknown type: `+e);for(var r=this._[e],i=0,a=r.length;i<a;++i)r[i].value.apply(t,n)}};function qu(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function Ju(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=Uu,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var Yu=`http://www.w3.org/1999/xhtml`,Xu={svg:`http://www.w3.org/2000/svg`,xhtml:Yu,xlink:`http://www.w3.org/1999/xlink`,xml:`http://www.w3.org/XML/1998/namespace`,xmlns:`http://www.w3.org/2000/xmlns/`};function Zu(e){var t=e+=``,n=t.indexOf(`:`);return n>=0&&(t=e.slice(0,n))!==`xmlns`&&(e=e.slice(n+1)),Xu.hasOwnProperty(t)?{space:Xu[t],local:e}:e}function Qu(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Yu&&t.documentElement.namespaceURI===Yu?t.createElement(e):t.createElementNS(n,e)}}function $u(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function ed(e){var t=Zu(e);return(t.local?$u:Qu)(t)}function td(){}function nd(e){return e==null?td:function(){return this.querySelector(e)}}function rd(e){typeof e!=`function`&&(e=nd(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=Array(o),c,l,u=0;u<o;++u)(c=a[u])&&(l=e.call(c,c.__data__,u,a))&&(`__data__`in c&&(l.__data__=c.__data__),s[u]=l);return new Kf(r,this._parents)}function id(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function ad(){return[]}function od(e){return e==null?ad:function(){return this.querySelectorAll(e)}}function sd(e){return function(){return id(e.apply(this,arguments))}}function cd(e){e=typeof e==`function`?sd(e):od(e);for(var t=this._groups,n=t.length,r=[],i=[],a=0;a<n;++a)for(var o=t[a],s=o.length,c,l=0;l<s;++l)(c=o[l])&&(r.push(e.call(c,c.__data__,l,o)),i.push(c));return new Kf(r,i)}function ld(e){return function(){return this.matches(e)}}function ud(e){return function(t){return t.matches(e)}}var dd=Array.prototype.find;function fd(e){return function(){return dd.call(this.children,e)}}function pd(){return this.firstElementChild}function md(e){return this.select(e==null?pd:fd(typeof e==`function`?e:ud(e)))}var hd=Array.prototype.filter;function gd(){return Array.from(this.children)}function _d(e){return function(){return hd.call(this.children,e)}}function vd(e){return this.selectAll(e==null?gd:_d(typeof e==`function`?e:ud(e)))}function yd(e){typeof e!=`function`&&(e=ld(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=[],c,l=0;l<o;++l)(c=a[l])&&e.call(c,c.__data__,l,a)&&s.push(c);return new Kf(r,this._parents)}function bd(e){return Array(e.length)}function xd(){return new Kf(this._enter||this._groups.map(bd),this._parents)}function Sd(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Sd.prototype={constructor:Sd,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 Cd(e){return function(){return e}}function wd(e,t,n,r,i,a){for(var o=0,s,c=t.length,l=a.length;o<l;++o)(s=t[o])?(s.__data__=a[o],r[o]=s):n[o]=new Sd(e,a[o]);for(;o<c;++o)(s=t[o])&&(i[o]=s)}function Td(e,t,n,r,i,a,o){var s,c,l=new Map,u=t.length,d=a.length,f=Array(u),p;for(s=0;s<u;++s)(c=t[s])&&(f[s]=p=o.call(c,c.__data__,s,t)+``,l.has(p)?i[s]=c:l.set(p,c));for(s=0;s<d;++s)p=o.call(e,a[s],s,a)+``,(c=l.get(p))?(r[s]=c,c.__data__=a[s],l.delete(p)):n[s]=new Sd(e,a[s]);for(s=0;s<u;++s)(c=t[s])&&l.get(f[s])===c&&(i[s]=c)}function Ed(e){return e.__data__}function Dd(e,t){if(!arguments.length)return Array.from(this,Ed);var n=t?Td:wd,r=this._parents,i=this._groups;typeof e!=`function`&&(e=Cd(e));for(var a=i.length,o=Array(a),s=Array(a),c=Array(a),l=0;l<a;++l){var u=r[l],d=i[l],f=d.length,p=Od(e.call(u,u&&u.__data__,l,r)),m=p.length,h=s[l]=Array(m),g=o[l]=Array(m);n(u,d,h,g,c[l]=Array(f),p,t);for(var _=0,v=0,y,b;_<m;++_)if(y=h[_]){for(_>=v&&(v=_+1);!(b=g[v])&&++v<m;);y._next=b||null}}return o=new Kf(o,r),o._enter=s,o._exit=c,o}function Od(e){return typeof e==`object`&&`length`in e?e:Array.from(e)}function kd(){return new Kf(this._exit||this._groups.map(bd),this._parents)}function Ad(e,t,n){var r=this.enter(),i=this,a=this.exit();return typeof e==`function`?(r=e(r),r&&=r.selection()):r=r.append(e+``),t!=null&&(i=t(i),i&&=i.selection()),n==null?a.remove():n(a),r&&i?r.merge(i).order():i}function jd(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,a=r.length,o=Math.min(i,a),s=Array(i),c=0;c<o;++c)for(var l=n[c],u=r[c],d=l.length,f=s[c]=Array(d),p,m=0;m<d;++m)(p=l[m]||u[m])&&(f[m]=p);for(;c<i;++c)s[c]=n[c];return new Kf(s,this._parents)}function Md(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],i=r.length-1,a=r[i],o;--i>=0;)(o=r[i])&&(a&&o.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(o,a),a=o);return this}function Nd(e){e||=Pd;function t(t,n){return t&&n?e(t.__data__,n.__data__):!t-!n}for(var n=this._groups,r=n.length,i=Array(r),a=0;a<r;++a){for(var o=n[a],s=o.length,c=i[a]=Array(s),l,u=0;u<s;++u)(l=o[u])&&(c[u]=l);c.sort(t)}return new Kf(i,this._parents).order()}function Pd(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function Fd(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function Id(){return Array.from(this)}function Ld(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length;i<a;++i){var o=r[i];if(o)return o}return null}function Rd(){let e=0;for(let t of this)++e;return e}function zd(){return!this.node()}function Bd(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i=t[n],a=0,o=i.length,s;a<o;++a)(s=i[a])&&e.call(s,s.__data__,a,i);return this}function Vd(e){return function(){this.removeAttribute(e)}}function Hd(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Ud(e,t){return function(){this.setAttribute(e,t)}}function Wd(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function Gd(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function Kd(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 qd(e,t){var n=Zu(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?Hd:Vd:typeof t==`function`?n.local?Kd:Gd:n.local?Wd:Ud)(n,t))}function Jd(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function Yd(e){return function(){this.style.removeProperty(e)}}function Xd(e,t,n){return function(){this.style.setProperty(e,t,n)}}function Zd(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function Qd(e,t,n){return arguments.length>1?this.each((t==null?Yd:typeof t==`function`?Zd:Xd)(e,t,n??``)):$d(this.node(),e)}function $d(e,t){return e.style.getPropertyValue(t)||Jd(e).getComputedStyle(e,null).getPropertyValue(t)}function ef(e){return function(){delete this[e]}}function tf(e,t){return function(){this[e]=t}}function nf(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function rf(e,t){return arguments.length>1?this.each((t==null?ef:typeof t==`function`?nf:tf)(e,t)):this.node()[e]}function af(e){return e.trim().split(/^|\s+/)}function of(e){return e.classList||new sf(e)}function sf(e){this._node=e,this._names=af(e.getAttribute(`class`)||``)}sf.prototype={add:function(e){this._names.indexOf(e)<0&&(this._names.push(e),this._node.setAttribute(`class`,this._names.join(` `)))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute(`class`,this._names.join(` `)))},contains:function(e){return this._names.indexOf(e)>=0}};function cf(e,t){for(var n=of(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function lf(e,t){for(var n=of(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function uf(e){return function(){cf(this,e)}}function df(e){return function(){lf(this,e)}}function ff(e,t){return function(){(t.apply(this,arguments)?cf:lf)(this,e)}}function pf(e,t){var n=af(e+``);if(arguments.length<2){for(var r=of(this.node()),i=-1,a=n.length;++i<a;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t==`function`?ff:t?uf:df)(n,t))}function mf(){this.textContent=``}function hf(e){return function(){this.textContent=e}}function gf(e){return function(){var t=e.apply(this,arguments);this.textContent=t??``}}function _f(e){return arguments.length?this.each(e==null?mf:(typeof e==`function`?gf:hf)(e)):this.node().textContent}function vf(){this.innerHTML=``}function yf(e){return function(){this.innerHTML=e}}function bf(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??``}}function xf(e){return arguments.length?this.each(e==null?vf:(typeof e==`function`?bf:yf)(e)):this.node().innerHTML}function Sf(){this.nextSibling&&this.parentNode.appendChild(this)}function Cf(){return this.each(Sf)}function wf(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Tf(){return this.each(wf)}function Ef(e){var t=typeof e==`function`?e:ed(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function Df(){return null}function Of(e,t){var n=typeof e==`function`?e:ed(e),r=t==null?Df:typeof t==`function`?t:nd(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function kf(){var e=this.parentNode;e&&e.removeChild(this)}function Af(){return this.each(kf)}function jf(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Mf(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Nf(e){return this.select(e?Mf:jf)}function Pf(e){return arguments.length?this.property(`__data__`,e):this.node().__data__}function Ff(e){return function(t){e.call(this,t,this.__data__)}}function If(e){return e.trim().split(/^|\s+/).map(function(e){var t=``,n=e.indexOf(`.`);return n>=0&&(t=e.slice(n+1),e=e.slice(0,n)),{type:e,name:t}})}function Lf(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,a;n<i;++n)a=t[n],(!e.type||a.type===e.type)&&a.name===e.name?this.removeEventListener(a.type,a.listener,a.options):t[++r]=a;++r?t.length=r:delete this.__on}}}function Rf(e,t,n){return function(){var r=this.__on,i,a=Ff(t);if(r){for(var o=0,s=r.length;o<s;++o)if((i=r[o]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=a,i.options=n),i.value=t;return}}this.addEventListener(e.type,a,n),i={type:e.type,name:e.name,value:t,listener:a,options:n},r?r.push(i):this.__on=[i]}}function zf(e,t,n){var r=If(e+``),i,a=r.length,o;if(arguments.length<2){var s=this.node().__on;if(s){for(var c=0,l=s.length,u;c<l;++c)for(i=0,u=s[c];i<a;++i)if((o=r[i]).type===u.type&&o.name===u.name)return u.value}return}for(s=t?Rf:Lf,i=0;i<a;++i)this.each(s(r[i],t,n));return this}function Bf(e,t,n){var r=Jd(e),i=r.CustomEvent;typeof i==`function`?i=new i(t,n):(i=r.document.createEvent(`Event`),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function Vf(e,t){return function(){return Bf(this,e,t)}}function Hf(e,t){return function(){return Bf(this,e,t.apply(this,arguments))}}function Uf(e,t){return this.each((typeof t==`function`?Hf:Vf)(e,t))}function*Wf(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length,o;i<a;++i)(o=r[i])&&(yield o)}var Gf=[null];function Kf(e,t){this._groups=e,this._parents=t}function qf(){return new Kf([[document.documentElement]],Gf)}function Jf(){return this}Kf.prototype=qf.prototype={constructor:Kf,select:rd,selectAll:cd,selectChild:md,selectChildren:vd,filter:yd,data:Dd,enter:xd,exit:kd,join:Ad,merge:jd,selection:Jf,order:Md,sort:Nd,call:Fd,nodes:Id,node:Ld,size:Rd,empty:zd,each:Bd,attr:qd,style:Qd,property:rf,classed:pf,text:_f,html:xf,raise:Cf,lower:Tf,append:Ef,insert:Of,remove:Af,clone:Nf,datum:Pf,on:zf,dispatch:Uf,[Symbol.iterator]:Wf};function Yf(e){return typeof e==`string`?new Kf([[document.querySelector(e)]],[document.documentElement]):new Kf([[e]],Gf)}function Xf(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Zf(e,t){if(e=Xf(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}var Qf={capture:!0,passive:!1};function $f(e){e.preventDefault(),e.stopImmediatePropagation()}function ep(e){var t=e.document.documentElement,n=Yf(e).on(`dragstart.drag`,$f,Qf);`onselectstart`in t?n.on(`selectstart.drag`,$f,Qf):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect=`none`)}function tp(e,t){var n=e.document.documentElement,r=Yf(e).on(`dragstart.drag`,null);t&&(r.on(`click.drag`,$f,Qf),setTimeout(function(){r.on(`click.drag`,null)},0)),`onselectstart`in n?r.on(`selectstart.drag`,null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}function np(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function rp(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function ip(){}var ap=.7,op=1/ap,sp=`\\s*([+-]?\\d+)\\s*`,cp=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*`,lp=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*`,up=/^#([0-9a-f]{3,8})$/,dp=RegExp(`^rgb\\(${sp},${sp},${sp}\\)$`),fp=RegExp(`^rgb\\(${lp},${lp},${lp}\\)$`),pp=RegExp(`^rgba\\(${sp},${sp},${sp},${cp}\\)$`),mp=RegExp(`^rgba\\(${lp},${lp},${lp},${cp}\\)$`),hp=RegExp(`^hsl\\(${cp},${lp},${lp}\\)$`),gp=RegExp(`^hsla\\(${cp},${lp},${lp},${cp}\\)$`),_p={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};np(ip,Sp,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:vp,formatHex:vp,formatHex8:yp,formatHsl:bp,formatRgb:xp,toString:xp});function vp(){return this.rgb().formatHex()}function yp(){return this.rgb().formatHex8()}function bp(){return Fp(this).formatHsl()}function xp(){return this.rgb().formatRgb()}function Sp(e){var t,n;return e=(e+``).trim().toLowerCase(),(t=up.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?Cp(t):n===3?new Dp(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?wp(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?wp(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=dp.exec(e))?new Dp(t[1],t[2],t[3],1):(t=fp.exec(e))?new Dp(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=pp.exec(e))?wp(t[1],t[2],t[3],t[4]):(t=mp.exec(e))?wp(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=hp.exec(e))?Pp(t[1],t[2]/100,t[3]/100,1):(t=gp.exec(e))?Pp(t[1],t[2]/100,t[3]/100,t[4]):_p.hasOwnProperty(e)?Cp(_p[e]):e===`transparent`?new Dp(NaN,NaN,NaN,0):null}function Cp(e){return new Dp(e>>16&255,e>>8&255,e&255,1)}function wp(e,t,n,r){return r<=0&&(e=t=n=NaN),new Dp(e,t,n,r)}function Tp(e){return e instanceof ip||(e=Sp(e)),e?(e=e.rgb(),new Dp(e.r,e.g,e.b,e.opacity)):new Dp}function Ep(e,t,n,r){return arguments.length===1?Tp(e):new Dp(e,t,n,r??1)}function Dp(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}np(Dp,Ep,rp(ip,{brighter(e){return e=e==null?op:op**+e,new Dp(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?ap:ap**+e,new Dp(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Dp(Mp(this.r),Mp(this.g),Mp(this.b),jp(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:Op,formatHex:Op,formatHex8:kp,formatRgb:Ap,toString:Ap}));function Op(){return`#${Np(this.r)}${Np(this.g)}${Np(this.b)}`}function kp(){return`#${Np(this.r)}${Np(this.g)}${Np(this.b)}${Np((isNaN(this.opacity)?1:this.opacity)*255)}`}function Ap(){let e=jp(this.opacity);return`${e===1?`rgb(`:`rgba(`}${Mp(this.r)}, ${Mp(this.g)}, ${Mp(this.b)}${e===1?`)`:`, ${e})`}`}function jp(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Mp(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Np(e){return e=Mp(e),(e<16?`0`:``)+e.toString(16)}function Pp(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Lp(e,t,n,r)}function Fp(e){if(e instanceof Lp)return new Lp(e.h,e.s,e.l,e.opacity);if(e instanceof ip||(e=Sp(e)),!e)return new Lp;if(e instanceof Lp)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=NaN,s=a-i,c=(a+i)/2;return s?(o=t===a?(n-r)/s+(n<r)*6:n===a?(r-t)/s+2:(t-n)/s+4,s/=c<.5?a+i:2-a-i,o*=60):s=c>0&&c<1?0:o,new Lp(o,s,c,e.opacity)}function Ip(e,t,n,r){return arguments.length===1?Fp(e):new Lp(e,t,n,r??1)}function Lp(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}np(Lp,Ip,rp(ip,{brighter(e){return e=e==null?op:op**+e,new Lp(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?ap:ap**+e,new Lp(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,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new Dp(Bp(e>=240?e-240:e+120,i,r),Bp(e,i,r),Bp(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Lp(Rp(this.h),zp(this.s),zp(this.l),jp(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(){let e=jp(this.opacity);return`${e===1?`hsl(`:`hsla(`}${Rp(this.h)}, ${zp(this.s)*100}%, ${zp(this.l)*100}%${e===1?`)`:`, ${e})`}`}}));function Rp(e){return e=(e||0)%360,e<0?e+360:e}function zp(e){return Math.max(0,Math.min(1,e||0))}function Bp(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}var Vp=e=>()=>e;function Hp(e,t){return function(n){return e+n*t}}function Up(e,t,n){return e**=+n,t=t**+n-e,n=1/n,function(r){return(e+r*t)**+n}}function Wp(e){return(e=+e)==1?Gp:function(t,n){return n-t?Up(t,n,e):Vp(isNaN(t)?n:t)}}function Gp(e,t){var n=t-e;return n?Hp(e,n):Vp(isNaN(e)?t:e)}var Kp=function e(t){var n=Wp(t);function r(e,t){var r=n((e=Ep(e)).r,(t=Ep(t)).r),i=n(e.g,t.g),a=n(e.b,t.b),o=Gp(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=a(t),e.opacity=o(t),e+``}}return r.gamma=e,r}(1);function qp(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}var Jp=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Yp=new RegExp(Jp.source,`g`);function Xp(e){return function(){return e}}function Zp(e){return function(t){return e(t)+``}}function Qp(e,t){var n=Jp.lastIndex=Yp.lastIndex=0,r,i,a,o=-1,s=[],c=[];for(e+=``,t+=``;(r=Jp.exec(e))&&(i=Yp.exec(t));)(a=i.index)>n&&(a=t.slice(n,a),s[o]?s[o]+=a:s[++o]=a),(r=r[0])===(i=i[0])?s[o]?s[o]+=i:s[++o]=i:(s[++o]=null,c.push({i:o,x:qp(r,i)})),n=Yp.lastIndex;return n<t.length&&(a=t.slice(n),s[o]?s[o]+=a:s[++o]=a),s.length<2?c[0]?Zp(c[0].x):Xp(t):(t=c.length,function(e){for(var n=0,r;n<t;++n)s[(r=c[n]).i]=r.x(e);return s.join(``)})}var $p=180/Math.PI,em={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function tm(e,t,n,r,i,a){var o,s,c;return(o=Math.sqrt(e*e+t*t))&&(e/=o,t/=o),(c=e*n+t*r)&&(n-=e*c,r-=t*c),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,c/=s),e*r<t*n&&(e=-e,t=-t,c=-c,o=-o),{translateX:i,translateY:a,rotate:Math.atan2(t,e)*$p,skewX:Math.atan(c)*$p,scaleX:o,scaleY:s}}var nm;function rm(e){let t=new(typeof DOMMatrix==`function`?DOMMatrix:WebKitCSSMatrix)(e+``);return t.isIdentity?em:tm(t.a,t.b,t.c,t.d,t.e,t.f)}function im(e){return e==null||(nm||=document.createElementNS(`http://www.w3.org/2000/svg`,`g`),nm.setAttribute(`transform`,e),!(e=nm.transform.baseVal.consolidate()))?em:(e=e.matrix,tm(e.a,e.b,e.c,e.d,e.e,e.f))}function am(e,t,n,r){function i(e){return e.length?e.pop()+` `:``}function a(e,r,i,a,o,s){if(e!==i||r!==a){var c=o.push(`translate(`,null,t,null,n);s.push({i:c-4,x:qp(e,i)},{i:c-2,x:qp(r,a)})}else(i||a)&&o.push(`translate(`+i+t+a+n)}function o(e,t,n,a){e===t?t&&n.push(i(n)+`rotate(`+t+r):(e-t>180?t+=360:t-e>180&&(e+=360),a.push({i:n.push(i(n)+`rotate(`,null,r)-2,x:qp(e,t)}))}function s(e,t,n,a){e===t?t&&n.push(i(n)+`skewX(`+t+r):a.push({i:n.push(i(n)+`skewX(`,null,r)-2,x:qp(e,t)})}function c(e,t,n,r,a,o){if(e!==n||t!==r){var s=a.push(i(a)+`scale(`,null,`,`,null,`)`);o.push({i:s-4,x:qp(e,n)},{i:s-2,x:qp(t,r)})}else(n!==1||r!==1)&&a.push(i(a)+`scale(`+n+`,`+r+`)`)}return function(t,n){var r=[],i=[];return t=e(t),n=e(n),a(t.translateX,t.translateY,n.translateX,n.translateY,r,i),o(t.rotate,n.rotate,r,i),s(t.skewX,n.skewX,r,i),c(t.scaleX,t.scaleY,n.scaleX,n.scaleY,r,i),t=n=null,function(e){for(var t=-1,n=i.length,a;++t<n;)r[(a=i[t]).i]=a.x(e);return r.join(``)}}}var om=am(rm,`px, `,`px)`,`deg)`),sm=am(im,`, `,`)`,`)`),cm=1e-12;function lm(e){return((e=Math.exp(e))+1/e)/2}function um(e){return((e=Math.exp(e))-1/e)/2}function dm(e){return((e=Math.exp(2*e))-1)/(e+1)}var fm=function e(t,n,r){function i(e,i){var a=e[0],o=e[1],s=e[2],c=i[0],l=i[1],u=i[2],d=c-a,f=l-o,p=d*d+f*f,m,h;if(p<cm)h=Math.log(u/s)/t,m=function(e){return[a+e*d,o+e*f,s*Math.exp(t*e*h)]};else{var g=Math.sqrt(p),_=(u*u-s*s+r*p)/(2*s*n*g),v=(u*u-s*s-r*p)/(2*u*n*g),y=Math.log(Math.sqrt(_*_+1)-_);h=(Math.log(Math.sqrt(v*v+1)-v)-y)/t,m=function(e){var r=e*h,i=lm(y),c=s/(n*g)*(i*dm(t*r+y)-um(y));return[a+c*d,o+c*f,s*i/lm(t*r+y)]}}return m.duration=h*1e3*t/Math.SQRT2,m}return i.rho=function(t){var n=Math.max(.001,+t),r=n*n;return e(n,r,r*r)},i}(Math.SQRT2,2,4),pm=0,mm=0,hm=0,gm=1e3,_m,vm,ym=0,bm=0,xm=0,Sm=typeof performance==`object`&&performance.now?performance:Date,Cm=typeof window==`object`&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function wm(){return bm||=(Cm(Tm),Sm.now()+xm)}function Tm(){bm=0}function Em(){this._call=this._time=this._next=null}Em.prototype=Dm.prototype={constructor:Em,restart:function(e,t,n){if(typeof e!=`function`)throw TypeError(`callback is not a function`);n=(n==null?wm():+n)+(t==null?0:+t),!this._next&&vm!==this&&(vm?vm._next=this:_m=this,vm=this),this._call=e,this._time=n,Mm()},stop:function(){this._call&&(this._call=null,this._time=1/0,Mm())}};function Dm(e,t,n){var r=new Em;return r.restart(e,t,n),r}function Om(){wm(),++pm;for(var e=_m,t;e;)(t=bm-e._time)>=0&&e._call.call(void 0,t),e=e._next;--pm}function km(){bm=(ym=Sm.now())+xm,pm=mm=0;try{Om()}finally{pm=0,jm(),bm=0}}function Am(){var e=Sm.now(),t=e-ym;t>gm&&(xm-=t,ym=e)}function jm(){for(var e,t=_m,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:_m=n);vm=e,Mm(r)}function Mm(e){pm||(mm&&=clearTimeout(mm),e-bm>24?(e<1/0&&(mm=setTimeout(km,e-Sm.now()-xm)),hm&&=clearInterval(hm)):(hm||=(ym=Sm.now(),setInterval(Am,gm)),pm=1,Cm(km)))}function Nm(e,t,n){var r=new Em;return t=t==null?0:+t,r.restart(n=>{r.stop(),e(n+t)},t,n),r}var Pm=Wu(`start`,`end`,`cancel`,`interrupt`),Fm=[],Im=0,Lm=1,Rm=2,zm=3,Bm=4,Vm=5,Hm=6;function Um(e,t,n,r,i,a){var o=e.__transition;if(!o)e.__transition={};else if(n in o)return;qm(e,n,{name:t,index:r,group:i,on:Pm,tween:Fm,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:Im})}function Wm(e,t){var n=Km(e,t);if(n.state>Im)throw Error(`too late; already scheduled`);return n}function Gm(e,t){var n=Km(e,t);if(n.state>zm)throw Error(`too late; already running`);return n}function Km(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw Error(`transition not found`);return n}function qm(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=Dm(a,0,n.time);function a(e){n.state=Lm,n.timer.restart(o,n.delay,n.time),n.delay<=e&&o(e-n.delay)}function o(a){var l,u,d,f;if(n.state!==Lm)return c();for(l in r)if(f=r[l],f.name===n.name){if(f.state===zm)return Nm(o);f.state===Bm?(f.state=Hm,f.timer.stop(),f.on.call(`interrupt`,e,e.__data__,f.index,f.group),delete r[l]):+l<t&&(f.state=Hm,f.timer.stop(),f.on.call(`cancel`,e,e.__data__,f.index,f.group),delete r[l])}if(Nm(function(){n.state===zm&&(n.state=Bm,n.timer.restart(s,n.delay,n.time),s(a))}),n.state=Rm,n.on.call(`start`,e,e.__data__,n.index,n.group),n.state===Rm){for(n.state=zm,i=Array(d=n.tween.length),l=0,u=-1;l<d;++l)(f=n.tween[l].value.call(e,e.__data__,n.index,n.group))&&(i[++u]=f);i.length=u+1}}function s(t){for(var r=t<n.duration?n.ease.call(null,t/n.duration):(n.timer.restart(c),n.state=Vm,1),a=-1,o=i.length;++a<o;)i[a].call(e,r);n.state===Vm&&(n.on.call(`end`,e,e.__data__,n.index,n.group),c())}function c(){for(var i in n.state=Hm,n.timer.stop(),delete r[t],r)return;delete e.__transition}}function Jm(e,t){var n=e.__transition,r,i,a=!0,o;if(n){for(o in t=t==null?null:t+``,n){if((r=n[o]).name!==t){a=!1;continue}i=r.state>Rm&&r.state<Vm,r.state=Hm,r.timer.stop(),r.on.call(i?`interrupt`:`cancel`,e,e.__data__,r.index,r.group),delete n[o]}a&&delete e.__transition}}function Ym(e){return this.each(function(){Jm(this,e)})}function Xm(e,t){var n,r;return function(){var i=Gm(this,e),a=i.tween;if(a!==n){r=n=a;for(var o=0,s=r.length;o<s;++o)if(r[o].name===t){r=r.slice(),r.splice(o,1);break}}i.tween=r}}function Zm(e,t,n){var r,i;if(typeof n!=`function`)throw Error();return function(){var a=Gm(this,e),o=a.tween;if(o!==r){i=(r=o).slice();for(var s={name:t,value:n},c=0,l=i.length;c<l;++c)if(i[c].name===t){i[c]=s;break}c===l&&i.push(s)}a.tween=i}}function Qm(e,t){var n=this._id;if(e+=``,arguments.length<2){for(var r=Km(this.node(),n).tween,i=0,a=r.length,o;i<a;++i)if((o=r[i]).name===e)return o.value;return null}return this.each((t==null?Xm:Zm)(n,e,t))}function $m(e,t,n){var r=e._id;return e.each(function(){var e=Gm(this,r);(e.value||={})[t]=n.apply(this,arguments)}),function(e){return Km(e,r).value[t]}}function eh(e,t){var n;return(typeof t==`number`?qp:t instanceof Sp?Kp:(n=Sp(t))?(t=n,Kp):Qp)(e,t)}function th(e){return function(){this.removeAttribute(e)}}function nh(e){return function(){this.removeAttributeNS(e.space,e.local)}}function rh(e,t,n){var r,i=n+``,a;return function(){var o=this.getAttribute(e);return o===i?null:o===r?a:a=t(r=o,n)}}function ih(e,t,n){var r,i=n+``,a;return function(){var o=this.getAttributeNS(e.space,e.local);return o===i?null:o===r?a:a=t(r=o,n)}}function ah(e,t,n){var r,i,a;return function(){var o,s=n(this),c;return s==null?void this.removeAttribute(e):(o=this.getAttribute(e),c=s+``,o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s)))}}function oh(e,t,n){var r,i,a;return function(){var o,s=n(this),c;return s==null?void this.removeAttributeNS(e.space,e.local):(o=this.getAttributeNS(e.space,e.local),c=s+``,o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s)))}}function sh(e,t){var n=Zu(e),r=n===`transform`?sm:eh;return this.attrTween(e,typeof t==`function`?(n.local?oh:ah)(n,r,$m(this,`attr.`+e,t)):t==null?(n.local?nh:th)(n):(n.local?ih:rh)(n,r,t))}function ch(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function lh(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function uh(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&lh(e,i)),n}return i._value=t,i}function dh(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&ch(e,i)),n}return i._value=t,i}function fh(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 Error();var r=Zu(e);return this.tween(n,(r.local?uh:dh)(r,t))}function ph(e,t){return function(){Wm(this,e).delay=+t.apply(this,arguments)}}function mh(e,t){return t=+t,function(){Wm(this,e).delay=t}}function hh(e){var t=this._id;return arguments.length?this.each((typeof e==`function`?ph:mh)(t,e)):Km(this.node(),t).delay}function gh(e,t){return function(){Gm(this,e).duration=+t.apply(this,arguments)}}function _h(e,t){return t=+t,function(){Gm(this,e).duration=t}}function vh(e){var t=this._id;return arguments.length?this.each((typeof e==`function`?gh:_h)(t,e)):Km(this.node(),t).duration}function yh(e,t){if(typeof t!=`function`)throw Error();return function(){Gm(this,e).ease=t}}function bh(e){var t=this._id;return arguments.length?this.each(yh(t,e)):Km(this.node(),t).ease}function xh(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!=`function`)throw Error();Gm(this,e).ease=n}}function Sh(e){if(typeof e!=`function`)throw Error();return this.each(xh(this._id,e))}function Ch(e){typeof e!=`function`&&(e=ld(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=[],c,l=0;l<o;++l)(c=a[l])&&e.call(c,c.__data__,l,a)&&s.push(c);return new Qh(r,this._parents,this._name,this._id)}function wh(e){if(e._id!==this._id)throw Error();for(var t=this._groups,n=e._groups,r=t.length,i=n.length,a=Math.min(r,i),o=Array(r),s=0;s<a;++s)for(var c=t[s],l=n[s],u=c.length,d=o[s]=Array(u),f,p=0;p<u;++p)(f=c[p]||l[p])&&(d[p]=f);for(;s<r;++s)o[s]=t[s];return new Qh(o,this._parents,this._name,this._id)}function Th(e){return(e+``).trim().split(/^|\s+/).every(function(e){var t=e.indexOf(`.`);return t>=0&&(e=e.slice(0,t)),!e||e===`start`})}function Eh(e,t,n){var r,i,a=Th(t)?Wm:Gm;return function(){var o=a(this,e),s=o.on;s!==r&&(i=(r=s).copy()).on(t,n),o.on=i}}function Dh(e,t){var n=this._id;return arguments.length<2?Km(this.node(),n).on.on(e):this.each(Eh(n,e,t))}function Oh(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function kh(){return this.on(`end.remove`,Oh(this._id))}function Ah(e){var t=this._name,n=this._id;typeof e!=`function`&&(e=nd(e));for(var r=this._groups,i=r.length,a=Array(i),o=0;o<i;++o)for(var s=r[o],c=s.length,l=a[o]=Array(c),u,d,f=0;f<c;++f)(u=s[f])&&(d=e.call(u,u.__data__,f,s))&&(`__data__`in u&&(d.__data__=u.__data__),l[f]=d,Um(l[f],t,n,f,l,Km(u,n)));return new Qh(a,this._parents,t,n)}function jh(e){var t=this._name,n=this._id;typeof e!=`function`&&(e=od(e));for(var r=this._groups,i=r.length,a=[],o=[],s=0;s<i;++s)for(var c=r[s],l=c.length,u,d=0;d<l;++d)if(u=c[d]){for(var f=e.call(u,u.__data__,d,c),p,m=Km(u,n),h=0,g=f.length;h<g;++h)(p=f[h])&&Um(p,t,n,h,f,m);a.push(f),o.push(u)}return new Qh(a,o,t,n)}var Mh=qf.prototype.constructor;function Nh(){return new Mh(this._groups,this._parents)}function Ph(e,t){var n,r,i;return function(){var a=$d(this,e),o=(this.style.removeProperty(e),$d(this,e));return a===o?null:a===n&&o===r?i:i=t(n=a,r=o)}}function Fh(e){return function(){this.style.removeProperty(e)}}function Ih(e,t,n){var r,i=n+``,a;return function(){var o=$d(this,e);return o===i?null:o===r?a:a=t(r=o,n)}}function Lh(e,t,n){var r,i,a;return function(){var o=$d(this,e),s=n(this),c=s+``;return s??(c=s=(this.style.removeProperty(e),$d(this,e))),o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s))}}function Rh(e,t){var n,r,i,a=`style.`+t,o=`end.`+a,s;return function(){var c=Gm(this,e),l=c.on,u=c.value[a]==null?s||=Fh(t):void 0;(l!==n||i!==u)&&(r=(n=l).copy()).on(o,i=u),c.on=r}}function zh(e,t,n){var r=(e+=``)==`transform`?om:eh;return t==null?this.styleTween(e,Ph(e,r)).on(`end.style.`+e,Fh(e)):typeof t==`function`?this.styleTween(e,Lh(e,r,$m(this,`style.`+e,t))).each(Rh(this._id,e)):this.styleTween(e,Ih(e,r,t),n).on(`end.style.`+e,null)}function Bh(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function Vh(e,t,n){var r,i;function a(){var a=t.apply(this,arguments);return a!==i&&(r=(i=a)&&Bh(e,a,n)),r}return a._value=t,a}function Hh(e,t,n){var r=`style.`+(e+=``);if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!=`function`)throw Error();return this.tween(r,Vh(e,t,n??``))}function Uh(e){return function(){this.textContent=e}}function Wh(e){return function(){var t=e(this);this.textContent=t??``}}function Gh(e){return this.tween(`text`,typeof e==`function`?Wh($m(this,`text`,e)):Uh(e==null?``:e+``))}function Kh(e){return function(t){this.textContent=e.call(this,t)}}function qh(e){var t,n;function r(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&Kh(r)),t}return r._value=e,r}function Jh(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 Error();return this.tween(t,qh(e))}function Yh(){for(var e=this._name,t=this._id,n=$h(),r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],s=o.length,c,l=0;l<s;++l)if(c=o[l]){var u=Km(c,t);Um(c,e,n,l,o,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new Qh(r,this._parents,e,n)}function Xh(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(a,o){var s={value:o},c={value:function(){--i===0&&a()}};n.each(function(){var n=Gm(this,r),i=n.on;i!==e&&(t=(e=i).copy(),t._.cancel.push(s),t._.interrupt.push(s),t._.end.push(c)),n.on=t}),i===0&&a()})}var Zh=0;function Qh(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function $h(){return++Zh}var eg=qf.prototype;Qh.prototype={constructor:Qh,select:Ah,selectAll:jh,selectChild:eg.selectChild,selectChildren:eg.selectChildren,filter:Ch,merge:wh,selection:Nh,transition:Yh,call:eg.call,nodes:eg.nodes,node:eg.node,size:eg.size,empty:eg.empty,each:eg.each,on:Dh,attr:sh,attrTween:fh,style:zh,styleTween:Hh,text:Gh,textTween:Jh,remove:kh,tween:Qm,delay:hh,duration:vh,ease:bh,easeVarying:Sh,end:Xh,[Symbol.iterator]:eg[Symbol.iterator]};function tg(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var ng={time:null,delay:0,duration:250,ease:tg};function rg(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw Error(`transition ${t} not found`);return n}function ig(e){var t,n;e instanceof Qh?(t=e._id,e=e._name):(t=$h(),(n=ng).time=wm(),e=e==null?null:e+``);for(var r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],s=o.length,c,l=0;l<s;++l)(c=o[l])&&Um(c,e,t,l,o,n||rg(c,t));return new Qh(r,this._parents,e,t)}qf.prototype.interrupt=Ym,qf.prototype.transition=ig;var ag=e=>()=>e;function og(e,{sourceEvent:t,target:n,transform:r,dispatch:i}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:i}})}function sg(e,t,n){this.k=e,this.x=t,this.y=n}sg.prototype={constructor:sg,scale:function(e){return e===1?this:new sg(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new sg(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 cg=new sg(1,0,0);sg.prototype;function lg(e){e.stopImmediatePropagation()}function ug(e){e.preventDefault(),e.stopImmediatePropagation()}function dg(e){return(!e.ctrlKey||e.type===`wheel`)&&!e.button}function fg(){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 pg(){return this.__zoom||cg}function mg(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function hg(){return navigator.maxTouchPoints||`ontouchstart`in this}function gg(e,t,n){var r=e.invertX(t[0][0])-n[0][0],i=e.invertX(t[1][0])-n[1][0],a=e.invertY(t[0][1])-n[0][1],o=e.invertY(t[1][1])-n[1][1];return e.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),o>a?(a+o)/2:Math.min(0,a)||Math.max(0,o))}function _g(){var e=dg,t=fg,n=gg,r=mg,i=hg,a=[0,1/0],o=[[-1/0,-1/0],[1/0,1/0]],s=250,c=fm,l=Wu(`start`,`zoom`,`end`),u,d,f,p=500,m=150,h=0,g=10;function _(e){e.property(`__zoom`,pg).on(`wheel.zoom`,w,{passive:!1}).on(`mousedown.zoom`,T).on(`dblclick.zoom`,E).filter(i).on(`touchstart.zoom`,D).on(`touchmove.zoom`,O).on(`touchend.zoom touchcancel.zoom`,k).style(`-webkit-tap-highlight-color`,`rgba(0,0,0,0)`)}_.transform=function(e,t,n,r){var i=e.selection?e.selection():e;i.property(`__zoom`,pg),e===i?i.interrupt().each(function(){S(this,arguments).event(r).start().zoom(null,typeof t==`function`?t.apply(this,arguments):t).end()}):x(e,t,n,r)},_.scaleBy=function(e,t,n,r){_.scaleTo(e,function(){return this.__zoom.k*(typeof t==`function`?t.apply(this,arguments):t)},n,r)},_.scaleTo=function(e,r,i,a){_.transform(e,function(){var e=t.apply(this,arguments),a=this.__zoom,s=i==null?b(e):typeof i==`function`?i.apply(this,arguments):i,c=a.invert(s),l=typeof r==`function`?r.apply(this,arguments):r;return n(y(v(a,l),s,c),e,o)},i,a)},_.translateBy=function(e,r,i,a){_.transform(e,function(){return n(this.__zoom.translate(typeof r==`function`?r.apply(this,arguments):r,typeof i==`function`?i.apply(this,arguments):i),t.apply(this,arguments),o)},null,a)},_.translateTo=function(e,r,i,a,s){_.transform(e,function(){var e=t.apply(this,arguments),s=this.__zoom,c=a==null?b(e):typeof a==`function`?a.apply(this,arguments):a;return n(cg.translate(c[0],c[1]).scale(s.k).translate(typeof r==`function`?-r.apply(this,arguments):-r,typeof i==`function`?-i.apply(this,arguments):-i),e,o)},a,s)};function v(e,t){return t=Math.max(a[0],Math.min(a[1],t)),t===e.k?e:new sg(t,e.x,e.y)}function y(e,t,n){var r=t[0]-n[0]*e.k,i=t[1]-n[1]*e.k;return r===e.x&&i===e.y?e:new sg(e.k,r,i)}function b(e){return[(+e[0][0]+ +e[1][0])/2,(+e[0][1]+ +e[1][1])/2]}function x(e,n,r,i){e.on(`start.zoom`,function(){S(this,arguments).event(i).start()}).on(`interrupt.zoom end.zoom`,function(){S(this,arguments).event(i).end()}).tween(`zoom`,function(){var e=this,a=arguments,o=S(e,a).event(i),s=t.apply(e,a),l=r==null?b(s):typeof r==`function`?r.apply(e,a):r,u=Math.max(s[1][0]-s[0][0],s[1][1]-s[0][1]),d=e.__zoom,f=typeof n==`function`?n.apply(e,a):n,p=c(d.invert(l).concat(u/d.k),f.invert(l).concat(u/f.k));return function(e){if(e===1)e=f;else{var t=p(e),n=u/t[2];e=new sg(n,l[0]-t[0]*n,l[1]-t[1]*n)}o.zoom(null,e)}})}function S(e,t,n){return!n&&e.__zooming||new C(e,t)}function C(e,n){this.that=e,this.args=n,this.active=0,this.sourceEvent=null,this.extent=t.apply(e,n),this.taps=0}C.prototype={event:function(e){return e&&(this.sourceEvent=e),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit(`start`)),this},zoom:function(e,t){return this.mouse&&e!==`mouse`&&(this.mouse[1]=t.invert(this.mouse[0])),this.touch0&&e!==`touch`&&(this.touch0[1]=t.invert(this.touch0[0])),this.touch1&&e!==`touch`&&(this.touch1[1]=t.invert(this.touch1[0])),this.that.__zoom=t,this.emit(`zoom`),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit(`end`)),this},emit:function(e){var t=Yf(this.that).datum();l.call(e,this.that,new og(e,{sourceEvent:this.sourceEvent,target:_,type:e,transform:this.that.__zoom,dispatch:l}),t)}};function w(t,...i){if(!e.apply(this,arguments))return;var s=S(this,i).event(t),c=this.__zoom,l=Math.max(a[0],Math.min(a[1],c.k*2**r.apply(this,arguments))),u=Zf(t);if(s.wheel)(s.mouse[0][0]!==u[0]||s.mouse[0][1]!==u[1])&&(s.mouse[1]=c.invert(s.mouse[0]=u)),clearTimeout(s.wheel);else if(c.k===l)return;else s.mouse=[u,c.invert(u)],Jm(this),s.start();ug(t),s.wheel=setTimeout(d,m),s.zoom(`mouse`,n(y(v(c,l),s.mouse[0],s.mouse[1]),s.extent,o));function d(){s.wheel=null,s.end()}}function T(t,...r){if(f||!e.apply(this,arguments))return;var i=t.currentTarget,a=S(this,r,!0).event(t),s=Yf(t.view).on(`mousemove.zoom`,d,!0).on(`mouseup.zoom`,p,!0),c=Zf(t,i),l=t.clientX,u=t.clientY;ep(t.view),lg(t),a.mouse=[c,this.__zoom.invert(c)],Jm(this),a.start();function d(e){if(ug(e),!a.moved){var t=e.clientX-l,r=e.clientY-u;a.moved=t*t+r*r>h}a.event(e).zoom(`mouse`,n(y(a.that.__zoom,a.mouse[0]=Zf(e,i),a.mouse[1]),a.extent,o))}function p(e){s.on(`mousemove.zoom mouseup.zoom`,null),tp(e.view,a.moved),ug(e),a.event(e).end()}}function E(r,...i){if(e.apply(this,arguments)){var a=this.__zoom,c=Zf(r.changedTouches?r.changedTouches[0]:r,this),l=a.invert(c),u=a.k*(r.shiftKey?.5:2),d=n(y(v(a,u),c,l),t.apply(this,i),o);ug(r),s>0?Yf(this).transition().duration(s).call(x,d,c,r):Yf(this).call(_.transform,d,c,r)}}function D(t,...n){if(e.apply(this,arguments)){var r=t.touches,i=r.length,a=S(this,n,t.changedTouches.length===i).event(t),o,s,c,l;for(lg(t),s=0;s<i;++s)c=r[s],l=Zf(c,this),l=[l,this.__zoom.invert(l),c.identifier],a.touch0?!a.touch1&&a.touch0[2]!==l[2]&&(a.touch1=l,a.taps=0):(a.touch0=l,o=!0,a.taps=1+!!u);u&&=clearTimeout(u),o&&(a.taps<2&&(d=l[0],u=setTimeout(function(){u=null},p)),Jm(this),a.start())}}function O(e,...t){if(this.__zooming){var r=S(this,t).event(e),i=e.changedTouches,a=i.length,s,c,l,u;for(ug(e),s=0;s<a;++s)c=i[s],l=Zf(c,this),r.touch0&&r.touch0[2]===c.identifier?r.touch0[0]=l:r.touch1&&r.touch1[2]===c.identifier&&(r.touch1[0]=l);if(c=r.that.__zoom,r.touch1){var d=r.touch0[0],f=r.touch0[1],p=r.touch1[0],m=r.touch1[1],h=(h=p[0]-d[0])*h+(h=p[1]-d[1])*h,g=(g=m[0]-f[0])*g+(g=m[1]-f[1])*g;c=v(c,Math.sqrt(h/g)),l=[(d[0]+p[0])/2,(d[1]+p[1])/2],u=[(f[0]+m[0])/2,(f[1]+m[1])/2]}else if(r.touch0)l=r.touch0[0],u=r.touch0[1];else return;r.zoom(`touch`,n(y(c,l,u),r.extent,o))}}function k(e,...t){if(this.__zooming){var n=S(this,t).event(e),r=e.changedTouches,i=r.length,a,o;for(lg(e),f&&clearTimeout(f),f=setTimeout(function(){f=null},p),a=0;a<i;++a)o=r[a],n.touch0&&n.touch0[2]===o.identifier?delete n.touch0:n.touch1&&n.touch1[2]===o.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&&(o=Zf(o,this),Math.hypot(d[0]-o[0],d[1]-o[1])<g)){var s=Yf(this).on(`dblclick.zoom`);s&&s.apply(this,arguments)}}}return _.wheelDelta=function(e){return arguments.length?(r=typeof e==`function`?e:ag(+e),_):r},_.filter=function(t){return arguments.length?(e=typeof t==`function`?t:ag(!!t),_):e},_.touchable=function(e){return arguments.length?(i=typeof e==`function`?e:ag(!!e),_):i},_.extent=function(e){return arguments.length?(t=typeof e==`function`?e:ag([[+e[0][0],+e[0][1]],[+e[1][0],+e[1][1]]]),_):t},_.scaleExtent=function(e){return arguments.length?(a[0]=+e[0],a[1]=+e[1],_):[a[0],a[1]]},_.translateExtent=function(e){return arguments.length?(o[0][0]=+e[0][0],o[1][0]=+e[1][0],o[0][1]=+e[0][1],o[1][1]=+e[1][1],_):[[o[0][0],o[0][1]],[o[1][0],o[1][1]]]},_.constrain=function(e){return arguments.length?(n=e,_):n},_.duration=function(e){return arguments.length?(s=+e,_):s},_.interpolate=function(e){return arguments.length?(c=e,_):c},_.on=function(){var e=l.on.apply(l,arguments);return e===l?_:e},_.clickDistance=function(e){return arguments.length?(h=(e=+e)*e,_):Math.sqrt(h)},_.tapDistance=function(e){return arguments.length?(g=+e,_):g},_}var vg=Symbol(`MiniMapSlots`),yg=[`id`,`x`,`y`,`rx`,`ry`,`width`,`height`,`fill`,`stroke`,`stroke-width`,`shape-rendering`],bg=c({name:`MiniMapNode`,compatConfig:{MODE:3},inheritAttrs:!1,props:{id:{},type:{},selected:{type:Boolean},dragging:{type:Boolean},position:{},dimensions:{},borderRadius:{},color:{},shapeRendering:{},strokeColor:{},strokeWidth:{},hidden:{type:Boolean}},emits:[`click`,`dblclick`,`mouseenter`,`mousemove`,`mouseleave`],setup(e,{emit:t}){let n=e,a=S(vg),s=U(),c=r(()=>s.style??{});function u(e){t(`click`,e)}function d(e){t(`dblclick`,e)}function f(e){t(`mouseenter`,e)}function m(e){t(`mousemove`,e)}function h(e){t(`mouseleave`,e)}return(e,t)=>!e.hidden&&e.dimensions.width!==0&&e.dimensions.height!==0?(D(),L(K,{key:0},[o(a)[`node-${n.type}`]?(D(),i(R(o(a)[`node-${n.type}`]),l(x({key:0},{...n,...e.$attrs})),null,16)):(D(),L(`rect`,x({key:1,id:e.id},e.$attrs,{class:[`vue-flow__minimap-node`,{selected:e.selected,dragging:e.dragging}],x:e.position.x,y:e.position.y,rx:e.borderRadius,ry:e.borderRadius,width:e.dimensions.width,height:e.dimensions.height,fill:e.color||c.value.background||c.value.backgroundColor,stroke:e.strokeColor,"stroke-width":e.strokeWidth,"shape-rendering":e.shapeRendering,onClick:u,onDblclick:d,onMouseenter:f,onMousemove:m,onMouseleave:h}),null,16,yg))],64)):p(``,!0)}}),xg=[`width`,`height`,`viewBox`,`aria-labelledby`],Sg=[`id`],Cg=[`d`,`fill`,`stroke`,`stroke-width`],wg=c({name:`MiniMap`,compatConfig:{MODE:3},props:{nodeColor:{type:[String,Function],default:`#e2e2e2`},nodeStrokeColor:{type:[String,Function],default:`transparent`},nodeClassName:{type:[String,Function]},nodeBorderRadius:{default:5},nodeStrokeWidth:{default:2},maskColor:{default:`rgb(240, 240, 240, 0.6)`},maskStrokeColor:{default:`none`},maskStrokeWidth:{default:1},position:{default:`bottom-right`},pannable:{type:Boolean,default:!1},zoomable:{type:Boolean,default:!1},width:{},height:{},ariaLabel:{default:`Vue Flow mini map`},inversePan:{type:Boolean,default:!1},zoomStep:{default:1},offsetScale:{default:5},maskBorderRadius:{default:0}},emits:[`click`,`nodeClick`,`nodeDblclick`,`nodeMouseenter`,`nodeMousemove`,`nodeMouseleave`],setup(t,{emit:n}){let s=k(),c=U(),{id:l,edges:u,viewport:d,translateExtent:f,dimensions:m,emits:h,d3Selection:v,d3Zoom:b,getNodesInitialized:x}=$(),S=A();g(vg,s);let C=r(()=>t.width??c.style?.width??200),w=r(()=>t.height??c.style?.height??150),T=typeof window>`u`||window.chrome?`crispEdges`:`geometricPrecision`,O=y(()=>typeof t.nodeColor==`string`?()=>t.nodeColor:t.nodeColor),M=y(()=>typeof t.nodeStrokeColor==`string`?()=>t.nodeStrokeColor:t.nodeStrokeColor),N=y(()=>typeof t.nodeClassName==`string`?()=>t.nodeClassName:typeof t.nodeClassName==`function`?t.nodeClassName:()=>``),P=y(()=>ss(x.value.filter(e=>!e.hidden))),F=y(()=>({x:-d.value.x/d.value.zoom,y:-d.value.y/d.value.zoom,width:m.value.width/d.value.zoom,height:m.value.height/d.value.zoom})),I=y(()=>x.value&&x.value.length?os(P.value,F.value):F.value),R=y(()=>{let e=I.value.width/C.value,t=I.value.height/w.value;return Math.max(e,t)}),z=y(()=>{let e=R.value*C.value,n=R.value*w.value,r=t.offsetScale*R.value;return{offset:r,x:I.value.x-(e-I.value.width)/2-r,y:I.value.y-(n-I.value.height)/2-r,width:e+r*2,height:n+r*2}}),B=y(()=>!z.value.x||!z.value.y?``:`
|
|
27
|
-
M${z.value.x-z.value.offset},${z.value.y-z.value.offset}
|
|
28
|
-
h${z.value.width+z.value.offset*2}
|
|
29
|
-
v${z.value.height+z.value.offset*2}
|
|
30
|
-
h${-z.value.width-z.value.offset*2}z
|
|
31
|
-
M${F.value.x+t.maskBorderRadius},${F.value.y}
|
|
32
|
-
h${F.value.width-2*t.maskBorderRadius}
|
|
33
|
-
a${t.maskBorderRadius},${t.maskBorderRadius} 0 0 1 ${t.maskBorderRadius},${t.maskBorderRadius}
|
|
34
|
-
v${F.value.height-2*t.maskBorderRadius}
|
|
35
|
-
a${t.maskBorderRadius},${t.maskBorderRadius} 0 0 1 -${t.maskBorderRadius},${t.maskBorderRadius}
|
|
36
|
-
h${-(F.value.width-2*t.maskBorderRadius)}
|
|
37
|
-
a${t.maskBorderRadius},${t.maskBorderRadius} 0 0 1 -${t.maskBorderRadius},-${t.maskBorderRadius}
|
|
38
|
-
v${-(F.value.height-2*t.maskBorderRadius)}
|
|
39
|
-
a${t.maskBorderRadius},${t.maskBorderRadius} 0 0 1 ${t.maskBorderRadius},-${t.maskBorderRadius}z`);W(e=>{if(S.value){let n=Yf(S.value),r=_g().wheelDelta(e=>_s(e)*(t.zoomStep/10)).on(`zoom`,t.pannable?e=>{if(e.sourceEvent.type!==`mousemove`||!v.value||!b.value)return;let n=R.value*Math.max(1,d.value.zoom)*(t.inversePan?-1:1),r={x:d.value.x-e.sourceEvent.movementX*n,y:d.value.y-e.sourceEvent.movementY*n},i=[[0,0],[m.value.width,m.value.height]],a=cg.translate(r.x,r.y).scale(d.value.zoom),o=b.value.constrain()(a,i,f.value);b.value.transform(v.value,o)}:()=>{}).on(`zoom.wheel`,t.zoomable?e=>{if(e.sourceEvent.type!==`wheel`||!v.value||!b.value)return;let n=e.sourceEvent.ctrlKey&&Ws()?10:1,r=-e.sourceEvent.deltaY*(e.sourceEvent.deltaMode===1?.05:e.sourceEvent.deltaMode?1:.002)*t.zoomStep,i=d.value.zoom*2**(r*n);b.value.scaleTo(v.value,i)}:()=>{});n.call(r),e(()=>{n.on(`zoom`,null)})}},{flush:`post`});function V(e){let[t,r]=Zf(e);n(`click`,{event:e,position:{x:t,y:r}})}function ee(e,t){let r={event:e,node:t,connectedEdges:ls([t],u.value)};h.miniMapNodeClick(r),n(`nodeClick`,r)}function G(e,t){let r={event:e,node:t,connectedEdges:ls([t],u.value)};h.miniMapNodeDoubleClick(r),n(`nodeDblclick`,r)}function te(e,t){let r={event:e,node:t,connectedEdges:ls([t],u.value)};h.miniMapNodeMouseEnter(r),n(`nodeMouseenter`,r)}function ne(e,t){let r={event:e,node:t,connectedEdges:ls([t],u.value)};h.miniMapNodeMouseMove(r),n(`nodeMousemove`,r)}function q(e,t){let r={event:e,node:t,connectedEdges:ls([t],u.value)};h.miniMapNodeMouseLeave(r),n(`nodeMouseleave`,r)}return(t,n)=>(D(),i(o(su),{position:t.position,class:H([`vue-flow__minimap`,{pannable:t.pannable,zoomable:t.zoomable}])},{default:j(()=>[(D(),L(`svg`,{ref_key:`el`,ref:S,width:C.value,height:w.value,viewBox:[z.value.x,z.value.y,z.value.width,z.value.height].join(` `),role:`img`,"aria-labelledby":`vue-flow__minimap-${o(l)}`,onClick:V},[t.ariaLabel?(D(),L(`title`,{key:0,id:`vue-flow__minimap-${o(l)}`},_(t.ariaLabel),9,Sg)):p(``,!0),(D(!0),L(K,null,e(o(x),e=>(D(),i(bg,{id:e.id,key:e.id,f:``,position:e.computedPosition,dimensions:e.dimensions,selected:e.selected,dragging:e.dragging,style:E(e.style),class:H(N.value(e)),color:O.value(e),"border-radius":t.nodeBorderRadius,"stroke-color":M.value(e),"stroke-width":t.nodeStrokeWidth,"shape-rendering":o(T),type:e.type,hidden:e.hidden,onClick:t=>ee(t,e),onDblclick:t=>G(t,e),onMouseenter:t=>te(t,e),onMousemove:t=>ne(t,e),onMouseleave:t=>q(t,e)},null,8,[`id`,`position`,`dimensions`,`selected`,`dragging`,`style`,`class`,`color`,`border-radius`,`stroke-color`,`stroke-width`,`shape-rendering`,`type`,`hidden`,`onClick`,`onDblclick`,`onMouseenter`,`onMousemove`,`onMouseleave`]))),128)),a(`path`,{class:`vue-flow__minimap-mask`,d:B.value,fill:t.maskColor,stroke:t.maskStrokeColor,"stroke-width":t.maskStrokeWidth,"fill-rule":`evenodd`},null,8,Cg)],8,xg))]),_:1},8,[`position`,`class`]))}});export{xo as a,qc as c,gu as i,$ as l,Hu as n,J as o,cu as r,ou as s,wg as t};
|