@xyflow/system 0.0.8 → 0.0.9

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.
@@ -1,3 +1,4 @@
1
+ "use client"
1
2
  import { drag } from 'd3-drag';
2
3
  import { select, pointer } from 'd3-selection';
3
4
  import { zoom, zoomIdentity, zoomTransform } from 'd3-zoom';
@@ -772,9 +773,9 @@ function getSmoothStepPath({ sourceX, sourceY, sourcePosition = Position.Bottom,
772
773
  }
773
774
 
774
775
  function getEdgePosition(params) {
775
- const [sourceNodeRect, sourceHandleBounds, sourceIsValid] = getHandleDataByNode(params.sourceNode);
776
- const [targetNodeRect, targetHandleBounds, targetIsValid] = getHandleDataByNode(params.targetNode);
777
- if (!sourceIsValid || !targetIsValid) {
776
+ const [sourceNodeRect, sourceHandleBounds, isSourceValid] = getHandleDataByNode(params.sourceNode);
777
+ const [targetNodeRect, targetHandleBounds, isTargetValid] = getHandleDataByNode(params.targetNode);
778
+ if (!isSourceValid || !isTargetValid) {
778
779
  return null;
779
780
  }
780
781
  // when connection type is loose we can define all handles as sources and connect source -> source
@@ -804,19 +805,40 @@ function getEdgePosition(params) {
804
805
  targetPosition,
805
806
  };
806
807
  }
808
+ function toHandleBounds(handles) {
809
+ if (!handles) {
810
+ return null;
811
+ }
812
+ return handles.reduce((res, item) => {
813
+ item.width = item.width || 1;
814
+ item.height = item.height || 1;
815
+ if (item.type === 'source') {
816
+ res.source?.push(item);
817
+ }
818
+ if (item.type === 'target') {
819
+ res.target?.push(item);
820
+ }
821
+ return res;
822
+ }, {
823
+ source: [],
824
+ target: [],
825
+ });
826
+ }
807
827
  function getHandleDataByNode(node) {
808
- const handleBounds = node?.[internalsSymbol]?.handleBounds || null;
828
+ const handleBounds = node?.[internalsSymbol]?.handleBounds || toHandleBounds(node?.handles) || null;
829
+ const nodeWidth = node?.width || node?.size?.width;
830
+ const nodeHeight = node?.height || node?.size?.height;
809
831
  const isValid = handleBounds &&
810
- node?.width &&
811
- node?.height &&
832
+ nodeWidth &&
833
+ nodeHeight &&
812
834
  typeof node?.positionAbsolute?.x !== 'undefined' &&
813
835
  typeof node?.positionAbsolute?.y !== 'undefined';
814
836
  return [
815
837
  {
816
838
  x: node?.positionAbsolute?.x || 0,
817
839
  y: node?.positionAbsolute?.y || 0,
818
- width: node?.width || 0,
819
- height: node?.height || 0,
840
+ width: nodeWidth || 0,
841
+ height: nodeHeight || 0,
820
842
  },
821
843
  handleBounds,
822
844
  !!isValid,
@@ -1080,7 +1102,7 @@ function getEventHandlerParams({ nodeId, dragItems, nodes, }) {
1080
1102
  return [nodeId ? extentedDragItems.find((n) => n.id === nodeId) : extentedDragItems[0], extentedDragItems];
1081
1103
  }
1082
1104
 
1083
- function XYDrag({ domNode, onNodeClick, getStoreItems, onDragStart, onDrag, onDragStop, }) {
1105
+ function XYDrag({ domNode, onNodeMouseDown, getStoreItems, onDragStart, onDrag, onDragStop, }) {
1084
1106
  let lastPos = { x: null, y: null };
1085
1107
  let autoPanId = 0;
1086
1108
  let dragItems = [];
@@ -1164,8 +1186,8 @@ function XYDrag({ domNode, onNodeClick, getStoreItems, onDragStart, onDrag, onDr
1164
1186
  unselectNodesAndEdges();
1165
1187
  }
1166
1188
  }
1167
- if (isSelectable && selectNodesOnDrag) {
1168
- onNodeClick?.();
1189
+ if (isSelectable && selectNodesOnDrag && nodeId) {
1190
+ onNodeMouseDown?.(nodeId);
1169
1191
  }
1170
1192
  const pointerPos = getPointerPosition(event.sourceEvent, { transform, snapGrid, snapToGrid });
1171
1193
  lastPos = pointerPos;
@@ -50,7 +50,7 @@ export type FitViewOptionsBase<NodeType extends NodeBase> = {
50
50
  minZoom?: number;
51
51
  maxZoom?: number;
52
52
  duration?: number;
53
- nodes?: (Partial<NodeType> & {
53
+ nodes?: (NodeType | {
54
54
  id: NodeType['id'];
55
55
  })[];
56
56
  };
@@ -1 +1 @@
1
- {"version":3,"file":"general.d.ts","sourceRoot":"","sources":["../../src/types/general.ts"],"names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,MAAM,EAAE;IACtC,kBAAkB,EAAE,UAAU,GAAG,IAAI,CAAC;IACtC,gBAAgB,EAAE,gBAAgB,GAAG,IAAI,CAAC;IAC1C,qBAAqB,EAAE,gBAAgB,GAAG,IAAI,CAAC;IAC/C,mBAAmB,EAAE,gBAAgB,GAAG,IAAI,CAAC;CAC9C,KAAK,IAAI,CAAC"}
@@ -1,8 +1,13 @@
1
- import type { XYPosition, Position, Dimensions, OnConnect, IsValidConnection } from '.';
1
+ import type { Position, OnConnect, IsValidConnection } from '.';
2
2
  export type HandleType = 'source' | 'target';
3
- export type HandleElement = XYPosition & Dimensions & {
3
+ export type HandleElement = {
4
4
  id?: string | null;
5
+ x: number;
6
+ y: number;
7
+ width: number;
8
+ height: number;
5
9
  position: Position;
10
+ type?: HandleType;
6
11
  };
7
12
  export type ConnectingHandle = {
8
13
  nodeId: string;
@@ -1 +1 @@
1
- {"version":3,"file":"handles.d.ts","sourceRoot":"","sources":["../../src/types/handles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,UAAU,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,GAAG,CAAC;AAExF,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAE7C,MAAM,MAAM,aAAa,GAAG,UAAU,GACpC,UAAU,GAAG;IACX,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,QAAQ,EAAE,QAAQ,CAAC;CACpB,CAAC;AAEJ,MAAM,MAAM,gBAAgB,GAAG;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,UAAU,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;IAClB,IAAI,EAAE,UAAU,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,CAA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ACX,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACxB,IAAI,EAAE,UAAU,CAAC;IACjB,QAAQ,EAAE,QAAQ,CAAC;IACnB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IACtC,EAAE,CAAC,EAAE,MAAM,CAAC;CACb,CAAC"}
@@ -1,5 +1,6 @@
1
1
  import { internalsSymbol } from '../constants';
2
2
  import type { XYPosition, Position, CoordinateExtent, HandleElement } from '.';
3
+ import { Optional } from '../utils/types';
3
4
  export type NodeBase<T = any, U extends string | undefined = string | undefined> = {
4
5
  id: string;
5
6
  position: XYPosition;
@@ -25,6 +26,11 @@ export type NodeBase<T = any, U extends string | undefined = string | undefined>
25
26
  ariaLabel?: string;
26
27
  focusable?: boolean;
27
28
  origin?: NodeOrigin;
29
+ handles?: NodeHandle[];
30
+ size?: {
31
+ width?: number;
32
+ height?: number;
33
+ };
28
34
  [internalsSymbol]?: {
29
35
  z?: number;
30
36
  handleBounds?: NodeHandleBounds;
@@ -74,4 +80,5 @@ export type NodeDragItem = {
74
80
  export type NodeOrigin = [number, number];
75
81
  export type OnNodeDrag = (event: MouseEvent, node: NodeBase, nodes: NodeBase[]) => void;
76
82
  export type OnSelectionDrag = (event: MouseEvent, nodes: NodeBase[]) => void;
83
+ export type NodeHandle = Optional<HandleElement, 'width' | 'height'>;
77
84
  //# sourceMappingURL=nodes.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"nodes.d.ts","sourceRoot":"","sources":["../../src/types/nodes.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,GAAG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E,KAAK,IAAI,CAAC;AAExF,MAAM,MAAM,eAAe,GAAG,CAAC,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,IAAI,CAAC;AAE7E,MAAM,MAAM,UAAU,GAAG,QAAQ,CAAC,aAAa,EAAE,OAAO,GAAG,QAAQ,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"positions.d.ts","sourceRoot":"","sources":["../../../src/utils/edges/positions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAE,QAAQ,EAAoB,MAAM,mBAAmB,CAAC;AAK/D,MAAM,MAAM,qBAAqB,GAAG;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,QAAQ,CAAC;IACrB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,UAAU,EAAE,QAAQ,CAAC;IACrB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,cAAc,EAAE,cAAc,CAAC;IAC/B,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,wBAAgB,eAAe,CAAC,MAAM,EAAE,qBAAqB,GAAG,YAAY,GAAG,IAAI,CA0ClF"}
1
+ {"version":3,"file":"positions.d.ts","sourceRoot":"","sources":["../../../src/utils/edges/positions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAE,QAAQ,EAAgC,MAAM,mBAAmB,CAAC;AAK3E,MAAM,MAAM,qBAAqB,GAAG;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,QAAQ,CAAC;IACrB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,UAAU,EAAE,QAAQ,CAAC;IACrB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,cAAc,EAAE,cAAc,CAAC;IAC/B,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,wBAAgB,eAAe,CAAC,MAAM,EAAE,qBAAqB,GAAG,YAAY,GAAG,IAAI,CA0ClF"}
@@ -1,10 +1,10 @@
1
1
  import { type Connection, type Transform, type XYPosition, type Rect, type NodeOrigin, type NodeBase, type EdgeBase, type FitViewParamsBase, type FitViewOptionsBase, NodeDragItem, CoordinateExtent, OnError } from '../types';
2
2
  export declare const isEdgeBase: <NodeType extends NodeBase<any, string | undefined> = NodeBase<any, string | undefined>, EdgeType extends EdgeBase<any> = EdgeBase<any>>(element: NodeType | EdgeType | Connection) => element is EdgeType;
3
3
  export declare const isNodeBase: <NodeType extends NodeBase<any, string | undefined> = NodeBase<any, string | undefined>, EdgeType extends EdgeBase<any> = EdgeBase<any>>(element: Connection | NodeType | EdgeType) => element is NodeType;
4
- export declare const getOutgoersBase: <NodeType extends NodeBase<any, string | undefined> = NodeBase<any, string | undefined>, EdgeType extends EdgeBase<any> = EdgeBase<any>>(node: Partial<NodeType> & {
4
+ export declare const getOutgoersBase: <NodeType extends NodeBase<any, string | undefined> = NodeBase<any, string | undefined>, EdgeType extends EdgeBase<any> = EdgeBase<any>>(node: NodeType | {
5
5
  id: string;
6
6
  }, nodes: NodeType[], edges: EdgeType[]) => NodeType[];
7
- export declare const getIncomersBase: <NodeType extends NodeBase<any, string | undefined> = NodeBase<any, string | undefined>, EdgeType extends EdgeBase<any> = EdgeBase<any>>(node: Partial<NodeType> & {
7
+ export declare const getIncomersBase: <NodeType extends NodeBase<any, string | undefined> = NodeBase<any, string | undefined>, EdgeType extends EdgeBase<any> = EdgeBase<any>>(node: NodeType | {
8
8
  id: string;
9
9
  }, nodes: NodeType[], edges: EdgeType[]) => NodeType[];
10
10
  export declare const getNodePositionWithOrigin: (node: NodeBase | undefined, n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it<T, K>;
2
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/utils/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,QAAQ,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,IAAI,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC"}
@@ -15,7 +15,10 @@ type StoreItems = {
15
15
  selectNodesOnDrag: boolean;
16
16
  nodeDragThreshold: number;
17
17
  panBy: PanBy;
18
- unselectNodesAndEdges: () => void;
18
+ unselectNodesAndEdges: (params?: {
19
+ nodes?: NodeBase[];
20
+ edges?: EdgeBase[];
21
+ }) => void;
19
22
  onError?: OnError;
20
23
  onNodeDragStart?: OnNodeDrag;
21
24
  onNodeDrag?: OnNodeDrag;
@@ -31,7 +34,7 @@ export type XYDragParams = {
31
34
  onDragStart?: OnDrag;
32
35
  onDrag?: OnDrag;
33
36
  onDragStop?: OnDrag;
34
- onNodeClick?: () => void;
37
+ onNodeMouseDown?: (id: string) => void;
35
38
  };
36
39
  export type XYDragInstance = {
37
40
  update: (params: DragUpdateParams) => void;
@@ -44,6 +47,6 @@ export type DragUpdateParams = {
44
47
  nodeId?: string;
45
48
  domNode: Element;
46
49
  };
47
- export declare function XYDrag({ domNode, onNodeClick, getStoreItems, onDragStart, onDrag, onDragStop, }: XYDragParams): XYDragInstance;
50
+ export declare function XYDrag({ domNode, onNodeMouseDown, getStoreItems, onDragStart, onDrag, onDragStop, }: XYDragParams): XYDragInstance;
48
51
  export {};
49
52
  //# sourceMappingURL=XYDrag.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"XYDrag.d.ts","sourceRoot":"","sources":["../../src/xydrag/XYDrag.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EACV,QAAQ,EACR,YAAY,EAGZ,QAAQ,EACR,gBAAgB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MAAM,MAAM,gBAAgB,GAAG;IAC7B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF,wBAAgB,MAAM,CAAC,EACrB,OAAO,EACP,eAAe,EACf,aAAa,EACb,WAAW,EACX,MAAM,EACN,UAAU,GACX,EAAE,YAAY,GAAG,cAAc,CA6O/B"}
package/dist/umd/index.js CHANGED
@@ -1 +1 @@
1
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).XYFlowSystem={})}(this,(function(t){"use strict";const e={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:t=>`Node type "${t}" 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:t=>`The old edge with id=${t} does not exist.`,error009:t=>`Marker type "${t}" doesn't exist.`,error008:(t,{id:e,sourceHandle:n,targetHandle:o})=>`Couldn't create edge for ${t} handle id: "${n?o:n}", edge id: ${e}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:t=>`Edge type "${t}" not found. Using fallback type "default".`,error012:t=>`Node with id "${t}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`},n=Symbol.for("internals"),o=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]];var r,i,a,s,u,c;t.ConnectionMode=void 0,(r=t.ConnectionMode||(t.ConnectionMode={})).Strict="strict",r.Loose="loose",t.PanOnScrollMode=void 0,(i=t.PanOnScrollMode||(t.PanOnScrollMode={})).Free="free",i.Vertical="vertical",i.Horizontal="horizontal",t.SelectionMode=void 0,(a=t.SelectionMode||(t.SelectionMode={})).Partial="partial",a.Full="full",t.ConnectionLineType=void 0,(s=t.ConnectionLineType||(t.ConnectionLineType={})).Bezier="default",s.Straight="straight",s.Step="step",s.SmoothStep="smoothstep",s.SimpleBezier="simplebezier",t.MarkerType=void 0,(u=t.MarkerType||(t.MarkerType={})).Arrow="arrow",u.ArrowClosed="arrowclosed",t.Position=void 0,(c=t.Position||(t.Position={})).Left="left",c.Top="top",c.Right="right",c.Bottom="bottom";const l=t=>"id"in t&&"source"in t&&"target"in t,h=(t,e=[0,0])=>{if(!t)return{x:0,y:0,positionAbsolute:{x:0,y:0}};const n=(t.width??0)*e[0],o=(t.height??0)*e[1],r={x:t.position.x-n,y:t.position.y-o};return{...r,positionAbsolute:t.positionAbsolute?{x:t.positionAbsolute.x-n,y:t.positionAbsolute.y-o}:r}},f=(t,e=[0,0])=>{if(0===t.length)return{x:0,y:0,width:0,height:0};const n=t.reduce(((t,n)=>{const{x:o,y:r}=h(n,n.origin||e).positionAbsolute;return x(t,w({x:o,y:r,width:n.width||0,height:n.height||0}))}),{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return _(n)},d=(t,e)=>{const n=new Set;return t.forEach((t=>{n.add(t.id)})),e.filter((t=>n.has(t.source)||n.has(t.target)))};function p(t,n,o,r,i=[0,0],a){const s=function(t,e){return e&&"parent"!==e?[e[0],[e[1][0]-(t.width||0),e[1][1]-(t.height||0)]]:e}(t,t.extent||r);let u=s,c=null,l={x:0,y:0};if(t.parentNode&&(c=o.find((e=>e.id===t.parentNode))||null,l=c?h(c,c.origin||i).positionAbsolute:l),"parent"!==t.extent||t.expandParent)t.extent&&t.parentNode&&"parent"!==t.extent&&(u=[[t.extent[0][0]+l.x,t.extent[0][1]+l.y],[t.extent[1][0]+l.x,t.extent[1][1]+l.y]]);else if(t.parentNode&&t.width&&t.height){const e=t.origin||i;u=c&&P(c.width)&&P(c.height)?[[l.x+t.width*e[0],l.y+t.height*e[1]],[l.x+c.width-t.width+t.width*e[0],l.y+c.height-t.height+t.height*e[1]]]:u}else a?.("005",e.error005()),u=s;const f=u&&"parent"!==u?y(n,u):n;return{position:{x:f.x-l.x,y:f.y-l.y},positionAbsolute:f}}const g=(t,e=0,n=1)=>Math.min(Math.max(t,e),n),y=(t={x:0,y:0},e)=>({x:g(t.x,e[0][0],e[1][0]),y:g(t.y,e[0][1],e[1][1])}),m=(t,e,n)=>t<e?g(Math.abs(t-e),1,50)/50:t>n?-g(Math.abs(t-n),1,50)/50:0,v=(t,e)=>[20*m(t.x,35,e.width-35),20*m(t.y,35,e.height-35)],x=(t,e)=>({x:Math.min(t.x,e.x),y:Math.min(t.y,e.y),x2:Math.max(t.x2,e.x2),y2:Math.max(t.y2,e.y2)}),w=({x:t,y:e,width:n,height:o})=>({x:t,y:e,x2:t+n,y2:e+o}),_=({x:t,y:e,x2:n,y2:o})=>({x:t,y:e,width:n-t,height:o-e}),b=(t,e=[0,0])=>{const{positionAbsolute:n}=h(t,t.origin||e);return{...n,width:t.width||0,height:t.height||0}},M=(t,e=[0,0])=>{const{positionAbsolute:n}=h(t,t.origin||e);return{...n,x2:n.x+(t.width||0),y2:n.y+(t.height||0)}},E=(t,e)=>{const n=Math.max(0,Math.min(t.x+t.width,e.x+e.width)-Math.max(t.x,e.x)),o=Math.max(0,Math.min(t.y+t.height,e.y+e.height)-Math.max(t.y,e.y));return Math.ceil(n*o)},P=t=>!isNaN(t)&&isFinite(t),N=(t,e)=>{};function S(t,e=[1,1]){return{x:e[0]*Math.round(t.x/e[0]),y:e[1]*Math.round(t.y/e[1])}}const A=({x:t,y:e},[n,o,r],i=!1,a=[1,1])=>{const s={x:(t-n)/r,y:(e-o)/r};return i?S(s,a):s},z=({x:t,y:e},[n,o,r])=>({x:t*r+n,y:e*r+o}),T=(t,e,n,o,r,i)=>{const a=e/(t.width*(1+i)),s=n/(t.height*(1+i)),u=Math.min(a,s),c=g(u,o,r);return[e/2-(t.x+t.width/2)*c,n/2-(t.y+t.height/2)*c,c]},$=()=>"undefined"!=typeof navigator&&navigator?.userAgent?.indexOf("Mac")>=0;function k(t,{snapGrid:e=[0,0],snapToGrid:n=!1,transform:o}){const{x:r,y:i}=X(t),a=A({x:r,y:i},o),{x:s,y:u}=n?S(a,e):a;return{xSnapped:s,ySnapped:u,...a}}const C=t=>({width:t.offsetWidth,height:t.offsetHeight}),O=t=>t.getRootNode?.()||window?.document,I=["INPUT","SELECT","TEXTAREA"];const B=t=>"clientX"in t,X=(t,e)=>{const n=B(t),o=n?t.clientX:t.touches?.[0].clientX,r=n?t.clientY:t.touches?.[0].clientY;return{x:o-(e?.left??0),y:r-(e?.top??0)}},H=(t,e,n,o=[0,0])=>{const r=e.querySelectorAll(t);if(!r||!r.length)return null;const i=Array.from(r),a=e.getBoundingClientRect(),s=a.width*o[0],u=a.height*o[1];return i.map((t=>{const e=t.getBoundingClientRect();return{id:t.getAttribute("data-handleid"),position:t.getAttribute("data-handlepos"),x:(e.left-a.left-s)/n,y:(e.top-a.top-u)/n,...C(t)}}))};function Y({sourceX:t,sourceY:e,targetX:n,targetY:o,sourceControlX:r,sourceControlY:i,targetControlX:a,targetControlY:s}){const u=.125*t+.375*r+.375*a+.125*n,c=.125*e+.375*i+.375*s+.125*o;return[u,c,Math.abs(u-t),Math.abs(c-e)]}function D(t,e){return t>=0?.5*t:25*e*Math.sqrt(-t)}function R({pos:e,x1:n,y1:o,x2:r,y2:i,c:a}){switch(e){case t.Position.Left:return[n-D(n-r,a),o];case t.Position.Right:return[n+D(r-n,a),o];case t.Position.Top:return[n,o-D(o-i,a)];case t.Position.Bottom:return[n,o+D(i-o,a)]}}function V({sourceX:t,sourceY:e,targetX:n,targetY:o}){const r=Math.abs(n-t)/2,i=n<t?n+r:n-r,a=Math.abs(o-e)/2;return[i,o<e?o+a:o-a,r,a]}const L=[{level:0,isMaxLevel:!0,edges:[]}];const q=({source:t,sourceHandle:e,target:n,targetHandle:o})=>`xyflow__edge-${t}${e||""}-${n}${o||""}`;const Z={[t.Position.Left]:{x:-1,y:0},[t.Position.Right]:{x:1,y:0},[t.Position.Top]:{x:0,y:-1},[t.Position.Bottom]:{x:0,y:1}},j=({source:e,sourcePosition:n=t.Position.Bottom,target:o})=>n===t.Position.Left||n===t.Position.Right?e.x<o.x?{x:1,y:0}:{x:-1,y:0}:e.y<o.y?{x:0,y:1}:{x:0,y:-1},G=(t,e)=>Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2));function F(t){const e=t?.[n]?.handleBounds||null,o=e&&t?.width&&t?.height&&void 0!==t?.positionAbsolute?.x&&void 0!==t?.positionAbsolute?.y;return[{x:t?.positionAbsolute?.x||0,y:t?.positionAbsolute?.y||0,width:t?.width||0,height:t?.height||0},e,!!o]}function K(e,n,o=null){const r=(o?.x||0)+n.x,i=(o?.y||0)+n.y,a=o?.width||n.width,s=o?.height||n.height;switch(e){case t.Position.Top:return{x:r+a/2,y:i};case t.Position.Right:return{x:r+a,y:i+s/2};case t.Position.Bottom:return{x:r+a/2,y:i+s};case t.Position.Left:return{x:r,y:i+s/2}}}function U(t,e){return t?1!==t.length&&e?e&&t.find((t=>t.id===e))||null:t[0]:null}function W(t,e){if(!t)return"";if("string"==typeof t)return t;return`${e?`${e}__`:""}${Object.keys(t).sort().map((e=>`${e}=${t[e]}`)).join("&")}`}function Q(t,e=[0,0],o){return t.map((r=>{if(r.parentNode&&!t.find((t=>t.id===r.parentNode)))throw new Error(`Parent node ${r.parentNode} not found`);if(r.parentNode||o?.[r.id]){const i=r.parentNode?t.find((t=>t.id===r.parentNode)):null,{x:a,y:s,z:u}=J(r,t,{...r.position,z:r[n]?.z??0},i?.origin||e);r.positionAbsolute={x:a,y:s},r[n].z=u,o?.[r.id]&&(r[n].isParent=!0)}return r}))}function J(t,e,o,r){if(!t.parentNode)return o;const i=e.find((e=>e.id===t.parentNode)),a=h(i,i?.origin||r);return J(i,e,{x:(o.x??0)+a.x,y:(o.y??0)+a.y,z:(i[n]?.z??0)>(o.z??0)?i[n]?.z??0:o.z??0},i.origin||r)}var tt={value:()=>{}};function et(){for(var t,e=0,n=arguments.length,o={};e<n;++e){if(!(t=arguments[e]+"")||t in o||/[\s.]/.test(t))throw new Error("illegal type: "+t);o[t]=[]}return new nt(o)}function nt(t){this._=t}function ot(t,e){for(var n,o=0,r=t.length;o<r;++o)if((n=t[o]).name===e)return n.value}function rt(t,e,n){for(var o=0,r=t.length;o<r;++o)if(t[o].name===e){t[o]=tt,t=t.slice(0,o).concat(t.slice(o+1));break}return null!=n&&t.push({name:e,value:n}),t}nt.prototype=et.prototype={constructor:nt,on:function(t,e){var n,o,r=this._,i=(o=r,(t+"").trim().split(/^|\s+/).map((function(t){var e="",n=t.indexOf(".");if(n>=0&&(e=t.slice(n+1),t=t.slice(0,n)),t&&!o.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:e}}))),a=-1,s=i.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++a<s;)if(n=(t=i[a]).type)r[n]=rt(r[n],t.name,e);else if(null==e)for(n in r)r[n]=rt(r[n],t.name,null);return this}for(;++a<s;)if((n=(t=i[a]).type)&&(n=ot(r[n],t.name)))return n},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new nt(t)},call:function(t,e){if((n=arguments.length-2)>0)for(var n,o,r=new Array(n),i=0;i<n;++i)r[i]=arguments[i+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(i=0,n=(o=this._[t]).length;i<n;++i)o[i].value.apply(e,r)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var o=this._[t],r=0,i=o.length;r<i;++r)o[r].value.apply(e,n)}};var it="http://www.w3.org/1999/xhtml",at={svg:"http://www.w3.org/2000/svg",xhtml:it,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function st(t){var e=t+="",n=e.indexOf(":");return n>=0&&"xmlns"!==(e=t.slice(0,n))&&(t=t.slice(n+1)),at.hasOwnProperty(e)?{space:at[e],local:t}:t}function ut(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===it&&e.documentElement.namespaceURI===it?e.createElement(t):e.createElementNS(n,t)}}function ct(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function lt(t){var e=st(t);return(e.local?ct:ut)(e)}function ht(){}function ft(t){return null==t?ht:function(){return this.querySelector(t)}}function dt(){return[]}function pt(t){return null==t?dt:function(){return this.querySelectorAll(t)}}function gt(t){return function(){return null==(e=t.apply(this,arguments))?[]:Array.isArray(e)?e:Array.from(e);var e}}function yt(t){return function(){return this.matches(t)}}function mt(t){return function(e){return e.matches(t)}}var vt=Array.prototype.find;function xt(){return this.firstElementChild}var wt=Array.prototype.filter;function _t(){return Array.from(this.children)}function bt(t){return new Array(t.length)}function Mt(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}function Et(t,e,n,o,r,i){for(var a,s=0,u=e.length,c=i.length;s<c;++s)(a=e[s])?(a.__data__=i[s],o[s]=a):n[s]=new Mt(t,i[s]);for(;s<u;++s)(a=e[s])&&(r[s]=a)}function Pt(t,e,n,o,r,i,a){var s,u,c,l=new Map,h=e.length,f=i.length,d=new Array(h);for(s=0;s<h;++s)(u=e[s])&&(d[s]=c=a.call(u,u.__data__,s,e)+"",l.has(c)?r[s]=u:l.set(c,u));for(s=0;s<f;++s)c=a.call(t,i[s],s,i)+"",(u=l.get(c))?(o[s]=u,u.__data__=i[s],l.delete(c)):n[s]=new Mt(t,i[s]);for(s=0;s<h;++s)(u=e[s])&&l.get(d[s])===u&&(r[s]=u)}function Nt(t){return t.__data__}function St(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}function At(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function zt(t){return function(){this.removeAttribute(t)}}function Tt(t){return function(){this.removeAttributeNS(t.space,t.local)}}function $t(t,e){return function(){this.setAttribute(t,e)}}function kt(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function Ct(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttribute(t):this.setAttribute(t,n)}}function Ot(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function It(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function Bt(t){return function(){this.style.removeProperty(t)}}function Xt(t,e,n){return function(){this.style.setProperty(t,e,n)}}function Ht(t,e,n){return function(){var o=e.apply(this,arguments);null==o?this.style.removeProperty(t):this.style.setProperty(t,o,n)}}function Yt(t,e){return t.style.getPropertyValue(e)||It(t).getComputedStyle(t,null).getPropertyValue(e)}function Dt(t){return function(){delete this[t]}}function Rt(t,e){return function(){this[t]=e}}function Vt(t,e){return function(){var n=e.apply(this,arguments);null==n?delete this[t]:this[t]=n}}function Lt(t){return t.trim().split(/^|\s+/)}function qt(t){return t.classList||new Zt(t)}function Zt(t){this._node=t,this._names=Lt(t.getAttribute("class")||"")}function jt(t,e){for(var n=qt(t),o=-1,r=e.length;++o<r;)n.add(e[o])}function Gt(t,e){for(var n=qt(t),o=-1,r=e.length;++o<r;)n.remove(e[o])}function Ft(t){return function(){jt(this,t)}}function Kt(t){return function(){Gt(this,t)}}function Ut(t,e){return function(){(e.apply(this,arguments)?jt:Gt)(this,t)}}function Wt(){this.textContent=""}function Qt(t){return function(){this.textContent=t}}function Jt(t){return function(){var e=t.apply(this,arguments);this.textContent=null==e?"":e}}function te(){this.innerHTML=""}function ee(t){return function(){this.innerHTML=t}}function ne(t){return function(){var e=t.apply(this,arguments);this.innerHTML=null==e?"":e}}function oe(){this.nextSibling&&this.parentNode.appendChild(this)}function re(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function ie(){return null}function ae(){var t=this.parentNode;t&&t.removeChild(this)}function se(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function ue(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function ce(t){return function(){var e=this.__on;if(e){for(var n,o=0,r=-1,i=e.length;o<i;++o)n=e[o],t.type&&n.type!==t.type||n.name!==t.name?e[++r]=n:this.removeEventListener(n.type,n.listener,n.options);++r?e.length=r:delete this.__on}}}function le(t,e,n){return function(){var o,r=this.__on,i=function(t){return function(e){t.call(this,e,this.__data__)}}(e);if(r)for(var a=0,s=r.length;a<s;++a)if((o=r[a]).type===t.type&&o.name===t.name)return this.removeEventListener(o.type,o.listener,o.options),this.addEventListener(o.type,o.listener=i,o.options=n),void(o.value=e);this.addEventListener(t.type,i,n),o={type:t.type,name:t.name,value:e,listener:i,options:n},r?r.push(o):this.__on=[o]}}function he(t,e,n){var o=It(t),r=o.CustomEvent;"function"==typeof r?r=new r(e,n):(r=o.document.createEvent("Event"),n?(r.initEvent(e,n.bubbles,n.cancelable),r.detail=n.detail):r.initEvent(e,!1,!1)),t.dispatchEvent(r)}function fe(t,e){return function(){return he(this,t,e)}}function de(t,e){return function(){return he(this,t,e.apply(this,arguments))}}Mt.prototype={constructor:Mt,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}},Zt.prototype={add:function(t){this._names.indexOf(t)<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var pe=[null];function ge(t,e){this._groups=t,this._parents=e}function ye(){return new ge([[document.documentElement]],pe)}function me(t){return"string"==typeof t?new ge([[document.querySelector(t)]],[document.documentElement]):new ge([[t]],pe)}function ve(t,e){if(t=function(t){let e;for(;e=t.sourceEvent;)t=e;return t}(t),void 0===e&&(e=t.currentTarget),e){var n=e.ownerSVGElement||e;if(n.createSVGPoint){var o=n.createSVGPoint();return o.x=t.clientX,o.y=t.clientY,[(o=o.matrixTransform(e.getScreenCTM().inverse())).x,o.y]}if(e.getBoundingClientRect){var r=e.getBoundingClientRect();return[t.clientX-r.left-e.clientLeft,t.clientY-r.top-e.clientTop]}}return[t.pageX,t.pageY]}ge.prototype=ye.prototype={constructor:ge,select:function(t){"function"!=typeof t&&(t=ft(t));for(var e=this._groups,n=e.length,o=new Array(n),r=0;r<n;++r)for(var i,a,s=e[r],u=s.length,c=o[r]=new Array(u),l=0;l<u;++l)(i=s[l])&&(a=t.call(i,i.__data__,l,s))&&("__data__"in i&&(a.__data__=i.__data__),c[l]=a);return new ge(o,this._parents)},selectAll:function(t){t="function"==typeof t?gt(t):pt(t);for(var e=this._groups,n=e.length,o=[],r=[],i=0;i<n;++i)for(var a,s=e[i],u=s.length,c=0;c<u;++c)(a=s[c])&&(o.push(t.call(a,a.__data__,c,s)),r.push(a));return new ge(o,r)},selectChild:function(t){return this.select(null==t?xt:function(t){return function(){return vt.call(this.children,t)}}("function"==typeof t?t:mt(t)))},selectChildren:function(t){return this.selectAll(null==t?_t:function(t){return function(){return wt.call(this.children,t)}}("function"==typeof t?t:mt(t)))},filter:function(t){"function"!=typeof t&&(t=yt(t));for(var e=this._groups,n=e.length,o=new Array(n),r=0;r<n;++r)for(var i,a=e[r],s=a.length,u=o[r]=[],c=0;c<s;++c)(i=a[c])&&t.call(i,i.__data__,c,a)&&u.push(i);return new ge(o,this._parents)},data:function(t,e){if(!arguments.length)return Array.from(this,Nt);var n,o=e?Pt:Et,r=this._parents,i=this._groups;"function"!=typeof t&&(n=t,t=function(){return n});for(var a=i.length,s=new Array(a),u=new Array(a),c=new Array(a),l=0;l<a;++l){var h=r[l],f=i[l],d=f.length,p=St(t.call(h,h&&h.__data__,l,r)),g=p.length,y=u[l]=new Array(g),m=s[l]=new Array(g);o(h,f,y,m,c[l]=new Array(d),p,e);for(var v,x,w=0,_=0;w<g;++w)if(v=y[w]){for(w>=_&&(_=w+1);!(x=m[_])&&++_<g;);v._next=x||null}}return(s=new ge(s,r))._enter=u,s._exit=c,s},enter:function(){return new ge(this._enter||this._groups.map(bt),this._parents)},exit:function(){return new ge(this._exit||this._groups.map(bt),this._parents)},join:function(t,e,n){var o=this.enter(),r=this,i=this.exit();return"function"==typeof t?(o=t(o))&&(o=o.selection()):o=o.append(t+""),null!=e&&(r=e(r))&&(r=r.selection()),null==n?i.remove():n(i),o&&r?o.merge(r).order():r},merge:function(t){for(var e=t.selection?t.selection():t,n=this._groups,o=e._groups,r=n.length,i=o.length,a=Math.min(r,i),s=new Array(r),u=0;u<a;++u)for(var c,l=n[u],h=o[u],f=l.length,d=s[u]=new Array(f),p=0;p<f;++p)(c=l[p]||h[p])&&(d[p]=c);for(;u<r;++u)s[u]=n[u];return new ge(s,this._parents)},selection:function(){return this},order:function(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var o,r=t[e],i=r.length-1,a=r[i];--i>=0;)(o=r[i])&&(a&&4^o.compareDocumentPosition(a)&&a.parentNode.insertBefore(o,a),a=o);return this},sort:function(t){function e(e,n){return e&&n?t(e.__data__,n.__data__):!e-!n}t||(t=At);for(var n=this._groups,o=n.length,r=new Array(o),i=0;i<o;++i){for(var a,s=n[i],u=s.length,c=r[i]=new Array(u),l=0;l<u;++l)(a=s[l])&&(c[l]=a);c.sort(e)}return new ge(r,this._parents).order()},call:function(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this},nodes:function(){return Array.from(this)},node:function(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var o=t[e],r=0,i=o.length;r<i;++r){var a=o[r];if(a)return a}return null},size:function(){let t=0;for(const e of this)++t;return t},empty:function(){return!this.node()},each:function(t){for(var e=this._groups,n=0,o=e.length;n<o;++n)for(var r,i=e[n],a=0,s=i.length;a<s;++a)(r=i[a])&&t.call(r,r.__data__,a,i);return this},attr:function(t,e){var n=st(t);if(arguments.length<2){var o=this.node();return n.local?o.getAttributeNS(n.space,n.local):o.getAttribute(n)}return this.each((null==e?n.local?Tt:zt:"function"==typeof e?n.local?Ot:Ct:n.local?kt:$t)(n,e))},style:function(t,e,n){return arguments.length>1?this.each((null==e?Bt:"function"==typeof e?Ht:Xt)(t,e,null==n?"":n)):Yt(this.node(),t)},property:function(t,e){return arguments.length>1?this.each((null==e?Dt:"function"==typeof e?Vt:Rt)(t,e)):this.node()[t]},classed:function(t,e){var n=Lt(t+"");if(arguments.length<2){for(var o=qt(this.node()),r=-1,i=n.length;++r<i;)if(!o.contains(n[r]))return!1;return!0}return this.each(("function"==typeof e?Ut:e?Ft:Kt)(n,e))},text:function(t){return arguments.length?this.each(null==t?Wt:("function"==typeof t?Jt:Qt)(t)):this.node().textContent},html:function(t){return arguments.length?this.each(null==t?te:("function"==typeof t?ne:ee)(t)):this.node().innerHTML},raise:function(){return this.each(oe)},lower:function(){return this.each(re)},append:function(t){var e="function"==typeof t?t:lt(t);return this.select((function(){return this.appendChild(e.apply(this,arguments))}))},insert:function(t,e){var n="function"==typeof t?t:lt(t),o=null==e?ie:"function"==typeof e?e:ft(e);return this.select((function(){return this.insertBefore(n.apply(this,arguments),o.apply(this,arguments)||null)}))},remove:function(){return this.each(ae)},clone:function(t){return this.select(t?ue:se)},datum:function(t){return arguments.length?this.property("__data__",t):this.node().__data__},on:function(t,e,n){var o,r,i=function(t){return t.trim().split(/^|\s+/).map((function(t){var e="",n=t.indexOf(".");return n>=0&&(e=t.slice(n+1),t=t.slice(0,n)),{type:t,name:e}}))}(t+""),a=i.length;if(!(arguments.length<2)){for(s=e?le:ce,o=0;o<a;++o)this.each(s(i[o],e,n));return this}var s=this.node().__on;if(s)for(var u,c=0,l=s.length;c<l;++c)for(o=0,u=s[c];o<a;++o)if((r=i[o]).type===u.type&&r.name===u.name)return u.value},dispatch:function(t,e){return this.each(("function"==typeof e?de:fe)(t,e))},[Symbol.iterator]:function*(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var o,r=t[e],i=0,a=r.length;i<a;++i)(o=r[i])&&(yield o)}};const xe={passive:!1},we={capture:!0,passive:!1};function _e(t){t.stopImmediatePropagation()}function be(t){t.preventDefault(),t.stopImmediatePropagation()}function Me(t){var e=t.document.documentElement,n=me(t).on("dragstart.drag",be,we);"onselectstart"in e?n.on("selectstart.drag",be,we):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}function Ee(t,e){var n=t.document.documentElement,o=me(t).on("dragstart.drag",null);e&&(o.on("click.drag",be,we),setTimeout((function(){o.on("click.drag",null)}),0)),"onselectstart"in n?o.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}var Pe=t=>()=>t;function Ne(t,{sourceEvent:e,subject:n,target:o,identifier:r,active:i,x:a,y:s,dx:u,dy:c,dispatch:l}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:o,enumerable:!0,configurable:!0},identifier:{value:r,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:s,enumerable:!0,configurable:!0},dx:{value:u,enumerable:!0,configurable:!0},dy:{value:c,enumerable:!0,configurable:!0},_:{value:l}})}function Se(t){return!t.ctrlKey&&!t.button}function Ae(){return this.parentNode}function ze(t,e){return null==e?{x:t.x,y:t.y}:e}function Te(){return navigator.maxTouchPoints||"ontouchstart"in this}function $e(t){return(e,n,o)=>t?.(e,o)}function ke(t,e){if(!t.parentNode)return!1;const n=e.find((t=>t.id===t.parentNode));return!!n&&(!!n.selected||ke(n,e))}function Ce(t,e,n){let o=t;do{if(o?.matches(e))return!0;if(o===n)return!1;o=o.parentElement}while(o);return!1}function Oe(t,e,n,o){return t.filter((n=>(n.selected||n.id===o)&&(!n.parentNode||!ke(n,t))&&(n.draggable||e&&void 0===n.draggable))).map((t=>({id:t.id,position:t.position||{x:0,y:0},positionAbsolute:t.positionAbsolute||{x:0,y:0},distance:{x:n.x-(t.positionAbsolute?.x??0),y:n.y-(t.positionAbsolute?.y??0)},delta:{x:0,y:0},extent:t.extent,parentNode:t.parentNode,width:t.width,height:t.height,origin:t.origin,expandParent:t.expandParent})))}function Ie({nodeId:t,dragItems:e,nodes:n}){const o=e.map((t=>({...n.find((e=>e.id===t.id)),position:t.position,positionAbsolute:t.positionAbsolute})));return[t?o.find((e=>e.id===t)):o[0],o]}function Be(t,e,n,o){return(e[n]||[]).reduce(((e,r)=>(`${t.id}-${r.id}-${n}`!==o&&e.push({id:r.id||null,type:n,nodeId:t.id,x:(t.positionAbsolute?.x??0)+r.x+r.width/2,y:(t.positionAbsolute?.y??0)+r.y+r.height/2}),e)),[])}function Xe(t,e){return t||(e?.classList.contains("target")?"target":e?.classList.contains("source")?"source":null)}function He(t,e){t?.classList.remove("valid","connecting",`${e}-flow__handle-valid`,`${e}-flow__handle-connecting`)}function Ye(t,e){let n=null;return e?n="valid":t&&!e&&(n="invalid"),n}Ne.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};const De={source:null,target:null,sourceHandle:null,targetHandle:null},Re=()=>!0;let Ve=null;function Le(e,{handle:n,connectionMode:o,fromNodeId:r,fromHandleId:i,fromType:a,doc:s,lib:u,isValidConnection:c=Re}){const l="target"===a,h=s.querySelector(`.${u}-flow__handle[data-id="${n?.nodeId}-${n?.id}-${n?.type}"]`),{x:f,y:d}=X(e),p=s.elementFromPoint(f,d),g=p?.classList.contains(`${u}-flow__handle`)?p:h,y={handleDomNode:g,isValid:!1,connection:De,endHandle:null};if(g){const e=Xe(void 0,g),n=g.getAttribute("data-nodeid"),a=g.getAttribute("data-handleid"),s=g.classList.contains("connectable"),u=g.classList.contains("connectableend"),h={source:l?n:r,sourceHandle:l?a:i,target:l?r:n,targetHandle:l?i:a};y.connection=h;s&&u&&(o===t.ConnectionMode.Strict?l&&"source"===e||!l&&"target"===e:n!==r||a!==i)&&(y.endHandle={nodeId:n,handleId:a,type:e},y.isValid=c(h))}return y}const qe={onPointerDown:function(t,{connectionMode:e,connectionRadius:o,handleId:r,nodeId:i,edgeUpdaterType:a,isTarget:s,domNode:u,nodes:c,lib:l,autoPanOnConnect:h,panBy:f,cancelConnection:d,onConnectStart:p,onConnect:g,onConnectEnd:y,isValidConnection:m=Re,onEdgeUpdateEnd:x,updateConnection:w,getTransform:_}){const b=O(t.target);let M,E=0;const{x:P,y:N}=X(t),S=b?.elementFromPoint(P,N),T=Xe(a,S),$=u?.getBoundingClientRect();if(!$||!T)return;let k,C=X(t,$),I=!1,B=null,H=!1,Y=null;const D=function({nodes:t,nodeId:e,handleId:o,handleType:r}){return t.reduce(((t,i)=>{if(i[n]){const{handleBounds:a}=i[n];let s=[],u=[];a&&(s=Be(i,a,"source",`${e}-${o}-${r}`),u=Be(i,a,"target",`${e}-${o}-${r}`)),t.push(...s,...u)}return t}),[])}({nodes:c,nodeId:i,handleId:r,handleType:T});function R(){if(!h||!$)return;const[t,e]=v(C,$);f({x:t,y:e}),E=requestAnimationFrame(R)}function V(t){const n=_();C=X(t,$),M=function(t,e,n){let o=[],r=1/0;return n.forEach((n=>{const i=Math.sqrt(Math.pow(n.x-t.x,2)+Math.pow(n.y-t.y,2));i<=e&&(i<r?o=[n]:i===r&&o.push(n),r=i)})),o.length?1===o.length?o[0]:o.find((t=>"target"===t.type))||o[0]:null}(A(C,n,!1,[1,1]),o,D),I||(R(),I=!0);const a=Le(t,{handle:M,connectionMode:e,fromNodeId:i,fromHandleId:r,fromType:s?"target":"source",isValidConnection:m,doc:b,lib:l});if(Y=a.handleDomNode,B=a.connection,H=a.isValid,w({connectionStartHandle:Ve,connectionPosition:M&&H?z({x:M.x,y:M.y},n):C,connectionStatus:Ye(!!M,H),connectionEndHandle:a.endHandle}),!M&&!H&&!Y)return He(k,l);B.source!==B.target&&Y&&(He(k,l),k=Y,Y.classList.add("connecting",`${l}-flow__handle-connecting`),Y.classList.toggle("valid",H),Y.classList.toggle(`${l}-flow__handle-valid`,H))}function L(t){(M||Y)&&B&&H&&g?.(B),y?.(t),a&&x?.(t),He(k,l),d(),cancelAnimationFrame(E),I=!1,H=!1,B=null,Y=null,Ve=null,b.removeEventListener("mousemove",V),b.removeEventListener("mouseup",L),b.removeEventListener("touchmove",V),b.removeEventListener("touchend",L)}Ve={nodeId:i,handleId:r,type:T},w({connectionPosition:C,connectionStatus:null,connectionStartHandle:Ve,connectionEndHandle:null}),p?.(t,{nodeId:i,handleId:r,handleType:T}),b.addEventListener("mousemove",V),b.addEventListener("mouseup",L),b.addEventListener("touchmove",V),b.addEventListener("touchend",L)},isValid:Le};function Ze(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function je(t,e){var n=Object.create(t.prototype);for(var o in e)n[o]=e[o];return n}function Ge(){}var Fe=.7,Ke=1/Fe,Ue="\\s*([+-]?\\d+)\\s*",We="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Qe="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Je=/^#([0-9a-f]{3,8})$/,tn=new RegExp(`^rgb\\(${Ue},${Ue},${Ue}\\)$`),en=new RegExp(`^rgb\\(${Qe},${Qe},${Qe}\\)$`),nn=new RegExp(`^rgba\\(${Ue},${Ue},${Ue},${We}\\)$`),on=new RegExp(`^rgba\\(${Qe},${Qe},${Qe},${We}\\)$`),rn=new RegExp(`^hsl\\(${We},${Qe},${Qe}\\)$`),an=new RegExp(`^hsla\\(${We},${Qe},${Qe},${We}\\)$`),sn={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function un(){return this.rgb().formatHex()}function cn(){return this.rgb().formatRgb()}function ln(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=Je.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?hn(e):3===n?new pn(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?fn(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?fn(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=tn.exec(t))?new pn(e[1],e[2],e[3],1):(e=en.exec(t))?new pn(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=nn.exec(t))?fn(e[1],e[2],e[3],e[4]):(e=on.exec(t))?fn(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=rn.exec(t))?wn(e[1],e[2]/100,e[3]/100,1):(e=an.exec(t))?wn(e[1],e[2]/100,e[3]/100,e[4]):sn.hasOwnProperty(t)?hn(sn[t]):"transparent"===t?new pn(NaN,NaN,NaN,0):null}function hn(t){return new pn(t>>16&255,t>>8&255,255&t,1)}function fn(t,e,n,o){return o<=0&&(t=e=n=NaN),new pn(t,e,n,o)}function dn(t,e,n,o){return 1===arguments.length?((r=t)instanceof Ge||(r=ln(r)),r?new pn((r=r.rgb()).r,r.g,r.b,r.opacity):new pn):new pn(t,e,n,null==o?1:o);var r}function pn(t,e,n,o){this.r=+t,this.g=+e,this.b=+n,this.opacity=+o}function gn(){return`#${xn(this.r)}${xn(this.g)}${xn(this.b)}`}function yn(){const t=mn(this.opacity);return`${1===t?"rgb(":"rgba("}${vn(this.r)}, ${vn(this.g)}, ${vn(this.b)}${1===t?")":`, ${t})`}`}function mn(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function vn(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function xn(t){return((t=vn(t))<16?"0":"")+t.toString(16)}function wn(t,e,n,o){return o<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new bn(t,e,n,o)}function _n(t){if(t instanceof bn)return new bn(t.h,t.s,t.l,t.opacity);if(t instanceof Ge||(t=ln(t)),!t)return new bn;if(t instanceof bn)return t;var e=(t=t.rgb()).r/255,n=t.g/255,o=t.b/255,r=Math.min(e,n,o),i=Math.max(e,n,o),a=NaN,s=i-r,u=(i+r)/2;return s?(a=e===i?(n-o)/s+6*(n<o):n===i?(o-e)/s+2:(e-n)/s+4,s/=u<.5?i+r:2-i-r,a*=60):s=u>0&&u<1?0:a,new bn(a,s,u,t.opacity)}function bn(t,e,n,o){this.h=+t,this.s=+e,this.l=+n,this.opacity=+o}function Mn(t){return(t=(t||0)%360)<0?t+360:t}function En(t){return Math.max(0,Math.min(1,t||0))}function Pn(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}Ze(Ge,ln,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:un,formatHex:un,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return _n(this).formatHsl()},formatRgb:cn,toString:cn}),Ze(pn,dn,je(Ge,{brighter(t){return t=null==t?Ke:Math.pow(Ke,t),new pn(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?Fe:Math.pow(Fe,t),new pn(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new pn(vn(this.r),vn(this.g),vn(this.b),mn(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:gn,formatHex:gn,formatHex8:function(){return`#${xn(this.r)}${xn(this.g)}${xn(this.b)}${xn(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:yn,toString:yn})),Ze(bn,(function(t,e,n,o){return 1===arguments.length?_n(t):new bn(t,e,n,null==o?1:o)}),je(Ge,{brighter(t){return t=null==t?Ke:Math.pow(Ke,t),new bn(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?Fe:Math.pow(Fe,t),new bn(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,o=n+(n<.5?n:1-n)*e,r=2*n-o;return new pn(Pn(t>=240?t-240:t+120,r,o),Pn(t,r,o),Pn(t<120?t+240:t-120,r,o),this.opacity)},clamp(){return new bn(Mn(this.h),En(this.s),En(this.l),mn(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=mn(this.opacity);return`${1===t?"hsl(":"hsla("}${Mn(this.h)}, ${100*En(this.s)}%, ${100*En(this.l)}%${1===t?")":`, ${t})`}`}}));var Nn=t=>()=>t;function Sn(t){return 1==(t=+t)?An:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(o){return Math.pow(t+o*e,n)}}(e,n,t):Nn(isNaN(e)?n:e)}}function An(t,e){var n=e-t;return n?function(t,e){return function(n){return t+n*e}}(t,n):Nn(isNaN(t)?e:t)}var zn=function t(e){var n=Sn(e);function o(t,e){var o=n((t=dn(t)).r,(e=dn(e)).r),r=n(t.g,e.g),i=n(t.b,e.b),a=An(t.opacity,e.opacity);return function(e){return t.r=o(e),t.g=r(e),t.b=i(e),t.opacity=a(e),t+""}}return o.gamma=t,o}(1);function Tn(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}var $n=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,kn=new RegExp($n.source,"g");function Cn(t,e){var n,o,r,i=$n.lastIndex=kn.lastIndex=0,a=-1,s=[],u=[];for(t+="",e+="";(n=$n.exec(t))&&(o=kn.exec(e));)(r=o.index)>i&&(r=e.slice(i,r),s[a]?s[a]+=r:s[++a]=r),(n=n[0])===(o=o[0])?s[a]?s[a]+=o:s[++a]=o:(s[++a]=null,u.push({i:a,x:Tn(n,o)})),i=kn.lastIndex;return i<e.length&&(r=e.slice(i),s[a]?s[a]+=r:s[++a]=r),s.length<2?u[0]?function(t){return function(e){return t(e)+""}}(u[0].x):function(t){return function(){return t}}(e):(e=u.length,function(t){for(var n,o=0;o<e;++o)s[(n=u[o]).i]=n.x(t);return s.join("")})}var On,In=180/Math.PI,Bn={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Xn(t,e,n,o,r,i){var a,s,u;return(a=Math.sqrt(t*t+e*e))&&(t/=a,e/=a),(u=t*n+e*o)&&(n-=t*u,o-=e*u),(s=Math.sqrt(n*n+o*o))&&(n/=s,o/=s,u/=s),t*o<e*n&&(t=-t,e=-e,u=-u,a=-a),{translateX:r,translateY:i,rotate:Math.atan2(e,t)*In,skewX:Math.atan(u)*In,scaleX:a,scaleY:s}}function Hn(t,e,n,o){function r(t){return t.length?t.pop()+" ":""}return function(i,a){var s=[],u=[];return i=t(i),a=t(a),function(t,o,r,i,a,s){if(t!==r||o!==i){var u=a.push("translate(",null,e,null,n);s.push({i:u-4,x:Tn(t,r)},{i:u-2,x:Tn(o,i)})}else(r||i)&&a.push("translate("+r+e+i+n)}(i.translateX,i.translateY,a.translateX,a.translateY,s,u),function(t,e,n,i){t!==e?(t-e>180?e+=360:e-t>180&&(t+=360),i.push({i:n.push(r(n)+"rotate(",null,o)-2,x:Tn(t,e)})):e&&n.push(r(n)+"rotate("+e+o)}(i.rotate,a.rotate,s,u),function(t,e,n,i){t!==e?i.push({i:n.push(r(n)+"skewX(",null,o)-2,x:Tn(t,e)}):e&&n.push(r(n)+"skewX("+e+o)}(i.skewX,a.skewX,s,u),function(t,e,n,o,i,a){if(t!==n||e!==o){var s=i.push(r(i)+"scale(",null,",",null,")");a.push({i:s-4,x:Tn(t,n)},{i:s-2,x:Tn(e,o)})}else 1===n&&1===o||i.push(r(i)+"scale("+n+","+o+")")}(i.scaleX,i.scaleY,a.scaleX,a.scaleY,s,u),i=a=null,function(t){for(var e,n=-1,o=u.length;++n<o;)s[(e=u[n]).i]=e.x(t);return s.join("")}}}var Yn=Hn((function(t){const e=new("function"==typeof DOMMatrix?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?Bn:Xn(e.a,e.b,e.c,e.d,e.e,e.f)}),"px, ","px)","deg)"),Dn=Hn((function(t){return null==t?Bn:(On||(On=document.createElementNS("http://www.w3.org/2000/svg","g")),On.setAttribute("transform",t),(t=On.transform.baseVal.consolidate())?Xn((t=t.matrix).a,t.b,t.c,t.d,t.e,t.f):Bn)}),", ",")",")");function Rn(t){return((t=Math.exp(t))+1/t)/2}var Vn,Ln,qn=function t(e,n,o){function r(t,r){var i,a,s=t[0],u=t[1],c=t[2],l=r[0],h=r[1],f=r[2],d=l-s,p=h-u,g=d*d+p*p;if(g<1e-12)a=Math.log(f/c)/e,i=function(t){return[s+t*d,u+t*p,c*Math.exp(e*t*a)]};else{var y=Math.sqrt(g),m=(f*f-c*c+o*g)/(2*c*n*y),v=(f*f-c*c-o*g)/(2*f*n*y),x=Math.log(Math.sqrt(m*m+1)-m),w=Math.log(Math.sqrt(v*v+1)-v);a=(w-x)/e,i=function(t){var o,r=t*a,i=Rn(x),l=c/(n*y)*(i*(o=e*r+x,((o=Math.exp(2*o))-1)/(o+1))-function(t){return((t=Math.exp(t))-1/t)/2}(x));return[s+l*d,u+l*p,c*i/Rn(e*r+x)]}}return i.duration=1e3*a*e/Math.SQRT2,i}return r.rho=function(e){var n=Math.max(.001,+e),o=n*n;return t(n,o,o*o)},r}(Math.SQRT2,2,4),Zn=0,jn=0,Gn=0,Fn=1e3,Kn=0,Un=0,Wn=0,Qn="object"==typeof performance&&performance.now?performance:Date,Jn="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function to(){return Un||(Jn(eo),Un=Qn.now()+Wn)}function eo(){Un=0}function no(){this._call=this._time=this._next=null}function oo(t,e,n){var o=new no;return o.restart(t,e,n),o}function ro(){Un=(Kn=Qn.now())+Wn,Zn=jn=0;try{!function(){to(),++Zn;for(var t,e=Vn;e;)(t=Un-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Zn}()}finally{Zn=0,function(){var t,e,n=Vn,o=1/0;for(;n;)n._call?(o>n._time&&(o=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:Vn=e);Ln=t,ao(o)}(),Un=0}}function io(){var t=Qn.now(),e=t-Kn;e>Fn&&(Wn-=e,Kn=t)}function ao(t){Zn||(jn&&(jn=clearTimeout(jn)),t-Un>24?(t<1/0&&(jn=setTimeout(ro,t-Qn.now()-Wn)),Gn&&(Gn=clearInterval(Gn))):(Gn||(Kn=Qn.now(),Gn=setInterval(io,Fn)),Zn=1,Jn(ro)))}function so(t,e,n){var o=new no;return e=null==e?0:+e,o.restart((n=>{o.stop(),t(n+e)}),e,n),o}no.prototype=oo.prototype={constructor:no,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?to():+n)+(null==e?0:+e),this._next||Ln===this||(Ln?Ln._next=this:Vn=this,Ln=this),this._call=t,this._time=n,ao()},stop:function(){this._call&&(this._call=null,this._time=1/0,ao())}};var uo=et("start","end","cancel","interrupt"),co=[],lo=0,ho=1,fo=2,po=3,go=4,yo=5,mo=6;function vo(t,e,n,o,r,i){var a=t.__transition;if(a){if(n in a)return}else t.__transition={};!function(t,e,n){var o,r=t.__transition;function i(t){n.state=ho,n.timer.restart(a,n.delay,n.time),n.delay<=t&&a(t-n.delay)}function a(i){var c,l,h,f;if(n.state!==ho)return u();for(c in r)if((f=r[c]).name===n.name){if(f.state===po)return so(a);f.state===go?(f.state=mo,f.timer.stop(),f.on.call("interrupt",t,t.__data__,f.index,f.group),delete r[c]):+c<e&&(f.state=mo,f.timer.stop(),f.on.call("cancel",t,t.__data__,f.index,f.group),delete r[c])}if(so((function(){n.state===po&&(n.state=go,n.timer.restart(s,n.delay,n.time),s(i))})),n.state=fo,n.on.call("start",t,t.__data__,n.index,n.group),n.state===fo){for(n.state=po,o=new Array(h=n.tween.length),c=0,l=-1;c<h;++c)(f=n.tween[c].value.call(t,t.__data__,n.index,n.group))&&(o[++l]=f);o.length=l+1}}function s(e){for(var r=e<n.duration?n.ease.call(null,e/n.duration):(n.timer.restart(u),n.state=yo,1),i=-1,a=o.length;++i<a;)o[i].call(t,r);n.state===yo&&(n.on.call("end",t,t.__data__,n.index,n.group),u())}function u(){for(var o in n.state=mo,n.timer.stop(),delete r[e],r)return;delete t.__transition}r[e]=n,n.timer=oo(i,0,n.time)}(t,n,{name:e,index:o,group:r,on:uo,tween:co,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:lo})}function xo(t,e){var n=_o(t,e);if(n.state>lo)throw new Error("too late; already scheduled");return n}function wo(t,e){var n=_o(t,e);if(n.state>po)throw new Error("too late; already running");return n}function _o(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function bo(t,e){var n,o,r,i=t.__transition,a=!0;if(i){for(r in e=null==e?null:e+"",i)(n=i[r]).name===e?(o=n.state>fo&&n.state<yo,n.state=mo,n.timer.stop(),n.on.call(o?"interrupt":"cancel",t,t.__data__,n.index,n.group),delete i[r]):a=!1;a&&delete t.__transition}}function Mo(t,e){var n,o;return function(){var r=wo(this,t),i=r.tween;if(i!==n)for(var a=0,s=(o=n=i).length;a<s;++a)if(o[a].name===e){(o=o.slice()).splice(a,1);break}r.tween=o}}function Eo(t,e,n){var o,r;if("function"!=typeof n)throw new Error;return function(){var i=wo(this,t),a=i.tween;if(a!==o){r=(o=a).slice();for(var s={name:e,value:n},u=0,c=r.length;u<c;++u)if(r[u].name===e){r[u]=s;break}u===c&&r.push(s)}i.tween=r}}function Po(t,e,n){var o=t._id;return t.each((function(){var t=wo(this,o);(t.value||(t.value={}))[e]=n.apply(this,arguments)})),function(t){return _o(t,o).value[e]}}function No(t,e){var n;return("number"==typeof e?Tn:e instanceof ln?zn:(n=ln(e))?(e=n,zn):Cn)(t,e)}function So(t){return function(){this.removeAttribute(t)}}function Ao(t){return function(){this.removeAttributeNS(t.space,t.local)}}function zo(t,e,n){var o,r,i=n+"";return function(){var a=this.getAttribute(t);return a===i?null:a===o?r:r=e(o=a,n)}}function To(t,e,n){var o,r,i=n+"";return function(){var a=this.getAttributeNS(t.space,t.local);return a===i?null:a===o?r:r=e(o=a,n)}}function $o(t,e,n){var o,r,i;return function(){var a,s,u=n(this);if(null!=u)return(a=this.getAttribute(t))===(s=u+"")?null:a===o&&s===r?i:(r=s,i=e(o=a,u));this.removeAttribute(t)}}function ko(t,e,n){var o,r,i;return function(){var a,s,u=n(this);if(null!=u)return(a=this.getAttributeNS(t.space,t.local))===(s=u+"")?null:a===o&&s===r?i:(r=s,i=e(o=a,u));this.removeAttributeNS(t.space,t.local)}}function Co(t,e){var n,o;function r(){var r=e.apply(this,arguments);return r!==o&&(n=(o=r)&&function(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}(t,r)),n}return r._value=e,r}function Oo(t,e){var n,o;function r(){var r=e.apply(this,arguments);return r!==o&&(n=(o=r)&&function(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}(t,r)),n}return r._value=e,r}function Io(t,e){return function(){xo(this,t).delay=+e.apply(this,arguments)}}function Bo(t,e){return e=+e,function(){xo(this,t).delay=e}}function Xo(t,e){return function(){wo(this,t).duration=+e.apply(this,arguments)}}function Ho(t,e){return e=+e,function(){wo(this,t).duration=e}}var Yo=ye.prototype.constructor;function Do(t){return function(){this.style.removeProperty(t)}}var Ro=0;function Vo(t,e,n,o){this._groups=t,this._parents=e,this._name=n,this._id=o}function Lo(){return++Ro}var qo=ye.prototype;Vo.prototype={constructor:Vo,select:function(t){var e=this._name,n=this._id;"function"!=typeof t&&(t=ft(t));for(var o=this._groups,r=o.length,i=new Array(r),a=0;a<r;++a)for(var s,u,c=o[a],l=c.length,h=i[a]=new Array(l),f=0;f<l;++f)(s=c[f])&&(u=t.call(s,s.__data__,f,c))&&("__data__"in s&&(u.__data__=s.__data__),h[f]=u,vo(h[f],e,n,f,h,_o(s,n)));return new Vo(i,this._parents,e,n)},selectAll:function(t){var e=this._name,n=this._id;"function"!=typeof t&&(t=pt(t));for(var o=this._groups,r=o.length,i=[],a=[],s=0;s<r;++s)for(var u,c=o[s],l=c.length,h=0;h<l;++h)if(u=c[h]){for(var f,d=t.call(u,u.__data__,h,c),p=_o(u,n),g=0,y=d.length;g<y;++g)(f=d[g])&&vo(f,e,n,g,d,p);i.push(d),a.push(u)}return new Vo(i,a,e,n)},selectChild:qo.selectChild,selectChildren:qo.selectChildren,filter:function(t){"function"!=typeof t&&(t=yt(t));for(var e=this._groups,n=e.length,o=new Array(n),r=0;r<n;++r)for(var i,a=e[r],s=a.length,u=o[r]=[],c=0;c<s;++c)(i=a[c])&&t.call(i,i.__data__,c,a)&&u.push(i);return new Vo(o,this._parents,this._name,this._id)},merge:function(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,n=t._groups,o=e.length,r=n.length,i=Math.min(o,r),a=new Array(o),s=0;s<i;++s)for(var u,c=e[s],l=n[s],h=c.length,f=a[s]=new Array(h),d=0;d<h;++d)(u=c[d]||l[d])&&(f[d]=u);for(;s<o;++s)a[s]=e[s];return new Vo(a,this._parents,this._name,this._id)},selection:function(){return new Yo(this._groups,this._parents)},transition:function(){for(var t=this._name,e=this._id,n=Lo(),o=this._groups,r=o.length,i=0;i<r;++i)for(var a,s=o[i],u=s.length,c=0;c<u;++c)if(a=s[c]){var l=_o(a,e);vo(a,t,n,c,s,{time:l.time+l.delay+l.duration,delay:0,duration:l.duration,ease:l.ease})}return new Vo(o,this._parents,t,n)},call:qo.call,nodes:qo.nodes,node:qo.node,size:qo.size,empty:qo.empty,each:qo.each,on:function(t,e){var n=this._id;return arguments.length<2?_o(this.node(),n).on.on(t):this.each(function(t,e,n){var o,r,i=function(t){return(t+"").trim().split(/^|\s+/).every((function(t){var e=t.indexOf(".");return e>=0&&(t=t.slice(0,e)),!t||"start"===t}))}(e)?xo:wo;return function(){var a=i(this,t),s=a.on;s!==o&&(r=(o=s).copy()).on(e,n),a.on=r}}(n,t,e))},attr:function(t,e){var n=st(t),o="transform"===n?Dn:No;return this.attrTween(t,"function"==typeof e?(n.local?ko:$o)(n,o,Po(this,"attr."+t,e)):null==e?(n.local?Ao:So)(n):(n.local?To:zo)(n,o,e))},attrTween:function(t,e){var n="attr."+t;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(null==e)return this.tween(n,null);if("function"!=typeof e)throw new Error;var o=st(t);return this.tween(n,(o.local?Co:Oo)(o,e))},style:function(t,e,n){var o="transform"==(t+="")?Yn:No;return null==e?this.styleTween(t,function(t,e){var n,o,r;return function(){var i=Yt(this,t),a=(this.style.removeProperty(t),Yt(this,t));return i===a?null:i===n&&a===o?r:r=e(n=i,o=a)}}(t,o)).on("end.style."+t,Do(t)):"function"==typeof e?this.styleTween(t,function(t,e,n){var o,r,i;return function(){var a=Yt(this,t),s=n(this),u=s+"";return null==s&&(this.style.removeProperty(t),u=s=Yt(this,t)),a===u?null:a===o&&u===r?i:(r=u,i=e(o=a,s))}}(t,o,Po(this,"style."+t,e))).each(function(t,e){var n,o,r,i,a="style."+e,s="end."+a;return function(){var u=wo(this,t),c=u.on,l=null==u.value[a]?i||(i=Do(e)):void 0;c===n&&r===l||(o=(n=c).copy()).on(s,r=l),u.on=o}}(this._id,t)):this.styleTween(t,function(t,e,n){var o,r,i=n+"";return function(){var a=Yt(this,t);return a===i?null:a===o?r:r=e(o=a,n)}}(t,o,e),n).on("end.style."+t,null)},styleTween:function(t,e,n){var o="style."+(t+="");if(arguments.length<2)return(o=this.tween(o))&&o._value;if(null==e)return this.tween(o,null);if("function"!=typeof e)throw new Error;return this.tween(o,function(t,e,n){var o,r;function i(){var i=e.apply(this,arguments);return i!==r&&(o=(r=i)&&function(t,e,n){return function(o){this.style.setProperty(t,e.call(this,o),n)}}(t,i,n)),o}return i._value=e,i}(t,e,null==n?"":n))},text:function(t){return this.tween("text","function"==typeof t?function(t){return function(){var e=t(this);this.textContent=null==e?"":e}}(Po(this,"text",t)):function(t){return function(){this.textContent=t}}(null==t?"":t+""))},textTween:function(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(null==t)return this.tween(e,null);if("function"!=typeof t)throw new Error;return this.tween(e,function(t){var e,n;function o(){var o=t.apply(this,arguments);return o!==n&&(e=(n=o)&&function(t){return function(e){this.textContent=t.call(this,e)}}(o)),e}return o._value=t,o}(t))},remove:function(){return this.on("end.remove",function(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}(this._id))},tween:function(t,e){var n=this._id;if(t+="",arguments.length<2){for(var o,r=_o(this.node(),n).tween,i=0,a=r.length;i<a;++i)if((o=r[i]).name===t)return o.value;return null}return this.each((null==e?Mo:Eo)(n,t,e))},delay:function(t){var e=this._id;return arguments.length?this.each(("function"==typeof t?Io:Bo)(e,t)):_o(this.node(),e).delay},duration:function(t){var e=this._id;return arguments.length?this.each(("function"==typeof t?Xo:Ho)(e,t)):_o(this.node(),e).duration},ease:function(t){var e=this._id;return arguments.length?this.each(function(t,e){if("function"!=typeof e)throw new Error;return function(){wo(this,t).ease=e}}(e,t)):_o(this.node(),e).ease},easeVarying:function(t){if("function"!=typeof t)throw new Error;return this.each(function(t,e){return function(){var n=e.apply(this,arguments);if("function"!=typeof n)throw new Error;wo(this,t).ease=n}}(this._id,t))},end:function(){var t,e,n=this,o=n._id,r=n.size();return new Promise((function(i,a){var s={value:a},u={value:function(){0==--r&&i()}};n.each((function(){var n=wo(this,o),r=n.on;r!==t&&((e=(t=r).copy())._.cancel.push(s),e._.interrupt.push(s),e._.end.push(u)),n.on=e})),0===r&&i()}))},[Symbol.iterator]:qo[Symbol.iterator]};var Zo={time:null,delay:0,duration:250,ease:function(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}};function jo(t,e){for(var n;!(n=t.__transition)||!(n=n[e]);)if(!(t=t.parentNode))throw new Error(`transition ${e} not found`);return n}ye.prototype.interrupt=function(t){return this.each((function(){bo(this,t)}))},ye.prototype.transition=function(t){var e,n;t instanceof Vo?(e=t._id,t=t._name):(e=Lo(),(n=Zo).time=to(),t=null==t?null:t+"");for(var o=this._groups,r=o.length,i=0;i<r;++i)for(var a,s=o[i],u=s.length,c=0;c<u;++c)(a=s[c])&&vo(a,t,e,c,s,n||jo(a,e));return new Vo(o,this._parents,t,e)};var Go=t=>()=>t;function Fo(t,{sourceEvent:e,target:n,transform:o,dispatch:r}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:o,enumerable:!0,configurable:!0},_:{value:r}})}function Ko(t,e,n){this.k=t,this.x=e,this.y=n}Ko.prototype={constructor:Ko,scale:function(t){return 1===t?this:new Ko(this.k*t,this.x,this.y)},translate:function(t,e){return 0===t&0===e?this:new Ko(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Uo=new Ko(1,0,0);function Wo(t){for(;!t.__zoom;)if(!(t=t.parentNode))return Uo;return t.__zoom}function Qo(t){t.stopImmediatePropagation()}function Jo(t){t.preventDefault(),t.stopImmediatePropagation()}function tr(t){return!(t.ctrlKey&&"wheel"!==t.type||t.button)}function er(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t).hasAttribute("viewBox")?[[(t=t.viewBox.baseVal).x,t.y],[t.x+t.width,t.y+t.height]]:[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]:[[0,0],[t.clientWidth,t.clientHeight]]}function nr(){return this.__zoom||Uo}function or(t){return-t.deltaY*(1===t.deltaMode?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function rr(){return navigator.maxTouchPoints||"ontouchstart"in this}function ir(t,e,n){var o=t.invertX(e[0][0])-n[0][0],r=t.invertX(e[1][0])-n[1][0],i=t.invertY(e[0][1])-n[0][1],a=t.invertY(e[1][1])-n[1][1];return t.translate(r>o?(o+r)/2:Math.min(0,o)||Math.max(0,r),a>i?(i+a)/2:Math.min(0,i)||Math.max(0,a))}function ar(){var t,e,n,o=tr,r=er,i=ir,a=or,s=rr,u=[0,1/0],c=[[-1/0,-1/0],[1/0,1/0]],l=250,h=qn,f=et("start","zoom","end"),d=500,p=150,g=0,y=10;function m(t){t.property("__zoom",nr).on("wheel.zoom",E,{passive:!1}).on("mousedown.zoom",P).on("dblclick.zoom",N).filter(s).on("touchstart.zoom",S).on("touchmove.zoom",A).on("touchend.zoom touchcancel.zoom",z).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function v(t,e){return(e=Math.max(u[0],Math.min(u[1],e)))===t.k?t:new Ko(e,t.x,t.y)}function x(t,e,n){var o=e[0]-n[0]*t.k,r=e[1]-n[1]*t.k;return o===t.x&&r===t.y?t:new Ko(t.k,o,r)}function w(t){return[(+t[0][0]+ +t[1][0])/2,(+t[0][1]+ +t[1][1])/2]}function _(t,e,n,o){t.on("start.zoom",(function(){b(this,arguments).event(o).start()})).on("interrupt.zoom end.zoom",(function(){b(this,arguments).event(o).end()})).tween("zoom",(function(){var t=this,i=arguments,a=b(t,i).event(o),s=r.apply(t,i),u=null==n?w(s):"function"==typeof n?n.apply(t,i):n,c=Math.max(s[1][0]-s[0][0],s[1][1]-s[0][1]),l=t.__zoom,f="function"==typeof e?e.apply(t,i):e,d=h(l.invert(u).concat(c/l.k),f.invert(u).concat(c/f.k));return function(t){if(1===t)t=f;else{var e=d(t),n=c/e[2];t=new Ko(n,u[0]-e[0]*n,u[1]-e[1]*n)}a.zoom(null,t)}}))}function b(t,e,n){return!n&&t.__zooming||new M(t,e)}function M(t,e){this.that=t,this.args=e,this.active=0,this.sourceEvent=null,this.extent=r.apply(t,e),this.taps=0}function E(t,...e){if(o.apply(this,arguments)){var n=b(this,e).event(t),r=this.__zoom,s=Math.max(u[0],Math.min(u[1],r.k*Math.pow(2,a.apply(this,arguments)))),l=ve(t);if(n.wheel)n.mouse[0][0]===l[0]&&n.mouse[0][1]===l[1]||(n.mouse[1]=r.invert(n.mouse[0]=l)),clearTimeout(n.wheel);else{if(r.k===s)return;n.mouse=[l,r.invert(l)],bo(this),n.start()}Jo(t),n.wheel=setTimeout((function(){n.wheel=null,n.end()}),p),n.zoom("mouse",i(x(v(r,s),n.mouse[0],n.mouse[1]),n.extent,c))}}function P(t,...e){if(!n&&o.apply(this,arguments)){var r=t.currentTarget,a=b(this,e,!0).event(t),s=me(t.view).on("mousemove.zoom",(function(t){if(Jo(t),!a.moved){var e=t.clientX-l,n=t.clientY-h;a.moved=e*e+n*n>g}a.event(t).zoom("mouse",i(x(a.that.__zoom,a.mouse[0]=ve(t,r),a.mouse[1]),a.extent,c))}),!0).on("mouseup.zoom",(function(t){s.on("mousemove.zoom mouseup.zoom",null),Ee(t.view,a.moved),Jo(t),a.event(t).end()}),!0),u=ve(t,r),l=t.clientX,h=t.clientY;Me(t.view),Qo(t),a.mouse=[u,this.__zoom.invert(u)],bo(this),a.start()}}function N(t,...e){if(o.apply(this,arguments)){var n=this.__zoom,a=ve(t.changedTouches?t.changedTouches[0]:t,this),s=n.invert(a),u=n.k*(t.shiftKey?.5:2),h=i(x(v(n,u),a,s),r.apply(this,e),c);Jo(t),l>0?me(this).transition().duration(l).call(_,h,a,t):me(this).call(m.transform,h,a,t)}}function S(n,...r){if(o.apply(this,arguments)){var i,a,s,u,c=n.touches,l=c.length,h=b(this,r,n.changedTouches.length===l).event(n);for(Qo(n),a=0;a<l;++a)u=[u=ve(s=c[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+!!t);t&&(t=clearTimeout(t)),i&&(h.taps<2&&(e=u[0],t=setTimeout((function(){t=null}),d)),bo(this),h.start())}}function A(t,...e){if(this.__zooming){var n,o,r,a,s=b(this,e).event(t),u=t.changedTouches,l=u.length;for(Jo(t),n=0;n<l;++n)r=ve(o=u[n],this),s.touch0&&s.touch0[2]===o.identifier?s.touch0[0]=r:s.touch1&&s.touch1[2]===o.identifier&&(s.touch1[0]=r);if(o=s.that.__zoom,s.touch1){var h=s.touch0[0],f=s.touch0[1],d=s.touch1[0],p=s.touch1[1],g=(g=d[0]-h[0])*g+(g=d[1]-h[1])*g,y=(y=p[0]-f[0])*y+(y=p[1]-f[1])*y;o=v(o,Math.sqrt(g/y)),r=[(h[0]+d[0])/2,(h[1]+d[1])/2],a=[(f[0]+p[0])/2,(f[1]+p[1])/2]}else{if(!s.touch0)return;r=s.touch0[0],a=s.touch0[1]}s.zoom("touch",i(x(o,r,a),s.extent,c))}}function z(t,...o){if(this.__zooming){var r,i,a=b(this,o).event(t),s=t.changedTouches,u=s.length;for(Qo(t),n&&clearTimeout(n),n=setTimeout((function(){n=null}),d),r=0;r<u;++r)i=s[r],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=ve(i,this),Math.hypot(e[0]-i[0],e[1]-i[1])<y)){var c=me(this).on("dblclick.zoom");c&&c.apply(this,arguments)}}}return m.transform=function(t,e,n,o){var r=t.selection?t.selection():t;r.property("__zoom",nr),t!==r?_(t,e,n,o):r.interrupt().each((function(){b(this,arguments).event(o).start().zoom(null,"function"==typeof e?e.apply(this,arguments):e).end()}))},m.scaleBy=function(t,e,n,o){m.scaleTo(t,(function(){return this.__zoom.k*("function"==typeof e?e.apply(this,arguments):e)}),n,o)},m.scaleTo=function(t,e,n,o){m.transform(t,(function(){var t=r.apply(this,arguments),o=this.__zoom,a=null==n?w(t):"function"==typeof n?n.apply(this,arguments):n,s=o.invert(a),u="function"==typeof e?e.apply(this,arguments):e;return i(x(v(o,u),a,s),t,c)}),n,o)},m.translateBy=function(t,e,n,o){m.transform(t,(function(){return i(this.__zoom.translate("function"==typeof e?e.apply(this,arguments):e,"function"==typeof n?n.apply(this,arguments):n),r.apply(this,arguments),c)}),null,o)},m.translateTo=function(t,e,n,o,a){m.transform(t,(function(){var t=r.apply(this,arguments),a=this.__zoom,s=null==o?w(t):"function"==typeof o?o.apply(this,arguments):o;return i(Uo.translate(s[0],s[1]).scale(a.k).translate("function"==typeof e?-e.apply(this,arguments):-e,"function"==typeof n?-n.apply(this,arguments):-n),t,c)}),o,a)},M.prototype={event:function(t){return t&&(this.sourceEvent=t),this},start:function(){return 1==++this.active&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(t,e){return this.mouse&&"mouse"!==t&&(this.mouse[1]=e.invert(this.mouse[0])),this.touch0&&"touch"!==t&&(this.touch0[1]=e.invert(this.touch0[0])),this.touch1&&"touch"!==t&&(this.touch1[1]=e.invert(this.touch1[0])),this.that.__zoom=e,this.emit("zoom"),this},end:function(){return 0==--this.active&&(delete this.that.__zooming,this.emit("end")),this},emit:function(t){var e=me(this.that).datum();f.call(t,this.that,new Fo(t,{sourceEvent:this.sourceEvent,target:m,type:t,transform:this.that.__zoom,dispatch:f}),e)}},m.wheelDelta=function(t){return arguments.length?(a="function"==typeof t?t:Go(+t),m):a},m.filter=function(t){return arguments.length?(o="function"==typeof t?t:Go(!!t),m):o},m.touchable=function(t){return arguments.length?(s="function"==typeof t?t:Go(!!t),m):s},m.extent=function(t){return arguments.length?(r="function"==typeof t?t:Go([[+t[0][0],+t[0][1]],[+t[1][0],+t[1][1]]]),m):r},m.scaleExtent=function(t){return arguments.length?(u[0]=+t[0],u[1]=+t[1],m):[u[0],u[1]]},m.translateExtent=function(t){return arguments.length?(c[0][0]=+t[0][0],c[1][0]=+t[1][0],c[0][1]=+t[0][1],c[1][1]=+t[1][1],m):[[c[0][0],c[0][1]],[c[1][0],c[1][1]]]},m.constrain=function(t){return arguments.length?(i=t,m):i},m.duration=function(t){return arguments.length?(l=+t,m):l},m.interpolate=function(t){return arguments.length?(h=t,m):h},m.on=function(){var t=f.on.apply(f,arguments);return t===f?m:t},m.clickDistance=function(t){return arguments.length?(g=(t=+t)*t,m):Math.sqrt(g)},m.tapDistance=function(t){return arguments.length?(y=+t,m):y},m}Wo.prototype=Ko.prototype;const sr=(t,e)=>t.x!==e.x||t.y!==e.y||t.zoom!==e.k,ur=t=>({x:t.x,y:t.y,zoom:t.k}),cr=({x:t,y:e,zoom:n})=>Uo.translate(t,e).scale(n),lr=(t,e)=>t.target.closest(`.${e}`),hr=(t,e)=>2===e&&Array.isArray(t)&&t.includes(2),fr=(t,e=0)=>"number"==typeof e&&e>0?t.transition().duration(e):t,dr=t=>{const e=t.ctrlKey&&$()?10:1;return-t.deltaY*(1===t.deltaMode?.05:t.deltaMode?1:.002)*e};t.XYDrag=function({domNode:t,onNodeClick:e,getStoreItems:n,onDragStart:o,onDrag:r,onDragStop:i}){let a={x:null,y:null},s=0,u=[],c=!1,l={x:0,y:0},h=null,d=null,g=!1;const y=me(t);return{update:function({noDragClassName:t,handleSelector:m,domNode:x,isSelectable:_,nodeId:b}){function M({x:t,y:e}){const{nodes:o,nodeExtent:i,snapGrid:s,snapToGrid:c,nodeOrigin:l,onNodeDrag:d,onSelectionDrag:g,onError:y,updateNodePositions:m}=n();a={x:t,y:e};let v=!1,x={x:0,y:0,x2:0,y2:0};if(u.length>1&&i){const t=f(u,l);x=w(t)}if(u=u.map((n=>{let r={x:t-n.distance.x,y:e-n.distance.y};c&&(r=S(r,s));const a=[[i[0][0],i[0][1]],[i[1][0],i[1][1]]];u.length>1&&i&&!n.extent&&(a[0][0]=n.positionAbsolute.x-x.x+i[0][0],a[1][0]=n.positionAbsolute.x+(n.width??0)-x.x2+i[1][0],a[0][1]=n.positionAbsolute.y-x.y+i[0][1],a[1][1]=n.positionAbsolute.y+(n.height??0)-x.y2+i[1][1]);const h=p(n,r,o,a,l,y);return v=v||n.position.x!==h.position.x||n.position.y!==h.position.y,n.position=h.position,n.positionAbsolute=h.positionAbsolute,n})),!v)return;m(u,!0,!0);const _=b?d:$e(g);if(h){const[t,e]=Ie({nodeId:b,dragItems:u,nodes:o});r?.(h,u,t,e),_?.(h,t,e)}}function E(){if(!d)return;const[t,e]=v(l,d);if(0!==t||0!==e){const{transform:o,panBy:r}=n();a.x=(a.x??0)-t/o[2],a.y=(a.y??0)-e/o[2],r({x:t,y:e})&&M(a)}s=requestAnimationFrame(E)}function P(t){const{nodes:r,multiSelectionActive:i,nodesDraggable:s,transform:c,snapGrid:l,snapToGrid:h,selectNodesOnDrag:f,onNodeDragStart:d,onSelectionDragStart:p,unselectNodesAndEdges:y}=n();g=!0,f&&_||i||!b||r.find((t=>t.id===b))?.selected||y(),_&&f&&e?.();const m=k(t.sourceEvent,{transform:c,snapGrid:l,snapToGrid:h});a=m,u=Oe(r,s,m,b);const v=b?d:$e(p);if(u){const[e,n]=Ie({nodeId:b,dragItems:u,nodes:r});o?.(t.sourceEvent,u,e,n),v?.(t.sourceEvent,e,n)}}const N=function(){var t,e,n,o,r=Se,i=Ae,a=ze,s=Te,u={},c=et("start","drag","end"),l=0,h=0;function f(t){t.on("mousedown.drag",d).filter(s).on("touchstart.drag",y).on("touchmove.drag",m,xe).on("touchend.drag touchcancel.drag",v).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function d(a,s){if(!o&&r.call(this,a,s)){var u=x(this,i.call(this,a,s),a,s,"mouse");u&&(me(a.view).on("mousemove.drag",p,we).on("mouseup.drag",g,we),Me(a.view),_e(a),n=!1,t=a.clientX,e=a.clientY,u("start",a))}}function p(o){if(be(o),!n){var r=o.clientX-t,i=o.clientY-e;n=r*r+i*i>h}u.mouse("drag",o)}function g(t){me(t.view).on("mousemove.drag mouseup.drag",null),Ee(t.view,n),be(t),u.mouse("end",t)}function y(t,e){if(r.call(this,t,e)){var n,o,a=t.changedTouches,s=i.call(this,t,e),u=a.length;for(n=0;n<u;++n)(o=x(this,s,t,e,a[n].identifier,a[n]))&&(_e(t),o("start",t,a[n]))}}function m(t){var e,n,o=t.changedTouches,r=o.length;for(e=0;e<r;++e)(n=u[o[e].identifier])&&(be(t),n("drag",t,o[e]))}function v(t){var e,n,r=t.changedTouches,i=r.length;for(o&&clearTimeout(o),o=setTimeout((function(){o=null}),500),e=0;e<i;++e)(n=u[r[e].identifier])&&(_e(t),n("end",t,r[e]))}function x(t,e,n,o,r,i){var s,h,d,p=c.copy(),g=ve(i||n,e);if(null!=(d=a.call(t,new Ne("beforestart",{sourceEvent:n,target:f,identifier:r,active:l,x:g[0],y:g[1],dx:0,dy:0,dispatch:p}),o)))return s=d.x-g[0]||0,h=d.y-g[1]||0,function n(i,a,c){var y,m=g;switch(i){case"start":u[r]=n,y=l++;break;case"end":delete u[r],--l;case"drag":g=ve(c||a,e),y=l}p.call(i,t,new Ne(i,{sourceEvent:a,subject:d,target:f,identifier:r,active:y,x:g[0]+s,y:g[1]+h,dx:g[0]-m[0],dy:g[1]-m[1],dispatch:p}),o)}}return f.filter=function(t){return arguments.length?(r="function"==typeof t?t:Pe(!!t),f):r},f.container=function(t){return arguments.length?(i="function"==typeof t?t:Pe(t),f):i},f.subject=function(t){return arguments.length?(a="function"==typeof t?t:Pe(t),f):a},f.touchable=function(t){return arguments.length?(s="function"==typeof t?t:Pe(!!t),f):s},f.on=function(){var t=c.on.apply(c,arguments);return t===c?f:t},f.clickDistance=function(t){return arguments.length?(h=(t=+t)*t,f):Math.sqrt(h)},f}().on("start",(t=>{const{domNode:e,nodeDragThreshold:o,transform:r,snapGrid:i,snapToGrid:s}=n();0===o&&P(t);const u=k(t.sourceEvent,{transform:r,snapGrid:i,snapToGrid:s});a=u,d=e?.getBoundingClientRect()||null,l=X(t.sourceEvent,d)})).on("drag",(t=>{const{autoPanOnNodeDrag:e,transform:o,snapGrid:r,snapToGrid:i,nodeDragThreshold:s}=n(),f=k(t.sourceEvent,{transform:o,snapGrid:r,snapToGrid:i});if(!c&&e&&g&&(c=!0,E()),!g){const e=f.xSnapped-(a.x??0),n=f.ySnapped-(a.y??0);Math.sqrt(e*e+n*n)>s&&P(t)}(a.x!==f.xSnapped||a.y!==f.ySnapped)&&u&&g&&(h=t.sourceEvent,l=X(t.sourceEvent,d),M(f))})).on("end",(t=>{if(g&&(c=!1,g=!1,cancelAnimationFrame(s),u)){const{nodes:e,updateNodePositions:o,onNodeDragStop:r,onSelectionDragStop:a}=n(),s=b?r:$e(a);o(u,!1,!1);const[c,l]=Ie({nodeId:b,dragItems:u,nodes:e});i?.(t.sourceEvent,u,c,l),s?.(t.sourceEvent,c,l)}})).filter((e=>{const n=e.target;return!e.button&&(!t||!Ce(n,`.${t}`,x))&&(!m||Ce(n,m,x))}));y.call(N)},destroy:function(){y.on(".drag",null)}}},t.XYHandle=qe,t.XYMinimap=function({domNode:t,panZoom:e,getTransform:n,getViewScale:o}){const r=me(t);return{update:function({translateExtent:t,width:i,height:a,zoomStep:s=10,pannable:u=!0,zoomable:c=!0,inversePan:l=!1}){const h=ar().on("zoom",u?r=>{const s=n();if("mousemove"!==r.sourceEvent.type||!e)return;const u=o()*Math.max(1,s[2])*(l?-1:1),c={x:s[0]-r.sourceEvent.movementX*u,y:s[1]-r.sourceEvent.movementY*u},h=[[0,0],[i,a]];e.setViewportConstrained({x:c.x,y:c.y,zoom:s[2]},h,t)}:null).on("zoom.wheel",c?t=>{const o=n();if("wheel"!==t.sourceEvent.type||!e)return;const r=-t.sourceEvent.deltaY*(1===t.sourceEvent.deltaMode?.05:t.sourceEvent.deltaMode?1:.002)*s,i=o[2]*Math.pow(2,r);e.scaleTo(i)}:null);r.call(h,{})},destroy:function(){r.on("zoom",null)},pointer:ve}},t.XYPanZoom=function({domNode:e,minZoom:n,maxZoom:o,translateExtent:r,viewport:i,onPanZoom:a,onPanZoomStart:s,onPanZoomEnd:u,onTransformChange:c,onDraggingChange:l}){const h={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{x:0,y:0,zoom:0},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},f=e.getBoundingClientRect(),d=ar().scaleExtent([n,o]).translateExtent(r),p=me(e).call(d);x({x:i.x,y:i.y,zoom:g(i.zoom,n,o)},[[0,0],[f.width,f.height]],r);const y=p.on("wheel.zoom");function m(t,e){p&&d?.transform(fr(p,e?.duration),t)}function v(){d.on("zoom",null)}function x(t,e,n){const o=cr(t),r=d?.constrain()(o,e,n);return r&&m(r),r}return d.wheelDelta(dr),{update:function({noWheelClassName:e,noPanClassName:n,onPaneContextMenu:o,userSelectionActive:r,panOnScroll:i,panOnDrag:f,panOnScrollMode:g,panOnScrollSpeed:m,preventScrolling:x,zoomOnPinch:w,zoomOnScroll:_,zoomOnDoubleClick:b,zoomActivationKeyPressed:M,lib:E}){r&&!h.isZoomingOrPanning&&v();const P=i&&!M&&!r?function({zoomPanValues:e,noWheelClassName:n,d3Selection:o,d3Zoom:r,panOnScrollMode:i,panOnScrollSpeed:a,zoomOnPinch:s,onPanZoomStart:u,onPanZoom:c,onPanZoomEnd:l}){return h=>{if(lr(h,n))return!1;h.preventDefault(),h.stopImmediatePropagation();const f=o.property("__zoom").k||1,d=$();if(h.ctrlKey&&s&&d){const t=ve(h),e=dr(h),n=f*Math.pow(2,e);return void r.scaleTo(o,n,t,h)}const p=1===h.deltaMode?20:1;let g=i===t.PanOnScrollMode.Vertical?0:h.deltaX*p,y=i===t.PanOnScrollMode.Horizontal?0:h.deltaY*p;!d&&h.shiftKey&&i!==t.PanOnScrollMode.Vertical&&(g=h.deltaY*p,y=0),r.translateBy(o,-g/f*a,-y/f*a,{internal:!0});const m=ur(o.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling||(e.isPanScrolling=!0,u?.(h,m)),e.isPanScrolling&&(c?.(h,m),e.panScrollTimeout=setTimeout((()=>{l?.(h,m),e.isPanScrolling=!1}),150))}}({zoomPanValues:h,noWheelClassName:e,d3Selection:p,d3Zoom:d,panOnScrollMode:g,panOnScrollSpeed:m,zoomOnPinch:w,onPanZoomStart:s,onPanZoom:a,onPanZoomEnd:u}):function({noWheelClassName:t,preventScrolling:e,d3ZoomHandler:n}){return function(o,r){if(!e||lr(o,t))return null;o.preventDefault(),n.call(this,o,r)}}({noWheelClassName:e,preventScrolling:x,d3ZoomHandler:y});if(p.on("wheel.zoom",P,{passive:!1}),!r){const t=function({zoomPanValues:t,onDraggingChange:e,onPanZoomStart:n}){return o=>{if(o.sourceEvent?.internal)return;const r=ur(o.transform);t.mouseButton=o.sourceEvent?.button||0,t.isZoomingOrPanning=!0,t.prevViewport=r,"mousedown"===o.sourceEvent?.type&&e(!0),n&&n?.(o.sourceEvent,r)}}({zoomPanValues:h,onDraggingChange:l,onPanZoomStart:s});d.on("start",t);const e=function({zoomPanValues:t,panOnDrag:e,onPaneContextMenu:n,onTransformChange:o,onPanZoom:r}){return i=>{t.usedRightMouseButton=!(!n||!hr(e,t.mouseButton??0)),i.sourceEvent?.sync||o([i.transform.x,i.transform.y,i.transform.k]),r&&!i.sourceEvent?.internal&&r?.(i.sourceEvent,ur(i.transform))}}({zoomPanValues:h,panOnDrag:f,onPaneContextMenu:!!o,onPanZoom:a,onTransformChange:c});d.on("zoom",e);const n=function({zoomPanValues:t,panOnDrag:e,panOnScroll:n,onDraggingChange:o,onPanZoomEnd:r,onPaneContextMenu:i}){return a=>{if(!a.sourceEvent?.internal&&(t.isZoomingOrPanning=!1,i&&hr(e,t.mouseButton??0)&&!t.usedRightMouseButton&&a.sourceEvent&&i(a.sourceEvent),t.usedRightMouseButton=!1,o(!1),r&&sr(t.prevViewport,a.transform))){const e=ur(a.transform);t.prevViewport=e,clearTimeout(t.timerId),t.timerId=setTimeout((()=>{r?.(a.sourceEvent,e)}),n?150:0)}}}({zoomPanValues:h,panOnDrag:f,panOnScroll:i,onPaneContextMenu:o,onPanZoomEnd:u,onDraggingChange:l});d.on("end",n)}const N=function({zoomActivationKeyPressed:t,zoomOnScroll:e,zoomOnPinch:n,panOnDrag:o,panOnScroll:r,zoomOnDoubleClick:i,userSelectionActive:a,noWheelClassName:s,noPanClassName:u,lib:c}){return l=>{const h=t||e,f=n&&l.ctrlKey;if(1===l.button&&"mousedown"===l.type&&(lr(l,`${c}-flow__node`)||lr(l,`${c}-flow__edge`)))return!0;if(!(o||h||r||i||n))return!1;if(a)return!1;if(!i&&"dblclick"===l.type)return!1;if(lr(l,s)&&"wheel"===l.type)return!1;if(lr(l,u)&&(!r&&"wheel"!==l.type||r&&"wheel"===l.type))return!1;if(!n&&l.ctrlKey&&"wheel"===l.type)return!1;if(!h&&!r&&!f&&"wheel"===l.type)return!1;if(!o&&("mousedown"===l.type||"touchstart"===l.type))return!1;if(Array.isArray(o)&&!o.includes(l.button)&&("mousedown"===l.type||"touchstart"===l.type))return!1;const d=Array.isArray(o)&&o.includes(l.button)||!l.button||l.button<=1;return(!l.ctrlKey||"wheel"===l.type)&&d}}({zoomActivationKeyPressed:M,panOnDrag:f,zoomOnScroll:_,panOnScroll:i,zoomOnDoubleClick:b,zoomOnPinch:w,userSelectionActive:r,noPanClassName:n,noWheelClassName:e,lib:E});d.filter(N)},destroy:v,setViewport:function(t,e){const n=cr(t);return m(n,e),n},setViewportConstrained:x,getViewport:function(){const t=p?Wo(p.node()):{x:0,y:0,k:1};return{x:t.x,y:t.y,zoom:t.k}},scaleTo:function(t,e){p&&d?.scaleTo(fr(p,e?.duration),t)},scaleBy:function(t,e){p&&d?.scaleBy(fr(p,e?.duration),t)},setScaleExtent:function(t){d?.scaleExtent(t)},setTranslateExtent:function(t){d?.translateExtent(t)},syncViewport:function(t){if(p){const e=cr(t),n=p.property("__zoom");n.k===t.zoom&&n.x===t.x&&n.y===t.y||d?.transform(p,e,null,{sync:!0})}}}},t.addEdgeBase=(t,n)=>{if(!t.source||!t.target)return e.error006(),n;let o;return o=l(t)?{...t}:{...t,id:q(t)},((t,e)=>e.some((e=>!(e.source!==t.source||e.target!==t.target||e.sourceHandle!==t.sourceHandle&&(e.sourceHandle||t.sourceHandle)||e.targetHandle!==t.targetHandle&&(e.targetHandle||t.targetHandle)))))(o,n)?n:n.concat(o)},t.boxToRect=_,t.calcAutoPan=v,t.calcNextPosition=p,t.clamp=g,t.clampPosition=y,t.createMarkerIds=function(t,{id:e,defaultColor:n}){const o=[];return t.reduce(((t,r)=>([r.markerStart,r.markerEnd].forEach((r=>{if(r&&"object"==typeof r){const i=W(r,e);o.includes(i)||(t.push({id:i,color:r.color||n,...r}),o.push(i))}})),t)),[]).sort(((t,e)=>t.id.localeCompare(e.id)))},t.devWarn=N,t.elementSelectionKeys=["Enter"," ","Escape"],t.errorMessages=e,t.fitView=function({nodes:t,width:e,height:n,panZoom:o,minZoom:r,maxZoom:i,nodeOrigin:a=[0,0]},s){const u=t.filter((t=>{const e=t.width&&t.height&&(s?.includeHiddenNodes||!t.hidden);return s?.nodes?.length?e&&s?.nodes.some((e=>e.id===t.id)):e}));if(u.length>0){const t=f(u,a),[c,l,h]=T(t,e,n,s?.minZoom??r,s?.maxZoom??i,s?.padding??.1);return o.setViewport({x:c,y:l,zoom:h},{duration:s?.duration}),!0}return!1},t.getBezierEdgeCenter=Y,t.getBezierPath=function({sourceX:e,sourceY:n,sourcePosition:o=t.Position.Bottom,targetX:r,targetY:i,targetPosition:a=t.Position.Top,curvature:s=.25}){const[u,c]=R({pos:o,x1:e,y1:n,x2:r,y2:i,c:s}),[l,h]=R({pos:a,x1:r,y1:i,x2:e,y2:n,c:s}),[f,d,p,g]=Y({sourceX:e,sourceY:n,targetX:r,targetY:i,sourceControlX:u,sourceControlY:c,targetControlX:l,targetControlY:h});return[`M${e},${n} C${u},${c} ${l},${h} ${r},${i}`,f,d,p,g]},t.getBoundsOfBoxes=x,t.getBoundsOfRects=(t,e)=>_(x(w(t),w(e))),t.getConnectedEdgesBase=d,t.getDimensions=C,t.getEdgeCenter=V,t.getEdgePosition=function(n){const[o,r,i]=F(n.sourceNode),[a,s,u]=F(n.targetNode);if(!i||!u)return null;const c=n.connectionMode===t.ConnectionMode.Strict?s.target:(s.target??[]).concat(s.source??[]),l=U(r.source,n.sourceHandle),h=U(c,n.targetHandle),f=l?.position||t.Position.Bottom,d=h?.position||t.Position.Top;if(!l||!h)return n.onError?.("008",e.error008(l?"target":"source",{id:n.id,sourceHandle:n.sourceHandle,targetHandle:n.targetHandle})),null;const{x:p,y:g}=K(f,o,l),{x:y,y:m}=K(d,a,h);return{sourceX:p,sourceY:g,targetX:y,targetY:m,sourcePosition:f,targetPosition:d}},t.getElementsToRemove=function({nodesToRemove:t,edgesToRemove:e,nodes:n,edges:o}){const r=t.map((t=>t.id)),i=e.map((t=>t.id)),a=n.reduce(((t,e)=>{const n=!r.includes(e.id)&&e.parentNode&&t.find((t=>t.id===e.parentNode));return("boolean"!=typeof e.deletable||e.deletable)&&(r.includes(e.id)||n)&&t.push(e),t}),[]),s=o.filter((t=>"boolean"!=typeof t.deletable||t.deletable));return{matchingEdges:[...s.filter((t=>i.includes(t.id))),...d(a,s)],matchingNodes:a}},t.getEventPosition=X,t.getHandleBounds=H,t.getHostForElement=O,t.getIncomersBase=(t,e,n)=>{if(!t.id)return[];const o=new Set;return n.forEach((e=>{e.target===t.id&&o.add(e.source)})),e.filter((t=>o.has(t.id)))},t.getMarkerId=W,t.getNodePositionWithOrigin=h,t.getNodesInside=(t,e,[n,o,r]=[0,0,1],i=!1,a=!1,s=[0,0])=>{const u={...A(e,[n,o,r]),width:e.width/r,height:e.height/r};return t.reduce(((t,e)=>{const{width:n,height:o,selectable:r=!0,hidden:c=!1}=e;if(a&&!r||c)return t;const l=E(u,b(e,s));return(void 0===n||void 0===o||null===n||null===o||i&&l>0||l>=(n||0)*(o||0)||e.dragging)&&t.push(e),t}),[])},t.getOutgoersBase=(t,e,n)=>{if(!t.id)return[];const o=new Set;return n.forEach((e=>{e.source===t.id&&o.add(e.target)})),e.filter((t=>o.has(t.id)))},t.getOverlappingArea=E,t.getPointerPosition=k,t.getPositionWithOrigin=({x:t,y:e,width:n,height:o,origin:r=[0,0]})=>!n||!o||r[0]<0||r[1]<0||r[0]>1||r[1]>1?{x:t,y:e}:{x:t-n*r[0],y:e-o*r[1]},t.getRectOfNodes=f,t.getSmoothStepPath=function({sourceX:e,sourceY:n,sourcePosition:o=t.Position.Bottom,targetX:r,targetY:i,targetPosition:a=t.Position.Top,borderRadius:s=5,centerX:u,centerY:c,offset:l=20}){const[h,f,d,p,g]=function({source:e,sourcePosition:n=t.Position.Bottom,target:o,targetPosition:r=t.Position.Top,center:i,offset:a}){const s=Z[n],u=Z[r],c={x:e.x+s.x*a,y:e.y+s.y*a},l={x:o.x+u.x*a,y:o.y+u.y*a},h=j({source:c,sourcePosition:n,target:l}),f=0!==h.x?"x":"y",d=h[f];let p,g,y=[];const m={x:0,y:0},v={x:0,y:0},[x,w,_,b]=V({sourceX:e.x,sourceY:e.y,targetX:o.x,targetY:o.y});if(s[f]*u[f]==-1){p=i.x||x,g=i.y||w;const t=[{x:p,y:c.y},{x:p,y:l.y}],e=[{x:c.x,y:g},{x:l.x,y:g}];y=s[f]===d?"x"===f?t:e:"x"===f?e:t}else{const t=[{x:c.x,y:l.y}],i=[{x:l.x,y:c.y}];if(y="x"===f?s.x===d?i:t:s.y===d?t:i,n===r){const t=Math.abs(e[f]-o[f]);if(t<=a){const n=Math.min(a-1,a-t);s[f]===d?m[f]=(c[f]>e[f]?-1:1)*n:v[f]=(l[f]>o[f]?-1:1)*n}}if(n!==r){const e="x"===f?"y":"x",n=s[f]===u[e],o=c[e]>l[e],r=c[e]<l[e];(1===s[f]&&(!n&&o||n&&r)||1!==s[f]&&(!n&&r||n&&o))&&(y="x"===f?t:i)}const h={x:c.x+m.x,y:c.y+m.y},x={x:l.x+v.x,y:l.y+v.y};Math.max(Math.abs(h.x-y[0].x),Math.abs(x.x-y[0].x))>=Math.max(Math.abs(h.y-y[0].y),Math.abs(x.y-y[0].y))?(p=(h.x+x.x)/2,g=y[0].y):(p=y[0].x,g=(h.y+x.y)/2)}return[[e,{x:c.x+m.x,y:c.y+m.y},...y,{x:l.x+v.x,y:l.y+v.y},o],p,g,_,b]}({source:{x:e,y:n},sourcePosition:o,target:{x:r,y:i},targetPosition:a,center:{x:u,y:c},offset:l});return[h.reduce(((t,e,n)=>{let o="";return o=n>0&&n<h.length-1?function(t,e,n,o){const r=Math.min(G(t,e)/2,G(e,n)/2,o),{x:i,y:a}=e;if(t.x===i&&i===n.x||t.y===a&&a===n.y)return`L${i} ${a}`;if(t.y===a)return`L ${i+r*(t.x<n.x?-1:1)},${a}Q ${i},${a} ${i},${a+r*(t.y<n.y?1:-1)}`;const s=t.x<n.x?1:-1;return`L ${i},${a+r*(t.y<n.y?-1:1)}Q ${i},${a} ${i+r*s},${a}`}(h[n-1],e,h[n+1],s):`${0===n?"M":"L"}${e.x} ${e.y}`,t+=o}),""),f,d,p,g]},t.getStraightPath=function({sourceX:t,sourceY:e,targetX:n,targetY:o}){const[r,i,a,s]=V({sourceX:t,sourceY:e,targetX:n,targetY:o});return[`M ${t},${e}L ${n},${o}`,r,i,a,s]},t.getTransformForBounds=T,t.groupEdgesByZLevel=function(t,e,o=!1){let r=-1;const i=t.reduce(((t,i)=>{const a=P(i.zIndex);let s=a?i.zIndex:0;if(o){const t=e.find((t=>t.id===i.target)),o=e.find((t=>t.id===i.source)),r=i.selected||t?.selected||o?.selected,u=Math.max(o?.[n]?.z||0,t?.[n]?.z||0,1e3);s=(a?i.zIndex:0)+(r?u:0)}return t[s]?t[s].push(i):t[s]=[i],r=s>r?s:r,t}),{}),a=Object.entries(i).map((([t,e])=>{const n=+t;return{edges:e,level:n,isMaxLevel:n===r}}));return 0===a.length?L:a},t.infiniteExtent=o,t.internalsSymbol=n,t.isEdgeBase=l,t.isEdgeVisible=function({sourceNode:t,targetNode:e,width:n,height:o,transform:r}){const i=x(M(t),M(e));i.x===i.x2&&(i.x2+=1),i.y===i.y2&&(i.y2+=1);const a={x:-r[0]/r[2],y:-r[1]/r[2],width:n/r[2],height:o/r[2]};return E(a,_(i))>0},t.isInputDOMNode=function(t){const e=t.composedPath?.()?.[0]||t.target,n=I.includes(e?.nodeName)||e?.hasAttribute("contenteditable"),o=t.ctrlKey||t.metaKey||t.shiftKey;return n&&!o||!!e?.closest(".nokey")},t.isMacOs=$,t.isMouseEvent=B,t.isNodeBase=t=>"id"in t&&!("source"in t)&&!("target"in t),t.isNumeric=P,t.isRectObject=t=>P(t.width)&&P(t.height)&&P(t.x)&&P(t.y),t.nodeToBox=M,t.nodeToRect=b,t.panBy=function({delta:t,panZoom:e,transform:n,translateExtent:o,width:r,height:i}){if(!e||!t.x&&!t.y)return!1;const a=e.setViewportConstrained({x:n[0]+t.x,y:n[1]+t.y,zoom:n[2]},[[0,0],[r,i]],o);return!!a&&(a.x!==n[0]||a.y!==n[1]||a.k!==n[2])},t.pointToRendererPoint=A,t.rectToBox=w,t.rendererPointToPoint=z,t.snapPosition=S,t.updateAbsolutePositions=Q,t.updateEdgeBase=(t,n,o,r={shouldReplaceId:!0})=>{const{id:i,...a}=t;if(!n.source||!n.target)return e.error006(),o;if(!o.find((e=>e.id===t.id)))return e.error007(i),o;const s={...a,id:r.shouldReplaceId?q(n):i,source:n.source,target:n.target,sourceHandle:n.sourceHandle,targetHandle:n.targetHandle};return o.filter((t=>t.id!==i)).concat(s)},t.updateNodeDimensions=function(t,e,o,r,i){const a=o?.querySelector(".xyflow__viewport");if(!a)return null;const s=window.getComputedStyle(a),{m22:u}=new window.DOMMatrixReadOnly(s.transform);return e.map((e=>{const o=t.find((t=>t.id===e.id));if(o){const t=C(o.nodeElement);if(!(!t.width||!t.height||e.width===t.width&&e.height===t.height&&!o.forceUpdate))return i?.(e.id,t),{...e,...t,[n]:{...e[n],handleBounds:{source:H(".source",o.nodeElement,u,e.origin||r),target:H(".target",o.nodeElement,u,e.origin||r)}}}}return e}))},t.updateNodes=function(t,e,o={nodeOrigin:[0,0],elevateNodesOnSelect:!0,defaults:{}}){const r={},i=o?.elevateNodesOnSelect?1e3:0;return Q(t.map((t=>{const a=e.find((e=>t.id===e.id)),s={...o.defaults,...t,positionAbsolute:t.position,width:t.width||a?.width,height:t.height||a?.height},u=(P(t.zIndex)?t.zIndex:0)+(t.selected?i:0),c=t?.[n]||a?.[n];return s.parentNode&&(r[s.parentNode]=!0),Object.defineProperty(s,n,{enumerable:!1,value:{handleBounds:c?.handleBounds,z:u}}),s})),o.nodeOrigin,r)}}));
1
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).XYFlowSystem={})}(this,(function(t){"use strict";const e={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:t=>`Node type "${t}" 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:t=>`The old edge with id=${t} does not exist.`,error009:t=>`Marker type "${t}" doesn't exist.`,error008:(t,{id:e,sourceHandle:n,targetHandle:o})=>`Couldn't create edge for ${t} handle id: "${n?o:n}", edge id: ${e}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:t=>`Edge type "${t}" not found. Using fallback type "default".`,error012:t=>`Node with id "${t}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`},n=Symbol.for("internals"),o=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]];var r,i,a,s,u,c;t.ConnectionMode=void 0,(r=t.ConnectionMode||(t.ConnectionMode={})).Strict="strict",r.Loose="loose",t.PanOnScrollMode=void 0,(i=t.PanOnScrollMode||(t.PanOnScrollMode={})).Free="free",i.Vertical="vertical",i.Horizontal="horizontal",t.SelectionMode=void 0,(a=t.SelectionMode||(t.SelectionMode={})).Partial="partial",a.Full="full",t.ConnectionLineType=void 0,(s=t.ConnectionLineType||(t.ConnectionLineType={})).Bezier="default",s.Straight="straight",s.Step="step",s.SmoothStep="smoothstep",s.SimpleBezier="simplebezier",t.MarkerType=void 0,(u=t.MarkerType||(t.MarkerType={})).Arrow="arrow",u.ArrowClosed="arrowclosed",t.Position=void 0,(c=t.Position||(t.Position={})).Left="left",c.Top="top",c.Right="right",c.Bottom="bottom";const l=t=>"id"in t&&"source"in t&&"target"in t,h=(t,e=[0,0])=>{if(!t)return{x:0,y:0,positionAbsolute:{x:0,y:0}};const n=(t.width??0)*e[0],o=(t.height??0)*e[1],r={x:t.position.x-n,y:t.position.y-o};return{...r,positionAbsolute:t.positionAbsolute?{x:t.positionAbsolute.x-n,y:t.positionAbsolute.y-o}:r}},f=(t,e=[0,0])=>{if(0===t.length)return{x:0,y:0,width:0,height:0};const n=t.reduce(((t,n)=>{const{x:o,y:r}=h(n,n.origin||e).positionAbsolute;return x(t,w({x:o,y:r,width:n.width||0,height:n.height||0}))}),{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return _(n)},d=(t,e)=>{const n=new Set;return t.forEach((t=>{n.add(t.id)})),e.filter((t=>n.has(t.source)||n.has(t.target)))};function p(t,n,o,r,i=[0,0],a){const s=function(t,e){return e&&"parent"!==e?[e[0],[e[1][0]-(t.width||0),e[1][1]-(t.height||0)]]:e}(t,t.extent||r);let u=s,c=null,l={x:0,y:0};if(t.parentNode&&(c=o.find((e=>e.id===t.parentNode))||null,l=c?h(c,c.origin||i).positionAbsolute:l),"parent"!==t.extent||t.expandParent)t.extent&&t.parentNode&&"parent"!==t.extent&&(u=[[t.extent[0][0]+l.x,t.extent[0][1]+l.y],[t.extent[1][0]+l.x,t.extent[1][1]+l.y]]);else if(t.parentNode&&t.width&&t.height){const e=t.origin||i;u=c&&P(c.width)&&P(c.height)?[[l.x+t.width*e[0],l.y+t.height*e[1]],[l.x+c.width-t.width+t.width*e[0],l.y+c.height-t.height+t.height*e[1]]]:u}else a?.("005",e.error005()),u=s;const f=u&&"parent"!==u?y(n,u):n;return{position:{x:f.x-l.x,y:f.y-l.y},positionAbsolute:f}}const g=(t,e=0,n=1)=>Math.min(Math.max(t,e),n),y=(t={x:0,y:0},e)=>({x:g(t.x,e[0][0],e[1][0]),y:g(t.y,e[0][1],e[1][1])}),m=(t,e,n)=>t<e?g(Math.abs(t-e),1,50)/50:t>n?-g(Math.abs(t-n),1,50)/50:0,v=(t,e)=>[20*m(t.x,35,e.width-35),20*m(t.y,35,e.height-35)],x=(t,e)=>({x:Math.min(t.x,e.x),y:Math.min(t.y,e.y),x2:Math.max(t.x2,e.x2),y2:Math.max(t.y2,e.y2)}),w=({x:t,y:e,width:n,height:o})=>({x:t,y:e,x2:t+n,y2:e+o}),_=({x:t,y:e,x2:n,y2:o})=>({x:t,y:e,width:n-t,height:o-e}),b=(t,e=[0,0])=>{const{positionAbsolute:n}=h(t,t.origin||e);return{...n,width:t.width||0,height:t.height||0}},M=(t,e=[0,0])=>{const{positionAbsolute:n}=h(t,t.origin||e);return{...n,x2:n.x+(t.width||0),y2:n.y+(t.height||0)}},E=(t,e)=>{const n=Math.max(0,Math.min(t.x+t.width,e.x+e.width)-Math.max(t.x,e.x)),o=Math.max(0,Math.min(t.y+t.height,e.y+e.height)-Math.max(t.y,e.y));return Math.ceil(n*o)},P=t=>!isNaN(t)&&isFinite(t),N=(t,e)=>{};function S(t,e=[1,1]){return{x:e[0]*Math.round(t.x/e[0]),y:e[1]*Math.round(t.y/e[1])}}const z=({x:t,y:e},[n,o,r],i=!1,a=[1,1])=>{const s={x:(t-n)/r,y:(e-o)/r};return i?S(s,a):s},A=({x:t,y:e},[n,o,r])=>({x:t*r+n,y:e*r+o}),T=(t,e,n,o,r,i)=>{const a=e/(t.width*(1+i)),s=n/(t.height*(1+i)),u=Math.min(a,s),c=g(u,o,r);return[e/2-(t.x+t.width/2)*c,n/2-(t.y+t.height/2)*c,c]},$=()=>"undefined"!=typeof navigator&&navigator?.userAgent?.indexOf("Mac")>=0;function k(t,{snapGrid:e=[0,0],snapToGrid:n=!1,transform:o}){const{x:r,y:i}=X(t),a=z({x:r,y:i},o),{x:s,y:u}=n?S(a,e):a;return{xSnapped:s,ySnapped:u,...a}}const C=t=>({width:t.offsetWidth,height:t.offsetHeight}),O=t=>t.getRootNode?.()||window?.document,I=["INPUT","SELECT","TEXTAREA"];const B=t=>"clientX"in t,X=(t,e)=>{const n=B(t),o=n?t.clientX:t.touches?.[0].clientX,r=n?t.clientY:t.touches?.[0].clientY;return{x:o-(e?.left??0),y:r-(e?.top??0)}},H=(t,e,n,o=[0,0])=>{const r=e.querySelectorAll(t);if(!r||!r.length)return null;const i=Array.from(r),a=e.getBoundingClientRect(),s=a.width*o[0],u=a.height*o[1];return i.map((t=>{const e=t.getBoundingClientRect();return{id:t.getAttribute("data-handleid"),position:t.getAttribute("data-handlepos"),x:(e.left-a.left-s)/n,y:(e.top-a.top-u)/n,...C(t)}}))};function Y({sourceX:t,sourceY:e,targetX:n,targetY:o,sourceControlX:r,sourceControlY:i,targetControlX:a,targetControlY:s}){const u=.125*t+.375*r+.375*a+.125*n,c=.125*e+.375*i+.375*s+.125*o;return[u,c,Math.abs(u-t),Math.abs(c-e)]}function D(t,e){return t>=0?.5*t:25*e*Math.sqrt(-t)}function R({pos:e,x1:n,y1:o,x2:r,y2:i,c:a}){switch(e){case t.Position.Left:return[n-D(n-r,a),o];case t.Position.Right:return[n+D(r-n,a),o];case t.Position.Top:return[n,o-D(o-i,a)];case t.Position.Bottom:return[n,o+D(i-o,a)]}}function V({sourceX:t,sourceY:e,targetX:n,targetY:o}){const r=Math.abs(n-t)/2,i=n<t?n+r:n-r,a=Math.abs(o-e)/2;return[i,o<e?o+a:o-a,r,a]}const L=[{level:0,isMaxLevel:!0,edges:[]}];const q=({source:t,sourceHandle:e,target:n,targetHandle:o})=>`xyflow__edge-${t}${e||""}-${n}${o||""}`;const Z={[t.Position.Left]:{x:-1,y:0},[t.Position.Right]:{x:1,y:0},[t.Position.Top]:{x:0,y:-1},[t.Position.Bottom]:{x:0,y:1}},j=({source:e,sourcePosition:n=t.Position.Bottom,target:o})=>n===t.Position.Left||n===t.Position.Right?e.x<o.x?{x:1,y:0}:{x:-1,y:0}:e.y<o.y?{x:0,y:1}:{x:0,y:-1},G=(t,e)=>Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2));function F(t){const e=t?.[n]?.handleBounds||(o=t?.handles,o?o.reduce(((t,e)=>(e.width=e.width||1,e.height=e.height||1,"source"===e.type&&t.source?.push(e),"target"===e.type&&t.target?.push(e),t)),{source:[],target:[]}):null)||null;var o;const r=t?.width||t?.size?.width,i=t?.height||t?.size?.height,a=e&&r&&i&&void 0!==t?.positionAbsolute?.x&&void 0!==t?.positionAbsolute?.y;return[{x:t?.positionAbsolute?.x||0,y:t?.positionAbsolute?.y||0,width:r||0,height:i||0},e,!!a]}function K(e,n,o=null){const r=(o?.x||0)+n.x,i=(o?.y||0)+n.y,a=o?.width||n.width,s=o?.height||n.height;switch(e){case t.Position.Top:return{x:r+a/2,y:i};case t.Position.Right:return{x:r+a,y:i+s/2};case t.Position.Bottom:return{x:r+a/2,y:i+s};case t.Position.Left:return{x:r,y:i+s/2}}}function U(t,e){return t?1!==t.length&&e?e&&t.find((t=>t.id===e))||null:t[0]:null}function W(t,e){if(!t)return"";if("string"==typeof t)return t;return`${e?`${e}__`:""}${Object.keys(t).sort().map((e=>`${e}=${t[e]}`)).join("&")}`}function Q(t,e=[0,0],o){return t.map((r=>{if(r.parentNode&&!t.find((t=>t.id===r.parentNode)))throw new Error(`Parent node ${r.parentNode} not found`);if(r.parentNode||o?.[r.id]){const i=r.parentNode?t.find((t=>t.id===r.parentNode)):null,{x:a,y:s,z:u}=J(r,t,{...r.position,z:r[n]?.z??0},i?.origin||e);r.positionAbsolute={x:a,y:s},r[n].z=u,o?.[r.id]&&(r[n].isParent=!0)}return r}))}function J(t,e,o,r){if(!t.parentNode)return o;const i=e.find((e=>e.id===t.parentNode)),a=h(i,i?.origin||r);return J(i,e,{x:(o.x??0)+a.x,y:(o.y??0)+a.y,z:(i[n]?.z??0)>(o.z??0)?i[n]?.z??0:o.z??0},i.origin||r)}var tt={value:()=>{}};function et(){for(var t,e=0,n=arguments.length,o={};e<n;++e){if(!(t=arguments[e]+"")||t in o||/[\s.]/.test(t))throw new Error("illegal type: "+t);o[t]=[]}return new nt(o)}function nt(t){this._=t}function ot(t,e){for(var n,o=0,r=t.length;o<r;++o)if((n=t[o]).name===e)return n.value}function rt(t,e,n){for(var o=0,r=t.length;o<r;++o)if(t[o].name===e){t[o]=tt,t=t.slice(0,o).concat(t.slice(o+1));break}return null!=n&&t.push({name:e,value:n}),t}nt.prototype=et.prototype={constructor:nt,on:function(t,e){var n,o,r=this._,i=(o=r,(t+"").trim().split(/^|\s+/).map((function(t){var e="",n=t.indexOf(".");if(n>=0&&(e=t.slice(n+1),t=t.slice(0,n)),t&&!o.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:e}}))),a=-1,s=i.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++a<s;)if(n=(t=i[a]).type)r[n]=rt(r[n],t.name,e);else if(null==e)for(n in r)r[n]=rt(r[n],t.name,null);return this}for(;++a<s;)if((n=(t=i[a]).type)&&(n=ot(r[n],t.name)))return n},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new nt(t)},call:function(t,e){if((n=arguments.length-2)>0)for(var n,o,r=new Array(n),i=0;i<n;++i)r[i]=arguments[i+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(i=0,n=(o=this._[t]).length;i<n;++i)o[i].value.apply(e,r)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var o=this._[t],r=0,i=o.length;r<i;++r)o[r].value.apply(e,n)}};var it="http://www.w3.org/1999/xhtml",at={svg:"http://www.w3.org/2000/svg",xhtml:it,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function st(t){var e=t+="",n=e.indexOf(":");return n>=0&&"xmlns"!==(e=t.slice(0,n))&&(t=t.slice(n+1)),at.hasOwnProperty(e)?{space:at[e],local:t}:t}function ut(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===it&&e.documentElement.namespaceURI===it?e.createElement(t):e.createElementNS(n,t)}}function ct(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function lt(t){var e=st(t);return(e.local?ct:ut)(e)}function ht(){}function ft(t){return null==t?ht:function(){return this.querySelector(t)}}function dt(){return[]}function pt(t){return null==t?dt:function(){return this.querySelectorAll(t)}}function gt(t){return function(){return null==(e=t.apply(this,arguments))?[]:Array.isArray(e)?e:Array.from(e);var e}}function yt(t){return function(){return this.matches(t)}}function mt(t){return function(e){return e.matches(t)}}var vt=Array.prototype.find;function xt(){return this.firstElementChild}var wt=Array.prototype.filter;function _t(){return Array.from(this.children)}function bt(t){return new Array(t.length)}function Mt(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}function Et(t,e,n,o,r,i){for(var a,s=0,u=e.length,c=i.length;s<c;++s)(a=e[s])?(a.__data__=i[s],o[s]=a):n[s]=new Mt(t,i[s]);for(;s<u;++s)(a=e[s])&&(r[s]=a)}function Pt(t,e,n,o,r,i,a){var s,u,c,l=new Map,h=e.length,f=i.length,d=new Array(h);for(s=0;s<h;++s)(u=e[s])&&(d[s]=c=a.call(u,u.__data__,s,e)+"",l.has(c)?r[s]=u:l.set(c,u));for(s=0;s<f;++s)c=a.call(t,i[s],s,i)+"",(u=l.get(c))?(o[s]=u,u.__data__=i[s],l.delete(c)):n[s]=new Mt(t,i[s]);for(s=0;s<h;++s)(u=e[s])&&l.get(d[s])===u&&(r[s]=u)}function Nt(t){return t.__data__}function St(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}function zt(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function At(t){return function(){this.removeAttribute(t)}}function Tt(t){return function(){this.removeAttributeNS(t.space,t.local)}}function $t(t,e){return function(){this.setAttribute(t,e)}}function kt(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function Ct(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttribute(t):this.setAttribute(t,n)}}function Ot(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function It(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function Bt(t){return function(){this.style.removeProperty(t)}}function Xt(t,e,n){return function(){this.style.setProperty(t,e,n)}}function Ht(t,e,n){return function(){var o=e.apply(this,arguments);null==o?this.style.removeProperty(t):this.style.setProperty(t,o,n)}}function Yt(t,e){return t.style.getPropertyValue(e)||It(t).getComputedStyle(t,null).getPropertyValue(e)}function Dt(t){return function(){delete this[t]}}function Rt(t,e){return function(){this[t]=e}}function Vt(t,e){return function(){var n=e.apply(this,arguments);null==n?delete this[t]:this[t]=n}}function Lt(t){return t.trim().split(/^|\s+/)}function qt(t){return t.classList||new Zt(t)}function Zt(t){this._node=t,this._names=Lt(t.getAttribute("class")||"")}function jt(t,e){for(var n=qt(t),o=-1,r=e.length;++o<r;)n.add(e[o])}function Gt(t,e){for(var n=qt(t),o=-1,r=e.length;++o<r;)n.remove(e[o])}function Ft(t){return function(){jt(this,t)}}function Kt(t){return function(){Gt(this,t)}}function Ut(t,e){return function(){(e.apply(this,arguments)?jt:Gt)(this,t)}}function Wt(){this.textContent=""}function Qt(t){return function(){this.textContent=t}}function Jt(t){return function(){var e=t.apply(this,arguments);this.textContent=null==e?"":e}}function te(){this.innerHTML=""}function ee(t){return function(){this.innerHTML=t}}function ne(t){return function(){var e=t.apply(this,arguments);this.innerHTML=null==e?"":e}}function oe(){this.nextSibling&&this.parentNode.appendChild(this)}function re(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function ie(){return null}function ae(){var t=this.parentNode;t&&t.removeChild(this)}function se(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function ue(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function ce(t){return function(){var e=this.__on;if(e){for(var n,o=0,r=-1,i=e.length;o<i;++o)n=e[o],t.type&&n.type!==t.type||n.name!==t.name?e[++r]=n:this.removeEventListener(n.type,n.listener,n.options);++r?e.length=r:delete this.__on}}}function le(t,e,n){return function(){var o,r=this.__on,i=function(t){return function(e){t.call(this,e,this.__data__)}}(e);if(r)for(var a=0,s=r.length;a<s;++a)if((o=r[a]).type===t.type&&o.name===t.name)return this.removeEventListener(o.type,o.listener,o.options),this.addEventListener(o.type,o.listener=i,o.options=n),void(o.value=e);this.addEventListener(t.type,i,n),o={type:t.type,name:t.name,value:e,listener:i,options:n},r?r.push(o):this.__on=[o]}}function he(t,e,n){var o=It(t),r=o.CustomEvent;"function"==typeof r?r=new r(e,n):(r=o.document.createEvent("Event"),n?(r.initEvent(e,n.bubbles,n.cancelable),r.detail=n.detail):r.initEvent(e,!1,!1)),t.dispatchEvent(r)}function fe(t,e){return function(){return he(this,t,e)}}function de(t,e){return function(){return he(this,t,e.apply(this,arguments))}}Mt.prototype={constructor:Mt,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}},Zt.prototype={add:function(t){this._names.indexOf(t)<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var pe=[null];function ge(t,e){this._groups=t,this._parents=e}function ye(){return new ge([[document.documentElement]],pe)}function me(t){return"string"==typeof t?new ge([[document.querySelector(t)]],[document.documentElement]):new ge([[t]],pe)}function ve(t,e){if(t=function(t){let e;for(;e=t.sourceEvent;)t=e;return t}(t),void 0===e&&(e=t.currentTarget),e){var n=e.ownerSVGElement||e;if(n.createSVGPoint){var o=n.createSVGPoint();return o.x=t.clientX,o.y=t.clientY,[(o=o.matrixTransform(e.getScreenCTM().inverse())).x,o.y]}if(e.getBoundingClientRect){var r=e.getBoundingClientRect();return[t.clientX-r.left-e.clientLeft,t.clientY-r.top-e.clientTop]}}return[t.pageX,t.pageY]}ge.prototype=ye.prototype={constructor:ge,select:function(t){"function"!=typeof t&&(t=ft(t));for(var e=this._groups,n=e.length,o=new Array(n),r=0;r<n;++r)for(var i,a,s=e[r],u=s.length,c=o[r]=new Array(u),l=0;l<u;++l)(i=s[l])&&(a=t.call(i,i.__data__,l,s))&&("__data__"in i&&(a.__data__=i.__data__),c[l]=a);return new ge(o,this._parents)},selectAll:function(t){t="function"==typeof t?gt(t):pt(t);for(var e=this._groups,n=e.length,o=[],r=[],i=0;i<n;++i)for(var a,s=e[i],u=s.length,c=0;c<u;++c)(a=s[c])&&(o.push(t.call(a,a.__data__,c,s)),r.push(a));return new ge(o,r)},selectChild:function(t){return this.select(null==t?xt:function(t){return function(){return vt.call(this.children,t)}}("function"==typeof t?t:mt(t)))},selectChildren:function(t){return this.selectAll(null==t?_t:function(t){return function(){return wt.call(this.children,t)}}("function"==typeof t?t:mt(t)))},filter:function(t){"function"!=typeof t&&(t=yt(t));for(var e=this._groups,n=e.length,o=new Array(n),r=0;r<n;++r)for(var i,a=e[r],s=a.length,u=o[r]=[],c=0;c<s;++c)(i=a[c])&&t.call(i,i.__data__,c,a)&&u.push(i);return new ge(o,this._parents)},data:function(t,e){if(!arguments.length)return Array.from(this,Nt);var n,o=e?Pt:Et,r=this._parents,i=this._groups;"function"!=typeof t&&(n=t,t=function(){return n});for(var a=i.length,s=new Array(a),u=new Array(a),c=new Array(a),l=0;l<a;++l){var h=r[l],f=i[l],d=f.length,p=St(t.call(h,h&&h.__data__,l,r)),g=p.length,y=u[l]=new Array(g),m=s[l]=new Array(g);o(h,f,y,m,c[l]=new Array(d),p,e);for(var v,x,w=0,_=0;w<g;++w)if(v=y[w]){for(w>=_&&(_=w+1);!(x=m[_])&&++_<g;);v._next=x||null}}return(s=new ge(s,r))._enter=u,s._exit=c,s},enter:function(){return new ge(this._enter||this._groups.map(bt),this._parents)},exit:function(){return new ge(this._exit||this._groups.map(bt),this._parents)},join:function(t,e,n){var o=this.enter(),r=this,i=this.exit();return"function"==typeof t?(o=t(o))&&(o=o.selection()):o=o.append(t+""),null!=e&&(r=e(r))&&(r=r.selection()),null==n?i.remove():n(i),o&&r?o.merge(r).order():r},merge:function(t){for(var e=t.selection?t.selection():t,n=this._groups,o=e._groups,r=n.length,i=o.length,a=Math.min(r,i),s=new Array(r),u=0;u<a;++u)for(var c,l=n[u],h=o[u],f=l.length,d=s[u]=new Array(f),p=0;p<f;++p)(c=l[p]||h[p])&&(d[p]=c);for(;u<r;++u)s[u]=n[u];return new ge(s,this._parents)},selection:function(){return this},order:function(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var o,r=t[e],i=r.length-1,a=r[i];--i>=0;)(o=r[i])&&(a&&4^o.compareDocumentPosition(a)&&a.parentNode.insertBefore(o,a),a=o);return this},sort:function(t){function e(e,n){return e&&n?t(e.__data__,n.__data__):!e-!n}t||(t=zt);for(var n=this._groups,o=n.length,r=new Array(o),i=0;i<o;++i){for(var a,s=n[i],u=s.length,c=r[i]=new Array(u),l=0;l<u;++l)(a=s[l])&&(c[l]=a);c.sort(e)}return new ge(r,this._parents).order()},call:function(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this},nodes:function(){return Array.from(this)},node:function(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var o=t[e],r=0,i=o.length;r<i;++r){var a=o[r];if(a)return a}return null},size:function(){let t=0;for(const e of this)++t;return t},empty:function(){return!this.node()},each:function(t){for(var e=this._groups,n=0,o=e.length;n<o;++n)for(var r,i=e[n],a=0,s=i.length;a<s;++a)(r=i[a])&&t.call(r,r.__data__,a,i);return this},attr:function(t,e){var n=st(t);if(arguments.length<2){var o=this.node();return n.local?o.getAttributeNS(n.space,n.local):o.getAttribute(n)}return this.each((null==e?n.local?Tt:At:"function"==typeof e?n.local?Ot:Ct:n.local?kt:$t)(n,e))},style:function(t,e,n){return arguments.length>1?this.each((null==e?Bt:"function"==typeof e?Ht:Xt)(t,e,null==n?"":n)):Yt(this.node(),t)},property:function(t,e){return arguments.length>1?this.each((null==e?Dt:"function"==typeof e?Vt:Rt)(t,e)):this.node()[t]},classed:function(t,e){var n=Lt(t+"");if(arguments.length<2){for(var o=qt(this.node()),r=-1,i=n.length;++r<i;)if(!o.contains(n[r]))return!1;return!0}return this.each(("function"==typeof e?Ut:e?Ft:Kt)(n,e))},text:function(t){return arguments.length?this.each(null==t?Wt:("function"==typeof t?Jt:Qt)(t)):this.node().textContent},html:function(t){return arguments.length?this.each(null==t?te:("function"==typeof t?ne:ee)(t)):this.node().innerHTML},raise:function(){return this.each(oe)},lower:function(){return this.each(re)},append:function(t){var e="function"==typeof t?t:lt(t);return this.select((function(){return this.appendChild(e.apply(this,arguments))}))},insert:function(t,e){var n="function"==typeof t?t:lt(t),o=null==e?ie:"function"==typeof e?e:ft(e);return this.select((function(){return this.insertBefore(n.apply(this,arguments),o.apply(this,arguments)||null)}))},remove:function(){return this.each(ae)},clone:function(t){return this.select(t?ue:se)},datum:function(t){return arguments.length?this.property("__data__",t):this.node().__data__},on:function(t,e,n){var o,r,i=function(t){return t.trim().split(/^|\s+/).map((function(t){var e="",n=t.indexOf(".");return n>=0&&(e=t.slice(n+1),t=t.slice(0,n)),{type:t,name:e}}))}(t+""),a=i.length;if(!(arguments.length<2)){for(s=e?le:ce,o=0;o<a;++o)this.each(s(i[o],e,n));return this}var s=this.node().__on;if(s)for(var u,c=0,l=s.length;c<l;++c)for(o=0,u=s[c];o<a;++o)if((r=i[o]).type===u.type&&r.name===u.name)return u.value},dispatch:function(t,e){return this.each(("function"==typeof e?de:fe)(t,e))},[Symbol.iterator]:function*(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var o,r=t[e],i=0,a=r.length;i<a;++i)(o=r[i])&&(yield o)}};const xe={passive:!1},we={capture:!0,passive:!1};function _e(t){t.stopImmediatePropagation()}function be(t){t.preventDefault(),t.stopImmediatePropagation()}function Me(t){var e=t.document.documentElement,n=me(t).on("dragstart.drag",be,we);"onselectstart"in e?n.on("selectstart.drag",be,we):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}function Ee(t,e){var n=t.document.documentElement,o=me(t).on("dragstart.drag",null);e&&(o.on("click.drag",be,we),setTimeout((function(){o.on("click.drag",null)}),0)),"onselectstart"in n?o.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}var Pe=t=>()=>t;function Ne(t,{sourceEvent:e,subject:n,target:o,identifier:r,active:i,x:a,y:s,dx:u,dy:c,dispatch:l}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:o,enumerable:!0,configurable:!0},identifier:{value:r,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:s,enumerable:!0,configurable:!0},dx:{value:u,enumerable:!0,configurable:!0},dy:{value:c,enumerable:!0,configurable:!0},_:{value:l}})}function Se(t){return!t.ctrlKey&&!t.button}function ze(){return this.parentNode}function Ae(t,e){return null==e?{x:t.x,y:t.y}:e}function Te(){return navigator.maxTouchPoints||"ontouchstart"in this}function $e(t){return(e,n,o)=>t?.(e,o)}function ke(t,e){if(!t.parentNode)return!1;const n=e.find((t=>t.id===t.parentNode));return!!n&&(!!n.selected||ke(n,e))}function Ce(t,e,n){let o=t;do{if(o?.matches(e))return!0;if(o===n)return!1;o=o.parentElement}while(o);return!1}function Oe(t,e,n,o){return t.filter((n=>(n.selected||n.id===o)&&(!n.parentNode||!ke(n,t))&&(n.draggable||e&&void 0===n.draggable))).map((t=>({id:t.id,position:t.position||{x:0,y:0},positionAbsolute:t.positionAbsolute||{x:0,y:0},distance:{x:n.x-(t.positionAbsolute?.x??0),y:n.y-(t.positionAbsolute?.y??0)},delta:{x:0,y:0},extent:t.extent,parentNode:t.parentNode,width:t.width,height:t.height,origin:t.origin,expandParent:t.expandParent})))}function Ie({nodeId:t,dragItems:e,nodes:n}){const o=e.map((t=>({...n.find((e=>e.id===t.id)),position:t.position,positionAbsolute:t.positionAbsolute})));return[t?o.find((e=>e.id===t)):o[0],o]}function Be(t,e,n,o){return(e[n]||[]).reduce(((e,r)=>(`${t.id}-${r.id}-${n}`!==o&&e.push({id:r.id||null,type:n,nodeId:t.id,x:(t.positionAbsolute?.x??0)+r.x+r.width/2,y:(t.positionAbsolute?.y??0)+r.y+r.height/2}),e)),[])}function Xe(t,e){return t||(e?.classList.contains("target")?"target":e?.classList.contains("source")?"source":null)}function He(t,e){t?.classList.remove("valid","connecting",`${e}-flow__handle-valid`,`${e}-flow__handle-connecting`)}function Ye(t,e){let n=null;return e?n="valid":t&&!e&&(n="invalid"),n}Ne.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};const De={source:null,target:null,sourceHandle:null,targetHandle:null},Re=()=>!0;let Ve=null;function Le(e,{handle:n,connectionMode:o,fromNodeId:r,fromHandleId:i,fromType:a,doc:s,lib:u,isValidConnection:c=Re}){const l="target"===a,h=s.querySelector(`.${u}-flow__handle[data-id="${n?.nodeId}-${n?.id}-${n?.type}"]`),{x:f,y:d}=X(e),p=s.elementFromPoint(f,d),g=p?.classList.contains(`${u}-flow__handle`)?p:h,y={handleDomNode:g,isValid:!1,connection:De,endHandle:null};if(g){const e=Xe(void 0,g),n=g.getAttribute("data-nodeid"),a=g.getAttribute("data-handleid"),s=g.classList.contains("connectable"),u=g.classList.contains("connectableend"),h={source:l?n:r,sourceHandle:l?a:i,target:l?r:n,targetHandle:l?i:a};y.connection=h;s&&u&&(o===t.ConnectionMode.Strict?l&&"source"===e||!l&&"target"===e:n!==r||a!==i)&&(y.endHandle={nodeId:n,handleId:a,type:e},y.isValid=c(h))}return y}const qe={onPointerDown:function(t,{connectionMode:e,connectionRadius:o,handleId:r,nodeId:i,edgeUpdaterType:a,isTarget:s,domNode:u,nodes:c,lib:l,autoPanOnConnect:h,panBy:f,cancelConnection:d,onConnectStart:p,onConnect:g,onConnectEnd:y,isValidConnection:m=Re,onEdgeUpdateEnd:x,updateConnection:w,getTransform:_}){const b=O(t.target);let M,E=0;const{x:P,y:N}=X(t),S=b?.elementFromPoint(P,N),T=Xe(a,S),$=u?.getBoundingClientRect();if(!$||!T)return;let k,C=X(t,$),I=!1,B=null,H=!1,Y=null;const D=function({nodes:t,nodeId:e,handleId:o,handleType:r}){return t.reduce(((t,i)=>{if(i[n]){const{handleBounds:a}=i[n];let s=[],u=[];a&&(s=Be(i,a,"source",`${e}-${o}-${r}`),u=Be(i,a,"target",`${e}-${o}-${r}`)),t.push(...s,...u)}return t}),[])}({nodes:c,nodeId:i,handleId:r,handleType:T});function R(){if(!h||!$)return;const[t,e]=v(C,$);f({x:t,y:e}),E=requestAnimationFrame(R)}function V(t){const n=_();C=X(t,$),M=function(t,e,n){let o=[],r=1/0;return n.forEach((n=>{const i=Math.sqrt(Math.pow(n.x-t.x,2)+Math.pow(n.y-t.y,2));i<=e&&(i<r?o=[n]:i===r&&o.push(n),r=i)})),o.length?1===o.length?o[0]:o.find((t=>"target"===t.type))||o[0]:null}(z(C,n,!1,[1,1]),o,D),I||(R(),I=!0);const a=Le(t,{handle:M,connectionMode:e,fromNodeId:i,fromHandleId:r,fromType:s?"target":"source",isValidConnection:m,doc:b,lib:l});if(Y=a.handleDomNode,B=a.connection,H=a.isValid,w({connectionStartHandle:Ve,connectionPosition:M&&H?A({x:M.x,y:M.y},n):C,connectionStatus:Ye(!!M,H),connectionEndHandle:a.endHandle}),!M&&!H&&!Y)return He(k,l);B.source!==B.target&&Y&&(He(k,l),k=Y,Y.classList.add("connecting",`${l}-flow__handle-connecting`),Y.classList.toggle("valid",H),Y.classList.toggle(`${l}-flow__handle-valid`,H))}function L(t){(M||Y)&&B&&H&&g?.(B),y?.(t),a&&x?.(t),He(k,l),d(),cancelAnimationFrame(E),I=!1,H=!1,B=null,Y=null,Ve=null,b.removeEventListener("mousemove",V),b.removeEventListener("mouseup",L),b.removeEventListener("touchmove",V),b.removeEventListener("touchend",L)}Ve={nodeId:i,handleId:r,type:T},w({connectionPosition:C,connectionStatus:null,connectionStartHandle:Ve,connectionEndHandle:null}),p?.(t,{nodeId:i,handleId:r,handleType:T}),b.addEventListener("mousemove",V),b.addEventListener("mouseup",L),b.addEventListener("touchmove",V),b.addEventListener("touchend",L)},isValid:Le};function Ze(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function je(t,e){var n=Object.create(t.prototype);for(var o in e)n[o]=e[o];return n}function Ge(){}var Fe=.7,Ke=1/Fe,Ue="\\s*([+-]?\\d+)\\s*",We="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Qe="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Je=/^#([0-9a-f]{3,8})$/,tn=new RegExp(`^rgb\\(${Ue},${Ue},${Ue}\\)$`),en=new RegExp(`^rgb\\(${Qe},${Qe},${Qe}\\)$`),nn=new RegExp(`^rgba\\(${Ue},${Ue},${Ue},${We}\\)$`),on=new RegExp(`^rgba\\(${Qe},${Qe},${Qe},${We}\\)$`),rn=new RegExp(`^hsl\\(${We},${Qe},${Qe}\\)$`),an=new RegExp(`^hsla\\(${We},${Qe},${Qe},${We}\\)$`),sn={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function un(){return this.rgb().formatHex()}function cn(){return this.rgb().formatRgb()}function ln(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=Je.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?hn(e):3===n?new pn(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?fn(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?fn(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=tn.exec(t))?new pn(e[1],e[2],e[3],1):(e=en.exec(t))?new pn(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=nn.exec(t))?fn(e[1],e[2],e[3],e[4]):(e=on.exec(t))?fn(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=rn.exec(t))?wn(e[1],e[2]/100,e[3]/100,1):(e=an.exec(t))?wn(e[1],e[2]/100,e[3]/100,e[4]):sn.hasOwnProperty(t)?hn(sn[t]):"transparent"===t?new pn(NaN,NaN,NaN,0):null}function hn(t){return new pn(t>>16&255,t>>8&255,255&t,1)}function fn(t,e,n,o){return o<=0&&(t=e=n=NaN),new pn(t,e,n,o)}function dn(t,e,n,o){return 1===arguments.length?((r=t)instanceof Ge||(r=ln(r)),r?new pn((r=r.rgb()).r,r.g,r.b,r.opacity):new pn):new pn(t,e,n,null==o?1:o);var r}function pn(t,e,n,o){this.r=+t,this.g=+e,this.b=+n,this.opacity=+o}function gn(){return`#${xn(this.r)}${xn(this.g)}${xn(this.b)}`}function yn(){const t=mn(this.opacity);return`${1===t?"rgb(":"rgba("}${vn(this.r)}, ${vn(this.g)}, ${vn(this.b)}${1===t?")":`, ${t})`}`}function mn(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function vn(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function xn(t){return((t=vn(t))<16?"0":"")+t.toString(16)}function wn(t,e,n,o){return o<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new bn(t,e,n,o)}function _n(t){if(t instanceof bn)return new bn(t.h,t.s,t.l,t.opacity);if(t instanceof Ge||(t=ln(t)),!t)return new bn;if(t instanceof bn)return t;var e=(t=t.rgb()).r/255,n=t.g/255,o=t.b/255,r=Math.min(e,n,o),i=Math.max(e,n,o),a=NaN,s=i-r,u=(i+r)/2;return s?(a=e===i?(n-o)/s+6*(n<o):n===i?(o-e)/s+2:(e-n)/s+4,s/=u<.5?i+r:2-i-r,a*=60):s=u>0&&u<1?0:a,new bn(a,s,u,t.opacity)}function bn(t,e,n,o){this.h=+t,this.s=+e,this.l=+n,this.opacity=+o}function Mn(t){return(t=(t||0)%360)<0?t+360:t}function En(t){return Math.max(0,Math.min(1,t||0))}function Pn(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}Ze(Ge,ln,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:un,formatHex:un,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return _n(this).formatHsl()},formatRgb:cn,toString:cn}),Ze(pn,dn,je(Ge,{brighter(t){return t=null==t?Ke:Math.pow(Ke,t),new pn(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?Fe:Math.pow(Fe,t),new pn(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new pn(vn(this.r),vn(this.g),vn(this.b),mn(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:gn,formatHex:gn,formatHex8:function(){return`#${xn(this.r)}${xn(this.g)}${xn(this.b)}${xn(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:yn,toString:yn})),Ze(bn,(function(t,e,n,o){return 1===arguments.length?_n(t):new bn(t,e,n,null==o?1:o)}),je(Ge,{brighter(t){return t=null==t?Ke:Math.pow(Ke,t),new bn(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?Fe:Math.pow(Fe,t),new bn(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,o=n+(n<.5?n:1-n)*e,r=2*n-o;return new pn(Pn(t>=240?t-240:t+120,r,o),Pn(t,r,o),Pn(t<120?t+240:t-120,r,o),this.opacity)},clamp(){return new bn(Mn(this.h),En(this.s),En(this.l),mn(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=mn(this.opacity);return`${1===t?"hsl(":"hsla("}${Mn(this.h)}, ${100*En(this.s)}%, ${100*En(this.l)}%${1===t?")":`, ${t})`}`}}));var Nn=t=>()=>t;function Sn(t){return 1==(t=+t)?zn:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(o){return Math.pow(t+o*e,n)}}(e,n,t):Nn(isNaN(e)?n:e)}}function zn(t,e){var n=e-t;return n?function(t,e){return function(n){return t+n*e}}(t,n):Nn(isNaN(t)?e:t)}var An=function t(e){var n=Sn(e);function o(t,e){var o=n((t=dn(t)).r,(e=dn(e)).r),r=n(t.g,e.g),i=n(t.b,e.b),a=zn(t.opacity,e.opacity);return function(e){return t.r=o(e),t.g=r(e),t.b=i(e),t.opacity=a(e),t+""}}return o.gamma=t,o}(1);function Tn(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}var $n=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,kn=new RegExp($n.source,"g");function Cn(t,e){var n,o,r,i=$n.lastIndex=kn.lastIndex=0,a=-1,s=[],u=[];for(t+="",e+="";(n=$n.exec(t))&&(o=kn.exec(e));)(r=o.index)>i&&(r=e.slice(i,r),s[a]?s[a]+=r:s[++a]=r),(n=n[0])===(o=o[0])?s[a]?s[a]+=o:s[++a]=o:(s[++a]=null,u.push({i:a,x:Tn(n,o)})),i=kn.lastIndex;return i<e.length&&(r=e.slice(i),s[a]?s[a]+=r:s[++a]=r),s.length<2?u[0]?function(t){return function(e){return t(e)+""}}(u[0].x):function(t){return function(){return t}}(e):(e=u.length,function(t){for(var n,o=0;o<e;++o)s[(n=u[o]).i]=n.x(t);return s.join("")})}var On,In=180/Math.PI,Bn={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Xn(t,e,n,o,r,i){var a,s,u;return(a=Math.sqrt(t*t+e*e))&&(t/=a,e/=a),(u=t*n+e*o)&&(n-=t*u,o-=e*u),(s=Math.sqrt(n*n+o*o))&&(n/=s,o/=s,u/=s),t*o<e*n&&(t=-t,e=-e,u=-u,a=-a),{translateX:r,translateY:i,rotate:Math.atan2(e,t)*In,skewX:Math.atan(u)*In,scaleX:a,scaleY:s}}function Hn(t,e,n,o){function r(t){return t.length?t.pop()+" ":""}return function(i,a){var s=[],u=[];return i=t(i),a=t(a),function(t,o,r,i,a,s){if(t!==r||o!==i){var u=a.push("translate(",null,e,null,n);s.push({i:u-4,x:Tn(t,r)},{i:u-2,x:Tn(o,i)})}else(r||i)&&a.push("translate("+r+e+i+n)}(i.translateX,i.translateY,a.translateX,a.translateY,s,u),function(t,e,n,i){t!==e?(t-e>180?e+=360:e-t>180&&(t+=360),i.push({i:n.push(r(n)+"rotate(",null,o)-2,x:Tn(t,e)})):e&&n.push(r(n)+"rotate("+e+o)}(i.rotate,a.rotate,s,u),function(t,e,n,i){t!==e?i.push({i:n.push(r(n)+"skewX(",null,o)-2,x:Tn(t,e)}):e&&n.push(r(n)+"skewX("+e+o)}(i.skewX,a.skewX,s,u),function(t,e,n,o,i,a){if(t!==n||e!==o){var s=i.push(r(i)+"scale(",null,",",null,")");a.push({i:s-4,x:Tn(t,n)},{i:s-2,x:Tn(e,o)})}else 1===n&&1===o||i.push(r(i)+"scale("+n+","+o+")")}(i.scaleX,i.scaleY,a.scaleX,a.scaleY,s,u),i=a=null,function(t){for(var e,n=-1,o=u.length;++n<o;)s[(e=u[n]).i]=e.x(t);return s.join("")}}}var Yn=Hn((function(t){const e=new("function"==typeof DOMMatrix?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?Bn:Xn(e.a,e.b,e.c,e.d,e.e,e.f)}),"px, ","px)","deg)"),Dn=Hn((function(t){return null==t?Bn:(On||(On=document.createElementNS("http://www.w3.org/2000/svg","g")),On.setAttribute("transform",t),(t=On.transform.baseVal.consolidate())?Xn((t=t.matrix).a,t.b,t.c,t.d,t.e,t.f):Bn)}),", ",")",")");function Rn(t){return((t=Math.exp(t))+1/t)/2}var Vn,Ln,qn=function t(e,n,o){function r(t,r){var i,a,s=t[0],u=t[1],c=t[2],l=r[0],h=r[1],f=r[2],d=l-s,p=h-u,g=d*d+p*p;if(g<1e-12)a=Math.log(f/c)/e,i=function(t){return[s+t*d,u+t*p,c*Math.exp(e*t*a)]};else{var y=Math.sqrt(g),m=(f*f-c*c+o*g)/(2*c*n*y),v=(f*f-c*c-o*g)/(2*f*n*y),x=Math.log(Math.sqrt(m*m+1)-m),w=Math.log(Math.sqrt(v*v+1)-v);a=(w-x)/e,i=function(t){var o,r=t*a,i=Rn(x),l=c/(n*y)*(i*(o=e*r+x,((o=Math.exp(2*o))-1)/(o+1))-function(t){return((t=Math.exp(t))-1/t)/2}(x));return[s+l*d,u+l*p,c*i/Rn(e*r+x)]}}return i.duration=1e3*a*e/Math.SQRT2,i}return r.rho=function(e){var n=Math.max(.001,+e),o=n*n;return t(n,o,o*o)},r}(Math.SQRT2,2,4),Zn=0,jn=0,Gn=0,Fn=1e3,Kn=0,Un=0,Wn=0,Qn="object"==typeof performance&&performance.now?performance:Date,Jn="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function to(){return Un||(Jn(eo),Un=Qn.now()+Wn)}function eo(){Un=0}function no(){this._call=this._time=this._next=null}function oo(t,e,n){var o=new no;return o.restart(t,e,n),o}function ro(){Un=(Kn=Qn.now())+Wn,Zn=jn=0;try{!function(){to(),++Zn;for(var t,e=Vn;e;)(t=Un-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Zn}()}finally{Zn=0,function(){var t,e,n=Vn,o=1/0;for(;n;)n._call?(o>n._time&&(o=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:Vn=e);Ln=t,ao(o)}(),Un=0}}function io(){var t=Qn.now(),e=t-Kn;e>Fn&&(Wn-=e,Kn=t)}function ao(t){Zn||(jn&&(jn=clearTimeout(jn)),t-Un>24?(t<1/0&&(jn=setTimeout(ro,t-Qn.now()-Wn)),Gn&&(Gn=clearInterval(Gn))):(Gn||(Kn=Qn.now(),Gn=setInterval(io,Fn)),Zn=1,Jn(ro)))}function so(t,e,n){var o=new no;return e=null==e?0:+e,o.restart((n=>{o.stop(),t(n+e)}),e,n),o}no.prototype=oo.prototype={constructor:no,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?to():+n)+(null==e?0:+e),this._next||Ln===this||(Ln?Ln._next=this:Vn=this,Ln=this),this._call=t,this._time=n,ao()},stop:function(){this._call&&(this._call=null,this._time=1/0,ao())}};var uo=et("start","end","cancel","interrupt"),co=[],lo=0,ho=1,fo=2,po=3,go=4,yo=5,mo=6;function vo(t,e,n,o,r,i){var a=t.__transition;if(a){if(n in a)return}else t.__transition={};!function(t,e,n){var o,r=t.__transition;function i(t){n.state=ho,n.timer.restart(a,n.delay,n.time),n.delay<=t&&a(t-n.delay)}function a(i){var c,l,h,f;if(n.state!==ho)return u();for(c in r)if((f=r[c]).name===n.name){if(f.state===po)return so(a);f.state===go?(f.state=mo,f.timer.stop(),f.on.call("interrupt",t,t.__data__,f.index,f.group),delete r[c]):+c<e&&(f.state=mo,f.timer.stop(),f.on.call("cancel",t,t.__data__,f.index,f.group),delete r[c])}if(so((function(){n.state===po&&(n.state=go,n.timer.restart(s,n.delay,n.time),s(i))})),n.state=fo,n.on.call("start",t,t.__data__,n.index,n.group),n.state===fo){for(n.state=po,o=new Array(h=n.tween.length),c=0,l=-1;c<h;++c)(f=n.tween[c].value.call(t,t.__data__,n.index,n.group))&&(o[++l]=f);o.length=l+1}}function s(e){for(var r=e<n.duration?n.ease.call(null,e/n.duration):(n.timer.restart(u),n.state=yo,1),i=-1,a=o.length;++i<a;)o[i].call(t,r);n.state===yo&&(n.on.call("end",t,t.__data__,n.index,n.group),u())}function u(){for(var o in n.state=mo,n.timer.stop(),delete r[e],r)return;delete t.__transition}r[e]=n,n.timer=oo(i,0,n.time)}(t,n,{name:e,index:o,group:r,on:uo,tween:co,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:lo})}function xo(t,e){var n=_o(t,e);if(n.state>lo)throw new Error("too late; already scheduled");return n}function wo(t,e){var n=_o(t,e);if(n.state>po)throw new Error("too late; already running");return n}function _o(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function bo(t,e){var n,o,r,i=t.__transition,a=!0;if(i){for(r in e=null==e?null:e+"",i)(n=i[r]).name===e?(o=n.state>fo&&n.state<yo,n.state=mo,n.timer.stop(),n.on.call(o?"interrupt":"cancel",t,t.__data__,n.index,n.group),delete i[r]):a=!1;a&&delete t.__transition}}function Mo(t,e){var n,o;return function(){var r=wo(this,t),i=r.tween;if(i!==n)for(var a=0,s=(o=n=i).length;a<s;++a)if(o[a].name===e){(o=o.slice()).splice(a,1);break}r.tween=o}}function Eo(t,e,n){var o,r;if("function"!=typeof n)throw new Error;return function(){var i=wo(this,t),a=i.tween;if(a!==o){r=(o=a).slice();for(var s={name:e,value:n},u=0,c=r.length;u<c;++u)if(r[u].name===e){r[u]=s;break}u===c&&r.push(s)}i.tween=r}}function Po(t,e,n){var o=t._id;return t.each((function(){var t=wo(this,o);(t.value||(t.value={}))[e]=n.apply(this,arguments)})),function(t){return _o(t,o).value[e]}}function No(t,e){var n;return("number"==typeof e?Tn:e instanceof ln?An:(n=ln(e))?(e=n,An):Cn)(t,e)}function So(t){return function(){this.removeAttribute(t)}}function zo(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Ao(t,e,n){var o,r,i=n+"";return function(){var a=this.getAttribute(t);return a===i?null:a===o?r:r=e(o=a,n)}}function To(t,e,n){var o,r,i=n+"";return function(){var a=this.getAttributeNS(t.space,t.local);return a===i?null:a===o?r:r=e(o=a,n)}}function $o(t,e,n){var o,r,i;return function(){var a,s,u=n(this);if(null!=u)return(a=this.getAttribute(t))===(s=u+"")?null:a===o&&s===r?i:(r=s,i=e(o=a,u));this.removeAttribute(t)}}function ko(t,e,n){var o,r,i;return function(){var a,s,u=n(this);if(null!=u)return(a=this.getAttributeNS(t.space,t.local))===(s=u+"")?null:a===o&&s===r?i:(r=s,i=e(o=a,u));this.removeAttributeNS(t.space,t.local)}}function Co(t,e){var n,o;function r(){var r=e.apply(this,arguments);return r!==o&&(n=(o=r)&&function(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}(t,r)),n}return r._value=e,r}function Oo(t,e){var n,o;function r(){var r=e.apply(this,arguments);return r!==o&&(n=(o=r)&&function(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}(t,r)),n}return r._value=e,r}function Io(t,e){return function(){xo(this,t).delay=+e.apply(this,arguments)}}function Bo(t,e){return e=+e,function(){xo(this,t).delay=e}}function Xo(t,e){return function(){wo(this,t).duration=+e.apply(this,arguments)}}function Ho(t,e){return e=+e,function(){wo(this,t).duration=e}}var Yo=ye.prototype.constructor;function Do(t){return function(){this.style.removeProperty(t)}}var Ro=0;function Vo(t,e,n,o){this._groups=t,this._parents=e,this._name=n,this._id=o}function Lo(){return++Ro}var qo=ye.prototype;Vo.prototype={constructor:Vo,select:function(t){var e=this._name,n=this._id;"function"!=typeof t&&(t=ft(t));for(var o=this._groups,r=o.length,i=new Array(r),a=0;a<r;++a)for(var s,u,c=o[a],l=c.length,h=i[a]=new Array(l),f=0;f<l;++f)(s=c[f])&&(u=t.call(s,s.__data__,f,c))&&("__data__"in s&&(u.__data__=s.__data__),h[f]=u,vo(h[f],e,n,f,h,_o(s,n)));return new Vo(i,this._parents,e,n)},selectAll:function(t){var e=this._name,n=this._id;"function"!=typeof t&&(t=pt(t));for(var o=this._groups,r=o.length,i=[],a=[],s=0;s<r;++s)for(var u,c=o[s],l=c.length,h=0;h<l;++h)if(u=c[h]){for(var f,d=t.call(u,u.__data__,h,c),p=_o(u,n),g=0,y=d.length;g<y;++g)(f=d[g])&&vo(f,e,n,g,d,p);i.push(d),a.push(u)}return new Vo(i,a,e,n)},selectChild:qo.selectChild,selectChildren:qo.selectChildren,filter:function(t){"function"!=typeof t&&(t=yt(t));for(var e=this._groups,n=e.length,o=new Array(n),r=0;r<n;++r)for(var i,a=e[r],s=a.length,u=o[r]=[],c=0;c<s;++c)(i=a[c])&&t.call(i,i.__data__,c,a)&&u.push(i);return new Vo(o,this._parents,this._name,this._id)},merge:function(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,n=t._groups,o=e.length,r=n.length,i=Math.min(o,r),a=new Array(o),s=0;s<i;++s)for(var u,c=e[s],l=n[s],h=c.length,f=a[s]=new Array(h),d=0;d<h;++d)(u=c[d]||l[d])&&(f[d]=u);for(;s<o;++s)a[s]=e[s];return new Vo(a,this._parents,this._name,this._id)},selection:function(){return new Yo(this._groups,this._parents)},transition:function(){for(var t=this._name,e=this._id,n=Lo(),o=this._groups,r=o.length,i=0;i<r;++i)for(var a,s=o[i],u=s.length,c=0;c<u;++c)if(a=s[c]){var l=_o(a,e);vo(a,t,n,c,s,{time:l.time+l.delay+l.duration,delay:0,duration:l.duration,ease:l.ease})}return new Vo(o,this._parents,t,n)},call:qo.call,nodes:qo.nodes,node:qo.node,size:qo.size,empty:qo.empty,each:qo.each,on:function(t,e){var n=this._id;return arguments.length<2?_o(this.node(),n).on.on(t):this.each(function(t,e,n){var o,r,i=function(t){return(t+"").trim().split(/^|\s+/).every((function(t){var e=t.indexOf(".");return e>=0&&(t=t.slice(0,e)),!t||"start"===t}))}(e)?xo:wo;return function(){var a=i(this,t),s=a.on;s!==o&&(r=(o=s).copy()).on(e,n),a.on=r}}(n,t,e))},attr:function(t,e){var n=st(t),o="transform"===n?Dn:No;return this.attrTween(t,"function"==typeof e?(n.local?ko:$o)(n,o,Po(this,"attr."+t,e)):null==e?(n.local?zo:So)(n):(n.local?To:Ao)(n,o,e))},attrTween:function(t,e){var n="attr."+t;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(null==e)return this.tween(n,null);if("function"!=typeof e)throw new Error;var o=st(t);return this.tween(n,(o.local?Co:Oo)(o,e))},style:function(t,e,n){var o="transform"==(t+="")?Yn:No;return null==e?this.styleTween(t,function(t,e){var n,o,r;return function(){var i=Yt(this,t),a=(this.style.removeProperty(t),Yt(this,t));return i===a?null:i===n&&a===o?r:r=e(n=i,o=a)}}(t,o)).on("end.style."+t,Do(t)):"function"==typeof e?this.styleTween(t,function(t,e,n){var o,r,i;return function(){var a=Yt(this,t),s=n(this),u=s+"";return null==s&&(this.style.removeProperty(t),u=s=Yt(this,t)),a===u?null:a===o&&u===r?i:(r=u,i=e(o=a,s))}}(t,o,Po(this,"style."+t,e))).each(function(t,e){var n,o,r,i,a="style."+e,s="end."+a;return function(){var u=wo(this,t),c=u.on,l=null==u.value[a]?i||(i=Do(e)):void 0;c===n&&r===l||(o=(n=c).copy()).on(s,r=l),u.on=o}}(this._id,t)):this.styleTween(t,function(t,e,n){var o,r,i=n+"";return function(){var a=Yt(this,t);return a===i?null:a===o?r:r=e(o=a,n)}}(t,o,e),n).on("end.style."+t,null)},styleTween:function(t,e,n){var o="style."+(t+="");if(arguments.length<2)return(o=this.tween(o))&&o._value;if(null==e)return this.tween(o,null);if("function"!=typeof e)throw new Error;return this.tween(o,function(t,e,n){var o,r;function i(){var i=e.apply(this,arguments);return i!==r&&(o=(r=i)&&function(t,e,n){return function(o){this.style.setProperty(t,e.call(this,o),n)}}(t,i,n)),o}return i._value=e,i}(t,e,null==n?"":n))},text:function(t){return this.tween("text","function"==typeof t?function(t){return function(){var e=t(this);this.textContent=null==e?"":e}}(Po(this,"text",t)):function(t){return function(){this.textContent=t}}(null==t?"":t+""))},textTween:function(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(null==t)return this.tween(e,null);if("function"!=typeof t)throw new Error;return this.tween(e,function(t){var e,n;function o(){var o=t.apply(this,arguments);return o!==n&&(e=(n=o)&&function(t){return function(e){this.textContent=t.call(this,e)}}(o)),e}return o._value=t,o}(t))},remove:function(){return this.on("end.remove",function(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}(this._id))},tween:function(t,e){var n=this._id;if(t+="",arguments.length<2){for(var o,r=_o(this.node(),n).tween,i=0,a=r.length;i<a;++i)if((o=r[i]).name===t)return o.value;return null}return this.each((null==e?Mo:Eo)(n,t,e))},delay:function(t){var e=this._id;return arguments.length?this.each(("function"==typeof t?Io:Bo)(e,t)):_o(this.node(),e).delay},duration:function(t){var e=this._id;return arguments.length?this.each(("function"==typeof t?Xo:Ho)(e,t)):_o(this.node(),e).duration},ease:function(t){var e=this._id;return arguments.length?this.each(function(t,e){if("function"!=typeof e)throw new Error;return function(){wo(this,t).ease=e}}(e,t)):_o(this.node(),e).ease},easeVarying:function(t){if("function"!=typeof t)throw new Error;return this.each(function(t,e){return function(){var n=e.apply(this,arguments);if("function"!=typeof n)throw new Error;wo(this,t).ease=n}}(this._id,t))},end:function(){var t,e,n=this,o=n._id,r=n.size();return new Promise((function(i,a){var s={value:a},u={value:function(){0==--r&&i()}};n.each((function(){var n=wo(this,o),r=n.on;r!==t&&((e=(t=r).copy())._.cancel.push(s),e._.interrupt.push(s),e._.end.push(u)),n.on=e})),0===r&&i()}))},[Symbol.iterator]:qo[Symbol.iterator]};var Zo={time:null,delay:0,duration:250,ease:function(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}};function jo(t,e){for(var n;!(n=t.__transition)||!(n=n[e]);)if(!(t=t.parentNode))throw new Error(`transition ${e} not found`);return n}ye.prototype.interrupt=function(t){return this.each((function(){bo(this,t)}))},ye.prototype.transition=function(t){var e,n;t instanceof Vo?(e=t._id,t=t._name):(e=Lo(),(n=Zo).time=to(),t=null==t?null:t+"");for(var o=this._groups,r=o.length,i=0;i<r;++i)for(var a,s=o[i],u=s.length,c=0;c<u;++c)(a=s[c])&&vo(a,t,e,c,s,n||jo(a,e));return new Vo(o,this._parents,t,e)};var Go=t=>()=>t;function Fo(t,{sourceEvent:e,target:n,transform:o,dispatch:r}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:o,enumerable:!0,configurable:!0},_:{value:r}})}function Ko(t,e,n){this.k=t,this.x=e,this.y=n}Ko.prototype={constructor:Ko,scale:function(t){return 1===t?this:new Ko(this.k*t,this.x,this.y)},translate:function(t,e){return 0===t&0===e?this:new Ko(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Uo=new Ko(1,0,0);function Wo(t){for(;!t.__zoom;)if(!(t=t.parentNode))return Uo;return t.__zoom}function Qo(t){t.stopImmediatePropagation()}function Jo(t){t.preventDefault(),t.stopImmediatePropagation()}function tr(t){return!(t.ctrlKey&&"wheel"!==t.type||t.button)}function er(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t).hasAttribute("viewBox")?[[(t=t.viewBox.baseVal).x,t.y],[t.x+t.width,t.y+t.height]]:[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]:[[0,0],[t.clientWidth,t.clientHeight]]}function nr(){return this.__zoom||Uo}function or(t){return-t.deltaY*(1===t.deltaMode?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function rr(){return navigator.maxTouchPoints||"ontouchstart"in this}function ir(t,e,n){var o=t.invertX(e[0][0])-n[0][0],r=t.invertX(e[1][0])-n[1][0],i=t.invertY(e[0][1])-n[0][1],a=t.invertY(e[1][1])-n[1][1];return t.translate(r>o?(o+r)/2:Math.min(0,o)||Math.max(0,r),a>i?(i+a)/2:Math.min(0,i)||Math.max(0,a))}function ar(){var t,e,n,o=tr,r=er,i=ir,a=or,s=rr,u=[0,1/0],c=[[-1/0,-1/0],[1/0,1/0]],l=250,h=qn,f=et("start","zoom","end"),d=500,p=150,g=0,y=10;function m(t){t.property("__zoom",nr).on("wheel.zoom",E,{passive:!1}).on("mousedown.zoom",P).on("dblclick.zoom",N).filter(s).on("touchstart.zoom",S).on("touchmove.zoom",z).on("touchend.zoom touchcancel.zoom",A).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function v(t,e){return(e=Math.max(u[0],Math.min(u[1],e)))===t.k?t:new Ko(e,t.x,t.y)}function x(t,e,n){var o=e[0]-n[0]*t.k,r=e[1]-n[1]*t.k;return o===t.x&&r===t.y?t:new Ko(t.k,o,r)}function w(t){return[(+t[0][0]+ +t[1][0])/2,(+t[0][1]+ +t[1][1])/2]}function _(t,e,n,o){t.on("start.zoom",(function(){b(this,arguments).event(o).start()})).on("interrupt.zoom end.zoom",(function(){b(this,arguments).event(o).end()})).tween("zoom",(function(){var t=this,i=arguments,a=b(t,i).event(o),s=r.apply(t,i),u=null==n?w(s):"function"==typeof n?n.apply(t,i):n,c=Math.max(s[1][0]-s[0][0],s[1][1]-s[0][1]),l=t.__zoom,f="function"==typeof e?e.apply(t,i):e,d=h(l.invert(u).concat(c/l.k),f.invert(u).concat(c/f.k));return function(t){if(1===t)t=f;else{var e=d(t),n=c/e[2];t=new Ko(n,u[0]-e[0]*n,u[1]-e[1]*n)}a.zoom(null,t)}}))}function b(t,e,n){return!n&&t.__zooming||new M(t,e)}function M(t,e){this.that=t,this.args=e,this.active=0,this.sourceEvent=null,this.extent=r.apply(t,e),this.taps=0}function E(t,...e){if(o.apply(this,arguments)){var n=b(this,e).event(t),r=this.__zoom,s=Math.max(u[0],Math.min(u[1],r.k*Math.pow(2,a.apply(this,arguments)))),l=ve(t);if(n.wheel)n.mouse[0][0]===l[0]&&n.mouse[0][1]===l[1]||(n.mouse[1]=r.invert(n.mouse[0]=l)),clearTimeout(n.wheel);else{if(r.k===s)return;n.mouse=[l,r.invert(l)],bo(this),n.start()}Jo(t),n.wheel=setTimeout((function(){n.wheel=null,n.end()}),p),n.zoom("mouse",i(x(v(r,s),n.mouse[0],n.mouse[1]),n.extent,c))}}function P(t,...e){if(!n&&o.apply(this,arguments)){var r=t.currentTarget,a=b(this,e,!0).event(t),s=me(t.view).on("mousemove.zoom",(function(t){if(Jo(t),!a.moved){var e=t.clientX-l,n=t.clientY-h;a.moved=e*e+n*n>g}a.event(t).zoom("mouse",i(x(a.that.__zoom,a.mouse[0]=ve(t,r),a.mouse[1]),a.extent,c))}),!0).on("mouseup.zoom",(function(t){s.on("mousemove.zoom mouseup.zoom",null),Ee(t.view,a.moved),Jo(t),a.event(t).end()}),!0),u=ve(t,r),l=t.clientX,h=t.clientY;Me(t.view),Qo(t),a.mouse=[u,this.__zoom.invert(u)],bo(this),a.start()}}function N(t,...e){if(o.apply(this,arguments)){var n=this.__zoom,a=ve(t.changedTouches?t.changedTouches[0]:t,this),s=n.invert(a),u=n.k*(t.shiftKey?.5:2),h=i(x(v(n,u),a,s),r.apply(this,e),c);Jo(t),l>0?me(this).transition().duration(l).call(_,h,a,t):me(this).call(m.transform,h,a,t)}}function S(n,...r){if(o.apply(this,arguments)){var i,a,s,u,c=n.touches,l=c.length,h=b(this,r,n.changedTouches.length===l).event(n);for(Qo(n),a=0;a<l;++a)u=[u=ve(s=c[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+!!t);t&&(t=clearTimeout(t)),i&&(h.taps<2&&(e=u[0],t=setTimeout((function(){t=null}),d)),bo(this),h.start())}}function z(t,...e){if(this.__zooming){var n,o,r,a,s=b(this,e).event(t),u=t.changedTouches,l=u.length;for(Jo(t),n=0;n<l;++n)r=ve(o=u[n],this),s.touch0&&s.touch0[2]===o.identifier?s.touch0[0]=r:s.touch1&&s.touch1[2]===o.identifier&&(s.touch1[0]=r);if(o=s.that.__zoom,s.touch1){var h=s.touch0[0],f=s.touch0[1],d=s.touch1[0],p=s.touch1[1],g=(g=d[0]-h[0])*g+(g=d[1]-h[1])*g,y=(y=p[0]-f[0])*y+(y=p[1]-f[1])*y;o=v(o,Math.sqrt(g/y)),r=[(h[0]+d[0])/2,(h[1]+d[1])/2],a=[(f[0]+p[0])/2,(f[1]+p[1])/2]}else{if(!s.touch0)return;r=s.touch0[0],a=s.touch0[1]}s.zoom("touch",i(x(o,r,a),s.extent,c))}}function A(t,...o){if(this.__zooming){var r,i,a=b(this,o).event(t),s=t.changedTouches,u=s.length;for(Qo(t),n&&clearTimeout(n),n=setTimeout((function(){n=null}),d),r=0;r<u;++r)i=s[r],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=ve(i,this),Math.hypot(e[0]-i[0],e[1]-i[1])<y)){var c=me(this).on("dblclick.zoom");c&&c.apply(this,arguments)}}}return m.transform=function(t,e,n,o){var r=t.selection?t.selection():t;r.property("__zoom",nr),t!==r?_(t,e,n,o):r.interrupt().each((function(){b(this,arguments).event(o).start().zoom(null,"function"==typeof e?e.apply(this,arguments):e).end()}))},m.scaleBy=function(t,e,n,o){m.scaleTo(t,(function(){return this.__zoom.k*("function"==typeof e?e.apply(this,arguments):e)}),n,o)},m.scaleTo=function(t,e,n,o){m.transform(t,(function(){var t=r.apply(this,arguments),o=this.__zoom,a=null==n?w(t):"function"==typeof n?n.apply(this,arguments):n,s=o.invert(a),u="function"==typeof e?e.apply(this,arguments):e;return i(x(v(o,u),a,s),t,c)}),n,o)},m.translateBy=function(t,e,n,o){m.transform(t,(function(){return i(this.__zoom.translate("function"==typeof e?e.apply(this,arguments):e,"function"==typeof n?n.apply(this,arguments):n),r.apply(this,arguments),c)}),null,o)},m.translateTo=function(t,e,n,o,a){m.transform(t,(function(){var t=r.apply(this,arguments),a=this.__zoom,s=null==o?w(t):"function"==typeof o?o.apply(this,arguments):o;return i(Uo.translate(s[0],s[1]).scale(a.k).translate("function"==typeof e?-e.apply(this,arguments):-e,"function"==typeof n?-n.apply(this,arguments):-n),t,c)}),o,a)},M.prototype={event:function(t){return t&&(this.sourceEvent=t),this},start:function(){return 1==++this.active&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(t,e){return this.mouse&&"mouse"!==t&&(this.mouse[1]=e.invert(this.mouse[0])),this.touch0&&"touch"!==t&&(this.touch0[1]=e.invert(this.touch0[0])),this.touch1&&"touch"!==t&&(this.touch1[1]=e.invert(this.touch1[0])),this.that.__zoom=e,this.emit("zoom"),this},end:function(){return 0==--this.active&&(delete this.that.__zooming,this.emit("end")),this},emit:function(t){var e=me(this.that).datum();f.call(t,this.that,new Fo(t,{sourceEvent:this.sourceEvent,target:m,type:t,transform:this.that.__zoom,dispatch:f}),e)}},m.wheelDelta=function(t){return arguments.length?(a="function"==typeof t?t:Go(+t),m):a},m.filter=function(t){return arguments.length?(o="function"==typeof t?t:Go(!!t),m):o},m.touchable=function(t){return arguments.length?(s="function"==typeof t?t:Go(!!t),m):s},m.extent=function(t){return arguments.length?(r="function"==typeof t?t:Go([[+t[0][0],+t[0][1]],[+t[1][0],+t[1][1]]]),m):r},m.scaleExtent=function(t){return arguments.length?(u[0]=+t[0],u[1]=+t[1],m):[u[0],u[1]]},m.translateExtent=function(t){return arguments.length?(c[0][0]=+t[0][0],c[1][0]=+t[1][0],c[0][1]=+t[0][1],c[1][1]=+t[1][1],m):[[c[0][0],c[0][1]],[c[1][0],c[1][1]]]},m.constrain=function(t){return arguments.length?(i=t,m):i},m.duration=function(t){return arguments.length?(l=+t,m):l},m.interpolate=function(t){return arguments.length?(h=t,m):h},m.on=function(){var t=f.on.apply(f,arguments);return t===f?m:t},m.clickDistance=function(t){return arguments.length?(g=(t=+t)*t,m):Math.sqrt(g)},m.tapDistance=function(t){return arguments.length?(y=+t,m):y},m}Wo.prototype=Ko.prototype;const sr=(t,e)=>t.x!==e.x||t.y!==e.y||t.zoom!==e.k,ur=t=>({x:t.x,y:t.y,zoom:t.k}),cr=({x:t,y:e,zoom:n})=>Uo.translate(t,e).scale(n),lr=(t,e)=>t.target.closest(`.${e}`),hr=(t,e)=>2===e&&Array.isArray(t)&&t.includes(2),fr=(t,e=0)=>"number"==typeof e&&e>0?t.transition().duration(e):t,dr=t=>{const e=t.ctrlKey&&$()?10:1;return-t.deltaY*(1===t.deltaMode?.05:t.deltaMode?1:.002)*e};t.XYDrag=function({domNode:t,onNodeMouseDown:e,getStoreItems:n,onDragStart:o,onDrag:r,onDragStop:i}){let a={x:null,y:null},s=0,u=[],c=!1,l={x:0,y:0},h=null,d=null,g=!1;const y=me(t);return{update:function({noDragClassName:t,handleSelector:m,domNode:x,isSelectable:_,nodeId:b}){function M({x:t,y:e}){const{nodes:o,nodeExtent:i,snapGrid:s,snapToGrid:c,nodeOrigin:l,onNodeDrag:d,onSelectionDrag:g,onError:y,updateNodePositions:m}=n();a={x:t,y:e};let v=!1,x={x:0,y:0,x2:0,y2:0};if(u.length>1&&i){const t=f(u,l);x=w(t)}if(u=u.map((n=>{let r={x:t-n.distance.x,y:e-n.distance.y};c&&(r=S(r,s));const a=[[i[0][0],i[0][1]],[i[1][0],i[1][1]]];u.length>1&&i&&!n.extent&&(a[0][0]=n.positionAbsolute.x-x.x+i[0][0],a[1][0]=n.positionAbsolute.x+(n.width??0)-x.x2+i[1][0],a[0][1]=n.positionAbsolute.y-x.y+i[0][1],a[1][1]=n.positionAbsolute.y+(n.height??0)-x.y2+i[1][1]);const h=p(n,r,o,a,l,y);return v=v||n.position.x!==h.position.x||n.position.y!==h.position.y,n.position=h.position,n.positionAbsolute=h.positionAbsolute,n})),!v)return;m(u,!0,!0);const _=b?d:$e(g);if(h){const[t,e]=Ie({nodeId:b,dragItems:u,nodes:o});r?.(h,u,t,e),_?.(h,t,e)}}function E(){if(!d)return;const[t,e]=v(l,d);if(0!==t||0!==e){const{transform:o,panBy:r}=n();a.x=(a.x??0)-t/o[2],a.y=(a.y??0)-e/o[2],r({x:t,y:e})&&M(a)}s=requestAnimationFrame(E)}function P(t){const{nodes:r,multiSelectionActive:i,nodesDraggable:s,transform:c,snapGrid:l,snapToGrid:h,selectNodesOnDrag:f,onNodeDragStart:d,onSelectionDragStart:p,unselectNodesAndEdges:y}=n();g=!0,f&&_||i||!b||r.find((t=>t.id===b))?.selected||y(),_&&f&&b&&e?.(b);const m=k(t.sourceEvent,{transform:c,snapGrid:l,snapToGrid:h});a=m,u=Oe(r,s,m,b);const v=b?d:$e(p);if(u){const[e,n]=Ie({nodeId:b,dragItems:u,nodes:r});o?.(t.sourceEvent,u,e,n),v?.(t.sourceEvent,e,n)}}const N=function(){var t,e,n,o,r=Se,i=ze,a=Ae,s=Te,u={},c=et("start","drag","end"),l=0,h=0;function f(t){t.on("mousedown.drag",d).filter(s).on("touchstart.drag",y).on("touchmove.drag",m,xe).on("touchend.drag touchcancel.drag",v).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function d(a,s){if(!o&&r.call(this,a,s)){var u=x(this,i.call(this,a,s),a,s,"mouse");u&&(me(a.view).on("mousemove.drag",p,we).on("mouseup.drag",g,we),Me(a.view),_e(a),n=!1,t=a.clientX,e=a.clientY,u("start",a))}}function p(o){if(be(o),!n){var r=o.clientX-t,i=o.clientY-e;n=r*r+i*i>h}u.mouse("drag",o)}function g(t){me(t.view).on("mousemove.drag mouseup.drag",null),Ee(t.view,n),be(t),u.mouse("end",t)}function y(t,e){if(r.call(this,t,e)){var n,o,a=t.changedTouches,s=i.call(this,t,e),u=a.length;for(n=0;n<u;++n)(o=x(this,s,t,e,a[n].identifier,a[n]))&&(_e(t),o("start",t,a[n]))}}function m(t){var e,n,o=t.changedTouches,r=o.length;for(e=0;e<r;++e)(n=u[o[e].identifier])&&(be(t),n("drag",t,o[e]))}function v(t){var e,n,r=t.changedTouches,i=r.length;for(o&&clearTimeout(o),o=setTimeout((function(){o=null}),500),e=0;e<i;++e)(n=u[r[e].identifier])&&(_e(t),n("end",t,r[e]))}function x(t,e,n,o,r,i){var s,h,d,p=c.copy(),g=ve(i||n,e);if(null!=(d=a.call(t,new Ne("beforestart",{sourceEvent:n,target:f,identifier:r,active:l,x:g[0],y:g[1],dx:0,dy:0,dispatch:p}),o)))return s=d.x-g[0]||0,h=d.y-g[1]||0,function n(i,a,c){var y,m=g;switch(i){case"start":u[r]=n,y=l++;break;case"end":delete u[r],--l;case"drag":g=ve(c||a,e),y=l}p.call(i,t,new Ne(i,{sourceEvent:a,subject:d,target:f,identifier:r,active:y,x:g[0]+s,y:g[1]+h,dx:g[0]-m[0],dy:g[1]-m[1],dispatch:p}),o)}}return f.filter=function(t){return arguments.length?(r="function"==typeof t?t:Pe(!!t),f):r},f.container=function(t){return arguments.length?(i="function"==typeof t?t:Pe(t),f):i},f.subject=function(t){return arguments.length?(a="function"==typeof t?t:Pe(t),f):a},f.touchable=function(t){return arguments.length?(s="function"==typeof t?t:Pe(!!t),f):s},f.on=function(){var t=c.on.apply(c,arguments);return t===c?f:t},f.clickDistance=function(t){return arguments.length?(h=(t=+t)*t,f):Math.sqrt(h)},f}().on("start",(t=>{const{domNode:e,nodeDragThreshold:o,transform:r,snapGrid:i,snapToGrid:s}=n();0===o&&P(t);const u=k(t.sourceEvent,{transform:r,snapGrid:i,snapToGrid:s});a=u,d=e?.getBoundingClientRect()||null,l=X(t.sourceEvent,d)})).on("drag",(t=>{const{autoPanOnNodeDrag:e,transform:o,snapGrid:r,snapToGrid:i,nodeDragThreshold:s}=n(),f=k(t.sourceEvent,{transform:o,snapGrid:r,snapToGrid:i});if(!c&&e&&g&&(c=!0,E()),!g){const e=f.xSnapped-(a.x??0),n=f.ySnapped-(a.y??0);Math.sqrt(e*e+n*n)>s&&P(t)}(a.x!==f.xSnapped||a.y!==f.ySnapped)&&u&&g&&(h=t.sourceEvent,l=X(t.sourceEvent,d),M(f))})).on("end",(t=>{if(g&&(c=!1,g=!1,cancelAnimationFrame(s),u)){const{nodes:e,updateNodePositions:o,onNodeDragStop:r,onSelectionDragStop:a}=n(),s=b?r:$e(a);o(u,!1,!1);const[c,l]=Ie({nodeId:b,dragItems:u,nodes:e});i?.(t.sourceEvent,u,c,l),s?.(t.sourceEvent,c,l)}})).filter((e=>{const n=e.target;return!e.button&&(!t||!Ce(n,`.${t}`,x))&&(!m||Ce(n,m,x))}));y.call(N)},destroy:function(){y.on(".drag",null)}}},t.XYHandle=qe,t.XYMinimap=function({domNode:t,panZoom:e,getTransform:n,getViewScale:o}){const r=me(t);return{update:function({translateExtent:t,width:i,height:a,zoomStep:s=10,pannable:u=!0,zoomable:c=!0,inversePan:l=!1}){const h=ar().on("zoom",u?r=>{const s=n();if("mousemove"!==r.sourceEvent.type||!e)return;const u=o()*Math.max(1,s[2])*(l?-1:1),c={x:s[0]-r.sourceEvent.movementX*u,y:s[1]-r.sourceEvent.movementY*u},h=[[0,0],[i,a]];e.setViewportConstrained({x:c.x,y:c.y,zoom:s[2]},h,t)}:null).on("zoom.wheel",c?t=>{const o=n();if("wheel"!==t.sourceEvent.type||!e)return;const r=-t.sourceEvent.deltaY*(1===t.sourceEvent.deltaMode?.05:t.sourceEvent.deltaMode?1:.002)*s,i=o[2]*Math.pow(2,r);e.scaleTo(i)}:null);r.call(h,{})},destroy:function(){r.on("zoom",null)},pointer:ve}},t.XYPanZoom=function({domNode:e,minZoom:n,maxZoom:o,translateExtent:r,viewport:i,onPanZoom:a,onPanZoomStart:s,onPanZoomEnd:u,onTransformChange:c,onDraggingChange:l}){const h={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{x:0,y:0,zoom:0},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},f=e.getBoundingClientRect(),d=ar().scaleExtent([n,o]).translateExtent(r),p=me(e).call(d);x({x:i.x,y:i.y,zoom:g(i.zoom,n,o)},[[0,0],[f.width,f.height]],r);const y=p.on("wheel.zoom");function m(t,e){p&&d?.transform(fr(p,e?.duration),t)}function v(){d.on("zoom",null)}function x(t,e,n){const o=cr(t),r=d?.constrain()(o,e,n);return r&&m(r),r}return d.wheelDelta(dr),{update:function({noWheelClassName:e,noPanClassName:n,onPaneContextMenu:o,userSelectionActive:r,panOnScroll:i,panOnDrag:f,panOnScrollMode:g,panOnScrollSpeed:m,preventScrolling:x,zoomOnPinch:w,zoomOnScroll:_,zoomOnDoubleClick:b,zoomActivationKeyPressed:M,lib:E}){r&&!h.isZoomingOrPanning&&v();const P=i&&!M&&!r?function({zoomPanValues:e,noWheelClassName:n,d3Selection:o,d3Zoom:r,panOnScrollMode:i,panOnScrollSpeed:a,zoomOnPinch:s,onPanZoomStart:u,onPanZoom:c,onPanZoomEnd:l}){return h=>{if(lr(h,n))return!1;h.preventDefault(),h.stopImmediatePropagation();const f=o.property("__zoom").k||1,d=$();if(h.ctrlKey&&s&&d){const t=ve(h),e=dr(h),n=f*Math.pow(2,e);return void r.scaleTo(o,n,t,h)}const p=1===h.deltaMode?20:1;let g=i===t.PanOnScrollMode.Vertical?0:h.deltaX*p,y=i===t.PanOnScrollMode.Horizontal?0:h.deltaY*p;!d&&h.shiftKey&&i!==t.PanOnScrollMode.Vertical&&(g=h.deltaY*p,y=0),r.translateBy(o,-g/f*a,-y/f*a,{internal:!0});const m=ur(o.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling||(e.isPanScrolling=!0,u?.(h,m)),e.isPanScrolling&&(c?.(h,m),e.panScrollTimeout=setTimeout((()=>{l?.(h,m),e.isPanScrolling=!1}),150))}}({zoomPanValues:h,noWheelClassName:e,d3Selection:p,d3Zoom:d,panOnScrollMode:g,panOnScrollSpeed:m,zoomOnPinch:w,onPanZoomStart:s,onPanZoom:a,onPanZoomEnd:u}):function({noWheelClassName:t,preventScrolling:e,d3ZoomHandler:n}){return function(o,r){if(!e||lr(o,t))return null;o.preventDefault(),n.call(this,o,r)}}({noWheelClassName:e,preventScrolling:x,d3ZoomHandler:y});if(p.on("wheel.zoom",P,{passive:!1}),!r){const t=function({zoomPanValues:t,onDraggingChange:e,onPanZoomStart:n}){return o=>{if(o.sourceEvent?.internal)return;const r=ur(o.transform);t.mouseButton=o.sourceEvent?.button||0,t.isZoomingOrPanning=!0,t.prevViewport=r,"mousedown"===o.sourceEvent?.type&&e(!0),n&&n?.(o.sourceEvent,r)}}({zoomPanValues:h,onDraggingChange:l,onPanZoomStart:s});d.on("start",t);const e=function({zoomPanValues:t,panOnDrag:e,onPaneContextMenu:n,onTransformChange:o,onPanZoom:r}){return i=>{t.usedRightMouseButton=!(!n||!hr(e,t.mouseButton??0)),i.sourceEvent?.sync||o([i.transform.x,i.transform.y,i.transform.k]),r&&!i.sourceEvent?.internal&&r?.(i.sourceEvent,ur(i.transform))}}({zoomPanValues:h,panOnDrag:f,onPaneContextMenu:!!o,onPanZoom:a,onTransformChange:c});d.on("zoom",e);const n=function({zoomPanValues:t,panOnDrag:e,panOnScroll:n,onDraggingChange:o,onPanZoomEnd:r,onPaneContextMenu:i}){return a=>{if(!a.sourceEvent?.internal&&(t.isZoomingOrPanning=!1,i&&hr(e,t.mouseButton??0)&&!t.usedRightMouseButton&&a.sourceEvent&&i(a.sourceEvent),t.usedRightMouseButton=!1,o(!1),r&&sr(t.prevViewport,a.transform))){const e=ur(a.transform);t.prevViewport=e,clearTimeout(t.timerId),t.timerId=setTimeout((()=>{r?.(a.sourceEvent,e)}),n?150:0)}}}({zoomPanValues:h,panOnDrag:f,panOnScroll:i,onPaneContextMenu:o,onPanZoomEnd:u,onDraggingChange:l});d.on("end",n)}const N=function({zoomActivationKeyPressed:t,zoomOnScroll:e,zoomOnPinch:n,panOnDrag:o,panOnScroll:r,zoomOnDoubleClick:i,userSelectionActive:a,noWheelClassName:s,noPanClassName:u,lib:c}){return l=>{const h=t||e,f=n&&l.ctrlKey;if(1===l.button&&"mousedown"===l.type&&(lr(l,`${c}-flow__node`)||lr(l,`${c}-flow__edge`)))return!0;if(!(o||h||r||i||n))return!1;if(a)return!1;if(!i&&"dblclick"===l.type)return!1;if(lr(l,s)&&"wheel"===l.type)return!1;if(lr(l,u)&&(!r&&"wheel"!==l.type||r&&"wheel"===l.type))return!1;if(!n&&l.ctrlKey&&"wheel"===l.type)return!1;if(!h&&!r&&!f&&"wheel"===l.type)return!1;if(!o&&("mousedown"===l.type||"touchstart"===l.type))return!1;if(Array.isArray(o)&&!o.includes(l.button)&&("mousedown"===l.type||"touchstart"===l.type))return!1;const d=Array.isArray(o)&&o.includes(l.button)||!l.button||l.button<=1;return(!l.ctrlKey||"wheel"===l.type)&&d}}({zoomActivationKeyPressed:M,panOnDrag:f,zoomOnScroll:_,panOnScroll:i,zoomOnDoubleClick:b,zoomOnPinch:w,userSelectionActive:r,noPanClassName:n,noWheelClassName:e,lib:E});d.filter(N)},destroy:v,setViewport:function(t,e){const n=cr(t);return m(n,e),n},setViewportConstrained:x,getViewport:function(){const t=p?Wo(p.node()):{x:0,y:0,k:1};return{x:t.x,y:t.y,zoom:t.k}},scaleTo:function(t,e){p&&d?.scaleTo(fr(p,e?.duration),t)},scaleBy:function(t,e){p&&d?.scaleBy(fr(p,e?.duration),t)},setScaleExtent:function(t){d?.scaleExtent(t)},setTranslateExtent:function(t){d?.translateExtent(t)},syncViewport:function(t){if(p){const e=cr(t),n=p.property("__zoom");n.k===t.zoom&&n.x===t.x&&n.y===t.y||d?.transform(p,e,null,{sync:!0})}}}},t.addEdgeBase=(t,n)=>{if(!t.source||!t.target)return e.error006(),n;let o;return o=l(t)?{...t}:{...t,id:q(t)},((t,e)=>e.some((e=>!(e.source!==t.source||e.target!==t.target||e.sourceHandle!==t.sourceHandle&&(e.sourceHandle||t.sourceHandle)||e.targetHandle!==t.targetHandle&&(e.targetHandle||t.targetHandle)))))(o,n)?n:n.concat(o)},t.boxToRect=_,t.calcAutoPan=v,t.calcNextPosition=p,t.clamp=g,t.clampPosition=y,t.createMarkerIds=function(t,{id:e,defaultColor:n}){const o=[];return t.reduce(((t,r)=>([r.markerStart,r.markerEnd].forEach((r=>{if(r&&"object"==typeof r){const i=W(r,e);o.includes(i)||(t.push({id:i,color:r.color||n,...r}),o.push(i))}})),t)),[]).sort(((t,e)=>t.id.localeCompare(e.id)))},t.devWarn=N,t.elementSelectionKeys=["Enter"," ","Escape"],t.errorMessages=e,t.fitView=function({nodes:t,width:e,height:n,panZoom:o,minZoom:r,maxZoom:i,nodeOrigin:a=[0,0]},s){const u=t.filter((t=>{const e=t.width&&t.height&&(s?.includeHiddenNodes||!t.hidden);return s?.nodes?.length?e&&s?.nodes.some((e=>e.id===t.id)):e}));if(u.length>0){const t=f(u,a),[c,l,h]=T(t,e,n,s?.minZoom??r,s?.maxZoom??i,s?.padding??.1);return o.setViewport({x:c,y:l,zoom:h},{duration:s?.duration}),!0}return!1},t.getBezierEdgeCenter=Y,t.getBezierPath=function({sourceX:e,sourceY:n,sourcePosition:o=t.Position.Bottom,targetX:r,targetY:i,targetPosition:a=t.Position.Top,curvature:s=.25}){const[u,c]=R({pos:o,x1:e,y1:n,x2:r,y2:i,c:s}),[l,h]=R({pos:a,x1:r,y1:i,x2:e,y2:n,c:s}),[f,d,p,g]=Y({sourceX:e,sourceY:n,targetX:r,targetY:i,sourceControlX:u,sourceControlY:c,targetControlX:l,targetControlY:h});return[`M${e},${n} C${u},${c} ${l},${h} ${r},${i}`,f,d,p,g]},t.getBoundsOfBoxes=x,t.getBoundsOfRects=(t,e)=>_(x(w(t),w(e))),t.getConnectedEdgesBase=d,t.getDimensions=C,t.getEdgeCenter=V,t.getEdgePosition=function(n){const[o,r,i]=F(n.sourceNode),[a,s,u]=F(n.targetNode);if(!i||!u)return null;const c=n.connectionMode===t.ConnectionMode.Strict?s.target:(s.target??[]).concat(s.source??[]),l=U(r.source,n.sourceHandle),h=U(c,n.targetHandle),f=l?.position||t.Position.Bottom,d=h?.position||t.Position.Top;if(!l||!h)return n.onError?.("008",e.error008(l?"target":"source",{id:n.id,sourceHandle:n.sourceHandle,targetHandle:n.targetHandle})),null;const{x:p,y:g}=K(f,o,l),{x:y,y:m}=K(d,a,h);return{sourceX:p,sourceY:g,targetX:y,targetY:m,sourcePosition:f,targetPosition:d}},t.getElementsToRemove=function({nodesToRemove:t,edgesToRemove:e,nodes:n,edges:o}){const r=t.map((t=>t.id)),i=e.map((t=>t.id)),a=n.reduce(((t,e)=>{const n=!r.includes(e.id)&&e.parentNode&&t.find((t=>t.id===e.parentNode));return("boolean"!=typeof e.deletable||e.deletable)&&(r.includes(e.id)||n)&&t.push(e),t}),[]),s=o.filter((t=>"boolean"!=typeof t.deletable||t.deletable));return{matchingEdges:[...s.filter((t=>i.includes(t.id))),...d(a,s)],matchingNodes:a}},t.getEventPosition=X,t.getHandleBounds=H,t.getHostForElement=O,t.getIncomersBase=(t,e,n)=>{if(!t.id)return[];const o=new Set;return n.forEach((e=>{e.target===t.id&&o.add(e.source)})),e.filter((t=>o.has(t.id)))},t.getMarkerId=W,t.getNodePositionWithOrigin=h,t.getNodesInside=(t,e,[n,o,r]=[0,0,1],i=!1,a=!1,s=[0,0])=>{const u={...z(e,[n,o,r]),width:e.width/r,height:e.height/r};return t.reduce(((t,e)=>{const{width:n,height:o,selectable:r=!0,hidden:c=!1}=e;if(a&&!r||c)return t;const l=E(u,b(e,s));return(void 0===n||void 0===o||null===n||null===o||i&&l>0||l>=(n||0)*(o||0)||e.dragging)&&t.push(e),t}),[])},t.getOutgoersBase=(t,e,n)=>{if(!t.id)return[];const o=new Set;return n.forEach((e=>{e.source===t.id&&o.add(e.target)})),e.filter((t=>o.has(t.id)))},t.getOverlappingArea=E,t.getPointerPosition=k,t.getPositionWithOrigin=({x:t,y:e,width:n,height:o,origin:r=[0,0]})=>!n||!o||r[0]<0||r[1]<0||r[0]>1||r[1]>1?{x:t,y:e}:{x:t-n*r[0],y:e-o*r[1]},t.getRectOfNodes=f,t.getSmoothStepPath=function({sourceX:e,sourceY:n,sourcePosition:o=t.Position.Bottom,targetX:r,targetY:i,targetPosition:a=t.Position.Top,borderRadius:s=5,centerX:u,centerY:c,offset:l=20}){const[h,f,d,p,g]=function({source:e,sourcePosition:n=t.Position.Bottom,target:o,targetPosition:r=t.Position.Top,center:i,offset:a}){const s=Z[n],u=Z[r],c={x:e.x+s.x*a,y:e.y+s.y*a},l={x:o.x+u.x*a,y:o.y+u.y*a},h=j({source:c,sourcePosition:n,target:l}),f=0!==h.x?"x":"y",d=h[f];let p,g,y=[];const m={x:0,y:0},v={x:0,y:0},[x,w,_,b]=V({sourceX:e.x,sourceY:e.y,targetX:o.x,targetY:o.y});if(s[f]*u[f]==-1){p=i.x||x,g=i.y||w;const t=[{x:p,y:c.y},{x:p,y:l.y}],e=[{x:c.x,y:g},{x:l.x,y:g}];y=s[f]===d?"x"===f?t:e:"x"===f?e:t}else{const t=[{x:c.x,y:l.y}],i=[{x:l.x,y:c.y}];if(y="x"===f?s.x===d?i:t:s.y===d?t:i,n===r){const t=Math.abs(e[f]-o[f]);if(t<=a){const n=Math.min(a-1,a-t);s[f]===d?m[f]=(c[f]>e[f]?-1:1)*n:v[f]=(l[f]>o[f]?-1:1)*n}}if(n!==r){const e="x"===f?"y":"x",n=s[f]===u[e],o=c[e]>l[e],r=c[e]<l[e];(1===s[f]&&(!n&&o||n&&r)||1!==s[f]&&(!n&&r||n&&o))&&(y="x"===f?t:i)}const h={x:c.x+m.x,y:c.y+m.y},x={x:l.x+v.x,y:l.y+v.y};Math.max(Math.abs(h.x-y[0].x),Math.abs(x.x-y[0].x))>=Math.max(Math.abs(h.y-y[0].y),Math.abs(x.y-y[0].y))?(p=(h.x+x.x)/2,g=y[0].y):(p=y[0].x,g=(h.y+x.y)/2)}return[[e,{x:c.x+m.x,y:c.y+m.y},...y,{x:l.x+v.x,y:l.y+v.y},o],p,g,_,b]}({source:{x:e,y:n},sourcePosition:o,target:{x:r,y:i},targetPosition:a,center:{x:u,y:c},offset:l});return[h.reduce(((t,e,n)=>{let o="";return o=n>0&&n<h.length-1?function(t,e,n,o){const r=Math.min(G(t,e)/2,G(e,n)/2,o),{x:i,y:a}=e;if(t.x===i&&i===n.x||t.y===a&&a===n.y)return`L${i} ${a}`;if(t.y===a)return`L ${i+r*(t.x<n.x?-1:1)},${a}Q ${i},${a} ${i},${a+r*(t.y<n.y?1:-1)}`;const s=t.x<n.x?1:-1;return`L ${i},${a+r*(t.y<n.y?-1:1)}Q ${i},${a} ${i+r*s},${a}`}(h[n-1],e,h[n+1],s):`${0===n?"M":"L"}${e.x} ${e.y}`,t+=o}),""),f,d,p,g]},t.getStraightPath=function({sourceX:t,sourceY:e,targetX:n,targetY:o}){const[r,i,a,s]=V({sourceX:t,sourceY:e,targetX:n,targetY:o});return[`M ${t},${e}L ${n},${o}`,r,i,a,s]},t.getTransformForBounds=T,t.groupEdgesByZLevel=function(t,e,o=!1){let r=-1;const i=t.reduce(((t,i)=>{const a=P(i.zIndex);let s=a?i.zIndex:0;if(o){const t=e.find((t=>t.id===i.target)),o=e.find((t=>t.id===i.source)),r=i.selected||t?.selected||o?.selected,u=Math.max(o?.[n]?.z||0,t?.[n]?.z||0,1e3);s=(a?i.zIndex:0)+(r?u:0)}return t[s]?t[s].push(i):t[s]=[i],r=s>r?s:r,t}),{}),a=Object.entries(i).map((([t,e])=>{const n=+t;return{edges:e,level:n,isMaxLevel:n===r}}));return 0===a.length?L:a},t.infiniteExtent=o,t.internalsSymbol=n,t.isEdgeBase=l,t.isEdgeVisible=function({sourceNode:t,targetNode:e,width:n,height:o,transform:r}){const i=x(M(t),M(e));i.x===i.x2&&(i.x2+=1),i.y===i.y2&&(i.y2+=1);const a={x:-r[0]/r[2],y:-r[1]/r[2],width:n/r[2],height:o/r[2]};return E(a,_(i))>0},t.isInputDOMNode=function(t){const e=t.composedPath?.()?.[0]||t.target,n=I.includes(e?.nodeName)||e?.hasAttribute("contenteditable"),o=t.ctrlKey||t.metaKey||t.shiftKey;return n&&!o||!!e?.closest(".nokey")},t.isMacOs=$,t.isMouseEvent=B,t.isNodeBase=t=>"id"in t&&!("source"in t)&&!("target"in t),t.isNumeric=P,t.isRectObject=t=>P(t.width)&&P(t.height)&&P(t.x)&&P(t.y),t.nodeToBox=M,t.nodeToRect=b,t.panBy=function({delta:t,panZoom:e,transform:n,translateExtent:o,width:r,height:i}){if(!e||!t.x&&!t.y)return!1;const a=e.setViewportConstrained({x:n[0]+t.x,y:n[1]+t.y,zoom:n[2]},[[0,0],[r,i]],o);return!!a&&(a.x!==n[0]||a.y!==n[1]||a.k!==n[2])},t.pointToRendererPoint=z,t.rectToBox=w,t.rendererPointToPoint=A,t.snapPosition=S,t.updateAbsolutePositions=Q,t.updateEdgeBase=(t,n,o,r={shouldReplaceId:!0})=>{const{id:i,...a}=t;if(!n.source||!n.target)return e.error006(),o;if(!o.find((e=>e.id===t.id)))return e.error007(i),o;const s={...a,id:r.shouldReplaceId?q(n):i,source:n.source,target:n.target,sourceHandle:n.sourceHandle,targetHandle:n.targetHandle};return o.filter((t=>t.id!==i)).concat(s)},t.updateNodeDimensions=function(t,e,o,r,i){const a=o?.querySelector(".xyflow__viewport");if(!a)return null;const s=window.getComputedStyle(a),{m22:u}=new window.DOMMatrixReadOnly(s.transform);return e.map((e=>{const o=t.find((t=>t.id===e.id));if(o){const t=C(o.nodeElement);if(!(!t.width||!t.height||e.width===t.width&&e.height===t.height&&!o.forceUpdate))return i?.(e.id,t),{...e,...t,[n]:{...e[n],handleBounds:{source:H(".source",o.nodeElement,u,e.origin||r),target:H(".target",o.nodeElement,u,e.origin||r)}}}}return e}))},t.updateNodes=function(t,e,o={nodeOrigin:[0,0],elevateNodesOnSelect:!0,defaults:{}}){const r={},i=o?.elevateNodesOnSelect?1e3:0;return Q(t.map((t=>{const a=e.find((e=>t.id===e.id)),s={...o.defaults,...t,positionAbsolute:t.position,width:t.width||a?.width,height:t.height||a?.height},u=(P(t.zIndex)?t.zIndex:0)+(t.selected?i:0),c=t?.[n]||a?.[n];return s.parentNode&&(r[s.parentNode]=!0),Object.defineProperty(s,n,{enumerable:!1,value:{handleBounds:c?.handleBounds,z:u}}),s})),o.nodeOrigin,r)}}));
@@ -50,7 +50,7 @@ export type FitViewOptionsBase<NodeType extends NodeBase> = {
50
50
  minZoom?: number;
51
51
  maxZoom?: number;
52
52
  duration?: number;
53
- nodes?: (Partial<NodeType> & {
53
+ nodes?: (NodeType | {
54
54
  id: NodeType['id'];
55
55
  })[];
56
56
  };
@@ -1 +1 @@
1
- {"version":3,"file":"general.d.ts","sourceRoot":"","sources":["../../src/types/general.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,IAAI,WAAW,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAE/F,OAAO,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAChD,OAAO,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAClE,OAAO,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,IAAI,CAAC;AAE9B,MAAM,MAAM,OAAO,GAAG,CAAC,QAAQ,EAAE,UAAU,KAAK,UAAU,CAAC;AAE3D,MAAM,MAAM,MAAM,GAAG,CAAC,KAAK,EAAE,UAAU,GAAG,UAAU,GAAG,IAAI,EAAE,QAAQ,EAAE,QAAQ,KAAK,IAAI,CAAC;AACzF,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC;AACjC,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC;AAE/B,MAAM,MAAM,SAAS,GAAG,CAAC,OAAO,CAAC,EAAE,6BAA6B,KAAK,IAAI,CAAC;AAC1E,MAAM,MAAM,MAAM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M,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,OAAO,GAAG,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;AAE5D,MAAM,MAAM,mBAAmB,GAAG,CAChC,SAAS,EAAE,YAAY,EAAE,GAAG,QAAQ,EAAE,EACtC,eAAe,CAAC,EAAE,OAAO,EACzB,QAAQ,CAAC,EAAE,OAAO,KACf,IAAI,CAAC;AACV,MAAM,MAAM,KAAK,GAAG,CAAC,KAAK,EAAE,UAAU,KAAK,OAAO,CAAC;AAEnD,MAAM,MAAM,gBAAgB,GAAG,CAAC,MAAM,EAAE;IACtC,kBAAkB,EAAE,UAAU,GAAG,IAAI,CAAC;IACtC,gBAAgB,EAAE,gBAAgB,GAAG,IAAI,CAAC;IAC1C,qBAAqB,EAAE,gBAAgB,GAAG,IAAI,CAAC;IAC/C,mBAAmB,EAAE,gBAAgB,GAAG,IAAI,CAAC;CAC9C,KAAK,IAAI,CAAC"}
@@ -1,8 +1,13 @@
1
- import type { XYPosition, Position, Dimensions, OnConnect, IsValidConnection } from '.';
1
+ import type { Position, OnConnect, IsValidConnection } from '.';
2
2
  export type HandleType = 'source' | 'target';
3
- export type HandleElement = XYPosition & Dimensions & {
3
+ export type HandleElement = {
4
4
  id?: string | null;
5
+ x: number;
6
+ y: number;
7
+ width: number;
8
+ height: number;
5
9
  position: Position;
10
+ type?: HandleType;
6
11
  };
7
12
  export type ConnectingHandle = {
8
13
  nodeId: string;
@@ -1 +1 @@
1
- {"version":3,"file":"handles.d.ts","sourceRoot":"","sources":["../../src/types/handles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,UAAU,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,GAAG,CAAC;AAExF,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAE7C,MAAM,MAAM,aAAa,GAAG,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AAE,QAAQ,CAAC;IACnB,IAAI,CAAC,EAAE,UAAU,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,UAAU,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;IAClB,IAAI,EAAE,UAAU,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACxB,IAAI,EAAE,UAAU,CAAC;IACjB,QAAQ,EAAE,QAAQ,CAAC;IACnB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IACtC,EAAE,CAAC,EAAE,MAAM,CAAC;CACb,CAAC"}
@@ -1,5 +1,6 @@
1
1
  import { internalsSymbol } from '../constants';
2
2
  import type { XYPosition, Position, CoordinateExtent, HandleElement } from '.';
3
+ import { Optional } from '../utils/types';
3
4
  export type NodeBase<T = any, U extends string | undefined = string | undefined> = {
4
5
  id: string;
5
6
  position: XYPosition;
@@ -25,6 +26,11 @@ export type NodeBase<T = any, U extends string | undefined = string | undefined>
25
26
  ariaLabel?: string;
26
27
  focusable?: boolean;
27
28
  origin?: NodeOrigin;
29
+ handles?: NodeHandle[];
30
+ size?: {
31
+ width?: number;
32
+ height?: number;
33
+ };
28
34
  [internalsSymbol]?: {
29
35
  z?: number;
30
36
  handleBounds?: NodeHandleBounds;
@@ -74,4 +80,5 @@ export type NodeDragItem = {
74
80
  export type NodeOrigin = [number, number];
75
81
  export type OnNodeDrag = (event: MouseEvent, node: NodeBase, nodes: NodeBase[]) => void;
76
82
  export type OnSelectionDrag = (event: MouseEvent, nodes: NodeBase[]) => void;
83
+ export type NodeHandle = Optional<HandleElement, 'width' | 'height'>;
77
84
  //# sourceMappingURL=nodes.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"nodes.d.ts","sourceRoot":"","sources":["../../src/types/nodes.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,GAAG,CAAC;AAG/E,MAAM,MAAM,QAAQ,CAAC,CAAC,GAAG,GAAG,EAAE,CAAC,SAAS,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,IAAI;IACjF,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,UAAU,CAAC;IACrB,IAAI,EAAE,CAAC,CAAC;IACR,IAAI,CAAC,EAAE,CAAC,CAAC;IACT,cAAc,CAAC,EAAE,QAAQ,CAAC;IAC1B,cAAc,CAAC,EAAE,QAAQ,CAAC;IAC1B,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,QAAQ,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YAAY,GAAG,IAAI,CA0ClF"}
1
+ {"version":3,"file":"positions.d.ts","sourceRoot":"","sources":["../../../src/utils/edges/positions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAE,QAAQ,EAAgC,MAAM,mBAAmB,CAAC;AAK3E,MAAM,MAAM,qBAAqB,GAAG;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,QAAQ,CAAC;IACrB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,UAAU,EAAE,QAAQ,CAAC;IACrB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,cAAc,EAAE,cAAc,CAAC;IAC/B,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,wBAAgB,eAAe,CAAC,MAAM,EAAE,qBAAqB,GAAG,YAAY,GAAG,IAAI,CA0ClF"}
@@ -1,10 +1,10 @@
1
1
  import { type Connection, type Transform, type XYPosition, type Rect, type NodeOrigin, type NodeBase, type EdgeBase, type FitViewParamsBase, type FitViewOptionsBase, NodeDragItem, CoordinateExtent, OnError } from '../types';
2
2
  export declare const isEdgeBase: <NodeType extends NodeBase<any, string | undefined> = NodeBase<any, string | undefined>, EdgeType extends EdgeBase<any> = EdgeBase<any>>(element: NodeType | EdgeType | Connection) => element is EdgeType;
3
3
  export declare const isNodeBase: <NodeType extends NodeBase<any, string | undefined> = NodeBase<any, string | undefined>, EdgeType extends EdgeBase<any> = EdgeBase<any>>(element: Connection | NodeType | EdgeType) => element is NodeType;
4
- export declare const getOutgoersBase: <NodeType extends NodeBase<any, string | undefined> = NodeBase<any, string | undefined>, EdgeType extends EdgeBase<any> = EdgeBase<any>>(node: Partial<NodeType> & {
4
+ export declare const getOutgoersBase: <NodeType extends NodeBase<any, string | undefined> = NodeBase<any, string | undefined>, EdgeType extends EdgeBase<any> = EdgeBase<any>>(node: NodeType | {
5
5
  id: string;
6
6
  }, nodes: NodeType[], edges: EdgeType[]) => NodeType[];
7
- export declare const getIncomersBase: <NodeType extends NodeBase<any, string | undefined> = NodeBase<any, string | undefined>, EdgeType extends EdgeBase<any> = EdgeBase<any>>(node: Partial<NodeType> & {
7
+ export declare const getIncomersBase: <NodeType extends NodeBase<any, string | undefined> = NodeBase<any, string | undefined>, EdgeType extends EdgeBase<any> = EdgeBase<any>>(node: NodeType | {
8
8
  id: string;
9
9
  }, nodes: NodeType[], edges: EdgeType[]) => NodeType[];
10
10
  export declare const getNodePositionWithOrigin: (node: NodeBase | undefined, nodeOrigin?: NodeOrigin) => XYPosition & {
@@ -1 +1 @@
1
- {"version":3,"file":"graph.d.ts","sourceRoot":"","sources":["../../src/utils/graph.ts"],"names":[],"mappings":"AAYA,OAAO,EACL,KAAK,UAAU,EACf,KAAK,SAAS,EACd,KAAK,UAAU,EACf,KAAK,IAAI,EACT,KAAK,UAAU,EACf,KAAK,QAAQ,EACb,KAAK,QAAQ,EACb,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,YAAY,EACZ,gBAAgB,EAChB,OAAO,EACR,MAAM,UAAU,CAAC;AAGlB,eAAO,MAAM,UAAU,4MAEgE,CAAC;AAExF,eAAO,MAAM,UAAU,4MAEsE,CAAC;AAE9F,eAAO,MAAM,eAAe;QACM,MAAM;sDAgBvC,CAAC;AAEF,eAAO,MAAM,eAAe;QACM,MAAM;sDAevC,CAAC;AAEF,eAAO,MAAM,yBAAyB,SAC9B,QAAQ,GAAG,SAAS,8BAEzB,UAAU,GAAG;IAAE,gBAAgB,EAAE,UAAU,CAAA;CA6B7C,CAAC;AAEF,eAAO,MAAM,cAAc,UAAW,QAAQ,EAAE,8BAAoC,IAsBnF,CAAC;AAEF,eAAO,MAAM,cAAc,gFAEnB,IAAI,gIAmCX,CAAC;AAEF,eAAO,MAAM,qBAAqB,8LAUjC,CAAC;AAEF,wB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,EAAE,EAC9G,aAAa,EACb,aAAa,EACb,KAAK,EACL,KAAK,GACN,EAAE;IACD,aAAa,EAAE,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC;IACnC,aAAa,EAAE,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC;IACnC,KAAK,EAAE,QAAQ,EAAE,CAAC;IAClB,KAAK,EAAE,QAAQ,EAAE,CAAC;CACnB,GAAG;IACF,aAAa,EAAE,QAAQ,EAAE,CAAC;IAC1B,aAAa,EAAE,QAAQ,EAAE,CAAC;CAC3B,CAsBA"}
@@ -0,0 +1,2 @@
1
+ export type Optional<T, K extends keyof T> = Pick<Partial<T>, K> & Omit<T, K>;
2
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/utils/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,QAAQ,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,IAAI,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC"}
@@ -15,7 +15,10 @@ type StoreItems = {
15
15
  selectNodesOnDrag: boolean;
16
16
  nodeDragThreshold: number;
17
17
  panBy: PanBy;
18
- unselectNodesAndEdges: () => void;
18
+ unselectNodesAndEdges: (params?: {
19
+ nodes?: NodeBase[];
20
+ edges?: EdgeBase[];
21
+ }) => void;
19
22
  onError?: OnError;
20
23
  onNodeDragStart?: OnNodeDrag;
21
24
  onNodeDrag?: OnNodeDrag;
@@ -31,7 +34,7 @@ export type XYDragParams = {
31
34
  onDragStart?: OnDrag;
32
35
  onDrag?: OnDrag;
33
36
  onDragStop?: OnDrag;
34
- onNodeClick?: () => void;
37
+ onNodeMouseDown?: (id: string) => void;
35
38
  };
36
39
  export type XYDragInstance = {
37
40
  update: (params: DragUpdateParams) => void;
@@ -44,6 +47,6 @@ export type DragUpdateParams = {
44
47
  nodeId?: string;
45
48
  domNode: Element;
46
49
  };
47
- export declare function XYDrag({ domNode, onNodeClick, getStoreItems, onDragStart, onDrag, onDragStop, }: XYDragParams): XYDragInstance;
50
+ export declare function XYDrag({ domNode, onNodeMouseDown, getStoreItems, onDragStart, onDrag, onDragStop, }: XYDragParams): XYDragInstance;
48
51
  export {};
49
52
  //# sourceMappingURL=XYDrag.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"XYDrag.d.ts","sourceRoot":"","sources":["../../src/xydrag/XYDrag.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EACV,QAAQ,EACR,YAAY,EAGZ,QAAQ,EACR,gBAAgB,EAChB,UAAU,EACV,OAAO,EACP,QAAQ,EACR,SAAS,EACT,KAAK,EACL,UAAU,EACV,eAAe,EACf,mBAAmB,EAEpB,MAAM,UAAU,CAAC;AAElB,MAAM,MAAM,MAAM,GAAG,CAAC,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,IAAI,CAAC;AAE/G,KAAK,UAAU,GAAG;IAChB,KAAK,EAAE,QAAQ,EAAE,CAAC;IAClB,KAAK,EAAE,QAAQ,EAAE,CAAC;IAClB,UAAU,EAAE,gBAAgB,CAAC;IAC7B,QAAQ,EAAE,QAAQ,CAAC;IACnB,UAAU,EAAE,OAAO,CAAC;IACpB,UAAU,EAAE,UAAU,CAAC;IACvB,oBAAoB,EAAE,OAAO,CAAC;IAC9B,OAAO,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IACzB,SAAS,EAAE,SAAS,CAAC;IACrB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,cAAc,EAAE,OAAO,CAAC;IACxB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,KAAK,EAAE,KAAK,CAAC;IACb,qBAAqB,EAAE,MAAM,IAAI,CAAC;IA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M,YAAY,GAAG;IACzB,OAAO,EAAE,OAAO,CAAC;IACjB,aAAa,EAAE,MAAM,UAAU,CAAC;IAChC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,eAAe,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;CACxC,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,MAAM,EAAE,CAAC,MAAM,EAAE,gBAAgB,KAAK,IAAI,CAAC;IAC3C,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF,wBAAgB,MAAM,CAAC,EACrB,OAAO,EACP,eAAe,EACf,aAAa,EACb,WAAW,EACX,MAAM,EACN,UAAU,GACX,EAAE,YAAY,GAAG,cAAc,CA6O/B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xyflow/system",
3
- "version": "0.0.8",
3
+ "version": "0.0.9",
4
4
  "description": "xyflow core system that powers React Flow and Svelte Flow.",
5
5
  "keywords": [
6
6
  "node-based UI",
@@ -47,9 +47,9 @@
47
47
  "devDependencies": {
48
48
  "@types/node": "^18.7.16",
49
49
  "typescript": "5.1.3",
50
- "@xyflow/tsconfig": "0.0.0",
50
+ "@xyflow/eslint-config": "0.0.0",
51
51
  "@xyflow/rollup-config": "0.0.0",
52
- "@xyflow/eslint-config": "0.0.0"
52
+ "@xyflow/tsconfig": "0.0.0"
53
53
  },
54
54
  "rollup": {
55
55
  "globals": {