@next-bricks/diagram 0.44.0 → 0.45.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bricks.json +5 -5
- package/dist/chunks/6055.b4910896.js +2 -0
- package/dist/chunks/6055.b4910896.js.map +1 -0
- package/dist/chunks/9711.53cc8f27.js +2 -0
- package/dist/chunks/9711.53cc8f27.js.map +1 -0
- package/dist/chunks/eo-display-canvas.e3d73902.js +2 -0
- package/dist/chunks/eo-display-canvas.e3d73902.js.map +1 -0
- package/dist/chunks/eo-draw-canvas.72086195.js +2 -0
- package/dist/chunks/eo-draw-canvas.72086195.js.map +1 -0
- package/dist/chunks/{main.3c306a02.js → main.7aa44cbf.js} +2 -2
- package/dist/chunks/{main.3c306a02.js.map → main.7aa44cbf.js.map} +1 -1
- package/dist/examples.json +3 -3
- package/dist/{index.9179413f.js → index.89f5ea83.js} +2 -2
- package/dist/{index.9179413f.js.map → index.89f5ea83.js.map} +1 -1
- package/dist/manifest.json +94 -93
- package/dist/types.json +3464 -3372
- package/dist-types/draw-canvas/HoverStateContext.d.ts +3 -3
- package/dist-types/draw-canvas/LineConnectorComponent.d.ts +2 -3
- package/dist-types/draw-canvas/LineEditorComponent.d.ts +2 -3
- package/dist-types/draw-canvas/index.d.ts +3 -0
- package/dist-types/draw-canvas/interfaces.d.ts +32 -6
- package/dist-types/shared/canvas/processors/getEditingLinePoints.d.ts +2 -1
- package/dist-types/shared/canvas/processors/getSmartLinePoints.d.ts +1 -1
- package/dist-types/shared/canvas/processors/getSmartLinePoints.spec.d.ts +1 -0
- package/dist-types/shared/canvas/useActiveTarget.d.ts +2 -2
- package/package.json +2 -2
- package/dist/chunks/6055.b92cd119.js +0 -2
- package/dist/chunks/6055.b92cd119.js.map +0 -1
- package/dist/chunks/9711.8210cef5.js +0 -2
- package/dist/chunks/9711.8210cef5.js.map +0 -1
- package/dist/chunks/eo-display-canvas.05693123.js +0 -2
- package/dist/chunks/eo-display-canvas.05693123.js.map +0 -1
- package/dist/chunks/eo-draw-canvas.c06550f7.js +0 -2
- package/dist/chunks/eo-draw-canvas.c06550f7.js.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import type { DecoratorCell, EditableLineInfo, LineEditorState, NodeCell, SmartConnectLineState } from "./interfaces";
|
|
2
|
+
import type { DecoratorCell, EdgeView, EditableLineInfo, LineEditorState, NodeCell, SmartConnectLineState } from "./interfaces";
|
|
3
3
|
import type { NodePosition } from "../diagram/interfaces";
|
|
4
4
|
export interface HoverState {
|
|
5
5
|
cell: NodeCell | DecoratorCell;
|
|
@@ -19,7 +19,7 @@ export declare const HoverStateContext: React.Context<{
|
|
|
19
19
|
setHoverState: React.Dispatch<React.SetStateAction<HoverState | null>>;
|
|
20
20
|
setSmartConnectLineState: React.Dispatch<React.SetStateAction<SmartConnectLineState | null>>;
|
|
21
21
|
onConnect?: (source: NodeCell | DecoratorCell, target: NodeCell | DecoratorCell, exitPosition: NodePosition, entryPosition: NodePosition | undefined) => void;
|
|
22
|
-
|
|
22
|
+
onChangeEdgeView?: (source: NodeCell | DecoratorCell, target: NodeCell | DecoratorCell, view: EdgeView) => void;
|
|
23
23
|
}>;
|
|
24
24
|
export declare function useHoverStateContext(): {
|
|
25
25
|
rootRef: React.RefObject<SVGSVGElement>;
|
|
@@ -33,5 +33,5 @@ export declare function useHoverStateContext(): {
|
|
|
33
33
|
setHoverState: React.Dispatch<React.SetStateAction<HoverState | null>>;
|
|
34
34
|
setSmartConnectLineState: React.Dispatch<React.SetStateAction<SmartConnectLineState | null>>;
|
|
35
35
|
onConnect?: (source: NodeCell | DecoratorCell, target: NodeCell | DecoratorCell, exitPosition: NodePosition, entryPosition: NodePosition | undefined) => void;
|
|
36
|
-
|
|
36
|
+
onChangeEdgeView?: (source: NodeCell | DecoratorCell, target: NodeCell | DecoratorCell, view: EdgeView) => void;
|
|
37
37
|
};
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import type { ActiveTarget } from "./interfaces";
|
|
2
|
-
import type { TransformLiteral } from "../diagram/interfaces";
|
|
3
2
|
export interface LineConnectorComponentProps {
|
|
4
3
|
activeTarget: ActiveTarget | null;
|
|
5
|
-
|
|
4
|
+
scale: number;
|
|
6
5
|
disabled?: boolean;
|
|
7
6
|
}
|
|
8
|
-
export declare function LineConnectorComponent({ activeTarget,
|
|
7
|
+
export declare function LineConnectorComponent({ activeTarget, scale, disabled, }: LineConnectorComponentProps): JSX.Element | null;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type { TransformLiteral } from "../diagram/interfaces";
|
|
2
1
|
export interface LineEditorComponentProps {
|
|
3
|
-
|
|
2
|
+
scale: number;
|
|
4
3
|
}
|
|
5
|
-
export declare function LineEditorComponent({
|
|
4
|
+
export declare function LineEditorComponent({ scale, }: LineEditorComponentProps): JSX.Element | null;
|
|
@@ -72,6 +72,9 @@ export declare class EoDrawCanvas extends ReactNextElement implements EoDrawCanv
|
|
|
72
72
|
accessor cells: InitialCell[] | undefined;
|
|
73
73
|
accessor layout: LayoutType;
|
|
74
74
|
accessor layoutOptions: LayoutOptions | undefined;
|
|
75
|
+
/**
|
|
76
|
+
* @default [100,20]
|
|
77
|
+
*/
|
|
75
78
|
accessor defaultNodeSize: SizeTuple;
|
|
76
79
|
accessor defaultNodeBricks: NodeBrickConf[] | undefined;
|
|
77
80
|
/**
|
|
@@ -62,8 +62,9 @@ export interface NodeBrickConf {
|
|
|
62
62
|
if?: string | boolean | null;
|
|
63
63
|
}
|
|
64
64
|
export interface EdgeView {
|
|
65
|
-
exitPosition?: NodePosition;
|
|
66
|
-
entryPosition?: NodePosition;
|
|
65
|
+
exitPosition?: NodePosition | null;
|
|
66
|
+
entryPosition?: NodePosition | null;
|
|
67
|
+
vertices?: NodePosition[] | null;
|
|
67
68
|
}
|
|
68
69
|
export interface EdgeLineConf extends BaseEdgeLineConf {
|
|
69
70
|
if?: string | boolean | null;
|
|
@@ -237,11 +238,36 @@ export interface EditableLineInfo {
|
|
|
237
238
|
edge: EdgeCell;
|
|
238
239
|
source: NodeCell | DecoratorCell;
|
|
239
240
|
target: NodeCell | DecoratorCell;
|
|
240
|
-
|
|
241
|
-
exitPosition?: NodePosition;
|
|
242
|
-
entryPosition?: NodePosition;
|
|
241
|
+
linePoints: NodePosition[];
|
|
243
242
|
}
|
|
244
|
-
export
|
|
243
|
+
export type LineEditorState = LineEditorStateOfEndPoint | LineEditorStateOfControl;
|
|
244
|
+
export interface LineEditorStateOfEndPoint extends EditableLineInfo {
|
|
245
245
|
type: "exit" | "entry";
|
|
246
246
|
offset: PositionTuple;
|
|
247
|
+
from: PositionTuple;
|
|
248
|
+
}
|
|
249
|
+
export interface LineEditorStateOfControl extends EditableLineInfo {
|
|
250
|
+
type: "control";
|
|
251
|
+
offset: PositionTuple;
|
|
252
|
+
from: PositionTuple;
|
|
253
|
+
control: ControlPoint;
|
|
254
|
+
}
|
|
255
|
+
/**
|
|
256
|
+
* A control point for editing line is the middle point of a line segment.
|
|
257
|
+
*
|
|
258
|
+
* Direction means the control point changes on the what direction,
|
|
259
|
+
* ns means north-south, ew means east-west.
|
|
260
|
+
*
|
|
261
|
+
* ```
|
|
262
|
+
* C1 ┌─────┐
|
|
263
|
+
* ┌──⊙──┤ T │
|
|
264
|
+
* C0 ⊙ └─────┘
|
|
265
|
+
* ┌──┴──┐
|
|
266
|
+
* │ S │
|
|
267
|
+
* └─────┘
|
|
268
|
+
* ```
|
|
269
|
+
*/
|
|
270
|
+
export interface ControlPoint extends NodePosition {
|
|
271
|
+
direction: "ns" | "ew";
|
|
272
|
+
index: number;
|
|
247
273
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { NodePosition, PositionTuple } from "../../../diagram/interfaces";
|
|
2
2
|
import type { HoverState } from "../../../draw-canvas/HoverStateContext";
|
|
3
|
-
import type { LineEditorState } from "../../../draw-canvas/interfaces";
|
|
3
|
+
import type { LineEditorState, LineEditorStateOfControl } from "../../../draw-canvas/interfaces";
|
|
4
4
|
export declare function getEditingLinePoints(lineEditorState: LineEditorState | null, connectLineTo: PositionTuple | null, hoverState: HoverState | null): NodePosition[] | null;
|
|
5
|
+
export declare function getNewLineVertices(lineEditorState: LineEditorStateOfControl, connectLineTo: PositionTuple): NodePosition[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { NodePosition } from "../../../diagram/interfaces";
|
|
2
2
|
import type { EdgeView, NodeView } from "../../../draw-canvas/interfaces";
|
|
3
|
-
export declare function getSmartLinePoints(sourceView: NodeView, targetView: NodeView,
|
|
3
|
+
export declare function getSmartLinePoints(sourceView: NodeView, targetView: NodeView, edgeView: EdgeView): NodePosition[];
|
|
4
4
|
export declare function getDefaultPosition(sourceView: NodeView, targetView: NodeView): NodePosition;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import type { ActiveTarget } from "../../draw-canvas/interfaces";
|
|
3
3
|
export interface UseActiveTargetOptions {
|
|
4
|
-
|
|
4
|
+
rootRef: React.RefObject<SVGGElement>;
|
|
5
5
|
activeTarget?: ActiveTarget | null;
|
|
6
6
|
onActiveTargetChange(target: ActiveTarget | null): void;
|
|
7
7
|
}
|
|
8
8
|
export type UseActiveTargetResult = ActiveTarget | null;
|
|
9
|
-
export declare function useActiveTarget({
|
|
9
|
+
export declare function useActiveTarget({ rootRef, activeTarget: _activeTarget, onActiveTargetChange, }: UseActiveTargetOptions): UseActiveTargetResult;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@next-bricks/diagram",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.45.0",
|
|
4
4
|
"homepage": "https://github.com/easyops-cn/next-bricks/tree/master/bricks/diagram",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -41,5 +41,5 @@
|
|
|
41
41
|
"peerDependencies": {
|
|
42
42
|
"@next-bricks/basic": "*"
|
|
43
43
|
},
|
|
44
|
-
"gitHead": "
|
|
44
|
+
"gitHead": "9b43797c83a53c9c6508a9bf077e69e41f3b7a35"
|
|
45
45
|
}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";(globalThis.webpackChunk_next_bricks_diagram=globalThis.webpackChunk_next_bricks_diagram||[]).push([[6055],{4932:(e,t,n)=>{n.d(t,{m:()=>R});var o=n(8769),r=n.n(o),i=n(3373),a=n.n(i),l=n(531),c=n(3188),s=n(3033),d=n(8653),u=n(3239),v=n(693);function h(e,t){return e.find((e=>(0,l.o6)(e)&&e.id===t))}var f=n(9978);function m(e){var t,n;let{edge:i,cells:m,lineConfMap:g,active:p}=e;const{setActiveEditableLine:y}=(0,f.s)(),w=(0,o.useRef)(null),x=(0,o.useMemo)((()=>h(m,i.source)),[m,i.source]),E=(0,o.useMemo)((()=>h(m,i.target)),[m,i.target]),k=(0,o.useMemo)((()=>g.get(i)),[i,g]),b=(0,o.useMemo)((()=>m.some((e=>{var t,n;return(0,l.WW)(e)&&e.source===i.target&&e.target===i.source&&!(null!==(t=i.view)&&void 0!==t&&t.exitPosition||null!==(n=i.view)&&void 0!==n&&n.entryPosition)}))?k.parallelGap:0),[m,i,k.parallelGap]),C=(0,o.useMemo)((()=>{var e,t,n,o;const r=null!==(e=i.view)&&void 0!==e&&e.exitPosition||null!==(t=i.view)&&void 0!==t&&t.entryPosition?0:s.p6;return x&&E&&null!=x.view.x&&null!=E.view.x?null!==(n=i.view)&&void 0!==n&&n.exitPosition||null!==(o=i.view)&&void 0!==o&&o.entryPosition?(0,v.V)(x.view,E.view,i.view):(0,c.h)((0,u.T)(x.view,r),(0,u.T)(E.view,r),b,i.view):null}),[i.view,b,x,E]),z=(0,o.useMemo)((()=>{const e="auto"===k.type?"polyline":k.type;return(0,d.S)(C,"curve"===e?k.curveType:"curveLinear",0,1)}),[k,C]);return(0,o.useEffect)((()=>{y((e=>{var t,n;return p?C&&x&&E?{edge:i,source:x,target:E,endPoints:[C[0],C[C.length-1]],exitPosition:null===(t=i.view)||void 0===t?void 0:t.exitPosition,entryPosition:null===(n=i.view)||void 0===n?void 0:n.entryPosition}:null:null!=e&&e.edge&&e.edge.source===i.source&&e.edge.target===i.target?null:e}))}),[p,i,C,y,x,E]),z&&C?r().createElement(r().Fragment,null,r().createElement("path",{d:z,fill:"none",stroke:"transparent",strokeWidth:k.interactStrokeWidth}),r().createElement("path",{ref:w,className:a()("line",{dashed:k.dashed,[(k.dashed?"dashed":"solid")+"-animation"]:k.animate.useAnimate}),style:{"--time":`${k.animate.duration??s.Be}s`,"--solid-length":null===(t=w.current)||void 0===t||null===(n=t.getTotalLength)||void 0===n?void 0:n.call(t)},d:z,fill:"none",stroke:k.strokeColor,strokeWidth:k.strokeWidth,markerStart:k.showStartArrow?k.$markerUrl:"",markerEnd:k.showEndArrow?k.$markerUrl:""}),r().createElement("path",{className:"line-active-bg",d:z,fill:"none"})):null}var g=n(564),p=n(3204),y=n(1030),w=n(9126);function x(e){let{node:t,degraded:n,degradedNodeLabel:i,defaultNodeBricks:a,onResize:l}=e;const c=function(e){const[t,n]=(0,o.useState)(e);return(0,o.useEffect)((()=>{n((t=>(0,y.isEqual)(t,e)?t:e))}),[e]),t}({node:{id:t.id,data:t.data}}),s=t.useBrick,d=(0,o.useRef)(null),u=(0,o.useMemo)((()=>{var e;return n?null:s??(null==a||null===(e=a.find((e=>(0,p.checkIfByTransform)(e,c))))||void 0===e?void 0:e.useBrick)}),[n,s,a,c]),v=(0,o.useMemo)((()=>n?String(p.__secret_internals.legacyDoTransform(c,i??"<% DATA.node.id %>")):""),[n,i,c]),h=(0,o.useCallback)((e=>{const n=d.current;n&&(n.disconnect(),d.current=null),e?setTimeout((()=>{const n=new w.A((()=>{l(t.id,[e.offsetWidth,e.offsetHeight])}));n.observe(e),d.current=n})):l(t.id,null)}),[t.id,l]),f=(0,o.useCallback)((e=>{if(e){const n=e.getBBox();l(t.id,[n.width,n.height])}else l(t.id,null)}),[t.id,l]);return u?r().createElement("foreignObject",{width:9999,height:9999,className:"node"},u&&r().createElement(g.ReactUseBrick,{useBrick:u,data:c,refCallback:h})):n?r().createElement("g",{className:"degraded",ref:f},r().createElement("circle",{cx:8,cy:8,r:8}),r().createElement("text",{x:8,y:32},v)):null}var E=n(9386),k=n(4197);function b(e,t){let{action:n,cell:o,scale:r,layout:i,layoutOptions:a,activeTarget:c,cells:d,onCellsMoving:u,onCellsMoved:v,onCellResizing:h,onCellResized:f,onSwitchActiveTarget:m}=t;e.stopPropagation(),"resize"!==n&&(0,k.Q)(o,c)||null==m||m((0,E.P)(o));const g="force"===i||"dagre"===i;if((0,l.WW)(o))return;const p=[],y="multi"===(null==c?void 0:c.type)&&"move"===n?d.filter((e=>(0,k.Q)(e,c))):[o];y.forEach((e=>{p.push(e),"move"===n&&(0,l.t2)(e)&&p.push(...d.filter((t=>(0,l.N)(t)&&t.containerId===e.id&&!y.includes(t))))}));const w=p.filter((e=>(0,l.N)(e)&&!g||(0,l.mH)(e)));if(0===w.length)return;const x=function(e){const t=e?!0===e?{grid:!0,object:!0}:e:null,n=null!=t&&t.grid?!0===t.grid?{}:t.grid:null,o=null!=t&&t.object?!0===t.object?{}:t.object:null;return{grid:n?{size:n.size??s.gx}:null,object:o?{distance:o.distance??s.ld}:null}}(null==a?void 0:a.snap),b=[e.clientX,e.clientY],z=w.map((e=>({cell:e,position:"move"===n?[e.view.x,e.view.y]:[e.view.width,e.view.height],center:"move"!==n||(0,l.WW)(e)?null:C(e.view)}))),S=z[0].position;let L=z.map((e=>{let{position:t}=e;return t})),P=[];if("move"===n&&x.object){const e=d.filter((e=>!(0,l.WW)(e)&&!p.includes(e)));P=e.map((e=>({cell:e,center:C(e.view)})))}let M=!1;const I=(e,t)=>{const i=function(e){return[(e.clientX-b[0])/r,(e.clientY-b[1])/r]}(e);let a,c,s,d,m;if(!x.grid&&!x.object||e.altKey)a=z.map((e=>{let{position:t}=e;return[t[0]+i[0],t[1]+i[1]]})),M||(M=i[0]**2+i[1]**2>=9);else{let e=1/0,t=1/0;const n=[...i];if(x.object){const o=x.object.distance;let r,a,l,u,v=0,h=0;for(const{cell:c,center:[s,f]}of P)for(const{cell:g,center:p}of z){const[y,w]=p,x=Math.abs(y+i[0]-s),E=Math.abs(w+i[1]-f),k=E<o&&E<t;x<o&&x<e&&(e=x,n[0]=s-y,d=g,l=c,r=[s,f],v=w),k&&(t=E,n[1]=f-w,m=g,u=c,a=[s,f],h=y)}if(l&&l===u){const e=l.view.height/2,t=l.view.width/2;c=[[r[0],r[1]-e],[r[0],r[1]+e]],s=[[a[0]-t,a[1]],[a[0]+t,a[1]]]}else r&&(c=[r,[r[0],v+n[1]]]),a&&(s=[a,[h+n[0],a[1]]])}if(x.grid){const o=x.grid.size,r=[Math.round((S[0]+i[0])/o)*o,Math.round((S[1]+i[1])/o)*o],a=[r[0]-S[0],r[1]-S[1]],l=Math.abs(a[0]-i[0]),u=Math.abs(a[1]-i[1]);l<e&&(e=l,n[0]=a[0],c=void 0,d=void 0),u<t&&(t=u,n[1]=a[1],s=void 0,m=void 0)}a=z.map((e=>{let{position:t}=e;return[Math.round(t[0]+n[0]),Math.round(t[1]+n[1])]})),(a[0][0]!==L[0][0]||a[0][1]!==L[0][1])&&(L=a,M=!0)}if(M)if("move"===n){var g;const e=z.map(((e,n)=>{let{cell:o}=e;return{type:o.type,id:o.id,x:a[n][0],y:a[n][1],width:o.view.width,height:o.view.height,decorator:(0,l.mH)(o)?o.decorator:void 0,guideLines:t?void 0:[...d===o?[c]:[],...m===o?[s]:[]]}}));null===(g=t?v:u)||void 0===g||g(e)}else{var p;null===(p=t?f:h)||void 0===p||p({type:o.type,id:o.id,width:a[0][0],height:a[0][1]})}},N=e=>{I(e)},A=e=>{I(e,!0),M=!1,document.removeEventListener("mousemove",N),document.removeEventListener("mouseup",A)};document.addEventListener("mousemove",N),document.addEventListener("mouseup",A)}function C(e){return[e.x+e.width/2,e.y+e.height/2]}function z(e){let{cell:t,transform:n,readOnly:i,layoutOptions:a,activeTarget:l,cells:c,onCellResizing:s,onCellResized:d,onSwitchActiveTarget:u}=e;const v=r().useRef(null);return(0,o.useEffect)((()=>{const e=v.current;if(!e||i)return;const o=e=>{b(e,{action:"resize",cell:t,scale:n.k,layoutOptions:a,activeTarget:l,cells:c,onCellResizing:s,onCellResized:d,onSwitchActiveTarget:u})};return e.addEventListener("mousedown",o),()=>{e.removeEventListener("mousedown",o)}}),[l,t,c,a,d,s,u,i,n.k]),r().createElement("g",{className:"decorator-area"},r().createElement("rect",{width:t.view.width,height:t.view.height,className:"area"}),!i&&r().createElement("g",{ref:v,className:"resize-handle",transform:`translate(${t.view.width-20} ${t.view.height-20})`},r().createElement("rect",{width:20,height:20}),r().createElement("path",{d:"M10 18L18 10 M15 18L18 15"})))}function S(e){let{cell:t,readOnly:n,onDecoratorTextEditing:i,onDecoratorTextChange:l}=e;const c=t.view.text??"",[s,d]=(0,o.useState)(c),[u,v]=(0,o.useState)(!1),h=(0,o.useRef)(!1),[f,m]=(0,o.useState)(!1),g=(0,o.useRef)(null),p=(0,o.useCallback)((e=>{n||(e.preventDefault(),e.stopPropagation(),v(!0))}),[n]);(0,o.useEffect)((()=>{const e=g.current;e&&e.textContent!==s&&(e.textContent=s)}),[s]),(0,o.useEffect)((()=>{var e;const n=null===(e=g.current)||void 0===e?void 0:e.parentElement;n&&(t.view.width=n.clientWidth,t.view.height=n.clientHeight)}),[s,t.id]),(0,o.useEffect)((()=>{u&&g.current&&(g.current.focus(),L(g.current)),null==i||i({id:t.id,editing:u})}),[t.id,u,i]),(0,o.useEffect)((()=>{h.current?null==i||i({id:t.id,editing:u}):h.current=!0}),[t.id,u,i]);const y=(0,o.useCallback)((e=>{n||d(e.target.textContent)}),[n]),w=(0,o.useCallback)((()=>{n||(v(!1),m(!0))}),[n]);return(0,o.useEffect)((()=>{f&&(null==l||l({id:t.id,view:{...t.view,text:s}}),m(!1))}),[t,s,l,f]),r().createElement("foreignObject",{className:"decorator-text"},r().createElement("div",{className:a()("text-container",{editing:u}),onDoubleClick:p},r().createElement("div",{className:"text",contentEditable:u,ref:g,onInput:y,onBlur:w})))}function L(e){const t=document.createRange();t.selectNodeContents(e);const n=window.getSelection();n.removeAllRanges(),n.addRange(t)}var P=n(9068);function M(e){let{cell:t,transform:n,readOnly:i,layout:c,view:s,activeTarget:d,cells:u,onCellResizing:v,onCellResized:h,onSwitchActiveTarget:f,onDecoratorTextEditing:m,onDecoratorTextChange:g}=e;const p=(0,y.get)(t.view,"text",""),w=(0,y.get)(t.view,"direction","top"),x=(0,o.useRef)(null),E=r().useRef(null),[k,C]=(0,o.useState)(!1),[z,S]=(0,o.useState)(p),[M,I]=(0,o.useState)(!1),[N,A]=(0,o.useState)(),[R,T]=(0,o.useState)({x:0,y:0,width:t.view.width,height:t.view.height}),H=(0,o.useCallback)((e=>{i||(e.preventDefault(),e.stopPropagation(),C(!0))}),[i]),D=(0,o.useCallback)((e=>{i||S(e.target.textContent)}),[i]),W=(0,o.useCallback)((()=>{i||(C(!1),I(!0),A((0,P.uuidV4)()))}),[i]);return(0,o.useEffect)((()=>{S(p)}),[p]),(0,o.useEffect)((()=>{const e=x.current;e&&e.textContent!==z&&(e.textContent=z)}),[z]),(0,o.useEffect)((()=>{var e;const t=null===(e=x.current)||void 0===e?void 0:e.parentElement;if(t){const{clientWidth:e,clientHeight:n}=t;if(["left","right"].includes(w)){const t={width:e,height:s.height,x:"left"===w?-e:s.width,y:0};T(t)}else{const e={width:s.width,height:n,x:0,y:"top"===w?-n:s.height};T(e)}}}),[s,z,w,N]),(0,o.useEffect)((()=>{k&&x.current&&(x.current.focus(),L(x.current)),null==m||m({id:t.id,editing:k})}),[t.id,k,m]),(0,o.useEffect)((()=>{M&&(null==g||g({id:t.id,view:{...s,text:z}}),I(!1))}),[t,s,z,g,M]),(0,o.useEffect)((()=>{const e=E.current;if(!e||i)return;const o=e=>{b(e,{action:"resize",cell:t,scale:n.k,activeTarget:d,cells:u,onCellResizing:v,onCellResized:h,onSwitchActiveTarget:f})};return e.addEventListener("mousedown",o),()=>{e.removeEventListener("mousedown",o)}}),[d,t,u,h,v,f,i,n.k]),r().createElement("g",{className:"decorator-container"},r().createElement("foreignObject",R,r().createElement("div",{className:a()("text-container",{editing:k,[["left","right"].includes(w)?"vertical":"horizontal"]:!0}),onDoubleClick:H},r().createElement("div",{className:"text",contentEditable:k,ref:x,onInput:D,onBlur:W}))),r().createElement("rect",{width:s.width,height:s.height,className:"container"}),!i&&!(0,l.OD)(c)&&r().createElement("g",{ref:E,className:"resize-handle",transform:`translate(${s.width-20} ${s.height-20})`},r().createElement("rect",{width:20,height:20}),r().createElement("path",{d:"M10 18L18 10 M15 18L18 15"})))}function I(e){let t,{cell:n,view:o,transform:i,readOnly:a,layout:l,layoutOptions:c,activeTarget:s,cells:d,onCellResizing:u,onCellResized:v,onSwitchActiveTarget:h,onDecoratorTextEditing:f,onDecoratorTextChange:m}=e;switch(n.decorator){case"container":t=M;break;case"area":t=z;break;case"text":t=S;break;default:return console.error(`Unknown decorator: ${n.decorator}`),null}return r().createElement(t,{cell:n,view:o,transform:i,readOnly:a,layout:l,layoutOptions:c,activeTarget:s,cells:d,onCellResizing:u,onCellResized:v,onSwitchActiveTarget:h,onDecoratorTextEditing:f,onDecoratorTextChange:m})}var N=n(8185);function A(e){let t=1/0,n=1/0,o=-1/0,r=-1/0;return e.forEach((e=>{const{x:i,y:a,width:l,height:c}=e.view;i<t&&(t=i),a<n&&(n=a),i+l>o&&(o=i+l),a+c>r&&(r=a+c)})),[t,o,n,r].some((e=>isFinite(e)))?{x:t-20,y:n-20,width:o-t+40,height:r-n+40}:{}}function R(e){let{layout:t,layoutOptions:n,cell:i,cells:c,degraded:s,degradedNodeLabel:d,defaultNodeBricks:u,lineConfMap:v,activeTarget:h,dragNodeToContainerActive:g,readOnly:p,transform:w,unrelatedCells:C,allowEdgeToArea:z,onCellsMoving:S,onCellsMoved:L,onCellResizing:P,onCellResized:M,onSwitchActiveTarget:R,onCellContextMenu:T,onCellClick:H,onDecoratorTextEditing:D,onDecoratorTextChange:W,onNodeBrickResize:B,onCellMouseEnter:O,onCellMouseLeave:V}=e;const{lineEditorState:Z,smartConnectLineState:j,setSmartConnectLineState:$,onConnect:U,setLineEditorState:X,onChangeEdgeEndpoints:G}=(0,f.s)(),Y=(0,o.useRef)(null),Q=(0,o.useMemo)((()=>C.some((e=>(0,N.c)(e,i)))),[i,C]),F=(0,o.useMemo)((()=>{if((0,l.t2)(i)&&(0,l.OD)(t)){const e=c.filter((e=>(0,l.N)(e)&&e.containerId===i.id)),t={...i.view,...A(e)};return i.view=t,t}return(0,l.WW)(i)?void 0:(0,y.get)(i,"view",{x:0,y:0,width:0,height:0})}),[t,i,c]);(0,o.useEffect)((()=>{const e=Y.current;if(!e)return;const o=e=>{p||(0,l.t2)(i)&&(0,l.OD)(t)?e.stopPropagation():b(e,{layout:t,layoutOptions:n,action:"move",cell:i,scale:w.k,activeTarget:h,cells:c,onCellsMoving:S,onCellsMoved:L,onSwitchActiveTarget:R})};return e.addEventListener("mousedown",o),()=>{e.removeEventListener("mousedown",o)}}),[t,n,i,h,c,L,S,R,p,w.k]),(0,o.useEffect)((()=>{const e=Y.current;if(!e||!(0,l.bo)(i,z)||!j&&!Z)return;const t=e=>{if(e.preventDefault(),e.stopPropagation(),j)j.source!==i&&(null==U||U(j.source,i,j.exitPosition,void 0)),$(null);else if(Z){const e="entry"===Z.type;(e?Z.target:Z.source)===i&&(e?null==G||G(Z.source,Z.target,Z.exitPosition,void 0):null==G||G(Z.source,Z.target,void 0,Z.entryPosition)),X(null)}};return e.addEventListener("mouseup",t),()=>{e.removeEventListener("mouseup",t)}}),[z,i,Z,G,U,X,$,j]);const J=(0,o.useCallback)((e=>{p&&"decorator"===i.type||(e.preventDefault(),R((0,E.P)(i)),T({cell:i,clientX:e.clientX,clientY:e.clientY}))}),[i,T,R,p]),_=(0,o.useCallback)((e=>{H&&"decorator"!==i.type&&H({cell:i,clientX:e.clientX,clientY:e.clientY})}),[i,H]),K=(0,o.useCallback)((()=>{null==O||O(i)}),[i,O]),q=(0,o.useCallback)((()=>{null==V||V(i)}),[i,V]),ee=(0,k.Q)(i,h);return r().createElement("g",{className:a()("cell",{active:ee,faded:Q,"read-only":p,"container-active":g}),ref:Y,transform:"edge"===i.type||null==i.view.x?void 0:`translate(${F.x} ${F.y})`,onContextMenu:J,onClick:_,onMouseEnter:K,onMouseLeave:q},(0,l.N)(i)?r().createElement(x,{node:i,degraded:s,degradedNodeLabel:d,defaultNodeBricks:u,onResize:B}):(0,l.WW)(i)?r().createElement(m,{edge:i,cells:c,lineConfMap:v,active:ee}):(0,l.mH)(i)?r().createElement(I,{cell:i,view:F,transform:w,readOnly:p,layout:t,layoutOptions:n,activeTarget:h,cells:c,onCellResizing:P,onCellResized:M,onSwitchActiveTarget:R,onDecoratorTextEditing:D,onDecoratorTextChange:W}):null)}},3639:(e,t,n)=>{n.d(t,{w:()=>l});var o=n(8769),r=n.n(o),i=n(3373),a=n.n(i);function l(e){let{connectLineState:t,transform:n,markerEnd:i,onConnect:l}=e;const[c,s]=(0,o.useState)(null);return(0,o.useEffect)((()=>{t&&s(t.from)}),[t]),(0,o.useEffect)((()=>{if(t){const e=e=>{s([(e.clientX-n.x-t.offset[0])/n.k,(e.clientY-n.y-t.offset[1])/n.k])},o=e=>{e.stopPropagation()},r=e=>{e.stopPropagation(),i(),l(t,[(e.clientX-n.x-t.offset[0])/n.k,(e.clientY-n.y-t.offset[1])/n.k])},i=()=>{document.removeEventListener("mousemove",e),document.removeEventListener("mousedown",o,{capture:!0}),document.removeEventListener("click",r,{capture:!0}),s(null)};return document.addEventListener("mousemove",e),document.addEventListener("mousedown",o,{capture:!0}),document.addEventListener("click",r,{capture:!0}),i}}),[t,l,n]),r().createElement("path",{className:a()("connect-line",{connecting:!!t&&c&&(c[0]-t.from[0])**2+(c[1]-t.from[1])**2>25}),d:t&&c?`M${t.from.join(" ")}L${c.join(" ")}`:"",fill:"none",stroke:"gray",strokeWidth:1,markerEnd:`url(#${i})`})}},1825:(e,t,n)=>{n.d(t,{W:()=>d});var o=n(8769),r=n.n(o),i=n(3373),a=n.n(i),l=n(8653),c=n(9978),s=n(693);function d(e){let{transform:t,options:n}=e;const[i,d]=(0,o.useState)(null),{hoverState:u,lineEditorState:v,setLineEditorState:h}=(0,c.s)();(0,o.useEffect)((()=>{if(!v)return;const e=e=>{d([(e.clientX-t.x-v.offset[0])/t.k,(e.clientY-t.y-v.offset[1])/t.k])};function n(e){e.preventDefault(),o()}function o(){document.removeEventListener("mousemove",e),document.removeEventListener("mouseup",n),d(null),h(null)}return document.addEventListener("mousemove",e),document.addEventListener("mouseup",n),o}),[v,t,h]);const f=(0,o.useMemo)((()=>{const e="auto"===n.type?"polyline":n.type,t=function(e,t,n){if(!e||!t&&void 0===(null==n?void 0:n.activePointIndex))return null;const{type:o,source:r,target:i,exitPosition:a,entryPosition:l}=e;if(void 0!==(null==n?void 0:n.activePointIndex)){const e=n.relativePoints[n.activePointIndex];return(0,s.V)(r.view,i.view,"entry"===o?{exitPosition:a,entryPosition:e}:{exitPosition:e,entryPosition:l})}const[c,d]=t;return"entry"===o?(0,s.V)(r.view,{x:c,y:d,width:0,height:0},{exitPosition:a}):(0,s.V)({x:c,y:d,width:0,height:0},i.view,{entryPosition:l})}(v,i,u);return(0,l.S)(t,"curve"===e?n.curveType:"curveLinear",0,1)}),[i,u,v,n]);return r().createElement("path",{className:a()("editing-line",{editing:!(!v||!i)}),d:f,fill:"none",stroke:n.editingStrokeColor,markerStart:n.showStartArrow?n.$editingMarkerUrl:"",markerEnd:n.showEndArrow?n.$editingMarkerUrl:""})}},9978:(e,t,n)=>{n.d(t,{H:()=>i,s:()=>a});var o=n(8769),r=n.n(o);const i=r().createContext({rootRef:{current:null},smartConnectLineState:null,unsetHoverStateTimeoutRef:{current:null},hoverState:null,activeEditableLine:null,lineEditorState:null,setLineEditorState:()=>{},setActiveEditableLine:()=>{},setHoverState:()=>{},setSmartConnectLineState:()=>{}});function a(){return r().useContext(i)}},2722:(e,t,n)=>{n.d(t,{T:()=>v});var o=n(8769),r=n.n(o),i=n(9978),a=n(4197),l=n(3033);const c="data:image/svg+xml;base64,PCFET0NUWVBFIHN2ZyBQVUJMSUMgIi0vL1czQy8vRFREIFNWRyAxLjEvL0VOIiAiaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkIj48c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHdpZHRoPSI1cHgiIGhlaWdodD0iNXB4IiB2ZXJzaW9uPSIxLjEiPjxwYXRoIGQ9Im0gMCAwIEwgNSA1IE0gMCA1IEwgNSAwIiBzdHJva2Utd2lkdGg9IjIiIHN0eWxlPSJzdHJva2Utb3BhY2l0eTowLjQiIHN0cm9rZT0iI2ZmZmZmZiIvPjxwYXRoIGQ9Im0gMCAwIEwgNSA1IE0gMCA1IEwgNSAwIiBzdHJva2U9IiMyOWI2ZjIiLz48L3N2Zz4=",s=5,d=8,u=s/2;function v(e){let{activeTarget:t,transform:n,disabled:c}=e;const{unsetHoverStateTimeoutRef:s,hoverState:u,setHoverState:v,smartConnectLineState:f,lineEditorState:m}=(0,i.s)(),g=(0,o.useCallback)((()=>{null!==s.current&&(clearTimeout(s.current),s.current=null)}),[s]),p=(0,o.useCallback)((()=>{g(),v((e=>void 0===(null==e?void 0:e.activePointIndex)?e:{...u,activePointIndex:void 0}))}),[u,v,g]),y=(0,o.useCallback)((()=>{s.current=setTimeout((()=>{v(null)}))}),[v,s]),w=!c&&u&&(!!f||(m?"entry"===m.type?u.cell===m.target:u.cell===m.source:!(0,a.Q)(u.cell,t)&&!function(e){return e&&("edge"===e.type||"multi"===e.type&&e.targets.some((e=>"edge"===e.type)))}(t))),x=(0,o.useMemo)((()=>w?u.points.map((e=>({x:e.x*n.k+n.x,y:e.y*n.k+n.y}))):null),[w,null==u?void 0:u.points,n]),E=l.XK,k=E/2;return r().createElement("g",{onMouseEnter:p,onMouseLeave:y},w&&r().createElement(r().Fragment,null,r().createElement("g",{transform:`translate(${n.x} ${n.y}) scale(${n.k})`},r().createElement("rect",{x:u.cell.view.x-k,y:u.cell.view.y-k,width:u.cell.view.width+E,height:u.cell.view.height+E,fill:"none",stroke:"transparent",strokeWidth:2*d/n.k,pointerEvents:"stroke"})),void 0!==(null==u?void 0:u.activePointIndex)&&r().createElement("circle",{cx:x[u.activePointIndex].x,cy:x[u.activePointIndex].y,r:d,fill:"lightgreen",fillOpacity:.5,pointerEvents:"none"}),x.map(((e,t)=>r().createElement(h,{key:t,index:t,point:e,unsetActivePointIndex:p,unsetTimeout:g})))))}function h(e){let{index:t,point:n,unsetTimeout:a,unsetActivePointIndex:l}=e;const{rootRef:v,smartConnectLineState:h,hoverState:f,setHoverState:m,setSmartConnectLineState:g,onConnect:p,lineEditorState:y,setLineEditorState:w,onChangeEdgeEndpoints:x}=(0,i.s)(),E=(0,o.useRef)(null);return(0,o.useEffect)((()=>{const e=E.current,n=o=>{"mousemove"===o.type&&(null==e||e.removeEventListener(o.type,n)),a(),m((e=>e&&e.activePointIndex!==t?{...f,activePointIndex:t}:e))};return null==e||e.addEventListener("mouseenter",n),null==e||e.addEventListener("mousemove",n),()=>{null==e||e.removeEventListener("mouseenter",n),null==e||e.removeEventListener("mousemove",n)}}),[f,t,m,a]),(0,o.useEffect)((()=>{if(y)return;const e=e=>{e.preventDefault(),e.stopPropagation();const n=v.current.getBoundingClientRect(),o=f.points[t];g({source:f.cell,from:[o.x,o.y],offset:[n.left,n.top],exitPosition:f.relativePoints[t]})},n=E.current;return null==n||n.addEventListener("mousedown",e),()=>{null==n||n.removeEventListener("mousedown",e)}}),[f,t,y,v,g]),(0,o.useEffect)((()=>{const e=e=>{if(e.preventDefault(),e.stopPropagation(),h)h.source!==(null==f?void 0:f.cell)&&(null==p||p(h.source,f.cell,h.exitPosition,f.relativePoints[f.activePointIndex])),g(null);else if(y){const e=f.relativePoints[f.activePointIndex];"entry"===y.type?null==x||x(y.source,y.target,y.exitPosition,e):null==x||x(y.source,y.target,e,y.entryPosition),w(null)}},t=E.current;return null==t||t.addEventListener("mouseup",e),()=>{null==t||t.removeEventListener("mouseup",e)}}),[h,f,p,g,y,x,w]),r().createElement("g",{ref:E,onMouseLeave:l},r().createElement("circle",{cx:n.x,cy:n.y,r:d,fill:"transparent"}),r().createElement("image",{x:n.x-u,y:n.y-u,width:s,height:s,xlinkHref:c,preserveAspectRatio:"none"}))}},2202:(e,t,n)=>{n.d(t,{F:()=>s});var o=n(9575),r=n(8769),i=n.n(r),a=n(9978);const l="data:image/svg+xml;base64,PCFET0NUWVBFIHN2ZyBQVUJMSUMgIi0vL1czQy8vRFREIFNWRyAxLjEvL0VOIiAiaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkIj48c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHdpZHRoPSIyMnB4IiBoZWlnaHQ9IjIycHgiIHZlcnNpb249IjEuMSI+PGNpcmNsZSBjeD0iMTEiIGN5PSIxMSIgcj0iNyIgc3Ryb2tlPSIjZmZmIiBmaWxsPSIjMDFiZDIyIi8+PHBhdGggZD0ibSA4IDggTCAxNCAxNE0gOCAxNCBMIDE0IDgiIHN0cm9rZT0iI2ZmZiIvPjwvc3ZnPg==",c=22;function s(e){let{transform:t}=e;const{rootRef:n,activeEditableLine:s,setLineEditorState:d}=(0,a.s)(),u=(0,r.useRef)(null),v=(0,r.useRef)(null);if((0,r.useEffect)((()=>{const e=u.current,t=v.current;if(!e||!t||!s)return;const o=e=>t=>{t.stopPropagation(),t.preventDefault();const o=n.current.getBoundingClientRect();d({...s,offset:[o.left,o.top],type:e})},r=o("exit"),i=o("entry");return e.addEventListener("mousedown",r),t.addEventListener("mousedown",i),()=>{e.removeEventListener("mousedown",r),t.removeEventListener("mousedown",i)}}),[s,n,d]),!s)return null;const h={width:c/t.k,height:c/t.k,xlinkHref:l,preserveAspectRatio:"none",style:{cursor:"pointer"},pointerEvents:"fill"},f=s.endPoints[0],m=s.endPoints[1],g=c/t.k/2;return i().createElement(i().Fragment,null,i().createElement("image",(0,o.A)({ref:u},h,{x:f.x-g,y:f.y-g})),i().createElement("image",(0,o.A)({ref:v},h,{x:m.x-g,y:m.y-g})))}},1103:(e,t,n)=>{n.d(t,{X:()=>d});var o=n(8769),r=n.n(o),i=n(3373),a=n.n(i),l=n(8653),c=n(9978),s=n(693);function d(e){let{transform:t,options:n}=e;const[i,d]=(0,o.useState)(null),{hoverState:u,smartConnectLineState:v,setSmartConnectLineState:h}=(0,c.s)();(0,o.useEffect)((()=>{if(v)return document.addEventListener("mousemove",e),document.addEventListener("mouseup",n),o;function e(e){d([(e.clientX-t.x-v.offset[0])/t.k,(e.clientY-t.y-v.offset[1])/t.k])}function n(e){e.preventDefault(),o()}function o(){document.removeEventListener("mousemove",e),document.removeEventListener("mouseup",n),d(null),h(null)}}),[h,v,t]);const f=(0,o.useMemo)((()=>{const e="auto"===n.type?"polyline":n.type,t=function(e,t,n){if(!e||!t&&void 0===(null==n?void 0:n.activePointIndex))return null;const o=e.source.view;if(void 0!==(null==n?void 0:n.activePointIndex))return(0,s.V)(o,n.cell.view,{exitPosition:e.exitPosition,entryPosition:n.relativePoints[n.activePointIndex]});const[r,i]=t;return(0,s.V)(o,{x:r,y:i,width:0,height:0},{exitPosition:e.exitPosition})}(v,i,u);return(0,l.S)(t,"curve"===e?n.curveType:"curveLinear",0,1)}),[i,u,v,n]);return r().createElement("path",{className:a()("connect-line",{connecting:!(!v||!i)}),d:f,fill:"none",stroke:n.strokeColor,strokeWidth:n.strokeWidth,markerStart:n.showStartArrow?n.$markerUrl:"",markerEnd:n.showEndArrow?n.$markerUrl:""})}},3033:(e,t,n)=>{n.d(t,{Be:()=>g,CV:()=>o,HP:()=>i,Ie:()=>h,N8:()=>l,Ub:()=>m,VO:()=>v,XK:()=>E,XV:()=>f,Yt:()=>d,gx:()=>y,ld:()=>w,mF:()=>u,p6:()=>x,pC:()=>p,sS:()=>s,sz:()=>a,w1:()=>c,xc:()=>r});const o=Symbol.for("size-initialized"),r=Symbol.for("layout-initialized"),i=20,a=36,l=180,c=120,s=.5,d=2,u="gray",v=1,h=15,f=!1,m=!0,g=1,p=500,y=10,w=5,x=5,E=0},531:(e,t,n)=>{function o(e){return"node"===e.type}function r(e){return"decorator"===e.type}function i(e){return"node"===e.type}function a(e){return"edge"===e.type}function l(e){return"node"===e.type||"edge"===e.type}function c(e){return"node"===e.type||"decorator"===e.type&&"area"===e.decorator}function s(e,t){return"node"===e.type||!!t&&"decorator"===e.type&&"area"===e.decorator}function d(e){return"decorator"===e.type&&"text"===e.decorator}function u(e){return"decorator"===e.type&&"container"===e.decorator}function v(e){return!["manual",void 0].includes(e)}n.d(t,{Hs:()=>d,N:()=>o,OD:()=>v,WW:()=>a,bo:()=>s,mH:()=>r,nv:()=>l,o6:()=>c,t2:()=>u,vC:()=>i})},9386:(e,t,n)=>{n.d(t,{P:()=>r});var o=n(1030);function r(e){return"edge"===e.type?(0,o.pick)(e,["type","source","target","data"]):(0,o.pick)(e,["type","id","data"])}},227:(e,t,n)=>{n.d(t,{Y:()=>r});var o=n(4197);function r(e,t,n,r){const i=[];if(t){const n=new Set;for(const o of e)"edge"===o.type&&o.source===t.source.id&&n.add(o.target);for(const t of e)switch(t.type){case"node":n.has(t.id)&&i.push(t);break;case"decorator":r&&"text"!=t.decorator&&!n.has(t.id)||i.push(t);break;default:i.push(t)}}else switch(null==n?void 0:n.type){case"multi":{const t=new Map,r=new Set,a=new Set;for(const e of n.targets)"node"===e.type&&(r.add(e.id),a.add(e.id));for(const l of e)"node"===l.type?t.set(l.id,l):"edge"===l.type?r.has(l.source)?a.add(l.target):r.has(l.target)?a.add(l.source):(0,o.Q)(l,n)||i.push(l):(0,o.Q)(l,n)||i.push(l);for(const[e,n]of t)a.has(e)||i.push(n);break}case"node":{const t=new Map,o=new Set([n.id]);for(const r of e)"node"===r.type?t.set(r.id,r):"edge"===r.type?r.source===n.id?o.add(r.target):r.target===n.id?o.add(r.source):i.push(r):i.push(r);for(const[e,n]of t)o.has(e)||i.push(n);break}case"edge":for(const t of e)("edge"===t.type?(0,o.Q)(t,n):"node"===t.type&&(t.id===n.source||t.id===n.target))||i.push(t)}return i}},5114:(e,t,n)=>{n.d(t,{a:()=>r});var o=n(4197);function r(e,t){let{cells:n,activeTarget:r}=t;const i=n.filter((e=>(0,o.Q)(e,r)));if(0!==i.length)switch(e.key||e.keyCode||e.which){case"Backspace":case 8:case"Delete":case 46:return e.preventDefault(),e.stopPropagation(),{action:"delete-cells",cells:i}}}},2219:(e,t,n)=>{function o(e,t){let{transform:n,offset:o,onLassoing:r,onLassoed:i}=t;if(e.ctrlKey||e.button)return;e.stopPropagation();const a=[e.clientX,e.clientY],l=(e.clientX-o[0]-n.x)/n.k,c=(e.clientY-o[1]-n.y)/n.k;let s=!1;const d=(e,t)=>{const o=function(e){return[(e.clientX-a[0])/n.k,(e.clientY-a[1])/n.k]}(e);if(s||(s=o[0]**2+o[1]**2>=9),s){let[e,n]=o,a=l,s=c;e<0&&(a=l+e,e=-e),n<0&&(s=c+n,n=-n),(t?i:r)({x:a,y:s,width:e,height:n})}},u=e=>{d(e)},v=e=>{d(e,!0),s=!1,document.removeEventListener("mousemove",u),document.removeEventListener("mouseup",v)};document.addEventListener("mousemove",u),document.addEventListener("mouseup",v)}n.d(t,{F:()=>o})},1991:(e,t,n)=>{n.d(t,{_:()=>r});var o=n(531);function r(e,t,n){const r=t.filter((e=>(0,o.N)(e))),i=e.filter((e=>(0,o.t2)(e))).map((e=>e.id)),a=e.filter((e=>{const t=r.find((t=>t.id===e.id)),n=(null==t?void 0:t.containerId)&&i.includes(t.containerId);return(0,o.N)(e)&&!n}));a.forEach((e=>{const n=e.x,r=e.x+e.width,i=e.y,a=e.y+e.height,l=t.filter((e=>(0,o.t2)(e)));for(const t of l){const o=t.view.x,l=t.view.x+t.view.width,c=t.view.y,s=t.view.y+t.view.height;if(n>=o&&r<=l&&i>=c&&a<=s){e.containerCell=t;break}}}));let l=[];return l=a.filter((e=>{var t;const n=r.find((t=>t.id===e.id));return(null==n?void 0:n.containerId)!==(null===(t=e.containerCell)||void 0===t?void 0:t.id)})),l.length>0&&(null==n||n(l)),l}},3783:(e,t,n)=>{n.d(t,{C:()=>r});var o=n(531);function r(e,t){let{defaultNodeSize:n}=t;return(e??[]).map((e=>{var t,r;return!(0,o.vC)(e)||void 0!==(null===(t=e.view)||void 0===t?void 0:t.width)&&void 0!==(null===(r=e.view)||void 0===r?void 0:r.height)?e:{...e,view:{width:n[0],height:n[1],...e.view}}}))}},8185:(e,t,n)=>{function o(e,t){return e?!!t&&e.type===t.type&&("multi"===e.type?e.targets.length===t.targets.length&&e.targets.every((e=>t.targets.some((t=>o(e,t))))):"node"===e.type||"decorator"===e.type?e.id===t.id:e.source===t.source&&e.target===t.target):!t}n.d(t,{c:()=>o})},4197:(e,t,n)=>{n.d(t,{Q:()=>r});var o=n(8185);function r(e,t){return!!t&&("multi"===t.type?t.targets:[t]).some((t=>(0,o.c)(t,e)))}},908:(e,t,n)=>{n.d(t,{r:()=>r});var o=n(531);function r(e,t){let{canvasWidth:n,canvasHeight:r,scaleRange:i}=t,a=1/0,l=1/0,c=-1/0,s=-1/0,d=!0;for(const t of e)if(!(0,o.WW)(t)){d=!1;const{view:e}=t,n=e.x+e.width,o=e.y+e.height;e.x<a&&(a=e.x),n>c&&(c=n),e.y<l&&(l=e.y),o>s&&(s=o)}const u=c-a,v=s-l,h=i&&!d&&(u>n||v>r)?Math.max(Math.min(n/u,r/v,i[1]),i[0]):1;return{x:d?0:(n-u*h)/2-a*h,y:d?0:(r-v*h)/2-l*h,k:h}}},2098:(e,t,n)=>{n.d(t,{L:()=>u});var o=n(1030),r=n(3033),i=n(531),a=n(3783),l=n(908),c=n(6170),s=n(9127),d=n(8185);function u(e){let{cells:t,layout:n,previousCells:u,defaultNodeSize:v,canvasWidth:h,canvasHeight:f,scaleRange:m,transform:g,reason:p,parent:y,allowEdgeToArea:w}=e;const x="force"!==n&&"dagre"!==n,E=(0,a.C)(t,{defaultNodeSize:v}),k=[];let b=!1;const C=new Map;let z=!1;for(const e of u)(0,i.mH)(e)?z=!0:(0,i.N)(e)&&(z=!0,e[r.CV]&&C.set(e.id,e));const S=new Map;for(const e of E)if((0,i.N)(e)){S.set(e.id,e);const t=C.get(e.id);t&&(e.view.width=t.view.width,e.view.height=t.view.height,e[r.CV]=!0)}let L=!1;if("add-related-nodes"===p&&y){const e=new Set;for(const t of E)(0,i.WW)(t)&&t.source===y&&t.target!==y&&e.add(t.target);const t=S.get(y);if(void 0!==(null==t?void 0:t.view.x)&&void 0!==t.view.y){if(L=!0,x)for(const t of E)((0,i.N)(t)&&void 0===t.view.x||(0,i.N)(t)&&void 0===t.view.y)&&e.add(t.id);const n=[...e].map((e=>S.get(e))).filter(Boolean);let o;for(const e of n)void 0!==e.view.x&&void 0!==e.view.y?(!o||e.view.x>o.view.x)&&e.view.y>t.view.y&&(o=e):k.push(e);if(k.length>0&&x){let e,n;if(o)e=o.view.x+o.view.width+r.sz,n=o.view.y;else{const o=k.reduce(((e,t)=>e+t.view.width+r.sz),-r.sz);e=t.view.x-o/2+t.view.width/2,n=t.view.y+t.view.height+r.sz}for(const t of k)t.view.x=e,t.view.y=n,e+=t.view.width+r.sz}}}if(!L){let e=v[0],t=v[1];const n=[];let r=!1;for(const o of E)(0,i.N)(o)?(o.view.width>e&&(e=o.view.width),o.view.height>t&&(t=o.view.height),void 0===o.view.x||void 0===o.view.y?k.push(o):n.push(o)):(0,i.mH)(o)&&(r=!0);if(x){let e;z||(g=(0,l.r)((0,o.without)(E,...k),{canvasWidth:h,canvasHeight:f,scaleRange:m})),0===n.length||1===n.length&&!r?(k.push(...n),({getNodeView:e}=(0,s.C)({cells:E,allowEdgeToArea:w})),b=0===u.length||u.length===E.length&&u.every(((e,t)=>(0,d.c)(e,E[t])))):({getNodeView:e}=(0,c.k)({cells:E,fixedPosition:!0,allowEdgeToArea:w,center:[(h/2-g.x)/g.k,(f/2-g.y)/g.k]}));for(const t of E)if((0,i.N)(t)){const n=e(t.id);t.view.x=n.x,t.view.y=n.y}}}return{cells:E,updated:k,shouldReCenter:b}}},5748:(e,t,n)=>{n.d(t,{d:()=>a});var o=n(531),r=n(3033);function i(e,t,n){const o=e.findLastIndex(n)+1;return[...e.slice(0,o),t,...e.slice(o)]}const a=(l={cells:(e,t)=>{switch(t.type){case"drop-node":return i(e,t.payload,(e=>!("decorator"===e.type&&"text"===e.decorator)));case"drop-decorator":return"text"===t.payload.decorator?[...e,t.payload]:i(e,t.payload,(e=>"decorator"===e.type&&"area"===e.decorator));case"add-nodes":{const n=e.findLastIndex((e=>!("decorator"===e.type&&"text"===e.decorator)))+1;return[...e.slice(0,n),...t.payload,...e.slice(n)]}case"add-edge":{const n=e.findIndex((e=>"edge"===e.type&&e.source===t.payload.source&&e.target===t.payload.target));return-1===n?i(e,t.payload,(e=>"edge"===e.type||"decorator"===e.type&&"area"===e.decorator)):[...e.slice(0,n),t.payload,...e.slice(n+1)]}case"change-edge-view":{const n=e.findIndex((e=>"edge"===e.type&&e.source===t.payload.source&&e.target===t.payload.target));return-1===n?e:[...e.slice(0,n),{...e[n],view:{...e[n].view,...t.payload.view}},...e.slice(n+1)]}case"move-cells":{let n=!1;const o=e.map((e=>{const o=t.payload.find((t=>e.type===t.type&&e.id===t.id));return o?(n=!0,{...e,view:{...e.view,x:o.x,y:o.y}}):e}));return n?o:e}case"resize-cell":{const{type:n,id:o,width:r,height:i}=t.payload,a=e.findIndex((e=>e.type===n&&e.id===o));if(-1!==a){const t=e[a];return[...e.slice(0,a),{...t,view:{...t.view,width:r,height:i}},...e.slice(a+1)]}return e}case"update-cells":return t.payload;case"update-node-size":return e.map((e=>(0,o.N)(e)&&e.id===t.payload.id?{...e,[r.CV]:!0,view:t.payload.size?{...e.view,width:t.payload.size[0],height:t.payload.size[1]}:e.view}:e))}return e},layoutKey:(e,t)=>"update-node-size"===t.type?t.layoutKey:e},(e,t)=>Object.fromEntries(Object.entries(l).map((n=>{let[o,r]=n;return[o,r(e[o],t)]}))));var l},7099:(e,t,n)=>{n.d(t,{Y:()=>f});var o=n(8769),r=n.n(o),i=n(2588),a=n(6768),l=n(6308),c=n(6257),s=n(564),d=n(9575);const u=e=>o.createElement("svg",(0,d.A)({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24"},e),o.createElement("path",{d:"M12 0a.5.5 0 0 1 .5.5v2.013a9.5 9.5 0 0 1 8.987 8.988L23.5 11.5a.5.5 0 0 1 0 1h-2.013a9.5 9.5 0 0 1-8.987 8.987V23.5a.5.5 0 0 1-1 0v-2.013A9.5 9.5 0 0 1 2.514 12.5H.5a.5.5 0 0 1 0-1h2.013A9.5 9.5 0 0 1 11.5 2.514V.5A.5.5 0 0 1 12 0M3.514 11.5H7.5a.5.5 0 0 1 0 1H3.514a8.5 8.5 0 0 0 7.987 7.986L11.5 16.5a.5.5 0 0 1 1 0v3.986a8.5 8.5 0 0 0 7.986-7.986H16.5a.5.5 0 0 1 0-1h3.986A8.5 8.5 0 0 0 12.5 3.515V7.5a.5.5 0 0 1-1 0V3.514a8.5 8.5 0 0 0-7.986 7.987zm8.486-1a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3"})),v=e=>o.createElement("svg",(0,d.A)({xmlns:"http://www.w3.org/2000/svg",width:128,height:128,className:"icon",viewBox:"0 0 1024 1024"},e),o.createElement("path",{d:"M512 76.8A435.2 435.2 0 1 0 947.2 512 435.71 435.71 0 0 0 512 76.8m0 819.2a384 384 0 1 1 384-384 384 384 0 0 1-384 384"}),o.createElement("path",{d:"M744.448 486.4h-204.8V281.6a25.6 25.6 0 1 0-51.2 0v204.8h-204.8a25.6 25.6 0 0 0 0 51.2h204.8v204.8a25.6 25.6 0 0 0 51.2 0V537.6h204.8a25.6 25.6 0 0 0 0-51.2"})),h=e=>o.createElement("svg",(0,d.A)({xmlns:"http://www.w3.org/2000/svg",width:128,height:128,className:"icon",viewBox:"0 0 1024 1024"},e),o.createElement("path",{d:"M512 76.8A435.2 435.2 0 1 0 947.2 512 435.71 435.71 0 0 0 512 76.8m0 819.2a384 384 0 1 1 384-384 384 384 0 0 1-384 384"}),o.createElement("path",{d:"M744.448 486.4H280.064a25.6 25.6 0 1 0 0 51.2h464.384a25.6 25.6 0 0 0 0-51.2"}));function f(e){let{shadowRoot:t,scale:n,scaleRange:d,onZoomChange:f,onReCenter:m}=e;const g=(0,s.useCurrentTheme)(),p=(0,o.useMemo)((()=>(0,c.VC)()),[]),y=(0,o.useRef)(null),w=100*d[0],x=100*d[1],E=100*n,k=(0,o.useMemo)((()=>({formatter:e=>`${e}%`,placement:"left",getPopupContainer:()=>y.current})),[]),b=(0,o.useCallback)((()=>{f(Math.min(E+5,x))}),[x,f,E]),C=(0,o.useCallback)((()=>{f(Math.max(E-5,w))}),[w,f,E]);return r().createElement(i.Ay,{theme:{algorithm:"dark-v2"===g?a.A.darkAlgorithm:a.A.defaultAlgorithm}},r().createElement(c.N7,{container:t,autoClear:!0,cache:p,hashPriority:"high"},r().createElement("div",{className:"zoom-bar",ref:y},r().createElement("div",{className:"center-button",onClick:m,role:"button"},r().createElement(u,null)),r().createElement("div",{className:"zoom-slider"},r().createElement("div",{className:"zoom-button",role:"button",onClick:b},r().createElement(v,null)),r().createElement(l.A,{min:w,max:x,value:E,step:5,vertical:!0,included:!1,tooltip:k,onChange:f}),r().createElement("div",{className:"zoom-button",role:"button",onClick:C},r().createElement(h,null))))))}},9127:(e,t,n)=>{n.d(t,{C:()=>c});var o=n(1030),r=n(7586),i=n.n(r),a=n(8802),l=n(531);function c(e){let{cells:t,layoutOptions:n,allowEdgeToArea:r}=e;const{nodePadding:c,...s}={nodePadding:0,rankdir:"TB",ranksep:50,edgesep:10,nodesep:50,...(0,o.pick)(n,["nodePadding","rankdir","ranksep","edgesep","nodesep","align"])},d=(0,a.D)(c);if(!t.some(l.N))return{getNodeView:()=>null,nodePaddings:d};const u=new(i().graphlib.Graph);u.setGraph(s),u.setDefaultEdgeLabel((function(){return{}}));for(const e of t)r&&(0,l.o6)(e)||(0,l.N)(e)?u.setNode(e.id,{id:e.id,width:e.view.width+d[1]+d[3],height:e.view.height+d[0]+d[2]}):(0,l.WW)(e)&&u.setEdge(e.source,e.target);return i().layout(u),{getNodeView:e=>u.node(e),nodePaddings:d}}},6170:(e,t,n)=>{n.d(t,{k:()=>v});var o=n(1030),r=n(6149),i=n(4842),a=n(1945),l=n(9418),c=n(3854),s=n(7931),d=n(531),u=n(8802);function v(e){let{cells:t,layoutOptions:n,center:v,fixedPosition:h,allowEdgeToArea:f}=e;const{nodePadding:m,collide:g}={nodePadding:0,...(0,o.pick)(n,["nodePadding"]),collide:!1!==(null==n?void 0:n.collide)&&{radiusDiff:18,strength:1,iterations:1,...!0===(null==n?void 0:n.collide)?null:null==n?void 0:n.collide}},p=(0,u.D)(m),y=[],w=[],x=new Map;for(const e of t)if(f&&(0,d.o6)(e)||(0,d.N)(e)){const t={id:e.id,width:e.view.width+p[1]+p[3],height:e.view.height+p[0]+p[2],...h?{fx:e.view.x,fy:e.view.y}:null};y.push(t),x.set(t.id,t)}else(0,d.WW)(e)&&w.push({source:e.source,target:e.target});const E=(0,r.A)(w).id((e=>e.id)),k=(0,i.A)(y).force("link",E).force("x",(0,a.A)(null==v?void 0:v[0])).force("y",(0,l.A)(null==v?void 0:v[1])).force("charge",(0,c.A)());return g&&k.force("collide",(0,s.A)().radius((e=>Math.sqrt(e.width**2+e.height**2)/2+g.radiusDiff)).strength(g.strength).iterations(g.iterations)),k.stop(),function(e){e.tick(Math.ceil(Math.log(e.alphaMin())/Math.log(1-e.alphaDecay())))}(k),{getNodeView:e=>x.get(e),nodePaddings:p}}},693:(e,t,n)=>{n.d(t,{V:()=>s});var o=n(1030),r=n(8875),i=n(4059),a=n(3239),l=n(3033);const c=["right","top","left","bottom"];function s(e,t,n){var s,u;const v=(0,r.X)(),h=n.exitPosition??d(t,e),f=n.entryPosition??d(e,t),m=(null===(s=v.find((e=>e.x===h.x&&e.y===h.y)))||void 0===s?void 0:s.d)??c,g=(null===(u=v.find((e=>e.x===f.x&&e.y===f.y)))||void 0===u?void 0:u.d)??c,p=[...m],y=[...g],w=l.XK,x=w/2,E=e.x-x+h.x*(e.width+w),k=e.y-x+h.y*(e.height+w),b=t.x-x+f.x*(t.width+w),C=t.y-x+f.y*(t.height+w);E<b?((0,o.pull)(p,"left"),(0,o.pull)(y,"right")):((0,o.pull)(p,"right"),(0,o.pull)(y,"left")),k<C?((0,o.pull)(p,"top"),(0,o.pull)(y,"bottom")):((0,o.pull)(p,"bottom"),(0,o.pull)(y,"top"));const z=p[0]??m[0],S=y[0]??g[0],L="left"===z||"right"===z?h.y:h.x,P="left"===S||"right"===S?f.y:f.x;return(0,i.o)((0,a.T)(e,w),(0,a.T)(t,w),z,S,L,P)}function d(e,t){return t.y+t.height<e.y?{x:.5,y:1}:t.y>e.y+e.height?{x:.5,y:0}:t.x<e.x?{x:1,y:.5}:{x:0,y:.5}}},3239:(e,t,n)=>{function o(e,t){return{x:e.x+e.width/2,y:e.y+e.height/2,width:e.width+t,height:e.height+t}}n.d(t,{T:()=>o})},8875:(e,t,n)=>{n.d(t,{G:()=>a,X:()=>i});const o=[{x:0,y:0,d:["top","left"]},{x:.5,y:0,d:["top"]},{x:1,y:0,d:["top","right"]},{x:0,y:.5,d:["left"]},{x:1,y:.5,d:["right"]},{x:0,y:1,d:["bottom","left"]},{x:.5,y:1,d:["bottom"]},{x:1,y:1,d:["bottom","right"]}],r=o.map((e=>({x:e.x,y:e.y})));function i(){return o}function a(){return r}},1819:(e,t,n)=>{n.d(t,{J:()=>i});var o=n(8769),r=n(8185);function i(e){let{cellsRef:t,activeTarget:n,onActiveTargetChange:i}=e;const a=n??null,[l,c]=(0,o.useState)(a);(0,o.useEffect)((()=>{c((e=>(0,r.c)(e,a)?e:a))}),[a]);const s=(0,o.useRef)(!1);return(0,o.useEffect)((()=>{s.current?i(l):s.current=!0}),[l,i]),(0,o.useEffect)((()=>{if(!l)return;const e=e=>{e.composedPath().indexOf(t.current)<=0&&c(null)};return document.addEventListener("click",e),()=>{document.removeEventListener("click",e)}}),[l,t]),l}},1484:(e,t,n)=>{n.d(t,{g:()=>h});var o=n(8769),r=n(7566),i=n(9047),a=n(3033),l=n(531),c=n(908),s=n(6170),d=n(9127);const u=new Map([["center",.5],["left",0],["right",1],["top",0],["bottom",1]]);function v(e,t){if("string"==typeof e){const n=u.get(e);if(void 0!==n)return n;const o=e.match(/^(-?\d+(?:\.\d+)?)%$/);if(o)return Number(o[1])/100;console.error("Unexpected align origin %s:",t,e)}else{if("number"==typeof e)return e;console.error("Unexpected align origin %s, expected %s, received %s:",t,"string | number",typeof e,e)}return.5}function h(e){let{layout:t,layoutOptions:n,rootRef:u,cells:h,zoomable:f,zoomer:m,scaleRange:g,layoutKey:p,allowEdgeToArea:y,dispatch:w}=e;const[x,E]=(0,o.useState)("force"!==t&&"dagre"!==t),k=(0,o.useRef)(p),b=(0,o.useCallback)((()=>++k.current),[]),[C,z]=function(e){let{rootRef:t,cells:n,layoutInitialized:s,zoomable:d,zoomer:u,scaleRange:v}=e;const[h,f]=(0,o.useState)(!1);return(0,o.useEffect)((()=>{const e=t.current;if(!e||!s||h||!n.some((e=>(0,l.N)(e)||(0,l.mH)(e)))||n.some((e=>(0,l.N)(e)&&!e[a.CV])))return;const{k:o,x:m,y:g}=(0,c.r)(n,{canvasWidth:e.clientWidth,canvasHeight:e.clientHeight,scaleRange:d?v:void 0});u.transform((0,r.A)(e),new i.uV(o,m,g)),f(!0)}),[n,h,s,t,v,d,u]),(0,o.useEffect)((()=>{n.some((e=>(0,l.N)(e)||(0,l.mH)(e)))||f(!1)}),[n]),[h,f]}({rootRef:u,layoutInitialized:x,cells:h,zoomable:f,zoomer:m,scaleRange:g}),S=(0,o.useRef)(null);return(0,o.useEffect)((()=>{if(h.some((e=>(0,l.N)(e)&&!e[a.CV]))||0===h.length)return;if("force"!==t&&"dagre"!==t)return void E(!0);if(k.current!==p||(e=S.current,o=h.filter(l.nv),(null==e?void 0:e.length)===o.length&&e.every(((e,t)=>e===o[t]))))return;var e,o;let r,i;({getNodeView:r,nodePaddings:i}="force"===t?(0,s.k)({cells:h,layoutOptions:n,allowEdgeToArea:y}):(0,d.C)({cells:h,layoutOptions:n,allowEdgeToArea:y}));const c=function(e){const t=e??[.5,.5];return[v(t[0],"x"),v(t[1],"y")]}(null==n?void 0:n.alignOrigin),u=h.map((e=>{if(y&&(0,l.o6)(e)||(0,l.N)(e)){const t=r(e.id);return{...e,view:{...e.view,x:t.x-t.width*c[0]+i[3],y:t.y-t.height*c[1]+i[0]},[a.xc]:!0}}return e}));S.current=u.filter(l.nv),w({type:"update-cells",payload:u}),E(!0)}),[h,w,t,p,n]),{centered:C,setCentered:z,getNextLayoutKey:b}}},7531:(e,t,n)=>{n.d(t,{d:()=>c});var o=n(8769),r=n(3204),i=n(1030),a=n(531),l=n(3033);function c(e){let{cells:t,defaultEdgeLines:n,markerPrefix:c,lineConnector:u}=e;return(0,o.useMemo)((()=>{const e=[{strokeColor:l.mF}];let o=null;if(u){o={...d(),editingStrokeColor:"var(--palette-blue-5)",...(0,i.omitBy)(!0===u?{}:u,i.isUndefined)};const t=s({strokeColor:o.strokeColor},e);o.$markerUrl=`url(#${c}${t})`;const n=s({strokeColor:o.editingStrokeColor},e);o.$editingMarkerUrl=`url(#${c}${n})`}const v=new WeakMap;for(const o of t)if((0,a.WW)(o)){const t=r.__secret_internals.legacyDoTransform({edge:o},null==n?void 0:n.find((e=>(0,r.checkIfByTransform)(e,{edge:o}))))??{},a={...d(),...(0,i.omitBy)(t,i.isUndefined),...(0,i.omitBy)(o.view,i.isUndefined)};void 0===a.parallelGap&&(a.parallelGap=a.interactStrokeWidth);const l=s({strokeColor:a.strokeColor},e);a.$markerUrl=`url(#${c}${l})`,v.set(o,a)}return{lineConfMap:v,lineConnectorConf:o,markers:e}}),[t,n,u,c])}function s(e,t){let n=(0,i.findIndex)(t,e);return-1===n&&(n=t.push(e)-1),n}function d(){return{type:"auto",dashed:!1,strokeColor:l.mF,strokeWidth:l.VO,interactStrokeWidth:l.Ie,showStartArrow:l.XV,showEndArrow:l.Ub,animate:{useAnimate:!1,duration:l.Be}}}},8197:(e,t,n)=>{n.d(t,{H:()=>a});var o=n(8769),r=n(531),i=n(3033);function a(e){let{cells:t,layout:n,centered:a}=e;return(0,o.useMemo)((()=>a&&t.every((e=>!(0,r.N)(e)||e[i.CV]&&("force"!==n&&"dagre"!==n||e[i.xc])))),[t,a,n])}},8091:(e,t,n)=>{n.d(t,{f:()=>l});var o=n(8769),r=n(7566),i=n(9047),a=n(3033);function l(e){let{rootRef:t,zoomable:n,scrollable:l,pannable:c,draggable:s,ctrlDraggable:d,scaleRange:u,onSwitchActiveTarget:v}=e;const[h,f]=(0,o.useState)(!1),[m,g]=(0,o.useState)({k:1,x:0,y:0}),p=(0,o.useMemo)((()=>u??[a.sS,a.Yt]),[u]),y=(0,o.useMemo)((()=>(0,i.s_)()),[]);return(0,o.useEffect)((()=>{let e=!1;y.scaleExtent(n?p:[1,1]).on("start",(()=>{e=!1,f(!0)})).on("zoom",(t=>{e=!0,g(t.transform)})).on("end",(()=>{f(!1),e||null==v||v(null)})).filter((e=>("wheel"===e.type||(d?s||e.ctrlKey:!e.ctrlKey))&&!e.button))}),[v,p,n,y,d,s]),(0,o.useEffect)((()=>{if(d){const e=e=>{e.ctrlKey&&e.preventDefault()};return document.addEventListener("contextmenu",e,!0),()=>{document.removeEventListener("contextmenu",e,!0)}}}),[d]),(0,o.useEffect)((()=>{const e=t.current;if(!e)return;const o=(0,r.A)(e),i=()=>{o.on(".zoom",null).on(".zoom.custom",null).on("wheel",null)};if(n||l||c)return(n||l)&&o.on("wheel.zoom.custom",(e=>{e.ctrlKey||(e.stopImmediatePropagation(),l&&(e.preventDefault(),y.translateBy(o,e.wheelDeltaX/5,e.wheelDeltaY/5)))})),o.call(y).on("wheel",(e=>{e.preventDefault()})).on("dblclick.zoom",null),(s||d)&&c||o.on("mousedown.zoom",null),c||o.on("touchstart.zoom",null).on("touchmove.zoom",null).on("touchend.zoom",null),i;i()}),[d,s,c,t,l,n,y]),{grabbing:h,transform:m,zoomer:y,scaleRange:p}}},6237:(e,t,n)=>{n.d(t,{A:()=>l});var o=n(6758),r=n.n(o),i=n(935),a=n.n(i)()(r());a.push([e.id,'.zoom-bar{position:absolute;bottom:20px;right:20px;width:40px;scale:0.8}.zoom-slider,\n.center-button{width:100%;display:flex;align-items:center;border:1px solid var(--antd-background-color-base);border-radius:var(--larger-border-radius);box-shadow:var(--connected-overlay-shadow);background-color:var(--color-fill-bg-container-4)}.zoom-slider{height:140px;padding:8px 0;flex-direction:column}[role="button"]{cursor:pointer}.center-button{justify-content:center;margin-bottom:8px;height:40px}.center-button:hover{border-color:var(--antd-btn-default-hover-border-color)}.center-button path{fill:var(--antd-link-hover-color)}.center-button:hover path{fill:var(--palette-blue-7)}.zoom-button{font-size:16px;line-height:0}.zoom-button svg{width:1em;height:1em;fill:var(--antd-link-hover-color)}.zoom-slider .ant-slider-vertical{padding-inline:5px}.zoom-slider .ant-slider-vertical .ant-slider-rail{width:2px}.zoom-slider .ant-slider-vertical .ant-slider-handle{width:6px;height:6px;inset-inline-start:3px}.zoom-slider .ant-slider .ant-slider-handle:hover::before,\n.zoom-slider .ant-slider .ant-slider-handle:focus::before,\n.zoom-slider .ant-slider .ant-slider-handle::before{width:10px;height:10px;inset-inline-start:-2px}.zoom-slider .ant-slider .ant-slider-handle:hover::after,\n.zoom-slider .ant-slider .ant-slider-handle:focus::after,\n.zoom-slider .ant-slider .ant-slider-handle::after{width:6px;height:6px;inset-block-start:0;inset-inline-start:0}',""]);const l=a.toString()},3012:(e,t,n)=>{n.d(t,{A:()=>l});var o=n(6758),r=n.n(o),i=n(935),a=n.n(i)()(r());a.push([e.id,"*{box-sizing:border-box}:host{display:block;position:relative;overflow:hidden;--animation-dasharray:48;--stroke-dashoffset:96;--dasharray:4}:host,\n.root{width:100%;height:100%}:host([hidden]){display:none}.root{opacity:0}.root.ready{opacity:1}.root:focus{outline:none}@keyframes dashedAnimation{0%{stroke-dashoffset:var(--stroke-dashoffset)}to{stroke-dashoffset:0}}@keyframes solidAnimation{to{stroke-dashoffset:0}}.solid-animation{stroke-dasharray:var(--solid-length);stroke-dashoffset:var(--solid-length);animation:solidAnimation var(--time) linear infinite}.dashed-animation{animation:dashedAnimation var(--time) linear infinite}.decorator-area .area,\n.decorator-container .container{fill:rgba(119,141,195,0.1);stroke:none;stroke-width:0}.node,\n.decorator-text{overflow:visible}.cell.active .decorator-area .area,\n.cell.active .decorator-container .container,\n.cell:not(.read-only) .decorator-container .container:hover,\n.allowEdgeToArea .decorator-area .area:hover,\n.cell.active .line-active-bg{stroke:var(--palette-blue-5);stroke-dasharray:var(--dasharray);stroke-width:1}.container-active .decorator-container .container{stroke:var(--palette-blue-5);stroke-width:1}.cell:not(.read-only){-webkit-user-select:none;user-select:none}.resize-handle{cursor:nwse-resize;opacity:0}.resize-handle rect{fill:transparent;stroke:none}.resize-handle path{fill:none;stroke:var(--palette-gray-5);stroke-width:1.5}.cell.active .decorator-area .resize-handle,\n.decorator-area:hover .resize-handle,\n.decorator-container:hover .resize-handle{opacity:1}.connect-line{pointer-events:none}.connect-line:not(.connecting){display:none}.editing-line{pointer-events:none;stroke-dasharray:var(--dasharray);stroke-width:1}.editing-line:not(.editing){display:none}.line.dashed{stroke-dasharray:var(--dasharray)}.cell.active .decorator-text .text-container{outline:1px dashed var(--palette-blue-5)}.decorator-text .text-container{width:max-content;padding:0.5em}.decorator-text .text:focus{outline:none}.cell.faded{opacity:0.3}.cell.container-active{opacity:1}.cell .node{pointer-events:none}.cell .node > *{position:fixed;pointer-events:auto}.degraded{pointer-events:bounding-box}.degraded circle{fill:rgb(119,141,195)}.degraded text{text-anchor:middle;fill:var(--antd-text-color)}.cell.active .degraded circle,\n.cell.active .degraded text,\n.degraded:hover circle,\n.degraded:hover text{fill:var(--color-brand)}.decorator-container{--defaultSize:24px}.decorator-container .text-container{display:flex;align-items:center;justify-content:center;padding:0.5em;text-align:center;font-size:16px;background-color:rgba(119,141,195,0.6);overflow:hidden}.decorator-container .horizontal{height:max-content;width:100%}:is(.decorator-container .horizontal) .text{min-height:var(--defaultSize)}.decorator-container .vertical{width:max-content;height:100%;writing-mode:vertical-lr;text-orientation:upright;letter-spacing:4px}:is(.decorator-container .vertical) .text{min-width:var(--defaultSize)}",""]);const l=a.toString()}}]);
|
|
2
|
-
//# sourceMappingURL=6055.b92cd119.js.map
|