@loopstack/loopstack-studio 0.29.5 → 0.31.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.
Files changed (122) hide show
  1. package/dist/_virtual/rolldown_runtime.js +3 -1
  2. package/dist/api/config.js +5 -4
  3. package/dist/api/environments.js +5 -1
  4. package/dist/api/processor.js +4 -1
  5. package/dist/app/EnvironmentEmbedRoot.js +22 -30
  6. package/dist/components/ai-elements/code-block.js +4 -4
  7. package/dist/components/dynamic-form/CodeContent.js +1 -1
  8. package/dist/components/dynamic-form/FormBody.js +1 -1
  9. package/dist/components/layout/StudioSidebar.js +116 -131
  10. package/dist/components/lists/ListView.js +46 -46
  11. package/dist/components/motion/FadeIn.js +72 -0
  12. package/dist/components/motion/StreamingText.js +49 -0
  13. package/dist/components/ui/accordion.js +2 -2
  14. package/dist/components/ui-widgets/UiWidget.js +11 -10
  15. package/dist/components/ui-widgets/widgets/AiPromptInput.js +31 -28
  16. package/dist/events/sse-client-events.js +7 -1
  17. package/dist/features/code-explorer/components/FileContentViewer.js +2 -2
  18. package/dist/features/dashboard/AppLauncher.js +84 -0
  19. package/dist/features/debug/components/WorkflowFlowViewer.js +49 -51
  20. package/dist/features/documents/DocumentRenderer.js +18 -17
  21. package/dist/features/documents/components/DocumentItem.js +42 -20
  22. package/dist/features/documents/components/DocumentList.js +34 -36
  23. package/dist/features/documents/components/DocumentMetadataPills.js +102 -49
  24. package/dist/features/documents/document-details/DocumentDetails.js +577 -377
  25. package/dist/features/documents/document-details/PromptDetails.js +118 -130
  26. package/dist/features/documents/document-details/document-debug-utils.js +100 -0
  27. package/dist/features/documents/renderers/ChoicesRenderer.js +41 -38
  28. package/dist/features/documents/renderers/ConfirmPromptRenderer.js +31 -28
  29. package/dist/features/documents/renderers/DocumentFormRenderer.js +62 -70
  30. package/dist/features/documents/renderers/LlmMessage.js +52 -47
  31. package/dist/features/documents/renderers/TextPromptRenderer.js +32 -29
  32. package/dist/features/documents/renderers/useDocumentTransition.js +4 -4
  33. package/dist/features/feature-registry/FeatureRegistryProvider.js +32 -10
  34. package/dist/features/feature-registry/available-features.js +12 -0
  35. package/dist/features/feature-registry/index.js +2 -1
  36. package/dist/features/file-explorer/components/FileExplorerPanel.js +55 -51
  37. package/dist/features/git/components/GitBranchBadge.js +31 -0
  38. package/dist/features/git/components/GitCommitList.js +46 -0
  39. package/dist/features/git/components/GitRemoteStatus.js +84 -0
  40. package/dist/features/git/components/WorkbenchGitPanel.js +81 -0
  41. package/dist/features/git/git-feature.js +12 -0
  42. package/dist/features/git/hooks/useGit.js +78 -0
  43. package/dist/features/git/index.js +1 -0
  44. package/dist/features/oauth/OAuthPromptRenderer.js +137 -142
  45. package/dist/features/runs/Runs.js +73 -73
  46. package/dist/features/secrets/components/WorkbenchSecretsPanel.js +1 -1
  47. package/dist/features/secrets/renderers/SecretInputRenderer.js +30 -29
  48. package/dist/features/workbench/Workbench.js +25 -33
  49. package/dist/features/workbench/WorkflowItem.js +9 -9
  50. package/dist/features/workbench/WorkflowList.js +61 -62
  51. package/dist/features/workbench/components/NewRunDialog.js +237 -209
  52. package/dist/features/workbench/components/RecentRunItem.js +3 -3
  53. package/dist/features/workbench/components/WorkbenchEnvironmentPanel.js +8 -8
  54. package/dist/features/workbench/components/WorkbenchIconSidebar.js +74 -109
  55. package/dist/features/workbench/components/WorkbenchSidebarShell.js +3 -3
  56. package/dist/features/workbench/components/WorkflowForms.js +11 -10
  57. package/dist/features/workbench/components/WorkflowHistoryItem.js +16 -36
  58. package/dist/features/workbench/components/WorkflowHistoryList.js +19 -17
  59. package/dist/features/workbench/components/buttons/WorkflowButtons.js +3 -3
  60. package/dist/features/workbench/hooks/useLlmStreamingDocuments.js +159 -0
  61. package/dist/features/workbench/hooks/useWorkflowData.js +58 -31
  62. package/dist/features/workbench/index.js +2 -2
  63. package/dist/features/workbench/providers/WorkbenchLayoutProvider.js +53 -53
  64. package/dist/features/workspaces/Workspaces.js +166 -136
  65. package/dist/features/workspaces/components/CreateWorkspace.js +115 -107
  66. package/dist/features/workspaces/components/ExecutionTimeline.js +2 -2
  67. package/dist/features/workspaces/components/WorkflowRunForm.js +127 -104
  68. package/dist/features/workspaces/components/WorkspaceHomePage.js +6 -89
  69. package/dist/features/workspaces/components/workflow-form/ArgumentsView.js +1 -1
  70. package/dist/features/workspaces/components/workflow-form/SelectionView.js +15 -15
  71. package/dist/hooks/index.js +3 -2
  72. package/dist/hooks/query-keys.js +43 -30
  73. package/dist/hooks/useConfig.js +28 -22
  74. package/dist/hooks/useEnvironments.js +27 -2
  75. package/dist/hooks/useProcessor.js +14 -1
  76. package/dist/hooks/useWorkflows.js +4 -4
  77. package/dist/index.d.ts +119 -18
  78. package/dist/index.js +10 -9
  79. package/dist/node_modules/d3/src/index.js +13 -13
  80. package/dist/node_modules/d3-scale/src/continuous.js +16 -16
  81. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/architectureDiagram-3BPJPVTR.js +43 -43
  82. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/blockDiagram-GPEHLZMM.js +270 -270
  83. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/c4Diagram-AAUBKEIU.js +90 -90
  84. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-3OPIFGDE.js +458 -458
  85. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-55IACEB6.js +3 -3
  86. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-5ZQYHXKU.js +37 -37
  87. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-727SXJPM.js +208 -208
  88. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-KSCS5N6A.js +145 -145
  89. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-ND2GUHAM.js +7 -7
  90. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-O5CBEL6O.js +41 -41
  91. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-WU5MYG2G.js +3 -3
  92. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/cose-bilkent-S5V4N54A.js +6 -6
  93. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/diagram-KO2AKTUF.js +30 -30
  94. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/diagram-OG6HWLK6.js +82 -82
  95. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/erDiagram-TEJ5UH35.js +65 -65
  96. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/flowDiagram-I6XJVG4X.js +227 -227
  97. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/ganttDiagram-6RSMTGT7.js +104 -104
  98. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/gitGraphDiagram-PVQCEYII.js +104 -104
  99. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/journeyDiagram-JHISSGLW.js +49 -49
  100. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/quadrantDiagram-W4KKPZXB.js +101 -101
  101. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/sankeyDiagram-5OEKKPKP.js +20 -20
  102. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/sequenceDiagram-3UESZ5HK.js +354 -354
  103. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/stateDiagram-AJRCARHV.js +53 -53
  104. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/timeline-definition-PNZ67QCA.js +113 -113
  105. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/vennDiagram-CIIHVFJN.js +90 -90
  106. package/dist/node_modules/mermaid/dist/mermaid.core.js +156 -156
  107. package/dist/node_modules/motion/dist/es/react.js +9 -2
  108. package/dist/pages/DashboardPage.js +20 -74
  109. package/dist/pages/DebugWorkflowDetailsPage.js +2 -2
  110. package/dist/pages/DebugWorkflowsPage.js +76 -106
  111. package/dist/pages/EmbedWorkbenchPage.js +1 -1
  112. package/dist/pages/PreviewWorkbenchPage.js +6 -6
  113. package/dist/pages/WorkbenchPage.js +43 -47
  114. package/dist/pages/WorkflowDebugPage.js +6 -12
  115. package/dist/pages/WorkspacePage.js +40 -66
  116. package/dist/pages/WorkspaceRunsPage.js +24 -31
  117. package/dist/routing/LocalRouter.js +1 -1
  118. package/package.json +2 -2
  119. package/dist/features/dashboard/Dashboard.js +0 -125
  120. package/dist/features/dashboard/RunItem.js +0 -78
  121. package/dist/features/dashboard/RunList.js +0 -32
  122. package/dist/hooks/useDashboard.js +0 -16
@@ -1,51 +1,51 @@
1
+ import select_default from "../../../../d3-selection/src/select.js";
1
2
  import { __name, log } from "./chunk-AGHRB4JF.js";
2
3
  import { evaluate, getConfig, getConfig2, getEffectiveHtmlLabels, hasKatex, parseGenericTypes, sanitizeText, sanitizeText3 } from "./chunk-CSCIHK7Q.js";
3
- import select_default from "../../../../d3-selection/src/select.js";
4
4
  import "../../../../d3/src/index.js";
5
5
  import { calculateTextWidth, decodeEntities, handleUndefinedAttr } from "./chunk-5ZQYHXKU.js";
6
6
  import { configureLabelImages, getSubGraphTitleMargins } from "./chunk-L5ZTLDWV.js";
7
7
  import { compileStyles, solidStateFill, styles2String, userNodeOverrides } from "./chunk-NZK2D7GU.js";
8
8
  import { createText, getIconSVG } from "./chunk-O5CBEL6O.js";
9
9
  import { at } from "../../../../roughjs/bundled/rough.esm.js";
