@xyflow/system 0.0.35 → 0.0.37

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/esm/index.js CHANGED
@@ -1219,7 +1219,8 @@ function adoptUserNodes(nodes, nodeLookup, parentLookup, options) {
1219
1219
  },
1220
1220
  internals: {
1221
1221
  positionAbsolute: getNodePositionWithOrigin(userNode, _options.nodeOrigin),
1222
- handleBounds: internalNode?.internals.handleBounds,
1222
+ // if user re-initializes the node or removes `measured` for whatever reason, we reset the handleBounds so that the node gets re-measured
1223
+ handleBounds: !userNode.measured ? undefined : internalNode?.internals.handleBounds,
1223
1224
  z: calculateZ(userNode, selectedNodeZ),
1224
1225
  userNode,
1225
1226
  },
@@ -1236,7 +1237,8 @@ function updateChildPosition(node, nodeLookup, parentLookup, options) {
1236
1237
  const parentId = node.parentId;
1237
1238
  const parentNode = nodeLookup.get(parentId);
1238
1239
  if (!parentNode) {
1239
- throw new Error(`Parent node ${parentId} not found`);
1240
+ console.warn(`Parent node ${parentId} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);
1241
+ return;
1240
1242
  }
1241
1243
  // update the parentLookup
1242
1244
  const childNodes = parentLookup.get(parentId);
@@ -1552,7 +1554,7 @@ function XYDrag({ onNodeMouseDown, getStoreItems, onDragStart, onDrag, onDragSto
1552
1554
  let d3Selection = null;
1553
1555
  let abortDrag = false; // prevents unintentional dragging on multitouch
1554
1556
  // public functions
1555
- function update({ noDragClassName, handleSelector, domNode, isSelectable, nodeId }) {
1557
+ function update({ noDragClassName, handleSelector, domNode, isSelectable, nodeId, nodeClickDistance = 0, }) {
1556
1558
  d3Selection = select(domNode);
1557
1559
  function updateNodes({ x, y }, dragEvent) {
1558
1560
  const { nodeLookup, nodeExtent, snapGrid, snapToGrid, nodeOrigin, onNodeDrag, onSelectionDrag, onError, updateNodePositions, } = getStoreItems();
@@ -1659,6 +1661,7 @@ function XYDrag({ onNodeMouseDown, getStoreItems, onDragStart, onDrag, onDragSto
1659
1661
  }
1660
1662
  }
1661
1663
  const d3DragInstance = drag()
1664
+ .clickDistance(nodeClickDistance)
1662
1665
  .on('start', (event) => {
1663
1666
  const { domNode, nodeDragThreshold, transform, snapGrid, snapToGrid } = getStoreItems();
1664
1667
  abortDrag = false;
@@ -1757,10 +1760,10 @@ function getHandles(node, handleBounds, type, currentHandle) {
1757
1760
  }, []);
1758
1761
  return [handles, excludedHandle];
1759
1762
  }
1760
- function getClosestHandle(pos, connectionRadius, handles) {
1763
+ function getClosestHandle(pos, connectionRadius, handleLookup) {
1761
1764
  let closestHandles = [];
1762
1765
  let minDistance = Infinity;
1763
- for (const handle of handles) {
1766
+ for (const handle of handleLookup.values()) {
1764
1767
  const distance = Math.sqrt(Math.pow(handle.x - pos.x, 2) + Math.pow(handle.y - pos.y, 2));
1765
1768
  if (distance <= connectionRadius) {
1766
1769
  if (distance < minDistance) {
@@ -1782,18 +1785,30 @@ function getClosestHandle(pos, connectionRadius, handles) {
1782
1785
  closestHandles.find((handle) => handle.type === 'target') || closestHandles[0];
1783
1786
  }
1784
1787
  function getHandleLookup({ nodeLookup, nodeId, handleId, handleType, }) {
1785
- const connectionHandles = [];
1788
+ const connectionHandles = new Map();
1786
1789
  const currentHandle = { nodeId, handleId, handleType };
1787
- let excludedHandle = null;
1790
+ let matchingHandle = null;
1788
1791
  for (const node of nodeLookup.values()) {
1789
1792
  if (node.internals.handleBounds) {
1790
1793
  const [sourceHandles, excludedSource] = getHandles(node, node.internals.handleBounds, 'source', currentHandle);
1791
1794
  const [targetHandles, excludedTarget] = getHandles(node, node.internals.handleBounds, 'target', currentHandle);
1792
- excludedHandle = excludedHandle ? excludedHandle : excludedSource ?? excludedTarget;
1793
- connectionHandles.push(...sourceHandles, ...targetHandles);
1795
+ matchingHandle = matchingHandle ? matchingHandle : excludedSource ?? excludedTarget;
1796
+ [...sourceHandles, ...targetHandles].forEach((handle) => connectionHandles.set(`${handle.nodeId}-${handle.type}-${handle.id}`, handle));
1797
+ }
1798
+ }
1799
+ // if the user only works with handles that are type="source" + connectionMode="loose"
1800
+ // it happens that we can't find a matching handle. The reason for this is, that the
1801
+ // edge don't know about the handles and always assumes that there is source and a target.
1802
+ // In this case we need to find the matching handle by switching the handleType
1803
+ if (!matchingHandle) {
1804
+ const node = nodeLookup.get(nodeId);
1805
+ if (node?.internals.handleBounds) {
1806
+ currentHandle.handleType = handleType === 'source' ? 'target' : 'source';
1807
+ const [, excluded] = getHandles(node, node.internals.handleBounds, currentHandle.handleType, currentHandle);
1808
+ matchingHandle = excluded;
1794
1809
  }
1795
1810
  }
1796
- return [connectionHandles, excludedHandle];
1811
+ return [connectionHandles, matchingHandle];
1797
1812
  }
1798
1813
  function getHandleType(edgeUpdaterType, handleDomNode) {
1799
1814
  if (edgeUpdaterType) {
@@ -1993,13 +2008,11 @@ function isValidHandle(event, { handle, connectionMode, fromNodeId, fromHandleId
1993
2008
  ? (isTarget && handleType === 'source') || (!isTarget && handleType === 'target')
1994
2009
  : handleNodeId !== fromNodeId || handleId !== fromHandleId);
1995
2010
  result.isValid = isValid && isValidConnection(connection);
1996
- if (handleLookup) {
1997
- const toHandle = handleLookup.find((h) => h.id === handleId && h.nodeId === handleNodeId && h.type === handleType);
1998
- if (toHandle) {
1999
- result.toHandle = {
2000
- ...toHandle,
2001
- };
2002
- }
2011
+ const toHandle = handleLookup?.get(`${handleNodeId}-${handleType}-${handleId}`);
2012
+ if (toHandle) {
2013
+ result.toHandle = {
2014
+ ...toHandle,
2015
+ };
2003
2016
  }
2004
2017
  }
2005
2018
  return result;
@@ -1219,7 +1219,8 @@ function adoptUserNodes(nodes, nodeLookup, parentLookup, options) {
1219
1219
  },
1220
1220
  internals: {
1221
1221
  positionAbsolute: getNodePositionWithOrigin(userNode, _options.nodeOrigin),
1222
- handleBounds: internalNode?.internals.handleBounds,
1222
+ // if user re-initializes the node or removes `measured` for whatever reason, we reset the handleBounds so that the node gets re-measured
1223
+ handleBounds: !userNode.measured ? undefined : internalNode?.internals.handleBounds,
1223
1224
  z: calculateZ(userNode, selectedNodeZ),
1224
1225
  userNode,
1225
1226
  },
@@ -1236,7 +1237,8 @@ function updateChildPosition(node, nodeLookup, parentLookup, options) {
1236
1237
  const parentId = node.parentId;
1237
1238
  const parentNode = nodeLookup.get(parentId);
1238
1239
  if (!parentNode) {
1239
- throw new Error(`Parent node ${parentId} not found`);
1240
+ console.warn(`Parent node ${parentId} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);
1241
+ return;
1240
1242
  }
1241
1243
  // update the parentLookup
1242
1244
  const childNodes = parentLookup.get(parentId);
@@ -1552,7 +1554,7 @@ function XYDrag({ onNodeMouseDown, getStoreItems, onDragStart, onDrag, onDragSto
1552
1554
  let d3Selection = null;
1553
1555
  let abortDrag = false; // prevents unintentional dragging on multitouch
1554
1556
  // public functions
1555
- function update({ noDragClassName, handleSelector, domNode, isSelectable, nodeId }) {
1557
+ function update({ noDragClassName, handleSelector, domNode, isSelectable, nodeId, nodeClickDistance = 0, }) {
1556
1558
  d3Selection = select(domNode);
1557
1559
  function updateNodes({ x, y }, dragEvent) {
1558
1560
  const { nodeLookup, nodeExtent, snapGrid, snapToGrid, nodeOrigin, onNodeDrag, onSelectionDrag, onError, updateNodePositions, } = getStoreItems();
@@ -1659,6 +1661,7 @@ function XYDrag({ onNodeMouseDown, getStoreItems, onDragStart, onDrag, onDragSto
1659
1661
  }
1660
1662
  }
1661
1663
  const d3DragInstance = drag()
1664
+ .clickDistance(nodeClickDistance)
1662
1665
  .on('start', (event) => {
1663
1666
  const { domNode, nodeDragThreshold, transform, snapGrid, snapToGrid } = getStoreItems();
1664
1667
  abortDrag = false;
@@ -1757,10 +1760,10 @@ function getHandles(node, handleBounds, type, currentHandle) {
1757
1760
  }, []);
1758
1761
  return [handles, excludedHandle];
1759
1762
  }
1760
- function getClosestHandle(pos, connectionRadius, handles) {
1763
+ function getClosestHandle(pos, connectionRadius, handleLookup) {
1761
1764
  let closestHandles = [];
1762
1765
  let minDistance = Infinity;
1763
- for (const handle of handles) {
1766
+ for (const handle of handleLookup.values()) {
1764
1767
  const distance = Math.sqrt(Math.pow(handle.x - pos.x, 2) + Math.pow(handle.y - pos.y, 2));
1765
1768
  if (distance <= connectionRadius) {
1766
1769
  if (distance < minDistance) {
@@ -1782,18 +1785,30 @@ function getClosestHandle(pos, connectionRadius, handles) {
1782
1785
  closestHandles.find((handle) => handle.type === 'target') || closestHandles[0];
1783
1786
  }
1784
1787
  function getHandleLookup({ nodeLookup, nodeId, handleId, handleType, }) {
1785
- const connectionHandles = [];
1788
+ const connectionHandles = new Map();
1786
1789
  const currentHandle = { nodeId, handleId, handleType };
1787
- let excludedHandle = null;
1790
+ let matchingHandle = null;
1788
1791
  for (const node of nodeLookup.values()) {
1789
1792
  if (node.internals.handleBounds) {
1790
1793
  const [sourceHandles, excludedSource] = getHandles(node, node.internals.handleBounds, 'source', currentHandle);
1791
1794
  const [targetHandles, excludedTarget] = getHandles(node, node.internals.handleBounds, 'target', currentHandle);
1792
- excludedHandle = excludedHandle ? excludedHandle : excludedSource ?? excludedTarget;
1793
- connectionHandles.push(...sourceHandles, ...targetHandles);
1795
+ matchingHandle = matchingHandle ? matchingHandle : excludedSource ?? excludedTarget;
1796
+ [...sourceHandles, ...targetHandles].forEach((handle) => connectionHandles.set(`${handle.nodeId}-${handle.type}-${handle.id}`, handle));
1797
+ }
1798
+ }
1799
+ // if the user only works with handles that are type="source" + connectionMode="loose"
1800
+ // it happens that we can't find a matching handle. The reason for this is, that the
1801
+ // edge don't know about the handles and always assumes that there is source and a target.
1802
+ // In this case we need to find the matching handle by switching the handleType
1803
+ if (!matchingHandle) {
1804
+ const node = nodeLookup.get(nodeId);
1805
+ if (node?.internals.handleBounds) {
1806
+ currentHandle.handleType = handleType === 'source' ? 'target' : 'source';
1807
+ const [, excluded] = getHandles(node, node.internals.handleBounds, currentHandle.handleType, currentHandle);
1808
+ matchingHandle = excluded;
1794
1809
  }
1795
1810
  }
1796
- return [connectionHandles, excludedHandle];
1811
+ return [connectionHandles, matchingHandle];
1797
1812
  }
1798
1813
  function getHandleType(edgeUpdaterType, handleDomNode) {
1799
1814
  if (edgeUpdaterType) {
@@ -1993,13 +2008,11 @@ function isValidHandle(event, { handle, connectionMode, fromNodeId, fromHandleId
1993
2008
  ? (isTarget && handleType === 'source') || (!isTarget && handleType === 'target')
1994
2009
  : handleNodeId !== fromNodeId || handleId !== fromHandleId);
1995
2010
  result.isValid = isValid && isValidConnection(connection);
1996
- if (handleLookup) {
1997
- const toHandle = handleLookup.find((h) => h.id === handleId && h.nodeId === handleNodeId && h.type === handleType);
1998
- if (toHandle) {
1999
- result.toHandle = {
2000
- ...toHandle,
2001
- };
2002
- }
2011
+ const toHandle = handleLookup?.get(`${handleNodeId}-${handleType}-${handleId}`);
2012
+ if (toHandle) {
2013
+ result.toHandle = {
2014
+ ...toHandle,
2015
+ };
2003
2016
  }
2004
2017
  }
2005
2018
  return result;
@@ -1 +1 @@
1
- {"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../src/utils/store.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EACR,gBAAgB,EAChB,kBAAkB,EAClB,UAAU,EACV,eAAe,EACf,SAAS,EACT,UAAU,EACV,gBAAgB,EAChB,QAAQ,EACR,UAAU,EACV,gBAAgB,EAChB,UAAU,EAEV,mBAAmB,EACnB,kBAAkB,EAClB,YAAY,EACb,MAAM,UAAU,CAAC;AAIlB,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAY5C,wBAAgB,uBAAuB,CAAC,QAAQ,SAAS,QAAQ,EAC/D,UAAU,EAAE,UAAU,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC,EAClD,YAAY,EAAE,YAAY,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC,EACtD,OAAO,CAAC,EAAE,kBAAkB,CAAC,QAAQ,CAAC,QAUvC;AAED,KAAK,kBAAkB,CAAC,QAAQ,SAAS,Q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;
51
52
  };
52
53
  export declare function XYDrag<OnNodeDrag extends (e: any, nodes: any, node: any) => void | undefined>({ onNodeMouseDown, getStoreItems, onDragStart, onDrag, onDragStop, }: XYDragParams<OnNodeDrag>): XYDragInstance;
53
54
  export {};
@@ -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,eAAe,EACf,mBAAmB,EAEnB,gBAAgB,EACjB,MAAM,UAAU,CAAC;AAElB,MAAM,MAAM,MAAM,GAAG,CACnB,KAAK,EAAE,UAAU,EACjB,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,EACpC,IAAI,EAAE,QAAQ,EACd,KAAK,EAAE,QAAQ,EAAE,KACd,IAAI,CAAC;AAEV,KAAK,UAAU,CAAC,UAAU,IAAI;IAC5B,KAAK,EAAE,QAAQ,EAAE,CAAC;IAClB,UAAU,EAAE,GAAG,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;IAC1C,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,CAAC,MAAM,CAAC,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AAE,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,KAAK,IAAI,GAAG,SAAS,EAAE,EAC7F,eAAe,EACf,aAAa,EACb,WAAW,EACX,MAAM,EACN,UAAU,GACX,EAAE,YAAY,CAAC,UAAU,CAAC,GAAG,cAAc,CAwR3C"}
@@ -1 +1 @@
1
- {"version":3,"file":"XYHandle.d.ts","sourceRoot":"","sources":["../../src/xyhandle/XYHandle.ts"],"names":[],"mappings":"AAkBA,OAAO,EAA8C,gBAAgB,EAAE,MAAM,SAAS,CAAC;AA0RvF,eAAO,MAAM,QAAQ,EAAE,gBAGtB,CAAC"}
1
+ {"version":3,"file":"XYHandle.d.ts","sourceRoot":"","sources":["../../src/xyhandle/XYHandle.ts"],"names":[],"mappings":"AAkBA,OAAO,EAA8C,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAsRvF,eAAO,MAAM,QAAQ,EAAE,gBAGtB,CAAC"}
@@ -33,7 +33,7 @@ export type IsValidParams = {
33
33
  doc: Document | ShadowRoot;
34
34
  lib: string;
35
35
  flowId: string | null;
36
- handleLookup?: Handle[];
36
+ handleLookup?: Map<string, Handle>;
37
37
  };
38
38
  export type XYHandleInstance = {
39
39
  onPointerDown: (event: MouseEvent | TouchEvent, params: OnPointerDownParams) => void;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/xyhandle/types.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,KAAK,UAAU,EACf,KAAK,SAAS,EACd,KAAK,cAAc,EACnB,KAAK,UAAU,EACf,KAAK,KAAK,EACV,KAAK,SAAS,EACd,KAAK,MAAM,EACX,KAAK,YAAY,EACjB,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,UAAU,EACX,MAAM,UAAU,CAAC;AAElB,MAAM,MAAM,mBAAmB,GAAG;IAChC,gBAAgB,EAAE,OAAO,CAAC;IAC1B,cAAc,EAAE,cAAc,CAAC;IAC/B,g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I,CAAC;IAC9B,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,UAAU,GAAG,IAAI,CAAC;IAC9B,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB,CAAC"}
@@ -1,12 +1,12 @@
1
1
  import { type HandleType, type XYPosition, type Handle, NodeLookup } from '../types';
2
- export declare function getClosestHandle(pos: XYPosition, connectionRadius: number, handles: Handle[]): Handle | null;
2
+ export declare function getClosestHandle(pos: XYPosition, connectionRadius: number, handleLookup: Map<string, Handle>): Handle | null;
3
3
  type GetHandleLookupParams = {
4
4
  nodeLookup: NodeLookup;
5
5
  nodeId: string;
6
6
  handleId: string | null;
7
7
  handleType: HandleType;
8
8
  };
9
- export declare function getHandleLookup({ nodeLookup, nodeId, handleId, handleType, }: GetHandleLookupParams): [Handle[], Handle];
9
+ export declare function getHandleLookup({ nodeLookup, nodeId, handleId, handleType, }: GetHandleLookupParams): [Map<string, Handle>, Handle];
10
10
  export declare function getHandleType(edgeUpdaterType: HandleType | undefined, handleDomNode: Element | null): HandleType | null;
11
11
  export declare function isConnectionValid(isInsideConnectionRadius: boolean, isHandleValid: boolean): boolean | null;
12
12
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/xyhandle/utils.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,UAAU,EAEf,KAAK,UAAU,EACf,KAAK,MAAM,EAEX,UAAU,EACX,MAAM,UAAU,CAAC;AAuBlB,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,MAAM,GAAG,IAAI,CAyB5G;AAED,KAAK,qBAAqB,GAAG;IAC3B,UAAU,EAAE,UAAU,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,UAAU,EAAE,UAAU,CAAC;CACxB,CAAC;AAEF,wB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+1,11 @@
1
1
  import type { D3DragEvent, SubjectPosition } from 'd3-drag';
2
- export type XYResizerParams = {
2
+ export type ResizeParams = {
3
3
  x: number;
4
4
  y: number;
5
5
  width: number;
6
6
  height: number;
7
7
  };
8
- export type XYResizerParamsWithDirection = XYResizerParams & {
8
+ export type ResizeParamsWithDirection = ResizeParams & {
9
9
  direction: number[];
10
10
  };
11
11
  export type ControlLinePosition = 'top' | 'bottom' | 'left' | 'right';
@@ -16,11 +16,11 @@ export declare enum ResizeControlVariant {
16
16
  }
17
17
  export declare const XY_RESIZER_HANDLE_POSITIONS: ControlPosition[];
18
18
  export declare const XY_RESIZER_LINE_POSITIONS: ControlLinePosition[];
19
- type OnResizeHandler<Params = XYResizerParams, Result = void> = (event: ResizeDragEvent, params: Params) => Result;
19
+ type OnResizeHandler<Params = ResizeParams, Result = void> = (event: ResizeDragEvent, params: Params) => Result;
20
20
  export type ResizeDragEvent = D3DragEvent<HTMLDivElement, null, SubjectPosition>;
21
- export type ShouldResize = OnResizeHandler<XYResizerParamsWithDirection, boolean>;
21
+ export type ShouldResize = OnResizeHandler<ResizeParamsWithDirection, boolean>;
22
22
  export type OnResizeStart = OnResizeHandler;
23
- export type OnResize = OnResizeHandler<XYResizerParamsWithDirection>;
23
+ export type OnResize = OnResizeHandler<ResizeParamsWithDirection>;
24
24
  export type OnResizeEnd = OnResizeHandler;
25
25
  export {};
26
26
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/xyresizer/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE5D,MAAM,MAAM,eAAe,GAAG;IAC5B,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,4BAA4B,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EAAE,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAC;AAEtE,MAAM,MAAM,eAAe,GAAG,mBAAmB,GAAG,UAAU,GAAG,WAAW,GAAG,aAAa,GAAG,cAAc,CAAC;AAE9G,oBAAY,oBAAoB;IAC9B,IAAI,SAAS;IACb,MAAM,WAAW;CAClB;AAED,eAAO,MAAM,2BAA2B,EAAE,eAAe,EAA6D,CAAC;AACvH,eAAO,MAAM,yBAAyB,EAAE,mBAAmB,EAAuC,CAAC;AAEnG,KAAK,eAAe,CAAC,MAAM,GAAG,YAAY,EAAE,MAAM,GAAG,IAAI,IAAI,CAAC,KAAK,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,KAAK,MAAM,CAAC;AAChH,MAAM,MAAM,eAAe,GAAG,WAAW,CAAC,cAAc,EAAE,IAAI,EAAE,eAAe,CAAC,CAAC;AAEjF,MAAM,MAAM,YAAY,GAAG,eAAe,CAAC,yBAAyB,EAAE,OAAO,CAAC,CAAC;AAC/E,MAAM,MAAM,aAAa,GAAG,eAAe,CAAC;AAC5C,MAAM,MAAM,QAAQ,GAAG,eAAe,CAAC,yBAAyB,CAAC,CAAC;AAClE,MAAM,MAAM,WAAW,GAAG,eAAe,CAAC"}
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.`,error013:(t="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${t}/dist/style.css' or base.css to make sure everything is working properly.`},n=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]];var o,r,i;t.ConnectionMode=void 0,(o=t.ConnectionMode||(t.ConnectionMode={})).Strict="strict",o.Loose="loose",t.PanOnScrollMode=void 0,(r=t.PanOnScrollMode||(t.PanOnScrollMode={})).Free="free",r.Vertical="vertical",r.Horizontal="horizontal",t.SelectionMode=void 0,(i=t.SelectionMode||(t.SelectionMode={})).Partial="partial",i.Full="full";var a,s,u;t.ConnectionLineType=void 0,(a=t.ConnectionLineType||(t.ConnectionLineType={})).Bezier="default",a.Straight="straight",a.Step="step",a.SmoothStep="smoothstep",a.SimpleBezier="simplebezier",t.MarkerType=void 0,(s=t.MarkerType||(t.MarkerType={})).Arrow="arrow",s.ArrowClosed="arrowclosed",t.Position=void 0,(u=t.Position||(t.Position={})).Left="left",u.Top="top",u.Right="right",u.Bottom="bottom";const l={[t.Position.Left]:t.Position.Right,[t.Position.Right]:t.Position.Left,[t.Position.Top]:t.Position.Bottom,[t.Position.Bottom]:t.Position.Top};const c=t=>"id"in t&&"source"in t&&"target"in t,h=t=>"id"in t&&"internals"in t&&!("source"in t)&&!("target"in t),d=(t,e=[0,0])=>{const{width:n,height:o}=H(t),r=t.origin??e,i=n*r[0],a=o*r[1];return{x:t.position.x-i,y:t.position.y-a}},f=(t,e={})=>{if(0===t.size)return{x:0,y:0,width:0,height:0};let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0};return t.forEach((t=>{if(void 0===e.filter||e.filter(t)){const e=P(t);n=w(n,e)}})),b(n)},p=(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 g({nodeId:t,nextPosition:n,nodeLookup:o,nodeOrigin:r=[0,0],nodeExtent:i,onError:a}){const s=o.get(t),u=s.parentId?o.get(s.parentId):void 0,{x:l,y:c}=u?u.internals.positionAbsolute:{x:0,y:0},h=s.origin??r;let d=function(t,e){return e&&"parent"!==e?[e[0],[e[1][0]-(t.measured?.width??0),e[1][1]-(t.measured?.height??0)]]:e}(s,s.extent||i);if("parent"!==s.extent||s.expandParent)u&&C(s.extent)&&(d=[[s.extent[0][0]+l,s.extent[0][1]+c],[s.extent[1][0]+l,s.extent[1][1]+c]]);else if(u){const t=s.measured.width,e=s.measured.height,n=u.measured.width,o=u.measured.height;t&&e&&n&&o&&(d=[[l,c],[l+n-t,c+o-e]])}else a?.("005",e.error005());const f=C(d)?y(n,d):n;return{position:{x:f.x-l+s.measured.width*h[0],y:f.y-c+s.measured.height*h[1]},positionAbsolute:f}}const m=(t,e=0,n=1)=>Math.min(Math.max(t,e),n),y=(t={x:0,y:0},e)=>({x:m(t.x,e[0][0],e[1][0]),y:m(t.y,e[0][1],e[1][1])}),v=(t,e,n)=>t<e?m(Math.abs(t-e),1,e)/e:t>n?-m(Math.abs(t-n),1,e)/e:0,x=(t,e,n=15,o=40)=>[v(t.x,o,e.width-o)*n,v(t.y,o,e.height-o)*n],w=(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)}),_=({x:t,y:e,width:n,height:o})=>({x:t,y:e,x2:t+n,y2:e+o}),b=({x:t,y:e,x2:n,y2:o})=>({x:t,y:e,width:n-t,height:o-e}),M=(t,e=[0,0])=>{const{x:n,y:o}=h(t)?t.internals.positionAbsolute:d(t,e);return{x:n,y:o,width:t.measured?.width??t.width??t.initialWidth??0,height:t.measured?.height??t.height??t.initialHeight??0}},P=(t,e=[0,0])=>{const{x:n,y:o}=h(t)?t.internals.positionAbsolute:d(t,e);return{x:n,y:o,x2:n+(t.measured?.width??t.width??t.initialWidth??0),y2:o+(t.measured?.height??t.height??t.initialHeight??0)}},E=(t,e)=>b(w(_(t),_(e))),S=(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)},z=t=>!isNaN(t)&&isFinite(t),N=(t,e)=>{},k=(t,e=[1,1])=>({x:e[0]*Math.round(t.x/e[0]),y:e[1]*Math.round(t.y/e[1])}),T=({x:t,y:e},[n,o,r],i=!1,a=[1,1])=>{const s={x:(t-n)/r,y:(e-o)/r};return i?k(s,a):s},A=({x:t,y:e},[n,o,r])=>({x:t*r+n,y:e*r+o}),I=(t,e,n,o,r,i)=>{const a=e/(t.width*(1+i)),s=n/(t.height*(1+i)),u=Math.min(a,s),l=m(u,o,r);return{x:e/2-(t.x+t.width/2)*l,y:n/2-(t.y+t.height/2)*l,zoom:l}},$=()=>"undefined"!=typeof navigator&&navigator?.userAgent?.indexOf("Mac")>=0;function C(t){return void 0!==t&&"parent"!==t}function H(t){return{width:t.measured?.width??t.width??t.initialWidth??0,height:t.measured?.height??t.height??t.initialHeight??0}}function O(t,{snapGrid:e=[0,0],snapToGrid:n=!1,transform:o}){const{x:r,y:i}=D(t),a=T({x:r,y:i},o),{x:s,y:u}=n?k(a,e):a;return{xSnapped:s,ySnapped:u,...a}}const X=t=>({width:t.offsetWidth,height:t.offsetHeight}),Y=t=>t.getRootNode?.()||window?.document,B=["INPUT","SELECT","TEXTAREA"];const R=t=>"clientX"in t,D=(t,e)=>{const n=R(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)}},L=(t,e,n,o,r)=>{const i=e.querySelectorAll(`.${t}`);return i&&i.length?Array.from(i).map((e=>{const i=e.getBoundingClientRect();return{id:e.getAttribute("data-handleid"),type:t,nodeId:r,position:e.getAttribute("data-handlepos"),x:(i.left-n.left)/o,y:(i.top-n.top)/o,...X(e)}})):null};function V({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,l=.125*e+.375*i+.375*s+.125*o;return[u,l,Math.abs(u-t),Math.abs(l-e)]}function q(t,e){return t>=0?.5*t:25*e*Math.sqrt(-t)}function Z({pos:e,x1:n,y1:o,x2:r,y2:i,c:a}){switch(e){case t.Position.Left:return[n-q(n-r,a),o];case t.Position.Right:return[n+q(r-n,a),o];case t.Position.Top:return[n,o-q(o-i,a)];case t.Position.Bottom:return[n,o+q(i-o,a)]}}function G({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 j=({source:t,sourceHandle:e,target:n,targetHandle:o})=>`xy-edge__${t}${e||""}-${n}${o||""}`;const F={[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}},W=({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},K=(t,e)=>Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2));function U(t){return t&&!(!t.internals.handleBounds&&!t.handles?.length)&&!!(t.measured.width||t.width||t.initialWidth)}function Q(t){if(!t)return null;const e=[],n=[];for(const o of t)o.width=o.width??1,o.height=o.height??1,"source"===o.type?e.push(o):"target"===o.type&&n.push(o);return{source:e,target:n}}function J(e,n,o=t.Position.Left,r=!1){const i=(n?.x??0)+e.internals.positionAbsolute.x,a=(n?.y??0)+e.internals.positionAbsolute.y,{width:s,height:u}=n??H(e);if(r)return{x:i+s/2,y:a+u/2};switch(n?.position??o){case t.Position.Top:return{x:i+s/2,y:a};case t.Position.Right:return{x:i+s,y:a+u/2};case t.Position.Bottom:return{x:i+s/2,y:a+u};case t.Position.Left:return{x:i,y:a+u/2}}}function tt(t,e){return t&&(e?t.find((t=>t.id===e)):t[0])||null}function et(t,e){if(!t)return"";if("string"==typeof t)return t;return`${e?`${e}__`:""}${Object.keys(t).sort().map((e=>`${e}=${t[e]}`)).join("&")}`}const nt={nodeOrigin:[0,0],elevateNodesOnSelect:!0,defaults:{}},ot={...nt,checkEquality:!0};function rt(t,e,n,o){const r={...nt,...o},i=t.parentId,a=e.get(i);if(!a)throw new Error(`Parent node ${i} not found`);const s=n.get(i);s?s.set(t.id,t):n.set(i,new Map([[t.id,t]]));const u=o?.elevateNodesOnSelect?1e3:0,{x:l,y:c,z:h}=function(t,e,n,o){const r=d(t,n),i=it(t,o),a=e.internals.z??0;return{x:e.internals.positionAbsolute.x+r.x,y:e.internals.positionAbsolute.y+r.y,z:a>i?a:i}}(t,a,r.nodeOrigin,u),f=t.internals.positionAbsolute,p=l!==f.x||c!==f.y;(p||h!==t.internals.z)&&(t.internals={...t.internals,positionAbsolute:p?{x:l,y:c}:f,z:h})}function it(t,e){return(z(t.zIndex)?t.zIndex:0)+(t.selected?e:0)}function at(t,e,n,o=[0,0]){const r=[],i=new Map;for(const n of t){const t=e.get(n.parentId);if(!t)continue;const o=i.get(n.parentId)?.expandedRect??M(t),r=E(o,n.rect);i.set(n.parentId,{expandedRect:r,parent:t})}return i.size>0&&i.forEach((({expandedRect:e,parent:i},a)=>{const s=i.internals.positionAbsolute,u=H(i),l=i.origin??o,c=e.x<s.x?Math.round(Math.abs(s.x-e.x)):0,h=e.y<s.y?Math.round(Math.abs(s.y-e.y)):0,d=Math.max(u.width,Math.round(e.width)),f=Math.max(u.height,Math.round(e.height)),p=(d-u.width)*l[0],g=(f-u.height)*l[1];(c>0||h>0||p||g)&&(r.push({id:a,type:"position",position:{x:i.position.x-c+p,y:i.position.y-h+g}}),n.get(a)?.forEach((e=>{t.some((t=>t.id===e.id))||r.push({id:e.id,type:"position",position:{x:e.position.x+c,y:e.position.y+h}})}))),(u.width<e.width||u.height<e.height||c||h)&&r.push({id:a,type:"dimensions",setAttributes:!0,dimensions:{width:d+(c?l[0]*c-p:0),height:f+(h?l[1]*h-g:0)}})})),r}var st={value:()=>{}};function ut(){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 lt(o)}function lt(t){this._=t}function ct(t,e){for(var n,o=0,r=t.length;o<r;++o)if((n=t[o]).name===e)return n.value}function ht(t,e,n){for(var o=0,r=t.length;o<r;++o)if(t[o].name===e){t[o]=st,t=t.slice(0,o).concat(t.slice(o+1));break}return null!=n&&t.push({name:e,value:n}),t}lt.prototype=ut.prototype={constructor:lt,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]=ht(r[n],t.name,e);else if(null==e)for(n in r)r[n]=ht(r[n],t.name,null);return this}for(;++a<s;)if((n=(t=i[a]).type)&&(n=ct(r[n],t.name)))return n},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new lt(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 dt="http://www.w3.org/1999/xhtml",ft={svg:"http://www.w3.org/2000/svg",xhtml:dt,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function pt(t){var e=t+="",n=e.indexOf(":");return n>=0&&"xmlns"!==(e=t.slice(0,n))&&(t=t.slice(n+1)),ft.hasOwnProperty(e)?{space:ft[e],local:t}:t}function gt(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===dt&&e.documentElement.namespaceURI===dt?e.createElement(t):e.createElementNS(n,t)}}function mt(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function yt(t){var e=pt(t);return(e.local?mt:gt)(e)}function vt(){}function xt(t){return null==t?vt:function(){return this.querySelector(t)}}function wt(){return[]}function _t(t){return null==t?wt:function(){return this.querySelectorAll(t)}}function bt(t){return function(){return null==(e=t.apply(this,arguments))?[]:Array.isArray(e)?e:Array.from(e);var e}}function Mt(t){return function(){return this.matches(t)}}function Pt(t){return function(e){return e.matches(t)}}var Et=Array.prototype.find;function St(){return this.firstElementChild}var zt=Array.prototype.filter;function Nt(){return Array.from(this.children)}function kt(t){return new Array(t.length)}function Tt(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}function At(t,e,n,o,r,i){for(var a,s=0,u=e.length,l=i.length;s<l;++s)(a=e[s])?(a.__data__=i[s],o[s]=a):n[s]=new Tt(t,i[s]);for(;s<u;++s)(a=e[s])&&(r[s]=a)}function It(t,e,n,o,r,i,a){var s,u,l,c=new Map,h=e.length,d=i.length,f=new Array(h);for(s=0;s<h;++s)(u=e[s])&&(f[s]=l=a.call(u,u.__data__,s,e)+"",c.has(l)?r[s]=u:c.set(l,u));for(s=0;s<d;++s)l=a.call(t,i[s],s,i)+"",(u=c.get(l))?(o[s]=u,u.__data__=i[s],c.delete(l)):n[s]=new Tt(t,i[s]);for(s=0;s<h;++s)(u=e[s])&&c.get(f[s])===u&&(r[s]=u)}function $t(t){return t.__data__}function Ct(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}function Ht(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function Ot(t){return function(){this.removeAttribute(t)}}function Xt(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Yt(t,e){return function(){this.setAttribute(t,e)}}function Bt(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function Rt(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttribute(t):this.setAttribute(t,n)}}function Dt(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 Lt(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function Vt(t){return function(){this.style.removeProperty(t)}}function qt(t,e,n){return function(){this.style.setProperty(t,e,n)}}function Zt(t,e,n){return function(){var o=e.apply(this,arguments);null==o?this.style.removeProperty(t):this.style.setProperty(t,o,n)}}function Gt(t,e){return t.style.getPropertyValue(e)||Lt(t).getComputedStyle(t,null).getPropertyValue(e)}function jt(t){return function(){delete this[t]}}function Ft(t,e){return function(){this[t]=e}}function Wt(t,e){return function(){var n=e.apply(this,arguments);null==n?delete this[t]:this[t]=n}}function Kt(t){return t.trim().split(/^|\s+/)}function Ut(t){return t.classList||new Qt(t)}function Qt(t){this._node=t,this._names=Kt(t.getAttribute("class")||"")}function Jt(t,e){for(var n=Ut(t),o=-1,r=e.length;++o<r;)n.add(e[o])}function te(t,e){for(var n=Ut(t),o=-1,r=e.length;++o<r;)n.remove(e[o])}function ee(t){return function(){Jt(this,t)}}function ne(t){return function(){te(this,t)}}function oe(t,e){return function(){(e.apply(this,arguments)?Jt:te)(this,t)}}function re(){this.textContent=""}function ie(t){return function(){this.textContent=t}}function ae(t){return function(){var e=t.apply(this,arguments);this.textContent=null==e?"":e}}function se(){this.innerHTML=""}function ue(t){return function(){this.innerHTML=t}}function le(t){return function(){var e=t.apply(this,arguments);this.innerHTML=null==e?"":e}}function ce(){this.nextSibling&&this.parentNode.appendChild(this)}function he(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function de(){return null}function fe(){var t=this.parentNode;t&&t.removeChild(this)}function pe(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function ge(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function me(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 ye(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 ve(t,e,n){var o=Lt(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 xe(t,e){return function(){return ve(this,t,e)}}function we(t,e){return function(){return ve(this,t,e.apply(this,arguments))}}Tt.prototype={constructor:Tt,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)}},Qt.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 _e=[null];function be(t,e){this._groups=t,this._parents=e}function Me(){return new be([[document.documentElement]],_e)}function Pe(t){return"string"==typeof t?new be([[document.querySelector(t)]],[document.documentElement]):new be([[t]],_e)}function Ee(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]}be.prototype=Me.prototype={constructor:be,select:function(t){"function"!=typeof t&&(t=xt(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,l=o[r]=new Array(u),c=0;c<u;++c)(i=s[c])&&(a=t.call(i,i.__data__,c,s))&&("__data__"in i&&(a.__data__=i.__data__),l[c]=a);return new be(o,this._parents)},selectAll:function(t){t="function"==typeof t?bt(t):_t(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,l=0;l<u;++l)(a=s[l])&&(o.push(t.call(a,a.__data__,l,s)),r.push(a));return new be(o,r)},selectChild:function(t){return this.select(null==t?St:function(t){return function(){return Et.call(this.children,t)}}("function"==typeof t?t:Pt(t)))},selectChildren:function(t){return this.selectAll(null==t?Nt:function(t){return function(){return zt.call(this.children,t)}}("function"==typeof t?t:Pt(t)))},filter:function(t){"function"!=typeof t&&(t=Mt(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]=[],l=0;l<s;++l)(i=a[l])&&t.call(i,i.__data__,l,a)&&u.push(i);return new be(o,this._parents)},data:function(t,e){if(!arguments.length)return Array.from(this,$t);var n,o=e?It:At,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),l=new Array(a),c=0;c<a;++c){var h=r[c],d=i[c],f=d.length,p=Ct(t.call(h,h&&h.__data__,c,r)),g=p.length,m=u[c]=new Array(g),y=s[c]=new Array(g);o(h,d,m,y,l[c]=new Array(f),p,e);for(var v,x,w=0,_=0;w<g;++w)if(v=m[w]){for(w>=_&&(_=w+1);!(x=y[_])&&++_<g;);v._next=x||null}}return(s=new be(s,r))._enter=u,s._exit=l,s},enter:function(){return new be(this._enter||this._groups.map(kt),this._parents)},exit:function(){return new be(this._exit||this._groups.map(kt),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 l,c=n[u],h=o[u],d=c.length,f=s[u]=new Array(d),p=0;p<d;++p)(l=c[p]||h[p])&&(f[p]=l);for(;u<r;++u)s[u]=n[u];return new be(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=Ht);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,l=r[i]=new Array(u),c=0;c<u;++c)(a=s[c])&&(l[c]=a);l.sort(e)}return new be(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=pt(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?Xt:Ot:"function"==typeof e?n.local?Dt:Rt:n.local?Bt:Yt)(n,e))},style:function(t,e,n){return arguments.length>1?this.each((null==e?Vt:"function"==typeof e?Zt:qt)(t,e,null==n?"":n)):Gt(this.node(),t)},property:function(t,e){return arguments.length>1?this.each((null==e?jt:"function"==typeof e?Wt:Ft)(t,e)):this.node()[t]},classed:function(t,e){var n=Kt(t+"");if(arguments.length<2){for(var o=Ut(this.node()),r=-1,i=n.length;++r<i;)if(!o.contains(n[r]))return!1;return!0}return this.each(("function"==typeof e?oe:e?ee:ne)(n,e))},text:function(t){return arguments.length?this.each(null==t?re:("function"==typeof t?ae:ie)(t)):this.node().textContent},html:function(t){return arguments.length?this.each(null==t?se:("function"==typeof t?le:ue)(t)):this.node().innerHTML},raise:function(){return this.each(ce)},lower:function(){return this.each(he)},append:function(t){var e="function"==typeof t?t:yt(t);return this.select((function(){return this.appendChild(e.apply(this,arguments))}))},insert:function(t,e){var n="function"==typeof t?t:yt(t),o=null==e?de:"function"==typeof e?e:xt(e);return this.select((function(){return this.insertBefore(n.apply(this,arguments),o.apply(this,arguments)||null)}))},remove:function(){return this.each(fe)},clone:function(t){return this.select(t?ge:pe)},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?ye:me,o=0;o<a;++o)this.each(s(i[o],e,n));return this}var s=this.node().__on;if(s)for(var u,l=0,c=s.length;l<c;++l)for(o=0,u=s[l];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?we:xe)(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 Se={passive:!1},ze={capture:!0,passive:!1};function Ne(t){t.stopImmediatePropagation()}function ke(t){t.preventDefault(),t.stopImmediatePropagation()}function Te(t){var e=t.document.documentElement,n=Pe(t).on("dragstart.drag",ke,ze);"onselectstart"in e?n.on("selectstart.drag",ke,ze):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}function Ae(t,e){var n=t.document.documentElement,o=Pe(t).on("dragstart.drag",null);e&&(o.on("click.drag",ke,ze),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 Ie=t=>()=>t;function $e(t,{sourceEvent:e,subject:n,target:o,identifier:r,active:i,x:a,y:s,dx:u,dy:l,dispatch:c}){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:l,enumerable:!0,configurable:!0},_:{value:c}})}function Ce(t){return!t.ctrlKey&&!t.button}function He(){return this.parentNode}function Oe(t,e){return null==e?{x:t.x,y:t.y}:e}function Xe(){return navigator.maxTouchPoints||"ontouchstart"in this}function Ye(){var t,e,n,o,r=Ce,i=He,a=Oe,s=Xe,u={},l=ut("start","drag","end"),c=0,h=0;function d(t){t.on("mousedown.drag",f).filter(s).on("touchstart.drag",m).on("touchmove.drag",y,Se).on("touchend.drag touchcancel.drag",v).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function f(a,s){if(!o&&r.call(this,a,s)){var u=x(this,i.call(this,a,s),a,s,"mouse");u&&(Pe(a.view).on("mousemove.drag",p,ze).on("mouseup.drag",g,ze),Te(a.view),Ne(a),n=!1,t=a.clientX,e=a.clientY,u("start",a))}}function p(o){if(ke(o),!n){var r=o.clientX-t,i=o.clientY-e;n=r*r+i*i>h}u.mouse("drag",o)}function g(t){Pe(t.view).on("mousemove.drag mouseup.drag",null),Ae(t.view,n),ke(t),u.mouse("end",t)}function m(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]))&&(Ne(t),o("start",t,a[n]))}}function y(t){var e,n,o=t.changedTouches,r=o.length;for(e=0;e<r;++e)(n=u[o[e].identifier])&&(ke(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])&&(Ne(t),n("end",t,r[e]))}function x(t,e,n,o,r,i){var s,h,f,p=l.copy(),g=Ee(i||n,e);if(null!=(f=a.call(t,new $e("beforestart",{sourceEvent:n,target:d,identifier:r,active:c,x:g[0],y:g[1],dx:0,dy:0,dispatch:p}),o)))return s=f.x-g[0]||0,h=f.y-g[1]||0,function n(i,a,l){var m,y=g;switch(i){case"start":u[r]=n,m=c++;break;case"end":delete u[r],--c;case"drag":g=Ee(l||a,e),m=c}p.call(i,t,new $e(i,{sourceEvent:a,subject:f,target:d,identifier:r,active:m,x:g[0]+s,y:g[1]+h,dx:g[0]-y[0],dy:g[1]-y[1],dispatch:p}),o)}}return d.filter=function(t){return arguments.length?(r="function"==typeof t?t:Ie(!!t),d):r},d.container=function(t){return arguments.length?(i="function"==typeof t?t:Ie(t),d):i},d.subject=function(t){return arguments.length?(a="function"==typeof t?t:Ie(t),d):a},d.touchable=function(t){return arguments.length?(s="function"==typeof t?t:Ie(!!t),d):s},d.on=function(){var t=l.on.apply(l,arguments);return t===l?d:t},d.clickDistance=function(t){return arguments.length?(h=(t=+t)*t,d):Math.sqrt(h)},d}function Be(t,e){if(!t.parentId)return!1;const n=e.get(t.parentId);return!!n&&(!!n.selected||Be(n,e))}function Re(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 De({nodeId:t,dragItems:e,nodeLookup:n,dragging:o=!0}){const r=[];for(const[t,i]of e){const e=n.get(t)?.internals.userNode;e&&r.push({...e,position:i.position,dragging:o})}if(!t)return[r[0],r];const i=n.get(t).internals.userNode;return[{...i,position:e.get(t)?.position||i.position,dragging:o},r]}function Le(t,e,n,o){let r=null;return[(e[n]||[]).reduce(((e,i)=>{if(t.id===o.nodeId&&n===o.handleType&&i.id===o.handleId)r=i;else{const n=J(t,i,i.position,!0);e.push({...i,...n})}return e}),[]),r]}function Ve(t,e){return t||(e?.classList.contains("target")?"target":e?.classList.contains("source")?"source":null)}$e.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};const qe=()=>!0;function Ze(e,{handle:n,connectionMode:o,fromNodeId:r,fromHandleId:i,fromType:a,doc:s,lib:u,flowId:l,isValidConnection:c=qe,handleLookup:h}){const d="target"===a,f=n?s.querySelector(`.${u}-flow__handle[data-id="${l}-${n?.nodeId}-${n?.id}-${n?.type}"]`):null,{x:p,y:g}=D(e),m=s.elementFromPoint(p,g),y=m?.classList.contains(`${u}-flow__handle`)?m:f,v={handleDomNode:y,isValid:!1,connection:null,toHandle:null};if(y){const e=Ve(void 0,y),n=y.getAttribute("data-nodeid"),a=y.getAttribute("data-handleid"),s=y.classList.contains("connectable"),u=y.classList.contains("connectableend");if(!n)return v;const l={source:d?n:r,sourceHandle:d?a:i,target:d?r:n,targetHandle:d?i:a};v.connection=l;const f=s&&u&&(o===t.ConnectionMode.Strict?d&&"source"===e||!d&&"target"===e:n!==r||a!==i);if(v.isValid=f&&c(l),h){const t=h.find((t=>t.id===a&&t.nodeId===n&&t.type===e));t&&(v.toHandle={...t})}}return v}const Ge={onPointerDown:function(e,{connectionMode:n,connectionRadius:o,handleId:r,nodeId:i,edgeUpdaterType:a,isTarget:s,domNode:u,nodeLookup:c,lib:h,autoPanOnConnect:d,flowId:f,panBy:p,cancelConnection:g,onConnectStart:m,onConnect:y,onConnectEnd:v,isValidConnection:w=qe,onReconnectEnd:_,updateConnection:b,getTransform:M,getFromHandle:P,autoPanSpeed:E}){const S=Y(e.target);let z,N=0;const{x:k,y:I}=D(e),$=S?.elementFromPoint(k,I),C=Ve(a,$),H=u?.getBoundingClientRect();if(!H||!C)return;let O=D(e,H),X=!1,B=null,R=!1,L=null;const[V,q]=function({nodeLookup:t,nodeId:e,handleId:n,handleType:o}){const r=[],i={nodeId:e,handleId:n,handleType:o};let a=null;for(const e of t.values())if(e.internals.handleBounds){const[t,n]=Le(e,e.internals.handleBounds,"source",i),[o,s]=Le(e,e.internals.handleBounds,"target",i);a=a||(n??s),r.push(...t,...o)}return[r,a]}({nodeLookup:c,nodeId:i,handleId:r,handleType:C});function Z(){if(!d||!H)return;const[t,e]=x(O,H,E);p({x:t,y:e}),N=requestAnimationFrame(Z)}const G={...q,nodeId:i,type:C,position:q.position},j=c.get(i),F={inProgress:!0,isValid:null,from:J(j,G,t.Position.Left,!0),fromHandle:G,fromPosition:G.position,fromNode:j,to:O,toHandle:null,toPosition:l[G.position],toNode:null};b(F);let W=F;function K(t){if(!P()||!G)return void U(t);const e=M();O=D(t,H),z=function(t,e,n){let o=[],r=1/0;for(const i of n){const n=Math.sqrt(Math.pow(i.x-t.x,2)+Math.pow(i.y-t.y,2));n<=e&&(n<r?o=[i]:n===r&&o.push(i),r=n)}return o.length?1===o.length?o[0]:o.find((t=>"target"===t.type))||o[0]:null}(T(O,e,!1,[1,1]),o,V),X||(Z(),X=!0);const a=Ze(t,{handle:z,connectionMode:n,fromNodeId:i,fromHandleId:r,fromType:s?"target":"source",isValidConnection:w,doc:S,lib:h,flowId:f,handleLookup:V});L=a.handleDomNode,B=a.connection,R=function(t,e){let n=null;return e?n=!0:t&&!e&&(n=!1),n}(!!z,a.isValid);const u={...W,isValid:R,to:z&&R?A({x:z.x,y:z.y},e):O,toHandle:a.toHandle,toPosition:R&&a.toHandle?a.toHandle.position:l[G.position],toNode:a.toHandle?c.get(a.toHandle.nodeId):null};R&&z&&W.toHandle&&u.toHandle&&W.toHandle.type===u.toHandle.type&&W.toHandle.nodeId===u.toHandle.nodeId&&W.toHandle.id===u.toHandle.id||(b(u),W=u)}function U(t){(z||L)&&B&&R&&y?.(B),v?.(t),a&&_?.(t),g(),cancelAnimationFrame(N),X=!1,R=!1,B=null,L=null,S.removeEventListener("mousemove",K),S.removeEventListener("mouseup",U),S.removeEventListener("touchmove",K),S.removeEventListener("touchend",U)}m?.(e,{nodeId:i,handleId:r,handleType:C}),S.addEventListener("mousemove",K),S.addEventListener("mouseup",U),S.addEventListener("touchmove",K),S.addEventListener("touchend",U)},isValid:Ze};function je(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function Fe(t,e){var n=Object.create(t.prototype);for(var o in e)n[o]=e[o];return n}function We(){}var Ke=.7,Ue=1/Ke,Qe="\\s*([+-]?\\d+)\\s*",Je="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",tn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",en=/^#([0-9a-f]{3,8})$/,nn=new RegExp(`^rgb\\(${Qe},${Qe},${Qe}\\)$`),on=new RegExp(`^rgb\\(${tn},${tn},${tn}\\)$`),rn=new RegExp(`^rgba\\(${Qe},${Qe},${Qe},${Je}\\)$`),an=new RegExp(`^rgba\\(${tn},${tn},${tn},${Je}\\)$`),sn=new RegExp(`^hsl\\(${Je},${tn},${tn}\\)$`),un=new RegExp(`^hsla\\(${Je},${tn},${tn},${Je}\\)$`),ln={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 cn(){return this.rgb().formatHex()}function hn(){return this.rgb().formatRgb()}function dn(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=en.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?fn(e):3===n?new mn(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?pn(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?pn(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=nn.exec(t))?new mn(e[1],e[2],e[3],1):(e=on.exec(t))?new mn(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=rn.exec(t))?pn(e[1],e[2],e[3],e[4]):(e=an.exec(t))?pn(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=sn.exec(t))?bn(e[1],e[2]/100,e[3]/100,1):(e=un.exec(t))?bn(e[1],e[2]/100,e[3]/100,e[4]):ln.hasOwnProperty(t)?fn(ln[t]):"transparent"===t?new mn(NaN,NaN,NaN,0):null}function fn(t){return new mn(t>>16&255,t>>8&255,255&t,1)}function pn(t,e,n,o){return o<=0&&(t=e=n=NaN),new mn(t,e,n,o)}function gn(t,e,n,o){return 1===arguments.length?((r=t)instanceof We||(r=dn(r)),r?new mn((r=r.rgb()).r,r.g,r.b,r.opacity):new mn):new mn(t,e,n,null==o?1:o);var r}function mn(t,e,n,o){this.r=+t,this.g=+e,this.b=+n,this.opacity=+o}function yn(){return`#${_n(this.r)}${_n(this.g)}${_n(this.b)}`}function vn(){const t=xn(this.opacity);return`${1===t?"rgb(":"rgba("}${wn(this.r)}, ${wn(this.g)}, ${wn(this.b)}${1===t?")":`, ${t})`}`}function xn(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function wn(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function _n(t){return((t=wn(t))<16?"0":"")+t.toString(16)}function bn(t,e,n,o){return o<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new Pn(t,e,n,o)}function Mn(t){if(t instanceof Pn)return new Pn(t.h,t.s,t.l,t.opacity);if(t instanceof We||(t=dn(t)),!t)return new Pn;if(t instanceof Pn)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 Pn(a,s,u,t.opacity)}function Pn(t,e,n,o){this.h=+t,this.s=+e,this.l=+n,this.opacity=+o}function En(t){return(t=(t||0)%360)<0?t+360:t}function Sn(t){return Math.max(0,Math.min(1,t||0))}function zn(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}je(We,dn,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:cn,formatHex:cn,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return Mn(this).formatHsl()},formatRgb:hn,toString:hn}),je(mn,gn,Fe(We,{brighter(t){return t=null==t?Ue:Math.pow(Ue,t),new mn(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?Ke:Math.pow(Ke,t),new mn(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new mn(wn(this.r),wn(this.g),wn(this.b),xn(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:yn,formatHex:yn,formatHex8:function(){return`#${_n(this.r)}${_n(this.g)}${_n(this.b)}${_n(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:vn,toString:vn})),je(Pn,(function(t,e,n,o){return 1===arguments.length?Mn(t):new Pn(t,e,n,null==o?1:o)}),Fe(We,{brighter(t){return t=null==t?Ue:Math.pow(Ue,t),new Pn(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?Ke:Math.pow(Ke,t),new Pn(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 mn(zn(t>=240?t-240:t+120,r,o),zn(t,r,o),zn(t<120?t+240:t-120,r,o),this.opacity)},clamp(){return new Pn(En(this.h),Sn(this.s),Sn(this.l),xn(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=xn(this.opacity);return`${1===t?"hsl(":"hsla("}${En(this.h)}, ${100*Sn(this.s)}%, ${100*Sn(this.l)}%${1===t?")":`, ${t})`}`}}));var Nn=t=>()=>t;function kn(t){return 1==(t=+t)?Tn: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 Tn(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=kn(e);function o(t,e){var o=n((t=gn(t)).r,(e=gn(e)).r),r=n(t.g,e.g),i=n(t.b,e.b),a=Tn(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 In(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}var $n=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Cn=new RegExp($n.source,"g");function Hn(t,e){var n,o,r,i=$n.lastIndex=Cn.lastIndex=0,a=-1,s=[],u=[];for(t+="",e+="";(n=$n.exec(t))&&(o=Cn.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:In(n,o)})),i=Cn.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,Xn=180/Math.PI,Yn={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Bn(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)*Xn,skewX:Math.atan(u)*Xn,scaleX:a,scaleY:s}}function Rn(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:In(t,r)},{i:u-2,x:In(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:In(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:In(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:In(t,n)},{i:s-2,x:In(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 Dn=Rn((function(t){const e=new("function"==typeof DOMMatrix?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?Yn:Bn(e.a,e.b,e.c,e.d,e.e,e.f)}),"px, ","px)","deg)"),Ln=Rn((function(t){return null==t?Yn:(On||(On=document.createElementNS("http://www.w3.org/2000/svg","g")),On.setAttribute("transform",t),(t=On.transform.baseVal.consolidate())?Bn((t=t.matrix).a,t.b,t.c,t.d,t.e,t.f):Yn)}),", ",")",")");function Vn(t){return((t=Math.exp(t))+1/t)/2}var qn,Zn,Gn=function t(e,n,o){function r(t,r){var i,a,s=t[0],u=t[1],l=t[2],c=r[0],h=r[1],d=r[2],f=c-s,p=h-u,g=f*f+p*p;if(g<1e-12)a=Math.log(d/l)/e,i=function(t){return[s+t*f,u+t*p,l*Math.exp(e*t*a)]};else{var m=Math.sqrt(g),y=(d*d-l*l+o*g)/(2*l*n*m),v=(d*d-l*l-o*g)/(2*d*n*m),x=Math.log(Math.sqrt(y*y+1)-y),w=Math.log(Math.sqrt(v*v+1)-v);a=(w-x)/e,i=function(t){var o,r=t*a,i=Vn(x),c=l/(n*m)*(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+c*f,u+c*p,l*i/Vn(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),jn=0,Fn=0,Wn=0,Kn=1e3,Un=0,Qn=0,Jn=0,to="object"==typeof performance&&performance.now?performance:Date,eo="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function no(){return Qn||(eo(oo),Qn=to.now()+Jn)}function oo(){Qn=0}function ro(){this._call=this._time=this._next=null}function io(t,e,n){var o=new ro;return o.restart(t,e,n),o}function ao(){Qn=(Un=to.now())+Jn,jn=Fn=0;try{!function(){no(),++jn;for(var t,e=qn;e;)(t=Qn-e._time)>=0&&e._call.call(void 0,t),e=e._next;--jn}()}finally{jn=0,function(){var t,e,n=qn,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:qn=e);Zn=t,uo(o)}(),Qn=0}}function so(){var t=to.now(),e=t-Un;e>Kn&&(Jn-=e,Un=t)}function uo(t){jn||(Fn&&(Fn=clearTimeout(Fn)),t-Qn>24?(t<1/0&&(Fn=setTimeout(ao,t-to.now()-Jn)),Wn&&(Wn=clearInterval(Wn))):(Wn||(Un=to.now(),Wn=setInterval(so,Kn)),jn=1,eo(ao)))}function lo(t,e,n){var o=new ro;return e=null==e?0:+e,o.restart((n=>{o.stop(),t(n+e)}),e,n),o}ro.prototype=io.prototype={constructor:ro,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?no():+n)+(null==e?0:+e),this._next||Zn===this||(Zn?Zn._next=this:qn=this,Zn=this),this._call=t,this._time=n,uo()},stop:function(){this._call&&(this._call=null,this._time=1/0,uo())}};var co=ut("start","end","cancel","interrupt"),ho=[],fo=0,po=1,go=2,mo=3,yo=4,vo=5,xo=6;function wo(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=po,n.timer.restart(a,n.delay,n.time),n.delay<=t&&a(t-n.delay)}function a(i){var l,c,h,d;if(n.state!==po)return u();for(l in r)if((d=r[l]).name===n.name){if(d.state===mo)return lo(a);d.state===yo?(d.state=xo,d.timer.stop(),d.on.call("interrupt",t,t.__data__,d.index,d.group),delete r[l]):+l<e&&(d.state=xo,d.timer.stop(),d.on.call("cancel",t,t.__data__,d.index,d.group),delete r[l])}if(lo((function(){n.state===mo&&(n.state=yo,n.timer.restart(s,n.delay,n.time),s(i))})),n.state=go,n.on.call("start",t,t.__data__,n.index,n.group),n.state===go){for(n.state=mo,o=new Array(h=n.tween.length),l=0,c=-1;l<h;++l)(d=n.tween[l].value.call(t,t.__data__,n.index,n.group))&&(o[++c]=d);o.length=c+1}}function s(e){for(var r=e<n.duration?n.ease.call(null,e/n.duration):(n.timer.restart(u),n.state=vo,1),i=-1,a=o.length;++i<a;)o[i].call(t,r);n.state===vo&&(n.on.call("end",t,t.__data__,n.index,n.group),u())}function u(){for(var o in n.state=xo,n.timer.stop(),delete r[e],r)return;delete t.__transition}r[e]=n,n.timer=io(i,0,n.time)}(t,n,{name:e,index:o,group:r,on:co,tween:ho,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:fo})}function _o(t,e){var n=Mo(t,e);if(n.state>fo)throw new Error("too late; already scheduled");return n}function bo(t,e){var n=Mo(t,e);if(n.state>mo)throw new Error("too late; already running");return n}function Mo(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function Po(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>go&&n.state<vo,n.state=xo,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 Eo(t,e){var n,o;return function(){var r=bo(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 So(t,e,n){var o,r;if("function"!=typeof n)throw new Error;return function(){var i=bo(this,t),a=i.tween;if(a!==o){r=(o=a).slice();for(var s={name:e,value:n},u=0,l=r.length;u<l;++u)if(r[u].name===e){r[u]=s;break}u===l&&r.push(s)}i.tween=r}}function zo(t,e,n){var o=t._id;return t.each((function(){var t=bo(this,o);(t.value||(t.value={}))[e]=n.apply(this,arguments)})),function(t){return Mo(t,o).value[e]}}function No(t,e){var n;return("number"==typeof e?In:e instanceof dn?An:(n=dn(e))?(e=n,An):Hn)(t,e)}function ko(t){return function(){this.removeAttribute(t)}}function To(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 Io(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 Co(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 Ho(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 Xo(t,e){return function(){_o(this,t).delay=+e.apply(this,arguments)}}function Yo(t,e){return e=+e,function(){_o(this,t).delay=e}}function Bo(t,e){return function(){bo(this,t).duration=+e.apply(this,arguments)}}function Ro(t,e){return e=+e,function(){bo(this,t).duration=e}}var Do=Me.prototype.constructor;function Lo(t){return function(){this.style.removeProperty(t)}}var Vo=0;function qo(t,e,n,o){this._groups=t,this._parents=e,this._name=n,this._id=o}function Zo(){return++Vo}var Go=Me.prototype;qo.prototype={constructor:qo,select:function(t){var e=this._name,n=this._id;"function"!=typeof t&&(t=xt(t));for(var o=this._groups,r=o.length,i=new Array(r),a=0;a<r;++a)for(var s,u,l=o[a],c=l.length,h=i[a]=new Array(c),d=0;d<c;++d)(s=l[d])&&(u=t.call(s,s.__data__,d,l))&&("__data__"in s&&(u.__data__=s.__data__),h[d]=u,wo(h[d],e,n,d,h,Mo(s,n)));return new qo(i,this._parents,e,n)},selectAll:function(t){var e=this._name,n=this._id;"function"!=typeof t&&(t=_t(t));for(var o=this._groups,r=o.length,i=[],a=[],s=0;s<r;++s)for(var u,l=o[s],c=l.length,h=0;h<c;++h)if(u=l[h]){for(var d,f=t.call(u,u.__data__,h,l),p=Mo(u,n),g=0,m=f.length;g<m;++g)(d=f[g])&&wo(d,e,n,g,f,p);i.push(f),a.push(u)}return new qo(i,a,e,n)},selectChild:Go.selectChild,selectChildren:Go.selectChildren,filter:function(t){"function"!=typeof t&&(t=Mt(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]=[],l=0;l<s;++l)(i=a[l])&&t.call(i,i.__data__,l,a)&&u.push(i);return new qo(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,l=e[s],c=n[s],h=l.length,d=a[s]=new Array(h),f=0;f<h;++f)(u=l[f]||c[f])&&(d[f]=u);for(;s<o;++s)a[s]=e[s];return new qo(a,this._parents,this._name,this._id)},selection:function(){return new Do(this._groups,this._parents)},transition:function(){for(var t=this._name,e=this._id,n=Zo(),o=this._groups,r=o.length,i=0;i<r;++i)for(var a,s=o[i],u=s.length,l=0;l<u;++l)if(a=s[l]){var c=Mo(a,e);wo(a,t,n,l,s,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new qo(o,this._parents,t,n)},call:Go.call,nodes:Go.nodes,node:Go.node,size:Go.size,empty:Go.empty,each:Go.each,on:function(t,e){var n=this._id;return arguments.length<2?Mo(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)?_o:bo;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=pt(t),o="transform"===n?Ln:No;return this.attrTween(t,"function"==typeof e?(n.local?Co:$o)(n,o,zo(this,"attr."+t,e)):null==e?(n.local?To:ko)(n):(n.local?Io: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=pt(t);return this.tween(n,(o.local?Ho:Oo)(o,e))},style:function(t,e,n){var o="transform"==(t+="")?Dn:No;return null==e?this.styleTween(t,function(t,e){var n,o,r;return function(){var i=Gt(this,t),a=(this.style.removeProperty(t),Gt(this,t));return i===a?null:i===n&&a===o?r:r=e(n=i,o=a)}}(t,o)).on("end.style."+t,Lo(t)):"function"==typeof e?this.styleTween(t,function(t,e,n){var o,r,i;return function(){var a=Gt(this,t),s=n(this),u=s+"";return null==s&&(this.style.removeProperty(t),u=s=Gt(this,t)),a===u?null:a===o&&u===r?i:(r=u,i=e(o=a,s))}}(t,o,zo(this,"style."+t,e))).each(function(t,e){var n,o,r,i,a="style."+e,s="end."+a;return function(){var u=bo(this,t),l=u.on,c=null==u.value[a]?i||(i=Lo(e)):void 0;l===n&&r===c||(o=(n=l).copy()).on(s,r=c),u.on=o}}(this._id,t)):this.styleTween(t,function(t,e,n){var o,r,i=n+"";return function(){var a=Gt(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}}(zo(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=Mo(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?Eo:So)(n,t,e))},delay:function(t){var e=this._id;return arguments.length?this.each(("function"==typeof t?Xo:Yo)(e,t)):Mo(this.node(),e).delay},duration:function(t){var e=this._id;return arguments.length?this.each(("function"==typeof t?Bo:Ro)(e,t)):Mo(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(){bo(this,t).ease=e}}(e,t)):Mo(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;bo(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=bo(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]:Go[Symbol.iterator]};var jo={time:null,delay:0,duration:250,ease:function(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}};function Fo(t,e){for(var n;!(n=t.__transition)||!(n=n[e]);)if(!(t=t.parentNode))throw new Error(`transition ${e} not found`);return n}Me.prototype.interrupt=function(t){return this.each((function(){Po(this,t)}))},Me.prototype.transition=function(t){var e,n;t instanceof qo?(e=t._id,t=t._name):(e=Zo(),(n=jo).time=no(),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,l=0;l<u;++l)(a=s[l])&&wo(a,t,e,l,s,n||Fo(a,e));return new qo(o,this._parents,t,e)};var Wo=t=>()=>t;function Ko(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 Uo(t,e,n){this.k=t,this.x=e,this.y=n}Uo.prototype={constructor:Uo,scale:function(t){return 1===t?this:new Uo(this.k*t,this.x,this.y)},translate:function(t,e){return 0===t&0===e?this:new Uo(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 Qo=new Uo(1,0,0);function Jo(t){for(;!t.__zoom;)if(!(t=t.parentNode))return Qo;return t.__zoom}function tr(t){t.stopImmediatePropagation()}function er(t){t.preventDefault(),t.stopImmediatePropagation()}function nr(t){return!(t.ctrlKey&&"wheel"!==t.type||t.button)}function or(){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 rr(){return this.__zoom||Qo}function ir(t){return-t.deltaY*(1===t.deltaMode?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function ar(){return navigator.maxTouchPoints||"ontouchstart"in this}function sr(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 ur(){var t,e,n,o=nr,r=or,i=sr,a=ir,s=ar,u=[0,1/0],l=[[-1/0,-1/0],[1/0,1/0]],c=250,h=Gn,d=ut("start","zoom","end"),f=500,p=150,g=0,m=10;function y(t){t.property("__zoom",rr).on("wheel.zoom",P,{passive:!1}).on("mousedown.zoom",E).on("dblclick.zoom",S).filter(s).on("touchstart.zoom",z).on("touchmove.zoom",N).on("touchend.zoom touchcancel.zoom",k).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 Uo(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 Uo(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,l=Math.max(s[1][0]-s[0][0],s[1][1]-s[0][1]),c=t.__zoom,d="function"==typeof e?e.apply(t,i):e,f=h(c.invert(u).concat(l/c.k),d.invert(u).concat(l/d.k));return function(t){if(1===t)t=d;else{var e=f(t),n=l/e[2];t=new Uo(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 P(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)))),c=Ee(t);if(n.wheel)n.mouse[0][0]===c[0]&&n.mouse[0][1]===c[1]||(n.mouse[1]=r.invert(n.mouse[0]=c)),clearTimeout(n.wheel);else{if(r.k===s)return;n.mouse=[c,r.invert(c)],Po(this),n.start()}er(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,l))}}function E(t,...e){if(!n&&o.apply(this,arguments)){var r=t.currentTarget,a=b(this,e,!0).event(t),s=Pe(t.view).on("mousemove.zoom",(function(t){if(er(t),!a.moved){var e=t.clientX-c,n=t.clientY-h;a.moved=e*e+n*n>g}a.event(t).zoom("mouse",i(x(a.that.__zoom,a.mouse[0]=Ee(t,r),a.mouse[1]),a.extent,l))}),!0).on("mouseup.zoom",(function(t){s.on("mousemove.zoom mouseup.zoom",null),Ae(t.view,a.moved),er(t),a.event(t).end()}),!0),u=Ee(t,r),c=t.clientX,h=t.clientY;Te(t.view),tr(t),a.mouse=[u,this.__zoom.invert(u)],Po(this),a.start()}}function S(t,...e){if(o.apply(this,arguments)){var n=this.__zoom,a=Ee(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),l);er(t),c>0?Pe(this).transition().duration(c).call(_,h,a,t):Pe(this).call(y.transform,h,a,t)}}function z(n,...r){if(o.apply(this,arguments)){var i,a,s,u,l=n.touches,c=l.length,h=b(this,r,n.changedTouches.length===c).event(n);for(tr(n),a=0;a<c;++a)u=[u=Ee(s=l[a],this),this.__zoom.invert(u),s.identifier],h.touch0?h.touch1||h.touch0[2]===u[2]||(h.touch1=u,h.taps=0):(h.touch0=u,i=!0,h.taps=1+!!t);t&&(t=clearTimeout(t)),i&&(h.taps<2&&(e=u[0],t=setTimeout((function(){t=null}),f)),Po(this),h.start())}}function N(t,...e){if(this.__zooming){var n,o,r,a,s=b(this,e).event(t),u=t.changedTouches,c=u.length;for(er(t),n=0;n<c;++n)r=Ee(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],d=s.touch0[1],f=s.touch1[0],p=s.touch1[1],g=(g=f[0]-h[0])*g+(g=f[1]-h[1])*g,m=(m=p[0]-d[0])*m+(m=p[1]-d[1])*m;o=v(o,Math.sqrt(g/m)),r=[(h[0]+f[0])/2,(h[1]+f[1])/2],a=[(d[0]+p[0])/2,(d[1]+p[1])/2]}else{if(!s.touch0)return;r=s.touch0[0],a=s.touch0[1]}s.zoom("touch",i(x(o,r,a),s.extent,l))}}function k(t,...o){if(this.__zooming){var r,i,a=b(this,o).event(t),s=t.changedTouches,u=s.length;for(tr(t),n&&clearTimeout(n),n=setTimeout((function(){n=null}),f),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=Ee(i,this),Math.hypot(e[0]-i[0],e[1]-i[1])<m)){var l=Pe(this).on("dblclick.zoom");l&&l.apply(this,arguments)}}}return y.transform=function(t,e,n,o){var r=t.selection?t.selection():t;r.property("__zoom",rr),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()}))},y.scaleBy=function(t,e,n,o){y.scaleTo(t,(function(){return this.__zoom.k*("function"==typeof e?e.apply(this,arguments):e)}),n,o)},y.scaleTo=function(t,e,n,o){y.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,l)}),n,o)},y.translateBy=function(t,e,n,o){y.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),l)}),null,o)},y.translateTo=function(t,e,n,o,a){y.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(Qo.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,l)}),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=Pe(this.that).datum();d.call(t,this.that,new Ko(t,{sourceEvent:this.sourceEvent,target:y,type:t,transform:this.that.__zoom,dispatch:d}),e)}},y.wheelDelta=function(t){return arguments.length?(a="function"==typeof t?t:Wo(+t),y):a},y.filter=function(t){return arguments.length?(o="function"==typeof t?t:Wo(!!t),y):o},y.touchable=function(t){return arguments.length?(s="function"==typeof t?t:Wo(!!t),y):s},y.extent=function(t){return arguments.length?(r="function"==typeof t?t:Wo([[+t[0][0],+t[0][1]],[+t[1][0],+t[1][1]]]),y):r},y.scaleExtent=function(t){return arguments.length?(u[0]=+t[0],u[1]=+t[1],y):[u[0],u[1]]},y.translateExtent=function(t){return arguments.length?(l[0][0]=+t[0][0],l[1][0]=+t[1][0],l[0][1]=+t[0][1],l[1][1]=+t[1][1],y):[[l[0][0],l[0][1]],[l[1][0],l[1][1]]]},y.constrain=function(t){return arguments.length?(i=t,y):i},y.duration=function(t){return arguments.length?(c=+t,y):c},y.interpolate=function(t){return arguments.length?(h=t,y):h},y.on=function(){var t=d.on.apply(d,arguments);return t===d?y:t},y.clickDistance=function(t){return arguments.length?(g=(t=+t)*t,y):Math.sqrt(g)},y.tapDistance=function(t){return arguments.length?(m=+t,y):m},y}Jo.prototype=Uo.prototype;const lr=(t,e)=>t.x!==e.x||t.y!==e.y||t.zoom!==e.k,cr=t=>({x:t.x,y:t.y,zoom:t.k}),hr=({x:t,y:e,zoom:n})=>Qo.translate(t,e).scale(n),dr=(t,e)=>t.target.closest(`.${e}`),fr=(t,e)=>2===e&&Array.isArray(t)&&t.includes(2),pr=(t,e=0,n=(()=>{}))=>{const o="number"==typeof e&&e>0;return o||n(),o?t.transition().duration(e).on("end",n):t},gr=t=>{const e=t.ctrlKey&&$()?10:1;return-t.deltaY*(1===t.deltaMode?.05:t.deltaMode?1:.002)*e};var mr;t.ResizeControlVariant=void 0,(mr=t.ResizeControlVariant||(t.ResizeControlVariant={})).Line="line",mr.Handle="handle";function yr(t,e){return Math.max(0,e-t)}function vr(t,e){return Math.max(0,t-e)}function xr(t,e,n){return Math.max(0,e-t,t-n)}function wr(t,e){return t?!e:e}const _r={width:0,height:0,x:0,y:0},br={..._r,pointerX:0,pointerY:0,aspectRatio:1};function Mr(t,e,n){const o=e.position.x+t.position.x,r=e.position.y+t.position.y,i=t.measured.width??0,a=t.measured.height??0,s=n[0]*i,u=n[1]*a;return[[o-s,r-u],[o+i-s,r+a-u]]}t.XYDrag=function({onNodeMouseDown:t,getStoreItems:e,onDragStart:n,onDrag:o,onDragStop:r}){let i={x:null,y:null},a=0,s=new Map,u=!1,l={x:0,y:0},c=null,h=!1,d=null,p=!1;return{update:function({noDragClassName:m,handleSelector:y,domNode:v,isSelectable:w,nodeId:b}){function M({x:t,y:n},r){const{nodeLookup:a,nodeExtent:u,snapGrid:l,snapToGrid:c,nodeOrigin:h,onNodeDrag:d,onSelectionDrag:p,onError:m,updateNodePositions:y}=e();i={x:t,y:n};let v=!1,x={x:0,y:0,x2:0,y2:0};if(s.size>1&&u){const t=f(s);x=_(t)}for(const[e,o]of s){let r={x:t-o.distance.x,y:n-o.distance.y};c&&(r=k(r,l));let i=[[u[0][0],u[0][1]],[u[1][0],u[1][1]]];if(s.size>1&&u&&!o.extent){const{positionAbsolute:t}=o.internals,e=t.x-x.x+u[0][0],n=t.x+o.measured.width-x.x2+u[1][0];i=[[e,t.y-x.y+u[0][1]],[n,t.y+o.measured.height-x.y2+u[1][1]]]}const{position:d,positionAbsolute:f}=g({nodeId:e,nextPosition:r,nodeLookup:a,nodeExtent:i,nodeOrigin:h,onError:m});v=v||o.position.x!==d.x||o.position.y!==d.y,o.position=d,o.internals.positionAbsolute=f}if(v&&(y(s,!0),r&&(o||d||!b&&p))){const[t,e]=De({nodeId:b,dragItems:s,nodeLookup:a});o?.(r,s,t,e),d?.(r,t,e),b||p?.(r,e)}}async function P(){if(!c)return;const{transform:t,panBy:n,autoPanSpeed:o}=e(),[r,s]=x(l,c,o);0===r&&0===s||(i.x=(i.x??0)-r/t[2],i.y=(i.y??0)-s/t[2],await n({x:r,y:s})&&M(i,null)),a=requestAnimationFrame(P)}function E(o){const{nodeLookup:r,multiSelectionActive:a,nodesDraggable:u,transform:l,snapGrid:c,snapToGrid:d,selectNodesOnDrag:f,onNodeDragStart:p,onSelectionDragStart:g,unselectNodesAndEdges:m}=e();h=!0,f&&w||a||!b||r.get(b)?.selected||m(),w&&f&&b&&t?.(b);const y=O(o.sourceEvent,{transform:l,snapGrid:c,snapToGrid:d});if(i=y,s=function(t,e,n,o){const r=new Map;for(const[i,a]of t)if((a.selected||a.id===o)&&(!a.parentId||!Be(a,t))&&(a.draggable||e&&void 0===a.draggable)){const e=t.get(i);e&&r.set(i,{id:i,position:e.position||{x:0,y:0},distance:{x:n.x-e.internals.positionAbsolute.x,y:n.y-e.internals.positionAbsolute.y},extent:e.extent,parentId:e.parentId,origin:e.origin,expandParent:e.expandParent,internals:{positionAbsolute:e.internals.positionAbsolute||{x:0,y:0}},measured:{width:e.measured.width??0,height:e.measured.height??0}})}return r}(r,u,y,b),s.size>0&&(n||p||!b&&g)){const[t,e]=De({nodeId:b,dragItems:s,nodeLookup:r});n?.(o.sourceEvent,s,t,e),p?.(o.sourceEvent,t,e),b||g?.(o.sourceEvent,e)}}d=Pe(v);const S=Ye().on("start",(t=>{const{domNode:n,nodeDragThreshold:o,transform:r,snapGrid:a,snapToGrid:s}=e();p=!1,0===o&&E(t);const u=O(t.sourceEvent,{transform:r,snapGrid:a,snapToGrid:s});i=u,c=n?.getBoundingClientRect()||null,l=D(t.sourceEvent,c)})).on("drag",(t=>{const{autoPanOnNodeDrag:n,transform:o,snapGrid:r,snapToGrid:a,nodeDragThreshold:d}=e(),f=O(t.sourceEvent,{transform:o,snapGrid:r,snapToGrid:a});if("touchmove"===t.sourceEvent.type&&t.sourceEvent.touches.length>1&&(p=!0),!p){if(!u&&n&&h&&(u=!0,P()),!h){const e=f.xSnapped-(i.x??0),n=f.ySnapped-(i.y??0);Math.sqrt(e*e+n*n)>d&&E(t)}(i.x!==f.xSnapped||i.y!==f.ySnapped)&&s&&h&&(l=D(t.sourceEvent,c),M(f,t.sourceEvent))}})).on("end",(t=>{if(h&&!p&&(u=!1,h=!1,cancelAnimationFrame(a),s.size>0)){const{nodeLookup:n,updateNodePositions:o,onNodeDragStop:i,onSelectionDragStop:a}=e();if(o(s,!1),r||i||!b&&a){const[e,o]=De({nodeId:b,dragItems:s,nodeLookup:n,dragging:!1});r?.(t.sourceEvent,s,e,o),i?.(t.sourceEvent,e,o),b||a?.(t.sourceEvent,o)}}})).filter((t=>{const e=t.target;return!t.button&&(!m||!Re(e,`.${m}`,v))&&(!y||Re(e,y,v))}));d.call(S)},destroy:function(){d?.on(".drag",null)}}},t.XYHandle=Ge,t.XYMinimap=function({domNode:t,panZoom:e,getTransform:n,getViewScale:o}){const r=Pe(t);return{update:function({translateExtent:t,width:i,height:a,zoomStep:s=10,pannable:u=!0,zoomable:l=!0,inversePan:c=!1}){let h=[0,0];const d=ur().on("start",(t=>{"mousedown"!==t.sourceEvent.type&&"touchstart"!==t.sourceEvent.type||(h=[t.sourceEvent.clientX??t.sourceEvent.touches[0].clientX,t.sourceEvent.clientY??t.sourceEvent.touches[0].clientY])})).on("zoom",u?r=>{const s=n();if("mousemove"!==r.sourceEvent.type&&"touchmove"!==r.sourceEvent.type||!e)return;const u=[r.sourceEvent.clientX??r.sourceEvent.touches[0].clientX,r.sourceEvent.clientY??r.sourceEvent.touches[0].clientY],l=[u[0]-h[0],u[1]-h[1]];h=u;const d=o()*Math.max(s[2],Math.log(s[2]))*(c?-1:1),f={x:s[0]-l[0]*d,y:s[1]-l[1]*d},p=[[0,0],[i,a]];e.setViewportConstrained({x:f.x,y:f.y,zoom:s[2]},p,t)}:null).on("zoom.wheel",l?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(d,{})},destroy:function(){r.on("zoom",null)},pointer:Ee}},t.XYPanZoom=function({domNode:e,minZoom:n,maxZoom:o,paneClickDistance:r,translateExtent:i,viewport:a,onPanZoom:s,onPanZoomStart:u,onPanZoomEnd:l,onTransformChange:c,onDraggingChange:h}){const d={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{x:0,y:0,zoom:0},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},f=e.getBoundingClientRect(),p=ur().clickDistance(!z(r)||r<0?0:r).scaleExtent([n,o]).translateExtent(i),g=Pe(e).call(p);_({x:a.x,y:a.y,zoom:m(a.zoom,n,o)},[[0,0],[f.width,f.height]],i);const y=g.on("wheel.zoom"),v=g.on("dblclick.zoom");function x(t,e){return g?new Promise((n=>{p?.transform(pr(g,e?.duration,(()=>n(!0))),t)})):Promise.resolve(!1)}function w(){p.on("zoom",null)}async function _(t,e,n){const o=hr(t),r=p?.constrain()(o,e,n);return r&&await x(r),new Promise((t=>t(r)))}return p.wheelDelta(gr),{update:function({noWheelClassName:e,noPanClassName:n,onPaneContextMenu:o,userSelectionActive:r,panOnScroll:i,panOnDrag:a,panOnScrollMode:f,panOnScrollSpeed:m,preventScrolling:x,zoomOnPinch:_,zoomOnScroll:b,zoomOnDoubleClick:M,zoomActivationKeyPressed:P,lib:E}){r&&!d.isZoomingOrPanning&&w();const S=i&&!P&&!r?function({zoomPanValues:e,noWheelClassName:n,d3Selection:o,d3Zoom:r,panOnScrollMode:i,panOnScrollSpeed:a,zoomOnPinch:s,onPanZoomStart:u,onPanZoom:l,onPanZoomEnd:c}){return h=>{if(dr(h,n))return!1;h.preventDefault(),h.stopImmediatePropagation();const d=o.property("__zoom").k||1;if(h.ctrlKey&&s){const t=Ee(h),e=gr(h),n=d*Math.pow(2,e);return void r.scaleTo(o,n,t,h)}const f=1===h.deltaMode?20:1;let p=i===t.PanOnScrollMode.Vertical?0:h.deltaX*f,g=i===t.PanOnScrollMode.Horizontal?0:h.deltaY*f;!$()&&h.shiftKey&&i!==t.PanOnScrollMode.Vertical&&(p=h.deltaY*f,g=0),r.translateBy(o,-p/d*a,-g/d*a,{internal:!0});const m=cr(o.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling||(e.isPanScrolling=!0,u?.(h,m)),e.isPanScrolling&&(l?.(h,m),e.panScrollTimeout=setTimeout((()=>{c?.(h,m),e.isPanScrolling=!1}),150))}}({zoomPanValues:d,noWheelClassName:e,d3Selection:g,d3Zoom:p,panOnScrollMode:f,panOnScrollSpeed:m,zoomOnPinch:_,onPanZoomStart:u,onPanZoom:s,onPanZoomEnd:l}):function({noWheelClassName:t,preventScrolling:e,d3ZoomHandler:n}){return function(o,r){if(!e&&"wheel"===o.type&&!o.ctrlKey||dr(o,t))return null;o.preventDefault(),n.call(this,o,r)}}({noWheelClassName:e,preventScrolling:x,d3ZoomHandler:y});if(g.on("wheel.zoom",S,{passive:!1}),!r){const t=function({zoomPanValues:t,onDraggingChange:e,onPanZoomStart:n}){return o=>{if(o.sourceEvent?.internal)return;const r=cr(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:d,onDraggingChange:h,onPanZoomStart:u});p.on("start",t);const e=function({zoomPanValues:t,panOnDrag:e,onPaneContextMenu:n,onTransformChange:o,onPanZoom:r}){return i=>{t.usedRightMouseButton=!(!n||!fr(e,t.mouseButton??0)),i.sourceEvent?.sync||o([i.transform.x,i.transform.y,i.transform.k]),r&&!i.sourceEvent?.internal&&r?.(i.sourceEvent,cr(i.transform))}}({zoomPanValues:d,panOnDrag:a,onPaneContextMenu:!!o,onPanZoom:s,onTransformChange:c});p.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&&fr(e,t.mouseButton??0)&&!t.usedRightMouseButton&&a.sourceEvent&&i(a.sourceEvent),t.usedRightMouseButton=!1,o(!1),r&&lr(t.prevViewport,a.transform))){const e=cr(a.transform);t.prevViewport=e,clearTimeout(t.timerId),t.timerId=setTimeout((()=>{r?.(a.sourceEvent,e)}),n?150:0)}}}({zoomPanValues:d,panOnDrag:a,panOnScroll:i,onPaneContextMenu:o,onPanZoomEnd:l,onDraggingChange:h});p.on("end",n)}const z=function({zoomActivationKeyPressed:t,zoomOnScroll:e,zoomOnPinch:n,panOnDrag:o,panOnScroll:r,zoomOnDoubleClick:i,userSelectionActive:a,noWheelClassName:s,noPanClassName:u,lib:l}){return c=>{const h=t||e,d=n&&c.ctrlKey;if(1===c.button&&"mousedown"===c.type&&(dr(c,`${l}-flow__node`)||dr(c,`${l}-flow__edge`)))return!0;if(!(o||h||r||i||n))return!1;if(a)return!1;if(dr(c,s)&&"wheel"===c.type)return!1;if(dr(c,u)&&("wheel"!==c.type||r&&"wheel"===c.type&&!t))return!1;if(!n&&c.ctrlKey&&"wheel"===c.type)return!1;if(!n&&"touchstart"===c.type&&c.touches?.length>1)return c.preventDefault(),!1;if(!h&&!r&&!d&&"wheel"===c.type)return!1;if(!o&&("mousedown"===c.type||"touchstart"===c.type))return!1;if(Array.isArray(o)&&!o.includes(c.button)&&"mousedown"===c.type)return!1;const f=Array.isArray(o)&&o.includes(c.button)||!c.button||c.button<=1;return(!c.ctrlKey||"wheel"===c.type)&&f}}({zoomActivationKeyPressed:P,panOnDrag:a,zoomOnScroll:b,panOnScroll:i,zoomOnDoubleClick:M,zoomOnPinch:_,userSelectionActive:r,noPanClassName:n,noWheelClassName:e,lib:E});p.filter(z),M?g.on("dblclick.zoom",v):g.on("dblclick.zoom",null)},destroy:w,setViewport:async function(t,e){const n=hr(t);return await x(n,e),new Promise((t=>t(n)))},setViewportConstrained:_,getViewport:function(){const t=g?Jo(g.node()):{x:0,y:0,k:1};return{x:t.x,y:t.y,zoom:t.k}},scaleTo:function(t,e){return g?new Promise((n=>{p?.scaleTo(pr(g,e?.duration,(()=>n(!0))),t)})):Promise.resolve(!1)},scaleBy:function(t,e){return g?new Promise((n=>{p?.scaleBy(pr(g,e?.duration,(()=>n(!0))),t)})):Promise.resolve(!1)},setScaleExtent:function(t){p?.scaleExtent(t)},setTranslateExtent:function(t){p?.translateExtent(t)},syncViewport:function(t){if(g){const e=hr(t),n=g.property("__zoom");n.k===t.zoom&&n.x===t.x&&n.y===t.y||p?.transform(g,e,null,{sync:!0})}},setClickDistance:function(t){const e=!z(t)||t<0?0:t;p?.clickDistance(e)}}},t.XYResizer=function({domNode:t,nodeId:e,getStoreItems:n,onChange:o,onEnd:r}){const i=Pe(t);return{update:function({controlPosition:t,boundaries:a,keepAspectRatio:s,onResizeStart:u,onResize:l,onResizeEnd:c,shouldResize:h}){let d={..._r},f={...br};const p=function(t){return{isHorizontal:t.includes("right")||t.includes("left"),isVertical:t.includes("bottom")||t.includes("top"),affectsX:t.includes("left"),affectsY:t.includes("top")}}(t);let g,m,y,v,x=[];const w=Ye().on("start",(t=>{const{nodeLookup:o,transform:r,snapGrid:i,snapToGrid:a,nodeOrigin:s}=n();if(g=o.get(e),!g)return;const{xSnapped:l,ySnapped:c}=O(t.sourceEvent,{transform:r,snapGrid:i,snapToGrid:a});d={width:g.measured.width??0,height:g.measured.height??0,x:g.position.x??0,y:g.position.y??0},f={...d,pointerX:l,pointerY:c,aspectRatio:d.width/d.height},m=void 0,g.parentId&&("parent"===g.extent||g.expandParent)&&(m=o.get(g.parentId),y=m&&"parent"===g.extent?function(t){return[[0,0],[t.measured.width,t.measured.height]]}(m):void 0),x=[],v=void 0;for(const[t,n]of o)if(n.parentId===e&&(x.push({id:t,position:{...n.position},extent:n.extent}),"parent"===n.extent||n.expandParent)){const t=Mr(n,g,n.origin??s);v=v?[[Math.min(t[0][0],v[0][0]),Math.min(t[0][1],v[0][1])],[Math.max(t[1][0],v[1][0]),Math.max(t[1][1],v[1][1])]]:t}u?.(t,{...d})})).on("drag",(t=>{const{transform:e,snapGrid:r,snapToGrid:i,nodeOrigin:u}=n(),c=O(t.sourceEvent,{transform:e,snapGrid:r,snapToGrid:i}),w=[];if(!g)return;const{x:_,y:b,width:M,height:P}=d,E={},S=g.origin??u,{width:z,height:N,x:k,y:T}=function(t,e,n,o,r,i,a,s){let{affectsX:u,affectsY:l}=e;const{isHorizontal:c,isVertical:h}=e,d=c&&h,{xSnapped:f,ySnapped:p}=n,{minWidth:g,maxWidth:m,minHeight:y,maxHeight:v}=o,{x:x,y:w,width:_,height:b,aspectRatio:M}=t;let P=Math.floor(c?f-t.pointerX:0),E=Math.floor(h?p-t.pointerY:0);const S=_+(u?-P:P),z=b+(l?-E:E),N=-i[0]*_,k=-i[1]*b;let T=xr(S,g,m),A=xr(z,y,v);if(a){let t=0,e=0;u&&P<0?t=yr(x+P+N,a[0][0]):!u&&P>0&&(t=vr(x+S+N,a[1][0])),l&&E<0?e=yr(w+E+k,a[0][1]):!l&&E>0&&(e=vr(w+z+k,a[1][1])),T=Math.max(T,t),A=Math.max(A,e)}if(s){let t=0,e=0;u&&P>0?t=vr(x+P,s[0][0]):!u&&P<0&&(t=yr(x+S,s[1][0])),l&&E>0?e=vr(w+E,s[0][1]):!l&&E<0&&(e=yr(w+z,s[1][1])),T=Math.max(T,t),A=Math.max(A,e)}if(r){if(c){const t=xr(S/M,y,v)*M;if(T=Math.max(T,t),a){let t=0;t=!u&&!l||u&&!l&&d?vr(w+k+S/M,a[1][1])*M:yr(w+k+(u?P:-P)/M,a[0][1])*M,T=Math.max(T,t)}if(s){let t=0;t=!u&&!l||u&&!l&&d?yr(w+S/M,s[1][1])*M:vr(w+(u?P:-P)/M,s[0][1])*M,T=Math.max(T,t)}}if(h){const t=xr(z*M,g,m)/M;if(A=Math.max(A,t),a){let t=0;t=!u&&!l||l&&!u&&d?vr(x+z*M+N,a[1][0])/M:yr(x+(l?E:-E)*M+N,a[0][0])/M,A=Math.max(A,t)}if(s){let t=0;t=!u&&!l||l&&!u&&d?yr(x+z*M,s[1][0])/M:vr(x+(l?E:-E)*M,s[0][0])/M,A=Math.max(A,t)}}}E+=E<0?A:-A,P+=P<0?T:-T,r&&(d?S>z*M?E=(wr(u,l)?-P:P)/M:P=(wr(u,l)?-E:E)*M:c?(E=P/M,l=u):(P=E*M,u=l));const I=u?x+P:x,$=l?w+E:w;return{width:_+(u?-P:P),height:b+(l?-E:E),x:i[0]*P*(u?-1:1)+I,y:i[1]*E*(l?-1:1)+$}}(f,p,c,a,s,S,y,v),A=z!==M,I=N!==P,$=k!==_&&A,C=T!==b&&I;if(!($||C||A||I))return;if(($||C||1===S[0]||1===S[1])&&(E.x=$?k:d.x,E.y=C?T:d.y,d.x=E.x,d.y=E.y,x.length>0)){const t=k-_,e=T-b;for(const n of x)n.position={x:n.position.x-t+S[0]*(z-M),y:n.position.y-e+S[1]*(N-P)},w.push(n)}if((A||I)&&(E.width=A?z:d.width,E.height=I?N:d.height,d.width=E.width,d.height=E.height),m&&g.expandParent){const t=S[0]*(E.width??0);E.x&&E.x<t&&(d.x=t,f.x=f.x-(E.x-t));const e=S[1]*(E.height??0);E.y&&E.y<e&&(d.y=e,f.y=f.y-(E.y-e))}const H=function({width:t,prevWidth:e,height:n,prevHeight:o,affectsX:r,affectsY:i}){const a=t-e,s=n-o,u=[a>0?1:a<0?-1:0,s>0?1:s<0?-1:0];return a&&r&&(u[0]=-1*u[0]),s&&i&&(u[1]=-1*u[1]),u}({width:d.width,prevWidth:M,height:d.height,prevHeight:P,affectsX:p.affectsX,affectsY:p.affectsY}),X={...d,direction:H},Y=h?.(t,X);!1!==Y&&(l?.(t,X),o(E,w))})).on("end",(t=>{c?.(t,{...d}),r?.()}));i.call(w)},destroy:function(){i.on(".drag",null)}}},t.XY_RESIZER_HANDLE_POSITIONS=["top-left","top-right","bottom-left","bottom-right"],t.XY_RESIZER_LINE_POSITIONS=["top","right","bottom","left"],t.addEdge=(t,n)=>{if(!t.source||!t.target)return e.error006(),n;let o;return o=c(t)?{...t}:{...t,id:j(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:(null===o.sourceHandle&&delete o.sourceHandle,null===o.targetHandle&&delete o.targetHandle,n.concat(o))},t.adoptUserNodes=function(t,e,n,o){const r={...ot,...o},i=new Map(e);e.clear(),n.clear();const a=o?.elevateNodesOnSelect?1e3:0;for(const s of t){let t=i.get(s.id);r.checkEquality&&s===t?.internals.userNode||(t={...r.defaults,...s,measured:{width:s.measured?.width,height:s.measured?.height},internals:{positionAbsolute:d(s,r.nodeOrigin),handleBounds:t?.internals.handleBounds,z:it(s,a),userNode:s}}),e.set(s.id,t),s.parentId&&rt(t,e,n,o)}},t.areConnectionMapsEqual=function(t,e){if(!t&&!e)return!0;if(!t||!e||t.size!==e.size)return!1;if(!t.size&&!e.size)return!0;for(const n of t.keys())if(!e.has(n))return!1;return!0},t.boxToRect=b,t.calcAutoPan=x,t.calculateNodePosition=g,t.clamp=m,t.clampPosition=y,t.createMarkerIds=function(t,{id:e,defaultColor:n,defaultMarkerStart:o,defaultMarkerEnd:r}){const i=new Set;return t.reduce(((t,a)=>([a.markerStart||o,a.markerEnd||r].forEach((o=>{if(o&&"object"==typeof o){const r=et(o,e);i.has(r)||(t.push({id:r,color:o.color||n,...o}),i.add(r))}})),t)),[]).sort(((t,e)=>t.id.localeCompare(e.id)))},t.devWarn=N,t.elementSelectionKeys=["Enter"," ","Escape"],t.errorMessages=e,t.evaluateAbsolutePosition=function(t,e={width:0,height:0},n,o,r){let i=n;const a={...t};for(;i;){const t=o.get(i);if(i=t?.parentId,t){const n=t.origin||r;a.x+=t.internals.positionAbsolute.x-(e.width??0)*n[0],a.y+=t.internals.positionAbsolute.y-(e.height??0)*n[1]}}return a},t.fitView=async function({nodes:t,width:e,height:n,panZoom:o,minZoom:r,maxZoom:i},a){if(0===t.size)return Promise.resolve(!1);const s=f(t),u=I(s,e,n,a?.minZoom??r,a?.maxZoom??i,a?.padding??.1);return await o.setViewport(u,{duration:a?.duration}),Promise.resolve(!0)},t.getBezierEdgeCenter=V,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,l]=Z({pos:o,x1:e,y1:n,x2:r,y2:i,c:s}),[c,h]=Z({pos:a,x1:r,y1:i,x2:e,y2:n,c:s}),[d,f,p,g]=V({sourceX:e,sourceY:n,targetX:r,targetY:i,sourceControlX:u,sourceControlY:l,targetControlX:c,targetControlY:h});return[`M${e},${n} C${u},${l} ${c},${h} ${r},${i}`,d,f,p,g]},t.getBoundsOfBoxes=w,t.getBoundsOfRects=E,t.getConnectedEdges=p,t.getConnectionStatus=function(t){return null===t?null:t?"valid":"invalid"},t.getDimensions=X,t.getEdgeCenter=G,t.getEdgePosition=function(n){const{sourceNode:o,targetNode:r}=n;if(!U(o)||!U(r))return null;const i=o.internals.handleBounds||Q(o.handles),a=r.internals.handleBounds||Q(r.handles),s=tt(i?.source??[],n.sourceHandle),u=tt(n.connectionMode===t.ConnectionMode.Strict?a?.target??[]:(a?.target??[]).concat(a?.source??[]),n.targetHandle);if(!s||!u)return n.onError?.("008",e.error008(s?"target":"source",{id:n.id,sourceHandle:n.sourceHandle,targetHandle:n.targetHandle})),null;const l=s?.position||t.Position.Bottom,c=u?.position||t.Position.Top,h=J(o,s,l),d=J(r,u,c);return{sourceX:h.x,sourceY:h.y,targetX:d.x,targetY:d.y,sourcePosition:l,targetPosition:c}},t.getElementsToRemove=async function({nodesToRemove:t=[],edgesToRemove:e=[],nodes:n,edges:o,onBeforeDelete:r}){const i=new Set(t.map((t=>t.id))),a=[];for(const t of n){if(!1===t.deletable)continue;const e=i.has(t.id),n=!e&&t.parentId&&a.find((e=>e.id===t.parentId));(e||n)&&a.push(t)}const s=new Set(e.map((t=>t.id))),u=o.filter((t=>!1!==t.deletable)),l=p(a,u);for(const t of u){s.has(t.id)&&!l.find((e=>e.id===t.id))&&l.push(t)}if(!r)return{edges:l,nodes:a};const c=await r({nodes:a,edges:l});return"boolean"==typeof c?c?{edges:l,nodes:a}:{edges:[],nodes:[]}:c},t.getElevatedEdgeZIndex=function({sourceNode:t,targetNode:e,selected:n=!1,zIndex:o=0,elevateOnSelect:r=!1}){if(!r)return o;const i=n||e.selected||t.selected,a=Math.max(t.internals.z||0,e.internals.z||0,1e3);return o+(i?a:0)},t.getEventPosition=D,t.getFitViewNodes=function(t,e){const n=new Map,o=e?.nodes?new Set(e.nodes.map((t=>t.id))):null;return t.forEach((t=>{!(t.measured.width&&t.measured.height&&(e?.includeHiddenNodes||!t.hidden))||o&&!o.has(t.id)||n.set(t.id,t)})),n},t.getHandleBounds=L,t.getHandlePosition=J,t.getHostForElement=Y,t.getIncomers=(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.getInternalNodesBounds=f,t.getMarkerId=et,t.getNodeDimensions=H,t.getNodePositionWithOrigin=d,t.getNodeToolbarTransform=function(e,n,o,r,i){let a=.5;"start"===i?a=0:"end"===i&&(a=1);let s=[(e.x+e.width*a)*n.zoom+n.x,e.y*n.zoom+n.y-r],u=[-100*a,-100];switch(o){case t.Position.Right:s=[(e.x+e.width)*n.zoom+n.x+r,(e.y+e.height*a)*n.zoom+n.y],u=[0,-100*a];break;case t.Position.Bottom:s[1]=(e.y+e.height)*n.zoom+n.y+r,u[1]=0;break;case t.Position.Left:s=[e.x*n.zoom+n.x-r,(e.y+e.height*a)*n.zoom+n.y],u=[-100,-100*a]}return`translate(${s[0]}px, ${s[1]}px) translate(${u[0]}%, ${u[1]}%)`},t.getNodesBounds=(t,e={nodeOrigin:[0,0]})=>{if(0===t.length)return{x:0,y:0,width:0,height:0};const n=t.reduce(((t,n)=>{const o=P(n,e.nodeOrigin);return w(t,o)}),{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return b(n)},t.getNodesInside=(t,e,[n,o,r]=[0,0,1],i=!1,a=!1)=>{const s={...T(e,[n,o,r]),width:e.width/r,height:e.height/r},u=[];for(const[,e]of t){const{measured:t,selectable:n=!0,hidden:o=!1}=e,r=t.width??e.width??e.initialWidth??null,l=t.height??e.height??e.initialHeight??null;if(a&&!n||o)continue;const c=S(s,M(e));(null===r||null===l||i&&c>0||c>=(r??0)*(l??0)||e.dragging)&&u.push(e)}return u},t.getOutgoers=(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=S,t.getPointerPosition=O,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:l,offset:c=20}){const[h,d,f,p,g]=function({source:e,sourcePosition:n=t.Position.Bottom,target:o,targetPosition:r=t.Position.Top,center:i,offset:a}){const s=F[n],u=F[r],l={x:e.x+s.x*a,y:e.y+s.y*a},c={x:o.x+u.x*a,y:o.y+u.y*a},h=W({source:l,sourcePosition:n,target:c}),d=0!==h.x?"x":"y",f=h[d];let p,g,m=[];const y={x:0,y:0},v={x:0,y:0},[x,w,_,b]=G({sourceX:e.x,sourceY:e.y,targetX:o.x,targetY:o.y});if(s[d]*u[d]==-1){p=i.x??x,g=i.y??w;const t=[{x:p,y:l.y},{x:p,y:c.y}],e=[{x:l.x,y:g},{x:c.x,y:g}];m=s[d]===f?"x"===d?t:e:"x"===d?e:t}else{const t=[{x:l.x,y:c.y}],i=[{x:c.x,y:l.y}];if(m="x"===d?s.x===f?i:t:s.y===f?t:i,n===r){const t=Math.abs(e[d]-o[d]);if(t<=a){const n=Math.min(a-1,a-t);s[d]===f?y[d]=(l[d]>e[d]?-1:1)*n:v[d]=(c[d]>o[d]?-1:1)*n}}if(n!==r){const e="x"===d?"y":"x",n=s[d]===u[e],o=l[e]>c[e],r=l[e]<c[e];(1===s[d]&&(!n&&o||n&&r)||1!==s[d]&&(!n&&r||n&&o))&&(m="x"===d?t:i)}const h={x:l.x+y.x,y:l.y+y.y},x={x:c.x+v.x,y:c.y+v.y};Math.max(Math.abs(h.x-m[0].x),Math.abs(x.x-m[0].x))>=Math.max(Math.abs(h.y-m[0].y),Math.abs(x.y-m[0].y))?(p=(h.x+x.x)/2,g=m[0].y):(p=m[0].x,g=(h.y+x.y)/2)}return[[e,{x:l.x+y.x,y:l.y+y.y},...m,{x:c.x+v.x,y:c.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:l},offset:c});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(K(t,e)/2,K(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}),""),d,f,p,g]},t.getStraightPath=function({sourceX:t,sourceY:e,targetX:n,targetY:o}){const[r,i,a,s]=G({sourceX:t,sourceY:e,targetX:n,targetY:o});return[`M ${t},${e}L ${n},${o}`,r,i,a,s]},t.getViewportForBounds=I,t.handleConnectionChange=function(t,e,n){if(!n)return;const o=[];t.forEach(((t,n)=>{e?.has(n)||o.push(t)})),o.length&&n(o)},t.handleExpandParent=at,t.infiniteExtent=n,t.initialConnection={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null},t.isCoordinateExtent=C,t.isEdgeBase=c,t.isEdgeVisible=function({sourceNode:t,targetNode:e,width:n,height:o,transform:r}){const i=w(P(t),P(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 S(a,b(i))>0},t.isInputDOMNode=function(t){const e=t.composedPath?.()?.[0]||t.target;return B.includes(e?.nodeName)||e?.hasAttribute("contenteditable")||!!e?.closest(".nokey")},t.isInternalNodeBase=h,t.isMacOs=$,t.isMouseEvent=R,t.isNodeBase=t=>"id"in t&&"position"in t&&!("source"in t)&&!("target"in t),t.isNumeric=z,t.isRectObject=t=>z(t.width)&&z(t.height)&&z(t.x)&&z(t.y),t.nodeHasDimensions=function(t){return void 0!==(t.measured?.width??t.width??t.initialWidth)&&void 0!==(t.measured?.height??t.height??t.initialHeight)},t.nodeToBox=P,t.nodeToRect=M,t.oppositePosition=l,t.panBy=async function({delta:t,panZoom:e,transform:n,translateExtent:o,width:r,height:i}){if(!e||!t.x&&!t.y)return Promise.resolve(!1);const a=await e.setViewportConstrained({x:n[0]+t.x,y:n[1]+t.y,zoom:n[2]},[[0,0],[r,i]],o),s=!!a&&(a.x!==n[0]||a.y!==n[1]||a.k!==n[2]);return Promise.resolve(s)},t.pointToRendererPoint=T,t.reconnectEdge=(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?j(n):i,source:n.source,target:n.target,sourceHandle:n.sourceHandle,targetHandle:n.targetHandle};return o.filter((t=>t.id!==i)).concat(s)},t.rectToBox=_,t.rendererPointToPoint=A,t.shallowNodeData=function(t,e){if(null===t||null===e)return!1;const n=Array.isArray(t)?t:[t],o=Array.isArray(e)?e:[e];if(n.length!==o.length)return!1;for(let t=0;t<n.length;t++)if(n[t].id!==o[t].id||n[t].type!==o[t].type||!Object.is(n[t].data,o[t].data))return!1;return!0},t.snapPosition=k,t.updateAbsolutePositions=function(t,e,n){const o={...nt,...n};for(const n of t.values())n.parentId&&rt(n,t,e,o)},t.updateConnectionLookup=function(t,e,n){t.clear(),e.clear();for(const o of n){const{source:n,target:r,sourceHandle:i=null,targetHandle:a=null}=o,s=`${n}-source-${i}`,u=`${r}-target-${a}`,l=t.get(s)||new Map,c=t.get(u)||new Map,h={edgeId:o.id,source:n,target:r,sourceHandle:i,targetHandle:a};e.set(o.id,o),t.set(s,l.set(`${r}-${a}`,h)),t.set(u,c.set(`${n}-${i}`,h))}},t.updateNodeInternals=function(t,e,n,o,r){const i=o?.querySelector(".xyflow__viewport");let a=!1;if(!i)return{changes:[],updatedInternals:a};const s=[],u=window.getComputedStyle(i),{m22:l}=new window.DOMMatrixReadOnly(u.transform),c=[];for(const o of t.values()){const t=e.get(o.id);if(t)if(t.hidden)t.internals={...t.internals,handleBounds:void 0},a=!0;else{const i=X(o.nodeElement),u=t.measured.width!==i.width||t.measured.height!==i.height;if(!(!i.width||!i.height||!u&&t.internals.handleBounds&&!o.force)){const h=o.nodeElement.getBoundingClientRect();t.measured=i,t.internals={...t.internals,positionAbsolute:d(t,r),handleBounds:{source:L("source",o.nodeElement,h,l,t.id),target:L("target",o.nodeElement,h,l,t.id)}},t.parentId&&rt(t,e,n,{nodeOrigin:r}),a=!0,u&&(s.push({id:t.id,type:"dimensions",dimensions:i}),t.expandParent&&t.parentId&&c.push({id:t.id,parentId:t.parentId,rect:M(t,r)}))}}}if(c.length>0){const t=at(c,e,n,r);s.push(...t)}return{changes:s,updatedInternals:a}}}));
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.`,error013:(t="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${t}/dist/style.css' or base.css to make sure everything is working properly.`},n=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]];var o,r,i;t.ConnectionMode=void 0,(o=t.ConnectionMode||(t.ConnectionMode={})).Strict="strict",o.Loose="loose",t.PanOnScrollMode=void 0,(r=t.PanOnScrollMode||(t.PanOnScrollMode={})).Free="free",r.Vertical="vertical",r.Horizontal="horizontal",t.SelectionMode=void 0,(i=t.SelectionMode||(t.SelectionMode={})).Partial="partial",i.Full="full";var a,s,u;t.ConnectionLineType=void 0,(a=t.ConnectionLineType||(t.ConnectionLineType={})).Bezier="default",a.Straight="straight",a.Step="step",a.SmoothStep="smoothstep",a.SimpleBezier="simplebezier",t.MarkerType=void 0,(s=t.MarkerType||(t.MarkerType={})).Arrow="arrow",s.ArrowClosed="arrowclosed",t.Position=void 0,(u=t.Position||(t.Position={})).Left="left",u.Top="top",u.Right="right",u.Bottom="bottom";const l={[t.Position.Left]:t.Position.Right,[t.Position.Right]:t.Position.Left,[t.Position.Top]:t.Position.Bottom,[t.Position.Bottom]:t.Position.Top};const c=t=>"id"in t&&"source"in t&&"target"in t,h=t=>"id"in t&&"internals"in t&&!("source"in t)&&!("target"in t),d=(t,e=[0,0])=>{const{width:n,height:o}=H(t),r=t.origin??e,i=n*r[0],a=o*r[1];return{x:t.position.x-i,y:t.position.y-a}},f=(t,e={})=>{if(0===t.size)return{x:0,y:0,width:0,height:0};let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0};return t.forEach((t=>{if(void 0===e.filter||e.filter(t)){const e=P(t);n=w(n,e)}})),b(n)},p=(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 g({nodeId:t,nextPosition:n,nodeLookup:o,nodeOrigin:r=[0,0],nodeExtent:i,onError:a}){const s=o.get(t),u=s.parentId?o.get(s.parentId):void 0,{x:l,y:c}=u?u.internals.positionAbsolute:{x:0,y:0},h=s.origin??r;let d=function(t,e){return e&&"parent"!==e?[e[0],[e[1][0]-(t.measured?.width??0),e[1][1]-(t.measured?.height??0)]]:e}(s,s.extent||i);if("parent"!==s.extent||s.expandParent)u&&C(s.extent)&&(d=[[s.extent[0][0]+l,s.extent[0][1]+c],[s.extent[1][0]+l,s.extent[1][1]+c]]);else if(u){const t=s.measured.width,e=s.measured.height,n=u.measured.width,o=u.measured.height;t&&e&&n&&o&&(d=[[l,c],[l+n-t,c+o-e]])}else a?.("005",e.error005());const f=C(d)?y(n,d):n;return{position:{x:f.x-l+s.measured.width*h[0],y:f.y-c+s.measured.height*h[1]},positionAbsolute:f}}const m=(t,e=0,n=1)=>Math.min(Math.max(t,e),n),y=(t={x:0,y:0},e)=>({x:m(t.x,e[0][0],e[1][0]),y:m(t.y,e[0][1],e[1][1])}),v=(t,e,n)=>t<e?m(Math.abs(t-e),1,e)/e:t>n?-m(Math.abs(t-n),1,e)/e:0,x=(t,e,n=15,o=40)=>[v(t.x,o,e.width-o)*n,v(t.y,o,e.height-o)*n],w=(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)}),_=({x:t,y:e,width:n,height:o})=>({x:t,y:e,x2:t+n,y2:e+o}),b=({x:t,y:e,x2:n,y2:o})=>({x:t,y:e,width:n-t,height:o-e}),M=(t,e=[0,0])=>{const{x:n,y:o}=h(t)?t.internals.positionAbsolute:d(t,e);return{x:n,y:o,width:t.measured?.width??t.width??t.initialWidth??0,height:t.measured?.height??t.height??t.initialHeight??0}},P=(t,e=[0,0])=>{const{x:n,y:o}=h(t)?t.internals.positionAbsolute:d(t,e);return{x:n,y:o,x2:n+(t.measured?.width??t.width??t.initialWidth??0),y2:o+(t.measured?.height??t.height??t.initialHeight??0)}},E=(t,e)=>b(w(_(t),_(e))),S=(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)},z=t=>!isNaN(t)&&isFinite(t),k=(t,e)=>{},N=(t,e=[1,1])=>({x:e[0]*Math.round(t.x/e[0]),y:e[1]*Math.round(t.y/e[1])}),T=({x:t,y:e},[n,o,r],i=!1,a=[1,1])=>{const s={x:(t-n)/r,y:(e-o)/r};return i?N(s,a):s},A=({x:t,y:e},[n,o,r])=>({x:t*r+n,y:e*r+o}),I=(t,e,n,o,r,i)=>{const a=e/(t.width*(1+i)),s=n/(t.height*(1+i)),u=Math.min(a,s),l=m(u,o,r);return{x:e/2-(t.x+t.width/2)*l,y:n/2-(t.y+t.height/2)*l,zoom:l}},$=()=>"undefined"!=typeof navigator&&navigator?.userAgent?.indexOf("Mac")>=0;function C(t){return void 0!==t&&"parent"!==t}function H(t){return{width:t.measured?.width??t.width??t.initialWidth??0,height:t.measured?.height??t.height??t.initialHeight??0}}function O(t,{snapGrid:e=[0,0],snapToGrid:n=!1,transform:o}){const{x:r,y:i}=D(t),a=T({x:r,y:i},o),{x:s,y:u}=n?N(a,e):a;return{xSnapped:s,ySnapped:u,...a}}const X=t=>({width:t.offsetWidth,height:t.offsetHeight}),B=t=>t.getRootNode?.()||window?.document,Y=["INPUT","SELECT","TEXTAREA"];const R=t=>"clientX"in t,D=(t,e)=>{const n=R(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)}},L=(t,e,n,o,r)=>{const i=e.querySelectorAll(`.${t}`);return i&&i.length?Array.from(i).map((e=>{const i=e.getBoundingClientRect();return{id:e.getAttribute("data-handleid"),type:t,nodeId:r,position:e.getAttribute("data-handlepos"),x:(i.left-n.left)/o,y:(i.top-n.top)/o,...X(e)}})):null};function V({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,l=.125*e+.375*i+.375*s+.125*o;return[u,l,Math.abs(u-t),Math.abs(l-e)]}function q(t,e){return t>=0?.5*t:25*e*Math.sqrt(-t)}function Z({pos:e,x1:n,y1:o,x2:r,y2:i,c:a}){switch(e){case t.Position.Left:return[n-q(n-r,a),o];case t.Position.Right:return[n+q(r-n,a),o];case t.Position.Top:return[n,o-q(o-i,a)];case t.Position.Bottom:return[n,o+q(i-o,a)]}}function G({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 j=({source:t,sourceHandle:e,target:n,targetHandle:o})=>`xy-edge__${t}${e||""}-${n}${o||""}`;const F={[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}},W=({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},K=(t,e)=>Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2));function U(t){return t&&!(!t.internals.handleBounds&&!t.handles?.length)&&!!(t.measured.width||t.width||t.initialWidth)}function Q(t){if(!t)return null;const e=[],n=[];for(const o of t)o.width=o.width??1,o.height=o.height??1,"source"===o.type?e.push(o):"target"===o.type&&n.push(o);return{source:e,target:n}}function J(e,n,o=t.Position.Left,r=!1){const i=(n?.x??0)+e.internals.positionAbsolute.x,a=(n?.y??0)+e.internals.positionAbsolute.y,{width:s,height:u}=n??H(e);if(r)return{x:i+s/2,y:a+u/2};switch(n?.position??o){case t.Position.Top:return{x:i+s/2,y:a};case t.Position.Right:return{x:i+s,y:a+u/2};case t.Position.Bottom:return{x:i+s/2,y:a+u};case t.Position.Left:return{x:i,y:a+u/2}}}function tt(t,e){return t&&(e?t.find((t=>t.id===e)):t[0])||null}function et(t,e){if(!t)return"";if("string"==typeof t)return t;return`${e?`${e}__`:""}${Object.keys(t).sort().map((e=>`${e}=${t[e]}`)).join("&")}`}const nt={nodeOrigin:[0,0],elevateNodesOnSelect:!0,defaults:{}},ot={...nt,checkEquality:!0};function rt(t,e,n,o){const r={...nt,...o},i=t.parentId,a=e.get(i);if(!a)return void console.warn(`Parent node ${i} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);const s=n.get(i);s?s.set(t.id,t):n.set(i,new Map([[t.id,t]]));const u=o?.elevateNodesOnSelect?1e3:0,{x:l,y:c,z:h}=function(t,e,n,o){const r=d(t,n),i=it(t,o),a=e.internals.z??0;return{x:e.internals.positionAbsolute.x+r.x,y:e.internals.positionAbsolute.y+r.y,z:a>i?a:i}}(t,a,r.nodeOrigin,u),f=t.internals.positionAbsolute,p=l!==f.x||c!==f.y;(p||h!==t.internals.z)&&(t.internals={...t.internals,positionAbsolute:p?{x:l,y:c}:f,z:h})}function it(t,e){return(z(t.zIndex)?t.zIndex:0)+(t.selected?e:0)}function at(t,e,n,o=[0,0]){const r=[],i=new Map;for(const n of t){const t=e.get(n.parentId);if(!t)continue;const o=i.get(n.parentId)?.expandedRect??M(t),r=E(o,n.rect);i.set(n.parentId,{expandedRect:r,parent:t})}return i.size>0&&i.forEach((({expandedRect:e,parent:i},a)=>{const s=i.internals.positionAbsolute,u=H(i),l=i.origin??o,c=e.x<s.x?Math.round(Math.abs(s.x-e.x)):0,h=e.y<s.y?Math.round(Math.abs(s.y-e.y)):0,d=Math.max(u.width,Math.round(e.width)),f=Math.max(u.height,Math.round(e.height)),p=(d-u.width)*l[0],g=(f-u.height)*l[1];(c>0||h>0||p||g)&&(r.push({id:a,type:"position",position:{x:i.position.x-c+p,y:i.position.y-h+g}}),n.get(a)?.forEach((e=>{t.some((t=>t.id===e.id))||r.push({id:e.id,type:"position",position:{x:e.position.x+c,y:e.position.y+h}})}))),(u.width<e.width||u.height<e.height||c||h)&&r.push({id:a,type:"dimensions",setAttributes:!0,dimensions:{width:d+(c?l[0]*c-p:0),height:f+(h?l[1]*h-g:0)}})})),r}var st={value:()=>{}};function ut(){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 lt(o)}function lt(t){this._=t}function ct(t,e){for(var n,o=0,r=t.length;o<r;++o)if((n=t[o]).name===e)return n.value}function ht(t,e,n){for(var o=0,r=t.length;o<r;++o)if(t[o].name===e){t[o]=st,t=t.slice(0,o).concat(t.slice(o+1));break}return null!=n&&t.push({name:e,value:n}),t}lt.prototype=ut.prototype={constructor:lt,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]=ht(r[n],t.name,e);else if(null==e)for(n in r)r[n]=ht(r[n],t.name,null);return this}for(;++a<s;)if((n=(t=i[a]).type)&&(n=ct(r[n],t.name)))return n},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new lt(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 dt="http://www.w3.org/1999/xhtml",ft={svg:"http://www.w3.org/2000/svg",xhtml:dt,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function pt(t){var e=t+="",n=e.indexOf(":");return n>=0&&"xmlns"!==(e=t.slice(0,n))&&(t=t.slice(n+1)),ft.hasOwnProperty(e)?{space:ft[e],local:t}:t}function gt(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===dt&&e.documentElement.namespaceURI===dt?e.createElement(t):e.createElementNS(n,t)}}function mt(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function yt(t){var e=pt(t);return(e.local?mt:gt)(e)}function vt(){}function xt(t){return null==t?vt:function(){return this.querySelector(t)}}function wt(){return[]}function _t(t){return null==t?wt:function(){return this.querySelectorAll(t)}}function bt(t){return function(){return null==(e=t.apply(this,arguments))?[]:Array.isArray(e)?e:Array.from(e);var e}}function Mt(t){return function(){return this.matches(t)}}function Pt(t){return function(e){return e.matches(t)}}var Et=Array.prototype.find;function St(){return this.firstElementChild}var zt=Array.prototype.filter;function kt(){return Array.from(this.children)}function Nt(t){return new Array(t.length)}function Tt(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}function At(t,e,n,o,r,i){for(var a,s=0,u=e.length,l=i.length;s<l;++s)(a=e[s])?(a.__data__=i[s],o[s]=a):n[s]=new Tt(t,i[s]);for(;s<u;++s)(a=e[s])&&(r[s]=a)}function It(t,e,n,o,r,i,a){var s,u,l,c=new Map,h=e.length,d=i.length,f=new Array(h);for(s=0;s<h;++s)(u=e[s])&&(f[s]=l=a.call(u,u.__data__,s,e)+"",c.has(l)?r[s]=u:c.set(l,u));for(s=0;s<d;++s)l=a.call(t,i[s],s,i)+"",(u=c.get(l))?(o[s]=u,u.__data__=i[s],c.delete(l)):n[s]=new Tt(t,i[s]);for(s=0;s<h;++s)(u=e[s])&&c.get(f[s])===u&&(r[s]=u)}function $t(t){return t.__data__}function Ct(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}function Ht(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function Ot(t){return function(){this.removeAttribute(t)}}function Xt(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Bt(t,e){return function(){this.setAttribute(t,e)}}function Yt(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function Rt(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttribute(t):this.setAttribute(t,n)}}function Dt(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 Lt(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function Vt(t){return function(){this.style.removeProperty(t)}}function qt(t,e,n){return function(){this.style.setProperty(t,e,n)}}function Zt(t,e,n){return function(){var o=e.apply(this,arguments);null==o?this.style.removeProperty(t):this.style.setProperty(t,o,n)}}function Gt(t,e){return t.style.getPropertyValue(e)||Lt(t).getComputedStyle(t,null).getPropertyValue(e)}function jt(t){return function(){delete this[t]}}function Ft(t,e){return function(){this[t]=e}}function Wt(t,e){return function(){var n=e.apply(this,arguments);null==n?delete this[t]:this[t]=n}}function Kt(t){return t.trim().split(/^|\s+/)}function Ut(t){return t.classList||new Qt(t)}function Qt(t){this._node=t,this._names=Kt(t.getAttribute("class")||"")}function Jt(t,e){for(var n=Ut(t),o=-1,r=e.length;++o<r;)n.add(e[o])}function te(t,e){for(var n=Ut(t),o=-1,r=e.length;++o<r;)n.remove(e[o])}function ee(t){return function(){Jt(this,t)}}function ne(t){return function(){te(this,t)}}function oe(t,e){return function(){(e.apply(this,arguments)?Jt:te)(this,t)}}function re(){this.textContent=""}function ie(t){return function(){this.textContent=t}}function ae(t){return function(){var e=t.apply(this,arguments);this.textContent=null==e?"":e}}function se(){this.innerHTML=""}function ue(t){return function(){this.innerHTML=t}}function le(t){return function(){var e=t.apply(this,arguments);this.innerHTML=null==e?"":e}}function ce(){this.nextSibling&&this.parentNode.appendChild(this)}function he(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function de(){return null}function fe(){var t=this.parentNode;t&&t.removeChild(this)}function pe(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function ge(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function me(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 ye(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 ve(t,e,n){var o=Lt(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 xe(t,e){return function(){return ve(this,t,e)}}function we(t,e){return function(){return ve(this,t,e.apply(this,arguments))}}Tt.prototype={constructor:Tt,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)}},Qt.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 _e=[null];function be(t,e){this._groups=t,this._parents=e}function Me(){return new be([[document.documentElement]],_e)}function Pe(t){return"string"==typeof t?new be([[document.querySelector(t)]],[document.documentElement]):new be([[t]],_e)}function Ee(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]}be.prototype=Me.prototype={constructor:be,select:function(t){"function"!=typeof t&&(t=xt(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,l=o[r]=new Array(u),c=0;c<u;++c)(i=s[c])&&(a=t.call(i,i.__data__,c,s))&&("__data__"in i&&(a.__data__=i.__data__),l[c]=a);return new be(o,this._parents)},selectAll:function(t){t="function"==typeof t?bt(t):_t(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,l=0;l<u;++l)(a=s[l])&&(o.push(t.call(a,a.__data__,l,s)),r.push(a));return new be(o,r)},selectChild:function(t){return this.select(null==t?St:function(t){return function(){return Et.call(this.children,t)}}("function"==typeof t?t:Pt(t)))},selectChildren:function(t){return this.selectAll(null==t?kt:function(t){return function(){return zt.call(this.children,t)}}("function"==typeof t?t:Pt(t)))},filter:function(t){"function"!=typeof t&&(t=Mt(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]=[],l=0;l<s;++l)(i=a[l])&&t.call(i,i.__data__,l,a)&&u.push(i);return new be(o,this._parents)},data:function(t,e){if(!arguments.length)return Array.from(this,$t);var n,o=e?It:At,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),l=new Array(a),c=0;c<a;++c){var h=r[c],d=i[c],f=d.length,p=Ct(t.call(h,h&&h.__data__,c,r)),g=p.length,m=u[c]=new Array(g),y=s[c]=new Array(g);o(h,d,m,y,l[c]=new Array(f),p,e);for(var v,x,w=0,_=0;w<g;++w)if(v=m[w]){for(w>=_&&(_=w+1);!(x=y[_])&&++_<g;);v._next=x||null}}return(s=new be(s,r))._enter=u,s._exit=l,s},enter:function(){return new be(this._enter||this._groups.map(Nt),this._parents)},exit:function(){return new be(this._exit||this._groups.map(Nt),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 l,c=n[u],h=o[u],d=c.length,f=s[u]=new Array(d),p=0;p<d;++p)(l=c[p]||h[p])&&(f[p]=l);for(;u<r;++u)s[u]=n[u];return new be(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=Ht);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,l=r[i]=new Array(u),c=0;c<u;++c)(a=s[c])&&(l[c]=a);l.sort(e)}return new be(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=pt(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?Xt:Ot:"function"==typeof e?n.local?Dt:Rt:n.local?Yt:Bt)(n,e))},style:function(t,e,n){return arguments.length>1?this.each((null==e?Vt:"function"==typeof e?Zt:qt)(t,e,null==n?"":n)):Gt(this.node(),t)},property:function(t,e){return arguments.length>1?this.each((null==e?jt:"function"==typeof e?Wt:Ft)(t,e)):this.node()[t]},classed:function(t,e){var n=Kt(t+"");if(arguments.length<2){for(var o=Ut(this.node()),r=-1,i=n.length;++r<i;)if(!o.contains(n[r]))return!1;return!0}return this.each(("function"==typeof e?oe:e?ee:ne)(n,e))},text:function(t){return arguments.length?this.each(null==t?re:("function"==typeof t?ae:ie)(t)):this.node().textContent},html:function(t){return arguments.length?this.each(null==t?se:("function"==typeof t?le:ue)(t)):this.node().innerHTML},raise:function(){return this.each(ce)},lower:function(){return this.each(he)},append:function(t){var e="function"==typeof t?t:yt(t);return this.select((function(){return this.appendChild(e.apply(this,arguments))}))},insert:function(t,e){var n="function"==typeof t?t:yt(t),o=null==e?de:"function"==typeof e?e:xt(e);return this.select((function(){return this.insertBefore(n.apply(this,arguments),o.apply(this,arguments)||null)}))},remove:function(){return this.each(fe)},clone:function(t){return this.select(t?ge:pe)},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?ye:me,o=0;o<a;++o)this.each(s(i[o],e,n));return this}var s=this.node().__on;if(s)for(var u,l=0,c=s.length;l<c;++l)for(o=0,u=s[l];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?we:xe)(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 Se={passive:!1},ze={capture:!0,passive:!1};function ke(t){t.stopImmediatePropagation()}function Ne(t){t.preventDefault(),t.stopImmediatePropagation()}function Te(t){var e=t.document.documentElement,n=Pe(t).on("dragstart.drag",Ne,ze);"onselectstart"in e?n.on("selectstart.drag",Ne,ze):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}function Ae(t,e){var n=t.document.documentElement,o=Pe(t).on("dragstart.drag",null);e&&(o.on("click.drag",Ne,ze),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 Ie=t=>()=>t;function $e(t,{sourceEvent:e,subject:n,target:o,identifier:r,active:i,x:a,y:s,dx:u,dy:l,dispatch:c}){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:l,enumerable:!0,configurable:!0},_:{value:c}})}function Ce(t){return!t.ctrlKey&&!t.button}function He(){return this.parentNode}function Oe(t,e){return null==e?{x:t.x,y:t.y}:e}function Xe(){return navigator.maxTouchPoints||"ontouchstart"in this}function Be(){var t,e,n,o,r=Ce,i=He,a=Oe,s=Xe,u={},l=ut("start","drag","end"),c=0,h=0;function d(t){t.on("mousedown.drag",f).filter(s).on("touchstart.drag",m).on("touchmove.drag",y,Se).on("touchend.drag touchcancel.drag",v).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function f(a,s){if(!o&&r.call(this,a,s)){var u=x(this,i.call(this,a,s),a,s,"mouse");u&&(Pe(a.view).on("mousemove.drag",p,ze).on("mouseup.drag",g,ze),Te(a.view),ke(a),n=!1,t=a.clientX,e=a.clientY,u("start",a))}}function p(o){if(Ne(o),!n){var r=o.clientX-t,i=o.clientY-e;n=r*r+i*i>h}u.mouse("drag",o)}function g(t){Pe(t.view).on("mousemove.drag mouseup.drag",null),Ae(t.view,n),Ne(t),u.mouse("end",t)}function m(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]))&&(ke(t),o("start",t,a[n]))}}function y(t){var e,n,o=t.changedTouches,r=o.length;for(e=0;e<r;++e)(n=u[o[e].identifier])&&(Ne(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])&&(ke(t),n("end",t,r[e]))}function x(t,e,n,o,r,i){var s,h,f,p=l.copy(),g=Ee(i||n,e);if(null!=(f=a.call(t,new $e("beforestart",{sourceEvent:n,target:d,identifier:r,active:c,x:g[0],y:g[1],dx:0,dy:0,dispatch:p}),o)))return s=f.x-g[0]||0,h=f.y-g[1]||0,function n(i,a,l){var m,y=g;switch(i){case"start":u[r]=n,m=c++;break;case"end":delete u[r],--c;case"drag":g=Ee(l||a,e),m=c}p.call(i,t,new $e(i,{sourceEvent:a,subject:f,target:d,identifier:r,active:m,x:g[0]+s,y:g[1]+h,dx:g[0]-y[0],dy:g[1]-y[1],dispatch:p}),o)}}return d.filter=function(t){return arguments.length?(r="function"==typeof t?t:Ie(!!t),d):r},d.container=function(t){return arguments.length?(i="function"==typeof t?t:Ie(t),d):i},d.subject=function(t){return arguments.length?(a="function"==typeof t?t:Ie(t),d):a},d.touchable=function(t){return arguments.length?(s="function"==typeof t?t:Ie(!!t),d):s},d.on=function(){var t=l.on.apply(l,arguments);return t===l?d:t},d.clickDistance=function(t){return arguments.length?(h=(t=+t)*t,d):Math.sqrt(h)},d}function Ye(t,e){if(!t.parentId)return!1;const n=e.get(t.parentId);return!!n&&(!!n.selected||Ye(n,e))}function Re(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 De({nodeId:t,dragItems:e,nodeLookup:n,dragging:o=!0}){const r=[];for(const[t,i]of e){const e=n.get(t)?.internals.userNode;e&&r.push({...e,position:i.position,dragging:o})}if(!t)return[r[0],r];const i=n.get(t).internals.userNode;return[{...i,position:e.get(t)?.position||i.position,dragging:o},r]}function Le(t,e,n,o){let r=null;return[(e[n]||[]).reduce(((e,i)=>{if(t.id===o.nodeId&&n===o.handleType&&i.id===o.handleId)r=i;else{const n=J(t,i,i.position,!0);e.push({...i,...n})}return e}),[]),r]}function Ve(t,e){return t||(e?.classList.contains("target")?"target":e?.classList.contains("source")?"source":null)}$e.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};const qe=()=>!0;function Ze(e,{handle:n,connectionMode:o,fromNodeId:r,fromHandleId:i,fromType:a,doc:s,lib:u,flowId:l,isValidConnection:c=qe,handleLookup:h}){const d="target"===a,f=n?s.querySelector(`.${u}-flow__handle[data-id="${l}-${n?.nodeId}-${n?.id}-${n?.type}"]`):null,{x:p,y:g}=D(e),m=s.elementFromPoint(p,g),y=m?.classList.contains(`${u}-flow__handle`)?m:f,v={handleDomNode:y,isValid:!1,connection:null,toHandle:null};if(y){const e=Ve(void 0,y),n=y.getAttribute("data-nodeid"),a=y.getAttribute("data-handleid"),s=y.classList.contains("connectable"),u=y.classList.contains("connectableend");if(!n)return v;const l={source:d?n:r,sourceHandle:d?a:i,target:d?r:n,targetHandle:d?i:a};v.connection=l;const f=s&&u&&(o===t.ConnectionMode.Strict?d&&"source"===e||!d&&"target"===e:n!==r||a!==i);v.isValid=f&&c(l);const p=h?.get(`${n}-${e}-${a}`);p&&(v.toHandle={...p})}return v}const Ge={onPointerDown:function(e,{connectionMode:n,connectionRadius:o,handleId:r,nodeId:i,edgeUpdaterType:a,isTarget:s,domNode:u,nodeLookup:c,lib:h,autoPanOnConnect:d,flowId:f,panBy:p,cancelConnection:g,onConnectStart:m,onConnect:y,onConnectEnd:v,isValidConnection:w=qe,onReconnectEnd:_,updateConnection:b,getTransform:M,getFromHandle:P,autoPanSpeed:E}){const S=B(e.target);let z,k=0;const{x:N,y:I}=D(e),$=S?.elementFromPoint(N,I),C=Ve(a,$),H=u?.getBoundingClientRect();if(!H||!C)return;let O=D(e,H),X=!1,Y=null,R=!1,L=null;const[V,q]=function({nodeLookup:t,nodeId:e,handleId:n,handleType:o}){const r=new Map,i={nodeId:e,handleId:n,handleType:o};let a=null;for(const e of t.values())if(e.internals.handleBounds){const[t,n]=Le(e,e.internals.handleBounds,"source",i),[o,s]=Le(e,e.internals.handleBounds,"target",i);a=a||(n??s),[...t,...o].forEach((t=>r.set(`${t.nodeId}-${t.type}-${t.id}`,t)))}if(!a){const n=t.get(e);if(n?.internals.handleBounds){i.handleType="source"===o?"target":"source";const[,t]=Le(n,n.internals.handleBounds,i.handleType,i);a=t}}return[r,a]}({nodeLookup:c,nodeId:i,handleId:r,handleType:C});function Z(){if(!d||!H)return;const[t,e]=x(O,H,E);p({x:t,y:e}),k=requestAnimationFrame(Z)}const G={...q,nodeId:i,type:C,position:q.position},j=c.get(i),F={inProgress:!0,isValid:null,from:J(j,G,t.Position.Left,!0),fromHandle:G,fromPosition:G.position,fromNode:j,to:O,toHandle:null,toPosition:l[G.position],toNode:null};b(F);let W=F;function K(t){if(!P()||!G)return void U(t);const e=M();O=D(t,H),z=function(t,e,n){let o=[],r=1/0;for(const i of n.values()){const n=Math.sqrt(Math.pow(i.x-t.x,2)+Math.pow(i.y-t.y,2));n<=e&&(n<r?o=[i]:n===r&&o.push(i),r=n)}return o.length?1===o.length?o[0]:o.find((t=>"target"===t.type))||o[0]:null}(T(O,e,!1,[1,1]),o,V),X||(Z(),X=!0);const a=Ze(t,{handle:z,connectionMode:n,fromNodeId:i,fromHandleId:r,fromType:s?"target":"source",isValidConnection:w,doc:S,lib:h,flowId:f,handleLookup:V});L=a.handleDomNode,Y=a.connection,R=function(t,e){let n=null;return e?n=!0:t&&!e&&(n=!1),n}(!!z,a.isValid);const u={...W,isValid:R,to:z&&R?A({x:z.x,y:z.y},e):O,toHandle:a.toHandle,toPosition:R&&a.toHandle?a.toHandle.position:l[G.position],toNode:a.toHandle?c.get(a.toHandle.nodeId):null};R&&z&&W.toHandle&&u.toHandle&&W.toHandle.type===u.toHandle.type&&W.toHandle.nodeId===u.toHandle.nodeId&&W.toHandle.id===u.toHandle.id||(b(u),W=u)}function U(t){(z||L)&&Y&&R&&y?.(Y),v?.(t),a&&_?.(t),g(),cancelAnimationFrame(k),X=!1,R=!1,Y=null,L=null,S.removeEventListener("mousemove",K),S.removeEventListener("mouseup",U),S.removeEventListener("touchmove",K),S.removeEventListener("touchend",U)}m?.(e,{nodeId:i,handleId:r,handleType:C}),S.addEventListener("mousemove",K),S.addEventListener("mouseup",U),S.addEventListener("touchmove",K),S.addEventListener("touchend",U)},isValid:Ze};function je(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function Fe(t,e){var n=Object.create(t.prototype);for(var o in e)n[o]=e[o];return n}function We(){}var Ke=.7,Ue=1/Ke,Qe="\\s*([+-]?\\d+)\\s*",Je="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",tn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",en=/^#([0-9a-f]{3,8})$/,nn=new RegExp(`^rgb\\(${Qe},${Qe},${Qe}\\)$`),on=new RegExp(`^rgb\\(${tn},${tn},${tn}\\)$`),rn=new RegExp(`^rgba\\(${Qe},${Qe},${Qe},${Je}\\)$`),an=new RegExp(`^rgba\\(${tn},${tn},${tn},${Je}\\)$`),sn=new RegExp(`^hsl\\(${Je},${tn},${tn}\\)$`),un=new RegExp(`^hsla\\(${Je},${tn},${tn},${Je}\\)$`),ln={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 cn(){return this.rgb().formatHex()}function hn(){return this.rgb().formatRgb()}function dn(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=en.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?fn(e):3===n?new mn(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?pn(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?pn(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=nn.exec(t))?new mn(e[1],e[2],e[3],1):(e=on.exec(t))?new mn(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=rn.exec(t))?pn(e[1],e[2],e[3],e[4]):(e=an.exec(t))?pn(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=sn.exec(t))?bn(e[1],e[2]/100,e[3]/100,1):(e=un.exec(t))?bn(e[1],e[2]/100,e[3]/100,e[4]):ln.hasOwnProperty(t)?fn(ln[t]):"transparent"===t?new mn(NaN,NaN,NaN,0):null}function fn(t){return new mn(t>>16&255,t>>8&255,255&t,1)}function pn(t,e,n,o){return o<=0&&(t=e=n=NaN),new mn(t,e,n,o)}function gn(t,e,n,o){return 1===arguments.length?((r=t)instanceof We||(r=dn(r)),r?new mn((r=r.rgb()).r,r.g,r.b,r.opacity):new mn):new mn(t,e,n,null==o?1:o);var r}function mn(t,e,n,o){this.r=+t,this.g=+e,this.b=+n,this.opacity=+o}function yn(){return`#${_n(this.r)}${_n(this.g)}${_n(this.b)}`}function vn(){const t=xn(this.opacity);return`${1===t?"rgb(":"rgba("}${wn(this.r)}, ${wn(this.g)}, ${wn(this.b)}${1===t?")":`, ${t})`}`}function xn(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function wn(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function _n(t){return((t=wn(t))<16?"0":"")+t.toString(16)}function bn(t,e,n,o){return o<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new Pn(t,e,n,o)}function Mn(t){if(t instanceof Pn)return new Pn(t.h,t.s,t.l,t.opacity);if(t instanceof We||(t=dn(t)),!t)return new Pn;if(t instanceof Pn)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 Pn(a,s,u,t.opacity)}function Pn(t,e,n,o){this.h=+t,this.s=+e,this.l=+n,this.opacity=+o}function En(t){return(t=(t||0)%360)<0?t+360:t}function Sn(t){return Math.max(0,Math.min(1,t||0))}function zn(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}je(We,dn,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:cn,formatHex:cn,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return Mn(this).formatHsl()},formatRgb:hn,toString:hn}),je(mn,gn,Fe(We,{brighter(t){return t=null==t?Ue:Math.pow(Ue,t),new mn(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?Ke:Math.pow(Ke,t),new mn(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new mn(wn(this.r),wn(this.g),wn(this.b),xn(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:yn,formatHex:yn,formatHex8:function(){return`#${_n(this.r)}${_n(this.g)}${_n(this.b)}${_n(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:vn,toString:vn})),je(Pn,(function(t,e,n,o){return 1===arguments.length?Mn(t):new Pn(t,e,n,null==o?1:o)}),Fe(We,{brighter(t){return t=null==t?Ue:Math.pow(Ue,t),new Pn(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?Ke:Math.pow(Ke,t),new Pn(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 mn(zn(t>=240?t-240:t+120,r,o),zn(t,r,o),zn(t<120?t+240:t-120,r,o),this.opacity)},clamp(){return new Pn(En(this.h),Sn(this.s),Sn(this.l),xn(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=xn(this.opacity);return`${1===t?"hsl(":"hsla("}${En(this.h)}, ${100*Sn(this.s)}%, ${100*Sn(this.l)}%${1===t?")":`, ${t})`}`}}));var kn=t=>()=>t;function Nn(t){return 1==(t=+t)?Tn: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):kn(isNaN(e)?n:e)}}function Tn(t,e){var n=e-t;return n?function(t,e){return function(n){return t+n*e}}(t,n):kn(isNaN(t)?e:t)}var An=function t(e){var n=Nn(e);function o(t,e){var o=n((t=gn(t)).r,(e=gn(e)).r),r=n(t.g,e.g),i=n(t.b,e.b),a=Tn(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 In(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}var $n=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Cn=new RegExp($n.source,"g");function Hn(t,e){var n,o,r,i=$n.lastIndex=Cn.lastIndex=0,a=-1,s=[],u=[];for(t+="",e+="";(n=$n.exec(t))&&(o=Cn.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:In(n,o)})),i=Cn.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,Xn=180/Math.PI,Bn={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Yn(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)*Xn,skewX:Math.atan(u)*Xn,scaleX:a,scaleY:s}}function Rn(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:In(t,r)},{i:u-2,x:In(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:In(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:In(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:In(t,n)},{i:s-2,x:In(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 Dn=Rn((function(t){const e=new("function"==typeof DOMMatrix?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?Bn:Yn(e.a,e.b,e.c,e.d,e.e,e.f)}),"px, ","px)","deg)"),Ln=Rn((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())?Yn((t=t.matrix).a,t.b,t.c,t.d,t.e,t.f):Bn)}),", ",")",")");function Vn(t){return((t=Math.exp(t))+1/t)/2}var qn,Zn,Gn=function t(e,n,o){function r(t,r){var i,a,s=t[0],u=t[1],l=t[2],c=r[0],h=r[1],d=r[2],f=c-s,p=h-u,g=f*f+p*p;if(g<1e-12)a=Math.log(d/l)/e,i=function(t){return[s+t*f,u+t*p,l*Math.exp(e*t*a)]};else{var m=Math.sqrt(g),y=(d*d-l*l+o*g)/(2*l*n*m),v=(d*d-l*l-o*g)/(2*d*n*m),x=Math.log(Math.sqrt(y*y+1)-y),w=Math.log(Math.sqrt(v*v+1)-v);a=(w-x)/e,i=function(t){var o,r=t*a,i=Vn(x),c=l/(n*m)*(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+c*f,u+c*p,l*i/Vn(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),jn=0,Fn=0,Wn=0,Kn=1e3,Un=0,Qn=0,Jn=0,to="object"==typeof performance&&performance.now?performance:Date,eo="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function no(){return Qn||(eo(oo),Qn=to.now()+Jn)}function oo(){Qn=0}function ro(){this._call=this._time=this._next=null}function io(t,e,n){var o=new ro;return o.restart(t,e,n),o}function ao(){Qn=(Un=to.now())+Jn,jn=Fn=0;try{!function(){no(),++jn;for(var t,e=qn;e;)(t=Qn-e._time)>=0&&e._call.call(void 0,t),e=e._next;--jn}()}finally{jn=0,function(){var t,e,n=qn,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:qn=e);Zn=t,uo(o)}(),Qn=0}}function so(){var t=to.now(),e=t-Un;e>Kn&&(Jn-=e,Un=t)}function uo(t){jn||(Fn&&(Fn=clearTimeout(Fn)),t-Qn>24?(t<1/0&&(Fn=setTimeout(ao,t-to.now()-Jn)),Wn&&(Wn=clearInterval(Wn))):(Wn||(Un=to.now(),Wn=setInterval(so,Kn)),jn=1,eo(ao)))}function lo(t,e,n){var o=new ro;return e=null==e?0:+e,o.restart((n=>{o.stop(),t(n+e)}),e,n),o}ro.prototype=io.prototype={constructor:ro,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?no():+n)+(null==e?0:+e),this._next||Zn===this||(Zn?Zn._next=this:qn=this,Zn=this),this._call=t,this._time=n,uo()},stop:function(){this._call&&(this._call=null,this._time=1/0,uo())}};var co=ut("start","end","cancel","interrupt"),ho=[],fo=0,po=1,go=2,mo=3,yo=4,vo=5,xo=6;function wo(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=po,n.timer.restart(a,n.delay,n.time),n.delay<=t&&a(t-n.delay)}function a(i){var l,c,h,d;if(n.state!==po)return u();for(l in r)if((d=r[l]).name===n.name){if(d.state===mo)return lo(a);d.state===yo?(d.state=xo,d.timer.stop(),d.on.call("interrupt",t,t.__data__,d.index,d.group),delete r[l]):+l<e&&(d.state=xo,d.timer.stop(),d.on.call("cancel",t,t.__data__,d.index,d.group),delete r[l])}if(lo((function(){n.state===mo&&(n.state=yo,n.timer.restart(s,n.delay,n.time),s(i))})),n.state=go,n.on.call("start",t,t.__data__,n.index,n.group),n.state===go){for(n.state=mo,o=new Array(h=n.tween.length),l=0,c=-1;l<h;++l)(d=n.tween[l].value.call(t,t.__data__,n.index,n.group))&&(o[++c]=d);o.length=c+1}}function s(e){for(var r=e<n.duration?n.ease.call(null,e/n.duration):(n.timer.restart(u),n.state=vo,1),i=-1,a=o.length;++i<a;)o[i].call(t,r);n.state===vo&&(n.on.call("end",t,t.__data__,n.index,n.group),u())}function u(){for(var o in n.state=xo,n.timer.stop(),delete r[e],r)return;delete t.__transition}r[e]=n,n.timer=io(i,0,n.time)}(t,n,{name:e,index:o,group:r,on:co,tween:ho,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:fo})}function _o(t,e){var n=Mo(t,e);if(n.state>fo)throw new Error("too late; already scheduled");return n}function bo(t,e){var n=Mo(t,e);if(n.state>mo)throw new Error("too late; already running");return n}function Mo(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function Po(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>go&&n.state<vo,n.state=xo,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 Eo(t,e){var n,o;return function(){var r=bo(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 So(t,e,n){var o,r;if("function"!=typeof n)throw new Error;return function(){var i=bo(this,t),a=i.tween;if(a!==o){r=(o=a).slice();for(var s={name:e,value:n},u=0,l=r.length;u<l;++u)if(r[u].name===e){r[u]=s;break}u===l&&r.push(s)}i.tween=r}}function zo(t,e,n){var o=t._id;return t.each((function(){var t=bo(this,o);(t.value||(t.value={}))[e]=n.apply(this,arguments)})),function(t){return Mo(t,o).value[e]}}function ko(t,e){var n;return("number"==typeof e?In:e instanceof dn?An:(n=dn(e))?(e=n,An):Hn)(t,e)}function No(t){return function(){this.removeAttribute(t)}}function To(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 Io(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 Co(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 Ho(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 Xo(t,e){return function(){_o(this,t).delay=+e.apply(this,arguments)}}function Bo(t,e){return e=+e,function(){_o(this,t).delay=e}}function Yo(t,e){return function(){bo(this,t).duration=+e.apply(this,arguments)}}function Ro(t,e){return e=+e,function(){bo(this,t).duration=e}}var Do=Me.prototype.constructor;function Lo(t){return function(){this.style.removeProperty(t)}}var Vo=0;function qo(t,e,n,o){this._groups=t,this._parents=e,this._name=n,this._id=o}function Zo(){return++Vo}var Go=Me.prototype;qo.prototype={constructor:qo,select:function(t){var e=this._name,n=this._id;"function"!=typeof t&&(t=xt(t));for(var o=this._groups,r=o.length,i=new Array(r),a=0;a<r;++a)for(var s,u,l=o[a],c=l.length,h=i[a]=new Array(c),d=0;d<c;++d)(s=l[d])&&(u=t.call(s,s.__data__,d,l))&&("__data__"in s&&(u.__data__=s.__data__),h[d]=u,wo(h[d],e,n,d,h,Mo(s,n)));return new qo(i,this._parents,e,n)},selectAll:function(t){var e=this._name,n=this._id;"function"!=typeof t&&(t=_t(t));for(var o=this._groups,r=o.length,i=[],a=[],s=0;s<r;++s)for(var u,l=o[s],c=l.length,h=0;h<c;++h)if(u=l[h]){for(var d,f=t.call(u,u.__data__,h,l),p=Mo(u,n),g=0,m=f.length;g<m;++g)(d=f[g])&&wo(d,e,n,g,f,p);i.push(f),a.push(u)}return new qo(i,a,e,n)},selectChild:Go.selectChild,selectChildren:Go.selectChildren,filter:function(t){"function"!=typeof t&&(t=Mt(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]=[],l=0;l<s;++l)(i=a[l])&&t.call(i,i.__data__,l,a)&&u.push(i);return new qo(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,l=e[s],c=n[s],h=l.length,d=a[s]=new Array(h),f=0;f<h;++f)(u=l[f]||c[f])&&(d[f]=u);for(;s<o;++s)a[s]=e[s];return new qo(a,this._parents,this._name,this._id)},selection:function(){return new Do(this._groups,this._parents)},transition:function(){for(var t=this._name,e=this._id,n=Zo(),o=this._groups,r=o.length,i=0;i<r;++i)for(var a,s=o[i],u=s.length,l=0;l<u;++l)if(a=s[l]){var c=Mo(a,e);wo(a,t,n,l,s,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new qo(o,this._parents,t,n)},call:Go.call,nodes:Go.nodes,node:Go.node,size:Go.size,empty:Go.empty,each:Go.each,on:function(t,e){var n=this._id;return arguments.length<2?Mo(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)?_o:bo;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=pt(t),o="transform"===n?Ln:ko;return this.attrTween(t,"function"==typeof e?(n.local?Co:$o)(n,o,zo(this,"attr."+t,e)):null==e?(n.local?To:No)(n):(n.local?Io: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=pt(t);return this.tween(n,(o.local?Ho:Oo)(o,e))},style:function(t,e,n){var o="transform"==(t+="")?Dn:ko;return null==e?this.styleTween(t,function(t,e){var n,o,r;return function(){var i=Gt(this,t),a=(this.style.removeProperty(t),Gt(this,t));return i===a?null:i===n&&a===o?r:r=e(n=i,o=a)}}(t,o)).on("end.style."+t,Lo(t)):"function"==typeof e?this.styleTween(t,function(t,e,n){var o,r,i;return function(){var a=Gt(this,t),s=n(this),u=s+"";return null==s&&(this.style.removeProperty(t),u=s=Gt(this,t)),a===u?null:a===o&&u===r?i:(r=u,i=e(o=a,s))}}(t,o,zo(this,"style."+t,e))).each(function(t,e){var n,o,r,i,a="style."+e,s="end."+a;return function(){var u=bo(this,t),l=u.on,c=null==u.value[a]?i||(i=Lo(e)):void 0;l===n&&r===c||(o=(n=l).copy()).on(s,r=c),u.on=o}}(this._id,t)):this.styleTween(t,function(t,e,n){var o,r,i=n+"";return function(){var a=Gt(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}}(zo(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=Mo(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?Eo:So)(n,t,e))},delay:function(t){var e=this._id;return arguments.length?this.each(("function"==typeof t?Xo:Bo)(e,t)):Mo(this.node(),e).delay},duration:function(t){var e=this._id;return arguments.length?this.each(("function"==typeof t?Yo:Ro)(e,t)):Mo(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(){bo(this,t).ease=e}}(e,t)):Mo(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;bo(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=bo(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]:Go[Symbol.iterator]};var jo={time:null,delay:0,duration:250,ease:function(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}};function Fo(t,e){for(var n;!(n=t.__transition)||!(n=n[e]);)if(!(t=t.parentNode))throw new Error(`transition ${e} not found`);return n}Me.prototype.interrupt=function(t){return this.each((function(){Po(this,t)}))},Me.prototype.transition=function(t){var e,n;t instanceof qo?(e=t._id,t=t._name):(e=Zo(),(n=jo).time=no(),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,l=0;l<u;++l)(a=s[l])&&wo(a,t,e,l,s,n||Fo(a,e));return new qo(o,this._parents,t,e)};var Wo=t=>()=>t;function Ko(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 Uo(t,e,n){this.k=t,this.x=e,this.y=n}Uo.prototype={constructor:Uo,scale:function(t){return 1===t?this:new Uo(this.k*t,this.x,this.y)},translate:function(t,e){return 0===t&0===e?this:new Uo(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 Qo=new Uo(1,0,0);function Jo(t){for(;!t.__zoom;)if(!(t=t.parentNode))return Qo;return t.__zoom}function tr(t){t.stopImmediatePropagation()}function er(t){t.preventDefault(),t.stopImmediatePropagation()}function nr(t){return!(t.ctrlKey&&"wheel"!==t.type||t.button)}function or(){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 rr(){return this.__zoom||Qo}function ir(t){return-t.deltaY*(1===t.deltaMode?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function ar(){return navigator.maxTouchPoints||"ontouchstart"in this}function sr(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 ur(){var t,e,n,o=nr,r=or,i=sr,a=ir,s=ar,u=[0,1/0],l=[[-1/0,-1/0],[1/0,1/0]],c=250,h=Gn,d=ut("start","zoom","end"),f=500,p=150,g=0,m=10;function y(t){t.property("__zoom",rr).on("wheel.zoom",P,{passive:!1}).on("mousedown.zoom",E).on("dblclick.zoom",S).filter(s).on("touchstart.zoom",z).on("touchmove.zoom",k).on("touchend.zoom touchcancel.zoom",N).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 Uo(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 Uo(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,l=Math.max(s[1][0]-s[0][0],s[1][1]-s[0][1]),c=t.__zoom,d="function"==typeof e?e.apply(t,i):e,f=h(c.invert(u).concat(l/c.k),d.invert(u).concat(l/d.k));return function(t){if(1===t)t=d;else{var e=f(t),n=l/e[2];t=new Uo(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 P(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)))),c=Ee(t);if(n.wheel)n.mouse[0][0]===c[0]&&n.mouse[0][1]===c[1]||(n.mouse[1]=r.invert(n.mouse[0]=c)),clearTimeout(n.wheel);else{if(r.k===s)return;n.mouse=[c,r.invert(c)],Po(this),n.start()}er(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,l))}}function E(t,...e){if(!n&&o.apply(this,arguments)){var r=t.currentTarget,a=b(this,e,!0).event(t),s=Pe(t.view).on("mousemove.zoom",(function(t){if(er(t),!a.moved){var e=t.clientX-c,n=t.clientY-h;a.moved=e*e+n*n>g}a.event(t).zoom("mouse",i(x(a.that.__zoom,a.mouse[0]=Ee(t,r),a.mouse[1]),a.extent,l))}),!0).on("mouseup.zoom",(function(t){s.on("mousemove.zoom mouseup.zoom",null),Ae(t.view,a.moved),er(t),a.event(t).end()}),!0),u=Ee(t,r),c=t.clientX,h=t.clientY;Te(t.view),tr(t),a.mouse=[u,this.__zoom.invert(u)],Po(this),a.start()}}function S(t,...e){if(o.apply(this,arguments)){var n=this.__zoom,a=Ee(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),l);er(t),c>0?Pe(this).transition().duration(c).call(_,h,a,t):Pe(this).call(y.transform,h,a,t)}}function z(n,...r){if(o.apply(this,arguments)){var i,a,s,u,l=n.touches,c=l.length,h=b(this,r,n.changedTouches.length===c).event(n);for(tr(n),a=0;a<c;++a)u=[u=Ee(s=l[a],this),this.__zoom.invert(u),s.identifier],h.touch0?h.touch1||h.touch0[2]===u[2]||(h.touch1=u,h.taps=0):(h.touch0=u,i=!0,h.taps=1+!!t);t&&(t=clearTimeout(t)),i&&(h.taps<2&&(e=u[0],t=setTimeout((function(){t=null}),f)),Po(this),h.start())}}function k(t,...e){if(this.__zooming){var n,o,r,a,s=b(this,e).event(t),u=t.changedTouches,c=u.length;for(er(t),n=0;n<c;++n)r=Ee(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],d=s.touch0[1],f=s.touch1[0],p=s.touch1[1],g=(g=f[0]-h[0])*g+(g=f[1]-h[1])*g,m=(m=p[0]-d[0])*m+(m=p[1]-d[1])*m;o=v(o,Math.sqrt(g/m)),r=[(h[0]+f[0])/2,(h[1]+f[1])/2],a=[(d[0]+p[0])/2,(d[1]+p[1])/2]}else{if(!s.touch0)return;r=s.touch0[0],a=s.touch0[1]}s.zoom("touch",i(x(o,r,a),s.extent,l))}}function N(t,...o){if(this.__zooming){var r,i,a=b(this,o).event(t),s=t.changedTouches,u=s.length;for(tr(t),n&&clearTimeout(n),n=setTimeout((function(){n=null}),f),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=Ee(i,this),Math.hypot(e[0]-i[0],e[1]-i[1])<m)){var l=Pe(this).on("dblclick.zoom");l&&l.apply(this,arguments)}}}return y.transform=function(t,e,n,o){var r=t.selection?t.selection():t;r.property("__zoom",rr),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()}))},y.scaleBy=function(t,e,n,o){y.scaleTo(t,(function(){return this.__zoom.k*("function"==typeof e?e.apply(this,arguments):e)}),n,o)},y.scaleTo=function(t,e,n,o){y.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,l)}),n,o)},y.translateBy=function(t,e,n,o){y.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),l)}),null,o)},y.translateTo=function(t,e,n,o,a){y.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(Qo.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,l)}),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=Pe(this.that).datum();d.call(t,this.that,new Ko(t,{sourceEvent:this.sourceEvent,target:y,type:t,transform:this.that.__zoom,dispatch:d}),e)}},y.wheelDelta=function(t){return arguments.length?(a="function"==typeof t?t:Wo(+t),y):a},y.filter=function(t){return arguments.length?(o="function"==typeof t?t:Wo(!!t),y):o},y.touchable=function(t){return arguments.length?(s="function"==typeof t?t:Wo(!!t),y):s},y.extent=function(t){return arguments.length?(r="function"==typeof t?t:Wo([[+t[0][0],+t[0][1]],[+t[1][0],+t[1][1]]]),y):r},y.scaleExtent=function(t){return arguments.length?(u[0]=+t[0],u[1]=+t[1],y):[u[0],u[1]]},y.translateExtent=function(t){return arguments.length?(l[0][0]=+t[0][0],l[1][0]=+t[1][0],l[0][1]=+t[0][1],l[1][1]=+t[1][1],y):[[l[0][0],l[0][1]],[l[1][0],l[1][1]]]},y.constrain=function(t){return arguments.length?(i=t,y):i},y.duration=function(t){return arguments.length?(c=+t,y):c},y.interpolate=function(t){return arguments.length?(h=t,y):h},y.on=function(){var t=d.on.apply(d,arguments);return t===d?y:t},y.clickDistance=function(t){return arguments.length?(g=(t=+t)*t,y):Math.sqrt(g)},y.tapDistance=function(t){return arguments.length?(m=+t,y):m},y}Jo.prototype=Uo.prototype;const lr=(t,e)=>t.x!==e.x||t.y!==e.y||t.zoom!==e.k,cr=t=>({x:t.x,y:t.y,zoom:t.k}),hr=({x:t,y:e,zoom:n})=>Qo.translate(t,e).scale(n),dr=(t,e)=>t.target.closest(`.${e}`),fr=(t,e)=>2===e&&Array.isArray(t)&&t.includes(2),pr=(t,e=0,n=(()=>{}))=>{const o="number"==typeof e&&e>0;return o||n(),o?t.transition().duration(e).on("end",n):t},gr=t=>{const e=t.ctrlKey&&$()?10:1;return-t.deltaY*(1===t.deltaMode?.05:t.deltaMode?1:.002)*e};var mr;t.ResizeControlVariant=void 0,(mr=t.ResizeControlVariant||(t.ResizeControlVariant={})).Line="line",mr.Handle="handle";function yr(t,e){return Math.max(0,e-t)}function vr(t,e){return Math.max(0,t-e)}function xr(t,e,n){return Math.max(0,e-t,t-n)}function wr(t,e){return t?!e:e}const _r={width:0,height:0,x:0,y:0},br={..._r,pointerX:0,pointerY:0,aspectRatio:1};function Mr(t,e,n){const o=e.position.x+t.position.x,r=e.position.y+t.position.y,i=t.measured.width??0,a=t.measured.height??0,s=n[0]*i,u=n[1]*a;return[[o-s,r-u],[o+i-s,r+a-u]]}t.XYDrag=function({onNodeMouseDown:t,getStoreItems:e,onDragStart:n,onDrag:o,onDragStop:r}){let i={x:null,y:null},a=0,s=new Map,u=!1,l={x:0,y:0},c=null,h=!1,d=null,p=!1;return{update:function({noDragClassName:m,handleSelector:y,domNode:v,isSelectable:w,nodeId:b,nodeClickDistance:M=0}){function P({x:t,y:n},r){const{nodeLookup:a,nodeExtent:u,snapGrid:l,snapToGrid:c,nodeOrigin:h,onNodeDrag:d,onSelectionDrag:p,onError:m,updateNodePositions:y}=e();i={x:t,y:n};let v=!1,x={x:0,y:0,x2:0,y2:0};if(s.size>1&&u){const t=f(s);x=_(t)}for(const[e,o]of s){let r={x:t-o.distance.x,y:n-o.distance.y};c&&(r=N(r,l));let i=[[u[0][0],u[0][1]],[u[1][0],u[1][1]]];if(s.size>1&&u&&!o.extent){const{positionAbsolute:t}=o.internals,e=t.x-x.x+u[0][0],n=t.x+o.measured.width-x.x2+u[1][0];i=[[e,t.y-x.y+u[0][1]],[n,t.y+o.measured.height-x.y2+u[1][1]]]}const{position:d,positionAbsolute:f}=g({nodeId:e,nextPosition:r,nodeLookup:a,nodeExtent:i,nodeOrigin:h,onError:m});v=v||o.position.x!==d.x||o.position.y!==d.y,o.position=d,o.internals.positionAbsolute=f}if(v&&(y(s,!0),r&&(o||d||!b&&p))){const[t,e]=De({nodeId:b,dragItems:s,nodeLookup:a});o?.(r,s,t,e),d?.(r,t,e),b||p?.(r,e)}}async function E(){if(!c)return;const{transform:t,panBy:n,autoPanSpeed:o}=e(),[r,s]=x(l,c,o);0===r&&0===s||(i.x=(i.x??0)-r/t[2],i.y=(i.y??0)-s/t[2],await n({x:r,y:s})&&P(i,null)),a=requestAnimationFrame(E)}function S(o){const{nodeLookup:r,multiSelectionActive:a,nodesDraggable:u,transform:l,snapGrid:c,snapToGrid:d,selectNodesOnDrag:f,onNodeDragStart:p,onSelectionDragStart:g,unselectNodesAndEdges:m}=e();h=!0,f&&w||a||!b||r.get(b)?.selected||m(),w&&f&&b&&t?.(b);const y=O(o.sourceEvent,{transform:l,snapGrid:c,snapToGrid:d});if(i=y,s=function(t,e,n,o){const r=new Map;for(const[i,a]of t)if((a.selected||a.id===o)&&(!a.parentId||!Ye(a,t))&&(a.draggable||e&&void 0===a.draggable)){const e=t.get(i);e&&r.set(i,{id:i,position:e.position||{x:0,y:0},distance:{x:n.x-e.internals.positionAbsolute.x,y:n.y-e.internals.positionAbsolute.y},extent:e.extent,parentId:e.parentId,origin:e.origin,expandParent:e.expandParent,internals:{positionAbsolute:e.internals.positionAbsolute||{x:0,y:0}},measured:{width:e.measured.width??0,height:e.measured.height??0}})}return r}(r,u,y,b),s.size>0&&(n||p||!b&&g)){const[t,e]=De({nodeId:b,dragItems:s,nodeLookup:r});n?.(o.sourceEvent,s,t,e),p?.(o.sourceEvent,t,e),b||g?.(o.sourceEvent,e)}}d=Pe(v);const z=Be().clickDistance(M).on("start",(t=>{const{domNode:n,nodeDragThreshold:o,transform:r,snapGrid:a,snapToGrid:s}=e();p=!1,0===o&&S(t);const u=O(t.sourceEvent,{transform:r,snapGrid:a,snapToGrid:s});i=u,c=n?.getBoundingClientRect()||null,l=D(t.sourceEvent,c)})).on("drag",(t=>{const{autoPanOnNodeDrag:n,transform:o,snapGrid:r,snapToGrid:a,nodeDragThreshold:d}=e(),f=O(t.sourceEvent,{transform:o,snapGrid:r,snapToGrid:a});if("touchmove"===t.sourceEvent.type&&t.sourceEvent.touches.length>1&&(p=!0),!p){if(!u&&n&&h&&(u=!0,E()),!h){const e=f.xSnapped-(i.x??0),n=f.ySnapped-(i.y??0);Math.sqrt(e*e+n*n)>d&&S(t)}(i.x!==f.xSnapped||i.y!==f.ySnapped)&&s&&h&&(l=D(t.sourceEvent,c),P(f,t.sourceEvent))}})).on("end",(t=>{if(h&&!p&&(u=!1,h=!1,cancelAnimationFrame(a),s.size>0)){const{nodeLookup:n,updateNodePositions:o,onNodeDragStop:i,onSelectionDragStop:a}=e();if(o(s,!1),r||i||!b&&a){const[e,o]=De({nodeId:b,dragItems:s,nodeLookup:n,dragging:!1});r?.(t.sourceEvent,s,e,o),i?.(t.sourceEvent,e,o),b||a?.(t.sourceEvent,o)}}})).filter((t=>{const e=t.target;return!t.button&&(!m||!Re(e,`.${m}`,v))&&(!y||Re(e,y,v))}));d.call(z)},destroy:function(){d?.on(".drag",null)}}},t.XYHandle=Ge,t.XYMinimap=function({domNode:t,panZoom:e,getTransform:n,getViewScale:o}){const r=Pe(t);return{update:function({translateExtent:t,width:i,height:a,zoomStep:s=10,pannable:u=!0,zoomable:l=!0,inversePan:c=!1}){let h=[0,0];const d=ur().on("start",(t=>{"mousedown"!==t.sourceEvent.type&&"touchstart"!==t.sourceEvent.type||(h=[t.sourceEvent.clientX??t.sourceEvent.touches[0].clientX,t.sourceEvent.clientY??t.sourceEvent.touches[0].clientY])})).on("zoom",u?r=>{const s=n();if("mousemove"!==r.sourceEvent.type&&"touchmove"!==r.sourceEvent.type||!e)return;const u=[r.sourceEvent.clientX??r.sourceEvent.touches[0].clientX,r.sourceEvent.clientY??r.sourceEvent.touches[0].clientY],l=[u[0]-h[0],u[1]-h[1]];h=u;const d=o()*Math.max(s[2],Math.log(s[2]))*(c?-1:1),f={x:s[0]-l[0]*d,y:s[1]-l[1]*d},p=[[0,0],[i,a]];e.setViewportConstrained({x:f.x,y:f.y,zoom:s[2]},p,t)}:null).on("zoom.wheel",l?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(d,{})},destroy:function(){r.on("zoom",null)},pointer:Ee}},t.XYPanZoom=function({domNode:e,minZoom:n,maxZoom:o,paneClickDistance:r,translateExtent:i,viewport:a,onPanZoom:s,onPanZoomStart:u,onPanZoomEnd:l,onTransformChange:c,onDraggingChange:h}){const d={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{x:0,y:0,zoom:0},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},f=e.getBoundingClientRect(),p=ur().clickDistance(!z(r)||r<0?0:r).scaleExtent([n,o]).translateExtent(i),g=Pe(e).call(p);_({x:a.x,y:a.y,zoom:m(a.zoom,n,o)},[[0,0],[f.width,f.height]],i);const y=g.on("wheel.zoom"),v=g.on("dblclick.zoom");function x(t,e){return g?new Promise((n=>{p?.transform(pr(g,e?.duration,(()=>n(!0))),t)})):Promise.resolve(!1)}function w(){p.on("zoom",null)}async function _(t,e,n){const o=hr(t),r=p?.constrain()(o,e,n);return r&&await x(r),new Promise((t=>t(r)))}return p.wheelDelta(gr),{update:function({noWheelClassName:e,noPanClassName:n,onPaneContextMenu:o,userSelectionActive:r,panOnScroll:i,panOnDrag:a,panOnScrollMode:f,panOnScrollSpeed:m,preventScrolling:x,zoomOnPinch:_,zoomOnScroll:b,zoomOnDoubleClick:M,zoomActivationKeyPressed:P,lib:E}){r&&!d.isZoomingOrPanning&&w();const S=i&&!P&&!r?function({zoomPanValues:e,noWheelClassName:n,d3Selection:o,d3Zoom:r,panOnScrollMode:i,panOnScrollSpeed:a,zoomOnPinch:s,onPanZoomStart:u,onPanZoom:l,onPanZoomEnd:c}){return h=>{if(dr(h,n))return!1;h.preventDefault(),h.stopImmediatePropagation();const d=o.property("__zoom").k||1;if(h.ctrlKey&&s){const t=Ee(h),e=gr(h),n=d*Math.pow(2,e);return void r.scaleTo(o,n,t,h)}const f=1===h.deltaMode?20:1;let p=i===t.PanOnScrollMode.Vertical?0:h.deltaX*f,g=i===t.PanOnScrollMode.Horizontal?0:h.deltaY*f;!$()&&h.shiftKey&&i!==t.PanOnScrollMode.Vertical&&(p=h.deltaY*f,g=0),r.translateBy(o,-p/d*a,-g/d*a,{internal:!0});const m=cr(o.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling||(e.isPanScrolling=!0,u?.(h,m)),e.isPanScrolling&&(l?.(h,m),e.panScrollTimeout=setTimeout((()=>{c?.(h,m),e.isPanScrolling=!1}),150))}}({zoomPanValues:d,noWheelClassName:e,d3Selection:g,d3Zoom:p,panOnScrollMode:f,panOnScrollSpeed:m,zoomOnPinch:_,onPanZoomStart:u,onPanZoom:s,onPanZoomEnd:l}):function({noWheelClassName:t,preventScrolling:e,d3ZoomHandler:n}){return function(o,r){if(!e&&"wheel"===o.type&&!o.ctrlKey||dr(o,t))return null;o.preventDefault(),n.call(this,o,r)}}({noWheelClassName:e,preventScrolling:x,d3ZoomHandler:y});if(g.on("wheel.zoom",S,{passive:!1}),!r){const t=function({zoomPanValues:t,onDraggingChange:e,onPanZoomStart:n}){return o=>{if(o.sourceEvent?.internal)return;const r=cr(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:d,onDraggingChange:h,onPanZoomStart:u});p.on("start",t);const e=function({zoomPanValues:t,panOnDrag:e,onPaneContextMenu:n,onTransformChange:o,onPanZoom:r}){return i=>{t.usedRightMouseButton=!(!n||!fr(e,t.mouseButton??0)),i.sourceEvent?.sync||o([i.transform.x,i.transform.y,i.transform.k]),r&&!i.sourceEvent?.internal&&r?.(i.sourceEvent,cr(i.transform))}}({zoomPanValues:d,panOnDrag:a,onPaneContextMenu:!!o,onPanZoom:s,onTransformChange:c});p.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&&fr(e,t.mouseButton??0)&&!t.usedRightMouseButton&&a.sourceEvent&&i(a.sourceEvent),t.usedRightMouseButton=!1,o(!1),r&&lr(t.prevViewport,a.transform))){const e=cr(a.transform);t.prevViewport=e,clearTimeout(t.timerId),t.timerId=setTimeout((()=>{r?.(a.sourceEvent,e)}),n?150:0)}}}({zoomPanValues:d,panOnDrag:a,panOnScroll:i,onPaneContextMenu:o,onPanZoomEnd:l,onDraggingChange:h});p.on("end",n)}const z=function({zoomActivationKeyPressed:t,zoomOnScroll:e,zoomOnPinch:n,panOnDrag:o,panOnScroll:r,zoomOnDoubleClick:i,userSelectionActive:a,noWheelClassName:s,noPanClassName:u,lib:l}){return c=>{const h=t||e,d=n&&c.ctrlKey;if(1===c.button&&"mousedown"===c.type&&(dr(c,`${l}-flow__node`)||dr(c,`${l}-flow__edge`)))return!0;if(!(o||h||r||i||n))return!1;if(a)return!1;if(dr(c,s)&&"wheel"===c.type)return!1;if(dr(c,u)&&("wheel"!==c.type||r&&"wheel"===c.type&&!t))return!1;if(!n&&c.ctrlKey&&"wheel"===c.type)return!1;if(!n&&"touchstart"===c.type&&c.touches?.length>1)return c.preventDefault(),!1;if(!h&&!r&&!d&&"wheel"===c.type)return!1;if(!o&&("mousedown"===c.type||"touchstart"===c.type))return!1;if(Array.isArray(o)&&!o.includes(c.button)&&"mousedown"===c.type)return!1;const f=Array.isArray(o)&&o.includes(c.button)||!c.button||c.button<=1;return(!c.ctrlKey||"wheel"===c.type)&&f}}({zoomActivationKeyPressed:P,panOnDrag:a,zoomOnScroll:b,panOnScroll:i,zoomOnDoubleClick:M,zoomOnPinch:_,userSelectionActive:r,noPanClassName:n,noWheelClassName:e,lib:E});p.filter(z),M?g.on("dblclick.zoom",v):g.on("dblclick.zoom",null)},destroy:w,setViewport:async function(t,e){const n=hr(t);return await x(n,e),new Promise((t=>t(n)))},setViewportConstrained:_,getViewport:function(){const t=g?Jo(g.node()):{x:0,y:0,k:1};return{x:t.x,y:t.y,zoom:t.k}},scaleTo:function(t,e){return g?new Promise((n=>{p?.scaleTo(pr(g,e?.duration,(()=>n(!0))),t)})):Promise.resolve(!1)},scaleBy:function(t,e){return g?new Promise((n=>{p?.scaleBy(pr(g,e?.duration,(()=>n(!0))),t)})):Promise.resolve(!1)},setScaleExtent:function(t){p?.scaleExtent(t)},setTranslateExtent:function(t){p?.translateExtent(t)},syncViewport:function(t){if(g){const e=hr(t),n=g.property("__zoom");n.k===t.zoom&&n.x===t.x&&n.y===t.y||p?.transform(g,e,null,{sync:!0})}},setClickDistance:function(t){const e=!z(t)||t<0?0:t;p?.clickDistance(e)}}},t.XYResizer=function({domNode:t,nodeId:e,getStoreItems:n,onChange:o,onEnd:r}){const i=Pe(t);return{update:function({controlPosition:t,boundaries:a,keepAspectRatio:s,onResizeStart:u,onResize:l,onResizeEnd:c,shouldResize:h}){let d={..._r},f={...br};const p=function(t){return{isHorizontal:t.includes("right")||t.includes("left"),isVertical:t.includes("bottom")||t.includes("top"),affectsX:t.includes("left"),affectsY:t.includes("top")}}(t);let g,m,y,v,x=[];const w=Be().on("start",(t=>{const{nodeLookup:o,transform:r,snapGrid:i,snapToGrid:a,nodeOrigin:s}=n();if(g=o.get(e),!g)return;const{xSnapped:l,ySnapped:c}=O(t.sourceEvent,{transform:r,snapGrid:i,snapToGrid:a});d={width:g.measured.width??0,height:g.measured.height??0,x:g.position.x??0,y:g.position.y??0},f={...d,pointerX:l,pointerY:c,aspectRatio:d.width/d.height},m=void 0,g.parentId&&("parent"===g.extent||g.expandParent)&&(m=o.get(g.parentId),y=m&&"parent"===g.extent?function(t){return[[0,0],[t.measured.width,t.measured.height]]}(m):void 0),x=[],v=void 0;for(const[t,n]of o)if(n.parentId===e&&(x.push({id:t,position:{...n.position},extent:n.extent}),"parent"===n.extent||n.expandParent)){const t=Mr(n,g,n.origin??s);v=v?[[Math.min(t[0][0],v[0][0]),Math.min(t[0][1],v[0][1])],[Math.max(t[1][0],v[1][0]),Math.max(t[1][1],v[1][1])]]:t}u?.(t,{...d})})).on("drag",(t=>{const{transform:e,snapGrid:r,snapToGrid:i,nodeOrigin:u}=n(),c=O(t.sourceEvent,{transform:e,snapGrid:r,snapToGrid:i}),w=[];if(!g)return;const{x:_,y:b,width:M,height:P}=d,E={},S=g.origin??u,{width:z,height:k,x:N,y:T}=function(t,e,n,o,r,i,a,s){let{affectsX:u,affectsY:l}=e;const{isHorizontal:c,isVertical:h}=e,d=c&&h,{xSnapped:f,ySnapped:p}=n,{minWidth:g,maxWidth:m,minHeight:y,maxHeight:v}=o,{x:x,y:w,width:_,height:b,aspectRatio:M}=t;let P=Math.floor(c?f-t.pointerX:0),E=Math.floor(h?p-t.pointerY:0);const S=_+(u?-P:P),z=b+(l?-E:E),k=-i[0]*_,N=-i[1]*b;let T=xr(S,g,m),A=xr(z,y,v);if(a){let t=0,e=0;u&&P<0?t=yr(x+P+k,a[0][0]):!u&&P>0&&(t=vr(x+S+k,a[1][0])),l&&E<0?e=yr(w+E+N,a[0][1]):!l&&E>0&&(e=vr(w+z+N,a[1][1])),T=Math.max(T,t),A=Math.max(A,e)}if(s){let t=0,e=0;u&&P>0?t=vr(x+P,s[0][0]):!u&&P<0&&(t=yr(x+S,s[1][0])),l&&E>0?e=vr(w+E,s[0][1]):!l&&E<0&&(e=yr(w+z,s[1][1])),T=Math.max(T,t),A=Math.max(A,e)}if(r){if(c){const t=xr(S/M,y,v)*M;if(T=Math.max(T,t),a){let t=0;t=!u&&!l||u&&!l&&d?vr(w+N+S/M,a[1][1])*M:yr(w+N+(u?P:-P)/M,a[0][1])*M,T=Math.max(T,t)}if(s){let t=0;t=!u&&!l||u&&!l&&d?yr(w+S/M,s[1][1])*M:vr(w+(u?P:-P)/M,s[0][1])*M,T=Math.max(T,t)}}if(h){const t=xr(z*M,g,m)/M;if(A=Math.max(A,t),a){let t=0;t=!u&&!l||l&&!u&&d?vr(x+z*M+k,a[1][0])/M:yr(x+(l?E:-E)*M+k,a[0][0])/M,A=Math.max(A,t)}if(s){let t=0;t=!u&&!l||l&&!u&&d?yr(x+z*M,s[1][0])/M:vr(x+(l?E:-E)*M,s[0][0])/M,A=Math.max(A,t)}}}E+=E<0?A:-A,P+=P<0?T:-T,r&&(d?S>z*M?E=(wr(u,l)?-P:P)/M:P=(wr(u,l)?-E:E)*M:c?(E=P/M,l=u):(P=E*M,u=l));const I=u?x+P:x,$=l?w+E:w;return{width:_+(u?-P:P),height:b+(l?-E:E),x:i[0]*P*(u?-1:1)+I,y:i[1]*E*(l?-1:1)+$}}(f,p,c,a,s,S,y,v),A=z!==M,I=k!==P,$=N!==_&&A,C=T!==b&&I;if(!($||C||A||I))return;if(($||C||1===S[0]||1===S[1])&&(E.x=$?N:d.x,E.y=C?T:d.y,d.x=E.x,d.y=E.y,x.length>0)){const t=N-_,e=T-b;for(const n of x)n.position={x:n.position.x-t+S[0]*(z-M),y:n.position.y-e+S[1]*(k-P)},w.push(n)}if((A||I)&&(E.width=A?z:d.width,E.height=I?k:d.height,d.width=E.width,d.height=E.height),m&&g.expandParent){const t=S[0]*(E.width??0);E.x&&E.x<t&&(d.x=t,f.x=f.x-(E.x-t));const e=S[1]*(E.height??0);E.y&&E.y<e&&(d.y=e,f.y=f.y-(E.y-e))}const H=function({width:t,prevWidth:e,height:n,prevHeight:o,affectsX:r,affectsY:i}){const a=t-e,s=n-o,u=[a>0?1:a<0?-1:0,s>0?1:s<0?-1:0];return a&&r&&(u[0]=-1*u[0]),s&&i&&(u[1]=-1*u[1]),u}({width:d.width,prevWidth:M,height:d.height,prevHeight:P,affectsX:p.affectsX,affectsY:p.affectsY}),X={...d,direction:H},B=h?.(t,X);!1!==B&&(l?.(t,X),o(E,w))})).on("end",(t=>{c?.(t,{...d}),r?.()}));i.call(w)},destroy:function(){i.on(".drag",null)}}},t.XY_RESIZER_HANDLE_POSITIONS=["top-left","top-right","bottom-left","bottom-right"],t.XY_RESIZER_LINE_POSITIONS=["top","right","bottom","left"],t.addEdge=(t,n)=>{if(!t.source||!t.target)return e.error006(),n;let o;return o=c(t)?{...t}:{...t,id:j(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:(null===o.sourceHandle&&delete o.sourceHandle,null===o.targetHandle&&delete o.targetHandle,n.concat(o))},t.adoptUserNodes=function(t,e,n,o){const r={...ot,...o},i=new Map(e);e.clear(),n.clear();const a=o?.elevateNodesOnSelect?1e3:0;for(const s of t){let t=i.get(s.id);r.checkEquality&&s===t?.internals.userNode||(t={...r.defaults,...s,measured:{width:s.measured?.width,height:s.measured?.height},internals:{positionAbsolute:d(s,r.nodeOrigin),handleBounds:s.measured?t?.internals.handleBounds:void 0,z:it(s,a),userNode:s}}),e.set(s.id,t),s.parentId&&rt(t,e,n,o)}},t.areConnectionMapsEqual=function(t,e){if(!t&&!e)return!0;if(!t||!e||t.size!==e.size)return!1;if(!t.size&&!e.size)return!0;for(const n of t.keys())if(!e.has(n))return!1;return!0},t.boxToRect=b,t.calcAutoPan=x,t.calculateNodePosition=g,t.clamp=m,t.clampPosition=y,t.createMarkerIds=function(t,{id:e,defaultColor:n,defaultMarkerStart:o,defaultMarkerEnd:r}){const i=new Set;return t.reduce(((t,a)=>([a.markerStart||o,a.markerEnd||r].forEach((o=>{if(o&&"object"==typeof o){const r=et(o,e);i.has(r)||(t.push({id:r,color:o.color||n,...o}),i.add(r))}})),t)),[]).sort(((t,e)=>t.id.localeCompare(e.id)))},t.devWarn=k,t.elementSelectionKeys=["Enter"," ","Escape"],t.errorMessages=e,t.evaluateAbsolutePosition=function(t,e={width:0,height:0},n,o,r){let i=n;const a={...t};for(;i;){const t=o.get(i);if(i=t?.parentId,t){const n=t.origin||r;a.x+=t.internals.positionAbsolute.x-(e.width??0)*n[0],a.y+=t.internals.positionAbsolute.y-(e.height??0)*n[1]}}return a},t.fitView=async function({nodes:t,width:e,height:n,panZoom:o,minZoom:r,maxZoom:i},a){if(0===t.size)return Promise.resolve(!1);const s=f(t),u=I(s,e,n,a?.minZoom??r,a?.maxZoom??i,a?.padding??.1);return await o.setViewport(u,{duration:a?.duration}),Promise.resolve(!0)},t.getBezierEdgeCenter=V,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,l]=Z({pos:o,x1:e,y1:n,x2:r,y2:i,c:s}),[c,h]=Z({pos:a,x1:r,y1:i,x2:e,y2:n,c:s}),[d,f,p,g]=V({sourceX:e,sourceY:n,targetX:r,targetY:i,sourceControlX:u,sourceControlY:l,targetControlX:c,targetControlY:h});return[`M${e},${n} C${u},${l} ${c},${h} ${r},${i}`,d,f,p,g]},t.getBoundsOfBoxes=w,t.getBoundsOfRects=E,t.getConnectedEdges=p,t.getConnectionStatus=function(t){return null===t?null:t?"valid":"invalid"},t.getDimensions=X,t.getEdgeCenter=G,t.getEdgePosition=function(n){const{sourceNode:o,targetNode:r}=n;if(!U(o)||!U(r))return null;const i=o.internals.handleBounds||Q(o.handles),a=r.internals.handleBounds||Q(r.handles),s=tt(i?.source??[],n.sourceHandle),u=tt(n.connectionMode===t.ConnectionMode.Strict?a?.target??[]:(a?.target??[]).concat(a?.source??[]),n.targetHandle);if(!s||!u)return n.onError?.("008",e.error008(s?"target":"source",{id:n.id,sourceHandle:n.sourceHandle,targetHandle:n.targetHandle})),null;const l=s?.position||t.Position.Bottom,c=u?.position||t.Position.Top,h=J(o,s,l),d=J(r,u,c);return{sourceX:h.x,sourceY:h.y,targetX:d.x,targetY:d.y,sourcePosition:l,targetPosition:c}},t.getElementsToRemove=async function({nodesToRemove:t=[],edgesToRemove:e=[],nodes:n,edges:o,onBeforeDelete:r}){const i=new Set(t.map((t=>t.id))),a=[];for(const t of n){if(!1===t.deletable)continue;const e=i.has(t.id),n=!e&&t.parentId&&a.find((e=>e.id===t.parentId));(e||n)&&a.push(t)}const s=new Set(e.map((t=>t.id))),u=o.filter((t=>!1!==t.deletable)),l=p(a,u);for(const t of u){s.has(t.id)&&!l.find((e=>e.id===t.id))&&l.push(t)}if(!r)return{edges:l,nodes:a};const c=await r({nodes:a,edges:l});return"boolean"==typeof c?c?{edges:l,nodes:a}:{edges:[],nodes:[]}:c},t.getElevatedEdgeZIndex=function({sourceNode:t,targetNode:e,selected:n=!1,zIndex:o=0,elevateOnSelect:r=!1}){if(!r)return o;const i=n||e.selected||t.selected,a=Math.max(t.internals.z||0,e.internals.z||0,1e3);return o+(i?a:0)},t.getEventPosition=D,t.getFitViewNodes=function(t,e){const n=new Map,o=e?.nodes?new Set(e.nodes.map((t=>t.id))):null;return t.forEach((t=>{!(t.measured.width&&t.measured.height&&(e?.includeHiddenNodes||!t.hidden))||o&&!o.has(t.id)||n.set(t.id,t)})),n},t.getHandleBounds=L,t.getHandlePosition=J,t.getHostForElement=B,t.getIncomers=(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.getInternalNodesBounds=f,t.getMarkerId=et,t.getNodeDimensions=H,t.getNodePositionWithOrigin=d,t.getNodeToolbarTransform=function(e,n,o,r,i){let a=.5;"start"===i?a=0:"end"===i&&(a=1);let s=[(e.x+e.width*a)*n.zoom+n.x,e.y*n.zoom+n.y-r],u=[-100*a,-100];switch(o){case t.Position.Right:s=[(e.x+e.width)*n.zoom+n.x+r,(e.y+e.height*a)*n.zoom+n.y],u=[0,-100*a];break;case t.Position.Bottom:s[1]=(e.y+e.height)*n.zoom+n.y+r,u[1]=0;break;case t.Position.Left:s=[e.x*n.zoom+n.x-r,(e.y+e.height*a)*n.zoom+n.y],u=[-100,-100*a]}return`translate(${s[0]}px, ${s[1]}px) translate(${u[0]}%, ${u[1]}%)`},t.getNodesBounds=(t,e={nodeOrigin:[0,0]})=>{if(0===t.length)return{x:0,y:0,width:0,height:0};const n=t.reduce(((t,n)=>{const o=P(n,e.nodeOrigin);return w(t,o)}),{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return b(n)},t.getNodesInside=(t,e,[n,o,r]=[0,0,1],i=!1,a=!1)=>{const s={...T(e,[n,o,r]),width:e.width/r,height:e.height/r},u=[];for(const[,e]of t){const{measured:t,selectable:n=!0,hidden:o=!1}=e,r=t.width??e.width??e.initialWidth??null,l=t.height??e.height??e.initialHeight??null;if(a&&!n||o)continue;const c=S(s,M(e));(null===r||null===l||i&&c>0||c>=(r??0)*(l??0)||e.dragging)&&u.push(e)}return u},t.getOutgoers=(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=S,t.getPointerPosition=O,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:l,offset:c=20}){const[h,d,f,p,g]=function({source:e,sourcePosition:n=t.Position.Bottom,target:o,targetPosition:r=t.Position.Top,center:i,offset:a}){const s=F[n],u=F[r],l={x:e.x+s.x*a,y:e.y+s.y*a},c={x:o.x+u.x*a,y:o.y+u.y*a},h=W({source:l,sourcePosition:n,target:c}),d=0!==h.x?"x":"y",f=h[d];let p,g,m=[];const y={x:0,y:0},v={x:0,y:0},[x,w,_,b]=G({sourceX:e.x,sourceY:e.y,targetX:o.x,targetY:o.y});if(s[d]*u[d]==-1){p=i.x??x,g=i.y??w;const t=[{x:p,y:l.y},{x:p,y:c.y}],e=[{x:l.x,y:g},{x:c.x,y:g}];m=s[d]===f?"x"===d?t:e:"x"===d?e:t}else{const t=[{x:l.x,y:c.y}],i=[{x:c.x,y:l.y}];if(m="x"===d?s.x===f?i:t:s.y===f?t:i,n===r){const t=Math.abs(e[d]-o[d]);if(t<=a){const n=Math.min(a-1,a-t);s[d]===f?y[d]=(l[d]>e[d]?-1:1)*n:v[d]=(c[d]>o[d]?-1:1)*n}}if(n!==r){const e="x"===d?"y":"x",n=s[d]===u[e],o=l[e]>c[e],r=l[e]<c[e];(1===s[d]&&(!n&&o||n&&r)||1!==s[d]&&(!n&&r||n&&o))&&(m="x"===d?t:i)}const h={x:l.x+y.x,y:l.y+y.y},x={x:c.x+v.x,y:c.y+v.y};Math.max(Math.abs(h.x-m[0].x),Math.abs(x.x-m[0].x))>=Math.max(Math.abs(h.y-m[0].y),Math.abs(x.y-m[0].y))?(p=(h.x+x.x)/2,g=m[0].y):(p=m[0].x,g=(h.y+x.y)/2)}return[[e,{x:l.x+y.x,y:l.y+y.y},...m,{x:c.x+v.x,y:c.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:l},offset:c});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(K(t,e)/2,K(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}),""),d,f,p,g]},t.getStraightPath=function({sourceX:t,sourceY:e,targetX:n,targetY:o}){const[r,i,a,s]=G({sourceX:t,sourceY:e,targetX:n,targetY:o});return[`M ${t},${e}L ${n},${o}`,r,i,a,s]},t.getViewportForBounds=I,t.handleConnectionChange=function(t,e,n){if(!n)return;const o=[];t.forEach(((t,n)=>{e?.has(n)||o.push(t)})),o.length&&n(o)},t.handleExpandParent=at,t.infiniteExtent=n,t.initialConnection={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null},t.isCoordinateExtent=C,t.isEdgeBase=c,t.isEdgeVisible=function({sourceNode:t,targetNode:e,width:n,height:o,transform:r}){const i=w(P(t),P(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 S(a,b(i))>0},t.isInputDOMNode=function(t){const e=t.composedPath?.()?.[0]||t.target;return Y.includes(e?.nodeName)||e?.hasAttribute("contenteditable")||!!e?.closest(".nokey")},t.isInternalNodeBase=h,t.isMacOs=$,t.isMouseEvent=R,t.isNodeBase=t=>"id"in t&&"position"in t&&!("source"in t)&&!("target"in t),t.isNumeric=z,t.isRectObject=t=>z(t.width)&&z(t.height)&&z(t.x)&&z(t.y),t.nodeHasDimensions=function(t){return void 0!==(t.measured?.width??t.width??t.initialWidth)&&void 0!==(t.measured?.height??t.height??t.initialHeight)},t.nodeToBox=P,t.nodeToRect=M,t.oppositePosition=l,t.panBy=async function({delta:t,panZoom:e,transform:n,translateExtent:o,width:r,height:i}){if(!e||!t.x&&!t.y)return Promise.resolve(!1);const a=await e.setViewportConstrained({x:n[0]+t.x,y:n[1]+t.y,zoom:n[2]},[[0,0],[r,i]],o),s=!!a&&(a.x!==n[0]||a.y!==n[1]||a.k!==n[2]);return Promise.resolve(s)},t.pointToRendererPoint=T,t.reconnectEdge=(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?j(n):i,source:n.source,target:n.target,sourceHandle:n.sourceHandle,targetHandle:n.targetHandle};return o.filter((t=>t.id!==i)).concat(s)},t.rectToBox=_,t.rendererPointToPoint=A,t.shallowNodeData=function(t,e){if(null===t||null===e)return!1;const n=Array.isArray(t)?t:[t],o=Array.isArray(e)?e:[e];if(n.length!==o.length)return!1;for(let t=0;t<n.length;t++)if(n[t].id!==o[t].id||n[t].type!==o[t].type||!Object.is(n[t].data,o[t].data))return!1;return!0},t.snapPosition=N,t.updateAbsolutePositions=function(t,e,n){const o={...nt,...n};for(const n of t.values())n.parentId&&rt(n,t,e,o)},t.updateConnectionLookup=function(t,e,n){t.clear(),e.clear();for(const o of n){const{source:n,target:r,sourceHandle:i=null,targetHandle:a=null}=o,s=`${n}-source-${i}`,u=`${r}-target-${a}`,l=t.get(s)||new Map,c=t.get(u)||new Map,h={edgeId:o.id,source:n,target:r,sourceHandle:i,targetHandle:a};e.set(o.id,o),t.set(s,l.set(`${r}-${a}`,h)),t.set(u,c.set(`${n}-${i}`,h))}},t.updateNodeInternals=function(t,e,n,o,r){const i=o?.querySelector(".xyflow__viewport");let a=!1;if(!i)return{changes:[],updatedInternals:a};const s=[],u=window.getComputedStyle(i),{m22:l}=new window.DOMMatrixReadOnly(u.transform),c=[];for(const o of t.values()){const t=e.get(o.id);if(t)if(t.hidden)t.internals={...t.internals,handleBounds:void 0},a=!0;else{const i=X(o.nodeElement),u=t.measured.width!==i.width||t.measured.height!==i.height;if(!(!i.width||!i.height||!u&&t.internals.handleBounds&&!o.force)){const h=o.nodeElement.getBoundingClientRect();t.measured=i,t.internals={...t.internals,positionAbsolute:d(t,r),handleBounds:{source:L("source",o.nodeElement,h,l,t.id),target:L("target",o.nodeElement,h,l,t.id)}},t.parentId&&rt(t,e,n,{nodeOrigin:r}),a=!0,u&&(s.push({id:t.id,type:"dimensions",dimensions:i}),t.expandParent&&t.parentId&&c.push({id:t.id,parentId:t.parentId,rect:M(t,r)}))}}}if(c.length>0){const t=at(c,e,n,r);s.push(...t)}return{changes:s,updatedInternals:a}}}));
@@ -1 +1 @@
1
- {"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../src/utils/store.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EACR,gBAAgB,EAChB,kBAAkB,EAClB,UAAU,EACV,eAAe,EACf,SAAS,EACT,UAAU,EACV,gBAAgB,EAChB,QAAQ,EACR,UAAU,EACV,gBAAgB,EAChB,UAAU,EAEV,mBAAmB,EACnB,kBAAkB,EAClB,YAAY,EACb,MAAM,UAAU,CAAC;AAIlB,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS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EAAE,MAAM,CAAC;CAChB,GAAG,OAAO,CAAC,OAAO,CAAC,CAuBnB;AAED,wBAAgB,sBAAsB,CAAC,gBAAgB,EAAE,gBAAgB,EAAE,UAAU,EAAE,UAAU,EAAE,KAAK,EAAE,QAAQ,EAAE,QAkBnH"}
@@ -48,6 +48,7 @@ export type DragUpdateParams = {
48
48
  isSelectable?: boolean;
49
49
  nodeId?: string;
50
50
  domNode: Element;
51
+ nodeClickDistance?: number;
51
52
  };
52
53
  export declare function XYDrag<OnNodeDrag extends (e: any, nodes: any, node: any) => void | undefined>({ onNodeMouseDown, getStoreItems, onDragStart, onDrag, onDragStop, }: XYDragParams<OnNodeDrag>): XYDragInstance;
53
54
  export {};
@@ -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,eAAe,EACf,mBAAmB,EAEnB,gBAAgB,EACjB,MAAM,UAAU,CAAC;AAElB,MAAM,MAAM,MAAM,GAAG,CACnB,KAAK,EAAE,UAAU,EACjB,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,EACpC,IAAI,EAAE,QAAQ,EACd,KAAK,EAAE,QAAQ,EAAE,KACd,IAAI,CAAC;AAEV,KAAK,UAAU,CAAC,UAAU,IAAI;IAC5B,KAAK,EAAE,QAAQ,EAAE,CAAC;IAClB,UAAU,EAAE,GAAG,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;IAC1C,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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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;IACjB,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B,CAAC;AAGF,wBAAgB,MAAM,CAAC,UAAU,SAAS,CAAC,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,KAAK,IAAI,GAAG,SAAS,EAAE,EAC7F,eAAe,EACf,aAAa,EACb,WAAW,EACX,MAAM,EACN,UAAU,GACX,EAAE,YAAY,CAAC,UAAU,CAAC,GAAG,cAAc,CAwR3C"}
@@ -1 +1 @@
1
- {"version":3,"file":"XYHandle.d.ts","sourceRoot":"","sources":["../../src/xyhandle/XYHandle.ts"],"names":[],"mappings":"AAkBA,OAAO,EAA8C,gBAAgB,EAAE,MAAM,SAAS,CAAC;AA0RvF,eAAO,MAAM,QAAQ,EAAE,gBAGtB,CAAC"}
1
+ {"version":3,"file":"XYHandle.d.ts","sourceRoot":"","sources":["../../src/xyhandle/XYHandle.ts"],"names":[],"mappings":"AAkBA,OAAO,EAA8C,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAsRvF,eAAO,MAAM,QAAQ,EAAE,gBAGtB,CAAC"}
@@ -33,7 +33,7 @@ export type IsValidParams = {
33
33
  doc: Document | ShadowRoot;
34
34
  lib: string;
35
35
  flowId: string | null;
36
- handleLookup?: Handle[];
36
+ handleLookup?: Map<string, Handle>;
37
37
  };
38
38
  export type XYHandleInstance = {
39
39
  onPointerDown: (event: MouseEvent | TouchEvent, params: OnPointerDownParams) => void;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/xyhandle/types.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,KAAK,UAAU,EACf,KAAK,SAA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AAgB,GAAG;IAC7B,aAAa,EAAE,CAAC,KAAK,EAAE,UAAU,GAAG,UAAU,EAAE,MAAM,EAAE,mBAAmB,KAAK,IAAI,CAAC;IACrF,OAAO,EAAE,CAAC,KAAK,EAAE,UAAU,GAAG,UAAU,EAAE,MAAM,EAAE,aAAa,KAAK,MAAM,CAAC;CAC5E,CAAC;AAEF,MAAM,MAAM,MAAM,GAAG;IACnB,aAAa,EAAE,OAAO,GAAG,IAAI,CAAC;IAC9B,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,UAAU,GAAG,IAAI,CAAC;IAC9B,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB,CAAC"}
@@ -1,12 +1,12 @@
1
1
  import { type HandleType, type XYPosition, type Handle, NodeLookup } from '../types';
2
- export declare function getClosestHandle(pos: XYPosition, connectionRadius: number, handles: Handle[]): Handle | null;
2
+ export declare function getClosestHandle(pos: XYPosition, connectionRadius: number, handleLookup: Map<string, Handle>): Handle | null;
3
3
  type GetHandleLookupParams = {
4
4
  nodeLookup: NodeLookup;
5
5
  nodeId: string;
6
6
  handleId: string | null;
7
7
  handleType: HandleType;
8
8
  };
9
- export declare function getHandleLookup({ nodeLookup, nodeId, handleId, handleType, }: GetHandleLookupParams): [Handle[], Handle];
9
+ export declare function getHandleLookup({ nodeLookup, nodeId, handleId, handleType, }: GetHandleLookupParams): [Map<string, Handle>, Handle];
10
10
  export declare function getHandleType(edgeUpdaterType: HandleType | undefined, handleDomNode: Element | null): HandleType | null;
11
11
  export declare function isConnectionValid(isInsideConnectionRadius: boolean, isHandleValid: boolean): boolean | null;
12
12
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/xyhandle/utils.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,UAAU,EAEf,KAAK,UAAU,EACf,KAAK,MAAM,EAEX,UAAU,EACX,MAAM,UAAU,CAAC;AAuBlB,wBAAgB,gBAAgB,CAAC,G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AAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,CAgCvD;AAED,wBAAgB,aAAa,CAC3B,eAAe,EAAE,UAAU,GAAG,SAAS,EACvC,aAAa,EAAE,OAAO,GAAG,IAAI,GAC5B,UAAU,GAAG,IAAI,CAUnB;AAED,wBAAgB,iBAAiB,CAAC,wBAAwB,EAAE,OAAO,EAAE,aAAa,EAAE,OAAO,kBAU1F"}
@@ -1,11 +1,11 @@
1
1
  import type { D3DragEvent, SubjectPosition } from 'd3-drag';
2
- export type XYResizerParams = {
2
+ export type ResizeParams = {
3
3
  x: number;
4
4
  y: number;
5
5
  width: number;
6
6
  height: number;
7
7
  };
8
- export type XYResizerParamsWithDirection = XYResizerParams & {
8
+ export type ResizeParamsWithDirection = ResizeParams & {
9
9
  direction: number[];
10
10
  };
11
11
  export type ControlLinePosition = 'top' | 'bottom' | 'left' | 'right';
@@ -16,11 +16,11 @@ export declare enum ResizeControlVariant {
16
16
  }
17
17
  export declare const XY_RESIZER_HANDLE_POSITIONS: ControlPosition[];
18
18
  export declare const XY_RESIZER_LINE_POSITIONS: ControlLinePosition[];
19
- type OnResizeHandler<Params = XYResizerParams, Result = void> = (event: ResizeDragEvent, params: Params) => Result;
19
+ type OnResizeHandler<Params = ResizeParams, Result = void> = (event: ResizeDragEvent, params: Params) => Result;
20
20
  export type ResizeDragEvent = D3DragEvent<HTMLDivElement, null, SubjectPosition>;
21
- export type ShouldResize = OnResizeHandler<XYResizerParamsWithDirection, boolean>;
21
+ export type ShouldResize = OnResizeHandler<ResizeParamsWithDirection, boolean>;
22
22
  export type OnResizeStart = OnResizeHandler;
23
- export type OnResize = OnResizeHandler<XYResizerParamsWithDirection>;
23
+ export type OnResize = OnResizeHandler<ResizeParamsWithDirection>;
24
24
  export type OnResizeEnd = OnResizeHandler;
25
25
  export {};
26
26
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../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O,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE5D,MAAM,MAAM,YAAY,GAAG;IACzB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG,YAAY,GAAG;IACrD,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAC;AAEtE,MAAM,MAAM,eAAe,GAAG,mBAAmB,GAAG,UAAU,GAAG,WAAW,GAAG,aAAa,GAAG,cAAc,CAAC;AAE9G,oBAAY,oBAAoB;IAC9B,IAAI,SAAS;IACb,MAAM,WAAW;CAClB;AAED,eAAO,MAAM,2BAA2B,EAAE,eAAe,EAA6D,CAAC;AACvH,eAAO,MAAM,yBAAyB,EAAE,mBAAmB,EAAuC,CAAC;AAEnG,KAAK,eAAe,CAAC,MAAM,GAAG,YAAY,EAAE,MAAM,GAAG,IAAI,IAAI,CAAC,KAAK,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,KAAK,MAAM,CAAC;AAChH,MAAM,MAAM,eAAe,GAAG,WAAW,CAAC,cAAc,EAAE,IAAI,EAAE,eAAe,CAAC,CAAC;AAEjF,MAAM,MAAM,YAAY,GAAG,eAAe,CAAC,yBAAyB,EAAE,OAAO,CAAC,CAAC;AAC/E,MAAM,MAAM,aAAa,GAAG,eAAe,CAAC;AAC5C,MAAM,MAAM,QAAQ,GAAG,eAAe,CAAC,yBAAyB,CAAC,CAAC;AAClE,MAAM,MAAM,WAAW,GAAG,eAAe,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xyflow/system",
3
- "version": "0.0.35",
3
+ "version": "0.0.37",
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/eslint-config": "0.0.0",
51
50
  "@xyflow/rollup-config": "0.0.0",
52
- "@xyflow/tsconfig": "0.0.0"
51
+ "@xyflow/tsconfig": "0.0.0",
52
+ "@xyflow/eslint-config": "0.0.0"
53
53
  },
54
54
  "rollup": {
55
55
  "globals": {