jinn-cli 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin/jimmy.d.ts +3 -0
- package/dist/bin/jimmy.d.ts.map +1 -0
- package/dist/bin/jimmy.js +148 -0
- package/dist/bin/jimmy.js.map +1 -0
- package/dist/src/cli/chrome-allow.d.ts +5 -0
- package/dist/src/cli/chrome-allow.d.ts.map +1 -0
- package/dist/src/cli/chrome-allow.js +241 -0
- package/dist/src/cli/chrome-allow.js.map +1 -0
- package/dist/src/cli/create.d.ts +2 -0
- package/dist/src/cli/create.d.ts.map +1 -0
- package/dist/src/cli/create.js +72 -0
- package/dist/src/cli/create.js.map +1 -0
- package/dist/src/cli/instances.d.ts +14 -0
- package/dist/src/cli/instances.d.ts.map +1 -0
- package/dist/src/cli/instances.js +43 -0
- package/dist/src/cli/instances.js.map +1 -0
- package/dist/src/cli/list.d.ts +2 -0
- package/dist/src/cli/list.d.ts.map +1 -0
- package/dist/src/cli/list.js +38 -0
- package/dist/src/cli/list.js.map +1 -0
- package/dist/src/cli/migrate.d.ts +5 -0
- package/dist/src/cli/migrate.d.ts.map +1 -0
- package/dist/src/cli/migrate.js +203 -0
- package/dist/src/cli/migrate.js.map +1 -0
- package/dist/src/cli/nuke.d.ts +2 -0
- package/dist/src/cli/nuke.d.ts.map +1 -0
- package/dist/src/cli/nuke.js +91 -0
- package/dist/src/cli/nuke.js.map +1 -0
- package/dist/src/cli/remove.d.ts +4 -0
- package/dist/src/cli/remove.d.ts.map +1 -0
- package/dist/src/cli/remove.js +47 -0
- package/dist/src/cli/remove.js.map +1 -0
- package/dist/src/cli/setup.d.ts +4 -0
- package/dist/src/cli/setup.d.ts.map +1 -0
- package/dist/src/cli/setup.js +483 -0
- package/dist/src/cli/setup.js.map +1 -0
- package/dist/src/cli/skills.d.ts +28 -0
- package/dist/src/cli/skills.d.ts.map +1 -0
- package/dist/src/cli/skills.js +284 -0
- package/dist/src/cli/skills.js.map +1 -0
- package/dist/src/cli/start.d.ts +5 -0
- package/dist/src/cli/start.d.ts.map +1 -0
- package/dist/src/cli/start.js +34 -0
- package/dist/src/cli/start.js.map +1 -0
- package/dist/src/cli/status.d.ts +2 -0
- package/dist/src/cli/status.d.ts.map +1 -0
- package/dist/src/cli/status.js +60 -0
- package/dist/src/cli/status.js.map +1 -0
- package/dist/src/cli/stop.d.ts +2 -0
- package/dist/src/cli/stop.d.ts.map +1 -0
- package/dist/src/cli/stop.js +11 -0
- package/dist/src/cli/stop.js.map +1 -0
- package/dist/src/connectors/slack/format.d.ts +10 -0
- package/dist/src/connectors/slack/format.d.ts.map +1 -0
- package/dist/src/connectors/slack/format.js +55 -0
- package/dist/src/connectors/slack/format.js.map +1 -0
- package/dist/src/connectors/slack/index.d.ts +18 -0
- package/dist/src/connectors/slack/index.d.ts.map +1 -0
- package/dist/src/connectors/slack/index.js +122 -0
- package/dist/src/connectors/slack/index.js.map +1 -0
- package/dist/src/connectors/slack/threads.d.ts +2 -0
- package/dist/src/connectors/slack/threads.d.ts.map +1 -0
- package/dist/src/connectors/slack/threads.js +10 -0
- package/dist/src/connectors/slack/threads.js.map +1 -0
- package/dist/src/cron/jobs.d.ts +5 -0
- package/dist/src/cron/jobs.d.ts.map +1 -0
- package/dist/src/cron/jobs.js +23 -0
- package/dist/src/cron/jobs.js.map +1 -0
- package/dist/src/cron/runner.d.ts +3 -0
- package/dist/src/cron/runner.d.ts.map +1 -0
- package/dist/src/cron/runner.js +118 -0
- package/dist/src/cron/runner.js.map +1 -0
- package/dist/src/cron/scheduler.d.ts +5 -0
- package/dist/src/cron/scheduler.d.ts.map +1 -0
- package/dist/src/cron/scheduler.js +39 -0
- package/dist/src/cron/scheduler.js.map +1 -0
- package/dist/src/engines/claude.d.ts +14 -0
- package/dist/src/engines/claude.d.ts.map +1 -0
- package/dist/src/engines/claude.js +264 -0
- package/dist/src/engines/claude.js.map +1 -0
- package/dist/src/engines/codex.d.ts +15 -0
- package/dist/src/engines/codex.d.ts.map +1 -0
- package/dist/src/engines/codex.js +346 -0
- package/dist/src/engines/codex.js.map +1 -0
- package/dist/src/gateway/api.d.ts +13 -0
- package/dist/src/gateway/api.d.ts.map +1 -0
- package/dist/src/gateway/api.js +819 -0
- package/dist/src/gateway/api.js.map +1 -0
- package/dist/src/gateway/daemon-entry.d.ts +2 -0
- package/dist/src/gateway/daemon-entry.d.ts.map +1 -0
- package/dist/src/gateway/daemon-entry.js +12 -0
- package/dist/src/gateway/daemon-entry.js.map +1 -0
- package/dist/src/gateway/lifecycle.d.ts +10 -0
- package/dist/src/gateway/lifecycle.d.ts.map +1 -0
- package/dist/src/gateway/lifecycle.js +124 -0
- package/dist/src/gateway/lifecycle.js.map +1 -0
- package/dist/src/gateway/org.d.ts +10 -0
- package/dist/src/gateway/org.d.ts.map +1 -0
- package/dist/src/gateway/org.js +71 -0
- package/dist/src/gateway/org.js.map +1 -0
- package/dist/src/gateway/server.d.ts +4 -0
- package/dist/src/gateway/server.d.ts.map +1 -0
- package/dist/src/gateway/server.js +301 -0
- package/dist/src/gateway/server.js.map +1 -0
- package/dist/src/gateway/watcher.d.ts +14 -0
- package/dist/src/gateway/watcher.d.ts.map +1 -0
- package/dist/src/gateway/watcher.js +104 -0
- package/dist/src/gateway/watcher.js.map +1 -0
- package/dist/src/index.d.ts +5 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +4 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/sessions/context.d.ts +20 -0
- package/dist/src/sessions/context.d.ts.map +1 -0
- package/dist/src/sessions/context.js +532 -0
- package/dist/src/sessions/context.js.map +1 -0
- package/dist/src/sessions/manager.d.ts +38 -0
- package/dist/src/sessions/manager.d.ts.map +1 -0
- package/dist/src/sessions/manager.js +208 -0
- package/dist/src/sessions/manager.js.map +1 -0
- package/dist/src/sessions/queue.d.ts +14 -0
- package/dist/src/sessions/queue.d.ts.map +1 -0
- package/dist/src/sessions/queue.js +42 -0
- package/dist/src/sessions/queue.js.map +1 -0
- package/dist/src/sessions/registry.d.ts +46 -0
- package/dist/src/sessions/registry.d.ts.map +1 -0
- package/dist/src/sessions/registry.js +193 -0
- package/dist/src/sessions/registry.js.map +1 -0
- package/dist/src/shared/config.d.ts +3 -0
- package/dist/src/shared/config.d.ts.map +1 -0
- package/dist/src/shared/config.js +11 -0
- package/dist/src/shared/config.js.map +1 -0
- package/dist/src/shared/logger.d.ts +12 -0
- package/dist/src/shared/logger.d.ts.map +1 -0
- package/dist/src/shared/logger.js +35 -0
- package/dist/src/shared/logger.js.map +1 -0
- package/dist/src/shared/paths.d.ts +19 -0
- package/dist/src/shared/paths.d.ts.map +1 -0
- package/dist/src/shared/paths.js +31 -0
- package/dist/src/shared/paths.js.map +1 -0
- package/dist/src/shared/types.d.ts +166 -0
- package/dist/src/shared/types.d.ts.map +1 -0
- package/dist/src/shared/types.js +4 -0
- package/dist/src/shared/types.js.map +1 -0
- package/dist/src/shared/version.d.ts +15 -0
- package/dist/src/shared/version.d.ts.map +1 -0
- package/dist/src/shared/version.js +56 -0
- package/dist/src/shared/version.js.map +1 -0
- package/dist/web/404.html +1 -0
- package/dist/web/_next/static/chunks/198-fd91406a158c5c25.js +1 -0
- package/dist/web/_next/static/chunks/517.62389e8d3c929c43.js +1 -0
- package/dist/web/_next/static/chunks/534-17c49c944e0d0fe1.js +1 -0
- package/dist/web/_next/static/chunks/573-070537ec2452d03e.js +1 -0
- package/dist/web/_next/static/chunks/590-2c34156c7417317e.js +1 -0
- package/dist/web/_next/static/chunks/704-af2893821e1d18dc.js +1 -0
- package/dist/web/_next/static/chunks/7273c211.06e3b6021d90b73f.js +1 -0
- package/dist/web/_next/static/chunks/73-c226535579393e21.js +1 -0
- package/dist/web/_next/static/chunks/743-5bb03adbb0e4ddec.js +1 -0
- package/dist/web/_next/static/chunks/874.97d5a27895061057.js +1 -0
- package/dist/web/_next/static/chunks/8e6518bb-c26e82767f1faf66.js +1 -0
- package/dist/web/_next/static/chunks/app/_not-found/page-bb075b0779827928.js +1 -0
- package/dist/web/_next/static/chunks/app/chat/page-6d5bc707a45c92c6.js +1 -0
- package/dist/web/_next/static/chunks/app/costs/page-d6c03718defdb599.js +1 -0
- package/dist/web/_next/static/chunks/app/cron/page-4c563eef2b6231fe.js +1 -0
- package/dist/web/_next/static/chunks/app/kanban/page-55a73165a36f4077.js +1 -0
- package/dist/web/_next/static/chunks/app/layout-5129b67d5f126cf0.js +1 -0
- package/dist/web/_next/static/chunks/app/logs/page-e18889d67e48c9c9.js +1 -0
- package/dist/web/_next/static/chunks/app/org/page-d5cd8d9b7864737b.js +1 -0
- package/dist/web/_next/static/chunks/app/page-b81992940fd1dbc6.js +1 -0
- package/dist/web/_next/static/chunks/app/sessions/page-2eef6ac7882a28ba.js +1 -0
- package/dist/web/_next/static/chunks/app/settings/page-4fb01b9b09500170.js +1 -0
- package/dist/web/_next/static/chunks/app/skills/page-df9465e314561bb5.js +1 -0
- package/dist/web/_next/static/chunks/framework-077b27ad7787463c.js +1 -0
- package/dist/web/_next/static/chunks/main-app-437f51faf74fbb3b.js +1 -0
- package/dist/web/_next/static/chunks/main-f1c74cefd4965abf.js +1 -0
- package/dist/web/_next/static/chunks/pages/_app-77a85fe7d6bca671.js +1 -0
- package/dist/web/_next/static/chunks/pages/_error-68febf4b34900064.js +1 -0
- package/dist/web/_next/static/chunks/polyfills-42372ed130431b0a.js +1 -0
- package/dist/web/_next/static/chunks/webpack-0f39b7e91dce9791.js +1 -0
- package/dist/web/_next/static/css/4a6a5bca9238c104.css +1 -0
- package/dist/web/_next/static/vLvOwhC8JocJzSHTHKKOv/_buildManifest.js +1 -0
- package/dist/web/_next/static/vLvOwhC8JocJzSHTHKKOv/_ssgManifest.js +1 -0
- package/dist/web/chat.html +1 -0
- package/dist/web/chat.txt +20 -0
- package/dist/web/costs.html +16 -0
- package/dist/web/costs.txt +20 -0
- package/dist/web/cron.html +1 -0
- package/dist/web/cron.txt +20 -0
- package/dist/web/index.html +1 -0
- package/dist/web/index.txt +20 -0
- package/dist/web/kanban.html +1 -0
- package/dist/web/kanban.txt +20 -0
- package/dist/web/logs.html +7 -0
- package/dist/web/logs.txt +20 -0
- package/dist/web/org.html +1 -0
- package/dist/web/org.txt +20 -0
- package/dist/web/sessions.html +1 -0
- package/dist/web/sessions.txt +20 -0
- package/dist/web/settings.html +1 -0
- package/dist/web/settings.txt +20 -0
- package/dist/web/skills.html +1 -0
- package/dist/web/skills.txt +20 -0
- package/package.json +43 -0
- package/template/AGENTS.md +167 -0
- package/template/CLAUDE.md +106 -0
- package/template/config.default.yaml +27 -0
- package/template/docs/architecture.md +74 -0
- package/template/docs/connectors.md +72 -0
- package/template/docs/cron.md +137 -0
- package/template/docs/org.md +105 -0
- package/template/docs/overview.md +39 -0
- package/template/docs/self-modification.md +65 -0
- package/template/docs/skills.md +58 -0
- package/template/knowledge/.gitkeep +0 -0
- package/template/migrations/.gitkeep +0 -0
- package/template/migrations/0.1.0/MIGRATION.md +25 -0
- package/template/skills/cron-manager/SKILL.md +127 -0
- package/template/skills/find-and-install/SKILL.md +92 -0
- package/template/skills/management/SKILL.md +203 -0
- package/template/skills/migrate/SKILL.md +154 -0
- package/template/skills/new/SKILL.md +19 -0
- package/template/skills/onboarding/SKILL.md +106 -0
- package/template/skills/self-heal/SKILL.md +114 -0
- package/template/skills/skill-creator/SKILL.md +112 -0
- package/template/skills/status/SKILL.md +19 -0
- package/template/skills/sync/SKILL.md +67 -0
- package/template/skills.json +3 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[874],{1804:(e,t,n)=>{n.d(t,{x:()=>r});function r(e,t){if(Object.is(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(let[n,r]of e)if(!Object.is(r,t.get(n)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}let n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}},3025:(e,t,n)=>{var r=n(5271),o=n(7143),i="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},a=o.useSyncExternalStore,s=r.useRef,u=r.useEffect,l=r.useMemo,c=r.useDebugValue;t.useSyncExternalStoreWithSelector=function(e,t,n,r,o){var h=s(null);if(null===h.current){var d={hasValue:!1,value:null};h.current=d}else d=h.current;var f=a(e,(h=l(function(){function e(e){if(!u){if(u=!0,a=e,e=r(e),void 0!==o&&d.hasValue){var t=d.value;if(o(t,e))return s=t}return s=e}if(t=s,i(a,e))return t;var n=r(e);return void 0!==o&&o(t,n)?(a=e,t):(a=e,s=n)}var a,s,u=!1,l=void 0===n?null:n;return[function(){return e(t())},null===l?void 0:function(){return e(l())}]},[t,n,r,o]))[0],h[1]);return u(function(){d.hasValue=!0,d.value=f},[f]),c(f),f}},4434:(e,t,n)=>{var r=n(5271),o="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},i=r.useState,a=r.useEffect,s=r.useLayoutEffect,u=r.useDebugValue;function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!o(e,n)}catch(e){return!0}}var c="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),o=r[0].inst,c=r[1];return s(function(){o.value=n,o.getSnapshot=t,l(o)&&c({inst:o})},[e,n,t]),a(function(){return l(o)&&c({inst:o}),e(function(){l(o)&&c({inst:o})})},[e]),u(n),n};t.useSyncExternalStore=void 0!==r.useSyncExternalStore?r.useSyncExternalStore:c},5618:(e,t,n)=>{n.d(t,{A:()=>function e(t){if("string"==typeof t||"number"==typeof t)return""+t;let n="";if(Array.isArray(t))for(let r=0,o;r<t.length;r++)""!==(o=e(t[r]))&&(n+=(n&&" ")+o);else for(let e in t)t[e]&&(n+=(n&&" ")+e);return n}})},5985:(e,t,n)=>{e.exports=n(3025)},7143:(e,t,n)=>{e.exports=n(4434)},8694:(e,t,n)=>{n.d(t,{h:()=>h,n:()=>l});var r=n(5271),o=n(5985);let i=e=>{let t,n=new Set,r=(e,r)=>{let o="function"==typeof e?e(t):e;if(!Object.is(o,t)){let e=t;t=(null!=r?r:"object"!=typeof o||null===o)?o:Object.assign({},t,o),n.forEach(n=>n(t,e))}},o=()=>t,i={setState:r,getState:o,getInitialState:()=>a,subscribe:e=>(n.add(e),()=>n.delete(e)),destroy:()=>{console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},a=t=e(r,o,i);return i},{useDebugValue:a}=r,{useSyncExternalStoreWithSelector:s}=o,u=e=>e;function l(e,t=u,n){let r=s(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return a(r),r}let c=(e,t)=>{let n=(e=>e?i(e):i)(e),r=(e,r=t)=>l(n,e,r);return Object.assign(r,n),r},h=(e,t)=>e?c(e,t):c},8865:(e,t,n)=>{n.d(t,{A:()=>C});var r=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),o=r((e,t)=>{var n=Object.defineProperty,r=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),o=(e,t,r)=>((e,t,r)=>t in e?n(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),i=r((e,t)=>{function n(e,t){e[t]?e[t]++:e[t]=1}function r(e,t){--e[t]||delete e[t]}function i(e,t,n,r){var o=""+t,i=""+n;if(!e&&o>i){var a=o;o=i,i=a}return o+"\x01"+i+"\x01"+(void 0===r?"\0":r)}function a(e,t){return i(e,t.v,t.w,t.name)}t.exports=class{constructor(e){o(this,"_isDirected",!0),o(this,"_isMultigraph",!1),o(this,"_isCompound",!1),o(this,"_label"),o(this,"_defaultNodeLabelFn",()=>{}),o(this,"_defaultEdgeLabelFn",()=>{}),o(this,"_nodes",{}),o(this,"_in",{}),o(this,"_preds",{}),o(this,"_out",{}),o(this,"_sucs",{}),o(this,"_edgeObjs",{}),o(this,"_edgeLabels",{}),o(this,"_nodeCount",0),o(this,"_edgeCount",0),o(this,"_parent"),o(this,"_children"),e&&(this._isDirected=!Object.hasOwn(e,"directed")||e.directed,this._isMultigraph=!!Object.hasOwn(e,"multigraph")&&e.multigraph,this._isCompound=!!Object.hasOwn(e,"compound")&&e.compound),this._isCompound&&(this._parent={},this._children={},this._children["\0"]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(e){return this._label=e,this}graph(){return this._label}setDefaultNodeLabel(e){return this._defaultNodeLabelFn=e,"function"!=typeof e&&(this._defaultNodeLabelFn=()=>e),this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){var e=this;return this.nodes().filter(t=>0===Object.keys(e._in[t]).length)}sinks(){var e=this;return this.nodes().filter(t=>0===Object.keys(e._out[t]).length)}setNodes(e,t){var n=arguments,r=this;return e.forEach(function(e){n.length>1?r.setNode(e,t):r.setNode(e)}),this}setNode(e,t){return Object.hasOwn(this._nodes,e)?arguments.length>1&&(this._nodes[e]=t):(this._nodes[e]=arguments.length>1?t:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]="\0",this._children[e]={},this._children["\0"][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount),this}node(e){return this._nodes[e]}hasNode(e){return Object.hasOwn(this._nodes,e)}removeNode(e){var t=this;if(Object.hasOwn(this._nodes,e)){var n=e=>t.removeEdge(t._edgeObjs[e]);delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],this.children(e).forEach(function(e){t.setParent(e)}),delete this._children[e]),Object.keys(this._in[e]).forEach(n),delete this._in[e],delete this._preds[e],Object.keys(this._out[e]).forEach(n),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this}setParent(e,t){if(!this._isCompound)throw Error("Cannot set parent in a non-compound graph");if(void 0===t)t="\0";else{t+="";for(var n=t;void 0!==n;n=this.parent(n))if(n===e)throw Error("Setting "+t+" as parent of "+e+" would create a cycle");this.setNode(t)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=t,this._children[t][e]=!0,this}_removeFromParentsChildList(e){delete this._children[this._parent[e]][e]}parent(e){if(this._isCompound){var t=this._parent[e];if("\0"!==t)return t}}children(e="\0"){if(this._isCompound){var t=this._children[e];if(t)return Object.keys(t)}else{if("\0"===e)return this.nodes();if(this.hasNode(e))return[]}}predecessors(e){var t=this._preds[e];if(t)return Object.keys(t)}successors(e){var t=this._sucs[e];if(t)return Object.keys(t)}neighbors(e){var t=this.predecessors(e);if(t){let r=new Set(t);for(var n of this.successors(e))r.add(n);return Array.from(r.values())}}isLeaf(e){return 0===(this.isDirected()?this.successors(e):this.neighbors(e)).length}filterNodes(e){var t=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});t.setGraph(this.graph());var n=this;Object.entries(this._nodes).forEach(function([n,r]){e(n)&&t.setNode(n,r)}),Object.values(this._edgeObjs).forEach(function(e){t.hasNode(e.v)&&t.hasNode(e.w)&&t.setEdge(e,n.edge(e))});var r={};return this._isCompound&&t.nodes().forEach(e=>t.setParent(e,function e(o){var i=n.parent(o);return void 0===i||t.hasNode(i)?(r[o]=i,i):i in r?r[i]:e(i)}(e))),t}setDefaultEdgeLabel(e){return this._defaultEdgeLabelFn=e,"function"!=typeof e&&(this._defaultEdgeLabelFn=()=>e),this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(e,t){var n=this,r=arguments;return e.reduce(function(e,o){return r.length>1?n.setEdge(e,o,t):n.setEdge(e,o),o}),this}setEdge(){var e,t,r,o,a=!1,s=arguments[0];"object"==typeof s&&null!==s&&"v"in s?(e=s.v,t=s.w,r=s.name,2==arguments.length&&(o=arguments[1],a=!0)):(e=s,t=arguments[1],r=arguments[3],arguments.length>2&&(o=arguments[2],a=!0)),e=""+e,t=""+t,void 0!==r&&(r=""+r);var u=i(this._isDirected,e,t,r);if(Object.hasOwn(this._edgeLabels,u))return a&&(this._edgeLabels[u]=o),this;if(void 0!==r&&!this._isMultigraph)throw Error("Cannot set a named edge when isMultigraph = false");this.setNode(e),this.setNode(t),this._edgeLabels[u]=a?o:this._defaultEdgeLabelFn(e,t,r);var l=function(e,t,n,r){var o=""+t,i=""+n;if(!e&&o>i){var a=o;o=i,i=a}var s={v:o,w:i};return r&&(s.name=r),s}(this._isDirected,e,t,r);return e=l.v,t=l.w,Object.freeze(l),this._edgeObjs[u]=l,n(this._preds[t],e),n(this._sucs[e],t),this._in[t][u]=l,this._out[e][u]=l,this._edgeCount++,this}edge(e,t,n){var r=1==arguments.length?a(this._isDirected,arguments[0]):i(this._isDirected,e,t,n);return this._edgeLabels[r]}edgeAsObj(){let e=this.edge(...arguments);return"object"!=typeof e?{label:e}:e}hasEdge(e,t,n){var r=1==arguments.length?a(this._isDirected,arguments[0]):i(this._isDirected,e,t,n);return Object.hasOwn(this._edgeLabels,r)}removeEdge(e,t,n){var o=1==arguments.length?a(this._isDirected,arguments[0]):i(this._isDirected,e,t,n),s=this._edgeObjs[o];return s&&(e=s.v,t=s.w,delete this._edgeLabels[o],delete this._edgeObjs[o],r(this._preds[t],e),r(this._sucs[e],t),delete this._in[t][o],delete this._out[e][o],this._edgeCount--),this}inEdges(e,t){return this.isDirected()?this.filterEdges(this._in[e],e,t):this.nodeEdges(e,t)}outEdges(e,t){return this.isDirected()?this.filterEdges(this._out[e],e,t):this.nodeEdges(e,t)}nodeEdges(e,t){if(e in this._nodes)return this.filterEdges({...this._in[e],...this._out[e]},e,t)}filterEdges(e,t,n){if(e){var r=Object.values(e);return n?r.filter(function(e){return e.v===t&&e.w===n||e.v===n&&e.w===t}):r}}}}),a=r((e,t)=>{t.exports="3.0.2"}),s=r((e,t)=>{t.exports={Graph:i(),version:a()}}),u=r((e,t)=>{var n=i();t.exports={write:function(e){var t,n,r={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:(t=e).nodes().map(function(e){var n=t.node(e),r=t.parent(e),o={v:e};return void 0!==n&&(o.value=n),void 0!==r&&(o.parent=r),o}),edges:(n=e).edges().map(function(e){var t=n.edge(e),r={v:e.v,w:e.w};return void 0!==e.name&&(r.name=e.name),void 0!==t&&(r.value=t),r})};return void 0!==e.graph()&&(r.value=structuredClone(e.graph())),r},read:function(e){var t=new n(e.options).setGraph(e.value);return e.nodes.forEach(function(e){t.setNode(e.v,e.value),e.parent&&t.setParent(e.v,e.parent)}),e.edges.forEach(function(e){t.setEdge({v:e.v,w:e.w,name:e.name},e.value)}),t}}}),l=r((e,t)=>{t.exports=function(e,t,r,o){return function(e,t,n,r){var o={},i=!0,a=0,s=e.nodes(),u=function(e){var t=n(e);o[e.v].distance+t<o[e.w].distance&&(o[e.w]={distance:o[e.v].distance+t,predecessor:e.v},i=!0)},l=function(){s.forEach(function(e){r(e).forEach(function(t){var n=t.v===e?t.v:t.w,r=n===t.v?t.w:t.v;u({v:n,w:r})})})};s.forEach(function(e){o[e]={distance:e===t?0:1/0}});for(var c=s.length,h=1;h<c&&(i=!1,a++,l(),i);h++);if(a===c-1&&(i=!1,l(),i))throw Error("The graph contains a negative weight cycle");return o}(e,String(t),r||n,o||function(t){return e.outEdges(t)})};var n=()=>1}),c=r((e,t)=>{t.exports=function(e){var t,n={},r=[];return e.nodes().forEach(function(o){t=[],function r(o){Object.hasOwn(n,o)||(n[o]=!0,t.push(o),e.successors(o).forEach(r),e.predecessors(o).forEach(r))}(o),t.length&&r.push(t)}),r}}),h=r((e,t)=>{t.exports=class{constructor(){o(this,"_arr",[]),o(this,"_keyIndices",{})}size(){return this._arr.length}keys(){return this._arr.map(function(e){return e.key})}has(e){return Object.hasOwn(this._keyIndices,e)}priority(e){var t=this._keyIndices[e];if(void 0!==t)return this._arr[t].priority}min(){if(0===this.size())throw Error("Queue underflow");return this._arr[0].key}add(e,t){var n=this._keyIndices;if(!Object.hasOwn(n,e=String(e))){var r=this._arr,o=r.length;return n[e]=o,r.push({key:e,priority:t}),this._decrease(o),!0}return!1}removeMin(){this._swap(0,this._arr.length-1);var e=this._arr.pop();return delete this._keyIndices[e.key],this._heapify(0),e.key}decrease(e,t){var n=this._keyIndices[e];if(t>this._arr[n].priority)throw Error("New priority is greater than current priority. Key: "+e+" Old: "+this._arr[n].priority+" New: "+t);this._arr[n].priority=t,this._decrease(n)}_heapify(e){var t=this._arr,n=2*e,r=n+1,o=e;n<t.length&&(o=t[n].priority<t[o].priority?n:o,r<t.length&&(o=t[r].priority<t[o].priority?r:o),o!==e&&(this._swap(e,o),this._heapify(o)))}_decrease(e){for(var t,n=this._arr,r=n[e].priority;0!==e&&!(n[t=e>>1].priority<r);)this._swap(e,t),e=t}_swap(e,t){var n=this._arr,r=this._keyIndices,o=n[e],i=n[t];n[e]=i,n[t]=o,r[i.key]=e,r[o.key]=t}}}),d=r((e,t)=>{var n=h();t.exports=function(e,t,o,i){return function(e,t,r,o){var i,a,s={},u=new n,l=function(e){var t=e.v!==i?e.v:e.w,n=s[t],o=r(e),l=a.distance+o;if(o<0)throw Error("dijkstra does not allow negative edge weights. Bad edge: "+e+" Weight: "+o);l<n.distance&&(n.distance=l,n.predecessor=i,u.decrease(t,l))};for(e.nodes().forEach(function(e){var n=e===t?0:1/0;s[e]={distance:n},u.add(e,n)});u.size()>0&&(a=s[i=u.removeMin()]).distance!==1/0;)o(i).forEach(l);return s}(e,String(t),o||r,i||function(t){return e.outEdges(t)})};var r=()=>1}),f=r((e,t)=>{var n=d();t.exports=function(e,t,r){return e.nodes().reduce(function(o,i){return o[i]=n(e,i,t,r),o},{})}}),p=r((e,t)=>{t.exports=function(e,t,n){if(void 0!==e[t].predecessor)throw Error("Invalid source vertex");if(void 0===e[n].predecessor&&n!==t)throw Error("Invalid destination vertex");return{weight:e[n].distance,path:function(e,t,n){for(var r=[],o=n;o!==t;)r.push(o),o=e[o].predecessor;return r.push(t),r.reverse()}(e,t,n)}}}),g=r((e,t)=>{t.exports=function(e){var t=0,n=[],r={},o=[];return e.nodes().forEach(function(i){Object.hasOwn(r,i)||function i(a){var s=r[a]={onStack:!0,lowlink:t,index:t++};if(n.push(a),e.successors(a).forEach(function(e){Object.hasOwn(r,e)?r[e].onStack&&(s.lowlink=Math.min(s.lowlink,r[e].index)):(i(e),s.lowlink=Math.min(s.lowlink,r[e].lowlink))}),s.lowlink===s.index){var u,l=[];do r[u=n.pop()].onStack=!1,l.push(u);while(a!==u);o.push(l)}}(i)}),o}}),v=r((e,t)=>{var n=g();t.exports=function(e){return n(e).filter(function(t){return t.length>1||1===t.length&&e.hasEdge(t[0],t[0])})}}),y=r((e,t)=>{t.exports=function(e,t,r){var o,i,a,s,u;return o=e,i=t||n,a=r||function(t){return e.outEdges(t)},s={},(u=o.nodes()).forEach(function(e){s[e]={},s[e][e]={distance:0},u.forEach(function(t){e!==t&&(s[e][t]={distance:1/0})}),a(e).forEach(function(t){var n=t.v===e?t.w:t.v,r=i(t);s[e][n]={distance:r,predecessor:e}})}),u.forEach(function(e){var t=s[e];u.forEach(function(n){var r=s[n];u.forEach(function(n){var o=r[e],i=t[n],a=r[n],s=o.distance+i.distance;s<a.distance&&(a.distance=s,a.predecessor=i.predecessor)})})}),s};var n=()=>1}),m=r((e,t)=>{function n(e){var t={},n={},o=[];if(e.sinks().forEach(function i(a){if(Object.hasOwn(n,a))throw new r;Object.hasOwn(t,a)||(n[a]=!0,t[a]=!0,e.predecessors(a).forEach(i),delete n[a],o.push(a))}),Object.keys(t).length!==e.nodeCount())throw new r;return o}var r=class extends Error{constructor(){super(...arguments)}};t.exports=n,n.CycleException=r}),x=r((e,t)=>{var n=m();t.exports=function(e){try{n(e)}catch(e){if(e instanceof n.CycleException)return!1;throw e}return!0}}),w=r((e,t)=>{t.exports=function(e,t,n,r,o){Array.isArray(t)||(t=[t]);var i=(e.isDirected()?e.successors:e.neighbors).bind(e),a={};return t.forEach(function(t){if(!e.hasNode(t))throw Error("Graph does not have node: "+t);o=function e(t,n,r,o,i,a,s){return Object.hasOwn(o,n)||(o[n]=!0,r||(s=a(s,n)),i(n).forEach(function(n){s=e(t,n,r,o,i,a,s)}),r&&(s=a(s,n))),s}(e,t,"post"===n,a,i,r,o)}),o}}),b=r((e,t)=>{var n=w();t.exports=function(e,t,r){return n(e,t,r,function(e,t){return e.push(t),e},[])}}),_=r((e,t)=>{var n=b();t.exports=function(e,t){return n(e,t,"post")}}),E=r((e,t)=>{var n=b();t.exports=function(e,t){return n(e,t,"pre")}}),k=r((e,t)=>{var n=i(),r=h();t.exports=function(e,t){var o,i=new n,a={},s=new r;function u(e){var n=e.v===o?e.w:e.v,r=s.priority(n);if(void 0!==r){var i=t(e);i<r&&(a[n]=o,s.decrease(n,i))}}if(0===e.nodeCount())return i;e.nodes().forEach(function(e){s.add(e,1/0),i.setNode(e)}),s.decrease(e.nodes()[0],0);for(var l=!1;s.size()>0;){if(Object.hasOwn(a,o=s.removeMin()))i.setEdge(o,a[o]);else{if(l)throw Error("Input graph is not connected: "+e);l=!0}e.nodeEdges(o).forEach(u)}return i}}),M=r((e,t)=>{var n=d(),r=l();t.exports=function(e,t,o,i){return function(e,t,o,i){if(void 0===o)return n(e,t,o,i);for(var a=!1,s=e.nodes(),u=0;u<s.length;u++){for(var l=i(s[u]),c=0;c<l.length;c++){var h=l[c],d=h.v===s[u]?h.v:h.w,f=d===h.v?h.w:h.v;0>o({v:d,w:f})&&(a=!0)}if(a)return r(e,t,o,i)}return n(e,t,o,i)}(e,t,o,i||function(t){return e.outEdges(t)})}}),O=r((e,t)=>{t.exports={bellmanFord:l(),components:c(),dijkstra:d(),dijkstraAll:f(),extractPath:p(),findCycles:v(),floydWarshall:y(),isAcyclic:x(),postorder:_(),preorder:E(),prim:k(),shortestPaths:M(),reduce:w(),tarjan:g(),topsort:m()}}),N=s();t.exports={Graph:N.Graph,json:u(),alg:O(),version:N.version}}),i=r((e,t)=>{function n(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function r(e,t){if("_next"!==e&&"_prev"!==e)return t}t.exports=class{constructor(){let e={};e._next=e._prev=e,this._sentinel=e}dequeue(){let e=this._sentinel,t=e._prev;if(t!==e)return n(t),t}enqueue(e){let t=this._sentinel;e._prev&&e._next&&n(e),e._next=t._next,t._next._prev=e,t._next=e,e._prev=t}toString(){let e=[],t=this._sentinel,n=t._prev;for(;n!==t;)e.push(JSON.stringify(n,r)),n=n._prev;return"["+e.join(", ")+"]"}}}),a=r((e,t)=>{var n=o().Graph,r=i();t.exports=function(e,t){var o,i;let l,c,h,d,f;if(1>=e.nodeCount())return[];let p=(o=e,i=t||a,l=new n,c=0,h=0,o.nodes().forEach(e=>{l.setNode(e,{v:e,in:0,out:0})}),o.edges().forEach(e=>{let t=l.edge(e.v,e.w)||0,n=i(e);l.setEdge(e.v,e.w,t+n),h=Math.max(h,l.node(e.v).out+=n),c=Math.max(c,l.node(e.w).in+=n)}),d=(function(e){let t=[];for(let n=0;n<e;n++)t.push(n);return t})(h+c+3).map(()=>new r),f=c+1,l.nodes().forEach(e=>{u(d,f,l.node(e))}),{graph:l,buckets:d,zeroIdx:f});return(function(e,t,n){let r=[],o=t[t.length-1],i=t[0],a;for(;e.nodeCount();){for(;a=i.dequeue();)s(e,t,n,a);for(;a=o.dequeue();)s(e,t,n,a);if(e.nodeCount()){for(let o=t.length-2;o>0;--o)if(a=t[o].dequeue()){r=r.concat(s(e,t,n,a,!0));break}}}return r})(p.graph,p.buckets,p.zeroIdx).flatMap(t=>e.outEdges(t.v,t.w))};var a=()=>1;function s(e,t,n,r,o){let i=o?[]:void 0;return e.inEdges(r.v).forEach(r=>{let a=e.edge(r),s=e.node(r.v);o&&i.push({v:r.v,w:r.w}),s.out-=a,u(t,n,s)}),e.outEdges(r.v).forEach(r=>{let o=e.edge(r),i=r.w,a=e.node(i);a.in-=o,u(t,n,a)}),e.removeNode(r.v),i}function u(e,t,n){n.out?n.in?e[n.out-n.in+t].enqueue(n):e[e.length-1].enqueue(n):e[0].enqueue(n)}}),s=r((e,t)=>{var n=o().Graph;function r(e,t,n,r){for(var o=r;e.hasNode(o);)o=u(r);return n.dummy=t,e.setNode(o,n),o}t.exports={addBorderNode:function(e,t,n,o){let i={width:0,height:0};return arguments.length>=4&&(i.rank=n,i.order=o),r(e,"border",i,t)},addDummyNode:r,applyWithChunking:i,asNonCompoundGraph:function(e){let t=new n({multigraph:e.isMultigraph()}).setGraph(e.graph());return e.nodes().forEach(n=>{e.children(n).length||t.setNode(n,e.node(n))}),e.edges().forEach(n=>{t.setEdge(n,e.edge(n))}),t},buildLayerMatrix:function(e){let t=l(a(e)+1).map(()=>[]);return e.nodes().forEach(n=>{let r=e.node(n),o=r.rank;void 0!==o&&(t[o][r.order]=n)}),t},intersectRect:function(e,t){let n,r,o=e.x,i=e.y,a=t.x-o,s=t.y-i,u=e.width/2,l=e.height/2;if(!a&&!s)throw Error("Not possible to find intersection inside of the rectangle");return Math.abs(s)*u>Math.abs(a)*l?(s<0&&(l=-l),n=l*a/s,r=l):(a<0&&(u=-u),n=u,r=u*s/a),{x:o+n,y:i+r}},mapValues:function(e,t){let n=t;return"string"==typeof t&&(n=e=>e[t]),Object.entries(e).reduce((e,[t,r])=>(e[t]=n(r,t),e),{})},maxRank:a,normalizeRanks:function(e){let t=i(Math.min,e.nodes().map(t=>{let n=e.node(t).rank;return void 0===n?Number.MAX_VALUE:n}));e.nodes().forEach(n=>{let r=e.node(n);Object.hasOwn(r,"rank")&&(r.rank-=t)})},notime:function(e,t){return t()},partition:function(e,t){let n={lhs:[],rhs:[]};return e.forEach(e=>{t(e)?n.lhs.push(e):n.rhs.push(e)}),n},pick:function(e,t){let n={};for(let r of t)void 0!==e[r]&&(n[r]=e[r]);return n},predecessorWeights:function(e){let t=e.nodes().map(t=>{let n={};return e.inEdges(t).forEach(t=>{n[t.v]=(n[t.v]||0)+e.edge(t).weight}),n});return c(e.nodes(),t)},range:l,removeEmptyRanks:function(e){let t=i(Math.min,e.nodes().map(t=>e.node(t).rank).filter(e=>void 0!==e)),n=[];e.nodes().forEach(r=>{let o=e.node(r).rank-t;n[o]||(n[o]=[]),n[o].push(r)});let r=0,o=e.graph().nodeRankFactor;Array.from(n).forEach((t,n)=>{void 0===t&&n%o!=0?--r:void 0!==t&&r&&t.forEach(t=>e.node(t).rank+=r)})},simplify:function(e){let t=new n().setGraph(e.graph());return e.nodes().forEach(n=>t.setNode(n,e.node(n))),e.edges().forEach(n=>{let r=t.edge(n.v,n.w)||{weight:0,minlen:1},o=e.edge(n);t.setEdge(n.v,n.w,{weight:r.weight+o.weight,minlen:Math.max(r.minlen,o.minlen)})}),t},successorWeights:function(e){let t=e.nodes().map(t=>{let n={};return e.outEdges(t).forEach(t=>{n[t.w]=(n[t.w]||0)+e.edge(t).weight}),n});return c(e.nodes(),t)},time:function(e,t){let n=Date.now();try{return t()}finally{console.log(e+" time: "+(Date.now()-n)+"ms")}},uniqueId:u,zipObject:c};function i(e,t){if(!(t.length>65535))return e.apply(null,t);{let n=function(e,t=65535){let n=[];for(let r=0;r<e.length;r+=t){let o=e.slice(r,r+t);n.push(o)}return n}(t);return e.apply(null,n.map(t=>e.apply(null,t)))}}function a(e){return i(Math.max,e.nodes().map(t=>{let n=e.node(t).rank;return void 0===n?5e-324:n}))}var s=0;function u(e){return e+""+ ++s}function l(e,t,n=1){null==t&&(t=e,e=0);let r=e=>e<t;n<0&&(r=e=>t<e);let o=[];for(let t=e;r(t);t+=n)o.push(t);return o}function c(e,t){return e.reduce((e,n,r)=>(e[n]=t[r],e),{})}}),u=r((e,t)=>{var n=a(),r=s().uniqueId;t.exports={run:function(e){var t,o;let i,a,s;("greedy"===e.graph().acyclicer?n(e,(t=e,e=>t.edge(e).weight)):(i=[],a={},s={},(o=e).nodes().forEach(function e(t){Object.hasOwn(s,t)||(s[t]=!0,a[t]=!0,o.outEdges(t).forEach(t=>{Object.hasOwn(a,t.w)?i.push(t):e(t.w)}),delete a[t])}),i)).forEach(t=>{let n=e.edge(t);e.removeEdge(t),n.forwardName=t.name,n.reversed=!0,e.setEdge(t.w,t.v,n,r("rev"))})},undo:function(e){e.edges().forEach(t=>{let n=e.edge(t);if(n.reversed){e.removeEdge(t);let r=n.forwardName;delete n.reversed,delete n.forwardName,e.setEdge(t.w,t.v,n,r)}})}}}),l=r((e,t)=>{var n=s();t.exports={run:function(e){e.graph().dummyChains=[],e.edges().forEach(t=>(function(e,t){let r,o,i,a=t.v,s=e.node(a).rank,u=t.w,l=e.node(u).rank,c=t.name,h=e.edge(t),d=h.labelRank;if(l!==s+1){for(e.removeEdge(t),i=0,++s;s<l;++i,++s)h.points=[],o={width:0,height:0,edgeLabel:h,edgeObj:t,rank:s},r=n.addDummyNode(e,"edge",o,"_d"),s===d&&(o.width=h.width,o.height=h.height,o.dummy="edge-label",o.labelpos=h.labelpos),e.setEdge(a,r,{weight:h.weight},c),0===i&&e.graph().dummyChains.push(r),a=r;e.setEdge(a,u,{weight:h.weight},c)}})(e,t))},undo:function(e){e.graph().dummyChains.forEach(t=>{let n=e.node(t),r=n.edgeLabel,o;for(e.setEdge(n.edgeObj,r);n.dummy;)o=e.successors(t)[0],e.removeNode(t),r.points.push({x:n.x,y:n.y}),"edge-label"===n.dummy&&(r.x=n.x,r.y=n.y,r.width=n.width,r.height=n.height),t=o,n=e.node(t)})}}}),c=r((e,t)=>{var{applyWithChunking:n}=s();t.exports={longestPath:function(e){var t={};e.sources().forEach(function r(o){var i=e.node(o);if(Object.hasOwn(t,o))return i.rank;t[o]=!0;var a=n(Math.min,e.outEdges(o).map(t=>null==t?1/0:r(t.w)-e.edge(t).minlen));return a===1/0&&(a=0),i.rank=a})},slack:function(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}}}),h=r((e,t)=>{var n=o().Graph,r=c().slack;t.exports=function(e){var t,o,i,a,s=new n({directed:!1}),u=e.nodes()[0],l=e.nodeCount();for(s.setNode(u,{});t=s,o=e,t.nodes().forEach(function e(n){o.nodeEdges(n).forEach(i=>{var a=i.v,s=n===a?i.w:a;t.hasNode(s)||r(o,i)||(t.setNode(s,{}),t.setEdge(n,s,{}),e(s))})}),t.nodeCount()<l;)i=function(e,t){return t.edges().reduce((n,o)=>{let i=1/0;return e.hasNode(o.v)!==e.hasNode(o.w)&&(i=r(t,o)),i<n[0]?[i,o]:n},[1/0,null])[1]}(s,e),a=s.hasNode(i.v)?r(e,i):-r(e,i),function(e,t,n){e.nodes().forEach(e=>t.node(e).rank+=n)}(s,e,a);return s}}),d=r((e,t)=>{var n=h(),r=c().slack,i=c().longestPath,a=o().alg.preorder,u=o().alg.postorder,l=s().simplify;function d(e){i(e=l(e));var t,r,o=n(e);for(g(o),f(o,e);t=v(o);)r=y(o,e,t),m(o,e,t,r)}function f(e,t){var n=u(e,e.nodes());(n=n.slice(0,n.length-1)).forEach(n=>{var r,o,i,a;return r=e,o=t,i=n,a=r.node(i).parent,void(r.edge(i,a).cutvalue=p(r,o,i))})}function p(e,t,n){var r=e.node(n).parent,o=!0,i=t.edge(n,r),a=0;return i||(o=!1,i=t.edge(r,n)),a=i.weight,t.nodeEdges(n).forEach(i=>{var s=i.v===n,u=s?i.w:i.v;if(u!==r){var l,c,h,d=s===o,f=t.edge(i).weight;if(a+=d?f:-f,l=e,c=n,h=u,l.hasEdge(c,h)){var p=e.edge(n,u).cutvalue;a+=d?-p:p}}}),a}function g(e,t){arguments.length<2&&(t=e.nodes()[0]),function e(t,n,r,o,i){var a=r,s=t.node(o);return n[o]=!0,t.neighbors(o).forEach(i=>{Object.hasOwn(n,i)||(r=e(t,n,r,i,o))}),s.low=a,s.lim=r++,i?s.parent=i:delete s.parent,r}(e,{},1,t)}function v(e){return e.edges().find(t=>e.edge(t).cutvalue<0)}function y(e,t,n){var o=n.v,i=n.w;t.hasEdge(o,i)||(o=n.w,i=n.v);var a=e.node(o),s=e.node(i),u=a,l=!1;return a.lim>s.lim&&(u=s,l=!0),t.edges().filter(t=>l===x(e,e.node(t.v),u)&&l!==x(e,e.node(t.w),u)).reduce((e,n)=>r(t,n)<r(t,e)?n:e)}function m(e,t,n,r){var o,i,s,u,l=n.v,c=n.w;e.removeEdge(l,c),e.setEdge(r.v,r.w,{}),g(e),f(e,t),o=e,i=t,s=o.nodes().find(e=>!i.node(e).parent),(u=(u=a(o,s)).slice(1)).forEach(e=>{var t=o.node(e).parent,n=i.edge(e,t),r=!1;n||(n=i.edge(t,e),r=!0),i.node(e).rank=i.node(t).rank+(r?n.minlen:-n.minlen)})}function x(e,t,n){return n.low<=t.lim&&t.lim<=n.lim}t.exports=d,d.initLowLimValues=g,d.initCutValues=f,d.calcCutValue=p,d.leaveEdge=v,d.enterEdge=y,d.exchangeEdges=m}),f=r((e,t)=>{var n=c().longestPath,r=h(),o=d();t.exports=function(e){var t,a=e.graph().ranker;if(a instanceof Function)return a(e);switch(e.graph().ranker){case"network-simplex":default:o(e);break;case"tight-tree":n(t=e),r(t);break;case"longest-path":i(e);case"none":}};var i=n}),p=r((e,t)=>{t.exports=function(e){var t;let n,r,o=(n={},r=0,(t=e).children().forEach(function e(o){let i=r;t.children(o).forEach(e),n[o]={low:i,lim:r++}}),n);e.graph().dummyChains.forEach(t=>{let n=e.node(t),r=n.edgeObj,i=function(e,t,n,r){let o=[],i=[],a=Math.min(t[n].low,t[r].low),s=Math.max(t[n].lim,t[r].lim),u,l;u=n;do o.push(u=e.parent(u));while(u&&(t[u].low>a||s>t[u].lim));for(l=u,u=r;(u=e.parent(u))!==l;)i.push(u);return{path:o.concat(i.reverse()),lca:l}}(e,o,r.v,r.w),a=i.path,s=i.lca,u=0,l=a[0],c=!0;for(;t!==r.w;){if(n=e.node(t),c){for(;(l=a[u])!==s&&e.node(l).maxRank<n.rank;)u++;l===s&&(c=!1)}if(!c){for(;u<a.length-1&&e.node(l=a[u+1]).minRank<=n.rank;)u++;l=a[u]}e.setParent(t,l),t=e.successors(t)[0]}})}}),g=r((e,t)=>{var n=s();t.exports={run:function(e){var t,r,o;let i=n.addDummyNode(e,"root",{},"_root"),a=(r={},(t=e).children().forEach(e=>(function e(n,o){var i=t.children(n);i&&i.length&&i.forEach(t=>e(t,o+1)),r[n]=o})(e,1)),r),s=Object.values(a),u=n.applyWithChunking(Math.max,s)-1,l=2*u+1;e.graph().nestingRoot=i,e.edges().forEach(t=>e.edge(t).minlen*=l);let c=(o=e).edges().reduce((e,t)=>e+o.edge(t).weight,0)+1;e.children().forEach(t=>(function e(t,r,o,i,a,s,u){let l=t.children(u);if(!l.length){u!==r&&t.setEdge(r,u,{weight:0,minlen:o});return}let c=n.addBorderNode(t,"_bt"),h=n.addBorderNode(t,"_bb"),d=t.node(u);t.setParent(c,u),d.borderTop=c,t.setParent(h,u),d.borderBottom=h,l.forEach(n=>{e(t,r,o,i,a,s,n);let l=t.node(n),d=l.borderTop?l.borderTop:n,f=l.borderBottom?l.borderBottom:n,p=l.borderTop?i:2*i,g=d!==f?1:a-s[u]+1;t.setEdge(c,d,{weight:p,minlen:g,nestingEdge:!0}),t.setEdge(f,h,{weight:p,minlen:g,nestingEdge:!0})}),t.parent(u)||t.setEdge(r,c,{weight:0,minlen:a+s[u]})})(e,i,l,c,u,a,t)),e.graph().nodeRankFactor=l},cleanup:function(e){var t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,e.edges().forEach(t=>{e.edge(t).nestingEdge&&e.removeEdge(t)})}}}),v=r((e,t)=>{var n=s();function r(e,t,r,o,i,a){let s=i[t][a-1],u=n.addDummyNode(e,"border",{width:0,height:0,rank:a,borderType:t},r);i[t][a]=u,e.setParent(u,o),s&&e.setEdge(s,u,{weight:1})}t.exports=function(e){e.children().forEach(function t(n){let o=e.children(n),i=e.node(n);if(o.length&&o.forEach(t),Object.hasOwn(i,"minRank")){i.borderLeft=[],i.borderRight=[];for(let t=i.minRank,o=i.maxRank+1;t<o;++t)r(e,"borderLeft","_bl",n,i,t),r(e,"borderRight","_br",n,i,t)}})}}),y=r((e,t)=>{function n(e){e.nodes().forEach(t=>r(e.node(t))),e.edges().forEach(t=>r(e.edge(t)))}function r(e){let t=e.width;e.width=e.height,e.height=t}function o(e){e.y=-e.y}function i(e){let t=e.x;e.x=e.y,e.y=t}t.exports={adjust:function(e){let t=e.graph().rankdir.toLowerCase();("lr"===t||"rl"===t)&&n(e)},undo:function(e){var t,r;let a=e.graph().rankdir.toLowerCase();("bt"===a||"rl"===a)&&((t=e).nodes().forEach(e=>o(t.node(e))),t.edges().forEach(e=>{let n=t.edge(e);n.points.forEach(o),Object.hasOwn(n,"y")&&o(n)})),("lr"===a||"rl"===a)&&((r=e).nodes().forEach(e=>i(r.node(e))),r.edges().forEach(e=>{let t=r.edge(e);t.points.forEach(i),Object.hasOwn(t,"x")&&i(t)}),n(e))}}}),m=r((e,t)=>{var n=s();t.exports=function(e){let t={},r=e.nodes().filter(t=>!e.children(t).length),o=r.map(t=>e.node(t).rank),i=n.applyWithChunking(Math.max,o),a=n.range(i+1).map(()=>[]);return r.sort((t,n)=>e.node(t).rank-e.node(n).rank).forEach(function n(r){t[r]||(t[r]=!0,a[e.node(r).rank].push(r),e.successors(r).forEach(n))}),a}}),x=r((e,t)=>{var n=s().zipObject;t.exports=function(e,t){let r=0;for(let o=1;o<t.length;++o)r+=function(e,t,r){let o=n(r,r.map((e,t)=>t)),i=t.flatMap(t=>e.outEdges(t).map(t=>({pos:o[t.w],weight:e.edge(t).weight})).sort((e,t)=>e.pos-t.pos)),a=1;for(;a<r.length;)a<<=1;let s=2*a-1;a-=1;let u=Array(s).fill(0),l=0;return i.forEach(e=>{let t=e.pos+a;u[t]+=e.weight;let n=0;for(;t>0;)t%2&&(n+=u[t+1]),t=t-1>>1,u[t]+=e.weight;l+=e.weight*n}),l}(e,t[o-1],t[o]);return r}}),w=r((e,t)=>{t.exports=function(e,t=[]){return t.map(t=>{let n=e.inEdges(t);if(!n.length)return{v:t};{let r=n.reduce((t,n)=>{let r=e.edge(n),o=e.node(n.v);return{sum:t.sum+r.weight*o.order,weight:t.weight+r.weight}},{sum:0,weight:0});return{v:t,barycenter:r.sum/r.weight,weight:r.weight}}})}}),b=r((e,t)=>{var n=s();t.exports=function(e,t){let r={};return e.forEach((e,t)=>{let n=r[e.v]={indegree:0,in:[],out:[],vs:[e.v],i:t};void 0!==e.barycenter&&(n.barycenter=e.barycenter,n.weight=e.weight)}),t.edges().forEach(e=>{let t=r[e.v],n=r[e.w];void 0!==t&&void 0!==n&&(n.indegree++,t.out.push(r[e.w]))}),function(e){let t=[];for(;e.length;){let n=e.pop();t.push(n),n.in.reverse().forEach(function(e){return t=>{t.merged||(void 0===t.barycenter||void 0===e.barycenter||t.barycenter>=e.barycenter)&&function(e,t){let n=0,r=0;e.weight&&(n+=e.barycenter*e.weight,r+=e.weight),t.weight&&(n+=t.barycenter*t.weight,r+=t.weight),e.vs=t.vs.concat(e.vs),e.barycenter=n/r,e.weight=r,e.i=Math.min(t.i,e.i),t.merged=!0}(e,t)}}(n)),n.out.forEach(function(t){return n=>{n.in.push(t),0==--n.indegree&&e.push(n)}}(n))}return t.filter(e=>!e.merged).map(e=>n.pick(e,["vs","i","barycenter","weight"]))}(Object.values(r).filter(e=>!e.indegree))}}),_=r((e,t)=>{var n=s();function r(e,t,n){let r;for(;t.length&&(r=t[t.length-1]).i<=n;)t.pop(),e.push(r.vs),n++;return n}t.exports=function(e,t){var o;let i=n.partition(e,e=>Object.hasOwn(e,"barycenter")),a=i.lhs,s=i.rhs.sort((e,t)=>t.i-e.i),u=[],l=0,c=0,h=0;a.sort((o=!!t,(e,t)=>e.barycenter<t.barycenter?-1:e.barycenter>t.barycenter?1:o?t.i-e.i:e.i-t.i)),h=r(u,s,h),a.forEach(e=>{h+=e.vs.length,u.push(e.vs),l+=e.barycenter*e.weight,c+=e.weight,h=r(u,s,h)});let d={vs:u.flat(!0)};return c&&(d.barycenter=l/c,d.weight=c),d}}),E=r((e,t)=>{var n=w(),r=b(),o=_();t.exports=function e(t,i,a,s){var u,l;let c=t.children(i),h=t.node(i),d=h?h.borderLeft:void 0,f=h?h.borderRight:void 0,p={};d&&(c=c.filter(e=>e!==d&&e!==f));let g=n(t,c);g.forEach(n=>{if(t.children(n.v).length){var r,o;let i=e(t,n.v,a,s);p[n.v]=i,Object.hasOwn(i,"barycenter")&&(r=n,o=i,void 0!==r.barycenter?(r.barycenter=(r.barycenter*r.weight+o.barycenter*o.weight)/(r.weight+o.weight),r.weight+=o.weight):(r.barycenter=o.barycenter,r.weight=o.weight))}});let v=r(g,a);u=v,l=p,u.forEach(e=>{e.vs=e.vs.flatMap(e=>l[e]?l[e].vs:e)});let y=o(v,s);if(d&&(y.vs=[d,y.vs,f].flat(!0),t.predecessors(d).length)){let e=t.node(t.predecessors(d)[0]),n=t.node(t.predecessors(f)[0]);Object.hasOwn(y,"barycenter")||(y.barycenter=0,y.weight=0),y.barycenter=(y.barycenter*y.weight+e.order+n.order)/(y.weight+2),y.weight+=2}return y}}),k=r((e,t)=>{var n=o().Graph,r=s();t.exports=function(e,t,o,i){i||(i=e.nodes());let a=function(e){for(var t;e.hasNode(t=r.uniqueId("_root")););return t}(e),s=new n({compound:!0}).setGraph({root:a}).setDefaultNodeLabel(t=>e.node(t));return i.forEach(n=>{let r=e.node(n),i=e.parent(n);(r.rank===t||r.minRank<=t&&t<=r.maxRank)&&(s.setNode(n),s.setParent(n,i||a),e[o](n).forEach(t=>{let r=t.v===n?t.w:t.v,o=s.edge(r,n),i=void 0!==o?o.weight:0;s.setEdge(r,n,{weight:e.edge(t).weight+i})}),Object.hasOwn(r,"minRank")&&s.setNode(n,{borderLeft:r.borderLeft[t],borderRight:r.borderRight[t]}))}),s}}),M=r((e,t)=>{t.exports=function(e,t,n){let r={},o;n.forEach(n=>{let i=e.parent(n),a,s;for(;i;){if((a=e.parent(i))?(s=r[a],r[a]=i):(s=o,o=i),s&&s!==i)return void t.setEdge(s,i);i=a}})}}),O=r((e,t)=>{var n=m(),r=x(),i=E(),a=k(),u=M(),l=o().Graph,c=s();function h(e,t,n){let r=new Map,o=(e,t)=>{r.has(e)||r.set(e,[]),r.get(e).push(t)};for(let t of e.nodes()){let n=e.node(t);if("number"==typeof n.rank&&o(n.rank,t),"number"==typeof n.minRank&&"number"==typeof n.maxRank)for(let e=n.minRank;e<=n.maxRank;e++)e!==n.rank&&o(e,t)}return t.map(function(t){return a(e,t,n,r.get(t)||[])})}function d(e,t){Object.values(t).forEach(t=>t.forEach((t,n)=>e.node(t).order=n))}t.exports=function e(t,o={}){if("function"==typeof o.customOrder)return void o.customOrder(t,e);let a=c.maxRank(t),s=h(t,c.range(1,a+1),"inEdges"),f=h(t,c.range(a-1,-1,-1),"outEdges"),p=n(t);if(d(t,p),o.disableOptimalOrderHeuristic)return;let g=1/0,v,y=o.constraints||[];for(let e=0,n=0;n<4;++e,++n){(function(e,t,n){let r=new l;e.forEach(function(e){n.forEach(e=>r.setEdge(e.left,e.right));let o=e.graph().root,a=i(e,o,r,t);a.vs.forEach((t,n)=>e.node(t).order=n),u(e,r,a.vs)})})(e%2?s:f,e%4>=2,y),p=c.buildLayerMatrix(t);let o=r(t,p);o<g?(n=0,v=Object.assign({},p),g=o):o===g&&(v=structuredClone(p))}d(t,v)}}),N=r((e,t)=>{var n=o().Graph,r=s();function i(e,t){let n={};return t.length&&t.reduce(function(t,r){let o=0,i=0,a=t.length,s=r[r.length-1];return r.forEach((t,l)=>{let c=function(e,t){if(e.node(t).dummy)return e.predecessors(t).find(t=>e.node(t).dummy)}(e,t),h=c?e.node(c).order:a;(c||t===s)&&(r.slice(i,l+1).forEach(t=>{e.predecessors(t).forEach(r=>{let i=e.node(r),a=i.order;(a<o||h<a)&&!(i.dummy&&e.node(t).dummy)&&u(n,r,t)})}),i=l+1,o=h)}),r}),n}function a(e,t){let n={};function o(t,o,i,a,s){let l;r.range(o,i).forEach(r=>{l=t[r],e.node(l).dummy&&e.predecessors(l).forEach(t=>{let r=e.node(t);r.dummy&&(r.order<a||r.order>s)&&u(n,t,l)})})}return t.length&&t.reduce(function(t,n){let r=-1,i,a=0;return n.forEach((s,u)=>{if("border"===e.node(s).dummy){let t=e.predecessors(s);t.length&&(i=e.node(t[0]).order,o(n,a,u,r,i),a=u,r=i)}o(n,a,n.length,i,t.length)}),n}),n}function u(e,t,n){if(t>n){let e=t;t=n,n=e}let r=e[t];r||(e[t]=r={}),r[n]=!0}function l(e,t,n){if(t>n){let e=t;t=n,n=e}return!!e[t]&&Object.hasOwn(e[t],n)}function c(e,t,n,r){let o={},i={},a={};return t.forEach(e=>{e.forEach((e,t)=>{o[e]=e,i[e]=e,a[e]=t})}),t.forEach(e=>{let t=-1;e.forEach(e=>{let s=r(e);if(s.length){let r=((s=s.sort((e,t)=>a[e]-a[t])).length-1)/2;for(let u=Math.floor(r),c=Math.ceil(r);u<=c;++u){let r=s[u];i[e]===e&&t<a[r]&&!l(n,e,r)&&(i[r]=e,i[e]=o[e]=o[r],t=a[r])}}})}),{root:o,align:i}}function h(e,t,r,o,i){var a,s,u,l,c,h,d;let f,p,g,v={},y=(a=e,s=t,u=r,l=i,f=new n,g=(c=(p=a.graph()).nodesep,h=p.edgesep,d=l,(e,t,n)=>{let r=e.node(t),o=e.node(n),i,a;if(i=0+r.width/2,Object.hasOwn(r,"labelpos"))switch(r.labelpos.toLowerCase()){case"l":a=-r.width/2;break;case"r":a=r.width/2}if(a&&(i+=d?a:-a),a=0,i+=(r.dummy?h:c)/2,i+=(o.dummy?h:c)/2,i+=o.width/2,Object.hasOwn(o,"labelpos"))switch(o.labelpos.toLowerCase()){case"l":a=o.width/2;break;case"r":a=-o.width/2}return a&&(i+=d?a:-a),a=0,i}),s.forEach(e=>{let t;e.forEach(e=>{let n=u[e];if(f.setNode(n),t){var r=u[t],o=f.edge(r,n);f.setEdge(r,n,Math.max(g(a,e,t),o||0))}t=e})}),f),m=i?"borderLeft":"borderRight";function x(e,t){let n=y.nodes().slice(),r={},o=n.pop();for(;o;){if(r[o])e(o);else for(let e of(r[o]=!0,n.push(o),t(o)))n.push(e);o=n.pop()}}return x(function(e){v[e]=y.inEdges(e).reduce((e,t)=>Math.max(e,v[t.v]+y.edge(t)),0)},y.predecessors.bind(y)),x(function(t){let n=y.outEdges(t).reduce((e,t)=>Math.min(e,v[t.w]-y.edge(t)),1/0),r=e.node(t);n!==1/0&&r.borderType!==m&&(v[t]=Math.max(v[t],n))},y.successors.bind(y)),Object.keys(o).forEach(e=>v[e]=v[r[e]]),v}function d(e,t){return Object.values(t).reduce((t,n)=>{let r=-1/0,o=1/0;Object.entries(n).forEach(([t,n])=>{var i,a;let s=(i=e,a=t,i.node(a).width/2);r=Math.max(n+s,r),o=Math.min(n-s,o)});let i=r-o;return i<t[0]&&(t=[i,n]),t},[1/0,null])[1]}function f(e,t){let n=Object.values(t),o=r.applyWithChunking(Math.min,n),i=r.applyWithChunking(Math.max,n);["u","d"].forEach(n=>{["l","r"].forEach(a=>{let s=n+a,u=e[s];if(u===t)return;let l=Object.values(u),c=o-r.applyWithChunking(Math.min,l);"l"!==a&&(c=i-r.applyWithChunking(Math.max,l)),c&&(e[s]=r.mapValues(u,e=>e+c))})})}function p(e,t){return r.mapValues(e.ul,(n,r)=>{if(t)return e[t.toLowerCase()][r];{let t=Object.values(e).map(e=>e[r]).sort((e,t)=>e-t);return(t[1]+t[2])/2}})}t.exports={positionX:function(e){let t=r.buildLayerMatrix(e),n=Object.assign(i(e,t),a(e,t)),o={},s;["u","d"].forEach(i=>{s="u"===i?t:Object.values(t).reverse(),["l","r"].forEach(t=>{"r"===t&&(s=s.map(e=>Object.values(e).reverse()));let a=("u"===i?e.predecessors:e.successors).bind(e),u=c(e,s,n,a),l=h(e,s,u.root,u.align,"r"===t);"r"===t&&(l=r.mapValues(l,e=>-e)),o[i+t]=l})});let u=d(e,o);return f(o,u),p(o,e.graph().align)},findType1Conflicts:i,findType2Conflicts:a,addConflict:u,hasConflict:l,verticalAlignment:c,horizontalCompaction:h,alignCoordinates:f,findSmallestWidthAlignment:d,balance:p}}),j=r((e,t)=>{var n=s(),r=N().positionX;t.exports=function(e){var t;let o,i,a,s;t=e=n.asNonCompoundGraph(e),o=n.buildLayerMatrix(t),i=t.graph().ranksep,a=t.graph().rankalign,s=0,o.forEach(e=>{let n=e.reduce((e,n)=>{let r=t.node(n).height;return e>r?e:r},0);e.forEach(e=>{let r=t.node(e);"top"===a?r.y=s+r.height/2:"bottom"===a?r.y=s+n-r.height/2:r.y=s+n/2}),s+=n+i}),Object.entries(r(e)).forEach(([t,n])=>e.node(t).x=n)}}),A=r((e,t)=>{var n=u(),r=l(),i=f(),a=s().normalizeRanks,c=p(),h=s().removeEmptyRanks,d=g(),m=v(),x=y(),w=O(),b=j(),_=s(),E=o().Graph;t.exports=function(e,t={}){let o=t.debugTiming?_.time:_.notime;return o("layout",()=>{let s=o(" buildLayoutGraph",()=>{var t;let n,r;return t=e,n=new E({multigraph:!0,compound:!0}),r=P(t.graph()),n.setGraph(Object.assign({},M,L(r,k),_.pick(r,N))),t.nodes().forEach(e=>{let r=L(P(t.node(e)),A);Object.keys(z).forEach(e=>{void 0===r[e]&&(r[e]=z[e])}),n.setNode(e,r),n.setParent(e,t.parent(e))}),t.edges().forEach(e=>{let r=P(t.edge(e));n.setEdge(e,Object.assign({},C,L(r,$),_.pick(r,S)))}),n});return o(" runLayout",()=>{var e,u,l;return e=s,u=o,l=t,void(u(" makeSpaceForEdgeLabels",()=>{var t;let n;return n=(t=e).graph(),void(n.ranksep/=2,t.edges().forEach(e=>{let r=t.edge(e);r.minlen*=2,"c"!==r.labelpos.toLowerCase()&&("TB"===n.rankdir||"BT"===n.rankdir?r.width+=r.labeloffset:r.height+=r.labeloffset)}))}),u(" removeSelfEdges",()=>{var t;(t=e).edges().forEach(e=>{if(e.v===e.w){var n=t.node(e.v);n.selfEdges||(n.selfEdges=[]),n.selfEdges.push({e:e,label:t.edge(e)}),t.removeEdge(e)}})}),u(" acyclic",()=>n.run(e)),u(" nestingGraph.run",()=>d.run(e)),u(" rank",()=>i(_.asNonCompoundGraph(e))),u(" injectEdgeLabelProxies",()=>{var t;(t=e).edges().forEach(e=>{let n=t.edge(e);if(n.width&&n.height){let n=t.node(e.v),r={rank:(t.node(e.w).rank-n.rank)/2+n.rank,e:e};_.addDummyNode(t,"edge-proxy",r,"_ep")}})}),u(" removeEmptyRanks",()=>h(e)),u(" nestingGraph.cleanup",()=>d.cleanup(e)),u(" normalizeRanks",()=>a(e)),u(" assignRankMinMax",()=>{var t;let n;return n=0,void((t=e).nodes().forEach(e=>{let r=t.node(e);r.borderTop&&(r.minRank=t.node(r.borderTop).rank,r.maxRank=t.node(r.borderBottom).rank,n=Math.max(n,r.maxRank))}),t.graph().maxRank=n)}),u(" removeEdgeLabelProxies",()=>{var t;(t=e).nodes().forEach(e=>{let n=t.node(e);"edge-proxy"===n.dummy&&(t.edge(n.e).labelRank=n.rank,t.removeNode(e))})}),u(" normalize.run",()=>r.run(e)),u(" parentDummyChains",()=>c(e)),u(" addBorderSegments",()=>m(e)),u(" order",()=>w(e,l)),u(" insertSelfEdges",()=>{var t;return t=e,void _.buildLayerMatrix(t).forEach(e=>{var n=0;e.forEach((e,r)=>{var o=t.node(e);o.order=r+n,(o.selfEdges||[]).forEach(e=>{_.addDummyNode(t,"selfedge",{width:e.label.width,height:e.label.height,rank:o.rank,order:r+ ++n,e:e.e,label:e.label},"_se")}),delete o.selfEdges})})}),u(" adjustCoordinateSystem",()=>x.adjust(e)),u(" position",()=>b(e)),u(" positionSelfEdges",()=>{var t;(t=e).nodes().forEach(e=>{var n=t.node(e);if("selfedge"===n.dummy){var r=t.node(n.e.v),o=r.x+r.width/2,i=r.y,a=n.x-o,s=r.height/2;t.setEdge(n.e,n.label),t.removeNode(e),n.label.points=[{x:o+2*a/3,y:i-s},{x:o+5*a/6,y:i-s},{x:o+a,y:i},{x:o+5*a/6,y:i+s},{x:o+2*a/3,y:i+s}],n.label.x=n.x,n.label.y=n.y}})}),u(" removeBorderNodes",()=>{var t;(t=e).nodes().forEach(e=>{if(t.children(e).length){let n=t.node(e),r=t.node(n.borderTop),o=t.node(n.borderBottom),i=t.node(n.borderLeft[n.borderLeft.length-1]),a=t.node(n.borderRight[n.borderRight.length-1]);n.width=Math.abs(a.x-i.x),n.height=Math.abs(o.y-r.y),n.x=i.x+n.width/2,n.y=r.y+n.height/2}}),t.nodes().forEach(e=>{"border"===t.node(e).dummy&&t.removeNode(e)})}),u(" normalize.undo",()=>r.undo(e)),u(" fixupEdgeLabelCoords",()=>{var t;(t=e).edges().forEach(e=>{let n=t.edge(e);if(Object.hasOwn(n,"x"))switch(("l"===n.labelpos||"r"===n.labelpos)&&(n.width-=n.labeloffset),n.labelpos){case"l":n.x-=n.width/2+n.labeloffset;break;case"r":n.x+=n.width/2+n.labeloffset}})}),u(" undoCoordinateSystem",()=>x.undo(e)),u(" translateGraph",()=>(function(e){let t=1/0,n=0,r=1/0,o=0,i=e.graph(),a=i.marginx||0,s=i.marginy||0;function u(e){let i=e.x,a=e.y,s=e.width,u=e.height;t=Math.min(t,i-s/2),n=Math.max(n,i+s/2),r=Math.min(r,a-u/2),o=Math.max(o,a+u/2)}e.nodes().forEach(t=>u(e.node(t))),e.edges().forEach(t=>{let n=e.edge(t);Object.hasOwn(n,"x")&&u(n)}),t-=a,r-=s,e.nodes().forEach(n=>{let o=e.node(n);o.x-=t,o.y-=r}),e.edges().forEach(n=>{let o=e.edge(n);o.points.forEach(e=>{e.x-=t,e.y-=r}),Object.hasOwn(o,"x")&&(o.x-=t),Object.hasOwn(o,"y")&&(o.y-=r)}),i.width=n-t+a,i.height=o-r+s})(e)),u(" assignNodeIntersects",()=>{var t;(t=e).edges().forEach(e=>{let n=t.edge(e),r=t.node(e.v),o=t.node(e.w),i,a;n.points?(i=n.points[0],a=n.points[n.points.length-1]):(n.points=[],i=o,a=r),n.points.unshift(_.intersectRect(r,i)),n.points.push(_.intersectRect(o,a))})}),u(" reversePoints",()=>{var t;(t=e).edges().forEach(e=>{let n=t.edge(e);n.reversed&&n.points.reverse()})}),u(" acyclic.undo",()=>n.undo(e)))}),o(" updateInputGraph",()=>{var t,n;return t=e,n=s,void(t.nodes().forEach(e=>{let r=t.node(e),o=n.node(e);r&&(r.x=o.x,r.y=o.y,r.order=o.order,r.rank=o.rank,n.children(e).length&&(r.width=o.width,r.height=o.height))}),t.edges().forEach(e=>{let r=t.edge(e),o=n.edge(e);r.points=o.points,Object.hasOwn(o,"x")&&(r.x=o.x,r.y=o.y)}),t.graph().width=n.graph().width,t.graph().height=n.graph().height)}),s})};var k=["nodesep","edgesep","ranksep","marginx","marginy"],M={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb",rankalign:"center"},N=["acyclicer","ranker","rankdir","align","rankalign"],A=["width","height","rank"],z={width:0,height:0},$=["minlen","weight","width","height","labeloffset"],C={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},S=["labelpos"];function L(e,t){return _.mapValues(_.pick(e,t),Number)}function P(e){var t={};return e&&Object.entries(e).forEach(([e,n])=>{"string"==typeof e&&(e=e.toLowerCase()),t[e]=n}),t}}),z=r((e,t)=>{var n=s(),r=o().Graph;t.exports={debugOrdering:function(e){let t=n.buildLayerMatrix(e),o=new r({compound:!0,multigraph:!0}).setGraph({});return e.nodes().forEach(t=>{o.setNode(t,{label:t}),o.setParent(t,"layer"+e.node(t).rank)}),e.edges().forEach(e=>o.setEdge(e.v,e.w,{},e.name)),t.forEach((e,t)=>{o.setNode("layer"+t,{rank:"same"}),e.reduce((e,t)=>(o.setEdge(e,t,{style:"invis"}),t))}),o}}}),$=r((e,t)=>{t.exports="2.0.4"});let C=r((e,t)=>{t.exports={graphlib:o(),layout:A(),debug:z(),util:{time:s().time,notime:s().notime},version:$()}})()},9661:(e,t,n)=>{n.d(t,{Do:()=>s,WZ:()=>o,TG:()=>u,ny:()=>i,yX:()=>l,xN:()=>c,Qc:()=>a,I$:()=>rc,aQ:()=>rg,di:()=>rv,kO:()=>rk,rN:()=>nF,bi:()=>re,_s:()=>nN,aE:()=>ne,Hm:()=>n3,tM:()=>tQ,KE:()=>nv,tn:()=>tZ,xc:()=>tK,us:()=>nO,IO:()=>t7,e_:()=>nR,Fp:()=>nH,Mi:()=>nd,HF:()=>t1,Eo:()=>n$,b5:()=>nJ,Tq:()=>nt,qX:()=>nV,q1:()=>nT,M_:()=>n1,oj:()=>nC,aZ:()=>t6,aW:()=>n5,uD:()=>nk,Jo:()=>t8,U$:()=>t9,X6:()=>nf,oN:()=>nZ,ah:()=>nG,R4:()=>nb,r8:()=>rr,ZO:()=>tU,bK:()=>tJ,b$:()=>t2,uj:()=>nX,v5:()=>nL,Ue:()=>n_,Er:()=>nP,oB:()=>t5,kf:()=>ng,mW:()=>np,Q6:()=>nA,QE:()=>nM,kM:()=>nc,No:()=>ri,Ff:()=>nm,zj:()=>nx,s_:()=>ny,vS:()=>n9,qn:()=>rs,uL:()=>ro,YN:()=>nj});var r,o,i,a,s,u,l,c,h={value:()=>{}};function d(){for(var e,t=0,n=arguments.length,r={};t<n;++t){if(!(e=arguments[t]+"")||e in r||/[\s.]/.test(e))throw Error("illegal type: "+e);r[e]=[]}return new f(r)}function f(e){this._=e}function p(e,t,n){for(var r=0,o=e.length;r<o;++r)if(e[r].name===t){e[r]=h,e=e.slice(0,r).concat(e.slice(r+1));break}return null!=n&&e.push({name:t,value:n}),e}function g(){}function v(e){return null==e?g:function(){return this.querySelector(e)}}function y(){return[]}function m(e){return null==e?y:function(){return this.querySelectorAll(e)}}function x(e){return function(){return this.matches(e)}}function w(e){return function(t){return t.matches(e)}}f.prototype=d.prototype={constructor:f,on:function(e,t){var n,r=this._,o=(e+"").trim().split(/^|\s+/).map(function(e){var t="",n=e.indexOf(".");if(n>=0&&(t=e.slice(n+1),e=e.slice(0,n)),e&&!r.hasOwnProperty(e))throw Error("unknown type: "+e);return{type:e,name:t}}),i=-1,a=o.length;if(arguments.length<2){for(;++i<a;)if((n=(e=o[i]).type)&&(n=function(e,t){for(var n,r=0,o=e.length;r<o;++r)if((n=e[r]).name===t)return n.value}(r[n],e.name)))return n;return}if(null!=t&&"function"!=typeof t)throw Error("invalid callback: "+t);for(;++i<a;)if(n=(e=o[i]).type)r[n]=p(r[n],e.name,t);else if(null==t)for(n in r)r[n]=p(r[n],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new f(e)},call:function(e,t){if((n=arguments.length-2)>0)for(var n,r,o=Array(n),i=0;i<n;++i)o[i]=arguments[i+2];if(!this._.hasOwnProperty(e))throw Error("unknown type: "+e);for(r=this._[e],i=0,n=r.length;i<n;++i)r[i].value.apply(t,o)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw Error("unknown type: "+e);for(var r=this._[e],o=0,i=r.length;o<i;++o)r[o].value.apply(t,n)}};var b=Array.prototype.find;function _(){return this.firstElementChild}var E=Array.prototype.filter;function k(){return Array.from(this.children)}function M(e){return Array(e.length)}function O(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}function N(e,t,n,r,o,i){for(var a,s=0,u=t.length,l=i.length;s<l;++s)(a=t[s])?(a.__data__=i[s],r[s]=a):n[s]=new O(e,i[s]);for(;s<u;++s)(a=t[s])&&(o[s]=a)}function j(e,t,n,r,o,i,a){var s,u,l,c=new Map,h=t.length,d=i.length,f=Array(h);for(s=0;s<h;++s)(u=t[s])&&(f[s]=l=a.call(u,u.__data__,s,t)+"",c.has(l)?o[s]=u:c.set(l,u));for(s=0;s<d;++s)l=a.call(e,i[s],s,i)+"",(u=c.get(l))?(r[s]=u,u.__data__=i[s],c.delete(l)):n[s]=new O(e,i[s]);for(s=0;s<h;++s)(u=t[s])&&c.get(f[s])===u&&(o[s]=u)}function A(e){return e.__data__}function z(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}O.prototype={constructor:O,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)}};var $="http://www.w3.org/1999/xhtml";let C={svg:"http://www.w3.org/2000/svg",xhtml:$,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function S(e){var t=e+="",n=t.indexOf(":");return n>=0&&"xmlns"!==(t=e.slice(0,n))&&(e=e.slice(n+1)),C.hasOwnProperty(t)?{space:C[t],local:e}:e}function L(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function P(e,t){return e.style.getPropertyValue(t)||L(e).getComputedStyle(e,null).getPropertyValue(t)}function T(e){return e.trim().split(/^|\s+/)}function I(e){return e.classList||new R(e)}function R(e){this._node=e,this._names=T(e.getAttribute("class")||"")}function D(e,t){for(var n=I(e),r=-1,o=t.length;++r<o;)n.add(t[r])}function B(e,t){for(var n=I(e),r=-1,o=t.length;++r<o;)n.remove(t[r])}function H(){this.textContent=""}function q(){this.innerHTML=""}function V(){this.nextSibling&&this.parentNode.appendChild(this)}function X(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Y(e){var t=S(e);return(t.local?function(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}:function(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===$&&t.documentElement.namespaceURI===$?t.createElement(e):t.createElementNS(n,e)}})(t)}function F(){return null}function G(){var e=this.parentNode;e&&e.removeChild(this)}function W(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function K(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function U(e){return function(){var t=this.__on;if(t){for(var n,r=0,o=-1,i=t.length;r<i;++r)(n=t[r],e.type&&n.type!==e.type||n.name!==e.name)?t[++o]=n:this.removeEventListener(n.type,n.listener,n.options);++o?t.length=o:delete this.__on}}}function Z(e,t,n){return function(){var r,o=this.__on,i=function(e){t.call(this,e,this.__data__)};if(o){for(var a=0,s=o.length;a<s;++a)if((r=o[a]).type===e.type&&r.name===e.name){this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=i,r.options=n),r.value=t;return}}this.addEventListener(e.type,i,n),r={type:e.type,name:e.name,value:t,listener:i,options:n},o?o.push(r):this.__on=[r]}}function Q(e,t,n){var r=L(e),o=r.CustomEvent;"function"==typeof o?o=new o(t,n):(o=r.document.createEvent("Event"),n?(o.initEvent(t,n.bubbles,n.cancelable),o.detail=n.detail):o.initEvent(t,!1,!1)),e.dispatchEvent(o)}R.prototype={add:function(e){0>this._names.indexOf(e)&&(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}};var J=[null];function ee(e,t){this._groups=e,this._parents=t}function et(){return new ee([[document.documentElement]],J)}function en(e){return"string"==typeof e?new ee([[document.querySelector(e)]],[document.documentElement]):new ee([[e]],J)}function er(e,t){if(e=function(e){let t;for(;t=e.sourceEvent;)e=t;return e}(e),void 0===t&&(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())).x,r.y]}if(t.getBoundingClientRect){var o=t.getBoundingClientRect();return[e.clientX-o.left-t.clientLeft,e.clientY-o.top-t.clientTop]}}return[e.pageX,e.pageY]}ee.prototype=et.prototype={constructor:ee,select:function(e){"function"!=typeof e&&(e=v(e));for(var t=this._groups,n=t.length,r=Array(n),o=0;o<n;++o)for(var i,a,s=t[o],u=s.length,l=r[o]=Array(u),c=0;c<u;++c)(i=s[c])&&(a=e.call(i,i.__data__,c,s))&&("__data__"in i&&(a.__data__=i.__data__),l[c]=a);return new ee(r,this._parents)},selectAll:function(e){if("function"==typeof e){var t;t=e,e=function(){var e;return e=t.apply(this,arguments),null==e?[]:Array.isArray(e)?e:Array.from(e)}}else e=m(e);for(var n=this._groups,r=n.length,o=[],i=[],a=0;a<r;++a)for(var s,u=n[a],l=u.length,c=0;c<l;++c)(s=u[c])&&(o.push(e.call(s,s.__data__,c,u)),i.push(s));return new ee(o,i)},selectChild:function(e){var t;return this.select(null==e?_:(t="function"==typeof e?e:w(e),function(){return b.call(this.children,t)}))},selectChildren:function(e){var t;return this.selectAll(null==e?k:(t="function"==typeof e?e:w(e),function(){return E.call(this.children,t)}))},filter:function(e){"function"!=typeof e&&(e=x(e));for(var t=this._groups,n=t.length,r=Array(n),o=0;o<n;++o)for(var i,a=t[o],s=a.length,u=r[o]=[],l=0;l<s;++l)(i=a[l])&&e.call(i,i.__data__,l,a)&&u.push(i);return new ee(r,this._parents)},data:function(e,t){if(!arguments.length)return Array.from(this,A);var n=t?j:N,r=this._parents,o=this._groups;"function"!=typeof e&&(m=e,e=function(){return m});for(var i=o.length,a=Array(i),s=Array(i),u=Array(i),l=0;l<i;++l){var c=r[l],h=o[l],d=h.length,f="object"==typeof(y=e.call(c,c&&c.__data__,l,r))&&"length"in y?y:Array.from(y),p=f.length,g=s[l]=Array(p),v=a[l]=Array(p);n(c,h,g,v,u[l]=Array(d),f,t);for(var y,m,x,w,b=0,_=0;b<p;++b)if(x=g[b]){for(b>=_&&(_=b+1);!(w=v[_])&&++_<p;);x._next=w||null}}return(a=new ee(a,r))._enter=s,a._exit=u,a},enter:function(){return new ee(this._enter||this._groups.map(M),this._parents)},exit:function(){return new ee(this._exit||this._groups.map(M),this._parents)},join:function(e,t,n){var r=this.enter(),o=this,i=this.exit();return"function"==typeof e?(r=e(r))&&(r=r.selection()):r=r.append(e+""),null!=t&&(o=t(o))&&(o=o.selection()),null==n?i.remove():n(i),r&&o?r.merge(o).order():o},merge:function(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,o=n.length,i=r.length,a=Math.min(o,i),s=Array(o),u=0;u<a;++u)for(var l,c=n[u],h=r[u],d=c.length,f=s[u]=Array(d),p=0;p<d;++p)(l=c[p]||h[p])&&(f[p]=l);for(;u<o;++u)s[u]=n[u];return new ee(s,this._parents)},selection:function(){return this},order:function(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r,o=e[t],i=o.length-1,a=o[i];--i>=0;)(r=o[i])&&(a&&4^r.compareDocumentPosition(a)&&a.parentNode.insertBefore(r,a),a=r);return this},sort:function(e){function t(t,n){return t&&n?e(t.__data__,n.__data__):!t-!n}e||(e=z);for(var n=this._groups,r=n.length,o=Array(r),i=0;i<r;++i){for(var a,s=n[i],u=s.length,l=o[i]=Array(u),c=0;c<u;++c)(a=s[c])&&(l[c]=a);l.sort(t)}return new ee(o,this._parents).order()},call:function(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this},nodes:function(){return Array.from(this)},node:function(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],o=0,i=r.length;o<i;++o){var a=r[o];if(a)return a}return null},size:function(){let e=0;for(let t of this)++e;return e},empty:function(){return!this.node()},each:function(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var o,i=t[n],a=0,s=i.length;a<s;++a)(o=i[a])&&e.call(o,o.__data__,a,i);return this},attr:function(e,t){var n=S(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((null==t?n.local?function(e){return function(){this.removeAttributeNS(e.space,e.local)}}:function(e){return function(){this.removeAttribute(e)}}:"function"==typeof t?n.local?function(e,t){return function(){var n=t.apply(this,arguments);null==n?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}:function(e,t){return function(){var n=t.apply(this,arguments);null==n?this.removeAttribute(e):this.setAttribute(e,n)}}:n.local?function(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}:function(e,t){return function(){this.setAttribute(e,t)}})(n,t))},style:function(e,t,n){return arguments.length>1?this.each((null==t?function(e){return function(){this.style.removeProperty(e)}}:"function"==typeof t?function(e,t,n){return function(){var r=t.apply(this,arguments);null==r?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}:function(e,t,n){return function(){this.style.setProperty(e,t,n)}})(e,t,null==n?"":n)):P(this.node(),e)},property:function(e,t){return arguments.length>1?this.each((null==t?function(e){return function(){delete this[e]}}:"function"==typeof t?function(e,t){return function(){var n=t.apply(this,arguments);null==n?delete this[e]:this[e]=n}}:function(e,t){return function(){this[e]=t}})(e,t)):this.node()[e]},classed:function(e,t){var n=T(e+"");if(arguments.length<2){for(var r=I(this.node()),o=-1,i=n.length;++o<i;)if(!r.contains(n[o]))return!1;return!0}return this.each(("function"==typeof t?function(e,t){return function(){(t.apply(this,arguments)?D:B)(this,e)}}:t?function(e){return function(){D(this,e)}}:function(e){return function(){B(this,e)}})(n,t))},text:function(e){return arguments.length?this.each(null==e?H:("function"==typeof e?function(e){return function(){var t=e.apply(this,arguments);this.textContent=null==t?"":t}}:function(e){return function(){this.textContent=e}})(e)):this.node().textContent},html:function(e){return arguments.length?this.each(null==e?q:("function"==typeof e?function(e){return function(){var t=e.apply(this,arguments);this.innerHTML=null==t?"":t}}:function(e){return function(){this.innerHTML=e}})(e)):this.node().innerHTML},raise:function(){return this.each(V)},lower:function(){return this.each(X)},append:function(e){var t="function"==typeof e?e:Y(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})},insert:function(e,t){var n="function"==typeof e?e:Y(e),r=null==t?F:"function"==typeof t?t:v(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})},remove:function(){return this.each(G)},clone:function(e){return this.select(e?K:W)},datum:function(e){return arguments.length?this.property("__data__",e):this.node().__data__},on:function(e,t,n){var r,o,i=(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}}),a=i.length;if(arguments.length<2){var s=this.node().__on;if(s){for(var u,l=0,c=s.length;l<c;++l)for(r=0,u=s[l];r<a;++r)if((o=i[r]).type===u.type&&o.name===u.name)return u.value}return}for(r=0,s=t?Z:U;r<a;++r)this.each(s(i[r],t,n));return this},dispatch:function(e,t){return this.each(("function"==typeof t?function(e,t){return function(){return Q(this,e,t.apply(this,arguments))}}:function(e,t){return function(){return Q(this,e,t)}})(e,t))},[Symbol.iterator]:function*(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r,o=e[t],i=0,a=o.length;i<a;++i)(r=o[i])&&(yield r)}};let eo={passive:!1},ei={capture:!0,passive:!1};function ea(e){e.stopImmediatePropagation()}function es(e){e.preventDefault(),e.stopImmediatePropagation()}function eu(e){var t=e.document.documentElement,n=en(e).on("dragstart.drag",es,ei);"onselectstart"in t?n.on("selectstart.drag",es,ei):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function el(e,t){var n=e.document.documentElement,r=en(e).on("dragstart.drag",null);t&&(r.on("click.drag",es,ei),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}let ec=e=>()=>e;function eh(e,{sourceEvent:t,subject:n,target:r,identifier:o,active:i,x:a,y:s,dx:u,dy:l,dispatch:c}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:o,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:s,enumerable:!0,configurable:!0},dx:{value:u,enumerable:!0,configurable:!0},dy:{value:l,enumerable:!0,configurable:!0},_:{value:c}})}function ed(e){return!e.ctrlKey&&!e.button}function ef(){return this.parentNode}function ep(e,t){return null==t?{x:e.x,y:e.y}:t}function eg(){return navigator.maxTouchPoints||"ontouchstart"in this}function ev(e){return((e=Math.exp(e))+1/e)/2}eh.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};let ey=function e(t,n,r){function o(e,o){var i,a,s=e[0],u=e[1],l=e[2],c=o[0],h=o[1],d=o[2],f=c-s,p=h-u,g=f*f+p*p;if(g<1e-12)a=Math.log(d/l)/t,i=function(e){return[s+e*f,u+e*p,l*Math.exp(t*e*a)]};else{var v=Math.sqrt(g),y=(d*d-l*l+r*g)/(2*l*n*v),m=(d*d-l*l-r*g)/(2*d*n*v),x=Math.log(Math.sqrt(y*y+1)-y);a=(Math.log(Math.sqrt(m*m+1)-m)-x)/t,i=function(e){var r,o,i=e*a,c=ev(x),h=l/(n*v)*(c*(((r=Math.exp(2*(r=t*i+x)))-1)/(r+1))-((o=Math.exp(o=x))-1/o)/2);return[s+h*f,u+h*p,l*c/ev(t*i+x)]}}return i.duration=1e3*a*t/Math.SQRT2,i}return o.rho=function(t){var n=Math.max(.001,+t),r=n*n;return e(n,r,r*r)},o}(Math.SQRT2,2,4);var em,ex,ew=0,eb=0,e_=0,eE=0,ek=0,eM=0,eO="object"==typeof performance&&performance.now?performance:Date,eN="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function ej(){return ek||(eN(eA),ek=eO.now()+eM)}function eA(){ek=0}function ez(){this._call=this._time=this._next=null}function e$(e,t,n){var r=new ez;return r.restart(e,t,n),r}function eC(){ek=(eE=eO.now())+eM,ew=eb=0;try{ej(),++ew;for(var e,t=em;t;)(e=ek-t._time)>=0&&t._call.call(void 0,e),t=t._next;--ew}finally{ew=0,function(){for(var e,t,n=em,r=1/0;n;)n._call?(r>n._time&&(r=n._time),e=n,n=n._next):(t=n._next,n._next=null,n=e?e._next=t:em=t);ex=e,eL(r)}(),ek=0}}function eS(){var e=eO.now(),t=e-eE;t>1e3&&(eM-=t,eE=e)}function eL(e){!ew&&(eb&&(eb=clearTimeout(eb)),e-ek>24?(e<1/0&&(eb=setTimeout(eC,e-eO.now()-eM)),e_&&(e_=clearInterval(e_))):(e_||(eE=eO.now(),e_=setInterval(eS,1e3)),ew=1,eN(eC)))}function eP(e,t,n){var r=new ez;return t=null==t?0:+t,r.restart(n=>{r.stop(),e(n+t)},t,n),r}ez.prototype=e$.prototype={constructor:ez,restart:function(e,t,n){if("function"!=typeof e)throw TypeError("callback is not a function");n=(null==n?ej():+n)+(null==t?0:+t),this._next||ex===this||(ex?ex._next=this:em=this,ex=this),this._call=e,this._time=n,eL()},stop:function(){this._call&&(this._call=null,this._time=1/0,eL())}};var eT=d("start","end","cancel","interrupt"),eI=[];function eR(e,t,n,r,o,i){var a=e.__transition;if(a){if(n in a)return}else e.__transition={};!function(e,t,n){var r,o=e.__transition;function i(u){var l,c,h,d;if(1!==n.state)return s();for(l in o)if((d=o[l]).name===n.name){if(3===d.state)return eP(i);4===d.state?(d.state=6,d.timer.stop(),d.on.call("interrupt",e,e.__data__,d.index,d.group),delete o[l]):+l<t&&(d.state=6,d.timer.stop(),d.on.call("cancel",e,e.__data__,d.index,d.group),delete o[l])}if(eP(function(){3===n.state&&(n.state=4,n.timer.restart(a,n.delay,n.time),a(u))}),n.state=2,n.on.call("start",e,e.__data__,n.index,n.group),2===n.state){for(l=0,n.state=3,r=Array(h=n.tween.length),c=-1;l<h;++l)(d=n.tween[l].value.call(e,e.__data__,n.index,n.group))&&(r[++c]=d);r.length=c+1}}function a(t){for(var o=t<n.duration?n.ease.call(null,t/n.duration):(n.timer.restart(s),n.state=5,1),i=-1,a=r.length;++i<a;)r[i].call(e,o);5===n.state&&(n.on.call("end",e,e.__data__,n.index,n.group),s())}function s(){for(var r in n.state=6,n.timer.stop(),delete o[t],o)return;delete e.__transition}o[t]=n,n.timer=e$(function(e){n.state=1,n.timer.restart(i,n.delay,n.time),n.delay<=e&&i(e-n.delay)},0,n.time)}(e,n,{name:t,index:r,group:o,on:eT,tween:eI,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:0})}function eD(e,t){var n=eH(e,t);if(n.state>0)throw Error("too late; already scheduled");return n}function eB(e,t){var n=eH(e,t);if(n.state>3)throw Error("too late; already running");return n}function eH(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw Error("transition not found");return n}function eq(e,t){var n,r,o,i=e.__transition,a=!0;if(i){for(o in t=null==t?null:t+"",i){if((n=i[o]).name!==t){a=!1;continue}r=n.state>2&&n.state<5,n.state=6,n.timer.stop(),n.on.call(r?"interrupt":"cancel",e,e.__data__,n.index,n.group),delete i[o]}a&&delete e.__transition}}function eV(e,t){return e*=1,t*=1,function(n){return e*(1-n)+t*n}}var eX=180/Math.PI,eY={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function eF(e,t,n,r,o,i){var a,s,u;return(a=Math.sqrt(e*e+t*t))&&(e/=a,t/=a),(u=e*n+t*r)&&(n-=e*u,r-=t*u),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,u/=s),e*r<t*n&&(e=-e,t=-t,u=-u,a=-a),{translateX:o,translateY:i,rotate:Math.atan2(t,e)*eX,skewX:Math.atan(u)*eX,scaleX:a,scaleY:s}}function eG(e,t,n,r){function o(e){return e.length?e.pop()+" ":""}return function(i,a){var s,u,l,c,h=[],d=[];return i=e(i),a=e(a),!function(e,r,o,i,a,s){if(e!==o||r!==i){var u=a.push("translate(",null,t,null,n);s.push({i:u-4,x:eV(e,o)},{i:u-2,x:eV(r,i)})}else(o||i)&&a.push("translate("+o+t+i+n)}(i.translateX,i.translateY,a.translateX,a.translateY,h,d),s=i.rotate,u=a.rotate,s!==u?(s-u>180?u+=360:u-s>180&&(s+=360),d.push({i:h.push(o(h)+"rotate(",null,r)-2,x:eV(s,u)})):u&&h.push(o(h)+"rotate("+u+r),l=i.skewX,c=a.skewX,l!==c?d.push({i:h.push(o(h)+"skewX(",null,r)-2,x:eV(l,c)}):c&&h.push(o(h)+"skewX("+c+r),!function(e,t,n,r,i,a){if(e!==n||t!==r){var s=i.push(o(i)+"scale(",null,",",null,")");a.push({i:s-4,x:eV(e,n)},{i:s-2,x:eV(t,r)})}else(1!==n||1!==r)&&i.push(o(i)+"scale("+n+","+r+")")}(i.scaleX,i.scaleY,a.scaleX,a.scaleY,h,d),i=a=null,function(e){for(var t,n=-1,r=d.length;++n<r;)h[(t=d[n]).i]=t.x(e);return h.join("")}}}var eW=eG(function(e){let t=new("function"==typeof DOMMatrix?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?eY:eF(t.a,t.b,t.c,t.d,t.e,t.f)},"px, ","px)","deg)"),eK=eG(function(e){return null==e?eY:(r||(r=document.createElementNS("http://www.w3.org/2000/svg","g")),r.setAttribute("transform",e),e=r.transform.baseVal.consolidate())?eF((e=e.matrix).a,e.b,e.c,e.d,e.e,e.f):eY},", ",")",")");function eU(e,t,n){var r=e._id;return e.each(function(){var e=eB(this,r);(e.value||(e.value={}))[t]=n.apply(this,arguments)}),function(e){return eH(e,r).value[t]}}function eZ(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function eQ(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function eJ(){}var e0="\\s*([+-]?\\d+)\\s*",e1="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",e2="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",e5=/^#([0-9a-f]{3,8})$/,e3=RegExp(`^rgb\\(${e0},${e0},${e0}\\)$`),e4=RegExp(`^rgb\\(${e2},${e2},${e2}\\)$`),e8=RegExp(`^rgba\\(${e0},${e0},${e0},${e1}\\)$`),e6=RegExp(`^rgba\\(${e2},${e2},${e2},${e1}\\)$`),e9=RegExp(`^hsl\\(${e1},${e2},${e2}\\)$`),e7=RegExp(`^hsla\\(${e1},${e2},${e2},${e1}\\)$`),te={aliceblue:0xf0f8ff,antiquewhite:0xfaebd7,aqua:65535,aquamarine:8388564,azure:0xf0ffff,beige:0xf5f5dc,bisque:0xffe4c4,black:0,blanchedalmond:0xffebcd,blue:255,blueviolet:9055202,brown:0xa52a2a,burlywood:0xdeb887,cadetblue:6266528,chartreuse:8388352,chocolate:0xd2691e,coral:0xff7f50,cornflowerblue:6591981,cornsilk:0xfff8dc,crimson:0xdc143c,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:0xb8860b,darkgray:0xa9a9a9,darkgreen:25600,darkgrey:0xa9a9a9,darkkhaki:0xbdb76b,darkmagenta:9109643,darkolivegreen:5597999,darkorange:0xff8c00,darkorchid:0x9932cc,darkred:9109504,darksalmon:0xe9967a,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:0xff1493,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:0xb22222,floralwhite:0xfffaf0,forestgreen:2263842,fuchsia:0xff00ff,gainsboro:0xdcdcdc,ghostwhite:0xf8f8ff,gold:0xffd700,goldenrod:0xdaa520,gray:8421504,green:32768,greenyellow:0xadff2f,grey:8421504,honeydew:0xf0fff0,hotpink:0xff69b4,indianred:0xcd5c5c,indigo:4915330,ivory:0xfffff0,khaki:0xf0e68c,lavender:0xe6e6fa,lavenderblush:0xfff0f5,lawngreen:8190976,lemonchiffon:0xfffacd,lightblue:0xadd8e6,lightcoral:0xf08080,lightcyan:0xe0ffff,lightgoldenrodyellow:0xfafad2,lightgray:0xd3d3d3,lightgreen:9498256,lightgrey:0xd3d3d3,lightpink:0xffb6c1,lightsalmon:0xffa07a,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:0xb0c4de,lightyellow:0xffffe0,lime:65280,limegreen:3329330,linen:0xfaf0e6,magenta:0xff00ff,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:0xba55d3,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:0xc71585,midnightblue:1644912,mintcream:0xf5fffa,mistyrose:0xffe4e1,moccasin:0xffe4b5,navajowhite:0xffdead,navy:128,oldlace:0xfdf5e6,olive:8421376,olivedrab:7048739,orange:0xffa500,orangered:0xff4500,orchid:0xda70d6,palegoldenrod:0xeee8aa,palegreen:0x98fb98,paleturquoise:0xafeeee,palevioletred:0xdb7093,papayawhip:0xffefd5,peachpuff:0xffdab9,peru:0xcd853f,pink:0xffc0cb,plum:0xdda0dd,powderblue:0xb0e0e6,purple:8388736,rebeccapurple:6697881,red:0xff0000,rosybrown:0xbc8f8f,royalblue:4286945,saddlebrown:9127187,salmon:0xfa8072,sandybrown:0xf4a460,seagreen:3050327,seashell:0xfff5ee,sienna:0xa0522d,silver:0xc0c0c0,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:0xfffafa,springgreen:65407,steelblue:4620980,tan:0xd2b48c,teal:32896,thistle:0xd8bfd8,tomato:0xff6347,turquoise:4251856,violet:0xee82ee,wheat:0xf5deb3,white:0xffffff,whitesmoke:0xf5f5f5,yellow:0xffff00,yellowgreen:0x9acd32};function tt(){return this.rgb().formatHex()}function tn(){return this.rgb().formatRgb()}function tr(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=e5.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?to(t):3===n?new ts(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?ti(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?ti(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=e3.exec(e))?new ts(t[1],t[2],t[3],1):(t=e4.exec(e))?new ts(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=e8.exec(e))?ti(t[1],t[2],t[3],t[4]):(t=e6.exec(e))?ti(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=e9.exec(e))?tf(t[1],t[2]/100,t[3]/100,1):(t=e7.exec(e))?tf(t[1],t[2]/100,t[3]/100,t[4]):te.hasOwnProperty(e)?to(te[e]):"transparent"===e?new ts(NaN,NaN,NaN,0):null}function to(e){return new ts(e>>16&255,e>>8&255,255&e,1)}function ti(e,t,n,r){return r<=0&&(e=t=n=NaN),new ts(e,t,n,r)}function ta(e,t,n,r){var o;return 1==arguments.length?((o=e)instanceof eJ||(o=tr(o)),o)?new ts((o=o.rgb()).r,o.g,o.b,o.opacity):new ts:new ts(e,t,n,null==r?1:r)}function ts(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function tu(){return`#${td(this.r)}${td(this.g)}${td(this.b)}`}function tl(){let e=tc(this.opacity);return`${1===e?"rgb(":"rgba("}${th(this.r)}, ${th(this.g)}, ${th(this.b)}${1===e?")":`, ${e})`}`}function tc(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function th(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function td(e){return((e=th(e))<16?"0":"")+e.toString(16)}function tf(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new tg(e,t,n,r)}function tp(e){if(e instanceof tg)return new tg(e.h,e.s,e.l,e.opacity);if(e instanceof eJ||(e=tr(e)),!e)return new tg;if(e instanceof tg)return e;var t=(e=e.rgb()).r/255,n=e.g/255,r=e.b/255,o=Math.min(t,n,r),i=Math.max(t,n,r),a=NaN,s=i-o,u=(i+o)/2;return s?(a=t===i?(n-r)/s+(n<r)*6:n===i?(r-t)/s+2:(t-n)/s+4,s/=u<.5?i+o:2-i-o,a*=60):s=u>0&&u<1?0:a,new tg(a,s,u,e.opacity)}function tg(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function tv(e){return(e=(e||0)%360)<0?e+360:e}function ty(e){return Math.max(0,Math.min(1,e||0))}function tm(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}function tx(e,t,n,r,o){var i=e*e,a=i*e;return((1-3*e+3*i-a)*t+(4-6*i+3*a)*n+(1+3*e+3*i-3*a)*r+a*o)/6}eZ(eJ,tr,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:tt,formatHex:tt,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return tp(this).formatHsl()},formatRgb:tn,toString:tn}),eZ(ts,ta,eQ(eJ,{brighter(e){return e=null==e?1.4285714285714286:Math.pow(1.4285714285714286,e),new ts(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new ts(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new ts(th(this.r),th(this.g),th(this.b),tc(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:tu,formatHex:tu,formatHex8:function(){return`#${td(this.r)}${td(this.g)}${td(this.b)}${td((isNaN(this.opacity)?1:this.opacity)*255)}`},formatRgb:tl,toString:tl})),eZ(tg,function(e,t,n,r){return 1==arguments.length?tp(e):new tg(e,t,n,null==r?1:r)},eQ(eJ,{brighter(e){return e=null==e?1.4285714285714286:Math.pow(1.4285714285714286,e),new tg(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new tg(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,o=2*n-r;return new ts(tm(e>=240?e-240:e+120,o,r),tm(e,o,r),tm(e<120?e+240:e-120,o,r),this.opacity)},clamp(){return new tg(tv(this.h),ty(this.s),ty(this.l),tc(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=tc(this.opacity);return`${1===e?"hsl(":"hsla("}${tv(this.h)}, ${100*ty(this.s)}%, ${100*ty(this.l)}%${1===e?")":`, ${e})`}`}}));let tw=e=>()=>e;function tb(e,t){var n=t-e;return n?function(t){return e+t*n}:tw(isNaN(e)?t:e)}let t_=function e(t){var n,r=1==(n=+t)?tb:function(e,t){var r,o,i;return t-e?(r=e,o=t,r=Math.pow(r,i=n),o=Math.pow(o,i)-r,i=1/i,function(e){return Math.pow(r+e*o,i)}):tw(isNaN(e)?t:e)};function o(e,t){var n=r((e=ta(e)).r,(t=ta(t)).r),o=r(e.g,t.g),i=r(e.b,t.b),a=tb(e.opacity,t.opacity);return function(t){return e.r=n(t),e.g=o(t),e.b=i(t),e.opacity=a(t),e+""}}return o.gamma=e,o}(1);function tE(e){return function(t){var n,r,o=t.length,i=Array(o),a=Array(o),s=Array(o);for(n=0;n<o;++n)r=ta(t[n]),i[n]=r.r||0,a[n]=r.g||0,s[n]=r.b||0;return i=e(i),a=e(a),s=e(s),r.opacity=1,function(e){return r.r=i(e),r.g=a(e),r.b=s(e),r+""}}}tE(function(e){var t=e.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,t-1):Math.floor(n*t),o=e[r],i=e[r+1],a=r>0?e[r-1]:2*o-i,s=r<t-1?e[r+2]:2*i-o;return tx((n-r/t)*t,a,o,i,s)}}),tE(function(e){var t=e.length;return function(n){var r=Math.floor(((n%=1)<0?++n:n)*t),o=e[(r+t-1)%t],i=e[r%t],a=e[(r+1)%t],s=e[(r+2)%t];return tx((n-r/t)*t,o,i,a,s)}});var tk=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,tM=RegExp(tk.source,"g");function tO(e,t){var n,r,o,i,a,s=tk.lastIndex=tM.lastIndex=0,u=-1,l=[],c=[];for(e+="",t+="";(o=tk.exec(e))&&(i=tM.exec(t));)(a=i.index)>s&&(a=t.slice(s,a),l[u]?l[u]+=a:l[++u]=a),(o=o[0])===(i=i[0])?l[u]?l[u]+=i:l[++u]=i:(l[++u]=null,c.push({i:u,x:eV(o,i)})),s=tM.lastIndex;return s<t.length&&(a=t.slice(s),l[u]?l[u]+=a:l[++u]=a),l.length<2?c[0]?(n=c[0].x,function(e){return n(e)+""}):(r=t,function(){return r}):(t=c.length,function(e){for(var n,r=0;r<t;++r)l[(n=c[r]).i]=n.x(e);return l.join("")})}function tN(e,t){var n;return("number"==typeof t?eV:t instanceof tr?t_:(n=tr(t))?(t=n,t_):tO)(e,t)}var tj=et.prototype.constructor;function tA(e){return function(){this.style.removeProperty(e)}}var tz=0;function t$(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}var tC=et.prototype;t$.prototype=(function(e){return et().transition(e)}).prototype={constructor:t$,select:function(e){var t=this._name,n=this._id;"function"!=typeof e&&(e=v(e));for(var r=this._groups,o=r.length,i=Array(o),a=0;a<o;++a)for(var s,u,l=r[a],c=l.length,h=i[a]=Array(c),d=0;d<c;++d)(s=l[d])&&(u=e.call(s,s.__data__,d,l))&&("__data__"in s&&(u.__data__=s.__data__),h[d]=u,eR(h[d],t,n,d,h,eH(s,n)));return new t$(i,this._parents,t,n)},selectAll:function(e){var t=this._name,n=this._id;"function"!=typeof e&&(e=m(e));for(var r=this._groups,o=r.length,i=[],a=[],s=0;s<o;++s)for(var u,l=r[s],c=l.length,h=0;h<c;++h)if(u=l[h]){for(var d,f=e.call(u,u.__data__,h,l),p=eH(u,n),g=0,v=f.length;g<v;++g)(d=f[g])&&eR(d,t,n,g,f,p);i.push(f),a.push(u)}return new t$(i,a,t,n)},selectChild:tC.selectChild,selectChildren:tC.selectChildren,filter:function(e){"function"!=typeof e&&(e=x(e));for(var t=this._groups,n=t.length,r=Array(n),o=0;o<n;++o)for(var i,a=t[o],s=a.length,u=r[o]=[],l=0;l<s;++l)(i=a[l])&&e.call(i,i.__data__,l,a)&&u.push(i);return new t$(r,this._parents,this._name,this._id)},merge:function(e){if(e._id!==this._id)throw Error();for(var t=this._groups,n=e._groups,r=t.length,o=n.length,i=Math.min(r,o),a=Array(r),s=0;s<i;++s)for(var u,l=t[s],c=n[s],h=l.length,d=a[s]=Array(h),f=0;f<h;++f)(u=l[f]||c[f])&&(d[f]=u);for(;s<r;++s)a[s]=t[s];return new t$(a,this._parents,this._name,this._id)},selection:function(){return new tj(this._groups,this._parents)},transition:function(){for(var e=this._name,t=this._id,n=++tz,r=this._groups,o=r.length,i=0;i<o;++i)for(var a,s=r[i],u=s.length,l=0;l<u;++l)if(a=s[l]){var c=eH(a,t);eR(a,e,n,l,s,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new t$(r,this._parents,e,n)},call:tC.call,nodes:tC.nodes,node:tC.node,size:tC.size,empty:tC.empty,each:tC.each,on:function(e,t){var n,r,o,i,a,s,u=this._id;return arguments.length<2?eH(this.node(),u).on.on(e):this.each((n=u,r=e,o=t,s=(r+"").trim().split(/^|\s+/).every(function(e){var t=e.indexOf(".");return t>=0&&(e=e.slice(0,t)),!e||"start"===e})?eD:eB,function(){var e=s(this,n),t=e.on;t!==i&&(a=(i=t).copy()).on(r,o),e.on=a}))},attr:function(e,t){var n=S(e),r="transform"===n?eK:tN;return this.attrTween(e,"function"==typeof t?(n.local?function(e,t,n){var r,o,i;return function(){var a,s,u=n(this);return null==u?void this.removeAttributeNS(e.space,e.local):(a=this.getAttributeNS(e.space,e.local))===(s=u+"")?null:a===r&&s===o?i:(o=s,i=t(r=a,u))}}:function(e,t,n){var r,o,i;return function(){var a,s,u=n(this);return null==u?void this.removeAttribute(e):(a=this.getAttribute(e))===(s=u+"")?null:a===r&&s===o?i:(o=s,i=t(r=a,u))}})(n,r,eU(this,"attr."+e,t)):null==t?(n.local?function(e){return function(){this.removeAttributeNS(e.space,e.local)}}:function(e){return function(){this.removeAttribute(e)}})(n):(n.local?function(e,t,n){var r,o,i=n+"";return function(){var a=this.getAttributeNS(e.space,e.local);return a===i?null:a===r?o:o=t(r=a,n)}}:function(e,t,n){var r,o,i=n+"";return function(){var a=this.getAttribute(e);return a===i?null:a===r?o:o=t(r=a,n)}})(n,r,t))},attrTween:function(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(null==t)return this.tween(n,null);if("function"!=typeof t)throw Error();var r=S(e);return this.tween(n,(r.local?function(e,t){var n,r;function o(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&function(t){this.setAttributeNS(e.space,e.local,o.call(this,t))}),n}return o._value=t,o}:function(e,t){var n,r;function o(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&function(t){this.setAttribute(e,o.call(this,t))}),n}return o._value=t,o})(r,t))},style:function(e,t,n){var r,o,i,a,s,u,l,c,h,d,f,p,g,v,y,m,x,w,b,_,E,k="transform"==(e+="")?eW:tN;return null==t?this.styleTween(e,(r=e,function(){var e=P(this,r),t=(this.style.removeProperty(r),P(this,r));return e===t?null:e===o&&t===i?a:a=k(o=e,i=t)})).on("end.style."+e,tA(e)):"function"==typeof t?this.styleTween(e,(s=e,u=eU(this,"style."+e,t),function(){var e=P(this,s),t=u(this),n=t+"";return null==t&&(this.style.removeProperty(s),n=t=P(this,s)),e===n?null:e===l&&n===c?h:(c=n,h=k(l=e,t))})).each((d=this._id,x="end."+(m="style."+(f=e)),function(){var e=eB(this,d),t=e.on,n=null==e.value[m]?y||(y=tA(f)):void 0;(t!==p||v!==n)&&(g=(p=t).copy()).on(x,v=n),e.on=g})):this.styleTween(e,(w=e,E=t+"",function(){var e=P(this,w);return e===E?null:e===b?_:_=k(b=e,t)}),n).on("end.style."+e,null)},styleTween:function(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==t)return this.tween(r,null);if("function"!=typeof t)throw Error();return this.tween(r,function(e,t,n){var r,o;function i(){var i=t.apply(this,arguments);return i!==o&&(r=(o=i)&&function(t){this.style.setProperty(e,i.call(this,t),n)}),r}return i._value=t,i}(e,t,null==n?"":n))},text:function(e){var t,n;return this.tween("text","function"==typeof e?(t=eU(this,"text",e),function(){var e=t(this);this.textContent=null==e?"":e}):(n=null==e?"":e+"",function(){this.textContent=n}))},textTween:function(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(null==e)return this.tween(t,null);if("function"!=typeof e)throw Error();return this.tween(t,function(e){var t,n;function r(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&function(e){this.textContent=r.call(this,e)}),t}return r._value=e,r}(e))},remove:function(){var e;return this.on("end.remove",(e=this._id,function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}))},tween:function(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r,o=eH(this.node(),n).tween,i=0,a=o.length;i<a;++i)if((r=o[i]).name===e)return r.value;return null}return this.each((null==t?function(e,t){var n,r;return function(){var o=eB(this,e),i=o.tween;if(i!==n){r=n=i;for(var a=0,s=r.length;a<s;++a)if(r[a].name===t){(r=r.slice()).splice(a,1);break}}o.tween=r}}:function(e,t,n){var r,o;if("function"!=typeof n)throw Error();return function(){var i=eB(this,e),a=i.tween;if(a!==r){o=(r=a).slice();for(var s={name:t,value:n},u=0,l=o.length;u<l;++u)if(o[u].name===t){o[u]=s;break}u===l&&o.push(s)}i.tween=o}})(n,e,t))},delay:function(e){var t=this._id;return arguments.length?this.each(("function"==typeof e?function(e,t){return function(){eD(this,e).delay=+t.apply(this,arguments)}}:function(e,t){return t*=1,function(){eD(this,e).delay=t}})(t,e)):eH(this.node(),t).delay},duration:function(e){var t=this._id;return arguments.length?this.each(("function"==typeof e?function(e,t){return function(){eB(this,e).duration=+t.apply(this,arguments)}}:function(e,t){return t*=1,function(){eB(this,e).duration=t}})(t,e)):eH(this.node(),t).duration},ease:function(e){var t=this._id;return arguments.length?this.each(function(e,t){if("function"!=typeof t)throw Error();return function(){eB(this,e).ease=t}}(t,e)):eH(this.node(),t).ease},easeVarying:function(e){var t;if("function"!=typeof e)throw Error();return this.each((t=this._id,function(){var n=e.apply(this,arguments);if("function"!=typeof n)throw Error();eB(this,t).ease=n}))},end:function(){var e,t,n=this,r=n._id,o=n.size();return new Promise(function(i,a){var s={value:a},u={value:function(){0==--o&&i()}};n.each(function(){var n=eB(this,r),o=n.on;o!==e&&((t=(e=o).copy())._.cancel.push(s),t._.interrupt.push(s),t._.end.push(u)),n.on=t}),0===o&&i()})},[Symbol.iterator]:tC[Symbol.iterator]};var tS={time:null,delay:0,duration:250,ease:function(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}};et.prototype.interrupt=function(e){return this.each(function(){eq(this,e)})},et.prototype.transition=function(e){var t,n;e instanceof t$?(t=e._id,e=e._name):(t=++tz,(n=tS).time=ej(),e=null==e?null:e+"");for(var r=this._groups,o=r.length,i=0;i<o;++i)for(var a,s=r[i],u=s.length,l=0;l<u;++l)(a=s[l])&&eR(a,e,t,l,s,n||function(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw Error(`transition ${t} not found`);return n}(a,t));return new t$(r,this._parents,e,t)};let tL=e=>()=>e;function tP(e,{sourceEvent:t,target:n,transform:r,dispatch:o}){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:o}})}function tT(e,t,n){this.k=e,this.x=t,this.y=n}tT.prototype={constructor:tT,scale:function(e){return 1===e?this:new tT(this.k*e,this.x,this.y)},translate:function(e,t){return 0===e&0===t?this:new tT(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 tI=new tT(1,0,0);function tR(e){for(;!e.__zoom;)if(!(e=e.parentNode))return tI;return e.__zoom}function tD(e){e.stopImmediatePropagation()}function tB(e){e.preventDefault(),e.stopImmediatePropagation()}function tH(e){return(!e.ctrlKey||"wheel"===e.type)&&!e.button}function tq(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e).hasAttribute("viewBox")?[[(e=e.viewBox.baseVal).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 tV(){return this.__zoom||tI}function tX(e){return-e.deltaY*(1===e.deltaMode?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function tY(){return navigator.maxTouchPoints||"ontouchstart"in this}function tF(e,t,n){var r=e.invertX(t[0][0])-n[0][0],o=e.invertX(t[1][0])-n[1][0],i=e.invertY(t[0][1])-n[0][1],a=e.invertY(t[1][1])-n[1][1];return e.translate(o>r?(r+o)/2:Math.min(0,r)||Math.max(0,o),a>i?(i+a)/2:Math.min(0,i)||Math.max(0,a))}function tG(){var e,t,n,r=tH,o=tq,i=tF,a=tX,s=tY,u=[0,1/0],l=[[-1/0,-1/0],[1/0,1/0]],c=250,h=ey,f=d("start","zoom","end"),p=0,g=10;function v(e){e.property("__zoom",tV).on("wheel.zoom",E,{passive:!1}).on("mousedown.zoom",k).on("dblclick.zoom",M).filter(s).on("touchstart.zoom",O).on("touchmove.zoom",N).on("touchend.zoom touchcancel.zoom",j).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function y(e,t){return(t=Math.max(u[0],Math.min(u[1],t)))===e.k?e:new tT(t,e.x,e.y)}function m(e,t,n){var r=t[0]-n[0]*e.k,o=t[1]-n[1]*e.k;return r===e.x&&o===e.y?e:new tT(e.k,r,o)}function x(e){return[(+e[0][0]+ +e[1][0])/2,(+e[0][1]+ +e[1][1])/2]}function w(e,t,n,r){e.on("start.zoom",function(){b(this,arguments).event(r).start()}).on("interrupt.zoom end.zoom",function(){b(this,arguments).event(r).end()}).tween("zoom",function(){var e=arguments,i=b(this,e).event(r),a=o.apply(this,e),s=null==n?x(a):"function"==typeof n?n.apply(this,e):n,u=Math.max(a[1][0]-a[0][0],a[1][1]-a[0][1]),l=this.__zoom,c="function"==typeof t?t.apply(this,e):t,d=h(l.invert(s).concat(u/l.k),c.invert(s).concat(u/c.k));return function(e){if(1===e)e=c;else{var t=d(e),n=u/t[2];e=new tT(n,s[0]-t[0]*n,s[1]-t[1]*n)}i.zoom(null,e)}})}function b(e,t,n){return!n&&e.__zooming||new _(e,t)}function _(e,t){this.that=e,this.args=t,this.active=0,this.sourceEvent=null,this.extent=o.apply(e,t),this.taps=0}function E(e,...t){if(r.apply(this,arguments)){var n=b(this,t).event(e),o=this.__zoom,s=Math.max(u[0],Math.min(u[1],o.k*Math.pow(2,a.apply(this,arguments)))),c=er(e);if(n.wheel)(n.mouse[0][0]!==c[0]||n.mouse[0][1]!==c[1])&&(n.mouse[1]=o.invert(n.mouse[0]=c)),clearTimeout(n.wheel);else{if(o.k===s)return;n.mouse=[c,o.invert(c)],eq(this),n.start()}tB(e),n.wheel=setTimeout(function(){n.wheel=null,n.end()},150),n.zoom("mouse",i(m(y(o,s),n.mouse[0],n.mouse[1]),n.extent,l))}}function k(e,...t){if(!n&&r.apply(this,arguments)){var o=e.currentTarget,a=b(this,t,!0).event(e),s=en(e.view).on("mousemove.zoom",function(e){if(tB(e),!a.moved){var t=e.clientX-c,n=e.clientY-h;a.moved=t*t+n*n>p}a.event(e).zoom("mouse",i(m(a.that.__zoom,a.mouse[0]=er(e,o),a.mouse[1]),a.extent,l))},!0).on("mouseup.zoom",function(e){s.on("mousemove.zoom mouseup.zoom",null),el(e.view,a.moved),tB(e),a.event(e).end()},!0),u=er(e,o),c=e.clientX,h=e.clientY;eu(e.view),tD(e),a.mouse=[u,this.__zoom.invert(u)],eq(this),a.start()}}function M(e,...t){if(r.apply(this,arguments)){var n=this.__zoom,a=er(e.changedTouches?e.changedTouches[0]:e,this),s=n.invert(a),u=n.k*(e.shiftKey?.5:2),h=i(m(y(n,u),a,s),o.apply(this,t),l);tB(e),c>0?en(this).transition().duration(c).call(w,h,a,e):en(this).call(v.transform,h,a,e)}}function O(n,...o){if(r.apply(this,arguments)){var i,a,s,u,l=n.touches,c=l.length,h=b(this,o,n.changedTouches.length===c).event(n);for(tD(n),a=0;a<c;++a)u=[u=er(s=l[a],this),this.__zoom.invert(u),s.identifier],h.touch0?h.touch1||h.touch0[2]===u[2]||(h.touch1=u,h.taps=0):(h.touch0=u,i=!0,h.taps=1+!!e);e&&(e=clearTimeout(e)),i&&(h.taps<2&&(t=u[0],e=setTimeout(function(){e=null},500)),eq(this),h.start())}}function N(e,...t){if(this.__zooming){var n,r,o,a,s=b(this,t).event(e),u=e.changedTouches,c=u.length;for(tB(e),n=0;n<c;++n)o=er(r=u[n],this),s.touch0&&s.touch0[2]===r.identifier?s.touch0[0]=o:s.touch1&&s.touch1[2]===r.identifier&&(s.touch1[0]=o);if(r=s.that.__zoom,s.touch1){var h=s.touch0[0],d=s.touch0[1],f=s.touch1[0],p=s.touch1[1],g=(g=f[0]-h[0])*g+(g=f[1]-h[1])*g,v=(v=p[0]-d[0])*v+(v=p[1]-d[1])*v;r=y(r,Math.sqrt(g/v)),o=[(h[0]+f[0])/2,(h[1]+f[1])/2],a=[(d[0]+p[0])/2,(d[1]+p[1])/2]}else{if(!s.touch0)return;o=s.touch0[0],a=s.touch0[1]}s.zoom("touch",i(m(r,o,a),s.extent,l))}}function j(e,...r){if(this.__zooming){var o,i,a=b(this,r).event(e),s=e.changedTouches,u=s.length;for(tD(e),n&&clearTimeout(n),n=setTimeout(function(){n=null},500),o=0;o<u;++o)i=s[o],a.touch0&&a.touch0[2]===i.identifier?delete a.touch0:a.touch1&&a.touch1[2]===i.identifier&&delete a.touch1;if(a.touch1&&!a.touch0&&(a.touch0=a.touch1,delete a.touch1),a.touch0)a.touch0[1]=this.__zoom.invert(a.touch0[0]);else if(a.end(),2===a.taps&&(i=er(i,this),Math.hypot(t[0]-i[0],t[1]-i[1])<g)){var l=en(this).on("dblclick.zoom");l&&l.apply(this,arguments)}}}return v.transform=function(e,t,n,r){var o=e.selection?e.selection():e;o.property("__zoom",tV),e!==o?w(e,t,n,r):o.interrupt().each(function(){b(this,arguments).event(r).start().zoom(null,"function"==typeof t?t.apply(this,arguments):t).end()})},v.scaleBy=function(e,t,n,r){v.scaleTo(e,function(){var e=this.__zoom.k,n="function"==typeof t?t.apply(this,arguments):t;return e*n},n,r)},v.scaleTo=function(e,t,n,r){v.transform(e,function(){var e=o.apply(this,arguments),r=this.__zoom,a=null==n?x(e):"function"==typeof n?n.apply(this,arguments):n,s=r.invert(a),u="function"==typeof t?t.apply(this,arguments):t;return i(m(y(r,u),a,s),e,l)},n,r)},v.translateBy=function(e,t,n,r){v.transform(e,function(){return i(this.__zoom.translate("function"==typeof t?t.apply(this,arguments):t,"function"==typeof n?n.apply(this,arguments):n),o.apply(this,arguments),l)},null,r)},v.translateTo=function(e,t,n,r,a){v.transform(e,function(){var e=o.apply(this,arguments),a=this.__zoom,s=null==r?x(e):"function"==typeof r?r.apply(this,arguments):r;return i(tI.translate(s[0],s[1]).scale(a.k).translate("function"==typeof t?-t.apply(this,arguments):-t,"function"==typeof n?-n.apply(this,arguments):-n),e,l)},r,a)},_.prototype={event:function(e){return e&&(this.sourceEvent=e),this},start:function(){return 1==++this.active&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(e,t){return this.mouse&&"mouse"!==e&&(this.mouse[1]=t.invert(this.mouse[0])),this.touch0&&"touch"!==e&&(this.touch0[1]=t.invert(this.touch0[0])),this.touch1&&"touch"!==e&&(this.touch1[1]=t.invert(this.touch1[0])),this.that.__zoom=t,this.emit("zoom"),this},end:function(){return 0==--this.active&&(delete this.that.__zooming,this.emit("end")),this},emit:function(e){var t=en(this.that).datum();f.call(e,this.that,new tP(e,{sourceEvent:this.sourceEvent,target:v,type:e,transform:this.that.__zoom,dispatch:f}),t)}},v.wheelDelta=function(e){return arguments.length?(a="function"==typeof e?e:tL(+e),v):a},v.filter=function(e){return arguments.length?(r="function"==typeof e?e:tL(!!e),v):r},v.touchable=function(e){return arguments.length?(s="function"==typeof e?e:tL(!!e),v):s},v.extent=function(e){return arguments.length?(o="function"==typeof e?e:tL([[+e[0][0],+e[0][1]],[+e[1][0],+e[1][1]]]),v):o},v.scaleExtent=function(e){return arguments.length?(u[0]=+e[0],u[1]=+e[1],v):[u[0],u[1]]},v.translateExtent=function(e){return arguments.length?(l[0][0]=+e[0][0],l[1][0]=+e[1][0],l[0][1]=+e[0][1],l[1][1]=+e[1][1],v):[[l[0][0],l[0][1]],[l[1][0],l[1][1]]]},v.constrain=function(e){return arguments.length?(i=e,v):i},v.duration=function(e){return arguments.length?(c=+e,v):c},v.interpolate=function(e){return arguments.length?(h=e,v):h},v.on=function(){var e=f.on.apply(f,arguments);return e===f?v:e},v.clickDistance=function(e){return arguments.length?(p=(e*=1)*e,v):Math.sqrt(p)},v.tapDistance=function(e){return arguments.length?(g=+e,v):g},v}function tW(e,t){var n,r,o=typeof t;return null==t||"boolean"===o?tw(t):("number"===o?eV:"string"===o?(r=tr(t))?(t=r,t_):tO:t instanceof tr?t_:t instanceof Date?function(e,t){var n=new Date;return e*=1,t*=1,function(r){return n.setTime(e*(1-r)+t*r),n}}:!ArrayBuffer.isView(n=t)||n instanceof DataView?Array.isArray(t)?function(e,t){var n,r=t?t.length:0,o=e?Math.min(r,e.length):0,i=Array(o),a=Array(r);for(n=0;n<o;++n)i[n]=tW(e[n],t[n]);for(;n<r;++n)a[n]=t[n];return function(e){for(n=0;n<o;++n)a[n]=i[n](e);return a}}:"function"!=typeof t.valueOf&&"function"!=typeof t.toString||isNaN(t)?function(e,t){var n,r={},o={};for(n in(null===e||"object"!=typeof e)&&(e={}),(null===t||"object"!=typeof t)&&(t={}),t)n in e?r[n]=tW(e[n],t[n]):o[n]=t[n];return function(e){for(n in r)o[n]=r[n](e);return o}}:eV:function(e,t){t||(t=[]);var n,r=e?Math.min(t.length,e.length):0,o=t.slice();return function(i){for(n=0;n<r;++n)o[n]=e[n]*(1-i)+t[n]*i;return o}})(e,t)}tR.prototype=tT.prototype;let tK={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${"source"===e?n:r}", edge id: ${t}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs."},tU=[[-1/0,-1/0],[1/0,1/0]],tZ=["Enter"," ","Escape"],tQ={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};!function(e){e.Strict="strict",e.Loose="loose"}(o||(o={})),function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"}(i||(i={})),function(e){e.Partial="partial",e.Full="full"}(a||(a={}));let tJ={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};!function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"}(s||(s={})),function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"}(u||(u={})),function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"}(l||(l={}));let t0={[l.Left]:l.Right,[l.Right]:l.Left,[l.Top]:l.Bottom,[l.Bottom]:l.Top};function t1(e){return null===e?null:e?"valid":"invalid"}let t2=e=>"id"in e&&"source"in e&&"target"in e,t5=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),t3=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),t4=(e,t=[0,0])=>{let{width:n,height:r}=nk(e),o=e.origin??t,i=n*o[0],a=r*o[1];return{x:e.position.x-i,y:e.position.y-a}},t8=(e,t={nodeOrigin:[0,0]})=>0===e.length?{x:0,y:0,width:0,height:0}:nl(e.reduce((e,n)=>{let r="string"==typeof n,o=t.nodeLookup||r?void 0:n;return t.nodeLookup&&(o=r?t.nodeLookup.get(n):t3(n)?n:t.nodeLookup.get(n.id)),ns(e,o?nh(o,t.nodeOrigin):{x:0,y:0,x2:0,y2:0})},{x:1/0,y:1/0,x2:-1/0,y2:-1/0})),t6=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(e=>{(void 0===t.filter||t.filter(e))&&(n=ns(n,nh(e)),r=!0)}),r?nl(n):{x:0,y:0,width:0,height:0}},t9=(e,t,[n,r,o]=[0,0,1],i=!1,a=!1)=>{let s={...nm(t,[n,r,o]),width:t.width/o,height:t.height/o},u=[];for(let t of e.values()){let{measured:e,selectable:n=!0,hidden:r=!1}=t;if(a&&!n||r)continue;let o=e.width??t.width??t.initialWidth??null,l=e.height??t.height??t.initialHeight??null,c=nf(s,nc(t)),h=(o??0)*(l??0),d=i&&c>0;(!t.internals.handleBounds||d||c>=h||t.dragging)&&u.push(t)}return u};async function t7({nodes:e,width:t,height:n,panZoom:r,minZoom:o,maxZoom:i},a){if(0===e.size)return Promise.resolve(!0);let s=nb(t6(function(e,t){let n=new Map,r=t?.nodes?new Set(t.nodes.map(e=>e.id)):null;return e.forEach(e=>{e.measured.width&&e.measured.height&&(t?.includeHiddenNodes||!e.hidden)&&(!r||r.has(e.id))&&n.set(e.id,e)}),n}(e,a)),t,n,a?.minZoom??o,a?.maxZoom??i,a?.padding??.1);return await r.setViewport(s,{duration:a?.duration,ease:a?.ease,interpolate:a?.interpolate}),Promise.resolve(!0)}function ne({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:o,onError:i}){let a=n.get(e),s=a.parentId?n.get(a.parentId):void 0,{x:u,y:l}=s?s.internals.positionAbsolute:{x:0,y:0},c=a.origin??r,h=a.extent||o;if("parent"!==a.extent||a.expandParent)s&&nE(a.extent)&&(h=[[a.extent[0][0]+u,a.extent[0][1]+l],[a.extent[1][0]+u,a.extent[1][1]+l]]);else if(s){let e=s.measured.width,t=s.measured.height;e&&t&&(h=[[u,l],[u+e,l+t]])}else i?.("005",tK.error005());let d=nE(h)?nr(t,h,a.measured):t;return(void 0===a.measured.width||void 0===a.measured.height)&&i?.("015",tK.error015()),{position:{x:d.x-u+(a.measured.width??0)*c[0],y:d.y-l+(a.measured.height??0)*c[1]},positionAbsolute:d}}async function nt({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:o}){let i=new Set(e.map(e=>e.id)),a=[];for(let e of n){if(!1===e.deletable)continue;let t=i.has(e.id),n=!t&&e.parentId&&a.find(t=>t.id===e.parentId);(t||n)&&a.push(e)}let s=new Set(t.map(e=>e.id)),u=r.filter(e=>!1!==e.deletable),l=((e,t)=>{let n=new Set;return e.forEach(e=>{n.add(e.id)}),t.filter(e=>n.has(e.source)||n.has(e.target))})(a,u);for(let e of u)s.has(e.id)&&!l.find(t=>t.id===e.id)&&l.push(e);if(!o)return{edges:l,nodes:a};let c=await o({nodes:a,edges:l});return"boolean"==typeof c?c?{edges:l,nodes:a}:{edges:[],nodes:[]}:c}let nn=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),nr=(e={x:0,y:0},t,n)=>({x:nn(e.x,t[0][0],t[1][0]-(n?.width??0)),y:nn(e.y,t[0][1],t[1][1]-(n?.height??0))});function no(e,t,n){let{width:r,height:o}=nk(n),{x:i,y:a}=n.internals.positionAbsolute;return nr(e,[[i,a],[i+r,a+o]],t)}let ni=(e,t,n)=>e<t?nn(Math.abs(e-t),1,t)/t:e>n?-nn(Math.abs(e-n),1,t)/t:0,na=(e,t,n=15,r=40)=>[ni(e.x,r,t.width-r)*n,ni(e.y,r,t.height-r)*n],ns=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),nu=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),nl=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),nc=(e,t=[0,0])=>{let{x:n,y:r}=t3(e)?e.internals.positionAbsolute:t4(e,t);return{x:n,y:r,width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}},nh=(e,t=[0,0])=>{let{x:n,y:r}=t3(e)?e.internals.positionAbsolute:t4(e,t);return{x:n,y:r,x2:n+(e.measured?.width??e.width??e.initialWidth??0),y2:r+(e.measured?.height??e.height??e.initialHeight??0)}},nd=(e,t)=>nl(ns(nu(e),nu(t))),nf=(e,t)=>Math.ceil(Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x))*Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y))),np=e=>ng(e.width)&&ng(e.height)&&ng(e.x)&&ng(e.y),ng=e=>!isNaN(e)&&isFinite(e),nv=(e,t)=>{},ny=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),nm=({x:e,y:t},[n,r,o],i=!1,a=[1,1])=>{let s={x:(e-n)/o,y:(t-r)/o};return i?ny(s,a):s},nx=({x:e,y:t},[n,r,o])=>({x:e*o+n,y:t*o+r});function nw(e,t){if("number"==typeof e)return Math.floor((t-t/(1+e))*.5);if("string"==typeof e&&e.endsWith("px")){let t=parseFloat(e);if(!Number.isNaN(t))return Math.floor(t)}if("string"==typeof e&&e.endsWith("%")){let n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`[React Flow] The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}let nb=(e,t,n,r,o,i)=>{let a=function(e,t,n){if("string"==typeof e||"number"==typeof e){let r=nw(e,n),o=nw(e,t);return{top:r,right:o,bottom:r,left:o,x:2*o,y:2*r}}if("object"==typeof e){let r=nw(e.top??e.y??0,n),o=nw(e.bottom??e.y??0,n),i=nw(e.left??e.x??0,t),a=nw(e.right??e.x??0,t);return{top:r,right:a,bottom:o,left:i,x:i+a,y:r+o}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}(i,t,n),s=nn(Math.min((t-a.x)/e.width,(n-a.y)/e.height),r,o),u=e.x+e.width/2,l=e.y+e.height/2,c=t/2-u*s,h=n/2-l*s,d=function(e,t,n,r,o,i){let{x:a,y:s}=nx(e,[t,n,r]),{x:u,y:l}=nx({x:e.x+e.width,y:e.y+e.height},[t,n,r]);return{left:Math.floor(a),top:Math.floor(s),right:Math.floor(o-u),bottom:Math.floor(i-l)}}(e,c,h,s,t,n),f={left:Math.min(d.left-a.left,0),top:Math.min(d.top-a.top,0),right:Math.min(d.right-a.right,0),bottom:Math.min(d.bottom-a.bottom,0)};return{x:c-f.left+f.right,y:h-f.top+f.bottom,zoom:s}},n_=()=>"undefined"!=typeof navigator&&navigator?.userAgent?.indexOf("Mac")>=0;function nE(e){return null!=e&&"parent"!==e}function nk(e){return{width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}}function nM(e){return(e.measured?.width??e.width??e.initialWidth)!==void 0&&(e.measured?.height??e.height??e.initialHeight)!==void 0}function nO(e,t={width:0,height:0},n,r,o){let i={...e},a=r.get(n);if(a){let e=a.origin||o;i.x+=a.internals.positionAbsolute.x-(t.width??0)*e[0],i.y+=a.internals.positionAbsolute.y-(t.height??0)*e[1]}return i}function nN(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function nj(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}function nA(e){return{...tQ,...e||{}}}function nz(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:o}){let{x:i,y:a}=nT(e),s=nm({x:i-(o?.left??0),y:a-(o?.top??0)},r),{x:u,y:l}=n?ny(s,t):s;return{xSnapped:u,ySnapped:l,...s}}let n$=e=>({width:e.offsetWidth,height:e.offsetHeight}),nC=e=>e?.getRootNode?.()||window?.document,nS=["INPUT","SELECT","TEXTAREA"];function nL(e){let t=e.composedPath?.()?.[0]||e.target;return t?.nodeType===1&&(nS.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey"))}let nP=e=>"clientX"in e,nT=(e,t)=>{let n=nP(e),r=n?e.clientX:e.touches?.[0].clientX,o=n?e.clientY:e.touches?.[0].clientY;return{x:r-(t?.left??0),y:o-(t?.top??0)}},nI=(e,t,n,r,o)=>{let i=t.querySelectorAll(`.${e}`);return i&&i.length?Array.from(i).map(t=>{let i=t.getBoundingClientRect();return{id:t.getAttribute("data-handleid"),type:e,nodeId:o,position:t.getAttribute("data-handlepos"),x:(i.left-n.left)/r,y:(i.top-n.top)/r,...n$(t)}}):null};function nR({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:o,sourceControlY:i,targetControlX:a,targetControlY:s}){let u=.125*e+.375*o+.375*a+.125*n,l=.125*t+.375*i+.375*s+.125*r,c=Math.abs(u-e),h=Math.abs(l-t);return[u,l,c,h]}function nD(e,t){return e>=0?.5*e:25*t*Math.sqrt(-e)}function nB({pos:e,x1:t,y1:n,x2:r,y2:o,c:i}){switch(e){case l.Left:return[t-nD(t-r,i),n];case l.Right:return[t+nD(r-t,i),n];case l.Top:return[t,n-nD(n-o,i)];case l.Bottom:return[t,n+nD(o-n,i)]}}function nH({sourceX:e,sourceY:t,sourcePosition:n=l.Bottom,targetX:r,targetY:o,targetPosition:i=l.Top,curvature:a=.25}){let[s,u]=nB({pos:n,x1:e,y1:t,x2:r,y2:o,c:a}),[c,h]=nB({pos:i,x1:r,y1:o,x2:e,y2:t,c:a}),[d,f,p,g]=nR({sourceX:e,sourceY:t,targetX:r,targetY:o,sourceControlX:s,sourceControlY:u,targetControlX:c,targetControlY:h});return[`M${e},${t} C${s},${u} ${c},${h} ${r},${o}`,d,f,p,g]}function nq({sourceX:e,sourceY:t,targetX:n,targetY:r}){let o=Math.abs(n-e)/2,i=Math.abs(r-t)/2;return[n<e?n+o:n-o,r<t?r+i:r-i,o,i]}function nV({sourceNode:e,targetNode:t,selected:n=!1,zIndex:r=0,elevateOnSelect:o=!1,zIndexMode:i="basic"}){if("manual"===i)return r;let a=Math.max(e.parentId||o&&e.selected?e.internals.z:0,t.parentId||o&&t.selected?t.internals.z:0);return(o&&n?r+1e3:r)+a}function nX({sourceNode:e,targetNode:t,width:n,height:r,transform:o}){let i=ns(nh(e),nh(t));return i.x===i.x2&&(i.x2+=1),i.y===i.y2&&(i.y2+=1),nf({x:-o[0]/o[2],y:-o[1]/o[2],width:n/o[2],height:r/o[2]},nl(i))>0}let nY=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,nF=(e,t,n={})=>{let r;if(!e.source||!e.target)return nv("006",tK.error006()),t;let o=n.getEdgeId||nY;return((e,t)=>t.some(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)))(r=t2(e)?{...e}:{...e,id:o(e)},t)?t:(null===r.sourceHandle&&delete r.sourceHandle,null===r.targetHandle&&delete r.targetHandle,t.concat(r))};function nG({sourceX:e,sourceY:t,targetX:n,targetY:r}){let[o,i,a,s]=nq({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,o,i,a,s]}let nW={[l.Left]:{x:-1,y:0},[l.Right]:{x:1,y:0},[l.Top]:{x:0,y:-1},[l.Bottom]:{x:0,y:1}},nK=({source:e,sourcePosition:t=l.Bottom,target:n})=>t===l.Left||t===l.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},nU=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function nZ({sourceX:e,sourceY:t,sourcePosition:n=l.Bottom,targetX:r,targetY:o,targetPosition:i=l.Top,borderRadius:a=5,centerX:s,centerY:u,offset:c=20,stepPosition:h=.5}){let[d,f,p,g,v]=function({source:e,sourcePosition:t=l.Bottom,target:n,targetPosition:r=l.Top,center:o,offset:i,stepPosition:a}){let s,u,c=nW[t],h=nW[r],d={x:e.x+c.x*i,y:e.y+c.y*i},f={x:n.x+h.x*i,y:n.y+h.y*i},p=nK({source:d,sourcePosition:t,target:f}),g=0!==p.x?"x":"y",v=p[g],y=[],m={x:0,y:0},x={x:0,y:0},[,,w,b]=nq({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(c[g]*h[g]==-1){"x"===g?(s=o.x??d.x+(f.x-d.x)*a,u=o.y??(d.y+f.y)/2):(s=o.x??(d.x+f.x)/2,u=o.y??d.y+(f.y-d.y)*a);let e=[{x:s,y:d.y},{x:s,y:f.y}],t=[{x:d.x,y:u},{x:f.x,y:u}];y=c[g]===v?"x"===g?e:t:"x"===g?t:e}else{let o=[{x:d.x,y:f.y}],a=[{x:f.x,y:d.y}];if(y="x"===g?c.x===v?a:o:c.y===v?o:a,t===r){let t=Math.abs(e[g]-n[g]);if(t<=i){let r=Math.min(i-1,i-t);c[g]===v?m[g]=(d[g]>e[g]?-1:1)*r:x[g]=(f[g]>n[g]?-1:1)*r}}if(t!==r){let e="x"===g?"y":"x",t=c[g]===h[e],n=d[e]>f[e],r=d[e]<f[e];(1===c[g]&&(!t&&n||t&&r)||1!==c[g]&&(!t&&r||t&&n))&&(y="x"===g?o:a)}let l={x:d.x+m.x,y:d.y+m.y},p={x:f.x+x.x,y:f.y+x.y};Math.max(Math.abs(l.x-y[0].x),Math.abs(p.x-y[0].x))>=Math.max(Math.abs(l.y-y[0].y),Math.abs(p.y-y[0].y))?(s=(l.x+p.x)/2,u=y[0].y):(s=y[0].x,u=(l.y+p.y)/2)}return[[e,{x:d.x+m.x,y:d.y+m.y},...y,{x:f.x+x.x,y:f.y+x.y},n],s,u,w,b]}({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:o},targetPosition:i,center:{x:s,y:u},offset:c,stepPosition:h});return[d.reduce((e,t,n)=>e+(n>0&&n<d.length-1?function(e,t,n,r){let o=Math.min(nU(e,t)/2,nU(t,n)/2,r),{x:i,y:a}=t;if(e.x===i&&i===n.x||e.y===a&&a===n.y)return`L${i} ${a}`;if(e.y===a){let t=e.x<n.x?-1:1,r=e.y<n.y?1:-1;return`L ${i+o*t},${a}Q ${i},${a} ${i},${a+o*r}`}let s=e.x<n.x?1:-1,u=e.y<n.y?-1:1;return`L ${i},${a+o*u}Q ${i},${a} ${i+o*s},${a}`}(d[n-1],t,d[n+1],a):`${0===n?"M":"L"}${t.x} ${t.y}`),""),f,p,g,v]}function nQ(e){return e&&!!(e.internals.handleBounds||e.handles?.length)&&!!(e.measured.width||e.width||e.initialWidth)}function nJ(e){let{sourceNode:t,targetNode:n}=e;if(!nQ(t)||!nQ(n))return null;let r=t.internals.handleBounds||n0(t.handles),i=n.internals.handleBounds||n0(n.handles),a=n2(r?.source??[],e.sourceHandle),s=n2(e.connectionMode===o.Strict?i?.target??[]:(i?.target??[]).concat(i?.source??[]),e.targetHandle);if(!a||!s)return e.onError?.("008",tK.error008(!a?"source":"target",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;let u=a?.position||l.Bottom,c=s?.position||l.Top,h=n1(t,a,u),d=n1(n,s,c);return{sourceX:h.x,sourceY:h.y,targetX:d.x,targetY:d.y,sourcePosition:u,targetPosition:c}}function n0(e){if(!e)return null;let t=[],n=[];for(let r of e)r.width=r.width??1,r.height=r.height??1,"source"===r.type?t.push(r):"target"===r.type&&n.push(r);return{source:t,target:n}}function n1(e,t,n=l.Left,r=!1){let o=(t?.x??0)+e.internals.positionAbsolute.x,i=(t?.y??0)+e.internals.positionAbsolute.y,{width:a,height:s}=t??nk(e);if(r)return{x:o+a/2,y:i+s/2};switch(t?.position??n){case l.Top:return{x:o+a/2,y:i};case l.Right:return{x:o+a,y:i+s/2};case l.Bottom:return{x:o+a/2,y:i+s};case l.Left:return{x:o,y:i+s/2}}}function n2(e,t){return e&&(t?e.find(e=>e.id===t):e[0])||null}function n5(e,t){if(!e)return"";if("string"==typeof e)return e;let n=t?`${t}__`:"";return`${n}${Object.keys(e).sort().map(t=>`${t}=${e[t]}`).join("&")}`}function n3(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:o}){let i=new Set;return e.reduce((e,a)=>([a.markerStart||r,a.markerEnd||o].forEach(r=>{if(r&&"object"==typeof r){let o=n5(r,t);i.has(o)||(e.push({id:o,color:r.color||n,...r}),i.add(o))}}),e),[]).sort((e,t)=>e.id.localeCompare(t.id))}let n4={nodeOrigin:[0,0],nodeExtent:tU,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},n8={...n4,checkEquality:!0};function n6(e,t){let n={...e};for(let e in t)void 0!==t[e]&&(n[e]=t[e]);return n}function n9(e,t,n){let r=n6(n4,n);for(let n of e.values())if(n.parentId)rt(n,e,t,r);else{let e=nr(t4(n,r.nodeOrigin),nE(n.extent)?n.extent:r.nodeExtent,nk(n));n.internals.positionAbsolute=e}}function n7(e){return"manual"===e}function re(e,t,n,r={}){let o=n6(n8,r),i={i:0},a=new Map(t),s=o?.elevateNodesOnSelect&&!n7(o.zIndexMode)?1e3:0,u=e.length>0;for(let l of(t.clear(),n.clear(),e)){let e=a.get(l.id);if(o.checkEquality&&l===e?.internals.userNode)t.set(l.id,e);else{let n=nr(t4(l,o.nodeOrigin),nE(l.extent)?l.extent:o.nodeExtent,nk(l));e={...o.defaults,...l,measured:{width:l.measured?.width,height:l.measured?.height},internals:{positionAbsolute:n,handleBounds:function(e,t){if(!e.handles)return e.measured?t?.internals.handleBounds:void 0;let n=[],r=[];for(let t of e.handles){let o={id:t.id,width:t.width??1,height:t.height??1,nodeId:e.id,x:t.x,y:t.y,position:t.position,type:t.type};"source"===t.type?n.push(o):"target"===t.type&&r.push(o)}return{source:n,target:r}}(l,e),z:rn(l,s,o.zIndexMode),userNode:l}},t.set(l.id,e)}void 0!==e.measured&&void 0!==e.measured.width&&void 0!==e.measured.height||e.hidden||(u=!1),l.parentId&&rt(e,t,n,r,i)}return u}function rt(e,t,n,r,o){let{elevateNodesOnSelect:i,nodeOrigin:a,nodeExtent:s,zIndexMode:u}=n6(n4,r),l=e.parentId,c=t.get(l);if(!c)return void console.warn(`Parent node ${l} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);!function(e,t){if(!e.parentId)return;let n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}(e,n),o&&!c.parentId&&void 0===c.internals.rootParentIndex&&"auto"===u&&(c.internals.rootParentIndex=++o.i,c.internals.z=c.internals.z+10*o.i),o&&void 0!==c.internals.rootParentIndex&&(o.i=c.internals.rootParentIndex);let{x:h,y:d,z:f}=function(e,t,n,r,o,i){let{x:a,y:s}=t.internals.positionAbsolute,u=nk(e),l=t4(e,n),c=nE(e.extent)?nr(l,e.extent,u):l,h=nr({x:a+c.x,y:s+c.y},r,u);"parent"===e.extent&&(h=no(h,u,t));let d=rn(e,o,i),f=t.internals.z??0;return{x:h.x,y:h.y,z:f>=d?f+1:d}}(e,c,a,s,i&&!n7(u)?1e3:0,u),{positionAbsolute:p}=e.internals,g=h!==p.x||d!==p.y;(g||f!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:g?{x:h,y:d}:p,z:f}})}function rn(e,t,n){let r=ng(e.zIndex)?e.zIndex:0;return n7(n)?r:r+(e.selected?t:0)}function rr(e,t,n,r=[0,0]){let o=[],i=new Map;for(let n of e){let e=t.get(n.parentId);if(!e)continue;let r=nd(i.get(n.parentId)?.expandedRect??nc(e),n.rect);i.set(n.parentId,{expandedRect:r,parent:e})}return i.size>0&&i.forEach(({expandedRect:t,parent:i},a)=>{let s=i.internals.positionAbsolute,u=nk(i),l=i.origin??r,c=t.x<s.x?Math.round(Math.abs(s.x-t.x)):0,h=t.y<s.y?Math.round(Math.abs(s.y-t.y)):0,d=Math.max(u.width,Math.round(t.width)),f=Math.max(u.height,Math.round(t.height)),p=(d-u.width)*l[0],g=(f-u.height)*l[1];(c>0||h>0||p||g)&&(o.push({id:a,type:"position",position:{x:i.position.x-c+p,y:i.position.y-h+g}}),n.get(a)?.forEach(t=>{e.some(e=>e.id===t.id)||o.push({id:t.id,type:"position",position:{x:t.position.x+c,y:t.position.y+h}})})),(u.width<t.width||u.height<t.height||c||h)&&o.push({id:a,type:"dimensions",setAttributes:!0,dimensions:{width:d+(c?l[0]*c-p:0),height:f+(h?l[1]*h-g:0)}})}),o}function ro(e,t,n,r,o,i,a){let s=r?.querySelector(".xyflow__viewport"),u=!1;if(!s)return{changes:[],updatedInternals:u};let l=[],c=window.getComputedStyle(s),{m22:h}=new window.DOMMatrixReadOnly(c.transform),d=[];for(let r of e.values()){let e=t.get(r.id);if(!e)continue;if(e.hidden){t.set(e.id,{...e,internals:{...e.internals,handleBounds:void 0}}),u=!0;continue}let s=n$(r.nodeElement),c=e.measured.width!==s.width||e.measured.height!==s.height;if(s.width&&s.height&&(c||!e.internals.handleBounds||r.force)){let f=r.nodeElement.getBoundingClientRect(),p=nE(e.extent)?e.extent:i,{positionAbsolute:g}=e.internals;e.parentId&&"parent"===e.extent?g=no(g,s,t.get(e.parentId)):p&&(g=nr(g,p,s));let v={...e,measured:s,internals:{...e.internals,positionAbsolute:g,handleBounds:{source:nI("source",r.nodeElement,f,h,e.id),target:nI("target",r.nodeElement,f,h,e.id)}}};t.set(e.id,v),e.parentId&&rt(v,t,n,{nodeOrigin:o,zIndexMode:a}),u=!0,c&&(l.push({id:e.id,type:"dimensions",dimensions:s}),e.expandParent&&e.parentId&&d.push({id:e.id,parentId:e.parentId,rect:nc(v,o)}))}}if(d.length>0){let e=rr(d,t,n,o);l.push(...e)}return{changes:l,updatedInternals:u}}async function ri({delta:e,panZoom:t,transform:n,translateExtent:r,width:o,height:i}){if(!t||!e.x&&!e.y)return Promise.resolve(!1);let a=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[o,i]],r);return Promise.resolve(!!a&&(a.x!==n[0]||a.y!==n[1]||a.k!==n[2]))}function ra(e,t,n,r,o,i){let a=o,s=r.get(a)||new Map;r.set(a,s.set(n,t)),a=`${o}-${e}`;let u=r.get(a)||new Map;if(r.set(a,u.set(n,t)),i){a=`${o}-${e}-${i}`;let s=r.get(a)||new Map;r.set(a,s.set(n,t))}}function rs(e,t,n){for(let r of(e.clear(),t.clear(),n)){let{source:n,target:o,sourceHandle:i=null,targetHandle:a=null}=r,s={edgeId:r.id,source:n,target:o,sourceHandle:i,targetHandle:a},u=`${n}-${i}--${o}-${a}`;ra("source",s,`${o}-${a}--${n}-${i}`,e,n,i),ra("target",s,u,e,o,a),t.set(r.id,r)}}function ru(e,t,n){let r=e;do{if(r?.matches?.(t))return!0;if(r===n)break;r=r?.parentElement}while(r);return!1}function rl({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){let o=[];for(let[e,i]of t){let t=n.get(e)?.internals.userNode;t&&o.push({...t,position:i.position,dragging:r})}if(!e)return[o[0],o];let i=n.get(e)?.internals.userNode;return[i?{...i,position:t.get(e)?.position||i.position,dragging:r}:o[0],o]}function rc({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:o}){let i={x:null,y:null},a=0,s=new Map,u=!1,l={x:0,y:0},c=null,h=!1,f=null,p=!1,g=!1,v=null;return{update:function({noDragClassName:y,handleSelector:m,domNode:x,isSelectable:w,nodeId:b,nodeClickDistance:_=0}){function E({x:e,y:n}){let{nodeLookup:o,nodeExtent:a,snapGrid:u,snapToGrid:l,nodeOrigin:c,onNodeDrag:h,onSelectionDrag:d,onError:f,updateNodePositions:p}=t();i={x:e,y:n};let y=!1,m=s.size>1,x=m&&a?nu(t6(s)):null,w=m&&l?function({dragItems:e,snapGrid:t,x:n,y:r}){let o=e.values().next().value;if(!o)return null;let i={x:n-o.distance.x,y:r-o.distance.y},a=ny(i,t);return{x:a.x-i.x,y:a.y-i.y}}({dragItems:s,snapGrid:u,x:e,y:n}):null;for(let[t,r]of s){if(!o.has(t))continue;let i={x:e-r.distance.x,y:n-r.distance.y};l&&(i=w?{x:Math.round(i.x+w.x),y:Math.round(i.y+w.y)}:ny(i,u));let s=null;if(m&&a&&!r.extent&&x){let{positionAbsolute:e}=r.internals,t=e.x-x.x+a[0][0],n=e.x+r.measured.width-x.x2+a[1][0];s=[[t,e.y-x.y+a[0][1]],[n,e.y+r.measured.height-x.y2+a[1][1]]]}let{position:h,positionAbsolute:d}=ne({nodeId:t,nextPosition:i,nodeLookup:o,nodeExtent:s||a,nodeOrigin:c,onError:f});y=y||r.position.x!==h.x||r.position.y!==h.y,r.position=h,r.internals.positionAbsolute=d}if(g=g||y,y&&(p(s,!0),v&&(r||h||!b&&d))){let[e,t]=rl({nodeId:b,dragItems:s,nodeLookup:o});r?.(v,s,e,t),h?.(v,e,t),b||d?.(v,t)}}async function k(){if(!c)return;let{transform:e,panBy:n,autoPanSpeed:r,autoPanOnNodeDrag:o}=t();if(!o){u=!1,cancelAnimationFrame(a);return}let[s,h]=na(l,c,r);(0!==s||0!==h)&&(i.x=(i.x??0)-s/e[2],i.y=(i.y??0)-h/e[2],await n({x:s,y:h})&&E(i)),a=requestAnimationFrame(k)}function M(r){let{nodeLookup:o,multiSelectionActive:a,nodesDraggable:u,transform:l,snapGrid:d,snapToGrid:f,selectNodesOnDrag:p,onNodeDragStart:g,onSelectionDragStart:v,unselectNodesAndEdges:y}=t();h=!0,p&&w||a||!b||o.get(b)?.selected||y(),w&&p&&b&&e?.(b);let m=nz(r.sourceEvent,{transform:l,snapGrid:d,snapToGrid:f,containerBounds:c});if(i=m,(s=function(e,t,n,r){let o=new Map;for(let[i,a]of e)if((a.selected||a.id===r)&&(!a.parentId||!function e(t,n){if(!t.parentId)return!1;let r=n.get(t.parentId);return!!r&&(!!r.selected||e(r,n))}(a,e))&&(a.draggable||t&&void 0===a.draggable)){let t=e.get(i);t&&o.set(i,{id:i,position:t.position||{x:0,y:0},distance:{x:n.x-t.internals.positionAbsolute.x,y:n.y-t.internals.positionAbsolute.y},extent:t.extent,parentId:t.parentId,origin:t.origin,expandParent:t.expandParent,internals:{positionAbsolute:t.internals.positionAbsolute||{x:0,y:0}},measured:{width:t.measured.width??0,height:t.measured.height??0}})}return o}(o,u,m,b)).size>0&&(n||g||!b&&v)){let[e,t]=rl({nodeId:b,dragItems:s,nodeLookup:o});n?.(r.sourceEvent,s,e,t),g?.(r.sourceEvent,e,t),b||v?.(r.sourceEvent,t)}}f=en(x);let O=(function(){var e,t,n,r,o=ed,i=ef,a=ep,s=eg,u={},l=d("start","drag","end"),c=0,h=0;function f(e){e.on("mousedown.drag",p).filter(s).on("touchstart.drag",y).on("touchmove.drag",m,eo).on("touchend.drag touchcancel.drag",x).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function p(a,s){if(!r&&o.call(this,a,s)){var u=w(this,i.call(this,a,s),a,s,"mouse");u&&(en(a.view).on("mousemove.drag",g,ei).on("mouseup.drag",v,ei),eu(a.view),ea(a),n=!1,e=a.clientX,t=a.clientY,u("start",a))}}function g(r){if(es(r),!n){var o=r.clientX-e,i=r.clientY-t;n=o*o+i*i>h}u.mouse("drag",r)}function v(e){en(e.view).on("mousemove.drag mouseup.drag",null),el(e.view,n),es(e),u.mouse("end",e)}function y(e,t){if(o.call(this,e,t)){var n,r,a=e.changedTouches,s=i.call(this,e,t),u=a.length;for(n=0;n<u;++n)(r=w(this,s,e,t,a[n].identifier,a[n]))&&(ea(e),r("start",e,a[n]))}}function m(e){var t,n,r=e.changedTouches,o=r.length;for(t=0;t<o;++t)(n=u[r[t].identifier])&&(es(e),n("drag",e,r[t]))}function x(e){var t,n,o=e.changedTouches,i=o.length;for(r&&clearTimeout(r),r=setTimeout(function(){r=null},500),t=0;t<i;++t)(n=u[o[t].identifier])&&(ea(e),n("end",e,o[t]))}function w(e,t,n,r,o,i){var s,h,d,p=l.copy(),g=er(i||n,t);if(null!=(d=a.call(e,new eh("beforestart",{sourceEvent:n,target:f,identifier:o,active:c,x:g[0],y:g[1],dx:0,dy:0,dispatch:p}),r)))return s=d.x-g[0]||0,h=d.y-g[1]||0,function n(i,a,l){var v,y=g;switch(i){case"start":u[o]=n,v=c++;break;case"end":delete u[o],--c;case"drag":g=er(l||a,t),v=c}p.call(i,e,new eh(i,{sourceEvent:a,subject:d,target:f,identifier:o,active:v,x:g[0]+s,y:g[1]+h,dx:g[0]-y[0],dy:g[1]-y[1],dispatch:p}),r)}}return f.filter=function(e){return arguments.length?(o="function"==typeof e?e:ec(!!e),f):o},f.container=function(e){return arguments.length?(i="function"==typeof e?e:ec(e),f):i},f.subject=function(e){return arguments.length?(a="function"==typeof e?e:ec(e),f):a},f.touchable=function(e){return arguments.length?(s="function"==typeof e?e:ec(!!e),f):s},f.on=function(){var e=l.on.apply(l,arguments);return e===l?f:e},f.clickDistance=function(e){return arguments.length?(h=(e*=1)*e,f):Math.sqrt(h)},f})().clickDistance(_).on("start",e=>{let{domNode:n,nodeDragThreshold:r,transform:o,snapGrid:a,snapToGrid:s}=t();c=n?.getBoundingClientRect()||null,p=!1,g=!1,v=e.sourceEvent,0===r&&M(e),i=nz(e.sourceEvent,{transform:o,snapGrid:a,snapToGrid:s,containerBounds:c}),l=nT(e.sourceEvent,c)}).on("drag",e=>{let{autoPanOnNodeDrag:n,transform:r,snapGrid:o,snapToGrid:a,nodeDragThreshold:d,nodeLookup:f}=t(),g=nz(e.sourceEvent,{transform:r,snapGrid:o,snapToGrid:a,containerBounds:c});if(v=e.sourceEvent,("touchmove"===e.sourceEvent.type&&e.sourceEvent.touches.length>1||b&&!f.has(b))&&(p=!0),!p){if(!u&&n&&h&&(u=!0,k()),!h){let t=nT(e.sourceEvent,c),n=t.x-l.x,r=t.y-l.y;Math.sqrt(n*n+r*r)>d&&M(e)}(i.x!==g.xSnapped||i.y!==g.ySnapped)&&s&&h&&(l=nT(e.sourceEvent,c),E(g))}}).on("end",e=>{if(h&&!p&&(u=!1,h=!1,cancelAnimationFrame(a),s.size>0)){let{nodeLookup:n,updateNodePositions:r,onNodeDragStop:i,onSelectionDragStop:a}=t();if(g&&(r(s,!1),g=!1),o||i||!b&&a){let[t,r]=rl({nodeId:b,dragItems:s,nodeLookup:n,dragging:!1});o?.(e.sourceEvent,s,t,r),i?.(e.sourceEvent,t,r),b||a?.(e.sourceEvent,r)}}}).filter(e=>{let t=e.target;return!e.button&&(!y||!ru(t,`.${y}`,x))&&(!m||ru(t,m,x))});f.call(O)},destroy:function(){f?.on(".drag",null)}}}function rh(e,t,n,r,o,i=!1){let a=r.get(e);if(!a)return null;let s="strict"===o?a.internals.handleBounds?.[t]:[...a.internals.handleBounds?.source??[],...a.internals.handleBounds?.target??[]],u=(n?s?.find(e=>e.id===n):s?.[0])??null;return u&&i?{...u,...n1(a,u,u.position,!0)}:u}function rd(e,t){return e?e:t?.classList.contains("target")?"target":t?.classList.contains("source")?"source":null}let rf=()=>!0;function rp(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:a,doc:s,lib:u,flowId:l,isValidConnection:c=rf,nodeLookup:h}){let d="target"===a,f=t?s.querySelector(`.${u}-flow__handle[data-id="${l}-${t?.nodeId}-${t?.id}-${t?.type}"]`):null,{x:p,y:g}=nT(e),v=s.elementFromPoint(p,g),y=v?.classList.contains(`${u}-flow__handle`)?v:f,m={handleDomNode:y,isValid:!1,connection:null,toHandle:null};if(y){let e=rd(void 0,y),t=y.getAttribute("data-nodeid"),a=y.getAttribute("data-handleid"),s=y.classList.contains("connectable"),u=y.classList.contains("connectableend");if(!t||!e)return m;let l={source:d?t:r,sourceHandle:d?a:i,target:d?r:t,targetHandle:d?i:a};m.connection=l,m.isValid=s&&u&&(n===o.Strict?d&&"source"===e||!d&&"target"===e:t!==r||a!==i)&&c(l),m.toHandle=rh(t,e,a,h,n,!0)}return m}let rg={onPointerDown:function(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:o,edgeUpdaterType:i,isTarget:a,domNode:s,nodeLookup:u,lib:c,autoPanOnConnect:h,flowId:d,panBy:f,cancelConnection:p,onConnectStart:g,onConnect:v,onConnectEnd:y,isValidConnection:m=rf,onReconnectEnd:x,updateConnection:w,getTransform:b,getFromHandle:_,autoPanSpeed:E,dragThreshold:k=1,handleDomNode:M}){let O,N=nC(e.target),j=0,{x:A,y:z}=nT(e),$=rd(i,M),C=s?.getBoundingClientRect(),S=!1;if(!C||!$)return;let L=rh(o,$,r,u,t);if(!L)return;let P=nT(e,C),T=!1,I=null,R=!1,D=null,B={...L,nodeId:o,type:$,position:L.position},H=u.get(o),q={inProgress:!0,isValid:null,from:n1(H,B,l.Left,!0),fromHandle:B,fromPosition:B.position,fromNode:H,to:P,toHandle:null,toPosition:t0[B.position],toNode:null,pointer:P};function V(){S=!0,w(q),g?.(e,{nodeId:o,handleId:r,handleType:$})}function X(e){var i,s;let p;if(!S){let{x:t,y:n}=nT(e),r=t-A,o=n-z;if(!(r*r+o*o>k*k))return;V()}if(!_()||!B)return void Y(e);let g=b();O=function(e,t,n,r){let o=[],i=1/0;for(let a of function(e,t,n){let r=[],o={x:e.x-n,y:e.y-n,width:2*n,height:2*n};for(let e of t.values())nf(o,nc(e))>0&&r.push(e);return r}(e,n,t+250))for(let n of[...a.internals.handleBounds?.source??[],...a.internals.handleBounds?.target??[]]){if(r.nodeId===n.nodeId&&r.type===n.type&&r.id===n.id)continue;let{x:s,y:u}=n1(a,n,n.position,!0),l=Math.sqrt(Math.pow(s-e.x,2)+Math.pow(u-e.y,2));l>t||(l<i?(o=[{...n,x:s,y:u}],i=l):l===i&&o.push({...n,x:s,y:u}))}if(!o.length)return null;if(o.length>1){let e="source"===r.type?"target":"source";return o.find(t=>t.type===e)??o[0]}return o[0]}(nm(P=nT(e,C),g,!1,[1,1]),n,u,B),T||(!function e(){if(!h||!C)return;let[t,n]=na(P,C,E);f({x:t,y:n}),j=requestAnimationFrame(e)}(),T=!0);let v=rp(e,{handle:O,connectionMode:t,fromNodeId:o,fromHandleId:r,fromType:a?"target":"source",isValidConnection:m,doc:N,lib:c,flowId:d,nodeLookup:u});D=v.handleDomNode,I=v.connection,i=!!O,s=v.isValid,p=null,s?p=!0:i&&!s&&(p=!1),R=p;let y=u.get(o),x=y?n1(y,B,l.Left,!0):q.from,M={...q,from:x,isValid:R,to:v.toHandle&&R?nx({x:v.toHandle.x,y:v.toHandle.y},g):P,toHandle:v.toHandle,toPosition:R&&v.toHandle?v.toHandle.position:t0[B.position],toNode:v.toHandle?u.get(v.toHandle.nodeId):null,pointer:P};w(M),q=M}function Y(e){if(!("touches"in e)||!(e.touches.length>0)){if(S){(O||D)&&I&&R&&v?.(I);let{inProgress:t,...n}=q,r={...n,toPosition:q.toHandle?q.toPosition:null};y?.(e,r),i&&x?.(e,r)}p(),cancelAnimationFrame(j),T=!1,R=!1,I=null,D=null,N.removeEventListener("mousemove",X),N.removeEventListener("mouseup",Y),N.removeEventListener("touchmove",X),N.removeEventListener("touchend",Y)}}0===k&&V(),N.addEventListener("mousemove",X),N.addEventListener("mouseup",Y),N.addEventListener("touchmove",X),N.addEventListener("touchend",Y)},isValid:rp};function rv({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){let o=en(e);return{update:function({translateExtent:e,width:i,height:a,zoomStep:s=1,pannable:u=!0,zoomable:l=!0,inversePan:c=!1}){let h=[0,0],d=tG().on("start",e=>{("mousedown"===e.sourceEvent.type||"touchstart"===e.sourceEvent.type)&&(h=[e.sourceEvent.clientX??e.sourceEvent.touches[0].clientX,e.sourceEvent.clientY??e.sourceEvent.touches[0].clientY])}).on("zoom",u?o=>{let s=n();if("mousemove"!==o.sourceEvent.type&&"touchmove"!==o.sourceEvent.type||!t)return;let u=[o.sourceEvent.clientX??o.sourceEvent.touches[0].clientX,o.sourceEvent.clientY??o.sourceEvent.touches[0].clientY],l=[u[0]-h[0],u[1]-h[1]];h=u;let d=r()*Math.max(s[2],Math.log(s[2]))*(c?-1:1),f={x:s[0]-l[0]*d,y:s[1]-l[1]*d};t.setViewportConstrained({x:f.x,y:f.y,zoom:s[2]},[[0,0],[i,a]],e)}:null).on("zoom.wheel",l?e=>{if("wheel"!==e.sourceEvent.type||!t)return;let r=n(),o=e.sourceEvent.ctrlKey&&n_()?10:1,i=-e.sourceEvent.deltaY*(1===e.sourceEvent.deltaMode?.05:e.sourceEvent.deltaMode?1:.002)*s,a=r[2]*Math.pow(2,i*o);t.scaleTo(a)}:null);o.call(d,{})},destroy:function(){o.on("zoom",null)},pointer:er}}let ry=e=>({x:e.x,y:e.y,zoom:e.k}),rm=({x:e,y:t,zoom:n})=>tI.translate(e,t).scale(n),rx=(e,t)=>e.target.closest(`.${t}`),rw=(e,t)=>2===t&&Array.isArray(e)&&e.includes(2),rb=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,r_=(e,t=0,n=rb,r=()=>{})=>{let o="number"==typeof t&&t>0;return o||r(),o?e.transition().duration(t).ease(n).on("end",r):e},rE=e=>{let t=e.ctrlKey&&n_()?10:1;return-e.deltaY*(1===e.deltaMode?.05:e.deltaMode?1:.002)*t};function rk({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:o,onPanZoom:a,onPanZoomStart:s,onPanZoomEnd:u,onDraggingChange:l}){let c={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{x:0,y:0,zoom:0},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},h=e.getBoundingClientRect(),d=tG().scaleExtent([t,n]).translateExtent(r),f=en(e).call(d);m({x:o.x,y:o.y,zoom:nn(o.zoom,t,n)},[[0,0],[h.width,h.height]],r);let p=f.on("wheel.zoom"),g=f.on("dblclick.zoom");function v(e,t){return f?new Promise(n=>{d?.interpolate(t?.interpolate==="linear"?tW:ey).transform(r_(f,t?.duration,t?.ease,()=>n(!0)),e)}):Promise.resolve(!1)}function y(){d.on("zoom",null)}async function m(e,t,n){let r=rm(e),o=d?.constrain()(r,t,n);return o&&await v(o),new Promise(e=>e(o))}return d.wheelDelta(rE),{update:function({noWheelClassName:e,noPanClassName:t,onPaneContextMenu:n,userSelectionActive:r,panOnScroll:o,panOnDrag:h,panOnScrollMode:v,panOnScrollSpeed:m,preventScrolling:x,zoomOnPinch:w,zoomOnScroll:b,zoomOnDoubleClick:_,zoomActivationKeyPressed:E,lib:k,onTransformChange:M,connectionInProgress:O,paneClickDistance:N,selectionOnDrag:j}){r&&!c.isZoomingOrPanning&&y();let A=o&&!E&&!r;d.clickDistance(j?1/0:!ng(N)||N<0?0:N);let z=A?function({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:o,panOnScrollSpeed:a,zoomOnPinch:s,onPanZoomStart:u,onPanZoom:l,onPanZoomEnd:c}){return h=>{if(rx(h,t))return h.ctrlKey&&h.preventDefault(),!1;h.preventDefault(),h.stopImmediatePropagation();let d=n.property("__zoom").k||1;if(h.ctrlKey&&s){let e=er(h),t=d*Math.pow(2,rE(h));r.scaleTo(n,t,e,h);return}let f=1===h.deltaMode?20:1,p=o===i.Vertical?0:h.deltaX*f,g=o===i.Horizontal?0:h.deltaY*f;!n_()&&h.shiftKey&&o!==i.Vertical&&(p=h.deltaY*f,g=0),r.translateBy(n,-(p/d)*a,-(g/d)*a,{internal:!0});let v=ry(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(l?.(h,v),e.panScrollTimeout=setTimeout(()=>{c?.(h,v),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,u?.(h,v))}}({zoomPanValues:c,noWheelClassName:e,d3Selection:f,d3Zoom:d,panOnScrollMode:v,panOnScrollSpeed:m,zoomOnPinch:w,onPanZoomStart:s,onPanZoom:a,onPanZoomEnd:u}):function({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,o){let i="wheel"===r.type,a=!t&&i&&!r.ctrlKey,s=rx(r,e);if(r.ctrlKey&&i&&s&&r.preventDefault(),a||s)return null;r.preventDefault(),n.call(this,r,o)}}({noWheelClassName:e,preventScrolling:x,d3ZoomHandler:p});if(f.on("wheel.zoom",z,{passive:!1}),!r){let e=function({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{if(r.sourceEvent?.internal)return;let o=ry(r.transform);e.mouseButton=r.sourceEvent?.button||0,e.isZoomingOrPanning=!0,e.prevViewport=o,r.sourceEvent?.type==="mousedown"&&t(!0),n&&n?.(r.sourceEvent,o)}}({zoomPanValues:c,onDraggingChange:l,onPanZoomStart:s});d.on("start",e);let t=function({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:o}){return i=>{e.usedRightMouseButton=!!(n&&rw(t,e.mouseButton??0)),i.sourceEvent?.sync||r([i.transform.x,i.transform.y,i.transform.k]),o&&!i.sourceEvent?.internal&&o?.(i.sourceEvent,ry(i.transform))}}({zoomPanValues:c,panOnDrag:h,onPaneContextMenu:!!n,onPanZoom:a,onTransformChange:M});d.on("zoom",t);let r=function({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:o,onPaneContextMenu:i}){return a=>{if(!a.sourceEvent?.internal&&(e.isZoomingOrPanning=!1,i&&rw(t,e.mouseButton??0)&&!e.usedRightMouseButton&&a.sourceEvent&&i(a.sourceEvent),e.usedRightMouseButton=!1,r(!1),o)){let t=ry(a.transform);e.prevViewport=t,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{o?.(a.sourceEvent,t)},150*!!n)}}}({zoomPanValues:c,panOnDrag:h,panOnScroll:o,onPaneContextMenu:n,onPanZoomEnd:u,onDraggingChange:l});d.on("end",r)}let $=function({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:o,zoomOnDoubleClick:i,userSelectionActive:a,noWheelClassName:s,noPanClassName:u,lib:l,connectionInProgress:c}){return h=>{let d=e||t,f=n&&h.ctrlKey,p="wheel"===h.type;if(1===h.button&&"mousedown"===h.type&&(rx(h,`${l}-flow__node`)||rx(h,`${l}-flow__edge`)))return!0;if(!r&&!d&&!o&&!i&&!n||a||c&&!p||rx(h,s)&&p||rx(h,u)&&(!p||o&&p&&!e)||!n&&h.ctrlKey&&p)return!1;if(!n&&"touchstart"===h.type&&h.touches?.length>1)return h.preventDefault(),!1;if(!d&&!o&&!f&&p||!r&&("mousedown"===h.type||"touchstart"===h.type)||Array.isArray(r)&&!r.includes(h.button)&&"mousedown"===h.type)return!1;let g=Array.isArray(r)&&r.includes(h.button)||!h.button||h.button<=1;return(!h.ctrlKey||p)&&g}}({zoomActivationKeyPressed:E,panOnDrag:h,zoomOnScroll:b,panOnScroll:o,zoomOnDoubleClick:_,zoomOnPinch:w,userSelectionActive:r,noPanClassName:t,noWheelClassName:e,lib:k,connectionInProgress:O});d.filter($),_?f.on("dblclick.zoom",g):f.on("dblclick.zoom",null)},destroy:y,setViewport:async function e(e,t){let n=rm(e);return await v(n,t),new Promise(e=>e(n))},setViewportConstrained:m,getViewport:function(){let e=f?tR(f.node()):{x:0,y:0,k:1};return{x:e.x,y:e.y,zoom:e.k}},scaleTo:function(e,t){return f?new Promise(n=>{d?.interpolate(t?.interpolate==="linear"?tW:ey).scaleTo(r_(f,t?.duration,t?.ease,()=>n(!0)),e)}):Promise.resolve(!1)},scaleBy:function(e,t){return f?new Promise(n=>{d?.interpolate(t?.interpolate==="linear"?tW:ey).scaleBy(r_(f,t?.duration,t?.ease,()=>n(!0)),e)}):Promise.resolve(!1)},setScaleExtent:function(e){d?.scaleExtent(e)},setTranslateExtent:function(e){d?.translateExtent(e)},syncViewport:function(e){if(f){let t=rm(e),n=f.property("__zoom");(n.k!==e.zoom||n.x!==e.x||n.y!==e.y)&&d?.transform(f,t,null,{sync:!0})}},setClickDistance:function(e){let t=!ng(e)||e<0?0:e;d?.clickDistance(t)}}}!function(e){e.Line="line",e.Handle="handle"}(c||(c={}))}}]);
|