10
- var labelHelper = /* @__PURE__ */ __name(async (e, a, s) => {
11
- let l, u = a.useHtmlLabels || evaluate(getConfig2()?.htmlLabels);
12
- l = s || "node default";
13
- let d = e.insert("g").attr("class", l).attr("id", a.domId || a.id), p = d.insert("g").attr("class", "label").attr("style", handleUndefinedAttr(a.labelStyle)), h;
14
- h = a.label === void 0 ? "" : typeof a.label == "string" ? a.label : a.label[0];
15
- let y = !!a.icon || !!a.img, b = a.labelType === "markdown", x = await createText(p, sanitizeText(decodeEntities(h), getConfig2()), {
16
- useHtmlLabels: u,
17
- width: a.width || getConfig2().flowchart?.wrappingWidth,
10
+ var labelHelper = /* @__PURE__ */ __name(async (a, o, c) => {
11
+ let u, d = o.useHtmlLabels || evaluate(getConfig2()?.htmlLabels);
12
+ u = c || "node default";
13
+ let f = a.insert("g").attr("class", u).attr("id", o.domId || o.id), m = f.insert("g").attr("class", "label").attr("style", handleUndefinedAttr(o.labelStyle)), h;
14
+ h = o.label === void 0 ? "" : typeof o.label == "string" ? o.label : o.label[0];
15
+ let y = !!o.icon || !!o.img, b = o.labelType === "markdown", x = await createText(m, sanitizeText(decodeEntities(h), getConfig2()), {
16
+ useHtmlLabels: d,
17
+ width: o.width || getConfig2().flowchart?.wrappingWidth,
18
18
  classes: b ? "markdown-node-label" : "",
19
- style: a.labelStyle,
19
+ style: o.labelStyle,
20
20
  addSvgBackground: y,
21
21
  markdown: b
22
- }, getConfig2()), S = x.getBBox(), C = (a?.padding ?? 0) / 2;
23
- if (u) {
24
- let e = x.children[0], a = select_default(x);
25
- await configureLabelImages(e, h), S = e.getBoundingClientRect(), a.attr("width", S.width), a.attr("height", S.height);
22
+ }, getConfig2()), S = x.getBBox(), C = (o?.padding ?? 0) / 2;
23
+ if (d) {
24
+ let a = x.children[0], o = select_default(x);
25
+ await configureLabelImages(a, h), S = a.getBoundingClientRect(), o.attr("width", S.width), o.attr("height", S.height);
26
26
  }
27
- return u ? p.attr("transform", "translate(" + -S.width / 2 + ", " + -S.height / 2 + ")") : p.attr("transform", "translate(0, " + -S.height / 2 + ")"), a.centerLabel && p.attr("transform", "translate(" + -S.width / 2 + ", " + -S.height / 2 + ")"), p.insert("rect", ":first-child"), {
28
- shapeSvg: d,
27
+ return d ? m.attr("transform", "translate(" + -S.width / 2 + ", " + -S.height / 2 + ")") : m.attr("transform", "translate(0, " + -S.height / 2 + ")"), o.centerLabel && m.attr("transform", "translate(" + -S.width / 2 + ", " + -S.height / 2 + ")"), m.insert("rect", ":first-child"), {
28
+ shapeSvg: f,
29
29
  bbox: S,
30
30
  halfPadding: C,
31
- label: p
31
+ label: m
32
32
  };
33
- }, "labelHelper"), insertLabel = /* @__PURE__ */ __name(async (e, a, o) => {
34
- let s = o.useHtmlLabels ?? getEffectiveHtmlLabels(getConfig2()), u = e.insert("g").attr("class", "label").attr("style", o.labelStyle || ""), d = await createText(u, sanitizeText(decodeEntities(a), getConfig2()), {
35
- useHtmlLabels: s,
36
- width: o.width || getConfig2()?.flowchart?.wrappingWidth,
37
- style: o.labelStyle,
38
- addSvgBackground: !!o.icon || !!o.img
39
- }), p = d.getBBox(), h = o.padding / 2;
33
+ }, "labelHelper"), insertLabel = /* @__PURE__ */ __name(async (a, o, s) => {
34
+ let c = s.useHtmlLabels ?? getEffectiveHtmlLabels(getConfig2()), d = a.insert("g").attr("class", "label").attr("style", s.labelStyle || ""), f = await createText(d, sanitizeText(decodeEntities(o), getConfig2()), {
35
+ useHtmlLabels: c,
36
+ width: s.width || getConfig2()?.flowchart?.wrappingWidth,
37
+ style: s.labelStyle,
38
+ addSvgBackground: !!s.icon || !!s.img
39
+ }), m = f.getBBox(), h = s.padding / 2;
40
40
  if (getEffectiveHtmlLabels(getConfig2())) {
41
- let e = d.children[0], a = select_default(d);
42
- p = e.getBoundingClientRect(), a.attr("width", p.width), a.attr("height", p.height);
41
+ let a = f.children[0], o = select_default(f);
42
+ m = a.getBoundingClientRect(), o.attr("width", m.width), o.attr("height", m.height);
43
43
  }
44
- return s ? u.attr("transform", "translate(" + -p.width / 2 + ", " + -p.height / 2 + ")") : u.attr("transform", "translate(0, " + -p.height / 2 + ")"), o.centerLabel && u.attr("transform", "translate(" + -p.width / 2 + ", " + -p.height / 2 + ")"), u.insert("rect", ":first-child"), {
45
- shapeSvg: e,
46
- bbox: p,
44
+ return c ? d.attr("transform", "translate(" + -m.width / 2 + ", " + -m.height / 2 + ")") : d.attr("transform", "translate(0, " + -m.height / 2 + ")"), s.centerLabel && d.attr("transform", "translate(" + -m.width / 2 + ", " + -m.height / 2 + ")"), d.insert("rect", ":first-child"), {
45
+ shapeSvg: a,
46
+ bbox: m,
47
47
  halfPadding: h,
48
- label: u
48
+ label: d
49
49
  };
50
50
  }, "insertLabel"), updateNodeBounds = /* @__PURE__ */ __name((e, a) => {
51
51
  let o = a.node().getBBox();
@@ -80,8 +80,8 @@ function generateCirclePoints(e, a, o, s, c, l) {
80
80
  return u;
81
81
  }
82
82
  __name(generateCirclePoints, "generateCirclePoints");
83
- function mergePaths(a) {
84
- let o = Array.from(a.childNodes).filter((e) => e.tagName === "path"), s = document.createElementNS("http://www.w3.org/2000/svg", "path"), c = o.map((e) => e.getAttribute("d")).filter((e) => e !== null).join(" ");
83
+ function mergePaths(e) {
84
+ let o = Array.from(e.childNodes).filter((e) => e.tagName === "path"), s = document.createElementNS("http://www.w3.org/2000/svg", "path"), c = o.map((e) => e.getAttribute("d")).filter((e) => e !== null).join(" ");
85
85
  s.setAttribute("d", c);
86
86
  let l = o.find((e) => e.getAttribute("fill") !== "none"), u = o.find((e) => e.getAttribute("stroke") !== "none"), d = /* @__PURE__ */ __name((e, a) => e?.getAttribute(a) ?? void 0, "getAttr");
87
87
  if (l) {
@@ -113,7 +113,7 @@ var intersect_rect_default = /* @__PURE__ */ __name((e, a) => {
113
113
  x: o + f,
114
114
  y: s + p
115
115
  };
116
- }, "intersectRect"), createLabel_default = /* @__PURE__ */ __name(async (e, a, o, s = !1, u = !1) => {
116
+ }, "intersectRect"), createLabel_default = /* @__PURE__ */ __name(async (e, a, o, s = !1, c = !1) => {
117
117
  let d = a || "";
118
118
  typeof d == "object" && (d = d[0]);
119
119
  let f = getConfig2(), p = getEffectiveHtmlLabels(f);
@@ -122,7 +122,7 @@ var intersect_rect_default = /* @__PURE__ */ __name((e, a) => {
122
122
  isTitle: s,
123
123
  useHtmlLabels: p,
124
124
  markdown: !1,
125
- isNode: u,
125
+ isNode: c,
126
126
  width: Infinity
127
127
  }, f);
128
128
  }, "createLabel"), createRoundedRectPathD = /* @__PURE__ */ __name((e, a, o, s, c) => [
@@ -170,43 +170,43 @@ var intersect_rect_default = /* @__PURE__ */ __name((e, a) => {
170
170
  e + c,
171
171
  a,
172
172
  "Z"
173
- ].join(" "), "createRoundedRectPathD"), rect = /* @__PURE__ */ __name(async (e, o) => {
174
- log.info("Creating subgraph rect for ", o.id, o);
175
- let s = getConfig2(), { themeVariables: u, handDrawnSeed: d } = s, { clusterBkg: f, clusterBorder: p } = u, { labelStyles: h, nodeStyles: g, borderStyles: _, backgroundStyles: v } = styles2String(o), b = e.insert("g").attr("class", "cluster " + o.cssClasses).attr("id", o.domId).attr("data-look", o.look), x = getEffectiveHtmlLabels(s), T = b.insert("g").attr("class", "cluster-label "), E;
176
- E = o.labelType === "markdown" ? await createText(T, o.label, {
177
- style: o.labelStyle,
173
+ ].join(" "), "createRoundedRectPathD"), rect = /* @__PURE__ */ __name(async (a, s) => {
174
+ log.info("Creating subgraph rect for ", s.id, s);
175
+ let c = getConfig2(), { themeVariables: d, handDrawnSeed: f } = c, { clusterBkg: p, clusterBorder: m } = d, { labelStyles: h, nodeStyles: g, borderStyles: _, backgroundStyles: v } = styles2String(s), b = a.insert("g").attr("class", "cluster " + s.cssClasses).attr("id", s.domId).attr("data-look", s.look), x = getEffectiveHtmlLabels(c), T = b.insert("g").attr("class", "cluster-label "), E;
176
+ E = s.labelType === "markdown" ? await createText(T, s.label, {
177
+ style: s.labelStyle,
178
178
  useHtmlLabels: x,
179
179
  isNode: !0,
180
- width: o.width
181
- }) : await createLabel_default(T, o.label, o.labelStyle || "", !1, !0);
180
+ width: s.width
181
+ }) : await createLabel_default(T, s.label, s.labelStyle || "", !1, !0);
182
182
  let D = E.getBBox();
183
- if (getEffectiveHtmlLabels(s)) {
184
- let e = E.children[0], a = select_default(E);
185
- D = e.getBoundingClientRect(), a.attr("width", D.width), a.attr("height", D.height);
183
+ if (getEffectiveHtmlLabels(c)) {
184
+ let a = E.children[0], o = select_default(E);
185
+ D = a.getBoundingClientRect(), o.attr("width", D.width), o.attr("height", D.height);
186
186
  }
187
- let O = o.width <= D.width + o.padding ? D.width + o.padding : o.width;
188
- o.width <= D.width + o.padding ? o.diff = (O - o.width) / 2 - o.padding : o.diff = -o.padding;
189
- let k = o.height, A = o.x - O / 2, j = o.y - k / 2;
190
- log.trace("Data ", o, JSON.stringify(o));
187
+ let O = s.width <= D.width + s.padding ? D.width + s.padding : s.width;
188
+ s.width <= D.width + s.padding ? s.diff = (O - s.width) / 2 - s.padding : s.diff = -s.padding;
189
+ let k = s.height, A = s.x - O / 2, j = s.y - k / 2;
190
+ log.trace("Data ", s, JSON.stringify(s));
191
191
  let M;
192
- if (o.look === "handDrawn") {
193
- let e = at.svg(b), s = userNodeOverrides(o, {
192
+ if (s.look === "handDrawn") {
193
+ let e = at.svg(b), a = userNodeOverrides(s, {
194
194
  roughness: .7,
195
- fill: f,
196
- stroke: p,
195
+ fill: p,
196
+ stroke: m,
197
197
  fillWeight: 3,
198
- seed: d
199
- }), c = e.path(createRoundedRectPathD(A, j, O, k, 0), s);
198
+ seed: f
199
+ }), c = e.path(createRoundedRectPathD(A, j, O, k, 0), a);
200
200
  M = b.insert(() => (log.debug("Rough node insert CXC", c), c), ":first-child"), M.select("path:nth-child(2)").attr("style", _.join(";")), M.select("path").attr("style", v.join(";").replace("fill", "stroke"));
201
- } else M = b.insert("rect", ":first-child"), M.attr("style", g).attr("rx", o.rx).attr("ry", o.ry).attr("x", A).attr("y", j).attr("width", O).attr("height", k);
202
- let { subGraphTitleTopMargin: N } = getSubGraphTitleMargins(s);
203
- if (T.attr("transform", `translate(${o.x - D.width / 2}, ${o.y - o.height / 2 + N})`), h) {
201
+ } else M = b.insert("rect", ":first-child"), M.attr("style", g).attr("rx", s.rx).attr("ry", s.ry).attr("x", A).attr("y", j).attr("width", O).attr("height", k);
202
+ let { subGraphTitleTopMargin: N } = getSubGraphTitleMargins(c);
203
+ if (T.attr("transform", `translate(${s.x - D.width / 2}, ${s.y - s.height / 2 + N})`), h) {
204
204
  let e = T.select("span");
205
205
  e && e.attr("style", h);
206
206
  }
207
207
  let L = M.node().getBBox();
208
- return o.offsetX = 0, o.width = L.width, o.height = L.height, o.offsetY = D.height - o.padding / 2, o.intersect = function(e) {
209
- return intersect_rect_default(o, e);
208
+ return s.offsetX = 0, s.width = L.width, s.height = L.height, s.offsetY = D.height - s.padding / 2, s.intersect = function(e) {
209
+ return intersect_rect_default(s, e);
210
210
  }, {
211
211
  cluster: b,
212
212
  labelBBox: D
@@ -214,36 +214,36 @@ var intersect_rect_default = /* @__PURE__ */ __name((e, a) => {
214
214
  }, "rect"), shapes = {
215
215
  rect,
216
216
  squareRect: rect,
217
- roundedWithTitle: /* @__PURE__ */ __name(async (e, a) => {
218
- let o = getConfig2(), { themeVariables: s, handDrawnSeed: u } = o, { altBackground: d, compositeBackground: f, compositeTitleBackground: p, nodeBorder: h } = s, g = e.insert("g").attr("class", a.cssClasses).attr("id", a.domId).attr("data-id", a.id).attr("data-look", a.look), _ = g.insert("g", ":first-child"), v = g.insert("g").attr("class", "cluster-label"), y = g.append("rect"), b = await createLabel_default(v, a.label, a.labelStyle, void 0, !0), x = b.getBBox();
219
- if (getEffectiveHtmlLabels(o)) {
220
- let e = b.children[0], a = select_default(b);
221
- x = e.getBoundingClientRect(), a.attr("width", x.width), a.attr("height", x.height);
217
+ roundedWithTitle: /* @__PURE__ */ __name(async (a, o) => {
218
+ let s = getConfig2(), { themeVariables: c, handDrawnSeed: d } = s, { altBackground: f, compositeBackground: p, compositeTitleBackground: m, nodeBorder: h } = c, g = a.insert("g").attr("class", o.cssClasses).attr("id", o.domId).attr("data-id", o.id).attr("data-look", o.look), _ = g.insert("g", ":first-child"), v = g.insert("g").attr("class", "cluster-label"), y = g.append("rect"), b = await createLabel_default(v, o.label, o.labelStyle, void 0, !0), x = b.getBBox();
219
+ if (getEffectiveHtmlLabels(s)) {
220
+ let a = b.children[0], o = select_default(b);
221
+ x = a.getBoundingClientRect(), o.attr("width", x.width), o.attr("height", x.height);
222
222
  }
223
- let S = 0 * a.padding, C = S / 2, w = (a.width <= x.width + a.padding ? x.width + a.padding : a.width) + S;
224
- a.width <= x.width + a.padding ? a.diff = (w - a.width) / 2 - a.padding : a.diff = -a.padding;
225
- let T = a.height + S, E = a.height + S - x.height - 6, D = a.x - w / 2, O = a.y - T / 2;
226
- a.width = w;
227
- let k = a.y - a.height / 2 - C + x.height + 2, A;
228
- if (a.look === "handDrawn") {
229
- let e = a.cssClasses.includes("statediagram-cluster-alt"), o = at.svg(g), s = a.rx || a.ry ? o.path(createRoundedRectPathD(D, O, w, T, 10), {
223
+ let S = 0 * o.padding, C = S / 2, w = (o.width <= x.width + o.padding ? x.width + o.padding : o.width) + S;
224
+ o.width <= x.width + o.padding ? o.diff = (w - o.width) / 2 - o.padding : o.diff = -o.padding;
225
+ let T = o.height + S, E = o.height + S - x.height - 6, D = o.x - w / 2, O = o.y - T / 2;
226
+ o.width = w;
227
+ let k = o.y - o.height / 2 - C + x.height + 2, A;
228
+ if (o.look === "handDrawn") {
229
+ let e = o.cssClasses.includes("statediagram-cluster-alt"), a = at.svg(g), s = o.rx || o.ry ? a.path(createRoundedRectPathD(D, O, w, T, 10), {
230
230
  roughness: .7,
231
- fill: p,
231
+ fill: m,
232
232
  fillStyle: "solid",
233
233
  stroke: h,
234
- seed: u
235
- }) : o.rectangle(D, O, w, T, { seed: u });
234
+ seed: d
235
+ }) : a.rectangle(D, O, w, T, { seed: d });
236
236
  A = g.insert(() => s, ":first-child");
237
- let c = o.rectangle(D, k, w, E, {
238
- fill: e ? d : f,
237
+ let c = a.rectangle(D, k, w, E, {
238
+ fill: e ? f : p,
239
239
  fillStyle: e ? "hachure" : "solid",
240
240
  stroke: h,
241
- seed: u
241
+ seed: d
242
242
  });
243
243
  A = g.insert(() => s, ":first-child"), y = g.insert(() => c);
244
- } else A = _.insert("rect", ":first-child"), A.attr("class", "outer").attr("x", D).attr("y", O).attr("width", w).attr("height", T).attr("data-look", a.look), y.attr("class", "inner").attr("x", D).attr("y", k).attr("width", w).attr("height", E);
245
- return v.attr("transform", `translate(${a.x - x.width / 2}, ${O + 1 - (getEffectiveHtmlLabels(o) ? 0 : 3)})`), a.height = A.node().getBBox().height, a.offsetX = 0, a.offsetY = x.height - a.padding / 2, a.labelBBox = x, a.intersect = function(e) {
246
- return intersect_rect_default(a, e);
244
+ } else A = _.insert("rect", ":first-child"), A.attr("class", "outer").attr("x", D).attr("y", O).attr("width", w).attr("height", T).attr("data-look", o.look), y.attr("class", "inner").attr("x", D).attr("y", k).attr("width", w).attr("height", E);
245
+ return v.attr("transform", `translate(${o.x - x.width / 2}, ${O + 1 - (getEffectiveHtmlLabels(s) ? 0 : 3)})`), o.height = A.node().getBBox().height, o.offsetX = 0, o.offsetY = x.height - o.padding / 2, o.labelBBox = x, o.intersect = function(e) {
246
+ return intersect_rect_default(o, e);
247
247
  }, {
248
248
  cluster: g,
249
249
  labelBBox: x
@@ -264,7 +264,7 @@ var intersect_rect_default = /* @__PURE__ */ __name((e, a) => {
264
264
  };
265
265
  }, "noteGroup"),
266
266
  divider: /* @__PURE__ */ __name((e, a) => {
267
- let { themeVariables: o, handDrawnSeed: s } = getConfig2(), { nodeBorder: l } = o, u = e.insert("g").attr("class", a.cssClasses).attr("id", a.domId).attr("data-look", a.look), d = u.insert("g", ":first-child"), f = 0 * a.padding, p = a.width + f;
267
+ let { themeVariables: o, handDrawnSeed: s } = getConfig2(), { nodeBorder: c } = o, u = e.insert("g").attr("class", a.cssClasses).attr("id", a.domId).attr("data-look", a.look), d = u.insert("g", ":first-child"), f = 0 * a.padding, p = a.width + f;
268
268
  a.diff = -a.padding;
269
269
  let m = a.height + f, h = a.x - p / 2, g = a.y - m / 2;
270
270
  a.width = p;
@@ -274,7 +274,7 @@ var intersect_rect_default = /* @__PURE__ */ __name((e, a) => {
274
274
  fill: "lightgrey",
275
275
  roughness: .5,
276
276
  strokeLineDash: [5],
277
- stroke: l,
277
+ stroke: c,
278
278
  seed: s
279
279
  });
280
280
  _ = u.insert(() => e, ":first-child");
@@ -290,41 +290,41 @@ var intersect_rect_default = /* @__PURE__ */ __name((e, a) => {
290
290
  labelBBox: {}
291
291
  };
292
292
  }, "divider"),
293
- kanbanSection: /* @__PURE__ */ __name(async (e, o) => {
294
- log.info("Creating subgraph rect for ", o.id, o);
295
- let s = getConfig2(), { themeVariables: u, handDrawnSeed: d } = s, { clusterBkg: f, clusterBorder: p } = u, { labelStyles: h, nodeStyles: g, borderStyles: _, backgroundStyles: v } = styles2String(o), b = e.insert("g").attr("class", "cluster " + o.cssClasses).attr("id", o.domId).attr("data-look", o.look), x = getEffectiveHtmlLabels(s), T = b.insert("g").attr("class", "cluster-label "), E = await createText(T, o.label, {
296
- style: o.labelStyle,
293
+ kanbanSection: /* @__PURE__ */ __name(async (a, s) => {
294
+ log.info("Creating subgraph rect for ", s.id, s);
295
+ let c = getConfig2(), { themeVariables: d, handDrawnSeed: f } = c, { clusterBkg: p, clusterBorder: m } = d, { labelStyles: h, nodeStyles: g, borderStyles: _, backgroundStyles: v } = styles2String(s), b = a.insert("g").attr("class", "cluster " + s.cssClasses).attr("id", s.domId).attr("data-look", s.look), x = getEffectiveHtmlLabels(c), T = b.insert("g").attr("class", "cluster-label "), E = await createText(T, s.label, {
296
+ style: s.labelStyle,
297
297
  useHtmlLabels: x,
298
298
  isNode: !0,
299
- width: o.width
299
+ width: s.width
300
300
  }), D = E.getBBox();
301
- if (getEffectiveHtmlLabels(s)) {
302
- let e = E.children[0], a = select_default(E);
303
- D = e.getBoundingClientRect(), a.attr("width", D.width), a.attr("height", D.height);
301
+ if (getEffectiveHtmlLabels(c)) {
302
+ let a = E.children[0], o = select_default(E);
303
+ D = a.getBoundingClientRect(), o.attr("width", D.width), o.attr("height", D.height);
304
304
  }
305
- let O = o.width <= D.width + o.padding ? D.width + o.padding : o.width;
306
- o.width <= D.width + o.padding ? o.diff = (O - o.width) / 2 - o.padding : o.diff = -o.padding;
307
- let k = o.height, A = o.x - O / 2, j = o.y - k / 2;
308
- log.trace("Data ", o, JSON.stringify(o));
305
+ let O = s.width <= D.width + s.padding ? D.width + s.padding : s.width;
306
+ s.width <= D.width + s.padding ? s.diff = (O - s.width) / 2 - s.padding : s.diff = -s.padding;
307
+ let k = s.height, A = s.x - O / 2, j = s.y - k / 2;
308
+ log.trace("Data ", s, JSON.stringify(s));
309
309
  let M;
310
- if (o.look === "handDrawn") {
311
- let e = at.svg(b), s = userNodeOverrides(o, {
310
+ if (s.look === "handDrawn") {
311
+ let e = at.svg(b), a = userNodeOverrides(s, {
312
312
  roughness: .7,
313
- fill: f,
314
- stroke: p,
313
+ fill: p,
314
+ stroke: m,
315
315
  fillWeight: 4,
316
- seed: d
317
- }), c = e.path(createRoundedRectPathD(A, j, O, k, o.rx), s);
316
+ seed: f
317
+ }), c = e.path(createRoundedRectPathD(A, j, O, k, s.rx), a);
318
318
  M = b.insert(() => (log.debug("Rough node insert CXC", c), c), ":first-child"), M.select("path:nth-child(2)").attr("style", _.join(";")), M.select("path").attr("style", v.join(";").replace("fill", "stroke"));
319
- } else M = b.insert("rect", ":first-child"), M.attr("style", g).attr("rx", o.rx).attr("ry", o.ry).attr("x", A).attr("y", j).attr("width", O).attr("height", k);
320
- let { subGraphTitleTopMargin: N } = getSubGraphTitleMargins(s);
321
- if (T.attr("transform", `translate(${o.x - D.width / 2}, ${o.y - o.height / 2 + N})`), h) {
319
+ } else M = b.insert("rect", ":first-child"), M.attr("style", g).attr("rx", s.rx).attr("ry", s.ry).attr("x", A).attr("y", j).attr("width", O).attr("height", k);
320
+ let { subGraphTitleTopMargin: N } = getSubGraphTitleMargins(c);
321
+ if (T.attr("transform", `translate(${s.x - D.width / 2}, ${s.y - s.height / 2 + N})`), h) {
322
322
  let e = T.select("span");
323
323
  e && e.attr("style", h);
324
324
  }
325
325
  let F = M.node().getBBox();
326
- return o.offsetX = 0, o.width = F.width, o.height = F.height, o.offsetY = D.height - o.padding / 2, o.intersect = function(e) {
327
- return intersect_rect_default(o, e);
326
+ return s.offsetX = 0, s.width = F.width, s.height = F.height, s.offsetY = D.height - s.padding / 2, s.intersect = function(e) {
327
+ return intersect_rect_default(s, e);
328
328
  }, {
329
329
  cluster: b,
330
330
  labelBBox: D
@@ -407,20 +407,20 @@ var intersect_default = {
407
407
  polygon: intersectPolygon,
408
408
  rect: intersect_rect_default
409
409
  };
410
- function anchor(e, o) {
411
- let { labelStyles: s } = styles2String(o);
412
- o.labelStyle = s;
413
- let c = getNodeClasses(o), l = c;
410
+ function anchor(e, a) {
411
+ let { labelStyles: s } = styles2String(a);
412
+ a.labelStyle = s;
413
+ let c = getNodeClasses(a), l = c;
414
414
  c || (l = "anchor");
415
- let u = e.insert("g").attr("class", l).attr("id", o.domId || o.id), { cssStyles: d } = o, f = at.svg(u), p = userNodeOverrides(o, {
415
+ let u = e.insert("g").attr("class", l).attr("id", a.domId || a.id), { cssStyles: d } = a, f = at.svg(u), p = userNodeOverrides(a, {
416
416
  fill: "black",
417
417
  stroke: "none",
418
418
  fillStyle: "solid"
419
419
  });
420
- o.look !== "handDrawn" && (p.roughness = 0);
420
+ a.look !== "handDrawn" && (p.roughness = 0);
421
421
  let m = f.circle(0, 0, 2, p), h = u.insert(() => m, ":first-child");
422
- return h.attr("class", "anchor").attr("style", handleUndefinedAttr(d)), updateNodeBounds(o, h), o.intersect = function(e) {
423
- return log.info("Circle intersect", o, 1, e), intersect_default.circle(o, 1, e);
422
+ return h.attr("class", "anchor").attr("style", handleUndefinedAttr(d)), updateNodeBounds(a, h), a.intersect = function(e) {
423
+ return log.info("Circle intersect", a, 1, e), intersect_default.circle(a, 1, e);
424
424
  }, u;
425
425
  }
426
426
  __name(anchor, "anchor");
@@ -445,13 +445,13 @@ function calculateArcSagitta(e, a, o) {
445
445
  return c * (1 - Math.sqrt(1 - (e / s / 2) ** 2));
446
446
  }
447
447
  __name(calculateArcSagitta, "calculateArcSagitta");
448
- async function bowTieRect(a, o) {
448
+ async function bowTieRect(e, o) {
449
449
  let { labelStyles: s, nodeStyles: c } = styles2String(o);
450
450
  o.labelStyle = s;
451
451
  let l = o.padding ?? 0, u = o.look === "neo" ? 16 : l, d = o.look === "neo" ? 12 : l, f = /* @__PURE__ */ __name((e) => e + d, "calcTotalHeight"), p = /* @__PURE__ */ __name((e) => {
452
452
  let a = e / 2;
453
453
  return [a / (2.5 + e / 50), a];
454
- }, "calcEllipseRadius"), { shapeSvg: m, bbox: h } = await labelHelper(a, o, getNodeClasses(o)), g = f(o?.height ? o?.height : h.height), [_, v] = p(g), y = calculateArcSagitta(g, _, v), b = (o?.width ? o?.width : h.width) + u * 2 + y - y, x = g, { cssStyles: w } = o, T = [
454
+ }, "calcEllipseRadius"), { shapeSvg: m, bbox: h } = await labelHelper(e, o, getNodeClasses(o)), g = f(o?.height ? o?.height : h.height), [_, v] = p(g), y = calculateArcSagitta(g, _, v), b = (o?.width ? o?.width : h.width) + u * 2 + y - y, x = g, { cssStyles: w } = o, T = [
455
455
  {
456
456
  x: b / 2,
457
457
  y: -x / 2
@@ -547,19 +547,19 @@ function choice(e, a) {
547
547
  }, s;
548
548
  }
549
549
  __name(choice, "choice");
550
- async function circle(e, o, s) {
551
- let { labelStyles: c, nodeStyles: l } = styles2String(o);
552
- o.labelStyle = c;
553
- let { shapeSvg: u, bbox: d, halfPadding: f } = await labelHelper(e, o, getNodeClasses(o)), p = s?.padding ?? f, m = o.look === "neo" ? d.width / 2 + 32 : d.width / 2 + p, h, { cssStyles: g } = o;
554
- if (o.look === "handDrawn") {
555
- let e = at.svg(u), a = userNodeOverrides(o, {}), s = e.circle(0, 0, m * 2, a);
550
+ async function circle(e, a, s) {
551
+ let { labelStyles: c, nodeStyles: l } = styles2String(a);
552
+ a.labelStyle = c;
553
+ let { shapeSvg: u, bbox: d, halfPadding: f } = await labelHelper(e, a, getNodeClasses(a)), p = s?.padding ?? f, m = a.look === "neo" ? d.width / 2 + 32 : d.width / 2 + p, h, { cssStyles: g } = a;
554
+ if (a.look === "handDrawn") {
555
+ let e = at.svg(u), o = userNodeOverrides(a, {}), s = e.circle(0, 0, m * 2, o);
556
556
  h = u.insert(() => s, ":first-child"), h.attr("class", "basic label-container").attr("style", handleUndefinedAttr(g));
557
557
  } else h = u.insert("circle", ":first-child").attr("class", "basic label-container").attr("style", l).attr("r", m).attr("cx", 0).attr("cy", 0);
558
- return updateNodeBounds(o, h), o.calcIntersect = function(e, a) {
558
+ return updateNodeBounds(a, h), a.calcIntersect = function(e, a) {
559
559
  let o = e.width / 2;
560
560
  return intersect_default.circle(e, o, a);
561
- }, o.intersect = function(e) {
562
- return log.info("Circle intersect", o, m, e), intersect_default.circle(o, m, e);
561
+ }, a.intersect = function(e) {
562
+ return log.info("Circle intersect", a, m, e), intersect_default.circle(a, m, e);
563
563
  }, u;
564
564
  }
565
565
  __name(circle, "circle");
@@ -581,17 +581,17 @@ function createLine(e) {
581
581
  M ${c.x},${c.y} L ${u.x},${u.y}`;
582
582
  }
583
583
  __name(createLine, "createLine");
584
- function crossedCircle(e, o) {
585
- let { labelStyles: s, nodeStyles: c } = styles2String(o);
586
- o.labelStyle = s, o.label = "";
587
- let l = e.insert("g").attr("class", getNodeClasses(o)).attr("id", o.domId ?? o.id), u = Math.max(30, o?.width ?? 0), { cssStyles: d } = o, f = at.svg(l), p = userNodeOverrides(o, {});
588
- o.look !== "handDrawn" && (p.roughness = 0, p.fillStyle = "solid");
584
+ function crossedCircle(e, a) {
585
+ let { labelStyles: s, nodeStyles: c } = styles2String(a);
586
+ a.labelStyle = s, a.label = "";
587
+ let l = e.insert("g").attr("class", getNodeClasses(a)).attr("id", a.domId ?? a.id), u = Math.max(30, a?.width ?? 0), { cssStyles: d } = a, f = at.svg(l), p = userNodeOverrides(a, {});
588
+ a.look !== "handDrawn" && (p.roughness = 0, p.fillStyle = "solid");
589
589
  let m = f.circle(0, 0, u * 2, p), h = createLine(u), g = f.path(h, p), _ = l.insert(() => m, ":first-child");
590
- return _.insert(() => g), _.attr("class", "outer-path"), d && o.look !== "handDrawn" && _.selectAll("path").attr("style", d), c && o.look !== "handDrawn" && _.selectAll("path").attr("style", c), updateNodeBounds(o, _), o.intersect = function(e) {
591
- return log.info("crossedCircle intersect", o, {
590
+ return _.insert(() => g), _.attr("class", "outer-path"), d && a.look !== "handDrawn" && _.selectAll("path").attr("style", d), c && a.look !== "handDrawn" && _.selectAll("path").attr("style", c), updateNodeBounds(a, _), a.intersect = function(e) {
591
+ return log.info("crossedCircle intersect", a, {
592
592
  radius: u,
593
593
  point: e
594
- }), intersect_default.circle(o, u, e);
594
+ }), intersect_default.circle(a, u, e);
595
595
  }, l;
596
596
  }
597
597
  __name(crossedCircle, "crossedCircle");
@@ -966,50 +966,50 @@ async function dividedRectangle(e, a) {
966
966
  }, u;
967
967
  }
968
968
  __name(dividedRectangle, "dividedRectangle");
969
- async function doublecircle(e, o) {
970
- let { labelStyles: s, nodeStyles: c } = styles2String(o), l = o.look === "neo" ? 12 : 5;
971
- o.labelStyle = s;
972
- let u = o.padding ?? 0, d = o.look === "neo" ? 16 : u, { shapeSvg: f, bbox: p } = await labelHelper(e, o, getNodeClasses(o)), m = (o?.width ? o?.width / 2 : p.width / 2) + (d ?? 0), h = m - l, g, { cssStyles: v } = o;
973
- if (o.look === "handDrawn") {
974
- let e = at.svg(f), a = userNodeOverrides(o, {
969
+ async function doublecircle(e, a) {
970
+ let { labelStyles: s, nodeStyles: c } = styles2String(a), l = a.look === "neo" ? 12 : 5;
971
+ a.labelStyle = s;
972
+ let u = a.padding ?? 0, d = a.look === "neo" ? 16 : u, { shapeSvg: f, bbox: p } = await labelHelper(e, a, getNodeClasses(a)), m = (a?.width ? a?.width / 2 : p.width / 2) + (d ?? 0), h = m - l, g, { cssStyles: v } = a;
973
+ if (a.look === "handDrawn") {
974
+ let e = at.svg(f), o = userNodeOverrides(a, {
975
975
  roughness: .2,
976
976
  strokeWidth: 2.5
977
- }), s = userNodeOverrides(o, {
977
+ }), s = userNodeOverrides(a, {
978
978
  roughness: .2,
979
979
  strokeWidth: 1.5
980
- }), c = e.circle(0, 0, m * 2, a), l = e.circle(0, 0, h * 2, s);
981
- g = f.insert("g", ":first-child"), g.attr("class", handleUndefinedAttr(o.cssClasses)).attr("style", handleUndefinedAttr(v)), g.node()?.appendChild(c), g.node()?.appendChild(l);
980
+ }), c = e.circle(0, 0, m * 2, o), l = e.circle(0, 0, h * 2, s);
981
+ g = f.insert("g", ":first-child"), g.attr("class", handleUndefinedAttr(a.cssClasses)).attr("style", handleUndefinedAttr(v)), g.node()?.appendChild(c), g.node()?.appendChild(l);
982
982
  } else {
983
983
  g = f.insert("g", ":first-child");
984
984
  let e = g.insert("circle", ":first-child"), a = g.insert("circle");
985
985
  g.attr("class", "basic label-container").attr("style", c), e.attr("class", "outer-circle").attr("style", c).attr("r", m).attr("cx", 0).attr("cy", 0), a.attr("class", "inner-circle").attr("style", c).attr("r", h).attr("cx", 0).attr("cy", 0);
986
986
  }
987
- return updateNodeBounds(o, g), o.intersect = function(e) {
988
- return log.info("DoubleCircle intersect", o, m, e), intersect_default.circle(o, m, e);
987
+ return updateNodeBounds(a, g), a.intersect = function(e) {
988
+ return log.info("DoubleCircle intersect", a, m, e), intersect_default.circle(a, m, e);
989
989
  }, f;
990
990
  }
991
991
  __name(doublecircle, "doublecircle");
992
- function filledCircle(e, o, { config: { themeVariables: s } }) {
993
- let { labelStyles: c, nodeStyles: l } = styles2String(o);
994
- o.label = "", o.labelStyle = c;
995
- let u = e.insert("g").attr("class", getNodeClasses(o)).attr("id", o.domId ?? o.id), { cssStyles: d } = o, f = at.svg(u), { nodeBorder: p } = s, m = userNodeOverrides(o, { fillStyle: "solid" });
996
- o.look !== "handDrawn" && (m.roughness = 0);
992
+ function filledCircle(e, a, { config: { themeVariables: s } }) {
993
+ let { labelStyles: c, nodeStyles: l } = styles2String(a);
994
+ a.label = "", a.labelStyle = c;
995
+ let u = e.insert("g").attr("class", getNodeClasses(a)).attr("id", a.domId ?? a.id), { cssStyles: d } = a, f = at.svg(u), { nodeBorder: p } = s, m = userNodeOverrides(a, { fillStyle: "solid" });
996
+ a.look !== "handDrawn" && (m.roughness = 0);
997
997
  let h = f.circle(0, 0, 14, m), g = u.insert(() => h, ":first-child");
998
- return g.selectAll("path").attr("style", `fill: ${p} !important;`), d && d.length > 0 && o.look !== "handDrawn" && g.selectAll("path").attr("style", d), l && o.look !== "handDrawn" && g.selectAll("path").attr("style", l), updateNodeBounds(o, g), o.intersect = function(e) {
999
- return log.info("filledCircle intersect", o, {
998
+ return g.selectAll("path").attr("style", `fill: ${p} !important;`), d && d.length > 0 && a.look !== "handDrawn" && g.selectAll("path").attr("style", d), l && a.look !== "handDrawn" && g.selectAll("path").attr("style", l), updateNodeBounds(a, g), a.intersect = function(e) {
999
+ return log.info("filledCircle intersect", a, {
1000
1000
  radius: 7,
1001
1001
  point: e
1002
- }), intersect_default.circle(o, 7, e);
1002
+ }), intersect_default.circle(a, 7, e);
1003
1003
  }, u;
1004
1004
  }
1005
1005
  __name(filledCircle, "filledCircle");
1006
1006
  var MIN_HEIGHT2 = 10, MIN_WIDTH2 = 10;
1007
- async function flippedTriangle(e, o) {
1008
- let { labelStyles: s, nodeStyles: c } = styles2String(o);
1009
- o.labelStyle = s;
1010
- let l = o.padding ?? 0, u = o.look === "neo" ? l * 2 : l;
1011
- (o.width || o.height) && (o.height = o?.height ?? 0, o.height < MIN_HEIGHT2 && (o.height = MIN_HEIGHT2), o.width = (o?.width ?? 0) - u - u / 2, o.width < MIN_WIDTH2 && (o.width = MIN_WIDTH2));
1012
- let { shapeSvg: d, bbox: f, label: p } = await labelHelper(e, o, getNodeClasses(o)), m = (o?.width ? o?.width : f.width) + (u ?? 0), h = o?.height ? o?.height : m + f.height, g = h, _ = [
1007
+ async function flippedTriangle(e, a) {
1008
+ let { labelStyles: s, nodeStyles: c } = styles2String(a);
1009
+ a.labelStyle = s;
1010
+ let l = a.padding ?? 0, u = a.look === "neo" ? l * 2 : l;
1011
+ (a.width || a.height) && (a.height = a?.height ?? 0, a.height < MIN_HEIGHT2 && (a.height = MIN_HEIGHT2), a.width = (a?.width ?? 0) - u - u / 2, a.width < MIN_WIDTH2 && (a.width = MIN_WIDTH2));
1012
+ let { shapeSvg: d, bbox: f, label: p } = await labelHelper(e, a, getNodeClasses(a)), m = (a?.width ? a?.width : f.width) + (u ?? 0), h = a?.height ? a?.height : m + f.height, g = h, _ = [
1013
1013
  {
1014
1014
  x: 0,
1015
1015
  y: -h
@@ -1022,11 +1022,11 @@ async function flippedTriangle(e, o) {
1022
1022
  x: g / 2,
1023
1023
  y: 0
1024
1024
  }
1025
- ], { cssStyles: v } = o, y = at.svg(d), b = userNodeOverrides(o, {});
1026
- o.look !== "handDrawn" && (b.roughness = 0, b.fillStyle = "solid");
1025
+ ], { cssStyles: v } = a, y = at.svg(d), b = userNodeOverrides(a, {});
1026
+ a.look !== "handDrawn" && (b.roughness = 0, b.fillStyle = "solid");
1027
1027
  let x = createPathFromPoints(_), w = y.path(x, b), T = d.insert(() => w, ":first-child").attr("transform", `translate(${-h / 2}, ${h / 2})`).attr("class", "outer-path");
1028
- return v && o.look !== "handDrawn" && T.selectChildren("path").attr("style", v), c && o.look !== "handDrawn" && T.selectChildren("path").attr("style", c), o.width = m, o.height = h, updateNodeBounds(o, T), p.attr("transform", `translate(${-f.width / 2 - (f.x - (f.left ?? 0))}, ${-h / 2 + (o.padding ?? 0) / 2 + (f.y - (f.top ?? 0))})`), o.intersect = function(e) {
1029
- return log.info("Triangle intersect", o, _, e), intersect_default.polygon(o, _, e);
1028
+ return v && a.look !== "handDrawn" && T.selectChildren("path").attr("style", v), c && a.look !== "handDrawn" && T.selectChildren("path").attr("style", c), a.width = m, a.height = h, updateNodeBounds(a, T), p.attr("transform", `translate(${-f.width / 2 - (f.x - (f.left ?? 0))}, ${-h / 2 + (a.padding ?? 0) / 2 + (f.y - (f.top ?? 0))})`), a.intersect = function(e) {
1029
+ return log.info("Triangle intersect", a, _, e), intersect_default.polygon(a, _, e);
1030
1030
  }, d;
1031
1031
  }
1032
1032
  __name(flippedTriangle, "flippedTriangle");
@@ -1048,13 +1048,13 @@ function forkJoin(e, a, { dir: o, config: { state: s, themeVariables: c } }) {
1048
1048
  }, u;
1049
1049
  }
1050
1050
  __name(forkJoin, "forkJoin");
1051
- async function halfRoundedRectangle(e, o) {
1052
- let { labelStyles: s, nodeStyles: c } = styles2String(o);
1053
- o.labelStyle = s;
1054
- let l = o.look === "neo" ? 16 : o.padding ?? 0, u = o.look === "neo" ? 12 : o.padding ?? 0;
1055
- (o.width || o.height) && (o.height = (o?.height ?? 0) - u * 2, o.height < 10 && (o.height = 10), o.width = (o?.width ?? 0) - l * 2, o.width < 15 && (o.width = 15));
1056
- let { shapeSvg: d, bbox: f } = await labelHelper(e, o, getNodeClasses(o)), p = (o?.width ? o?.width : Math.max(15, f.width)) + l * 2, m = (o?.height ? o?.height : Math.max(10, f.height)) + u * 2, h = m / 2, { cssStyles: g } = o, _ = at.svg(d), v = userNodeOverrides(o, {});
1057
- o.look !== "handDrawn" && (v.roughness = 0, v.fillStyle = "solid");
1051
+ async function halfRoundedRectangle(e, a) {
1052
+ let { labelStyles: s, nodeStyles: c } = styles2String(a);
1053
+ a.labelStyle = s;
1054
+ let l = a.look === "neo" ? 16 : a.padding ?? 0, u = a.look === "neo" ? 12 : a.padding ?? 0;
1055
+ (a.width || a.height) && (a.height = (a?.height ?? 0) - u * 2, a.height < 10 && (a.height = 10), a.width = (a?.width ?? 0) - l * 2, a.width < 15 && (a.width = 15));
1056
+ let { shapeSvg: d, bbox: f } = await labelHelper(e, a, getNodeClasses(a)), p = (a?.width ? a?.width : Math.max(15, f.width)) + l * 2, m = (a?.height ? a?.height : Math.max(10, f.height)) + u * 2, h = m / 2, { cssStyles: g } = a, _ = at.svg(d), v = userNodeOverrides(a, {});
1057
+ a.look !== "handDrawn" && (v.roughness = 0, v.fillStyle = "solid");
1058
1058
  let y = [
1059
1059
  {
1060
1060
  x: -p / 2,
@@ -1074,11 +1074,11 @@ async function halfRoundedRectangle(e, o) {
1074
1074
  y: m / 2
1075
1075
  }
1076
1076
  ], b = createPathFromPoints(y), x = _.path(b, v), w = d.insert(() => x, ":first-child");
1077
- return w.attr("class", "basic label-container outer-path"), g && o.look !== "handDrawn" && w.selectChildren("path").attr("style", g), c && o.look !== "handDrawn" && w.selectChildren("path").attr("style", c), updateNodeBounds(o, w), o.intersect = function(e) {
1078
- return log.info("Pill intersect", o, {
1077
+ return w.attr("class", "basic label-container outer-path"), g && a.look !== "handDrawn" && w.selectChildren("path").attr("style", g), c && a.look !== "handDrawn" && w.selectChildren("path").attr("style", c), updateNodeBounds(a, w), a.intersect = function(e) {
1078
+ return log.info("Pill intersect", a, {
1079
1079
  radius: h,
1080
1080
  point: e
1081
- }), intersect_default.polygon(o, y, e);
1081
+ }), intersect_default.polygon(a, y, e);
1082
1082
  }, d;
1083
1083
  }
1084
1084
  __name(halfRoundedRectangle, "halfRoundedRectangle");
@@ -1134,11 +1134,11 @@ async function hexagon(e, a) {
1134
1134
  }, f;
1135
1135
  }
1136
1136
  __name(hexagon, "hexagon");
1137
- async function hourglass(e, o) {
1138
- let { labelStyles: s, nodeStyles: c } = styles2String(o);
1139
- o.label = "", o.labelStyle = s;
1140
- let { shapeSvg: l } = await labelHelper(e, o, getNodeClasses(o)), u = Math.max(30, o?.width ?? 0), d = Math.max(30, o?.height ?? 0), { cssStyles: f } = o, p = at.svg(l), m = userNodeOverrides(o, {});
1141
- o.look !== "handDrawn" && (m.roughness = 0, m.fillStyle = "solid");
1137
+ async function hourglass(e, a) {
1138
+ let { labelStyles: s, nodeStyles: c } = styles2String(a);
1139
+ a.label = "", a.labelStyle = s;
1140
+ let { shapeSvg: l } = await labelHelper(e, a, getNodeClasses(a)), u = Math.max(30, a?.width ?? 0), d = Math.max(30, a?.height ?? 0), { cssStyles: f } = a, p = at.svg(l), m = userNodeOverrides(a, {});
1141
+ a.look !== "handDrawn" && (m.roughness = 0, m.fillStyle = "solid");
1142
1142
  let h = [
1143
1143
  {
1144
1144
  x: 0,
@@ -1157,39 +1157,39 @@ async function hourglass(e, o) {
1157
1157
  y: d
1158
1158
  }
1159
1159
  ], g = createPathFromPoints(h), _ = p.path(g, m), v = l.insert(() => _, ":first-child");
1160
- return v.attr("class", "basic label-container outer-path"), f && o.look !== "handDrawn" && v.selectChildren("path").attr("style", f), c && o.look !== "handDrawn" && v.selectChildren("path").attr("style", c), v.attr("transform", `translate(${-u / 2}, ${-d / 2})`), updateNodeBounds(o, v), o.intersect = function(e) {
1161
- return log.info("Pill intersect", o, { points: h }), intersect_default.polygon(o, h, e);
1160
+ return v.attr("class", "basic label-container outer-path"), f && a.look !== "handDrawn" && v.selectChildren("path").attr("style", f), c && a.look !== "handDrawn" && v.selectChildren("path").attr("style", c), v.attr("transform", `translate(${-u / 2}, ${-d / 2})`), updateNodeBounds(a, v), a.intersect = function(e) {
1161
+ return log.info("Pill intersect", a, { points: h }), intersect_default.polygon(a, h, e);
1162
1162
  }, l;
1163
1163
  }
1164
1164
  __name(hourglass, "hourglass");
1165
- async function icon(e, o, { config: { themeVariables: s, flowchart: c } }) {
1166
- let { labelStyles: l } = styles2String(o);
1167
- o.labelStyle = l;
1168
- let u = o.assetHeight ?? 48, d = o.assetWidth ?? 48, f = Math.max(u, d), p = c?.wrappingWidth;
1169
- o.width = Math.max(f, p ?? 0);
1170
- let { shapeSvg: m, bbox: h, label: g } = await labelHelper(e, o, "icon-shape default"), _ = o.pos === "t", v = f, y = f, { nodeBorder: x } = s, { stylesMap: w } = compileStyles(o), D = -y / 2, k = -v / 2, A = o.label ? 8 : 0, j = at.svg(m), M = userNodeOverrides(o, {
1165
+ async function icon(e, a, { config: { themeVariables: s, flowchart: c } }) {
1166
+ let { labelStyles: l } = styles2String(a);
1167
+ a.labelStyle = l;
1168
+ let u = a.assetHeight ?? 48, d = a.assetWidth ?? 48, f = Math.max(u, d), p = c?.wrappingWidth;
1169
+ a.width = Math.max(f, p ?? 0);
1170
+ let { shapeSvg: m, bbox: h, label: g } = await labelHelper(e, a, "icon-shape default"), _ = a.pos === "t", v = f, y = f, { nodeBorder: x } = s, { stylesMap: w } = compileStyles(a), D = -y / 2, k = -v / 2, A = a.label ? 8 : 0, j = at.svg(m), M = userNodeOverrides(a, {
1171
1171
  stroke: "none",
1172
1172
  fill: "none"
1173
1173
  });
1174
- o.look !== "handDrawn" && (M.roughness = 0, M.fillStyle = "solid");
1174
+ a.look !== "handDrawn" && (M.roughness = 0, M.fillStyle = "solid");
1175
1175
  let N = j.rectangle(D, k, y, v, M), P = Math.max(y, h.width), F = v + h.height + A, I = j.rectangle(-P / 2, -F / 2, P, F, {
1176
1176
  ...M,
1177
1177
  fill: "transparent",
1178
1178
  stroke: "none"
1179
1179
  }), L = m.insert(() => N, ":first-child"), R = m.insert(() => I);
1180
- if (o.icon) {
1180
+ if (a.icon) {
1181
1181
  let e = m.append("g");
1182
- e.html(`<g>${await getIconSVG(o.icon, {
1182
+ e.html(`<g>${await getIconSVG(a.icon, {
1183
1183
  height: f,
1184
1184
  width: f,
1185
1185
  fallbackPrefix: ""
1186
1186
  })}</g>`);
1187
- let a = e.node().getBBox(), s = a.width, c = a.height, l = a.x, u = a.y;
1187
+ let o = e.node().getBBox(), s = o.width, c = o.height, l = o.x, u = o.y;
1188
1188
  e.attr("transform", `translate(${-s / 2 - l},${_ ? h.height / 2 + A / 2 - c / 2 - u : -h.height / 2 - A / 2 - c / 2 - u})`), e.attr("style", `color: ${w.get("stroke") ?? x};`);
1189
1189
  }
1190
- return g.attr("transform", `translate(${-h.width / 2 - (h.x - (h.left ?? 0))},${_ ? -F / 2 : F / 2 - h.height})`), L.attr("transform", `translate(0,${_ ? h.height / 2 + A / 2 : -h.height / 2 - A / 2})`), updateNodeBounds(o, R), o.intersect = function(e) {
1191
- if (log.info("iconSquare intersect", o, e), !o.label) return intersect_default.rect(o, e);
1192
- let s = o.x ?? 0, c = o.y ?? 0, l = o.height ?? 0, u = [];
1190
+ return g.attr("transform", `translate(${-h.width / 2 - (h.x - (h.left ?? 0))},${_ ? -F / 2 : F / 2 - h.height})`), L.attr("transform", `translate(0,${_ ? h.height / 2 + A / 2 : -h.height / 2 - A / 2})`), updateNodeBounds(a, R), a.intersect = function(e) {
1191
+ if (log.info("iconSquare intersect", a, e), !a.label) return intersect_default.rect(a, e);
1192
+ let s = a.x ?? 0, c = a.y ?? 0, l = a.height ?? 0, u = [];
1193
1193
  return u = _ ? [
1194
1194
  {
1195
1195
  x: s - h.width / 2,
@@ -1256,19 +1256,19 @@ async function icon(e, o, { config: { themeVariables: s, flowchart: c } }) {
1256
1256
  x: s - y / 2,
1257
1257
  y: c - l / 2 + v
1258
1258
  }
1259
- ], intersect_default.polygon(o, u, e);
1259
+ ], intersect_default.polygon(a, u, e);
1260
1260
  }, m;
1261
1261
  }
1262
1262
  __name(icon, "icon");
1263
- async function iconCircle(e, o, { config: { themeVariables: s, flowchart: c } }) {
1264
- let { labelStyles: l } = styles2String(o);
1265
- o.labelStyle = l;
1266
- let u = o.assetHeight ?? 48, d = o.assetWidth ?? 48, f = Math.max(u, d), p = c?.wrappingWidth;
1267
- o.width = Math.max(f, p ?? 0);
1268
- let { shapeSvg: m, bbox: h, label: g } = await labelHelper(e, o, "icon-shape default"), _ = o.label ? 8 : 0, v = o.pos === "t", { nodeBorder: y, mainBkg: x } = s, { stylesMap: w } = compileStyles(o), D = at.svg(m), k = userNodeOverrides(o, {});
1269
- o.look !== "handDrawn" && (k.roughness = 0, k.fillStyle = "solid"), k.stroke = w.get("fill") ?? x;
1263
+ async function iconCircle(e, a, { config: { themeVariables: s, flowchart: c } }) {
1264
+ let { labelStyles: l } = styles2String(a);
1265
+ a.labelStyle = l;
1266
+ let u = a.assetHeight ?? 48, d = a.assetWidth ?? 48, f = Math.max(u, d), p = c?.wrappingWidth;
1267
+ a.width = Math.max(f, p ?? 0);
1268
+ let { shapeSvg: m, bbox: h, label: g } = await labelHelper(e, a, "icon-shape default"), _ = a.label ? 8 : 0, v = a.pos === "t", { nodeBorder: y, mainBkg: x } = s, { stylesMap: w } = compileStyles(a), D = at.svg(m), k = userNodeOverrides(a, {});
1269
+ a.look !== "handDrawn" && (k.roughness = 0, k.fillStyle = "solid"), k.stroke = w.get("fill") ?? x;
1270
1270
  let A = m.append("g");
1271
- o.icon && A.html(`<g>${await getIconSVG(o.icon, {
1271
+ a.icon && A.html(`<g>${await getIconSVG(a.icon, {
1272
1272
  height: f,
1273
1273
  width: f,
1274
1274
  fallbackPrefix: ""
@@ -1278,36 +1278,36 @@ async function iconCircle(e, o, { config: { themeVariables: s, flowchart: c } })
1278
1278
  fill: "transparent",
1279
1279
  stroke: "none"
1280
1280
  }), V = m.insert(() => L, ":first-child"), H = m.insert(() => B);
1281
- return A.attr("transform", `translate(${-M / 2 - P},${v ? h.height / 2 + _ / 2 - N / 2 - F : -h.height / 2 - _ / 2 - N / 2 - F})`), A.attr("style", `color: ${w.get("stroke") ?? y};`), g.attr("transform", `translate(${-h.width / 2 - (h.x - (h.left ?? 0))},${v ? -z / 2 : z / 2 - h.height})`), V.attr("transform", `translate(0,${v ? h.height / 2 + _ / 2 : -h.height / 2 - _ / 2})`), updateNodeBounds(o, H), o.intersect = function(e) {
1282
- return log.info("iconSquare intersect", o, e), intersect_default.rect(o, e);
1281
+ return A.attr("transform", `translate(${-M / 2 - P},${v ? h.height / 2 + _ / 2 - N / 2 - F : -h.height / 2 - _ / 2 - N / 2 - F})`), A.attr("style", `color: ${w.get("stroke") ?? y};`), g.attr("transform", `translate(${-h.width / 2 - (h.x - (h.left ?? 0))},${v ? -z / 2 : z / 2 - h.height})`), V.attr("transform", `translate(0,${v ? h.height / 2 + _ / 2 : -h.height / 2 - _ / 2})`), updateNodeBounds(a, H), a.intersect = function(e) {
1282
+ return log.info("iconSquare intersect", a, e), intersect_default.rect(a, e);
1283
1283
  }, m;
1284
1284
  }
1285
1285
  __name(iconCircle, "iconCircle");
1286
- async function iconRounded(e, o, { config: { themeVariables: s, flowchart: c } }) {
1287
- let { labelStyles: l } = styles2String(o);
1288
- o.labelStyle = l;
1289
- let u = o.assetHeight ?? 48, d = o.assetWidth ?? 48, f = Math.max(u, d), p = c?.wrappingWidth;
1290
- o.width = Math.max(f, p ?? 0);
1291
- let { shapeSvg: m, bbox: h, halfPadding: g, label: _ } = await labelHelper(e, o, "icon-shape default"), v = o.pos === "t", y = f + g * 2, x = f + g * 2, { nodeBorder: w, mainBkg: D } = s, { stylesMap: k } = compileStyles(o), A = -x / 2, j = -y / 2, M = o.label ? 8 : 0, N = at.svg(m), P = userNodeOverrides(o, {});
1292
- o.look !== "handDrawn" && (P.roughness = 0, P.fillStyle = "solid"), P.stroke = k.get("fill") ?? D;
1286
+ async function iconRounded(e, a, { config: { themeVariables: s, flowchart: c } }) {
1287
+ let { labelStyles: l } = styles2String(a);
1288
+ a.labelStyle = l;
1289
+ let u = a.assetHeight ?? 48, d = a.assetWidth ?? 48, f = Math.max(u, d), p = c?.wrappingWidth;
1290
+ a.width = Math.max(f, p ?? 0);
1291
+ let { shapeSvg: m, bbox: h, halfPadding: g, label: _ } = await labelHelper(e, a, "icon-shape default"), v = a.pos === "t", y = f + g * 2, x = f + g * 2, { nodeBorder: w, mainBkg: D } = s, { stylesMap: k } = compileStyles(a), A = -x / 2, j = -y / 2, M = a.label ? 8 : 0, N = at.svg(m), P = userNodeOverrides(a, {});
1292
+ a.look !== "handDrawn" && (P.roughness = 0, P.fillStyle = "solid"), P.stroke = k.get("fill") ?? D;
1293
1293
  let F = N.path(createRoundedRectPathD(A, j, x, y, 5), P), L = Math.max(x, h.width), R = y + h.height + M, z = N.rectangle(-L / 2, -R / 2, L, R, {
1294
1294
  ...P,
1295
1295
  fill: "transparent",
1296
1296
  stroke: "none"
1297
1297
  }), B = m.insert(() => F, ":first-child").attr("class", "icon-shape2"), V = m.insert(() => z);
1298
- if (o.icon) {
1298
+ if (a.icon) {
1299
1299
  let e = m.append("g");
1300
- e.html(`<g>${await getIconSVG(o.icon, {
1300
+ e.html(`<g>${await getIconSVG(a.icon, {
1301
1301
  height: f,
1302
1302
  width: f,
1303
1303
  fallbackPrefix: ""
1304
1304
  })}</g>`);
1305
- let a = e.node().getBBox(), s = a.width, c = a.height, l = a.x, u = a.y;
1305
+ let o = e.node().getBBox(), s = o.width, c = o.height, l = o.x, u = o.y;
1306
1306
  e.attr("transform", `translate(${-s / 2 - l},${v ? h.height / 2 + M / 2 - c / 2 - u : -h.height / 2 - M / 2 - c / 2 - u})`), e.attr("style", `color: ${k.get("stroke") ?? w};`);
1307
1307
  }
1308
- return _.attr("transform", `translate(${-h.width / 2 - (h.x - (h.left ?? 0))},${v ? -R / 2 : R / 2 - h.height})`), B.attr("transform", `translate(0,${v ? h.height / 2 + M / 2 : -h.height / 2 - M / 2})`), updateNodeBounds(o, V), o.intersect = function(e) {
1309
- if (log.info("iconSquare intersect", o, e), !o.label) return intersect_default.rect(o, e);
1310
- let s = o.x ?? 0, c = o.y ?? 0, l = o.height ?? 0, u = [];
1308
+ return _.attr("transform", `translate(${-h.width / 2 - (h.x - (h.left ?? 0))},${v ? -R / 2 : R / 2 - h.height})`), B.attr("transform", `translate(0,${v ? h.height / 2 + M / 2 : -h.height / 2 - M / 2})`), updateNodeBounds(a, V), a.intersect = function(e) {
1309
+ if (log.info("iconSquare intersect", a, e), !a.label) return intersect_default.rect(a, e);
1310
+ let s = a.x ?? 0, c = a.y ?? 0, l = a.height ?? 0, u = [];
1311
1311
  return u = v ? [
1312
1312
  {
1313
1313
  x: s - h.width / 2,
@@ -1374,35 +1374,35 @@ async function iconRounded(e, o, { config: { themeVariables: s, flowchart: c } }
1374
1374
  x: s - x / 2,
1375
1375
  y: c - l / 2 + y
1376
1376
  }
1377
- ], intersect_default.polygon(o, u, e);
1377
+ ], intersect_default.polygon(a, u, e);
1378
1378
  }, m;
1379
1379
  }
1380
1380
  __name(iconRounded, "iconRounded");
1381
- async function iconSquare(e, o, { config: { themeVariables: s, flowchart: c } }) {
1382
- let { labelStyles: l } = styles2String(o);
1383
- o.labelStyle = l;
1384
- let u = o.assetHeight ?? 48, d = o.assetWidth ?? 48, f = Math.max(u, d), p = c?.wrappingWidth;
1385
- o.width = Math.max(f, p ?? 0);
1386
- let { shapeSvg: m, bbox: h, halfPadding: g, label: _ } = await labelHelper(e, o, "icon-shape default"), v = o.pos === "t", y = f + g * 2, x = f + g * 2, { nodeBorder: w, mainBkg: D } = s, { stylesMap: k } = compileStyles(o), A = -x / 2, j = -y / 2, M = o.label ? 8 : 0, N = at.svg(m), P = userNodeOverrides(o, {});
1387
- o.look !== "handDrawn" && (P.roughness = 0, P.fillStyle = "solid"), P.stroke = k.get("fill") ?? D;
1381
+ async function iconSquare(e, a, { config: { themeVariables: s, flowchart: c } }) {
1382
+ let { labelStyles: l } = styles2String(a);
1383
+ a.labelStyle = l;
1384
+ let u = a.assetHeight ?? 48, d = a.assetWidth ?? 48, f = Math.max(u, d), p = c?.wrappingWidth;
1385
+ a.width = Math.max(f, p ?? 0);
1386
+ let { shapeSvg: m, bbox: h, halfPadding: g, label: _ } = await labelHelper(e, a, "icon-shape default"), v = a.pos === "t", y = f + g * 2, x = f + g * 2, { nodeBorder: w, mainBkg: D } = s, { stylesMap: k } = compileStyles(a), A = -x / 2, j = -y / 2, M = a.label ? 8 : 0, N = at.svg(m), P = userNodeOverrides(a, {});
1387
+ a.look !== "handDrawn" && (P.roughness = 0, P.fillStyle = "solid"), P.stroke = k.get("fill") ?? D;
1388
1388
  let F = N.path(createRoundedRectPathD(A, j, x, y, .1), P), L = Math.max(x, h.width), R = y + h.height + M, z = N.rectangle(-L / 2, -R / 2, L, R, {
1389
1389
  ...P,
1390
1390
  fill: "transparent",
1391
1391
  stroke: "none"
1392
1392
  }), B = m.insert(() => F, ":first-child"), V = m.insert(() => z);
1393
- if (o.icon) {
1393
+ if (a.icon) {
1394
1394
  let e = m.append("g");
1395
- e.html(`<g>${await getIconSVG(o.icon, {
1395
+ e.html(`<g>${await getIconSVG(a.icon, {
1396
1396
  height: f,
1397
1397
  width: f,
1398
1398
  fallbackPrefix: ""
1399
1399
  })}</g>`);
1400
- let a = e.node().getBBox(), s = a.width, c = a.height, l = a.x, u = a.y;
1400
+ let o = e.node().getBBox(), s = o.width, c = o.height, l = o.x, u = o.y;
1401
1401
  e.attr("transform", `translate(${-s / 2 - l},${v ? h.height / 2 + M / 2 - c / 2 - u : -h.height / 2 - M / 2 - c / 2 - u})`), e.attr("style", `color: ${k.get("stroke") ?? w};`);
1402
1402
  }
1403
- return _.attr("transform", `translate(${-h.width / 2 - (h.x - (h.left ?? 0))},${v ? -R / 2 : R / 2 - h.height})`), B.attr("transform", `translate(0,${v ? h.height / 2 + M / 2 : -h.height / 2 - M / 2})`), updateNodeBounds(o, V), o.intersect = function(e) {
1404
- if (log.info("iconSquare intersect", o, e), !o.label) return intersect_default.rect(o, e);
1405
- let s = o.x ?? 0, c = o.y ?? 0, l = o.height ?? 0, u = [];
1403
+ return _.attr("transform", `translate(${-h.width / 2 - (h.x - (h.left ?? 0))},${v ? -R / 2 : R / 2 - h.height})`), B.attr("transform", `translate(0,${v ? h.height / 2 + M / 2 : -h.height / 2 - M / 2})`), updateNodeBounds(a, V), a.intersect = function(e) {
1404
+ if (log.info("iconSquare intersect", a, e), !a.label) return intersect_default.rect(a, e);
1405
+ let s = a.x ?? 0, c = a.y ?? 0, l = a.height ?? 0, u = [];
1406
1406
  return u = v ? [
1407
1407
  {
1408
1408
  x: s - h.width / 2,
@@ -1469,35 +1469,35 @@ async function iconSquare(e, o, { config: { themeVariables: s, flowchart: c } })
1469
1469
  x: s - x / 2,
1470
1470
  y: c - l / 2 + y
1471
1471
  }
1472
- ], intersect_default.polygon(o, u, e);
1472
+ ], intersect_default.polygon(a, u, e);
1473
1473
  }, m;
1474
1474
  }
1475
1475
  __name(iconSquare, "iconSquare");
1476
- async function imageSquare(e, o, { config: { flowchart: s } }) {
1476
+ async function imageSquare(e, a, { config: { flowchart: s } }) {
1477
1477
  let c = new Image();
1478
- c.src = o?.img ?? "", await c.decode();
1478
+ c.src = a?.img ?? "", await c.decode();
1479
1479
  let l = Number(c.naturalWidth.toString().replace("px", "")), u = Number(c.naturalHeight.toString().replace("px", ""));
1480
- o.imageAspectRatio = l / u;
1481
- let { labelStyles: d } = styles2String(o);
1482
- o.labelStyle = d;
1480
+ a.imageAspectRatio = l / u;
1481
+ let { labelStyles: d } = styles2String(a);
1482
+ a.labelStyle = d;
1483
1483
  let f = s?.wrappingWidth;
1484
- o.defaultWidth = s?.wrappingWidth;
1485
- let p = Math.max(o.label ? f ?? 0 : 0, o?.assetWidth ?? l), m = o.constraint === "on" && o?.assetHeight ? o.assetHeight * o.imageAspectRatio : p, h = o.constraint === "on" ? m / o.imageAspectRatio : o?.assetHeight ?? u;
1486
- o.width = Math.max(m, f ?? 0);
1487
- let { shapeSvg: g, bbox: _, label: v } = await labelHelper(e, o, "image-shape default"), y = o.pos === "t", b = -m / 2, x = -h / 2, w = o.label ? 8 : 0, T = at.svg(g), D = userNodeOverrides(o, {});
1488
- o.look !== "handDrawn" && (D.roughness = 0, D.fillStyle = "solid");
1484
+ a.defaultWidth = s?.wrappingWidth;
1485
+ let p = Math.max(a.label ? f ?? 0 : 0, a?.assetWidth ?? l), m = a.constraint === "on" && a?.assetHeight ? a.assetHeight * a.imageAspectRatio : p, h = a.constraint === "on" ? m / a.imageAspectRatio : a?.assetHeight ?? u;
1486
+ a.width = Math.max(m, f ?? 0);
1487
+ let { shapeSvg: g, bbox: _, label: v } = await labelHelper(e, a, "image-shape default"), y = a.pos === "t", b = -m / 2, x = -h / 2, w = a.label ? 8 : 0, T = at.svg(g), D = userNodeOverrides(a, {});
1488
+ a.look !== "handDrawn" && (D.roughness = 0, D.fillStyle = "solid");
1489
1489
  let k = T.rectangle(b, x, m, h, D), A = Math.max(m, _.width), j = h + _.height + w, M = T.rectangle(-A / 2, -j / 2, A, j, {
1490
1490
  ...D,
1491
1491
  fill: "none",
1492
1492
  stroke: "none"
1493
1493
  }), N = g.insert(() => k, ":first-child"), P = g.insert(() => M);
1494
- if (o.img) {
1494
+ if (a.img) {
1495
1495
  let e = g.append("image");
1496
- e.attr("href", o.img), e.attr("width", m), e.attr("height", h), e.attr("preserveAspectRatio", "none"), e.attr("transform", `translate(${-m / 2},${y ? j / 2 - h : -j / 2})`);
1496
+ e.attr("href", a.img), e.attr("width", m), e.attr("height", h), e.attr("preserveAspectRatio", "none"), e.attr("transform", `translate(${-m / 2},${y ? j / 2 - h : -j / 2})`);
1497
1497
  }
1498
- return v.attr("transform", `translate(${-_.width / 2 - (_.x - (_.left ?? 0))},${y ? -h / 2 - _.height / 2 - w / 2 : h / 2 - _.height / 2 + w / 2})`), N.attr("transform", `translate(0,${y ? _.height / 2 + w / 2 : -_.height / 2 - w / 2})`), updateNodeBounds(o, P), o.intersect = function(e) {
1499
- if (log.info("iconSquare intersect", o, e), !o.label) return intersect_default.rect(o, e);
1500
- let s = o.x ?? 0, c = o.y ?? 0, l = o.height ?? 0, u = [];
1498
+ return v.attr("transform", `translate(${-_.width / 2 - (_.x - (_.left ?? 0))},${y ? -h / 2 - _.height / 2 - w / 2 : h / 2 - _.height / 2 + w / 2})`), N.attr("transform", `translate(0,${y ? _.height / 2 + w / 2 : -_.height / 2 - w / 2})`), updateNodeBounds(a, P), a.intersect = function(e) {
1499
+ if (log.info("iconSquare intersect", a, e), !a.label) return intersect_default.rect(a, e);
1500
+ let s = a.x ?? 0, c = a.y ?? 0, l = a.height ?? 0, u = [];
1501
1501
  return u = y ? [
1502
1502
  {
1503
1503
  x: s - _.width / 2,
@@ -1564,7 +1564,7 @@ async function imageSquare(e, o, { config: { flowchart: s } }) {
1564
1564
  x: s - m / 2,
1565
1565
  y: c - l / 2 + h
1566
1566
  }
1567
- ], intersect_default.polygon(o, u, e);
1567
+ ], intersect_default.polygon(a, u, e);
1568
1568
  }, g;
1569
1569
  }
1570
1570
  __name(imageSquare, "imageSquare");
@@ -1665,10 +1665,10 @@ async function lean_right(e, a) {
1665
1665
  }, d;
1666
1666
  }
1667
1667
  __name(lean_right, "lean_right");
1668
- function lightningBolt(e, o) {
1669
- let { labelStyles: s, nodeStyles: c } = styles2String(o);
1670
- o.label = "", o.labelStyle = s;
1671
- let l = e.insert("g").attr("class", getNodeClasses(o)).attr("id", o.domId ?? o.id), { cssStyles: u } = o, d = Math.max(35, o?.width ?? 0), f = Math.max(35, o?.height ?? 0), p = [
1668
+ function lightningBolt(e, a) {
1669
+ let { labelStyles: s, nodeStyles: c } = styles2String(a);
1670
+ a.label = "", a.labelStyle = s;
1671
+ let l = e.insert("g").attr("class", getNodeClasses(a)).attr("id", a.domId ?? a.id), { cssStyles: u } = a, d = Math.max(35, a?.width ?? 0), f = Math.max(35, a?.height ?? 0), p = [
1672
1672
  {
1673
1673
  x: d,
1674
1674
  y: 0
@@ -1693,11 +1693,11 @@ function lightningBolt(e, o) {
1693
1693
  x: 14,
1694
1694
  y: f - 7 / 2
1695
1695
  }
1696
- ], m = at.svg(l), h = userNodeOverrides(o, {});
1697
- o.look !== "handDrawn" && (h.roughness = 0, h.fillStyle = "solid");
1696
+ ], m = at.svg(l), h = userNodeOverrides(a, {});
1697
+ a.look !== "handDrawn" && (h.roughness = 0, h.fillStyle = "solid");
1698
1698
  let g = createPathFromPoints(p), _ = m.path(g, h), v = l.insert(() => _, ":first-child");
1699
- return v.attr("class", "outer-path"), u && o.look !== "handDrawn" && v.selectAll("path").attr("style", u), c && o.look !== "handDrawn" && v.selectAll("path").attr("style", c), v.attr("transform", `translate(-${d / 2},${-f})`), updateNodeBounds(o, v), o.intersect = function(e) {
1700
- return log.info("lightningBolt intersect", o, e), intersect_default.polygon(o, p, e);
1699
+ return v.attr("class", "outer-path"), u && a.look !== "handDrawn" && v.selectAll("path").attr("style", u), c && a.look !== "handDrawn" && v.selectAll("path").attr("style", c), v.attr("transform", `translate(-${d / 2},${-f})`), updateNodeBounds(a, v), a.intersect = function(e) {
1700
+ return log.info("lightningBolt intersect", a, e), intersect_default.polygon(a, p, e);
1701
1701
  }, l;
1702
1702
  }
1703
1703
  __name(lightningBolt, "lightningBolt");
@@ -1965,15 +1965,15 @@ async function multiWaveEdgedRectangle(e, a) {
1965
1965
  }
1966
1966
  __name(multiWaveEdgedRectangle, "multiWaveEdgedRectangle");
1967
1967
  async function note(e, a, { config: { themeVariables: o } }) {
1968
- let { labelStyles: c, nodeStyles: u } = styles2String(a);
1969
- a.labelStyle = c, a.useHtmlLabels || getEffectiveHtmlLabels(getConfig()) || (a.centerLabel = !0);
1968
+ let { labelStyles: s, nodeStyles: l } = styles2String(a);
1969
+ a.labelStyle = s, a.useHtmlLabels || getEffectiveHtmlLabels(getConfig()) || (a.centerLabel = !0);
1970
1970
  let { shapeSvg: d, bbox: f, label: p } = await labelHelper(e, a, getNodeClasses(a)), m = Math.max(f.width + (a.padding ?? 0) * 2, a?.width ?? 0), h = Math.max(f.height + (a.padding ?? 0) * 2, a?.height ?? 0), g = -m / 2, _ = -h / 2, { cssStyles: v } = a, y = at.svg(d), b = userNodeOverrides(a, {
1971
1971
  fill: o.noteBkgColor,
1972
1972
  stroke: o.noteBorderColor
1973
1973
  });
1974
1974
  a.look !== "handDrawn" && (b.roughness = 0, b.fillStyle = "solid");
1975
1975
  let x = y.rectangle(g, _, m, h, b), w = d.insert(() => x, ":first-child");
1976
- return w.attr("class", "basic label-container outer-path"), p.attr("class", "label noteLabel"), v && a.look !== "handDrawn" && w.selectAll("path").attr("style", v), u && a.look !== "handDrawn" && w.selectAll("path").attr("style", u), p.attr("transform", `translate(${-f.width / 2 - (f.x - (f.left ?? 0))}, ${-(f.height / 2) - (f.y - (f.top ?? 0))})`), updateNodeBounds(a, w), a.intersect = function(e) {
1976
+ return w.attr("class", "basic label-container outer-path"), p.attr("class", "label noteLabel"), v && a.look !== "handDrawn" && w.selectAll("path").attr("style", v), l && a.look !== "handDrawn" && w.selectAll("path").attr("style", l), p.attr("transform", `translate(${-f.width / 2 - (f.x - (f.left ?? 0))}, ${-(f.height / 2) - (f.y - (f.top ?? 0))})`), updateNodeBounds(a, w), a.intersect = function(e) {
1977
1977
  return intersect_default.rect(a, e);
1978
1978
  }, d;
1979
1979
  }
@@ -2070,32 +2070,32 @@ async function rect_left_inv_arrow(e, a) {
2070
2070
  }, d;
2071
2071
  }
2072
2072
  __name(rect_left_inv_arrow, "rect_left_inv_arrow");
2073
- async function rectWithTitle(e, o) {
2074
- let { labelStyles: s, nodeStyles: u } = styles2String(o);
2075
- o.labelStyle = s;
2076
- let d;
2077
- d = o.cssClasses ? "node " + o.cssClasses : "node default";
2078
- let f = e.insert("g").attr("class", d).attr("id", o.domId || o.id), p = f.insert("g"), h = f.insert("g").attr("class", "label").attr("style", u), g = o.description, _ = o.label, v = await createLabel_default(h, _, o.labelStyle, !0, !0), y = {
2073
+ async function rectWithTitle(a, s) {
2074
+ let { labelStyles: c, nodeStyles: d } = styles2String(s);
2075
+ s.labelStyle = c;
2076
+ let f;
2077
+ f = s.cssClasses ? "node " + s.cssClasses : "node default";
2078
+ let p = a.insert("g").attr("class", f).attr("id", s.domId || s.id), m = p.insert("g"), h = p.insert("g").attr("class", "label").attr("style", d), g = s.description, _ = s.label, v = await createLabel_default(h, _, s.labelStyle, !0, !0), y = {
2079
2079
  width: 0,
2080
2080
  height: 0
2081
2081
  };
2082
2082
  if (getEffectiveHtmlLabels(getConfig2())) {
2083
- let e = v.children[0], a = select_default(v);
2084
- y = e.getBoundingClientRect(), a.attr("width", y.width), a.attr("height", y.height);
2083
+ let a = v.children[0], o = select_default(v);
2084
+ y = a.getBoundingClientRect(), o.attr("width", y.width), o.attr("height", y.height);
2085
2085
  }
2086
2086
  log.info("Text 2", g);
2087
- let b = g || [], x = v.getBBox(), w = await createLabel_default(h, Array.isArray(b) ? b.join("<br/>") : b, o.labelStyle, !0, !0), T = w.children[0], E = select_default(w);
2087
+ let b = g || [], x = v.getBBox(), w = await createLabel_default(h, Array.isArray(b) ? b.join("<br/>") : b, s.labelStyle, !0, !0), T = w.children[0], E = select_default(w);
2088
2088
  y = T.getBoundingClientRect(), E.attr("width", y.width), E.attr("height", y.height);
2089
- let D = (o.padding || 0) / 2;
2089
+ let D = (s.padding || 0) / 2;
2090
2090
  select_default(w).attr("transform", "translate( " + (y.width > x.width ? 0 : (x.width - y.width) / 2) + ", " + (x.height + D + 5) + ")"), select_default(v).attr("transform", "translate( " + (y.width < x.width ? 0 : -(x.width - y.width) / 2) + ", 0)"), y = h.node().getBBox(), h.attr("transform", "translate(" + -y.width / 2 + ", " + (-y.height / 2 - D + 3) + ")");
2091
- let k = y.width + (o.padding || 0), A = y.height + (o.padding || 0), j = -y.width / 2 - D, M = -y.height / 2 - D, N, P;
2092
- if (o.look === "handDrawn") {
2093
- let e = at.svg(f), s = userNodeOverrides(o, {}), c = e.path(createRoundedRectPathD(j, M, k, A, o.rx || 0), s), l = e.line(-y.width / 2 - D, -y.height / 2 - D + x.height + D, y.width / 2 + D, -y.height / 2 - D + x.height + D, s);
2094
- P = f.insert(() => (log.debug("Rough node insert CXC", c), l), ":first-child"), N = f.insert(() => (log.debug("Rough node insert CXC", c), c), ":first-child");
2095
- } else N = p.insert("rect", ":first-child"), P = p.insert("line"), N.attr("class", "outer title-state").attr("style", u).attr("x", -y.width / 2 - D).attr("y", -y.height / 2 - D).attr("width", y.width + (o.padding || 0)).attr("height", y.height + (o.padding || 0)), P.attr("class", "divider").attr("x1", -y.width / 2 - D).attr("x2", y.width / 2 + D).attr("y1", -y.height / 2 - D + x.height + D).attr("y2", -y.height / 2 - D + x.height + D);
2096
- return updateNodeBounds(o, N), o.intersect = function(e) {
2097
- return intersect_default.rect(o, e);
2098
- }, f;
2091
+ let k = y.width + (s.padding || 0), A = y.height + (s.padding || 0), j = -y.width / 2 - D, M = -y.height / 2 - D, N, P;
2092
+ if (s.look === "handDrawn") {
2093
+ let e = at.svg(p), a = userNodeOverrides(s, {}), c = e.path(createRoundedRectPathD(j, M, k, A, s.rx || 0), a), l = e.line(-y.width / 2 - D, -y.height / 2 - D + x.height + D, y.width / 2 + D, -y.height / 2 - D + x.height + D, a);
2094
+ P = p.insert(() => (log.debug("Rough node insert CXC", c), l), ":first-child"), N = p.insert(() => (log.debug("Rough node insert CXC", c), c), ":first-child");
2095
+ } else N = m.insert("rect", ":first-child"), P = m.insert("line"), N.attr("class", "outer title-state").attr("style", d).attr("x", -y.width / 2 - D).attr("y", -y.height / 2 - D).attr("width", y.width + (s.padding || 0)).attr("height", y.height + (s.padding || 0)), P.attr("class", "divider").attr("x1", -y.width / 2 - D).attr("x2", y.width / 2 + D).attr("y1", -y.height / 2 - D + x.height + D).attr("y2", -y.height / 2 - D + x.height + D);
2096
+ return updateNodeBounds(s, N), s.intersect = function(e) {
2097
+ return intersect_default.rect(s, e);
2098
+ }, p;
2099
2099
  }
2100
2100
  __name(rectWithTitle, "rectWithTitle");
2101
2101
  async function roundedRect(e, a, { config: { themeVariables: o } }) {
@@ -2538,12 +2538,12 @@ async function trapezoidalPentagon(e, a) {
2538
2538
  }
2539
2539
  __name(trapezoidalPentagon, "trapezoidalPentagon");
2540
2540
  var MIN_HEIGHT5 = 10, MIN_WIDTH5 = 10;
2541
- async function triangle(e, s) {
2542
- let { labelStyles: l, nodeStyles: u } = styles2String(s);
2543
- s.labelStyle = l;
2544
- let d = s.padding ?? 0, f = s.look === "neo" ? d * 2 : d;
2545
- (s.width || s.height) && (s.width = ((s?.width ?? 0) - f) / 2, s.width < MIN_WIDTH5 && (s.width = MIN_WIDTH5), s.height = s?.height ?? 0, s.height < MIN_HEIGHT5 && (s.height = MIN_HEIGHT5));
2546
- let { shapeSvg: p, bbox: m, label: h } = await labelHelper(e, s, getNodeClasses(s)), g = evaluate(getConfig2().flowchart?.htmlLabels), _ = (s?.width ? s?.width : m.width) + f, v = s?.height ? s?.height : _ + m.height, y = v, b = [
2541
+ async function triangle(e, a) {
2542
+ let { labelStyles: c, nodeStyles: u } = styles2String(a);
2543
+ a.labelStyle = c;
2544
+ let d = a.padding ?? 0, f = a.look === "neo" ? d * 2 : d;
2545
+ (a.width || a.height) && (a.width = ((a?.width ?? 0) - f) / 2, a.width < MIN_WIDTH5 && (a.width = MIN_WIDTH5), a.height = a?.height ?? 0, a.height < MIN_HEIGHT5 && (a.height = MIN_HEIGHT5));
2546
+ let { shapeSvg: p, bbox: m, label: h } = await labelHelper(e, a, getNodeClasses(a)), g = evaluate(getConfig2().flowchart?.htmlLabels), _ = (a?.width ? a?.width : m.width) + f, v = a?.height ? a?.height : _ + m.height, y = v, b = [
2547
2547
  {
2548
2548
  x: 0,
2549
2549
  y: 0
@@ -2556,11 +2556,11 @@ async function triangle(e, s) {
2556
2556
  x: y / 2,
2557
2557
  y: -v
2558
2558
  }
2559
- ], { cssStyles: x } = s, w = at.svg(p), T = userNodeOverrides(s, {});
2560
- s.look !== "handDrawn" && (T.roughness = 0, T.fillStyle = "solid");
2559
+ ], { cssStyles: x } = a, w = at.svg(p), T = userNodeOverrides(a, {});
2560
+ a.look !== "handDrawn" && (T.roughness = 0, T.fillStyle = "solid");
2561
2561
  let D = createPathFromPoints(b), j = w.path(D, T), M = p.insert(() => j, ":first-child").attr("transform", `translate(${-v / 2}, ${v / 2})`).attr("class", "outer-path");
2562
- return x && s.look !== "handDrawn" && M.selectChildren("path").attr("style", x), u && s.look !== "handDrawn" && M.selectChildren("path").attr("style", u), s.width = _, s.height = v, updateNodeBounds(s, M), h.attr("transform", `translate(${-m.width / 2 - (m.x - (m.left ?? 0))}, ${v / 2 - (m.height + (s.padding ?? 0) / (g ? 2 : 1) - (m.y - (m.top ?? 0)))})`), s.intersect = function(e) {
2563
- return log.info("Triangle intersect", s, b, e), intersect_default.polygon(s, b, e);
2562
+ return x && a.look !== "handDrawn" && M.selectChildren("path").attr("style", x), u && a.look !== "handDrawn" && M.selectChildren("path").attr("style", u), a.width = _, a.height = v, updateNodeBounds(a, M), h.attr("transform", `translate(${-m.width / 2 - (m.x - (m.left ?? 0))}, ${v / 2 - (m.height + (a.padding ?? 0) / (g ? 2 : 1) - (m.y - (m.top ?? 0)))})`), a.intersect = function(e) {
2563
+ return log.info("Triangle intersect", a, b, e), intersect_default.polygon(a, b, e);
2564
2564
  }, p;
2565
2565
  }
2566
2566
  __name(triangle, "triangle");
@@ -2658,50 +2658,50 @@ var COLOR_THEMES = /* @__PURE__ */ new Set(["redux-color", "redux-dark-color"]),
2658
2658
  "redux-color",
2659
2659
  "redux-dark-color"
2660
2660
  ]);
2661
- async function erBox(e, a) {
2662
- let c = a;
2663
- c.alias && (a.label = c.alias);
2664
- let { theme: l, themeVariables: u } = getConfig(), { rowEven: d, rowOdd: f, nodeBorder: p, borderColorArray: g } = u;
2665
- if (a.look === "handDrawn") {
2666
- let { themeVariables: o } = getConfig(), { background: c } = o;
2667
- await erBox(e, {
2668
- ...a,
2669
- id: a.id + "-background",
2670
- domId: (a.domId || a.id) + "-background",
2661
+ async function erBox(a, o) {
2662
+ let l = o;
2663
+ l.alias && (o.label = l.alias);
2664
+ let { theme: u, themeVariables: d } = getConfig(), { rowEven: f, rowOdd: p, nodeBorder: m, borderColorArray: g } = d;
2665
+ if (o.look === "handDrawn") {
2666
+ let { themeVariables: e } = getConfig(), { background: s } = e;
2667
+ await erBox(a, {
2668
+ ...o,
2669
+ id: o.id + "-background",
2670
+ domId: (o.domId || o.id) + "-background",
2671
2671
  look: "default",
2672
- cssStyles: ["stroke: none", `fill: ${c}`]
2672
+ cssStyles: ["stroke: none", `fill: ${s}`]
2673
2673
  });
2674
2674
  }
2675
2675
  let _ = getConfig();
2676
- a.useHtmlLabels = _.htmlLabels;
2677
- let v = _.er?.diagramPadding ?? 10, y = _.er?.entityPadding ?? 6, { cssStyles: b } = a, { labelStyles: x, nodeStyles: w } = styles2String(a);
2678
- if (c.attributes.length === 0 && a.label) {
2679
- let s = {
2676
+ o.useHtmlLabels = _.htmlLabels;
2677
+ let v = _.er?.diagramPadding ?? 10, y = _.er?.entityPadding ?? 6, { cssStyles: b } = o, { labelStyles: x, nodeStyles: w } = styles2String(o);
2678
+ if (l.attributes.length === 0 && o.label) {
2679
+ let e = {
2680
2680
  rx: 0,
2681
2681
  ry: 0,
2682
2682
  labelPaddingX: v,
2683
2683
  labelPaddingY: v * 1.5,
2684
2684
  classes: ""
2685
2685
  };
2686
- calculateTextWidth(a.label, _) + s.labelPaddingX * 2 < _.er.minEntityWidth && (a.width = _.er.minEntityWidth);
2687
- let u = await drawRect(e, a, s);
2688
- if (l != null && COLOR_THEMES.has(l)) {
2689
- let e = c.colorIndex ?? 0;
2690
- u.attr("data-color-id", `color-${e % g.length}`);
2686
+ calculateTextWidth(o.label, _) + e.labelPaddingX * 2 < _.er.minEntityWidth && (o.width = _.er.minEntityWidth);
2687
+ let c = await drawRect(a, o, e);
2688
+ if (u != null && COLOR_THEMES.has(u)) {
2689
+ let e = l.colorIndex ?? 0;
2690
+ c.attr("data-color-id", `color-${e % g.length}`);
2691
2691
  }
2692
2692
  if (!evaluate(_.htmlLabels)) {
2693
- let e = u.select("text"), a = e.node()?.getBBox();
2693
+ let e = c.select("text"), a = e.node()?.getBBox();
2694
2694
  e.attr("transform", `translate(${-a.width / 2}, 0)`);
2695
2695
  }
2696
- return u;
2696
+ return c;
2697
2697
  }
2698
2698
  _.htmlLabels || (v *= 1.25, y *= 1.25);
2699
- let T = getNodeClasses(a);
2699
+ let T = getNodeClasses(o);
2700
2700
  T ||= "node default";
2701
- let E = e.insert("g").attr("class", T).attr("id", a.domId || a.id), D = await addText(E, a.label ?? "", _, 0, 0, ["name"], x);
2701
+ let E = a.insert("g").attr("class", T).attr("id", o.domId || o.id), D = await addText(E, o.label ?? "", _, 0, 0, ["name"], x);
2702
2702
  D.height += y;
2703
2703
  let A = 0, j = [], M = [], N = 0, P = 0, F = 0, I = 0, L = !0, R = !0;
2704
- for (let e of c.attributes) {
2704
+ for (let e of l.attributes) {
2705
2705
  let a = await addText(E, e.type, _, 0, A, ["attribute-type"], x);
2706
2706
  N = Math.max(N, a.width + v);
2707
2707
  let o = await addText(E, e.name, _, 0, A, ["attribute-name"], x);
@@ -2723,20 +2723,20 @@ async function erBox(e, a) {
2723
2723
  let e = D.width + v * 2 - (N + P + F + I);
2724
2724
  N += e / z, P += e / z, F > 0 && (F += e / z), I > 0 && (I += e / z);
2725
2725
  }
2726
- let V = N + P + F + I, H = at.svg(E), U = userNodeOverrides(a, {});
2727
- a.look !== "handDrawn" && (U.roughness = 0, U.fillStyle = "solid");
2726
+ let V = N + P + F + I, H = at.svg(E), U = userNodeOverrides(o, {});
2727
+ o.look !== "handDrawn" && (U.roughness = 0, U.fillStyle = "solid");
2728
2728
  let W = 0;
2729
2729
  M.length > 0 && (W = M.reduce((e, a) => e + (a?.rowHeight ?? 0), 0));
2730
- let G = Math.max(B.width + v * 2, a?.width || 0, V), K = Math.max((W ?? 0) + D.height, a?.height || 0), q = -G / 2, J = -K / 2;
2731
- if (E.selectAll("g:not(:first-child)").each((e, a, o) => {
2732
- let s = select_default(o[a]), c = s.attr("transform"), l = 0, u = 0;
2733
- if (c) {
2734
- let e = RegExp(/translate\(([^,]+),([^)]+)\)/).exec(c);
2735
- e && (l = parseFloat(e[1]), u = parseFloat(e[2]), s.attr("class").includes("attribute-name") ? l += N : s.attr("class").includes("attribute-keys") ? l += N + P : s.attr("class").includes("attribute-comment") && (l += N + P + F));
2730
+ let G = Math.max(B.width + v * 2, o?.width || 0, V), K = Math.max((W ?? 0) + D.height, o?.height || 0), q = -G / 2, J = -K / 2;
2731
+ if (E.selectAll("g:not(:first-child)").each((a, o, s) => {
2732
+ let c = select_default(s[o]), l = c.attr("transform"), u = 0, d = 0;
2733
+ if (l) {
2734
+ let e = RegExp(/translate\(([^,]+),([^)]+)\)/).exec(l);
2735
+ e && (u = parseFloat(e[1]), d = parseFloat(e[2]), c.attr("class").includes("attribute-name") ? u += N : c.attr("class").includes("attribute-keys") ? u += N + P : c.attr("class").includes("attribute-comment") && (u += N + P + F));
2736
2736
  }
2737
- s.attr("transform", `translate(${q + v / 2 + l}, ${u + J + D.height + y / 2})`);
2738
- }), E.select(".name").attr("transform", "translate(" + -D.width / 2 + ", " + (J + y / 2) + ")"), l != null && COLOR_THEMES.has(l)) {
2739
- let e = c.colorIndex ?? 0;
2737
+ c.attr("transform", `translate(${q + v / 2 + u}, ${d + J + D.height + y / 2})`);
2738
+ }), E.select(".name").attr("transform", "translate(" + -D.width / 2 + ", " + (J + y / 2) + ")"), u != null && COLOR_THEMES.has(u)) {
2739
+ let e = l.colorIndex ?? 0;
2740
2740
  E.attr("data-color-id", `color-${e % g.length}`);
2741
2741
  }
2742
2742
  let Y = H.rectangle(q, J, G, K, U), X = E.insert(() => Y, ":first-child").attr("class", "outer-path").attr("style", b.join(""));
@@ -2744,8 +2744,8 @@ async function erBox(e, a) {
2744
2744
  for (let [e, a] of M.entries()) {
2745
2745
  let o = (e + 1) % 2 == 0 && a.yOffset !== 0, s = H.rectangle(q, D.height + J + a?.yOffset, G, a?.rowHeight, {
2746
2746
  ...U,
2747
- fill: o ? d : f,
2748
- stroke: p
2747
+ fill: o ? f : p,
2748
+ stroke: m
2749
2749
  });
2750
2750
  E.insert(() => s, "g.label").attr("style", b.join("")).attr("class", `row-rect-${o ? "even" : "odd"}`);
2751
2751
  }
@@ -2762,34 +2762,34 @@ async function erBox(e, a) {
2762
2762
  let a = D.height + J + e;
2763
2763
  Q = lineToPolygon(q, a, G + q, a, Z), $ = H.polygon(Q.map((e) => [e.x, e.y]), U), E.insert(() => $).attr("class", "divider");
2764
2764
  }
2765
- if (updateNodeBounds(a, X), w && a.look !== "handDrawn") if (l != null && REDUX_THEMES.has(l)) E.selectAll("path").attr("style", w);
2765
+ if (updateNodeBounds(o, X), w && o.look !== "handDrawn") if (u != null && REDUX_THEMES.has(u)) E.selectAll("path").attr("style", w);
2766
2766
  else {
2767
2767
  let e = w.split(";")?.filter((e) => e.includes("stroke"))?.map((e) => `${e}`).join("; ");
2768
2768
  E.selectAll("path").attr("style", e ?? ""), E.selectAll(".row-rect-even path").attr("style", w);
2769
2769
  }
2770
- return a.intersect = function(e) {
2771
- return intersect_default.rect(a, e);
2770
+ return o.intersect = function(e) {
2771
+ return intersect_default.rect(o, e);
2772
2772
  }, E;
2773
2773
  }
2774
2774
  __name(erBox, "erBox");
2775
- async function addText(e, a, s, c = 0, l = 0, u = [], f = "") {
2776
- let p = e.insert("g").attr("class", `label ${u.join(" ")}`).attr("transform", `translate(${c}, ${l})`).attr("style", f);
2777
- a !== parseGenericTypes(a) && (a = parseGenericTypes(a), a = a.replaceAll("<", "&lt;").replaceAll(">", "&gt;"));
2778
- let g = p.node().appendChild(await createText(p, a, {
2779
- width: calculateTextWidth(a, s) + 100,
2780
- style: f,
2781
- useHtmlLabels: s.htmlLabels
2782
- }, s));
2783
- if (a.includes("&lt;") || a.includes("&gt;")) {
2775
+ async function addText(a, o, c, l = 0, u = 0, d = [], p = "") {
2776
+ let m = a.insert("g").attr("class", `label ${d.join(" ")}`).attr("transform", `translate(${l}, ${u})`).attr("style", p);
2777
+ o !== parseGenericTypes(o) && (o = parseGenericTypes(o), o = o.replaceAll("<", "&lt;").replaceAll(">", "&gt;"));
2778
+ let g = m.node().appendChild(await createText(m, o, {
2779
+ width: calculateTextWidth(o, c) + 100,
2780
+ style: p,
2781
+ useHtmlLabels: c.htmlLabels
2782
+ }, c));
2783
+ if (o.includes("&lt;") || o.includes("&gt;")) {
2784
2784
  let e = g.children[0];
2785
2785
  for (e.textContent = e.textContent.replaceAll("&lt;", "<").replaceAll("&gt;", ">"); e.childNodes[0];) e = e.childNodes[0], e.textContent = e.textContent.replaceAll("&lt;", "<").replaceAll("&gt;", ">");
2786
2786
  }
2787
2787
  let _ = g.getBBox();
2788
- if (evaluate(s.htmlLabels)) {
2789
- let e = g.children[0];
2790
- e.style.textAlign = "start";
2791
- let a = select_default(g);
2792
- _ = e.getBoundingClientRect(), a.attr("width", _.width), a.attr("height", _.height);
2788
+ if (evaluate(c.htmlLabels)) {
2789
+ let a = g.children[0];
2790
+ a.style.textAlign = "start";
2791
+ let o = select_default(g);
2792
+ _ = a.getBoundingClientRect(), o.attr("width", _.width), o.attr("height", _.height);
2793
2793
  }
2794
2794
  return _;
2795
2795
  }
@@ -2863,23 +2863,23 @@ async function textHelper(e, a, o, s, c = o.class.padding ?? 12) {
2863
2863
  };
2864
2864
  }
2865
2865
  __name(textHelper, "textHelper");
2866
- async function addText2(a, c, l, d = []) {
2867
- let f = a.insert("g").attr("class", "label").attr("style", d.join("; ")), _ = getConfig(), v = "useHtmlLabels" in c ? c.useHtmlLabels : evaluate(_.htmlLabels) ?? !0, y = "";
2868
- y = "text" in c ? c.text : c.label, !v && y.startsWith("\\") && (y = y.substring(1)), hasKatex(y) && (v = !0);
2869
- let b = await createText(f, sanitizeText3(decodeEntities(y)), {
2866
+ async function addText2(o, l, u, f = []) {
2867
+ let p = o.insert("g").attr("class", "label").attr("style", f.join("; ")), _ = getConfig(), v = "useHtmlLabels" in l ? l.useHtmlLabels : evaluate(_.htmlLabels) ?? !0, y = "";
2868
+ y = "text" in l ? l.text : l.label, !v && y.startsWith("\\") && (y = y.substring(1)), hasKatex(y) && (v = !0);
2869
+ let b = await createText(p, sanitizeText3(decodeEntities(y)), {
2870
2870
  width: calculateTextWidth(y, _) + 50,
2871
2871
  classes: "markdown-node-label",
2872
2872
  useHtmlLabels: v
2873
2873
  }, _), x, S = 1;
2874
2874
  if (v) {
2875
- let a = b.children[0], o = select_default(b);
2876
- S = a.innerHTML.split("<br>").length, a.innerHTML.includes("</math>") && (S += a.innerHTML.split("<mrow>").length - 1);
2877
- let s = a.getElementsByTagName("img");
2878
- if (s) {
2879
- let a = y.replace(/<img[^>]*>/g, "").trim() === "";
2880
- await Promise.all([...s].map((o) => new Promise((s) => {
2875
+ let o = b.children[0], s = select_default(b);
2876
+ S = o.innerHTML.split("<br>").length, o.innerHTML.includes("</math>") && (S += o.innerHTML.split("<mrow>").length - 1);
2877
+ let c = o.getElementsByTagName("img");
2878
+ if (c) {
2879
+ let e = y.replace(/<img[^>]*>/g, "").trim() === "";
2880
+ await Promise.all([...c].map((o) => new Promise((s) => {
2881
2881
  function c() {
2882
- if (o.style.display = "flex", o.style.flexDirection = "column", a) {
2882
+ if (o.style.display = "flex", o.style.flexDirection = "column", e) {
2883
2883
  let e = _.fontSize?.toString() ?? window.getComputedStyle(document.body).fontSize, a = parseInt(e, 10) * 5 + "px";
2884
2884
  o.style.minWidth = a, o.style.maxWidth = a;
2885
2885
  } else o.style.width = "100%";
@@ -2890,56 +2890,56 @@ async function addText2(a, c, l, d = []) {
2890
2890
  }), o.addEventListener("error", c), o.addEventListener("load", c);
2891
2891
  })));
2892
2892
  }
2893
- x = a.getBoundingClientRect(), o.attr("width", x.width), o.attr("height", x.height);
2893
+ x = o.getBoundingClientRect(), s.attr("width", x.width), s.attr("height", x.height);
2894
2894
  } else {
2895
- d.includes("font-weight: bolder") && select_default(b).selectAll("tspan").attr("font-weight", ""), S = b.children.length;
2896
- let e = b.children[0];
2897
- (b.textContent === "" || b.textContent.includes("&gt")) && (e.textContent = y[0] + y.substring(1).replaceAll("&gt;", ">").replaceAll("&lt;", "<").trim(), y[1] === " " && (e.textContent = e.textContent[0] + " " + e.textContent.substring(1))), e.textContent === "undefined" && (e.textContent = ""), x = b.getBBox();
2895
+ f.includes("font-weight: bolder") && select_default(b).selectAll("tspan").attr("font-weight", ""), S = b.children.length;
2896
+ let a = b.children[0];
2897
+ (b.textContent === "" || b.textContent.includes("&gt")) && (a.textContent = y[0] + y.substring(1).replaceAll("&gt;", ">").replaceAll("&lt;", "<").trim(), y[1] === " " && (a.textContent = a.textContent[0] + " " + a.textContent.substring(1))), a.textContent === "undefined" && (a.textContent = ""), x = b.getBBox();
2898
2898
  }
2899
- return f.attr("transform", "translate(0," + (-x.height / (2 * S) + l) + ")"), x.height;
2899
+ return p.attr("transform", "translate(0," + (-x.height / (2 * S) + u) + ")"), x.height;
2900
2900
  }
2901
2901
  __name(addText2, "addText");
2902
- async function classBox(e, a) {
2903
- let s = getConfig2(), { themeVariables: l } = s, { useGradient: u } = l, d = s.class.padding ?? 12, f = d, p = a.useHtmlLabels ?? evaluate(s.htmlLabels) ?? !0, h = a;
2902
+ async function classBox(a, o) {
2903
+ let c = getConfig2(), { themeVariables: u } = c, { useGradient: d } = u, f = c.class.padding ?? 12, p = f, m = o.useHtmlLabels ?? evaluate(c.htmlLabels) ?? !0, h = o;
2904
2904
  h.annotations = h.annotations ?? [], h.members = h.members ?? [], h.methods = h.methods ?? [];
2905
- let { shapeSvg: g, bbox: _ } = await textHelper(e, a, s, p, f), { labelStyles: v, nodeStyles: y } = styles2String(a);
2906
- a.labelStyle = v, a.cssStyles = h.styles || "";
2905
+ let { shapeSvg: g, bbox: _ } = await textHelper(a, o, c, m, p), { labelStyles: v, nodeStyles: y } = styles2String(o);
2906
+ o.labelStyle = v, o.cssStyles = h.styles || "";
2907
2907
  let b = h.styles?.join(";") || y || "";
2908
- a.cssStyles ||= b.replaceAll("!important", "").split(";");
2909
- let x = h.members.length === 0 && h.methods.length === 0 && !s.class?.hideEmptyMembersBox, w = at.svg(g), T = userNodeOverrides(a, {});
2910
- a.look !== "handDrawn" && (T.roughness = 0, T.fillStyle = "solid");
2911
- let E = Math.max(a.width ?? 0, _.width), D = Math.max(a.height ?? 0, _.height), k = (a.height ?? 0) > _.height;
2912
- h.members.length === 0 && h.methods.length === 0 ? D += f : h.members.length > 0 && h.methods.length === 0 && (D += f * 2);
2913
- let A = -E / 2, j = -D / 2, M = x ? d * 2 : h.members.length === 0 && h.methods.length === 0 ? -d : 0;
2914
- k && (M = d * 2);
2915
- let N = w.rectangle(A - d, j - d - (x ? d : h.members.length === 0 && h.methods.length === 0 ? -d / 2 : 0), E + 2 * d, D + 2 * d + M, T), P = g.insert(() => N, ":first-child");
2908
+ o.cssStyles ||= b.replaceAll("!important", "").split(";");
2909
+ let x = h.members.length === 0 && h.methods.length === 0 && !c.class?.hideEmptyMembersBox, w = at.svg(g), T = userNodeOverrides(o, {});
2910
+ o.look !== "handDrawn" && (T.roughness = 0, T.fillStyle = "solid");
2911
+ let E = Math.max(o.width ?? 0, _.width), D = Math.max(o.height ?? 0, _.height), k = (o.height ?? 0) > _.height;
2912
+ h.members.length === 0 && h.methods.length === 0 ? D += p : h.members.length > 0 && h.methods.length === 0 && (D += p * 2);
2913
+ let A = -E / 2, j = -D / 2, M = x ? f * 2 : h.members.length === 0 && h.methods.length === 0 ? -f : 0;
2914
+ k && (M = f * 2);
2915
+ let N = w.rectangle(A - f, j - f - (x ? f : h.members.length === 0 && h.methods.length === 0 ? -f / 2 : 0), E + 2 * f, D + 2 * f + M, T), P = g.insert(() => N, ":first-child");
2916
2916
  P.attr("class", "basic label-container outer-path");
2917
- let F = P.node().getBBox(), I = g.select(".annotation-group").node().getBBox().height - (x ? d / 2 : 0) || 0, L = g.select(".label-group").node().getBBox().height - (x ? d / 2 : 0) || 0, R = g.select(".members-group").node().getBBox().height - (x ? d / 2 : 0) || 0, z = (I + L + j + d - (j - d - (x ? d : h.members.length === 0 && h.methods.length === 0 ? -d / 2 : 0))) / 2;
2918
- if (g.selectAll(".text").each((e, a, o) => {
2919
- let c = select_default(o[a]), l = c.attr("transform"), u = 0;
2920
- if (l) {
2921
- let e = RegExp(/translate\(([^,]+),([^)]+)\)/).exec(l);
2922
- e && (u = parseFloat(e[2]));
2917
+ let F = P.node().getBBox(), I = g.select(".annotation-group").node().getBBox().height - (x ? f / 2 : 0) || 0, L = g.select(".label-group").node().getBBox().height - (x ? f / 2 : 0) || 0, R = g.select(".members-group").node().getBBox().height - (x ? f / 2 : 0) || 0, z = (I + L + j + f - (j - f - (x ? f : h.members.length === 0 && h.methods.length === 0 ? -f / 2 : 0))) / 2;
2918
+ if (g.selectAll(".text").each((a, o, s) => {
2919
+ let l = select_default(s[o]), u = l.attr("transform"), d = 0;
2920
+ if (u) {
2921
+ let e = RegExp(/translate\(([^,]+),([^)]+)\)/).exec(u);
2922
+ e && (d = parseFloat(e[2]));
2923
2923
  }
2924
- let _ = u + j + d - (x ? d : h.members.length === 0 && h.methods.length === 0 ? -d / 2 : 0);
2925
- if (c.attr("class").includes("methods-group")) {
2926
- let e = Math.max(R, f / 2);
2927
- _ = k ? Math.max(z, I + L + e + j + f * 2 + d) + f * 2 : I + L + e + j + f * 4 + d;
2924
+ let _ = d + j + f - (x ? f : h.members.length === 0 && h.methods.length === 0 ? -f / 2 : 0);
2925
+ if (l.attr("class").includes("methods-group")) {
2926
+ let e = Math.max(R, p / 2);
2927
+ _ = k ? Math.max(z, I + L + e + j + p * 2 + f) + p * 2 : I + L + e + j + p * 4 + f;
2928
2928
  }
2929
- h.members.length === 0 && h.methods.length === 0 && s.class?.hideEmptyMembersBox && (_ = h.annotations.length > 0 ? u - f : u), p || (_ -= 4);
2929
+ h.members.length === 0 && h.methods.length === 0 && c.class?.hideEmptyMembersBox && (_ = h.annotations.length > 0 ? d - p : d), m || (_ -= 4);
2930
2930
  let v = A;
2931
- (c.attr("class").includes("label-group") || c.attr("class").includes("annotation-group")) && (v = -c.node()?.getBBox().width / 2 || 0, g.selectAll("text").each(function(e, a, o) {
2931
+ (l.attr("class").includes("label-group") || l.attr("class").includes("annotation-group")) && (v = -l.node()?.getBBox().width / 2 || 0, g.selectAll("text").each(function(e, a, o) {
2932
2932
  window.getComputedStyle(o[a]).textAnchor === "middle" && (v = 0);
2933
- })), c.attr("transform", `translate(${v}, ${_})`);
2933
+ })), l.attr("transform", `translate(${v}, ${_})`);
2934
2934
  }), h.members.length > 0 || h.methods.length > 0 || x) {
2935
- let e = I + L + j + d, o = w.line(F.x, e, F.x + F.width, e + .001, T);
2936
- g.insert(() => o).attr("class", `divider${a.look === "neo" && !u ? " neo-line" : ""}`).attr("style", b);
2935
+ let e = I + L + j + f, a = w.line(F.x, e, F.x + F.width, e + .001, T);
2936
+ g.insert(() => a).attr("class", `divider${o.look === "neo" && !d ? " neo-line" : ""}`).attr("style", b);
2937
2937
  }
2938
2938
  if (x || h.members.length > 0 || h.methods.length > 0) {
2939
- let e = I + L + R + j + f * 2 + d, o = w.line(F.x, k ? Math.max(z, e) : e, F.x + F.width, (k ? Math.max(z, e) : e) + .001, T);
2940
- g.insert(() => o).attr("class", `divider${a.look === "neo" && !u ? " neo-line" : ""}`).attr("style", b);
2939
+ let e = I + L + R + j + p * 2 + f, a = w.line(F.x, k ? Math.max(z, e) : e, F.x + F.width, (k ? Math.max(z, e) : e) + .001, T);
2940
+ g.insert(() => a).attr("class", `divider${o.look === "neo" && !d ? " neo-line" : ""}`).attr("style", b);
2941
2941
  }
2942
- if (h.look !== "handDrawn" && g.selectAll("path").attr("style", b), P.select(":nth-child(2)").attr("style", b), g.selectAll(".divider").select("path").attr("style", b), a.labelStyle ? g.selectAll("span").attr("style", a.labelStyle) : g.selectAll("span").attr("style", b), !p) {
2942
+ if (h.look !== "handDrawn" && g.selectAll("path").attr("style", b), P.select(":nth-child(2)").attr("style", b), g.selectAll(".divider").select("path").attr("style", b), o.labelStyle ? g.selectAll("span").attr("style", o.labelStyle) : g.selectAll("span").attr("style", b), !m) {
2943
2943
  let e = RegExp(/color\s*:\s*([^;]*)/), a = e.exec(b);
2944
2944
  if (a) {
2945
2945
  let e = a[0].replace("color", "fill");
@@ -2952,78 +2952,78 @@ async function classBox(e, a) {
2952
2952
  }
2953
2953
  }
2954
2954
  }
2955
- return updateNodeBounds(a, P), a.intersect = function(e) {
2956
- return intersect_default.rect(a, e);
2955
+ return updateNodeBounds(o, P), o.intersect = function(e) {
2956
+ return intersect_default.rect(o, e);
2957
2957
  }, g;
2958
2958
  }
2959
2959
  __name(classBox, "classBox");
2960
- async function requirementBox(e, a) {
2961
- let { labelStyles: o, nodeStyles: s } = styles2String(a);
2962
- a.labelStyle = o;
2963
- let l = a, u = a, d = "verifyMethod" in a, f = getNodeClasses(a), { themeVariables: p } = getConfig2(), { borderColorArray: h, requirementEdgeLabelBackground: g } = p, _ = e.insert("g").attr("class", f).attr("id", a.domId ?? a.id), v;
2964
- v = d ? await addText3(_, `&lt;&lt;${l.type}&gt;&gt;`, 0, a.labelStyle) : await addText3(_, "&lt;&lt;Element&gt;&gt;", 0, a.labelStyle);
2965
- let y = v, b = await addText3(_, l.name, y, a.labelStyle + "; font-weight: bold;");
2966
- if (y += b + 20, d) {
2967
- let e = await addText3(_, `${l.requirementId ? `ID: ${l.requirementId}` : ""}`, y, a.labelStyle);
2960
+ async function requirementBox(a, o) {
2961
+ let { labelStyles: s, nodeStyles: c } = styles2String(o);
2962
+ o.labelStyle = s;
2963
+ let u = o, d = o, f = "verifyMethod" in o, p = getNodeClasses(o), { themeVariables: m } = getConfig2(), { borderColorArray: h, requirementEdgeLabelBackground: g } = m, _ = a.insert("g").attr("class", p).attr("id", o.domId ?? o.id), v;
2964
+ v = f ? await addText3(_, `&lt;&lt;${u.type}&gt;&gt;`, 0, o.labelStyle) : await addText3(_, "&lt;&lt;Element&gt;&gt;", 0, o.labelStyle);
2965
+ let y = v, b = await addText3(_, u.name, y, o.labelStyle + "; font-weight: bold;");
2966
+ if (y += b + 20, f) {
2967
+ let e = await addText3(_, `${u.requirementId ? `ID: ${u.requirementId}` : ""}`, y, o.labelStyle);
2968
2968
  y += e;
2969
- let o = await addText3(_, `${l.text ? `Text: ${l.text}` : ""}`, y, a.labelStyle);
2970
- y += o;
2971
- let s = await addText3(_, `${l.risk ? `Risk: ${l.risk}` : ""}`, y, a.labelStyle);
2972
- y += s, await addText3(_, `${l.verifyMethod ? `Verification: ${l.verifyMethod}` : ""}`, y, a.labelStyle);
2969
+ let a = await addText3(_, `${u.text ? `Text: ${u.text}` : ""}`, y, o.labelStyle);
2970
+ y += a;
2971
+ let s = await addText3(_, `${u.risk ? `Risk: ${u.risk}` : ""}`, y, o.labelStyle);
2972
+ y += s, await addText3(_, `${u.verifyMethod ? `Verification: ${u.verifyMethod}` : ""}`, y, o.labelStyle);
2973
2973
  } else {
2974
- let e = await addText3(_, `${u.type ? `Type: ${u.type}` : ""}`, y, a.labelStyle);
2975
- y += e, await addText3(_, `${u.docRef ? `Doc Ref: ${u.docRef}` : ""}`, y, a.labelStyle);
2974
+ let e = await addText3(_, `${d.type ? `Type: ${d.type}` : ""}`, y, o.labelStyle);
2975
+ y += e, await addText3(_, `${d.docRef ? `Doc Ref: ${d.docRef}` : ""}`, y, o.labelStyle);
2976
2976
  }
2977
- let x = (_.node()?.getBBox().width ?? 200) + 20, w = (_.node()?.getBBox().height ?? 200) + 20, T = -x / 2, E = -w / 2, D = at.svg(_), A = userNodeOverrides(a, {});
2978
- a.look !== "handDrawn" && (A.roughness = 0, A.fillStyle = "solid");
2977
+ let x = (_.node()?.getBBox().width ?? 200) + 20, w = (_.node()?.getBBox().height ?? 200) + 20, T = -x / 2, E = -w / 2, D = at.svg(_), A = userNodeOverrides(o, {});
2978
+ o.look !== "handDrawn" && (A.roughness = 0, A.fillStyle = "solid");
2979
2979
  let j = D.rectangle(T, E, x, w, A), M = _.insert(() => j, ":first-child");
2980
- if (M.attr("class", "basic label-container outer-path").attr("style", s), h?.length) {
2981
- let e = a.colorIndex ?? 0;
2980
+ if (M.attr("class", "basic label-container outer-path").attr("style", c), h?.length) {
2981
+ let e = o.colorIndex ?? 0;
2982
2982
  _.attr("data-color-id", `color-${e % h.length}`);
2983
2983
  }
2984
- if (_.selectAll(".label").each((e, a, o) => {
2985
- let s = select_default(o[a]), c = s.attr("transform"), l = 0, u = 0;
2986
- if (c) {
2987
- let e = RegExp(/translate\(([^,]+),([^)]+)\)/).exec(c);
2988
- e && (l = parseFloat(e[1]), u = parseFloat(e[2]));
2984
+ if (_.selectAll(".label").each((a, o, s) => {
2985
+ let c = select_default(s[o]), l = c.attr("transform"), u = 0, d = 0;
2986
+ if (l) {
2987
+ let e = RegExp(/translate\(([^,]+),([^)]+)\)/).exec(l);
2988
+ e && (u = parseFloat(e[1]), d = parseFloat(e[2]));
2989
2989
  }
2990
- let d = u - w / 2, f = T + 20 / 2;
2991
- (a === 0 || a === 1) && (f = l), s.attr("transform", `translate(${f}, ${d + 20})`);
2990
+ let f = d - w / 2, p = T + 20 / 2;
2991
+ (o === 0 || o === 1) && (p = u), c.attr("transform", `translate(${p}, ${f + 20})`);
2992
2992
  }), y > v + b + 20) {
2993
- let e = E + v + b + 20, o;
2994
- if (a.look === "neo") {
2995
- let a = .001, s = [
2993
+ let e = E + v + b + 20, a;
2994
+ if (o.look === "neo") {
2995
+ let o = .001, s = [
2996
2996
  [T, e],
2997
2997
  [T + x, e],
2998
- [T + x, e + a],
2999
- [T, e + a]
2998
+ [T + x, e + o],
2999
+ [T, e + o]
3000
3000
  ];
3001
- o = D.polygon(s, A);
3002
- } else o = D.line(T, e, T + x, e, A);
3003
- _.insert(() => o).attr("class", "divider");
3001
+ a = D.polygon(s, A);
3002
+ } else a = D.line(T, e, T + x, e, A);
3003
+ _.insert(() => a).attr("class", "divider");
3004
3004
  }
3005
- return updateNodeBounds(a, M), a.intersect = function(e) {
3006
- return intersect_default.rect(a, e);
3007
- }, s && a.look !== "handDrawn" && (g || h?.length) && _.selectAll("path").attr("style", s), _;
3005
+ return updateNodeBounds(o, M), o.intersect = function(e) {
3006
+ return intersect_default.rect(o, e);
3007
+ }, c && o.look !== "handDrawn" && (g || h?.length) && _.selectAll("path").attr("style", c), _;
3008
3008
  }
3009
3009
  __name(requirementBox, "requirementBox");
3010
- async function addText3(e, a, o, s = "") {
3011
- if (a === "") return 0;
3012
- let l = e.insert("g").attr("class", "label").attr("style", s), u = getConfig2(), d = u.htmlLabels ?? !0, f = await createText(l, sanitizeText3(decodeEntities(a)), {
3013
- width: calculateTextWidth(a, u) + 50,
3010
+ async function addText3(a, o, s, c = "") {
3011
+ if (o === "") return 0;
3012
+ let u = a.insert("g").attr("class", "label").attr("style", c), d = getConfig2(), f = d.htmlLabels ?? !0, p = await createText(u, sanitizeText3(decodeEntities(o)), {
3013
+ width: calculateTextWidth(o, d) + 50,
3014
3014
  classes: "markdown-node-label",
3015
- useHtmlLabels: d,
3016
- style: s
3017
- }, u), _;
3018
- if (d) {
3019
- let e = f.children[0], a = select_default(f);
3020
- _ = e.getBoundingClientRect(), a.attr("width", _.width), a.attr("height", _.height);
3015
+ useHtmlLabels: f,
3016
+ style: c
3017
+ }, d), _;
3018
+ if (f) {
3019
+ let a = p.children[0], o = select_default(p);
3020
+ _ = a.getBoundingClientRect(), o.attr("width", _.width), o.attr("height", _.height);
3021
3021
  } else {
3022
- let e = f.children[0];
3023
- for (let a of e.children) s && a.setAttribute("style", s);
3024
- _ = f.getBBox(), _.height += 6;
3022
+ let e = p.children[0];
3023
+ for (let a of e.children) c && a.setAttribute("style", c);
3024
+ _ = p.getBBox(), _.height += 6;
3025
3025
  }
3026
- return l.attr("transform", `translate(${-_.width / 2},${-_.height / 2 + o})`), _.height;
3026
+ return u.attr("transform", `translate(${-_.width / 2},${-_.height / 2 + s})`), _.height;
3027
3027
  }
3028
3028
  __name(addText3, "addText");
3029
3029
  var colorFromPriority = /* @__PURE__ */ __name((e) => {
@@ -3072,10 +3072,10 @@ async function kanbanItem(e, a, { config: o }) {
3072
3072
  }, u;
3073
3073
  }
3074
3074
  __name(kanbanItem, "kanbanItem");
3075
- async function bang(e, o) {
3076
- let { labelStyles: s, nodeStyles: c } = styles2String(o);
3077
- o.labelStyle = s;
3078
- let { shapeSvg: l, bbox: u, halfPadding: d, label: f } = await labelHelper(e, o, getNodeClasses(o)), p = u.width + 10 * d, m = u.height + 8 * d, h = .15 * p, { cssStyles: g } = o, v = u.width + 20, y = u.height + 20, b = Math.max(p, v), x = Math.max(m, y);
3075
+ async function bang(e, a) {
3076
+ let { labelStyles: s, nodeStyles: c } = styles2String(a);
3077
+ a.labelStyle = s;
3078
+ let { shapeSvg: l, bbox: u, halfPadding: d, label: f } = await labelHelper(e, a, getNodeClasses(a)), p = u.width + 10 * d, m = u.height + 8 * d, h = .15 * p, { cssStyles: g } = a, v = u.width + 20, y = u.height + 20, b = Math.max(p, v), x = Math.max(m, y);
3079
3079
  f.attr("transform", `translate(${-u.width / 2}, ${-u.height / 2})`);
3080
3080
  let w, T = `M0 0
3081
3081
  a${h},${h} 1 0,0 ${b * .25},${-1 * x * .1}
@@ -3096,21 +3096,21 @@ async function bang(e, o) {
3096
3096
  a${h * .8},${h * .8} 1 0,0 0,${-1 * x * .34}
3097
3097
  a${h},${h} 1 0,0 ${b * .1},${-1 * x * .33}
3098
3098
  H0 V0 Z`;
3099
- if (o.look === "handDrawn") {
3100
- let e = at.svg(l), a = userNodeOverrides(o, {}), s = e.path(T, a);
3099
+ if (a.look === "handDrawn") {
3100
+ let e = at.svg(l), o = userNodeOverrides(a, {}), s = e.path(T, o);
3101
3101
  w = l.insert(() => s, ":first-child"), w.attr("class", "basic label-container").attr("style", handleUndefinedAttr(g));
3102
3102
  } else w = l.insert("path", ":first-child").attr("class", "basic label-container").attr("style", c).attr("d", T);
3103
- return w.attr("transform", `translate(${-b / 2}, ${-x / 2})`), updateNodeBounds(o, w), o.calcIntersect = function(e, a) {
3103
+ return w.attr("transform", `translate(${-b / 2}, ${-x / 2})`), updateNodeBounds(a, w), a.calcIntersect = function(e, a) {
3104
3104
  return intersect_default.rect(e, a);
3105
- }, o.intersect = function(e) {
3106
- return log.info("Bang intersect", o, e), intersect_default.rect(o, e);
3105
+ }, a.intersect = function(e) {
3106
+ return log.info("Bang intersect", a, e), intersect_default.rect(a, e);
3107
3107
  }, l;
3108
3108
  }
3109
3109
  __name(bang, "bang");
3110
- async function cloud(e, o) {
3111
- let { labelStyles: s, nodeStyles: c } = styles2String(o);
3112
- o.labelStyle = s;
3113
- let { shapeSvg: l, bbox: u, halfPadding: d, label: f } = await labelHelper(e, o, getNodeClasses(o)), p = u.width + 2 * d, m = u.height + 2 * d, h = .15 * p, g = .25 * p, v = .35 * p, y = .2 * p, { cssStyles: b } = o, x, w = `M0 0
3110
+ async function cloud(e, a) {
3111
+ let { labelStyles: s, nodeStyles: c } = styles2String(a);
3112
+ a.labelStyle = s;
3113
+ let { shapeSvg: l, bbox: u, halfPadding: d, label: f } = await labelHelper(e, a, getNodeClasses(a)), p = u.width + 2 * d, m = u.height + 2 * d, h = .15 * p, g = .25 * p, v = .35 * p, y = .2 * p, { cssStyles: b } = a, x, w = `M0 0
3114
3114
  a${h},${h} 0 0,1 ${p * .25},${-1 * p * .1}
3115
3115
  a${v},${v} 1 0,1 ${p * .4},${-1 * p * .1}
3116
3116
  a${g},${g} 1 0,1 ${p * .35},${p * .2}
@@ -3125,14 +3125,14 @@ async function cloud(e, o) {
3125
3125
  a${h},${h} 1 0,1 ${-1 * p * .1},${-1 * m * .35}
3126
3126
  a${y},${y} 1 0,1 ${p * .1},${-1 * m * .65}
3127
3127
  H0 V0 Z`;
3128
- if (o.look === "handDrawn") {
3129
- let e = at.svg(l), a = userNodeOverrides(o, {}), s = e.path(w, a);
3128
+ if (a.look === "handDrawn") {
3129
+ let e = at.svg(l), o = userNodeOverrides(a, {}), s = e.path(w, o);
3130
3130
  x = l.insert(() => s, ":first-child"), x.attr("class", "basic label-container").attr("style", handleUndefinedAttr(b));
3131
3131
  } else x = l.insert("path", ":first-child").attr("class", "basic label-container").attr("style", c).attr("d", w);
3132
- return f.attr("transform", `translate(${-u.width / 2}, ${-u.height / 2})`), x.attr("transform", `translate(${-p / 2}, ${-m / 2})`), updateNodeBounds(o, x), o.calcIntersect = function(e, a) {
3132
+ return f.attr("transform", `translate(${-u.width / 2}, ${-u.height / 2})`), x.attr("transform", `translate(${-p / 2}, ${-m / 2})`), updateNodeBounds(a, x), a.calcIntersect = function(e, a) {
3133
3133
  return intersect_default.rect(e, a);
3134
- }, o.intersect = function(e) {
3135
- return log.info("Cloud intersect", o, e), intersect_default.rect(o, e);
3134
+ }, a.intersect = function(e) {
3135
+ return log.info("Cloud intersect", a, e), intersect_default.rect(a, e);
3136
3136
  }, l;
3137
3137
  }
3138
3138
  __name(cloud, "cloud");
@@ -3658,9 +3658,9 @@ var setNodeElem = /* @__PURE__ */ __name((e, a) => {
3658
3658
  }, "setNodeElem"), clear2 = /* @__PURE__ */ __name(() => {
3659
3659
  nodeElems.clear();
3660
3660
  }, "clear"), positionNode = /* @__PURE__ */ __name((e) => {
3661
- let o = nodeElems.get(e.id);
3661
+ let a = nodeElems.get(e.id);
3662
3662
  log.trace("Transforming node", e.diff, e, "translate(" + (e.x - e.width / 2 - 5) + ", " + e.width / 2 + ")");
3663
3663
  let s = e.diff || 0;
3664
- return e.clusterNode ? o.attr("transform", "translate(" + (e.x + s - e.width / 2) + ", " + (e.y - e.height / 2 - 8) + ")") : o.attr("transform", "translate(" + e.x + ", " + e.y + ")"), s;
3664
+ return e.clusterNode ? a.attr("transform", "translate(" + (e.x + s - e.width / 2) + ", " + (e.y - e.height / 2 - 8) + ")") : a.attr("transform", "translate(" + e.x + ", " + e.y + ")"), s;
3665
3665
  }, "positionNode");
3666
3666
  export { clear, clear2, createLabel_default, insertCluster, insertNode, isValidShape, labelHelper, positionNode, setNodeElem, updateNodeBounds };