@draftably/editor 0.1.0 → 0.3.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 (104) hide show
  1. package/README.md +4 -5
  2. package/dist/assets/engine.worker-BY9GKt7x.js +7505 -0
  3. package/dist/element.js +1 -1
  4. package/dist/index.js +20202 -2
  5. package/dist/types/src/cli/raster-fonts.d.ts +3 -0
  6. package/dist/types/src/components/controls.d.ts +8 -5
  7. package/dist/types/src/dsl/compile.d.ts +13 -0
  8. package/dist/types/src/dsl/corridors.d.ts +38 -0
  9. package/dist/types/src/model/types.d.ts +9 -0
  10. package/dist/types/src/state/canvas-commands.d.ts +169 -0
  11. package/dist/types/src/state/canvas-keyboard.d.ts +15 -0
  12. package/dist/types/src/state/links.d.ts +4 -1
  13. package/dist/types/src/state/workspace.d.ts +3 -0
  14. package/package.json +1 -1
  15. package/dist/assets/engine.worker-DmHew5f6.js +0 -6813
  16. package/dist/assets/import-d2.worker-CnXfFXoa.js +0 -5395
  17. package/dist/chunks/abnfDiagram-WEYOIA3C-llcpthp5.js +0 -87
  18. package/dist/chunks/arc-rJj0TtXf.js +0 -83
  19. package/dist/chunks/architectureDiagram-ZHVYKT53-CfiXg0Lk.js +0 -4781
  20. package/dist/chunks/blockDiagram-RJAE7QA3-CO-14jWz.js +0 -1440
  21. package/dist/chunks/browser-iNhbPsGc.js +0 -40
  22. package/dist/chunks/c4Diagram-XDPPPE54-DYKuxA4n.js +0 -1524
  23. package/dist/chunks/channel-qMvPU6eH.js +0 -5
  24. package/dist/chunks/chunk-2E7WHVMD-BEZwsFS3.js +0 -670
  25. package/dist/chunks/chunk-2Q5K7J3B-gqtzQ8ux.js +0 -18
  26. package/dist/chunks/chunk-4EMNKR2T-MC54CXVe.js +0 -262
  27. package/dist/chunks/chunk-55XCU76K-DkZUAaqC.js +0 -68
  28. package/dist/chunks/chunk-5VM5RSS4-CaKe4sjM.js +0 -19
  29. package/dist/chunks/chunk-JWPE2WC7-CnAFS2xF.js +0 -8
  30. package/dist/chunks/chunk-VQ5W62QI-CXRv7FiX.js +0 -19
  31. package/dist/chunks/chunk-XXDRQBXY-B-AMQgD2.js +0 -8
  32. package/dist/chunks/chunk-ZCHMQSOR-BALpdc3g.js +0 -451
  33. package/dist/chunks/classDiagram-v2-4MYWR3UA-wPjgJTg4.js +0 -1570
  34. package/dist/chunks/cose-bilkent-JH36ORCC-Bbh5ggBc.js +0 -2608
  35. package/dist/chunks/cynefin-EF2NZ3EQ-Bt6b88hY.js +0 -22361
  36. package/dist/chunks/cynefinDiagram-WF24UDRP-BHWZvxoF.js +0 -299
  37. package/dist/chunks/cytoscape.esm-CRsF_JA3.js +0 -18791
  38. package/dist/chunks/dagre-NK4GIZVX-Cz37yPrT.js +0 -2157
  39. package/dist/chunks/defaultLocale-BgPVtth8.js +0 -171
  40. package/dist/chunks/diagram-CBK3MWTC-Q2R6FJ0B.js +0 -531
  41. package/dist/chunks/diagram-I5XIIV2D-a2Kdu_wA.js +0 -153
  42. package/dist/chunks/diagram-ODIL2UCW-DTWXxcOn.js +0 -346
  43. package/dist/chunks/diagram-PFBEJUXE-DIAQQ5KX.js +0 -480
  44. package/dist/chunks/diagram-RJA3I4VV-BPD0GghS.js +0 -219
  45. package/dist/chunks/diagram-TYUNFSNR-BmdkONfG.js +0 -2586
  46. package/dist/chunks/dot-importer-B23jwEkx.js +0 -1547
  47. package/dist/chunks/ebnfDiagram-V4P3TTPT-C5IKvYlb.js +0 -109
  48. package/dist/chunks/elk-QONTBCTQ-CtdQFvh2.js +0 -49229
  49. package/dist/chunks/erDiagram-KYQIGQAA-5wguK9Dx.js +0 -1064
  50. package/dist/chunks/flowDiagram-IUGLLWBU-BijvFPku.js +0 -1771
  51. package/dist/chunks/ganttDiagram-R7GPNTJY-BaqGPz-O.js +0 -2729
  52. package/dist/chunks/gitGraphDiagram-PDYL7XHY-DZfMGyHE.js +0 -815
  53. package/dist/chunks/graph-CKJmgLki.js +0 -1541
  54. package/dist/chunks/import-core-C-I1wGfw.js +0 -145
  55. package/dist/chunks/infoDiagram-MVDRKAX5-C2vH_59e.js +0 -24
  56. package/dist/chunks/init-DjUOC4st.js +0 -16
  57. package/dist/chunks/ishikawaDiagram-HPEHV2GE-q149MFlV.js +0 -624
  58. package/dist/chunks/journeyDiagram-BOSHW7O7-D-2Z3VtR.js +0 -834
  59. package/dist/chunks/kanban-definition-FNSA4HC5-wvAjV5ub.js +0 -724
  60. package/dist/chunks/katex-BsrBVQKd.js +0 -11314
  61. package/dist/chunks/linear-4t7D_ros.js +0 -259
  62. package/dist/chunks/mermaid-facade-BoLWBerE.js +0 -289
  63. package/dist/chunks/mermaid-importer-Cgx1IhmR.js +0 -478
  64. package/dist/chunks/mermaid.core-DXv6D2Sm.js +0 -19244
  65. package/dist/chunks/mindmap-definition-6OY57UG3-r9wTKul_.js +0 -837
  66. package/dist/chunks/mount-C1Xk_GQz.js +0 -22131
  67. package/dist/chunks/ordinal-DfAQgscy.js +0 -61
  68. package/dist/chunks/pegDiagram-ECIUJNBX-CmKlFWiP.js +0 -95
  69. package/dist/chunks/pieDiagram-GNMPY74T-DNTw_qan.js +0 -208
  70. package/dist/chunks/quadrantDiagram-D57K4MC3-CT_tvVub.js +0 -1029
  71. package/dist/chunks/railroadDiagram-Y72NRBL7-C5TUvZBe.js +0 -77
  72. package/dist/chunks/requirementDiagram-EQYSW5RA-C_c65aCa.js +0 -889
  73. package/dist/chunks/sankeyDiagram-SY24JHO5-CKcbizM1.js +0 -859
  74. package/dist/chunks/sequenceDiagram-BLEHNHQU-GpVnHOjf.js +0 -2972
  75. package/dist/chunks/sizeCapture-INFHLROL-CToN3JSu.js +0 -46
  76. package/dist/chunks/stateDiagram-v2-A6IESKWZ-rJYd2FfM.js +0 -1520
  77. package/dist/chunks/swimlanes-B3ENRKFQ-C7w5pfxG.js +0 -4991
  78. package/dist/chunks/swimlanesDiagram-AYQRV4AK-BpGY_bvE.js +0 -13
  79. package/dist/chunks/timeline-definition-JXYKGLGB-ChKFPBKc.js +0 -1058
  80. package/dist/chunks/usecaseDiagram-WPOLBNNX-skXH8Dcu.js +0 -7945
  81. package/dist/chunks/vennDiagram-Q3Y3IDCW-C5KknmJf.js +0 -1578
  82. package/dist/chunks/wardleyDiagram-IVAIDKWA-DY4Lkfpu.js +0 -678
  83. package/dist/chunks/xychartDiagram-4URNHDU4-BHScsL7h.js +0 -1536
  84. package/dist/types/src/cli/png.d.ts +0 -23
  85. package/dist/types/src/import/browser.d.ts +0 -3
  86. package/dist/types/src/import/detect.d.ts +0 -31
  87. package/dist/types/src/import/dot-importer.d.ts +0 -3
  88. package/dist/types/src/import/import-core.d.ts +0 -105
  89. package/dist/types/src/import/mermaid-facade.d.ts +0 -120
  90. package/dist/types/src/import/mermaid-importer.d.ts +0 -4
  91. package/dist/types/src/import/mermaid-sequence.d.ts +0 -8
  92. package/dist/types/src/import/scratch.d.ts +0 -3
  93. package/dist/types/src/lib/source-hash.d.ts +0 -7
  94. package/dist/types/src/model/candidates.d.ts +0 -53
  95. package/dist/types/src/model/embed.d.ts +0 -17
  96. package/dist/types/src/model/examples.d.ts +0 -15
  97. package/dist/types/src/model/label-hits.d.ts +0 -27
  98. package/dist/types/src/model/static-scene.d.ts +0 -15
  99. package/dist/types/src/state/commands.d.ts +0 -529
  100. package/dist/types/src/state/comparison.d.ts +0 -151
  101. package/dist/types/src/state/files.d.ts +0 -61
  102. package/dist/types/src/state/keyboard.d.ts +0 -6
  103. package/dist/types/src/state/launch.d.ts +0 -61
  104. package/dist/types/src/state/ui.d.ts +0 -39
@@ -1,2586 +0,0 @@
1
- import { g as A1 } from "./chunk-5VM5RSS4-CaKe4sjM.js";
2
- import { g as k1 } from "./chunk-XXDRQBXY-B-AMQgD2.js";
3
- import { s as E1 } from "./chunk-VQ5W62QI-CXRv7FiX.js";
4
- import { _ as k, o as e1, l as ae, c as Ce, p as C1, r as S1, u as Pt, b as x1, s as T1, q as D1, a as _1, g as v1, t as F1, m as V1, v as t1, J as s1, x as I1, y as Nt, k as Rt, z as L1, A as B1, B as M1, C as y1, D as w1, E as N1, F as R1, G as O1 } from "./mermaid.core-DXv6D2Sm.js";
5
- import { c as P1 } from "./chunk-55XCU76K-DkZUAaqC.js";
6
- import { c as G1 } from "./channel-qMvPU6eH.js";
7
- var et = {
8
- /**
9
- * Shape annotation that v0.8.1 does *not* remove explicitly but the
10
- * renderer doesn't recognise. The renderer falls back to roundedRect.
11
- * Distinct from `SHAPE_REMOVED`, which is a hard error.
12
- */
13
- SHAPE_UNSUPPORTED: "SHAPE_UNSUPPORTED",
14
- /**
15
- * Shape explicitly removed in v0.8.1 (§4.3.3): `doc`, `stadium`,
16
- * `terminal`, `circle`, `trapezoid`/`inv-trapezoid`, `double-circle`,
17
- * `typeDeclaration`, `procs`, the five per-kind instance shapes, plus
18
- * `cylinder`, `ellipse`, `odd`, `lean_left`. Hard error.
19
- */
20
- SHAPE_REMOVED: "SHAPE_REMOVED",
21
- /**
22
- * Edge operator removed in v0.8.1 (§5.1): `==>`, `~~`, `-.->`, plus
23
- * marker variants of `--` (`<-->`, `o--o`, `--o`, `-->>`). Hard error.
24
- *
25
- * Reserved — emitted by the semantics module, never by this package.
26
- */
27
- EDGE_OPERATOR_UNSUPPORTED: "EDGE_OPERATOR_UNSUPPORTED",
28
- /**
29
- * A label was authored on a `-.-` reference edge. Per §5.2 reference
30
- * edges carry no parameter/channel meaning so a label "would not mean
31
- * anything"; the label is ignored. Warn tier.
32
- *
33
- * Reserved — emitted by the semantics module, never by this package.
34
- */
35
- REFERENCE_EDGE_LABEL_REJECTED: "REFERENCE_EDGE_LABEL_REJECTED",
36
- /**
37
- * A `connectorRef` value's prefix (or whole bare-id form) doesn't
38
- * resolve to a declared `connector`. Per §8.1. Warn-only pre-1.0;
39
- * error from v1.0.
40
- *
41
- * Reserved — emitted by the semantics module, never by this package.
42
- */
43
- CONNECTOR_REF_UNRESOLVED: "CONNECTOR_REF_UNRESOLVED",
44
- /**
45
- * A `connectorRef` value resolves to an id that exists but isn't a
46
- * connector declaration (it's a vertex, flow, etc.). Per §8.1
47
- * connectors must be declared with the `connector` keyword. Warn pre-
48
- * 1.0; error from v1.0.
49
- *
50
- * Reserved — emitted by the semantics module, never by this package.
51
- */
52
- CONNECTOR_REF_NOT_A_CONNECTOR: "CONNECTOR_REF_NOT_A_CONNECTOR",
53
- /**
54
- * A known domain metadata key appears on an element kind it isn't
55
- * declared for per the §10 applicability table (e.g. `params` on a
56
- * `refdoc`, or `protocol` on a `flow`). Universal keys (`description`,
57
- * `instruction`, plus structural and presentation controls) are
58
- * excluded. Warn pre-1.0; error from v1.0.
59
- *
60
- * Reserved — emitted by the semantics module, never by this package.
61
- */
62
- METADATA_KEY_MISAPPLIED: "METADATA_KEY_MISAPPLIED",
63
- /**
64
- * Two declarations in the node-or-container namespace (§9) share an
65
- * id — e.g. two `a["..."]` vertex declarations, or a vertex and a
66
- * container with the same id. Implicit vertices created by edge
67
- * resolution do not count as declarations. Warn-only pre-1.0; error
68
- * from v1.0 behind `agentflow.strictIds`.
69
- *
70
- * Reserved — emitted by the semantics module, never by this package.
71
- */
72
- DUPLICATE_ID_NODE: "DUPLICATE_ID_NODE",
73
- /**
74
- * An author declared an id reserved for synthetic renderer output.
75
- * v0.8.1 keeps `connectors` reserved through pre-1.0 even though the
76
- * real `connector` keyword removes the synthesised group; reservation
77
- * stays for forward compat. Warn-only.
78
- *
79
- * Reserved — emitted by the semantics module, never by this package.
80
- */
81
- RESERVED_SYNTHETIC_ID: "RESERVED_SYNTHETIC_ID",
82
- /**
83
- * A container's child violates the §3.3 containment matrix. In v0.8.1
84
- * the matrix is trivial — only `flow` is a container, and it accepts
85
- * nested `flow` plus any node. Warn-only pre-1.0; error from v1.0
86
- * behind `agentflow.strictContainment`.
87
- */
88
- CONTAINMENT_VIOLATION: "CONTAINMENT_VIOLATION",
89
- /**
90
- * An edge's §5.1 semantic is incompatible with the kinds of its
91
- * endpoints. v0.8.1 covers two cases:
92
- *
93
- * - A `-.-` reference edge has no `refdoc`-shape endpoint (the only
94
- * meaningful target for §16.2 reference-document attachment).
95
- * - A `--x` failure edge originates from a non-flow endpoint.
96
- *
97
- * Warn-only pre-1.0; error from v1.0 behind the future
98
- * `agentflow.strictEdgeSemantics` flag.
99
- *
100
- * Reserved — emitted by the semantics module, never by this package.
101
- */
102
- EDGE_SEMANTIC_CONTRADICTION: "EDGE_SEMANTIC_CONTRADICTION",
103
- /**
104
- * A `flow` container's tree contains no input node (`shape: input`,
105
- * canonical `lean-right`). Per §10.2 a flow must declare its required
106
- * inputs; the runtime / editor prompts the user for any missing
107
- * values. Warn pre-1.0; error from v1.0.
108
- *
109
- * Reserved — emitted by the semantics module, never by this package.
110
- */
111
- FLOW_NO_INPUT: "FLOW_NO_INPUT"
112
- }, U1 = /* @__PURE__ */ new Set([
113
- et.SHAPE_UNSUPPORTED,
114
- et.SHAPE_REMOVED,
115
- et.CONTAINMENT_VIOLATION
116
- ]);
117
- new Set(
118
- Object.values(et).filter(
119
- (e) => !U1.has(e)
120
- )
121
- );
122
- var j1 = /* @__PURE__ */ new Map([
123
- ["task", "roundedRect"],
124
- ["tool", "subroutine"],
125
- ["input", "lean-right"],
126
- ["decision", "diamond"],
127
- ["refdoc", "lin-doc"],
128
- ["action", "hexagon"],
129
- ["round", "rect"]
130
- ]), z1 = /* @__PURE__ */ new Set([
131
- "doc",
132
- "stadium",
133
- "terminal",
134
- "circle",
135
- "trapezoid",
136
- "inv_trapezoid",
137
- "inv-trapezoid",
138
- "doublecircle",
139
- "double-circle",
140
- "typeDeclaration",
141
- "procs",
142
- "lean_left",
143
- "lean-left",
144
- "in-out",
145
- "cylinder",
146
- "ellipse",
147
- "odd",
148
- // Instance shapes — instancing mechanism removed entirely.
149
- "tag-rect",
150
- "tagged-rectangle",
151
- "delay",
152
- "half-rounded-rectangle",
153
- "lin-rect",
154
- "lined-rectangle",
155
- "win-pane",
156
- "window-pane",
157
- "curv-trap",
158
- "curved-trapezoid"
159
- ]), W1 = /* @__PURE__ */ new Set([
160
- "roundedRect",
161
- "subroutine",
162
- "subprocess",
163
- "subproc",
164
- "framed-rectangle",
165
- "lean-right",
166
- "diamond",
167
- "lin-doc",
168
- "lined-document",
169
- "hexagon",
170
- "hex",
171
- "connector",
172
- // Collapsed flow container
173
- "collapsedGroup"
174
- ]), Ze = "roundedRect";
175
- function $e(e) {
176
- return e && (j1.get(e) ?? e);
177
- }
178
- k($e, "resolveShapeAlias");
179
- function n1(e, i) {
180
- for (const n of e)
181
- if (!n.isGroup) {
182
- if ((!n.shape || n.shape === "squareRect" || n.shape === "rect") && (n.shape = Ze), z1.has(n.shape)) {
183
- const r = `shape "${n.shape}" was removed in v0.8.1, using "${Ze}"`;
184
- i?.emitError ? i.emitError("SHAPE_REMOVED", r, { nodeId: n.id }) : ae.warn(`agentflow: ${r}`), n.shape = Ze;
185
- continue;
186
- }
187
- if (!W1.has(n.shape)) {
188
- const r = `shape "${n.shape}" is not supported, using "${Ze}"`;
189
- i?.emitWarning ? i.emitWarning("SHAPE_UNSUPPORTED", r, { nodeId: n.id }) : ae.warn(`agentflow: ${r}`), n.shape = Ze;
190
- }
191
- }
192
- }
193
- k(n1, "normaliseNodeShapes");
194
- var It = /* @__PURE__ */ new Map([
195
- ["tool", 0],
196
- ["task", 1],
197
- ["decision", 2],
198
- ["input", 3],
199
- ["refdoc", 4],
200
- ["connector", 5],
201
- ["action", 6]
202
- ]), r1 = It.size, a1 = /* @__PURE__ */ k((e) => `af-kind-${e}`, "kindClass"), K1 = [...It.keys()], o1 = /* @__PURE__ */ k((e) => Math.max(1, e - r1), "containerSlotCount"), u1 = /* @__PURE__ */ k((e, i) => {
203
- const n = r1 + e % o1(i);
204
- return i > 0 ? n % i : n;
205
- }, "containerSlot");
206
- function l1(e, i, n) {
207
- const r = Ce().themeVariables?.borderColorArray, u = Array.isArray(r) ? r.length : 0;
208
- let l = n.size;
209
- for (const a of e ?? []) {
210
- if (a.isGroup || a.shape === "collapsedGroup") {
211
- const f = n.get(String(a.id)) ?? l++;
212
- a.colorIndex = u1(f, u);
213
- continue;
214
- }
215
- const c = i(String(a.id));
216
- c && It.has(c) && (a.cssClasses = `${a.cssClasses ?? ""} ${a1(c)}`.replace(/\s+/g, " ").trim());
217
- }
218
- }
219
- k(l1, "assignColorSlots");
220
- var i1 = "agentflow-", Ot = /* @__PURE__ */ new Set([
221
- "shape",
222
- "view",
223
- "icon",
224
- "img",
225
- "form",
226
- "pos",
227
- "w",
228
- "h",
229
- "class",
230
- "style",
231
- "labelType"
232
- ]), H1 = /* @__PURE__ */ new Set([
233
- "subroutine",
234
- "subprocess",
235
- "subproc",
236
- "framed-rectangle",
237
- "tool"
238
- ]), Y1 = {
239
- flow: "flowGroup"
240
- };
241
- function Vt(e) {
242
- if (Array.isArray(e))
243
- return e.map((n) => Vt(n));
244
- if (e === null || typeof e != "object")
245
- return e;
246
- const i = {};
247
- for (const n of Object.keys(e))
248
- n === "__proto__" || n === "constructor" || n === "prototype" || (i[n] = Vt(e[n]));
249
- return i;
250
- }
251
- k(Vt, "stripPrototypeKeys");
252
- function c1(e) {
253
- let i = !1, n = !1, r = 0, u;
254
- const l = [];
255
- for (const a of e.split(`
256
- `)) {
257
- if (u !== void 0) {
258
- const g = a.length - a.trimStart().length;
259
- if (a.trim() === "" || g > u) {
260
- l.push(a);
261
- continue;
262
- }
263
- u = void 0;
264
- }
265
- let c = -1;
266
- for (let g = 0; g < a.length; g++) {
267
- const b = a[g];
268
- if (n)
269
- b === "\\" ? g++ : b === '"' && (n = !1);
270
- else if (i)
271
- b === "'" && (i = !1);
272
- else if (b === '"')
273
- n = !0;
274
- else if (b === "'")
275
- i = !0;
276
- else if (b === "#" && (g === 0 || a[g - 1] === " " || a[g - 1] === " ")) {
277
- c = g;
278
- break;
279
- } else b === "[" || b === "{" ? r++ : (b === "]" || b === "}") && (r = Math.max(0, r - 1));
280
- }
281
- if (i || n || r > 0) {
282
- l.push(a);
283
- continue;
284
- }
285
- const f = c >= 0 ? a.slice(0, c) : a, p = c >= 0 ? a.slice(c) : "";
286
- if (/:\s*[>|][\d+-]*\s*$/.test(f)) {
287
- u = a.length - a.trimStart().length, l.push(a);
288
- continue;
289
- }
290
- l.push(f.replace(/,([\t ]*)$/, "$1") + p);
291
- }
292
- return l.join(`
293
- `);
294
- }
295
- k(c1, "stripLineTrailingCommas");
296
- var q1 = class {
297
- // cspell:ignore funs
298
- constructor() {
299
- this.vertexCounter = 0, this.config = Ce(), this.vertices = /* @__PURE__ */ new Map(), this.edges = [], this.classes = /* @__PURE__ */ new Map(), this.subGraphs = [], this.subGraphLookup = /* @__PURE__ */ new Map(), this.globalNodes = /* @__PURE__ */ new Set(), this.connectors = /* @__PURE__ */ new Map(), this.tooltips = /* @__PURE__ */ new Map(), this.subCount = 0, this.firstGraphFlag = !0, this.secCount = -1, this.posCrossRef = [], this.diagramId = "", this.preserveCommentsWhenParsing = !0, this.frontmatterLineOffset = 0, this.elementMappings = [], this.bareVertexMappings = /* @__PURE__ */ new WeakSet(), this.diagnostics = [], this.postParseValidationRun = !1, this.funs = [], this.setAccTitle = x1, this.setAccDescription = T1, this.setDiagramTitle = D1, this.getAccTitle = _1, this.getAccDescription = v1, this.getDiagramTitle = F1, this.funs.push(this.setupToolTips.bind(this)), this.addVertex = this.addVertex.bind(this), this.firstGraph = this.firstGraph.bind(this), this.setDirection = this.setDirection.bind(this), this.addSubGraph = this.addSubGraph.bind(this), this.addGlobal = this.addGlobal.bind(this), this.addConnector = this.addConnector.bind(this), this.addConnectorMapping = this.addConnectorMapping.bind(this), this.addLink = this.addLink.bind(this), this.setLink = this.setLink.bind(this), this.updateLink = this.updateLink.bind(this), this.addClass = this.addClass.bind(this), this.setClass = this.setClass.bind(this), this.destructLink = this.destructLink.bind(this), this.setClickEvent = this.setClickEvent.bind(this), this.setTooltip = this.setTooltip.bind(this), this.updateLinkInterpolate = this.updateLinkInterpolate.bind(this), this.setClickFun = this.setClickFun.bind(this), this.bindFunctions = this.bindFunctions.bind(this), this.setFrontmatterLineOffset = this.setFrontmatterLineOffset.bind(this), this.addVertexMapping = this.addVertexMapping.bind(this), this.extendVertexMapping = this.extendVertexMapping.bind(this), this.addEdgeMapping = this.addEdgeMapping.bind(this), this.addSubgraphMapping = this.addSubgraphMapping.bind(this), this.emitWarning = this.emitWarning.bind(this), this.emitError = this.emitError.bind(this), this.getDiagnostics = this.getDiagnostics.bind(this), this.lex = {
300
- firstGraph: this.firstGraph.bind(this)
301
- }, this.clear(), this.setGen("gen-2");
302
- }
303
- static {
304
- k(this, "AgentFlowDB");
305
- }
306
- sanitizeText(e) {
307
- return V1.sanitizeText(e, this.config);
308
- }
309
- sanitizeNodeLabelType(e) {
310
- switch (e) {
311
- case "markdown":
312
- case "string":
313
- case "text":
314
- return e;
315
- default:
316
- return "markdown";
317
- }
318
- }
319
- /**
320
- * Sets the diagram's SVG element ID, used to prefix domIds for uniqueness
321
- * across multiple diagrams on the same page.
322
- */
323
- setDiagramId(e) {
324
- this.diagramId = e;
325
- }
326
- /**
327
- * Function to lookup domId from id in the graph definition.
328
- * When diagramId is set, returns the prefixed version for DOM uniqueness.
329
- *
330
- * @param id - id of the node
331
- */
332
- lookUpDomId(e) {
333
- for (const i of this.vertices.values())
334
- if (i.id === e)
335
- return this.diagramId ? `${this.diagramId}-${i.domId}` : i.domId;
336
- return this.diagramId ? `${this.diagramId}-${e}` : e;
337
- }
338
- /**
339
- * Function called by parser when a node definition has been found
340
- */
341
- addVertex(e, i, n, r, u, l, a = {}, c, f) {
342
- if (!e || e.trim().length === 0)
343
- return;
344
- let p;
345
- if (c !== void 0) {
346
- let m;
347
- c.includes(`
348
- `) ? m = c + `
349
- ` : m = `{
350
- ` + c + `
351
- }`;
352
- try {
353
- p = t1(m, { schema: s1 }) ?? {};
354
- } catch (d) {
355
- const h = c.includes(`
356
- `) ? c1(c) : c;
357
- if (h !== c)
358
- try {
359
- p = t1(h + `
360
- `, { schema: s1 }) ?? {};
361
- } catch {
362
- this.rethrowMetadataYamlError(d, c, f);
363
- }
364
- else
365
- this.rethrowMetadataYamlError(d, c, f);
366
- }
367
- p = Vt(p);
368
- }
369
- let g;
370
- if (p && typeof p.shape == "string") {
371
- const m = p;
372
- g = m.shape;
373
- const d = $e(g);
374
- d && d !== g && (m.shape = d);
375
- }
376
- const b = this.subGraphLookup.get(e);
377
- if (b && p) {
378
- b.metadata = { ...b.metadata, ...p };
379
- return;
380
- }
381
- const _ = this.connectors.get(e);
382
- if (_ && p) {
383
- _.metadata = {
384
- ..._.metadata,
385
- ...p
386
- };
387
- return;
388
- }
389
- if (e === "connectors")
390
- return;
391
- const S = this.edges.find((m) => m.id === e);
392
- if (S) {
393
- const m = p;
394
- m?.animate !== void 0 && (S.animate = m.animate), m?.animation !== void 0 && (S.animation = m.animation), m?.curve !== void 0 && (S.interpolate = m.curve), p && (S.metadata = { ...S.metadata, ...p });
395
- return;
396
- }
397
- let B, T = this.vertices.get(e);
398
- if (T === void 0 && (T = {
399
- id: e,
400
- labelType: "text",
401
- domId: i1 + e + "-" + this.vertexCounter,
402
- styles: [],
403
- classes: []
404
- }, this.vertices.set(e, T)), this.vertexCounter++, i !== void 0 ? (this.config = Ce(), B = this.sanitizeText(i.text.trim()), T.labelType = i.type, B.startsWith('"') && B.endsWith('"') && (B = B.substring(1, B.length - 1)), T.text = B) : T.text === void 0 && (T.text = e), n !== void 0 && (T.type = n), r?.forEach((m) => {
405
- T.styles.push(m);
406
- }), u?.forEach((m) => {
407
- T.classes.push(m);
408
- }), l !== void 0 && (T.dir = l), T.props === void 0 ? T.props = a : a !== void 0 && Object.assign(T.props, a), p) {
409
- if (T.metadata = { ...T.metadata, ...p }, p.shape) {
410
- const m = g ?? p.shape;
411
- if (typeof m != "string")
412
- throw this.positionedShapeError(
413
- `No such shape: ${JSON.stringify(m)}.`,
414
- f
415
- );
416
- if (m !== m.toLowerCase() || m.includes("_"))
417
- throw this.positionedShapeError(
418
- `No such shape: ${m}. Shape names should be lowercase.`,
419
- f
420
- );
421
- if (!I1(p.shape))
422
- throw this.positionedShapeError(`No such shape: ${p.shape}.`, f);
423
- T.type = p?.shape;
424
- }
425
- p?.label && (T.text = this.sanitizeText(p.label), T.labelType = this.sanitizeNodeLabelType(p?.labelType));
426
- }
427
- }
428
- /**
429
- * Translate a js-yaml failure raised while parsing an `<id>@{ ... }` block
430
- * from block-relative coordinates into absolute source coordinates, then
431
- * rethrow (issue #56 part 2).
432
- *
433
- * js-yaml's `mark.line` / `mark.column` (and the `(R:C)` reference plus the
434
- * `N |` excerpt prefixes baked into `message`) count from the start of the
435
- * block buffer the DB hands it — either the synthetic `{\n … \n}` wrapper
436
- * (single-line `@{ … }`) or the verbatim multi-line body. Neither matches
437
- * the line the user sees. Using the `shapeData` symbol's JISON location
438
- * (`@{`'s position) plus the frontmatter offset, we map the reported
439
- * coordinate back to source space, rewrite the message's `(R:C)` and excerpt
440
- * prefixes, update `mark`, and attach a JISON-style `hash.loc` so downstream
441
- * tooling can read source coordinates structurally instead of re-deriving
442
- * them from the buffer.
443
- *
444
- * Defensive: if the error isn't a positioned js-yaml exception, or we lack
445
- * the block location, the original error propagates untouched — translation
446
- * never makes a failure harder to read than it already was.
447
- */
448
- /**
449
- * Build a shape error carrying a JISON-shaped `hash.loc`, so the position is
450
- * readable structurally rather than only as prose. Mirrors what
451
- * `rethrowMetadataYamlError` attaches for YAML failures.
452
- */
453
- positionedShapeError(e, i) {
454
- const n = new Error(e);
455
- if (!i)
456
- return n;
457
- const r = i.first_line + this.frontmatterLineOffset;
458
- return Object.assign(n, {
459
- hash: {
460
- text: "",
461
- token: null,
462
- line: r - 1,
463
- loc: {
464
- first_line: r,
465
- last_line: i.last_line + this.frontmatterLineOffset,
466
- first_column: i.first_column,
467
- last_column: i.last_column
468
- },
469
- expected: []
470
- }
471
- }), n;
472
- }
473
- rethrowMetadataYamlError(e, i, n) {
474
- const r = e;
475
- if (!r || r.name !== "YAMLException" || !r.mark || !n)
476
- throw e;
477
- let u;
478
- try {
479
- const l = !i.includes(`
480
- `), a = l ? `{
481
- ` + i + `
482
- }` : i + `
483
- `, c = n.first_line + this.frontmatterLineOffset, f = n.first_column + 2, p = /* @__PURE__ */ k((m, d) => l ? { line: c, column: f + (m === 1 ? d : 0) } : {
484
- line: c + m,
485
- column: m === 0 ? f + d : d
486
- }, "toSource"), g = p(r.mark.line, r.mark.column), b = r.reason ?? (r.message ?? "").split(`
487
- `)[0].replace(/\s*\(\d+:\d+\)\s*$/, ""), _ = a.split(`
488
- `), S = [];
489
- if (l)
490
- S.push(1);
491
- else
492
- for (let m = r.mark.line - 1; m <= r.mark.line + 1; m++)
493
- m < 0 || m >= _.length || m === _.length - 1 && _[m] === "" && m !== r.mark.line || S.push(m);
494
- const B = Math.max(...S.map((m) => String(p(m, 0).line).length)), T = [];
495
- for (const m of S) {
496
- const d = p(m, 0).line, h = ` ${String(d).padStart(B)} | `;
497
- T.push(h + _[m].replace(/\t/g, "→")), m === r.mark.line && T.push("-".repeat(h.length + r.mark.column) + "^");
498
- }
499
- u = {
500
- message: `${b} (${g.line}:${g.column + 1})
501
-
502
- ${T.join(`
503
- `)}`,
504
- markLine: g.line - 1,
505
- markColumn: g.column,
506
- // JISON-style hash so editors can consume source coordinates directly.
507
- hash: {
508
- text: "",
509
- token: null,
510
- line: g.line - 1,
511
- loc: {
512
- first_line: g.line,
513
- last_line: g.line,
514
- first_column: g.column,
515
- last_column: g.column + 1
516
- },
517
- expected: []
518
- }
519
- };
520
- } catch {
521
- }
522
- throw u && (r.message = u.message, r.mark.line = u.markLine, r.mark.column = u.markColumn, r.hash = u.hash), r;
523
- }
524
- /**
525
- * Function called by parser when a link/edge definition has been found
526
- *
527
- */
528
- addSingleLink(e, i, n, r) {
529
- const a = {
530
- start: e,
531
- end: i,
532
- type: void 0,
533
- text: "",
534
- labelType: "text",
535
- classes: [],
536
- isUserDefinedId: !1,
537
- interpolate: this.edges.defaultInterpolate
538
- };
539
- ae.info("abc78 Got edge...", a);
540
- const c = n.text;
541
- if (c !== void 0 && (a.text = this.sanitizeText(c.text.trim()), a.text.startsWith('"') && a.text.endsWith('"') && (a.text = a.text.substring(1, a.text.length - 1)), a.labelType = this.sanitizeNodeLabelType(c.type)), n !== void 0 && (a.type = n.type, a.stroke = n.stroke, a.length = n.length > 10 ? 10 : n.length, n.edgeSemantic && (a.edgeSemantic = n.edgeSemantic)), r && !this.edges.some((f) => f.id === r))
542
- a.id = r, a.isUserDefinedId = !0;
543
- else {
544
- const f = this.edges.filter((p) => p.start === a.start && p.end === a.end);
545
- f.length === 0 ? a.id = Nt(a.start, a.end, { counter: 0, prefix: "L" }) : a.id = Nt(a.start, a.end, {
546
- counter: f.length + 1,
547
- prefix: "L"
548
- });
549
- }
550
- if (this.edges.length < (this.config.maxEdges ?? 500))
551
- ae.info("Pushing edge..."), this.edges.push(a);
552
- else
553
- throw new Error(
554
- `Edge limit exceeded. ${this.edges.length} edges found, but the limit is ${this.config.maxEdges}.
555
-
556
- Initialize mermaid with maxEdges set to a higher number to allow more edges.
557
- You cannot set this config via configuration inside the diagram as it is a secure config.
558
- You have to call mermaid.initialize.`
559
- );
560
- }
561
- isLinkData(e) {
562
- return e !== null && typeof e == "object" && "id" in e && typeof e.id == "string";
563
- }
564
- addLink(e, i, n) {
565
- const r = this.isLinkData(n) ? n.id.replace("@", "") : void 0;
566
- ae.info("addLink", e, i, r);
567
- for (const u of e)
568
- for (const l of i) {
569
- const a = u === e[e.length - 1], c = l === i[0];
570
- a && c ? this.addSingleLink(u, l, n, r) : this.addSingleLink(u, l, n, void 0);
571
- }
572
- }
573
- /**
574
- * Updates a link's line interpolation algorithm
575
- */
576
- updateLinkInterpolate(e, i) {
577
- e.forEach((n) => {
578
- if (n === "default") {
579
- this.edges.defaultInterpolate = i;
580
- return;
581
- }
582
- if (typeof n == "number" && n >= this.edges.length)
583
- throw new Error(
584
- `The index ${n} for linkStyle is out of bounds. Valid indices for linkStyle are between 0 and ${this.edges.length - 1}. (Help: Ensure that the index is within the range of existing edges.)`
585
- );
586
- this.edges[n].interpolate = i;
587
- });
588
- }
589
- /**
590
- * Updates a link with a style
591
- *
592
- */
593
- updateLink(e, i) {
594
- e.forEach((n) => {
595
- if (typeof n == "number" && n >= this.edges.length)
596
- throw new Error(
597
- `The index ${n} for linkStyle is out of bounds. Valid indices for linkStyle are between 0 and ${this.edges.length - 1}. (Help: Ensure that the index is within the range of existing edges.)`
598
- );
599
- n === "default" ? this.edges.defaultStyle = i : (this.edges[n].style = i, (this.edges[n]?.style?.length ?? 0) > 0 && !this.edges[n]?.style?.some((r) => r?.startsWith("fill")) && this.edges[n]?.style?.push("fill:none"));
600
- });
601
- }
602
- addClass(e, i) {
603
- const n = i.join().replace(/\\,/g, "§§§").replace(/,/g, ";").replace(/§§§/g, ",").split(";");
604
- e.split(",").forEach((r) => {
605
- let u = this.classes.get(r);
606
- u === void 0 && (u = { id: r, styles: [], textStyles: [] }, this.classes.set(r, u)), n?.forEach((l) => {
607
- if (/color/.exec(l)) {
608
- const a = l.replace("fill", "bgFill");
609
- u.textStyles.push(a);
610
- }
611
- u.styles.push(l);
612
- });
613
- });
614
- }
615
- /**
616
- * Called by parser when a graph definition is found, stores the direction of the chart.
617
- *
618
- */
619
- setDirection(e) {
620
- this.direction = e.trim(), /.*</.exec(this.direction) && (this.direction = "RL"), /.*\^/.exec(this.direction) && (this.direction = "BT"), /.*>/.exec(this.direction) && (this.direction = "LR"), /.*v/.exec(this.direction) && (this.direction = "TB"), this.direction === "TD" && (this.direction = "TB");
621
- }
622
- /**
623
- * Called by parser when a special node is found, e.g. a clickable element.
624
- *
625
- * @param ids - Comma separated list of ids
626
- * @param className - Class to add
627
- */
628
- setClass(e, i) {
629
- for (const n of e.split(",")) {
630
- const r = this.vertices.get(n);
631
- r && r.classes.push(i);
632
- const u = this.edges.find((a) => a.id === n);
633
- u && u.classes.push(i);
634
- const l = this.subGraphLookup.get(n);
635
- l && l.classes.push(i);
636
- }
637
- }
638
- setTooltip(e, i) {
639
- if (i !== void 0) {
640
- i = this.sanitizeText(i);
641
- for (const n of e.split(","))
642
- this.tooltips.set(this.version === "gen-1" ? this.lookUpDomId(n) : n, i);
643
- }
644
- }
645
- setClickFun(e, i, n) {
646
- if (Ce().securityLevel !== "loose" || i === void 0)
647
- return;
648
- let r = [];
649
- if (typeof n == "string") {
650
- r = n.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);
651
- for (let l = 0; l < r.length; l++) {
652
- let a = r[l].trim();
653
- a.startsWith('"') && a.endsWith('"') && (a = a.substr(1, a.length - 2)), r[l] = a;
654
- }
655
- }
656
- r.length === 0 && r.push(e);
657
- const u = this.vertices.get(e);
658
- u && (u.haveCallback = !0, this.funs.push(() => {
659
- const l = this.lookUpDomId(e), a = document.querySelector(`[id="${l}"]`);
660
- a !== null && a.addEventListener(
661
- "click",
662
- () => {
663
- Pt.runFunc(i, ...r);
664
- },
665
- !1
666
- );
667
- }));
668
- }
669
- /**
670
- * Called by parser when a link is found. Adds the URL to the vertex data.
671
- *
672
- * @param ids - Comma separated list of ids
673
- * @param linkStr - URL to create a link for
674
- * @param target - Target attribute for the link
675
- */
676
- setLink(e, i, n) {
677
- e.split(",").forEach((r) => {
678
- const u = this.vertices.get(r);
679
- u !== void 0 && (u.link = Pt.formatUrl(i, this.config), u.linkTarget = n);
680
- }), this.setClass(e, "clickable");
681
- }
682
- getTooltip(e) {
683
- return this.tooltips.get(e);
684
- }
685
- /**
686
- * Called by parser when a click definition is found. Registers an event handler.
687
- *
688
- * @param ids - Comma separated list of ids
689
- * @param functionName - Function to be called on click
690
- * @param functionArgs - Arguments to be passed to the function
691
- */
692
- setClickEvent(e, i, n) {
693
- e.split(",").forEach((r) => {
694
- this.setClickFun(r, i, n);
695
- }), this.setClass(e, "clickable");
696
- }
697
- bindFunctions(e) {
698
- this.funs.forEach((i) => {
699
- i(e);
700
- });
701
- }
702
- getDirection() {
703
- return this.direction?.trim();
704
- }
705
- /**
706
- * Retrieval function for fetching the found nodes after parsing has completed.
707
- *
708
- */
709
- getVertices() {
710
- return this.vertices;
711
- }
712
- /**
713
- * Retrieval function for fetching the found links after parsing has completed.
714
- *
715
- */
716
- getEdges() {
717
- return this.edges;
718
- }
719
- /**
720
- * Returns true when `vertex` is a **tool definition** per
721
- * the agentflow syntax specification §8 — its resolved shape is `subroutine` or one
722
- * of the accepted aliases (`subprocess`, `subproc`, `framed-rectangle`).
723
- *
724
- * This is the source of truth for "is this a tool?" — there is no
725
- * separate kind tag stored on the vertex; tool-ness is derived from
726
- * shape on every check. Downstream consumers reading the semantic model
727
- * see this surfaced as `vertexKind: 'tool'` (see `getSemanticModel`).
728
- */
729
- isToolDefinition(e) {
730
- return H1.has(e.type);
731
- }
732
- /**
733
- * Returns every vertex that is a tool definition (per `isToolDefinition`).
734
- * Derived view; not cached.
735
- */
736
- getTools() {
737
- const e = [];
738
- for (const i of this.vertices.values())
739
- this.isToolDefinition(i) && e.push(i);
740
- return e;
741
- }
742
- /**
743
- * Retrieval function for fetching the found class definitions after parsing has completed.
744
- *
745
- */
746
- getClasses() {
747
- return this.classes;
748
- }
749
- setupToolTips(e) {
750
- const i = P1();
751
- Rt(e).select("svg").selectAll("g.node").on("mouseover", (u) => {
752
- const l = Rt(u.currentTarget), a = l.attr("title");
753
- if (a === null)
754
- return;
755
- const c = u.currentTarget?.getBoundingClientRect();
756
- i.transition().duration(200).style("opacity", ".9"), i.text(l.attr("title")).style("left", window.scrollX + c.left + (c.right - c.left) / 2 + "px").style("top", window.scrollY + c.bottom + "px"), i.html(L1.sanitize(a)), l.classed("hover", !0);
757
- }).on("mouseout", (u) => {
758
- i.transition().duration(500).style("opacity", 0), Rt(u.currentTarget).classed("hover", !1);
759
- });
760
- }
761
- /**
762
- * Clears the internal graph db so that a new graph can be parsed.
763
- *
764
- */
765
- clear(e = "gen-2") {
766
- this.vertices = /* @__PURE__ */ new Map(), this.classes = /* @__PURE__ */ new Map(), this.edges = [], this.funs = [this.setupToolTips.bind(this)], this.subGraphs = [], this.subGraphLookup = /* @__PURE__ */ new Map(), this.globalNodes = /* @__PURE__ */ new Set(), this.connectors = /* @__PURE__ */ new Map(), this.subCount = 0, this.tooltips = /* @__PURE__ */ new Map(), this.firstGraphFlag = !0, this.version = e, this.config = Ce(), this.diagramId = "", this.vertexCounter = 0, this.direction = void 0, this.secCount = -1, this.posCrossRef = [], this.frontmatterLineOffset = 0, this.elementMappings = [], this.bareVertexMappings = /* @__PURE__ */ new WeakSet(), this.diagnostics = [], this.postParseValidationRun = !1, B1();
767
- }
768
- setGen(e) {
769
- this.version = e || "gen-2";
770
- }
771
- /**
772
- * Legacy `linkStyle default` colours, byte-identical to `flowDb`. Hardcoded
773
- * rather than theme-derived on purpose: nothing in the repo calls this, and
774
- * changing the values would diverge from flowchart for no visible gain.
775
- */
776
- defaultStyle() {
777
- return "fill:#ffa;stroke: #f66; stroke-width: 3px; stroke-dasharray: 5, 5;fill:#ffa;stroke: #666;";
778
- }
779
- addSubGraph(e, i, n, r) {
780
- let u = e?.text?.trim(), l = n?.text;
781
- e === n && n?.text && /\s/.exec(n.text) && (u = void 0);
782
- const c = (/* @__PURE__ */ k((S) => {
783
- const B = { boolean: {}, number: {}, string: {} }, T = [];
784
- let m;
785
- return { nodeList: S.filter(function(h) {
786
- const x = typeof h;
787
- return h.stmt && h.stmt === "dir" ? (m = h.value, !1) : h.trim() === "" ? !1 : x in B ? B[x].hasOwnProperty(h) ? !1 : B[x][h] = !0 : T.includes(h) ? !1 : T.push(h);
788
- }), dir: m };
789
- }, "uniq"))(i.flat()), f = c.nodeList;
790
- let p = c.dir;
791
- const g = Ce().flowchart ?? {};
792
- if (p = p ?? (g.inheritDir ? this.getDirection() ?? Ce().direction ?? void 0 : void 0), this.version === "gen-1")
793
- for (let S = 0; S < f.length; S++)
794
- f[S] = this.lookUpDomId(f[S]);
795
- u = u ?? "subGraph" + this.subCount, l = l || "", l = this.sanitizeText(l), this.subCount = this.subCount + 1;
796
- const b = {
797
- id: u,
798
- // A subgraph is never a member of itself. In-block edge endpoints are
799
- // folded into the member list, so `a --> myFlow` written inside
800
- // `flow myFlow … end` would otherwise make the flow its own member and
801
- // self-parent, crashing the renderer with graphlib's "would create a
802
- // cycle" (issue #70). Globally scoped nodes (`global … end`, issue #80)
803
- // are exempt from membership the same way — referencing one inside a
804
- // flow must not adopt it.
805
- nodes: f.filter((S) => S !== u && !this.globalNodes.has(S)),
806
- title: l.trim(),
807
- classes: [],
808
- dir: p,
809
- labelType: this.sanitizeNodeLabelType(n?.type),
810
- type: r ?? "flow"
811
- };
812
- ae.info("Adding", b.id, b.nodes, b.dir), b.nodes = this.makeUniq(b, this.subGraphs).nodes;
813
- const _ = this.getPosForId(u);
814
- if (_ !== -1) {
815
- const S = this.subGraphs[_];
816
- for (const B of b.nodes)
817
- S.nodes.includes(B) || S.nodes.push(B);
818
- b.title && (S.title = b.title), b.dir && (S.dir = b.dir), b.type && (S.type = b.type), this.subGraphLookup.set(u, S);
819
- } else
820
- this.subGraphs.push(b), this.subGraphLookup.set(u, b);
821
- return u;
822
- }
823
- /**
824
- * Registers every node id that appears inside a `global … end` block as
825
- * globally scoped (issue #80): the node keeps no parent even when it is
826
- * referenced inside a `flow … end` block, opting out of the textual
827
- * membership rule that would otherwise pull it in. Edges declared inside
828
- * the block are ordinary top-level edges — only the membership exemption
829
- * is recorded here, and no container is emitted for the block.
830
- */
831
- addGlobal(e) {
832
- for (const i of e.flat()) {
833
- if (typeof i != "string")
834
- continue;
835
- const n = i.trim();
836
- n !== "" && this.globalNodes.add(n);
837
- }
838
- for (const i of this.subGraphs)
839
- i.nodes = i.nodes.filter((n) => !this.globalNodes.has(n));
840
- }
841
- getPosForId(e) {
842
- for (const [i, n] of this.subGraphs.entries())
843
- if (n.id === e)
844
- return i;
845
- return -1;
846
- }
847
- indexNodes2(e, i) {
848
- const n = this.subGraphs[i].nodes;
849
- if (this.secCount = this.secCount + 1, this.secCount > 2e3)
850
- return {
851
- result: !1,
852
- count: 0
853
- };
854
- if (this.posCrossRef[this.secCount] = i, this.subGraphs[i].id === e)
855
- return {
856
- result: !0,
857
- count: 0
858
- };
859
- let r = 0, u = 1;
860
- for (; r < n.length; ) {
861
- const l = this.getPosForId(n[r]);
862
- if (l >= 0) {
863
- const a = this.indexNodes2(e, l);
864
- if (a.result)
865
- return {
866
- result: !0,
867
- count: u + a.count
868
- };
869
- u = u + a.count;
870
- }
871
- r = r + 1;
872
- }
873
- return {
874
- result: !1,
875
- count: u
876
- };
877
- }
878
- getDepthFirstPos(e) {
879
- return this.posCrossRef[e];
880
- }
881
- indexNodes() {
882
- this.secCount = -1, this.subGraphs.length > 0 && this.indexNodes2("none", this.subGraphs.length - 1);
883
- }
884
- /**
885
- * Called by parser when a `connector <id>["Title"]` declaration is
886
- * encountered (§8). Stores the connector as a FlowVertex with
887
- * `isConnector: true` so the connector flows through the renderer
888
- * alongside vertices, while keeping a separate index for connector-
889
- * specific lookups (e.g. `connectorRef` resolution).
890
- */
891
- addConnector(e, i) {
892
- const n = e?.text?.trim();
893
- if (!n)
894
- return "";
895
- const r = i?.text?.trim() ?? "", u = r.length > 0 ? this.sanitizeText(r) : n;
896
- let l = this.connectors.get(n);
897
- return l ? r.length > 0 && (l.text = u) : (l = {
898
- id: n,
899
- labelType: "text",
900
- domId: i1 + n + "-" + this.vertexCounter,
901
- styles: [],
902
- classes: [],
903
- isConnector: !0,
904
- text: u
905
- }, this.connectors.set(n, l), this.vertices.set(n, l), this.vertexCounter++), n;
906
- }
907
- /**
908
- * Live array. `getData()` and the JISON actions read it on the hot path and a
909
- * per-call copy would be wasted work; unlike `getDiagnostics()` this is not an
910
- * accessor built for external consumers. Same for `getVertices()` /
911
- * `getEdges()`, whose `defaultStyle` / `defaultInterpolate` side-properties a
912
- * copy would drop.
913
- */
914
- getSubGraphs() {
915
- return this.subGraphs;
916
- }
917
- /** Returns connectors declared via the `connector` keyword (§8). */
918
- getConnectors() {
919
- return [...this.connectors.values()];
920
- }
921
- firstGraph() {
922
- return this.firstGraphFlag ? (this.firstGraphFlag = !1, !0) : !1;
923
- }
924
- /**
925
- * Maps the post-`destructLink` `(type, stroke)` pair onto the canonical
926
- * `edgeSemantic` value defined by the agentflow syntax specification §5.1 (v0.8.1).
927
- * The three-way table:
928
- * - `-->` → arrow_point + normal → sequence
929
- * - `-.-` → arrow_open + dotted → reference
930
- * - `--x` → arrow_cross + normal → failure
931
- * Returns `undefined` for combinations the spec no longer permits.
932
- */
933
- computeEdgeSemantic(e, i) {
934
- if (e === "arrow_point" && i === "normal")
935
- return "sequence";
936
- if (e === "arrow_cross" && i === "normal")
937
- return "failure";
938
- if (e === "arrow_open" && i === "dotted")
939
- return "reference";
940
- }
941
- destructStartLink(e) {
942
- const i = e.trim(), n = "arrow_open";
943
- let r = "normal";
944
- return i.includes(".") && (r = "dotted"), { type: n, stroke: r };
945
- }
946
- countChar(e, i) {
947
- const n = i.length;
948
- let r = 0;
949
- for (let u = 0; u < n; ++u)
950
- i[u] === e && ++r;
951
- return r;
952
- }
953
- destructEndLink(e) {
954
- const i = e.trim();
955
- let n = i.slice(0, -1), r = "arrow_open";
956
- switch (i.slice(-1)) {
957
- case "x":
958
- r = "arrow_cross";
959
- break;
960
- case ">":
961
- r = "arrow_point";
962
- break;
963
- case "-":
964
- case ".":
965
- r = "arrow_open", n = i;
966
- break;
967
- }
968
- let u = "normal", l = n.length - 1;
969
- const a = this.countChar(".", n);
970
- return a > 0 && (u = "dotted", l = a), { type: r, stroke: u, length: l };
971
- }
972
- destructLink(e, i) {
973
- const n = this.destructEndLink(e);
974
- let r;
975
- return i ? (r = this.destructStartLink(i), r.stroke !== n.stroke ? { type: "INVALID", stroke: "INVALID" } : (r.type = n.type, r.length = n.length, {
976
- ...r,
977
- edgeSemantic: this.computeEdgeSemantic(
978
- r.type,
979
- r.stroke
980
- )
981
- })) : {
982
- ...n,
983
- edgeSemantic: this.computeEdgeSemantic(n.type, n.stroke)
984
- };
985
- }
986
- // Todo optimizer this by caching existing nodes
987
- exists(e, i) {
988
- for (const n of e)
989
- if (n.nodes.includes(i))
990
- return !0;
991
- return !1;
992
- }
993
- /**
994
- * Deletes an id from all subgraphs
995
- *
996
- */
997
- makeUniq(e, i) {
998
- const n = [];
999
- return e.nodes.forEach((r, u) => {
1000
- this.exists(i, r) || n.push(e.nodes[u]);
1001
- }), { nodes: n };
1002
- }
1003
- getTypeFromVertex(e) {
1004
- const i = typeof e.type == "string" ? $e(e.type) : e.type;
1005
- switch (i) {
1006
- case "square":
1007
- case void 0:
1008
- return "squareRect";
1009
- case "round":
1010
- return "roundedRect";
1011
- case "ellipse":
1012
- return "ellipse";
1013
- default:
1014
- return i;
1015
- }
1016
- }
1017
- findNode(e, i) {
1018
- return e.find((n) => n.id === i);
1019
- }
1020
- destructEdgeType(e) {
1021
- let i = "none", n = "arrow_point";
1022
- switch (e) {
1023
- case "arrow_point":
1024
- case "arrow_circle":
1025
- case "arrow_cross":
1026
- case "arrow_hierarchy":
1027
- n = e;
1028
- break;
1029
- case "double_arrow_point":
1030
- case "double_arrow_circle":
1031
- case "double_arrow_cross":
1032
- i = e.replace("double_", ""), n = i;
1033
- break;
1034
- }
1035
- return { arrowTypeStart: i, arrowTypeEnd: n };
1036
- }
1037
- addNodeFromVertex(e, i, n, r, u, l) {
1038
- const a = n.get(e.id), c = r.get(e.id) ?? !1, f = this.findNode(i, e.id);
1039
- if (f)
1040
- f.cssStyles = e.styles, f.cssCompiledStyles = this.getCompiledStyles(e.classes), f.cssClasses = e.classes.join(" ");
1041
- else {
1042
- const p = {
1043
- id: e.id,
1044
- label: e.text,
1045
- labelType: e.labelType,
1046
- labelStyle: "",
1047
- parentId: a,
1048
- padding: u.flowchart?.padding || 8,
1049
- cssStyles: e.styles,
1050
- cssCompiledStyles: this.getCompiledStyles(["default", "node", ...e.classes]),
1051
- cssClasses: "default " + e.classes.join(" "),
1052
- dir: e.dir,
1053
- domId: e.domId,
1054
- look: l,
1055
- link: e.link,
1056
- linkTarget: e.linkTarget,
1057
- tooltip: this.getTooltip(e.id),
1058
- metadata: e.metadata
1059
- };
1060
- c ? i.push({
1061
- ...p,
1062
- isGroup: !0,
1063
- shape: "rect"
1064
- }) : i.push({
1065
- ...p,
1066
- isGroup: !1,
1067
- shape: this.getTypeFromVertex(e),
1068
- wrappingWidth: u.agentflow?.wrappingWidth,
1069
- minWidth: u.agentflow?.minNodeWidth
1070
- });
1071
- }
1072
- }
1073
- getCompiledStyles(e) {
1074
- let i = [];
1075
- for (const n of e) {
1076
- const r = this.classes.get(n);
1077
- r?.styles && (i = [...i, ...r.styles ?? []].map((u) => u.trim())), r?.textStyles && (i = [...i, ...r.textStyles ?? []].map((u) => u.trim()));
1078
- }
1079
- return i;
1080
- }
1081
- /**
1082
- * Post-parse hook. Property-level metadata validation and semantic checks
1083
- * (§10 applicability, connector-ref resolution, §3.3 containment, edge
1084
- * endpoint kinds, flow input, identifier namespace) were removed from the
1085
- * parser in v0.8.2 (issue #64) — they are semantic concerns owned by the
1086
- * semantics module. The parser keeps only structural parsing plus `shape`
1087
- * (unknown-shape errors, see `transformData`) and `view` handling. This hook
1088
- * remains as a no-op so downstream callers and the run-once guard are intact.
1089
- */
1090
- runPostParseValidators() {
1091
- this.postParseValidationRun || (this.postParseValidationRun = !0);
1092
- }
1093
- getData() {
1094
- this.runPostParseValidators();
1095
- const e = Ce(), i = [], n = [], r = this.getSubGraphs(), u = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Set(), c = /* @__PURE__ */ new Map(), f = /* @__PURE__ */ k((d, h, x = /* @__PURE__ */ new Set()) => {
1096
- if (x.has(d))
1097
- return;
1098
- x.add(d);
1099
- const N = this.subGraphLookup.get(d);
1100
- if (N)
1101
- for (const te of N.nodes)
1102
- te === h || x.has(te) || (a.add(te), c.set(te, h), f(te, h, x));
1103
- }, "collectDescendants");
1104
- for (const d of r)
1105
- d.metadata?.view === "collapsed" && !a.has(d.id) && f(d.id, d.id);
1106
- const p = /* @__PURE__ */ k((d, h) => {
1107
- const x = /* @__PURE__ */ new Set();
1108
- let N = h;
1109
- for (; N !== void 0 && !x.has(N); ) {
1110
- if (N === d)
1111
- return !0;
1112
- x.add(N), N = u.get(N);
1113
- }
1114
- return !1;
1115
- }, "wouldCloseContainmentCycle");
1116
- for (let d = r.length - 1; d >= 0; d--) {
1117
- const h = r[d];
1118
- if (!a.has(h.id)) {
1119
- h.nodes.length > 0 && l.set(h.id, !0);
1120
- for (const x of h.nodes) {
1121
- if (p(x, h.id)) {
1122
- this.emitWarning(
1123
- et.CONTAINMENT_VIOLATION,
1124
- `Container "${h.id}" cannot contain "${x}" because "${x}" already contains it. The nesting that would close the loop is dropped.`,
1125
- { nodeId: x }
1126
- );
1127
- continue;
1128
- }
1129
- u.set(x, h.id);
1130
- }
1131
- }
1132
- }
1133
- for (let d = r.length - 1; d >= 0; d--) {
1134
- const h = r[d];
1135
- if (a.has(h.id))
1136
- continue;
1137
- if (h.metadata?.view === "collapsed") {
1138
- const N = {
1139
- ...h.metadata,
1140
- containerType: h.type
1141
- };
1142
- i.push({
1143
- id: h.id,
1144
- label: h.title,
1145
- labelStyle: "",
1146
- labelType: h.labelType,
1147
- parentId: u.get(h.id),
1148
- padding: 8,
1149
- cssCompiledStyles: this.getCompiledStyles(h.classes),
1150
- cssClasses: h.classes.join(" "),
1151
- shape: "collapsedGroup",
1152
- dir: h.dir,
1153
- isGroup: !1,
1154
- look: e.look,
1155
- metadata: N
1156
- });
1157
- } else
1158
- i.push({
1159
- id: h.id,
1160
- label: h.title,
1161
- labelStyle: "",
1162
- labelType: h.labelType,
1163
- parentId: u.get(h.id),
1164
- padding: 8,
1165
- cssCompiledStyles: this.getCompiledStyles(h.classes),
1166
- cssClasses: h.classes.join(" "),
1167
- shape: Y1[h.type ?? "flow"],
1168
- dir: h.dir,
1169
- isGroup: !0,
1170
- look: e.look,
1171
- metadata: h.metadata
1172
- });
1173
- }
1174
- this.getVertices().forEach((d) => {
1175
- a.has(d.id) || this.addNodeFromVertex(d, i, u, l, e, e.look || "classic");
1176
- });
1177
- const b = this.getEdges();
1178
- b.forEach((d, h) => {
1179
- const x = c.get(d.start) ?? d.start, N = c.get(d.end) ?? d.end;
1180
- if (x === N && d.start !== d.end)
1181
- return;
1182
- const { arrowTypeStart: te, arrowTypeEnd: ce } = this.destructEdgeType(d.type), ue = [...b.defaultStyle ?? []];
1183
- d.style && ue.push(...d.style);
1184
- const de = {
1185
- id: Nt(x, N, { counter: h, prefix: "L" }, d.id),
1186
- isUserDefinedId: d.isUserDefinedId,
1187
- start: x,
1188
- end: N,
1189
- type: d.type ?? "normal",
1190
- label: d.text,
1191
- labelType: d.labelType,
1192
- labelpos: "c",
1193
- thickness: d.stroke,
1194
- minlen: d.length,
1195
- classes: d?.stroke === "invisible" ? "" : "edge-thickness-normal edge-pattern-solid flowchart-link",
1196
- arrowTypeStart: d?.stroke === "invisible" || d?.type === "arrow_open" ? "none" : te,
1197
- arrowTypeEnd: d?.stroke === "invisible" || d?.type === "arrow_open" ? "none" : ce,
1198
- // Inert: `Edge.arrowheadStyle` is declared but never read by the
1199
- // renderer. Kept at flowchart parity rather than theme-derived.
1200
- arrowheadStyle: "fill: #333",
1201
- cssCompiledStyles: this.getCompiledStyles(d.classes),
1202
- labelStyle: ue,
1203
- style: ue,
1204
- pattern: d.stroke,
1205
- look: e.look,
1206
- animate: d.animate,
1207
- animation: d.animation,
1208
- curve: d.interpolate || this.edges.defaultInterpolate || e.flowchart?.curve,
1209
- // §5.3 edge metadata (e.g. `instruction`) — carried to the IR so
1210
- // downstream tooling (dispatch compile) can read it (issue #62).
1211
- metadata: d.metadata
1212
- };
1213
- n.push(de);
1214
- }), n1(i, this);
1215
- const _ = /* @__PURE__ */ new Map(), S = /* @__PURE__ */ new Map();
1216
- for (const d of r) {
1217
- const h = u.get(d.id);
1218
- h !== void 0 && S.set(h, [...S.get(h) ?? [], d.id]);
1219
- }
1220
- let B = 0;
1221
- const T = /* @__PURE__ */ k((d) => {
1222
- if (!_.has(d)) {
1223
- _.set(d, B++);
1224
- for (const h of S.get(d) ?? [])
1225
- T(h);
1226
- }
1227
- }, "walkContainers");
1228
- for (const d of r)
1229
- u.get(d.id) === void 0 && T(d.id);
1230
- const m = new Set(this.getConnectors().map((d) => d.id));
1231
- return l1(
1232
- i,
1233
- (d) => {
1234
- if (m.has(d))
1235
- return "connector";
1236
- const h = this.vertices.get(d);
1237
- return h ? this.deriveVertexKind(h, $e(h.type)) : void 0;
1238
- },
1239
- _
1240
- ), {
1241
- nodes: i,
1242
- edges: n,
1243
- other: {},
1244
- config: e,
1245
- connectors: this.getConnectors()
1246
- };
1247
- }
1248
- defaultConfig() {
1249
- return M1.flowchart;
1250
- }
1251
- // ── Semantic-model projection (PR 3) ─────────────────────────────────
1252
- //
1253
- // `getSemanticModel()` returns a presentation-stripped view of the
1254
- // diagram state for downstream tooling. Per the agentflow syntax specification §13
1255
- // `view`, `classDef` / `class` / `style` / `linkStyle`, `icon`, `img`,
1256
- // `w`, `h`, collapsed/expanded state, element mappings, and interactivity
1257
- // bindings are presentation-only and MUST NOT influence semantic
1258
- // interpretation — so none of them appear in the returned model. Fields
1259
- // that carry meaning (ids, labels, shape, domain metadata, edge
1260
- // arrow/stroke/label, subgraph membership, type/template declarations,
1261
- // diagnostics) are kept.
1262
- /**
1263
- * The v0.8.1 §4 vertex kind for a parsed vertex.
1264
- *
1265
- * Extracted so the semantic model and `getData()`'s palette slots read the same rules
1266
- * from one place. Kind is NOT recoverable from the resolved shape alone — a tool and a
1267
- * task can both land on `roundedRect` — which is why this takes the vertex and not just
1268
- * its shape.
1269
- */
1270
- deriveVertexKind(e, i) {
1271
- return this.isToolDefinition(e) ? "tool" : i === "hexagon" || i === "hex" ? "action" : i === "lean-right" || i === "lean_right" ? "input" : i === "lin-doc" || i === "lined-document" ? "refdoc" : i === "diamond" ? "decision" : "task";
1272
- }
1273
- getSemanticModel() {
1274
- this.runPostParseValidators();
1275
- const e = new Set(this.subGraphs.map((a) => a.id)), i = [], n = [];
1276
- for (const [a, c] of this.vertices) {
1277
- if (e.has(a))
1278
- continue;
1279
- if (c.isConnector) {
1280
- const g = { id: a };
1281
- if (c.text !== void 0 && c.text !== a && (g.title = c.text), c.metadata && Object.keys(c.metadata).length > 0) {
1282
- const b = {};
1283
- for (const [_, S] of Object.entries(c.metadata))
1284
- Ot.has(_) || (b[_] = S);
1285
- Object.keys(b).length > 0 && (g.metadata = b);
1286
- }
1287
- n.push(g);
1288
- continue;
1289
- }
1290
- const f = { id: a };
1291
- c.text !== void 0 && (f.label = c.text);
1292
- const p = typeof c.type == "string" ? $e(c.type) : c.type;
1293
- if (p !== void 0 && (f.shape = p), f.vertexKind = this.deriveVertexKind(c, p), c.metadata && Object.keys(c.metadata).length > 0) {
1294
- const g = {};
1295
- for (const [b, _] of Object.entries(c.metadata))
1296
- Ot.has(b) || (g[b] = _);
1297
- Object.keys(g).length > 0 && (f.metadata = g);
1298
- }
1299
- i.push(f);
1300
- }
1301
- const r = this.edges.map((a) => {
1302
- const c = { start: a.start, end: a.end };
1303
- return a.id !== void 0 && (c.id = a.id), typeof a.text == "string" && a.text.length > 0 && (c.label = a.text), a.type !== void 0 && (c.type = a.type), a.stroke !== void 0 && (c.stroke = a.stroke), a.edgeSemantic !== void 0 && (c.edgeSemantic = a.edgeSemantic), a.length !== void 0 && (c.length = a.length), a.metadata && Object.keys(a.metadata).length > 0 && (c.metadata = { ...a.metadata }), c;
1304
- }), u = this.subGraphs.map((a) => {
1305
- const c = {
1306
- id: a.id,
1307
- nodes: [...a.nodes]
1308
- };
1309
- if (a.type !== void 0 && (c.type = a.type), a.title !== void 0 && (c.title = a.title), a.dir !== void 0 && (c.direction = a.dir), a.metadata && Object.keys(a.metadata).length > 0) {
1310
- const f = {};
1311
- for (const [p, g] of Object.entries(a.metadata))
1312
- Ot.has(p) || (f[p] = g);
1313
- Object.keys(f).length > 0 && (c.metadata = f);
1314
- }
1315
- return c;
1316
- }), l = {
1317
- vertices: i,
1318
- edges: r,
1319
- subGraphs: u,
1320
- connectors: n,
1321
- diagnostics: this.diagnostics
1322
- };
1323
- return this.direction !== void 0 && (l.direction = this.direction), l;
1324
- }
1325
- // ── Element-mapping infrastructure (PR 2a) ────────────────────────────
1326
- //
1327
- // JISON action blocks call the `add*Mapping` methods alongside the
1328
- // structural `add*` methods; see `agentflow.jison`. When a diagram DB
1329
- // does not expose these methods the JISON guard `if (yy.addVertexMapping)`
1330
- // simply skips them, so the mapping layer is opt-in and has no effect on
1331
- // diagrams that don't consume positions.
1332
- setFrontmatterLineOffset(e) {
1333
- this.frontmatterLineOffset = e ?? 0;
1334
- }
1335
- toElementPosition(e) {
1336
- const i = e?.first_line ?? 0, n = e?.first_column ?? 0, r = e?.last_line ?? i, u = e?.last_column ?? n, [l, a] = e?.range ?? [0, 0];
1337
- return {
1338
- startLine: i + this.frontmatterLineOffset,
1339
- startColumn: n,
1340
- endLine: r + this.frontmatterLineOffset,
1341
- endColumn: u,
1342
- startIndex: l,
1343
- endIndex: a
1344
- };
1345
- }
1346
- pushMapping(e, i, n) {
1347
- if (!e)
1348
- return;
1349
- const r = {
1350
- id: e,
1351
- type: i,
1352
- position: this.toElementPosition(n)
1353
- };
1354
- return this.elementMappings.push(r), r;
1355
- }
1356
- addVertexMapping(e, i, n, r) {
1357
- const u = this.pushMapping(e, "vertex", r);
1358
- u && n == null && this.bareVertexMappings.add(u);
1359
- }
1360
- /**
1361
- * Extend a vertex's mapping end to cover a trailing inline metadata block
1362
- * (`id["..."]@{ ... }`). The node declaration already pushed a mapping
1363
- * spanning just the declaration; when the `@{ ... }` block reduces we widen
1364
- * that mapping's end to the block's closing `}` so editor cursors inside the
1365
- * block resolve to the node rather than the containing flow (issue #60).
1366
- * `loc` is the `shapeData` symbol's location, so only the end moves — the
1367
- * declaration start is preserved. Falls back to a fresh mapping if the node
1368
- * has none yet.
1369
- *
1370
- * When the mapping being widened came from a bare `id` reference (no
1371
- * label/shape brackets), the statement is a standalone attachment
1372
- * (`id@{ ... }`) annotating an element declared elsewhere — retype it to
1373
- * 'attachment' so consumers can tell it apart from a declaration
1374
- * (issue #75).
1375
- */
1376
- extendVertexMapping(e, i) {
1377
- if (!e || !i)
1378
- return;
1379
- const n = this.toElementPosition(i);
1380
- for (let r = this.elementMappings.length - 1; r >= 0; r--) {
1381
- const u = this.elementMappings[r];
1382
- if (u.type === "vertex" && u.id === e) {
1383
- this.bareVertexMappings.has(u) && (u.type = "attachment", this.bareVertexMappings.delete(u)), (n.endLine > u.position.endLine || n.endLine === u.position.endLine && n.endColumn > u.position.endColumn) && (u.position.endLine = n.endLine, u.position.endColumn = n.endColumn, u.position.endIndex = n.endIndex);
1384
- return;
1385
- }
1386
- }
1387
- this.pushMapping(e, "attachment", i);
1388
- }
1389
- addEdgeMapping(e, i, n, r) {
1390
- const u = Array.isArray(i) ? i.map((a) => typeof a == "string" ? a : a?.id ?? "").filter(Boolean) : [], l = u.length > 0 ? u.join(">") : "edge";
1391
- this.pushMapping(l, "edge", r);
1392
- }
1393
- addSubgraphMapping(e, i, n, r) {
1394
- const u = (typeof e == "string" ? e : e?.text) ?? "", l = this.toElementPosition(n), a = r ? this.toElementPosition(r) : l;
1395
- u && this.elementMappings.push({
1396
- id: u,
1397
- type: "subgraph",
1398
- // Range spans from the container keyword to its `end` — startLine from
1399
- // the opener, endLine from the closer.
1400
- position: {
1401
- startLine: l.startLine,
1402
- startColumn: l.startColumn,
1403
- endLine: a.endLine,
1404
- endColumn: a.endColumn,
1405
- startIndex: l.startIndex,
1406
- endIndex: a.endIndex
1407
- }
1408
- });
1409
- }
1410
- addConnectorMapping(e, i, n, r) {
1411
- const u = e?.text?.trim() ?? "";
1412
- if (!u)
1413
- return;
1414
- const l = this.toElementPosition(n), a = r ? this.toElementPosition(r) : l;
1415
- this.elementMappings.push({
1416
- id: u,
1417
- type: "connector",
1418
- position: {
1419
- startLine: l.startLine,
1420
- startColumn: l.startColumn,
1421
- endLine: a.endLine,
1422
- endColumn: a.endColumn,
1423
- startIndex: l.startIndex,
1424
- endIndex: a.endIndex
1425
- }
1426
- });
1427
- }
1428
- getElementMappings() {
1429
- return [...this.elementMappings];
1430
- }
1431
- getElementById(e) {
1432
- return this.elementMappings.find((i) => i.id === e);
1433
- }
1434
- getElementsOnLine(e) {
1435
- return this.elementMappings.filter(
1436
- (i) => e >= i.position.startLine && e <= i.position.endLine
1437
- );
1438
- }
1439
- getElementAtPosition(e, i) {
1440
- const n = this.elementMappings.filter((u) => {
1441
- const { startLine: l, startColumn: a, endLine: c, endColumn: f } = u.position;
1442
- return !(e < l || e > c || e === l && i < a || e === c && i > f);
1443
- });
1444
- if (n.length === 0)
1445
- return;
1446
- const r = /* @__PURE__ */ k(({ position: u }) => [
1447
- u.endLine - u.startLine,
1448
- u.endColumn - u.startColumn
1449
- ], "span");
1450
- return n.reduce((u, l) => {
1451
- const [a, c] = r(u), [f, p] = r(l);
1452
- return f !== a ? f < a ? l : u : p < c ? l : u;
1453
- });
1454
- }
1455
- getMappingStats() {
1456
- let e = 0, i = 0, n = 0, r = 0, u = 0;
1457
- for (const l of this.elementMappings)
1458
- l.type === "vertex" ? e++ : l.type === "edge" ? i++ : l.type === "subgraph" ? n++ : l.type === "connector" ? r++ : l.type === "attachment" && u++;
1459
- return {
1460
- vertices: e,
1461
- edges: i,
1462
- subgraphs: n,
1463
- connectors: r,
1464
- attachments: u,
1465
- totalElements: this.elementMappings.length
1466
- };
1467
- }
1468
- // ── Diagnostics (PR 2b) ────────────────────────────────────────────────
1469
- //
1470
- // `emitWarning` (and its error-severity counterpart `emitError`) record a
1471
- // structured diagnostic and also fire `log.warn` so humans see the
1472
- // message in the console. When the caller supplies a `nodeId` or
1473
- // `edgeId`, the position is looked up through the element-mapping layer
1474
- // added in PR 2a — so the diagnostic carries enough context for an
1475
- // editor to highlight the offending element.
1476
- emitDiagnostic(e, i, n, r) {
1477
- const u = r?.nodeId ?? r?.edgeId, l = u ? this.getElementById(u) : void 0, a = {
1478
- id: e,
1479
- severity: i,
1480
- message: n,
1481
- ...r?.nodeId ? { nodeId: r.nodeId } : {},
1482
- ...r?.edgeId && !r?.nodeId ? { edgeId: r.edgeId } : {},
1483
- ...l ? { position: l.position } : {}
1484
- };
1485
- if (this.diagnostics.some(
1486
- (p) => p.id === a.id && p.severity === a.severity && p.message === a.message && p.nodeId === a.nodeId && p.edgeId === a.edgeId
1487
- ))
1488
- return;
1489
- this.diagnostics.push(a);
1490
- const f = `agentflow[${e}]: ${n}`;
1491
- i === "error" ? ae.error(f) : ae.warn(f);
1492
- }
1493
- emitWarning(e, i, n) {
1494
- this.emitDiagnostic(e, "warning", i, n);
1495
- }
1496
- emitError(e, i, n) {
1497
- this.emitDiagnostic(e, "error", i, n);
1498
- }
1499
- /**
1500
- * `readonly` is erased at runtime, so hand back a copy — this is a
1501
- * consumer-facing accessor and a caller sorting the result in place would
1502
- * otherwise reorder the DB's own list.
1503
- */
1504
- getDiagnostics() {
1505
- return [...this.diagnostics];
1506
- }
1507
- }, X1 = /* @__PURE__ */ k(function(e, i) {
1508
- return i.db.getClasses();
1509
- }, "getClasses"), J1 = /* @__PURE__ */ k(async function(e, i, n, r) {
1510
- ae.debug("Drawing agentflow diagram", i);
1511
- const { securityLevel: u, agentflow: l, layout: a } = Ce();
1512
- r.db.setDiagramId(i), ae.debug("Before getData: ");
1513
- const c = r.db.getData();
1514
- ae.debug("Data: ", c);
1515
- const f = k1(i, u), p = r.db.getDirection();
1516
- c.type = r.type, c.layoutAlgorithm = C1(a), c.layoutAlgorithm === "dagre" && a === "elk" && ae.warn(
1517
- "flowchart-elk was moved to an external package in Mermaid v11. Please refer [release notes](https://github.com/mermaid-js/mermaid/releases/tag/v11.0.0) for more details. This diagram will be rendered using `dagre` layout as a fallback."
1518
- ), c.direction = p, c.nodeSpacing = l?.nodeSpacing || 50, c.rankSpacing = l?.rankSpacing || 50, c.markers = ["point", "circle", "cross", "hierarchy"], c.diagramId = i, ae.debug("REF1:", c), await S1(c, f);
1519
- const g = l?.diagramPadding ?? 8;
1520
- Pt.insertTitle(
1521
- f,
1522
- "agentflowTitleText",
1523
- l?.titleTopMargin ?? 0,
1524
- r.db.getDiagramTitle()
1525
- ), E1(f, g, "agentflow", l?.useMaxWidth ?? !0);
1526
- }, "draw"), Q1 = {
1527
- getClasses: X1,
1528
- draw: J1
1529
- }, Gt = (function() {
1530
- var e = /* @__PURE__ */ k(function(Te, A, E, C) {
1531
- for (E = E || {}, C = Te.length; C--; E[Te[C]] = A) ;
1532
- return E;
1533
- }, "o"), i = [1, 5], n = [1, 4], r = [1, 3], u = [1, 6], l = [1, 8, 9, 10, 11, 12, 28, 35, 36, 38, 40, 42, 47, 63, 87, 88, 89, 90, 91, 92, 105, 108, 109, 112, 114, 117, 118, 119, 124, 125, 126, 127, 128], a = [2, 2], c = [1, 15], f = [1, 16], p = [1, 17], g = [1, 18], b = [1, 19], _ = [1, 26], S = [1, 27], B = [1, 28], T = [1, 30], m = [1, 31], d = [1, 32], h = [1, 55], x = [1, 54], N = [1, 34], te = [1, 35], ce = [1, 36], ue = [1, 37], de = [1, 38], O = [1, 50], P = [1, 52], G = [1, 48], U = [1, 53], j = [1, 49], z = [1, 56], W = [1, 51], K = [1, 57], H = [1, 58], De = [1, 39], _e = [1, 40], ve = [1, 41], Fe = [1, 42], Ve = [1, 43], Se = [1, 64], D = [1, 8, 9, 10, 11, 12, 28, 33, 35, 36, 38, 40, 42, 47, 63, 87, 88, 89, 90, 91, 92, 105, 108, 109, 112, 114, 117, 118, 119, 124, 125, 126, 127, 128], Q = [1, 70], Z = [1, 68], $ = [1, 67], ee = [1, 69], Me = [8, 9, 10, 12, 78, 80, 81], ye = [1, 88], we = [1, 101], Ne = [1, 106], Re = [1, 105], Oe = [1, 102], Pe = [1, 98], Ge = [1, 104], Ue = [1, 100], je = [1, 107], ze = [1, 103], We = [1, 108], Ke = [1, 99], Ie = [8, 9, 10, 11, 12, 43, 78, 80, 81], q = [8, 9, 10, 11, 12, 43, 49, 78, 80, 81], ie = [8, 9, 10, 11, 12, 30, 43, 47, 49, 51, 53, 55, 57, 59, 61, 63, 66, 68, 70, 71, 73, 78, 80, 81, 92, 105, 108, 109, 112, 114, 117, 118, 119], Ut = [8, 9, 10, 12, 47, 63, 78, 80, 81, 92, 105, 108, 109, 112, 114, 117, 118, 119], He = [47, 63, 92, 105, 108, 109, 112, 114, 117, 118, 119], jt = [1, 131], zt = [1, 132], tt = [1, 134], st = [1, 133], Wt = [47, 63, 65, 77, 92, 105, 108, 109, 112, 114, 117, 118, 119], it = [1, 143], nt = [1, 157], rt = [1, 158], at = [1, 159], ot = [1, 162], ut = [1, 161], lt = [1, 160], ct = [1, 145], dt = [1, 147], ht = [1, 151], Kt = [1, 139], Ht = [1, 140], pt = [1, 152], ft = [1, 153], gt = [1, 154], mt = [1, 155], bt = [1, 156], At = [1, 163], kt = [1, 164], Et = [1, 141], Ct = [1, 142], St = [1, 149], xt = [1, 144], Tt = [1, 148], Dt = [1, 146], Ye = [8, 9, 10, 11, 12, 28, 33, 35, 36, 38, 40, 42, 47, 63, 87, 88, 89, 90, 91, 92, 105, 108, 109, 112, 114, 117, 118, 119, 124, 125, 126, 127, 128], Yt = [1, 168], qe = [1, 170], R = [8, 9, 10, 12], ne = [8, 9, 10, 11, 12, 15, 47, 63, 92, 108, 109, 112, 114, 117, 118, 119], v = [1, 190], X = [1, 186], J = [1, 187], F = [1, 191], V = [1, 188], I = [1, 189], Xe = [80, 119, 122], M = [8, 9, 10, 11, 12, 13, 15, 28, 30, 33, 35, 36, 43, 47, 63, 78, 87, 88, 89, 90, 91, 92, 93, 108, 112, 114, 117, 118, 119], qt = [11, 109], xe = [32, 52, 54, 56, 58, 60, 65, 67, 69, 70, 72, 74, 119, 120, 121], he = [1, 269], pe = [1, 267], fe = [1, 271], ge = [1, 265], me = [1, 266], be = [1, 268], Ae = [1, 270], ke = [1, 272], Je = [1, 292], Xt = [8, 9, 10, 12, 109], le = [8, 9, 10, 11, 12, 63, 87, 108, 109, 112, 113, 114, 115], Lt = {
1534
- trace: /* @__PURE__ */ k(function() {
1535
- }, "trace"),
1536
- yy: {},
1537
- symbols_: { error: 2, start: 3, graphConfig: 4, document: 5, line: 6, statement: 7, COMMENT: 8, SEMI: 9, NEWLINE: 10, SPACE: 11, EOF: 12, GRAPH: 13, NODIR: 14, DIR: 15, FirstStmtSeparator: 16, ending: 17, endToken: 18, spaceList: 19, spaceListNewline: 20, vertexStatement: 21, separator: 22, styleStatement: 23, linkStyleStatement: 24, classDefStatement: 25, classStatement: 26, clickStatement: 27, flow: 28, textNoTags: 29, SQS: 30, text: 31, SQE: 32, end: 33, shapeData: 34, global: 35, connector: 36, direction: 37, acc_title: 38, acc_title_value: 39, acc_descr: 40, acc_descr_value: 41, acc_descr_multiline_value: 42, SHAPE_DATA: 43, link: 44, node: 45, styledVertex: 46, AMP: 47, vertex: 48, STYLE_SEPARATOR: 49, idString: 50, DOUBLECIRCLESTART: 51, DOUBLECIRCLEEND: 52, PS: 53, PE: 54, "(-": 55, "-)": 56, STADIUMSTART: 57, STADIUMEND: 58, SUBROUTINESTART: 59, SUBROUTINEEND: 60, VERTEX_WITH_PROPS_START: 61, "NODE_STRING[field]": 62, COLON: 63, "NODE_STRING[value]": 64, PIPE: 65, CYLINDERSTART: 66, CYLINDEREND: 67, DIAMOND_START: 68, DIAMOND_STOP: 69, TAGEND: 70, TRAPSTART: 71, TRAPEND: 72, INVTRAPSTART: 73, INVTRAPEND: 74, linkStatement: 75, arrowText: 76, TESTSTR: 77, START_LINK: 78, edgeText: 79, LINK: 80, LINK_ID: 81, edgeTextToken: 82, STR: 83, MD_STR: 84, textToken: 85, keywords: 86, STYLE: 87, LINKSTYLE: 88, CLASSDEF: 89, CLASS: 90, CLICK: 91, DOWN: 92, UP: 93, textNoTagsToken: 94, stylesOpt: 95, "idString[vertex]": 96, "idString[class]": 97, CALLBACKNAME: 98, CALLBACKARGS: 99, HREF: 100, LINK_TARGET: 101, "STR[link]": 102, "STR[tooltip]": 103, alphaNum: 104, DEFAULT: 105, numList: 106, INTERPOLATE: 107, NUM: 108, COMMA: 109, style: 110, styleComponent: 111, NODE_STRING: 112, UNIT: 113, BRKT: 114, PCT: 115, idStringToken: 116, MINUS: 117, MULT: 118, UNICODE_TEXT: 119, TEXT: 120, TAGSTART: 121, EDGE_TEXT: 122, alphaNumToken: 123, direction_tb: 124, direction_bt: 125, direction_rl: 126, direction_lr: 127, direction_td: 128, $accept: 0, $end: 1 },
1538
- terminals_: { 2: "error", 8: "COMMENT", 9: "SEMI", 10: "NEWLINE", 11: "SPACE", 12: "EOF", 13: "GRAPH", 14: "NODIR", 15: "DIR", 28: "flow", 30: "SQS", 32: "SQE", 33: "end", 35: "global", 36: "connector", 38: "acc_title", 39: "acc_title_value", 40: "acc_descr", 41: "acc_descr_value", 42: "acc_descr_multiline_value", 43: "SHAPE_DATA", 47: "AMP", 49: "STYLE_SEPARATOR", 51: "DOUBLECIRCLESTART", 52: "DOUBLECIRCLEEND", 53: "PS", 54: "PE", 55: "(-", 56: "-)", 57: "STADIUMSTART", 58: "STADIUMEND", 59: "SUBROUTINESTART", 60: "SUBROUTINEEND", 61: "VERTEX_WITH_PROPS_START", 62: "NODE_STRING[field]", 63: "COLON", 64: "NODE_STRING[value]", 65: "PIPE", 66: "CYLINDERSTART", 67: "CYLINDEREND", 68: "DIAMOND_START", 69: "DIAMOND_STOP", 70: "TAGEND", 71: "TRAPSTART", 72: "TRAPEND", 73: "INVTRAPSTART", 74: "INVTRAPEND", 77: "TESTSTR", 78: "START_LINK", 80: "LINK", 81: "LINK_ID", 83: "STR", 84: "MD_STR", 87: "STYLE", 88: "LINKSTYLE", 89: "CLASSDEF", 90: "CLASS", 91: "CLICK", 92: "DOWN", 93: "UP", 96: "idString[vertex]", 97: "idString[class]", 98: "CALLBACKNAME", 99: "CALLBACKARGS", 100: "HREF", 101: "LINK_TARGET", 102: "STR[link]", 103: "STR[tooltip]", 105: "DEFAULT", 107: "INTERPOLATE", 108: "NUM", 109: "COMMA", 112: "NODE_STRING", 113: "UNIT", 114: "BRKT", 115: "PCT", 117: "MINUS", 118: "MULT", 119: "UNICODE_TEXT", 120: "TEXT", 121: "TAGSTART", 122: "EDGE_TEXT", 124: "direction_tb", 125: "direction_bt", 126: "direction_rl", 127: "direction_lr", 128: "direction_td" },
1539
- productions_: [0, [3, 2], [5, 0], [5, 2], [6, 1], [6, 1], [6, 1], [6, 1], [6, 1], [6, 1], [4, 2], [4, 2], [4, 2], [4, 2], [4, 3], [17, 2], [17, 1], [18, 1], [18, 1], [18, 1], [16, 1], [16, 1], [16, 2], [16, 1], [20, 2], [20, 2], [20, 2], [20, 1], [20, 1], [20, 1], [19, 2], [19, 1], [7, 2], [7, 2], [7, 2], [7, 2], [7, 2], [7, 2], [7, 9], [7, 10], [7, 6], [7, 7], [7, 4], [7, 4], [7, 7], [7, 8], [7, 4], [7, 5], [7, 1], [7, 2], [7, 2], [7, 1], [22, 1], [22, 1], [22, 1], [22, 1], [34, 2], [34, 1], [21, 4], [21, 3], [21, 4], [21, 2], [21, 2], [21, 1], [45, 1], [45, 6], [45, 5], [46, 1], [46, 3], [48, 4], [48, 4], [48, 6], [48, 4], [48, 4], [48, 4], [48, 8], [48, 4], [48, 4], [48, 4], [48, 6], [48, 4], [48, 4], [48, 4], [48, 4], [48, 4], [48, 1], [44, 2], [44, 3], [44, 3], [44, 1], [44, 3], [44, 4], [79, 1], [79, 2], [79, 1], [79, 1], [75, 1], [75, 2], [76, 3], [31, 1], [31, 2], [31, 1], [31, 1], [86, 1], [86, 1], [86, 1], [86, 1], [86, 1], [86, 1], [86, 1], [86, 1], [86, 1], [86, 1], [86, 1], [86, 1], [86, 1], [29, 1], [29, 2], [29, 1], [29, 1], [25, 5], [26, 5], [27, 2], [27, 4], [27, 3], [27, 5], [27, 3], [27, 5], [27, 5], [27, 7], [27, 2], [27, 4], [27, 2], [27, 4], [27, 4], [27, 6], [23, 5], [24, 5], [24, 5], [24, 9], [24, 9], [24, 7], [24, 7], [106, 1], [106, 3], [95, 1], [95, 3], [110, 1], [110, 2], [111, 1], [111, 1], [111, 1], [111, 1], [111, 1], [111, 1], [111, 1], [111, 1], [116, 1], [116, 1], [116, 1], [116, 1], [116, 1], [116, 1], [116, 1], [116, 1], [116, 1], [116, 1], [116, 1], [85, 1], [85, 1], [85, 1], [85, 1], [94, 1], [94, 1], [94, 1], [94, 1], [94, 1], [94, 1], [94, 1], [94, 1], [94, 1], [94, 1], [94, 1], [82, 1], [82, 1], [123, 1], [123, 1], [123, 1], [123, 1], [123, 1], [123, 1], [123, 1], [123, 1], [123, 1], [123, 1], [123, 1], [50, 1], [50, 2], [104, 1], [104, 2], [37, 1], [37, 1], [37, 1], [37, 1], [37, 1]],
1540
- performAction: /* @__PURE__ */ k(function(A, E, C, o, y, t, L) {
1541
- var s = t.length - 1;
1542
- switch (y) {
1543
- case 2:
1544
- this.$ = [];
1545
- break;
1546
- case 3:
1547
- (!Array.isArray(t[s]) || t[s].length > 0) && t[s - 1].push(t[s]), this.$ = t[s - 1];
1548
- break;
1549
- case 4:
1550
- case 198:
1551
- this.$ = t[s];
1552
- break;
1553
- case 5:
1554
- case 33:
1555
- case 34:
1556
- case 35:
1557
- case 36:
1558
- case 37:
1559
- this.$ = [];
1560
- break;
1561
- case 13:
1562
- o.setDirection("TB"), this.$ = "TB";
1563
- break;
1564
- case 14:
1565
- o.setDirection(t[s - 1]), this.$ = t[s - 1];
1566
- break;
1567
- case 32:
1568
- this.$ = t[s - 1].nodes;
1569
- break;
1570
- case 38:
1571
- this.$ = o.addSubGraph(t[s - 6], t[s - 1], t[s - 4], "flow"), o.addSubgraphMapping && o.addSubgraphMapping(t[s - 6], t[s - 4], L[s - 8], L[s]);
1572
- break;
1573
- case 39:
1574
- this.$ = o.addSubGraph(t[s - 7], t[s - 1], t[s - 5], "flow"), o.addVertex(this.$, void 0, void 0, void 0, void 0, void 0, void 0, t[s - 3], L[s - 3]), o.addSubgraphMapping && o.addSubgraphMapping(t[s - 7], t[s - 5], L[s - 9], L[s]);
1575
- break;
1576
- case 40:
1577
- this.$ = o.addSubGraph(t[s - 3], t[s - 1], { text: "", type: "text" }, "flow"), o.addSubgraphMapping && o.addSubgraphMapping(t[s - 3], { text: "", type: "text" }, L[s - 5], L[s]);
1578
- break;
1579
- case 41:
1580
- this.$ = o.addSubGraph(t[s - 4], t[s - 1], { text: "", type: "text" }, "flow"), o.addVertex(this.$, void 0, void 0, void 0, void 0, void 0, void 0, t[s - 3], L[s - 3]), o.addSubgraphMapping && o.addSubgraphMapping(t[s - 4], { text: "", type: "text" }, L[s - 6], L[s]);
1581
- break;
1582
- case 42:
1583
- this.$ = o.addSubGraph(void 0, t[s - 1], void 0, "flow"), o.addSubgraphMapping && o.addSubgraphMapping(void 0, void 0, L[s - 3], L[s]);
1584
- break;
1585
- case 43:
1586
- o.addGlobal(t[s - 1]), this.$ = [];
1587
- break;
1588
- case 44:
1589
- this.$ = o.addConnector(t[s - 4], t[s - 2]), o.addConnectorMapping && o.addConnectorMapping(t[s - 4], t[s - 2], L[s - 6], L[s]);
1590
- break;
1591
- case 45:
1592
- this.$ = o.addConnector(t[s - 5], t[s - 3]), o.addVertex(this.$, void 0, void 0, void 0, void 0, void 0, void 0, t[s - 1], L[s - 1]), o.addConnectorMapping && o.addConnectorMapping(t[s - 5], t[s - 3], L[s - 7], L[s]);
1593
- break;
1594
- case 46:
1595
- this.$ = o.addConnector(t[s - 1], { text: "", type: "text" }), o.addConnectorMapping && o.addConnectorMapping(t[s - 1], { text: "", type: "text" }, L[s - 3], L[s]);
1596
- break;
1597
- case 47:
1598
- this.$ = o.addConnector(t[s - 2], { text: "", type: "text" }), o.addVertex(this.$, void 0, void 0, void 0, void 0, void 0, void 0, t[s - 1], L[s - 1]), o.addConnectorMapping && o.addConnectorMapping(t[s - 2], { text: "", type: "text" }, L[s - 4], L[s]);
1599
- break;
1600
- case 49:
1601
- this.$ = t[s].trim(), o.setAccTitle(this.$);
1602
- break;
1603
- case 50:
1604
- case 51:
1605
- this.$ = t[s].trim(), o.setAccDescription(this.$);
1606
- break;
1607
- case 56:
1608
- this.$ = t[s - 1] + t[s];
1609
- break;
1610
- case 57:
1611
- this.$ = t[s];
1612
- break;
1613
- case 58:
1614
- o.addVertex(t[s - 1][t[s - 1].length - 1], void 0, void 0, void 0, void 0, void 0, void 0, t[s], L[s]), o.extendVertexMapping && o.extendVertexMapping(t[s - 1][t[s - 1].length - 1], L[s]), o.addLink(t[s - 3].stmt, t[s - 1], t[s - 2]), o.addEdgeMapping && o.addEdgeMapping(t[s - 3].stmt, t[s - 1], t[s - 2], this._$), this.$ = { stmt: t[s - 1], nodes: t[s - 1].concat(t[s - 3].nodes) };
1615
- break;
1616
- case 59:
1617
- o.addLink(t[s - 2].stmt, t[s], t[s - 1]), o.addEdgeMapping && o.addEdgeMapping(t[s - 2].stmt, t[s], t[s - 1], this._$), this.$ = { stmt: t[s], nodes: t[s].concat(t[s - 2].nodes) };
1618
- break;
1619
- case 60:
1620
- o.addLink(t[s - 3].stmt, t[s - 1], t[s - 2]), o.addEdgeMapping && o.addEdgeMapping(t[s - 3].stmt, t[s - 1], t[s - 2], this._$), this.$ = { stmt: t[s - 1], nodes: t[s - 1].concat(t[s - 3].nodes) };
1621
- break;
1622
- case 61:
1623
- this.$ = { stmt: t[s - 1], nodes: t[s - 1] };
1624
- break;
1625
- case 62:
1626
- o.addVertex(t[s - 1][t[s - 1].length - 1], void 0, void 0, void 0, void 0, void 0, void 0, t[s], L[s]), o.extendVertexMapping && o.extendVertexMapping(t[s - 1][t[s - 1].length - 1], L[s]), this.$ = { stmt: t[s - 1], nodes: t[s - 1], shapeData: t[s] };
1627
- break;
1628
- case 63:
1629
- this.$ = { stmt: t[s], nodes: t[s] };
1630
- break;
1631
- case 64:
1632
- this.$ = [t[s]];
1633
- break;
1634
- case 65:
1635
- o.addVertex(t[s - 5][t[s - 5].length - 1], void 0, void 0, void 0, void 0, void 0, void 0, t[s - 4], L[s - 4]), o.extendVertexMapping && o.extendVertexMapping(t[s - 5][t[s - 5].length - 1], L[s - 4]), this.$ = t[s - 5].concat(t[s]);
1636
- break;
1637
- case 66:
1638
- this.$ = t[s - 4].concat(t[s]);
1639
- break;
1640
- case 67:
1641
- this.$ = t[s];
1642
- break;
1643
- case 68:
1644
- this.$ = t[s - 2], o.setClass(t[s - 2], t[s]);
1645
- break;
1646
- case 69:
1647
- this.$ = t[s - 3], o.addVertex(t[s - 3], t[s - 1], "square"), o.addVertexMapping && o.addVertexMapping(t[s - 3], t[s - 1], "square", this._$);
1648
- break;
1649
- case 70:
1650
- this.$ = t[s - 3], o.addVertex(t[s - 3], t[s - 1], "doublecircle"), o.addVertexMapping && o.addVertexMapping(t[s - 3], t[s - 1], "doublecircle", this._$);
1651
- break;
1652
- case 71:
1653
- this.$ = t[s - 5], o.addVertex(t[s - 5], t[s - 2], "circle"), o.addVertexMapping && o.addVertexMapping(t[s - 5], t[s - 2], "circle", this._$);
1654
- break;
1655
- case 72:
1656
- this.$ = t[s - 3], o.addVertex(t[s - 3], t[s - 1], "ellipse"), o.addVertexMapping && o.addVertexMapping(t[s - 3], t[s - 1], "ellipse", this._$);
1657
- break;
1658
- case 73:
1659
- this.$ = t[s - 3], o.addVertex(t[s - 3], t[s - 1], "stadium"), o.addVertexMapping && o.addVertexMapping(t[s - 3], t[s - 1], "stadium", this._$);
1660
- break;
1661
- case 74:
1662
- this.$ = t[s - 3], o.addVertex(t[s - 3], t[s - 1], "subroutine"), o.addVertexMapping && o.addVertexMapping(t[s - 3], t[s - 1], "subroutine", this._$);
1663
- break;
1664
- case 75:
1665
- this.$ = t[s - 7], o.addVertex(t[s - 7], t[s - 1], "rect", void 0, void 0, void 0, Object.fromEntries([[t[s - 5], t[s - 3]]])), o.addVertexMapping && o.addVertexMapping(t[s - 7], t[s - 1], "rect", this._$);
1666
- break;
1667
- case 76:
1668
- this.$ = t[s - 3], o.addVertex(t[s - 3], t[s - 1], "cylinder"), o.addVertexMapping && o.addVertexMapping(t[s - 3], t[s - 1], "cylinder", this._$);
1669
- break;
1670
- case 77:
1671
- this.$ = t[s - 3], o.addVertex(t[s - 3], t[s - 1], "round"), o.addVertexMapping && o.addVertexMapping(t[s - 3], t[s - 1], "round", this._$);
1672
- break;
1673
- case 78:
1674
- this.$ = t[s - 3], o.addVertex(t[s - 3], t[s - 1], "diamond"), o.addVertexMapping && o.addVertexMapping(t[s - 3], t[s - 1], "diamond", this._$);
1675
- break;
1676
- case 79:
1677
- this.$ = t[s - 5], o.addVertex(t[s - 5], t[s - 2], "hexagon"), o.addVertexMapping && o.addVertexMapping(t[s - 5], t[s - 2], "hexagon", this._$);
1678
- break;
1679
- case 80:
1680
- this.$ = t[s - 3], o.addVertex(t[s - 3], t[s - 1], "odd"), o.addVertexMapping && o.addVertexMapping(t[s - 3], t[s - 1], "odd", this._$);
1681
- break;
1682
- case 81:
1683
- this.$ = t[s - 3], o.addVertex(t[s - 3], t[s - 1], "trapezoid"), o.addVertexMapping && o.addVertexMapping(t[s - 3], t[s - 1], "trapezoid", this._$);
1684
- break;
1685
- case 82:
1686
- this.$ = t[s - 3], o.addVertex(t[s - 3], t[s - 1], "inv_trapezoid"), o.addVertexMapping && o.addVertexMapping(t[s - 3], t[s - 1], "inv_trapezoid", this._$);
1687
- break;
1688
- case 83:
1689
- this.$ = t[s - 3], o.addVertex(t[s - 3], t[s - 1], "lean_right"), o.addVertexMapping && o.addVertexMapping(t[s - 3], t[s - 1], "lean_right", this._$);
1690
- break;
1691
- case 84:
1692
- this.$ = t[s - 3], o.addVertex(t[s - 3], t[s - 1], "lean_left"), o.addVertexMapping && o.addVertexMapping(t[s - 3], t[s - 1], "lean_left", this._$);
1693
- break;
1694
- case 85:
1695
- this.$ = t[s], o.addVertex(t[s]), o.addVertexMapping && o.addVertexMapping(t[s], void 0, void 0, this._$);
1696
- break;
1697
- case 86:
1698
- t[s - 1].text = t[s], this.$ = t[s - 1];
1699
- break;
1700
- case 87:
1701
- case 88:
1702
- t[s - 2].text = t[s - 1], this.$ = t[s - 2];
1703
- break;
1704
- case 89:
1705
- this.$ = t[s];
1706
- break;
1707
- case 90:
1708
- var w = o.destructLink(t[s], t[s - 2]);
1709
- this.$ = { type: w.type, stroke: w.stroke, length: w.length, edgeSemantic: w.edgeSemantic, text: t[s - 1] };
1710
- break;
1711
- case 91:
1712
- var w = o.destructLink(t[s], t[s - 2]);
1713
- this.$ = { type: w.type, stroke: w.stroke, length: w.length, edgeSemantic: w.edgeSemantic, text: t[s - 1], id: t[s - 3] };
1714
- break;
1715
- case 92:
1716
- this.$ = { text: t[s], type: "text" };
1717
- break;
1718
- case 93:
1719
- this.$ = { text: t[s - 1].text + "" + t[s], type: t[s - 1].type };
1720
- break;
1721
- case 94:
1722
- this.$ = { text: t[s], type: "string" };
1723
- break;
1724
- case 95:
1725
- this.$ = { text: t[s], type: "markdown" };
1726
- break;
1727
- case 96:
1728
- var w = o.destructLink(t[s]);
1729
- this.$ = { type: w.type, stroke: w.stroke, length: w.length, edgeSemantic: w.edgeSemantic };
1730
- break;
1731
- case 97:
1732
- var w = o.destructLink(t[s]);
1733
- this.$ = { type: w.type, stroke: w.stroke, length: w.length, edgeSemantic: w.edgeSemantic, id: t[s - 1] };
1734
- break;
1735
- case 98:
1736
- this.$ = t[s - 1];
1737
- break;
1738
- case 99:
1739
- this.$ = { text: t[s], type: "text" };
1740
- break;
1741
- case 100:
1742
- this.$ = { text: t[s - 1].text + "" + t[s], type: t[s - 1].type };
1743
- break;
1744
- case 101:
1745
- this.$ = { text: t[s], type: "string" };
1746
- break;
1747
- case 102:
1748
- case 119:
1749
- this.$ = { text: t[s], type: "markdown" };
1750
- break;
1751
- case 116:
1752
- this.$ = { text: t[s], type: "text" };
1753
- break;
1754
- case 117:
1755
- this.$ = { text: t[s - 1].text + "" + t[s], type: t[s - 1].type };
1756
- break;
1757
- case 118:
1758
- this.$ = { text: t[s], type: "text" };
1759
- break;
1760
- case 120:
1761
- this.$ = t[s - 4], o.addClass(t[s - 2], t[s]);
1762
- break;
1763
- case 121:
1764
- this.$ = t[s - 4], o.setClass(t[s - 2], t[s]);
1765
- break;
1766
- case 122:
1767
- case 130:
1768
- this.$ = t[s - 1], o.setClickEvent(t[s - 1], t[s]);
1769
- break;
1770
- case 123:
1771
- case 131:
1772
- this.$ = t[s - 3], o.setClickEvent(t[s - 3], t[s - 2]), o.setTooltip(t[s - 3], t[s]);
1773
- break;
1774
- case 124:
1775
- this.$ = t[s - 2], o.setClickEvent(t[s - 2], t[s - 1], t[s]);
1776
- break;
1777
- case 125:
1778
- this.$ = t[s - 4], o.setClickEvent(t[s - 4], t[s - 3], t[s - 2]), o.setTooltip(t[s - 4], t[s]);
1779
- break;
1780
- case 126:
1781
- this.$ = t[s - 2], o.setLink(t[s - 2], t[s]);
1782
- break;
1783
- case 127:
1784
- this.$ = t[s - 4], o.setLink(t[s - 4], t[s - 2]), o.setTooltip(t[s - 4], t[s]);
1785
- break;
1786
- case 128:
1787
- this.$ = t[s - 4], o.setLink(t[s - 4], t[s - 2], t[s]);
1788
- break;
1789
- case 129:
1790
- this.$ = t[s - 6], o.setLink(t[s - 6], t[s - 4], t[s]), o.setTooltip(t[s - 6], t[s - 2]);
1791
- break;
1792
- case 132:
1793
- this.$ = t[s - 1], o.setLink(t[s - 1], t[s]);
1794
- break;
1795
- case 133:
1796
- this.$ = t[s - 3], o.setLink(t[s - 3], t[s - 2]), o.setTooltip(t[s - 3], t[s]);
1797
- break;
1798
- case 134:
1799
- this.$ = t[s - 3], o.setLink(t[s - 3], t[s - 2], t[s]);
1800
- break;
1801
- case 135:
1802
- this.$ = t[s - 5], o.setLink(t[s - 5], t[s - 4], t[s]), o.setTooltip(t[s - 5], t[s - 2]);
1803
- break;
1804
- case 136:
1805
- this.$ = t[s - 4], o.addVertex(t[s - 2], void 0, void 0, t[s]);
1806
- break;
1807
- case 137:
1808
- this.$ = t[s - 4], o.updateLink([t[s - 2]], t[s]);
1809
- break;
1810
- case 138:
1811
- this.$ = t[s - 4], o.updateLink(t[s - 2], t[s]);
1812
- break;
1813
- case 139:
1814
- this.$ = t[s - 8], o.updateLinkInterpolate([t[s - 6]], t[s - 2]), o.updateLink([t[s - 6]], t[s]);
1815
- break;
1816
- case 140:
1817
- this.$ = t[s - 8], o.updateLinkInterpolate(t[s - 6], t[s - 2]), o.updateLink(t[s - 6], t[s]);
1818
- break;
1819
- case 141:
1820
- this.$ = t[s - 6], o.updateLinkInterpolate([t[s - 4]], t[s]);
1821
- break;
1822
- case 142:
1823
- this.$ = t[s - 6], o.updateLinkInterpolate(t[s - 4], t[s]);
1824
- break;
1825
- case 143:
1826
- case 145:
1827
- this.$ = [t[s]];
1828
- break;
1829
- case 144:
1830
- case 146:
1831
- t[s - 2].push(t[s]), this.$ = t[s - 2];
1832
- break;
1833
- case 148:
1834
- this.$ = t[s - 1] + t[s];
1835
- break;
1836
- case 196:
1837
- this.$ = t[s];
1838
- break;
1839
- case 197:
1840
- this.$ = t[s - 1] + "" + t[s];
1841
- break;
1842
- case 199:
1843
- this.$ = t[s - 1] + "" + t[s];
1844
- break;
1845
- case 200:
1846
- this.$ = { stmt: "dir", value: "TB" };
1847
- break;
1848
- case 201:
1849
- this.$ = { stmt: "dir", value: "BT" };
1850
- break;
1851
- case 202:
1852
- this.$ = { stmt: "dir", value: "RL" };
1853
- break;
1854
- case 203:
1855
- this.$ = { stmt: "dir", value: "LR" };
1856
- break;
1857
- case 204:
1858
- this.$ = { stmt: "dir", value: "TD" };
1859
- break;
1860
- }
1861
- }, "anonymous"),
1862
- table: [{ 3: 1, 4: 2, 8: i, 10: n, 11: r, 13: u }, { 1: [3] }, e(l, a, { 5: 7 }), { 4: 8, 8: i, 10: n, 11: r, 13: u }, { 4: 9, 8: i, 10: n, 11: r, 13: u }, { 4: 10, 8: i, 10: n, 11: r, 13: u }, { 14: [1, 11], 15: [1, 12] }, { 1: [2, 1], 6: 13, 7: 14, 8: c, 9: f, 10: p, 11: g, 12: b, 21: 20, 23: 21, 24: 22, 25: 23, 26: 24, 27: 25, 28: _, 35: S, 36: B, 37: 29, 38: T, 40: m, 42: d, 45: 33, 46: 44, 47: h, 48: 45, 50: 46, 63: x, 87: N, 88: te, 89: ce, 90: ue, 91: de, 92: O, 105: P, 108: G, 109: U, 112: j, 114: z, 116: 47, 117: W, 118: K, 119: H, 124: De, 125: _e, 126: ve, 127: Fe, 128: Ve }, e(l, [2, 10]), e(l, [2, 11]), e(l, [2, 12]), e(l, [2, 13]), { 8: [1, 63], 9: [1, 60], 10: [1, 61], 11: Se, 16: 59, 19: 62 }, e(D, [2, 3]), e(D, [2, 4]), e(D, [2, 5]), e(D, [2, 6]), e(D, [2, 7]), e(D, [2, 8]), e(D, [2, 9]), { 8: Q, 9: Z, 10: $, 12: ee, 22: 65, 44: 66, 75: 71, 78: [1, 72], 80: [1, 74], 81: [1, 73] }, { 8: Q, 9: Z, 10: $, 12: ee, 22: 75 }, { 8: Q, 9: Z, 10: $, 12: ee, 22: 76 }, { 8: Q, 9: Z, 10: $, 12: ee, 22: 77 }, { 8: Q, 9: Z, 10: $, 12: ee, 22: 78 }, { 8: Q, 9: Z, 10: $, 12: ee, 22: 79 }, { 8: Q, 9: Z, 10: $, 11: [1, 80], 12: ee, 22: 81 }, { 8: Q, 9: Z, 10: $, 12: ee, 22: 82 }, { 11: [1, 83] }, e(D, [2, 48]), { 39: [1, 84] }, { 41: [1, 85] }, e(D, [2, 51]), e(Me, [2, 63], { 19: 86, 34: 87, 11: Se, 43: ye }), { 11: [1, 89] }, { 11: [1, 90] }, { 11: [1, 91] }, { 11: [1, 92] }, { 15: we, 47: Ne, 63: Re, 83: [1, 96], 92: Oe, 98: [1, 93], 100: [1, 94], 104: 95, 108: Pe, 109: Ge, 112: Ue, 114: je, 117: ze, 118: We, 119: Ke, 123: 97 }, e(D, [2, 200]), e(D, [2, 201]), e(D, [2, 202]), e(D, [2, 203]), e(D, [2, 204]), e(Ie, [2, 64]), e(Ie, [2, 67], { 49: [1, 109] }), e(q, [2, 85], { 116: 122, 30: [1, 110], 47: h, 51: [1, 111], 53: [1, 112], 55: [1, 113], 57: [1, 114], 59: [1, 115], 61: [1, 116], 63: x, 66: [1, 117], 68: [1, 118], 70: [1, 119], 71: [1, 120], 73: [1, 121], 92: O, 105: P, 108: G, 109: U, 112: j, 114: z, 117: W, 118: K, 119: H }), e(ie, [2, 196]), e(ie, [2, 157]), e(ie, [2, 158]), e(ie, [2, 159]), e(ie, [2, 160]), e(ie, [2, 161]), e(ie, [2, 162]), e(ie, [2, 163]), e(ie, [2, 164]), e(ie, [2, 165]), e(ie, [2, 166]), e(ie, [2, 167]), e(l, [2, 14]), e(l, [2, 20]), e(l, [2, 21]), { 10: [1, 123] }, e(l, [2, 23]), e(Ut, [2, 31], { 19: 124, 11: Se }), e(D, [2, 32]), { 45: 125, 46: 44, 47: h, 48: 45, 50: 46, 63: x, 92: O, 105: P, 108: G, 109: U, 112: j, 114: z, 116: 47, 117: W, 118: K, 119: H }, e(D, [2, 52]), e(D, [2, 53]), e(D, [2, 54]), e(D, [2, 55]), e(He, [2, 89], { 76: 126, 65: [1, 128], 77: [1, 127] }), { 79: 129, 82: 130, 83: jt, 84: zt, 119: tt, 122: st }, { 78: [1, 135], 80: [1, 136] }, e(Wt, [2, 96]), e(D, [2, 33]), e(D, [2, 34]), e(D, [2, 35]), e(D, [2, 36]), e(D, [2, 37]), { 11: it, 13: nt, 15: rt, 28: at, 29: 137, 33: ot, 35: ut, 36: lt, 47: ct, 63: dt, 78: ht, 83: Kt, 84: Ht, 86: 150, 87: pt, 88: ft, 89: gt, 90: mt, 91: bt, 92: At, 93: kt, 94: 138, 108: Et, 112: Ct, 114: St, 117: xt, 118: Tt, 119: Dt }, e(Ye, a, { 5: 165 }), e(Ye, a, { 5: 166 }), { 11: it, 13: nt, 15: rt, 28: at, 29: 167, 33: ot, 35: ut, 36: lt, 47: ct, 63: dt, 78: ht, 83: Kt, 84: Ht, 86: 150, 87: pt, 88: ft, 89: gt, 90: mt, 91: bt, 92: At, 93: kt, 94: 138, 108: Et, 112: Ct, 114: St, 117: xt, 118: Tt, 119: Dt }, e(D, [2, 49]), e(D, [2, 50]), e(Me, [2, 61], { 47: Yt }), e(Me, [2, 62], { 19: 169, 11: Se, 43: qe }), e(Ie, [2, 57]), { 47: h, 50: 171, 63: x, 92: O, 105: P, 108: G, 109: U, 112: j, 114: z, 116: 47, 117: W, 118: K, 119: H }, { 105: [1, 172], 106: 173, 108: [1, 174] }, { 47: h, 50: 175, 63: x, 92: O, 105: P, 108: G, 109: U, 112: j, 114: z, 116: 47, 117: W, 118: K, 119: H }, { 47: h, 50: 176, 63: x, 92: O, 105: P, 108: G, 109: U, 112: j, 114: z, 116: 47, 117: W, 118: K, 119: H }, e(R, [2, 122], { 11: [1, 177], 99: [1, 178] }), { 83: [1, 179] }, e(R, [2, 130], { 123: 181, 11: [1, 180], 15: we, 47: Ne, 63: Re, 92: Oe, 108: Pe, 109: Ge, 112: Ue, 114: je, 117: ze, 118: We, 119: Ke }), e(R, [2, 132], { 11: [1, 182] }), e(ne, [2, 198]), e(ne, [2, 185]), e(ne, [2, 186]), e(ne, [2, 187]), e(ne, [2, 188]), e(ne, [2, 189]), e(ne, [2, 190]), e(ne, [2, 191]), e(ne, [2, 192]), e(ne, [2, 193]), e(ne, [2, 194]), e(ne, [2, 195]), { 47: h, 50: 183, 63: x, 92: O, 105: P, 108: G, 109: U, 112: j, 114: z, 116: 47, 117: W, 118: K, 119: H }, { 31: 184, 70: v, 83: X, 84: J, 85: 185, 119: F, 120: V, 121: I }, { 31: 192, 70: v, 83: X, 84: J, 85: 185, 119: F, 120: V, 121: I }, { 31: 194, 53: [1, 193], 70: v, 83: X, 84: J, 85: 185, 119: F, 120: V, 121: I }, { 31: 195, 70: v, 83: X, 84: J, 85: 185, 119: F, 120: V, 121: I }, { 31: 196, 70: v, 83: X, 84: J, 85: 185, 119: F, 120: V, 121: I }, { 31: 197, 70: v, 83: X, 84: J, 85: 185, 119: F, 120: V, 121: I }, { 112: [1, 198] }, { 31: 199, 70: v, 83: X, 84: J, 85: 185, 119: F, 120: V, 121: I }, { 31: 200, 68: [1, 201], 70: v, 83: X, 84: J, 85: 185, 119: F, 120: V, 121: I }, { 31: 202, 70: v, 83: X, 84: J, 85: 185, 119: F, 120: V, 121: I }, { 31: 203, 70: v, 83: X, 84: J, 85: 185, 119: F, 120: V, 121: I }, { 31: 204, 70: v, 83: X, 84: J, 85: 185, 119: F, 120: V, 121: I }, e(ie, [2, 197]), e(l, [2, 22]), e(Ut, [2, 30]), e(Me, [2, 59], { 34: 205, 19: 206, 11: Se, 43: ye }), e(He, [2, 86], { 11: [1, 207] }), { 11: [1, 208] }, { 31: 209, 70: v, 83: X, 84: J, 85: 185, 119: F, 120: V, 121: I }, { 80: [1, 210], 82: 211, 119: tt, 122: st }, e(Xe, [2, 92]), e(Xe, [2, 94]), e(Xe, [2, 95]), e(Xe, [2, 183]), e(Xe, [2, 184]), { 79: 212, 82: 130, 83: jt, 84: zt, 119: tt, 122: st }, e(Wt, [2, 97]), { 8: Q, 9: Z, 10: $, 11: it, 12: ee, 13: nt, 15: rt, 22: 214, 28: at, 30: [1, 213], 33: ot, 34: 215, 35: ut, 36: lt, 43: ye, 47: ct, 63: dt, 78: ht, 86: 150, 87: pt, 88: ft, 89: gt, 90: mt, 91: bt, 92: At, 93: kt, 94: 216, 108: Et, 112: Ct, 114: St, 117: xt, 118: Tt, 119: Dt }, e(M, [2, 116]), e(M, [2, 118]), e(M, [2, 119]), e(M, [2, 172]), e(M, [2, 173]), e(M, [2, 174]), e(M, [2, 175]), e(M, [2, 176]), e(M, [2, 177]), e(M, [2, 178]), e(M, [2, 179]), e(M, [2, 180]), e(M, [2, 181]), e(M, [2, 182]), e(M, [2, 103]), e(M, [2, 104]), e(M, [2, 105]), e(M, [2, 106]), e(M, [2, 107]), e(M, [2, 108]), e(M, [2, 109]), e(M, [2, 110]), e(M, [2, 111]), e(M, [2, 112]), e(M, [2, 113]), e(M, [2, 114]), e(M, [2, 115]), { 6: 13, 7: 14, 8: c, 9: f, 10: p, 11: g, 12: b, 21: 20, 23: 21, 24: 22, 25: 23, 26: 24, 27: 25, 28: _, 33: [1, 217], 35: S, 36: B, 37: 29, 38: T, 40: m, 42: d, 45: 33, 46: 44, 47: h, 48: 45, 50: 46, 63: x, 87: N, 88: te, 89: ce, 90: ue, 91: de, 92: O, 105: P, 108: G, 109: U, 112: j, 114: z, 116: 47, 117: W, 118: K, 119: H, 124: De, 125: _e, 126: ve, 127: Fe, 128: Ve }, { 6: 13, 7: 14, 8: c, 9: f, 10: p, 11: g, 12: b, 21: 20, 23: 21, 24: 22, 25: 23, 26: 24, 27: 25, 28: _, 33: [1, 218], 35: S, 36: B, 37: 29, 38: T, 40: m, 42: d, 45: 33, 46: 44, 47: h, 48: 45, 50: 46, 63: x, 87: N, 88: te, 89: ce, 90: ue, 91: de, 92: O, 105: P, 108: G, 109: U, 112: j, 114: z, 116: 47, 117: W, 118: K, 119: H, 124: De, 125: _e, 126: ve, 127: Fe, 128: Ve }, { 8: Q, 9: Z, 10: $, 11: it, 12: ee, 13: nt, 15: rt, 22: 220, 28: at, 30: [1, 219], 33: ot, 34: 221, 35: ut, 36: lt, 43: ye, 47: ct, 63: dt, 78: ht, 86: 150, 87: pt, 88: ft, 89: gt, 90: mt, 91: bt, 92: At, 93: kt, 94: 216, 108: Et, 112: Ct, 114: St, 117: xt, 118: Tt, 119: Dt }, { 11: Se, 19: 222 }, { 47: [1, 223] }, e(Ie, [2, 56]), { 11: [1, 224], 47: h, 63: x, 92: O, 105: P, 108: G, 109: U, 112: j, 114: z, 116: 122, 117: W, 118: K, 119: H }, { 11: [1, 225] }, { 11: [1, 226], 109: [1, 227] }, e(qt, [2, 143]), { 11: [1, 228], 47: h, 63: x, 92: O, 105: P, 108: G, 109: U, 112: j, 114: z, 116: 122, 117: W, 118: K, 119: H }, { 11: [1, 229], 47: h, 63: x, 92: O, 105: P, 108: G, 109: U, 112: j, 114: z, 116: 122, 117: W, 118: K, 119: H }, { 83: [1, 230] }, e(R, [2, 124], { 11: [1, 231] }), e(R, [2, 126], { 11: [1, 232] }), { 83: [1, 233] }, e(ne, [2, 199]), { 83: [1, 234], 101: [1, 235] }, e(Ie, [2, 68], { 116: 122, 47: h, 63: x, 92: O, 105: P, 108: G, 109: U, 112: j, 114: z, 117: W, 118: K, 119: H }), { 32: [1, 236], 70: v, 85: 237, 119: F, 120: V, 121: I }, e(xe, [2, 99]), e(xe, [2, 101]), e(xe, [2, 102]), e(xe, [2, 168]), e(xe, [2, 169]), e(xe, [2, 170]), e(xe, [2, 171]), { 52: [1, 238], 70: v, 85: 237, 119: F, 120: V, 121: I }, { 31: 239, 70: v, 83: X, 84: J, 85: 185, 119: F, 120: V, 121: I }, { 54: [1, 240], 70: v, 85: 237, 119: F, 120: V, 121: I }, { 56: [1, 241], 70: v, 85: 237, 119: F, 120: V, 121: I }, { 58: [1, 242], 70: v, 85: 237, 119: F, 120: V, 121: I }, { 60: [1, 243], 70: v, 85: 237, 119: F, 120: V, 121: I }, { 63: [1, 244] }, { 67: [1, 245], 70: v, 85: 237, 119: F, 120: V, 121: I }, { 69: [1, 246], 70: v, 85: 237, 119: F, 120: V, 121: I }, { 31: 247, 70: v, 83: X, 84: J, 85: 185, 119: F, 120: V, 121: I }, { 32: [1, 248], 70: v, 85: 237, 119: F, 120: V, 121: I }, { 70: v, 72: [1, 249], 74: [1, 250], 85: 237, 119: F, 120: V, 121: I }, { 70: v, 72: [1, 252], 74: [1, 251], 85: 237, 119: F, 120: V, 121: I }, e(Me, [2, 58], { 19: 169, 11: Se, 43: qe }), e(Me, [2, 60], { 47: Yt }), e(He, [2, 88]), e(He, [2, 87]), { 65: [1, 253], 70: v, 85: 237, 119: F, 120: V, 121: I }, e(He, [2, 90]), e(Xe, [2, 93]), { 80: [1, 254], 82: 211, 119: tt, 122: st }, { 31: 255, 70: v, 83: X, 84: J, 85: 185, 119: F, 120: V, 121: I }, e(Ye, a, { 5: 256 }), { 8: Q, 9: Z, 10: $, 12: ee, 22: 257, 43: qe }, e(M, [2, 117]), e(D, [2, 42]), e(D, [2, 43]), { 31: 258, 70: v, 83: X, 84: J, 85: 185, 119: F, 120: V, 121: I }, e(D, [2, 46]), { 8: Q, 9: Z, 10: $, 12: ee, 22: 259, 43: qe }, { 46: 260, 47: h, 48: 45, 50: 46, 63: x, 92: O, 105: P, 108: G, 109: U, 112: j, 114: z, 116: 47, 117: W, 118: K, 119: H }, { 11: Se, 19: 261 }, { 11: he, 63: pe, 87: fe, 95: 262, 108: ge, 110: 263, 111: 264, 112: me, 113: be, 114: Ae, 115: ke }, { 11: he, 63: pe, 87: fe, 95: 273, 107: [1, 274], 108: ge, 110: 263, 111: 264, 112: me, 113: be, 114: Ae, 115: ke }, { 11: he, 63: pe, 87: fe, 95: 275, 107: [1, 276], 108: ge, 110: 263, 111: 264, 112: me, 113: be, 114: Ae, 115: ke }, { 108: [1, 277] }, { 11: he, 63: pe, 87: fe, 95: 278, 108: ge, 110: 263, 111: 264, 112: me, 113: be, 114: Ae, 115: ke }, { 47: h, 50: 279, 63: x, 92: O, 105: P, 108: G, 109: U, 112: j, 114: z, 116: 47, 117: W, 118: K, 119: H }, e(R, [2, 123]), { 83: [1, 280] }, { 83: [1, 281], 101: [1, 282] }, e(R, [2, 131]), e(R, [2, 133], { 11: [1, 283] }), e(R, [2, 134]), e(q, [2, 69]), e(xe, [2, 100]), e(q, [2, 70]), { 54: [1, 284], 70: v, 85: 237, 119: F, 120: V, 121: I }, e(q, [2, 77]), e(q, [2, 72]), e(q, [2, 73]), e(q, [2, 74]), { 112: [1, 285] }, e(q, [2, 76]), e(q, [2, 78]), { 69: [1, 286], 70: v, 85: 237, 119: F, 120: V, 121: I }, e(q, [2, 80]), e(q, [2, 81]), e(q, [2, 83]), e(q, [2, 82]), e(q, [2, 84]), e([11, 47, 63, 92, 105, 108, 109, 112, 114, 117, 118, 119], [2, 98]), e(He, [2, 91]), { 32: [1, 287], 70: v, 85: 237, 119: F, 120: V, 121: I }, { 6: 13, 7: 14, 8: c, 9: f, 10: p, 11: g, 12: b, 21: 20, 23: 21, 24: 22, 25: 23, 26: 24, 27: 25, 28: _, 33: [1, 288], 35: S, 36: B, 37: 29, 38: T, 40: m, 42: d, 45: 33, 46: 44, 47: h, 48: 45, 50: 46, 63: x, 87: N, 88: te, 89: ce, 90: ue, 91: de, 92: O, 105: P, 108: G, 109: U, 112: j, 114: z, 116: 47, 117: W, 118: K, 119: H, 124: De, 125: _e, 126: ve, 127: Fe, 128: Ve }, e(Ye, a, { 5: 289 }), { 32: [1, 290], 70: v, 85: 237, 119: F, 120: V, 121: I }, e(D, [2, 47]), e(Ie, [2, 66]), { 46: 291, 47: h, 48: 45, 50: 46, 63: x, 92: O, 105: P, 108: G, 109: U, 112: j, 114: z, 116: 47, 117: W, 118: K, 119: H }, e(R, [2, 136], { 109: Je }), e(Xt, [2, 145], { 111: 293, 11: he, 63: pe, 87: fe, 108: ge, 112: me, 113: be, 114: Ae, 115: ke }), e(le, [2, 147]), e(le, [2, 149]), e(le, [2, 150]), e(le, [2, 151]), e(le, [2, 152]), e(le, [2, 153]), e(le, [2, 154]), e(le, [2, 155]), e(le, [2, 156]), e(R, [2, 137], { 109: Je }), { 11: [1, 294] }, e(R, [2, 138], { 109: Je }), { 11: [1, 295] }, e(qt, [2, 144]), e(R, [2, 120], { 109: Je }), e(R, [2, 121], { 116: 122, 47: h, 63: x, 92: O, 105: P, 108: G, 109: U, 112: j, 114: z, 117: W, 118: K, 119: H }), e(R, [2, 125]), e(R, [2, 127], { 11: [1, 296] }), e(R, [2, 128]), { 101: [1, 297] }, { 54: [1, 298] }, { 65: [1, 299] }, { 69: [1, 300] }, { 8: Q, 9: Z, 10: $, 12: ee, 22: 301, 34: 302, 43: ye }, e(D, [2, 40]), { 6: 13, 7: 14, 8: c, 9: f, 10: p, 11: g, 12: b, 21: 20, 23: 21, 24: 22, 25: 23, 26: 24, 27: 25, 28: _, 33: [1, 303], 35: S, 36: B, 37: 29, 38: T, 40: m, 42: d, 45: 33, 46: 44, 47: h, 48: 45, 50: 46, 63: x, 87: N, 88: te, 89: ce, 90: ue, 91: de, 92: O, 105: P, 108: G, 109: U, 112: j, 114: z, 116: 47, 117: W, 118: K, 119: H, 124: De, 125: _e, 126: ve, 127: Fe, 128: Ve }, { 8: Q, 9: Z, 10: $, 12: ee, 22: 304, 34: 305, 43: ye }, e(Ie, [2, 65]), { 11: he, 63: pe, 87: fe, 108: ge, 110: 306, 111: 264, 112: me, 113: be, 114: Ae, 115: ke }, e(le, [2, 148]), { 15: we, 47: Ne, 63: Re, 92: Oe, 104: 307, 108: Pe, 109: Ge, 112: Ue, 114: je, 117: ze, 118: We, 119: Ke, 123: 97 }, { 15: we, 47: Ne, 63: Re, 92: Oe, 104: 308, 108: Pe, 109: Ge, 112: Ue, 114: je, 117: ze, 118: We, 119: Ke, 123: 97 }, { 101: [1, 309] }, e(R, [2, 135]), e(q, [2, 71]), { 31: 310, 70: v, 83: X, 84: J, 85: 185, 119: F, 120: V, 121: I }, e(q, [2, 79]), e(Ye, a, { 5: 311 }), { 8: Q, 9: Z, 10: $, 12: ee, 22: 312, 43: qe }, e(D, [2, 41]), e(D, [2, 44]), { 8: Q, 9: Z, 10: $, 12: ee, 22: 313, 43: qe }, e(Xt, [2, 146], { 111: 293, 11: he, 63: pe, 87: fe, 108: ge, 112: me, 113: be, 114: Ae, 115: ke }), e(R, [2, 141], { 123: 181, 11: [1, 314], 15: we, 47: Ne, 63: Re, 92: Oe, 108: Pe, 109: Ge, 112: Ue, 114: je, 117: ze, 118: We, 119: Ke }), e(R, [2, 142], { 123: 181, 11: [1, 315], 15: we, 47: Ne, 63: Re, 92: Oe, 108: Pe, 109: Ge, 112: Ue, 114: je, 117: ze, 118: We, 119: Ke }), e(R, [2, 129]), { 32: [1, 316], 70: v, 85: 237, 119: F, 120: V, 121: I }, { 6: 13, 7: 14, 8: c, 9: f, 10: p, 11: g, 12: b, 21: 20, 23: 21, 24: 22, 25: 23, 26: 24, 27: 25, 28: _, 33: [1, 317], 35: S, 36: B, 37: 29, 38: T, 40: m, 42: d, 45: 33, 46: 44, 47: h, 48: 45, 50: 46, 63: x, 87: N, 88: te, 89: ce, 90: ue, 91: de, 92: O, 105: P, 108: G, 109: U, 112: j, 114: z, 116: 47, 117: W, 118: K, 119: H, 124: De, 125: _e, 126: ve, 127: Fe, 128: Ve }, e(Ye, a, { 5: 318 }), e(D, [2, 45]), { 11: he, 63: pe, 87: fe, 95: 319, 108: ge, 110: 263, 111: 264, 112: me, 113: be, 114: Ae, 115: ke }, { 11: he, 63: pe, 87: fe, 95: 320, 108: ge, 110: 263, 111: 264, 112: me, 113: be, 114: Ae, 115: ke }, e(q, [2, 75]), e(D, [2, 38]), { 6: 13, 7: 14, 8: c, 9: f, 10: p, 11: g, 12: b, 21: 20, 23: 21, 24: 22, 25: 23, 26: 24, 27: 25, 28: _, 33: [1, 321], 35: S, 36: B, 37: 29, 38: T, 40: m, 42: d, 45: 33, 46: 44, 47: h, 48: 45, 50: 46, 63: x, 87: N, 88: te, 89: ce, 90: ue, 91: de, 92: O, 105: P, 108: G, 109: U, 112: j, 114: z, 116: 47, 117: W, 118: K, 119: H, 124: De, 125: _e, 126: ve, 127: Fe, 128: Ve }, e(R, [2, 139], { 109: Je }), e(R, [2, 140], { 109: Je }), e(D, [2, 39])],
1863
- defaultActions: {},
1864
- parseError: /* @__PURE__ */ k(function(A, E) {
1865
- if (E.recoverable)
1866
- this.trace(A);
1867
- else {
1868
- var C = new Error(A);
1869
- throw C.hash = E, C;
1870
- }
1871
- }, "parseError"),
1872
- parse: /* @__PURE__ */ k(function(A) {
1873
- var E = this, C = [0], o = [], y = [null], t = [], L = this.table, s = "", w = 0, Jt = 0, f1 = 2, Qt = 1, g1 = t.slice.call(arguments, 1), Y = Object.create(this.lexer), Le = { yy: {} };
1874
- for (var Bt in this.yy)
1875
- Object.prototype.hasOwnProperty.call(this.yy, Bt) && (Le.yy[Bt] = this.yy[Bt]);
1876
- Y.setInput(A, Le.yy), Le.yy.lexer = Y, Le.yy.parser = this, typeof Y.yylloc > "u" && (Y.yylloc = {});
1877
- var Mt = Y.yylloc;
1878
- t.push(Mt);
1879
- var m1 = Y.options && Y.options.ranges;
1880
- typeof Le.yy.parseError == "function" ? this.parseError = Le.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
1881
- function b1(re) {
1882
- C.length = C.length - 2 * re, y.length = y.length - re, t.length = t.length - re;
1883
- }
1884
- k(b1, "popStack");
1885
- function Zt() {
1886
- var re;
1887
- return re = o.pop() || Y.lex() || Qt, typeof re != "number" && (re instanceof Array && (o = re, re = o.pop()), re = E.symbols_[re] || re), re;
1888
- }
1889
- k(Zt, "lex");
1890
- for (var se, Be, oe, yt, Qe = {}, vt, Ee, $t, Ft; ; ) {
1891
- if (Be = C[C.length - 1], this.defaultActions[Be] ? oe = this.defaultActions[Be] : ((se === null || typeof se > "u") && (se = Zt()), oe = L[Be] && L[Be][se]), typeof oe > "u" || !oe.length || !oe[0]) {
1892
- var wt = "";
1893
- Ft = [];
1894
- for (vt in L[Be])
1895
- this.terminals_[vt] && vt > f1 && Ft.push("'" + this.terminals_[vt] + "'");
1896
- Y.showPosition ? wt = "Parse error on line " + (w + 1) + `:
1897
- ` + Y.showPosition() + `
1898
- Expecting ` + Ft.join(", ") + ", got '" + (this.terminals_[se] || se) + "'" : wt = "Parse error on line " + (w + 1) + ": Unexpected " + (se == Qt ? "end of input" : "'" + (this.terminals_[se] || se) + "'"), this.parseError(wt, {
1899
- text: Y.match,
1900
- token: this.terminals_[se] || se,
1901
- line: Y.yylineno,
1902
- loc: Mt,
1903
- expected: Ft
1904
- });
1905
- }
1906
- if (oe[0] instanceof Array && oe.length > 1)
1907
- throw new Error("Parse Error: multiple actions possible at state: " + Be + ", token: " + se);
1908
- switch (oe[0]) {
1909
- case 1:
1910
- C.push(se), y.push(Y.yytext), t.push(Y.yylloc), C.push(oe[1]), se = null, Jt = Y.yyleng, s = Y.yytext, w = Y.yylineno, Mt = Y.yylloc;
1911
- break;
1912
- case 2:
1913
- if (Ee = this.productions_[oe[1]][1], Qe.$ = y[y.length - Ee], Qe._$ = {
1914
- first_line: t[t.length - (Ee || 1)].first_line,
1915
- last_line: t[t.length - 1].last_line,
1916
- first_column: t[t.length - (Ee || 1)].first_column,
1917
- last_column: t[t.length - 1].last_column
1918
- }, m1 && (Qe._$.range = [
1919
- t[t.length - (Ee || 1)].range[0],
1920
- t[t.length - 1].range[1]
1921
- ]), yt = this.performAction.apply(Qe, [
1922
- s,
1923
- Jt,
1924
- w,
1925
- Le.yy,
1926
- oe[1],
1927
- y,
1928
- t
1929
- ].concat(g1)), typeof yt < "u")
1930
- return yt;
1931
- Ee && (C = C.slice(0, -1 * Ee * 2), y = y.slice(0, -1 * Ee), t = t.slice(0, -1 * Ee)), C.push(this.productions_[oe[1]][0]), y.push(Qe.$), t.push(Qe._$), $t = L[C[C.length - 2]][C[C.length - 1]], C.push($t);
1932
- break;
1933
- case 3:
1934
- return !0;
1935
- }
1936
- }
1937
- return !0;
1938
- }, "parse")
1939
- }, p1 = /* @__PURE__ */ (function() {
1940
- var Te = {
1941
- EOF: 1,
1942
- parseError: /* @__PURE__ */ k(function(E, C) {
1943
- if (this.yy.parser)
1944
- this.yy.parser.parseError(E, C);
1945
- else
1946
- throw new Error(E);
1947
- }, "parseError"),
1948
- // resets the lexer, sets new input
1949
- setInput: /* @__PURE__ */ k(function(A, E) {
1950
- return this.yy = E || this.yy || {}, this._input = A, this._more = this._backtrack = this.done = !1, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = {
1951
- first_line: 1,
1952
- first_column: 0,
1953
- last_line: 1,
1954
- last_column: 0
1955
- }, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this;
1956
- }, "setInput"),
1957
- // consumes and returns one char from the input
1958
- input: /* @__PURE__ */ k(function() {
1959
- var A = this._input[0];
1960
- this.yytext += A, this.yyleng++, this.offset++, this.match += A, this.matched += A;
1961
- var E = A.match(/(?:\r\n?|\n).*/g);
1962
- return E ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), A;
1963
- }, "input"),
1964
- // unshifts one char (or a string) into the input
1965
- unput: /* @__PURE__ */ k(function(A) {
1966
- var E = A.length, C = A.split(/(?:\r\n?|\n)/g);
1967
- this._input = A + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - E), this.offset -= E;
1968
- var o = this.match.split(/(?:\r\n?|\n)/g);
1969
- this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), C.length - 1 && (this.yylineno -= C.length - 1);
1970
- var y = this.yylloc.range;
1971
- return this.yylloc = {
1972
- first_line: this.yylloc.first_line,
1973
- last_line: this.yylineno + 1,
1974
- first_column: this.yylloc.first_column,
1975
- last_column: C ? (C.length === o.length ? this.yylloc.first_column : 0) + o[o.length - C.length].length - C[0].length : this.yylloc.first_column - E
1976
- }, this.options.ranges && (this.yylloc.range = [y[0], y[0] + this.yyleng - E]), this.yyleng = this.yytext.length, this;
1977
- }, "unput"),
1978
- // When called from action, caches matched text and appends it on next action
1979
- more: /* @__PURE__ */ k(function() {
1980
- return this._more = !0, this;
1981
- }, "more"),
1982
- // When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead.
1983
- reject: /* @__PURE__ */ k(function() {
1984
- if (this.options.backtrack_lexer)
1985
- this._backtrack = !0;
1986
- else
1987
- return this.parseError("Lexical error on line " + (this.yylineno + 1) + `. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
1988
- ` + this.showPosition(), {
1989
- text: "",
1990
- token: null,
1991
- line: this.yylineno
1992
- });
1993
- return this;
1994
- }, "reject"),
1995
- // retain first n characters of the match
1996
- less: /* @__PURE__ */ k(function(A) {
1997
- this.unput(this.match.slice(A));
1998
- }, "less"),
1999
- // displays already matched input, i.e. for error messages
2000
- pastInput: /* @__PURE__ */ k(function() {
2001
- var A = this.matched.substr(0, this.matched.length - this.match.length);
2002
- return (A.length > 20 ? "..." : "") + A.substr(-20).replace(/\n/g, "");
2003
- }, "pastInput"),
2004
- // displays upcoming input, i.e. for error messages
2005
- upcomingInput: /* @__PURE__ */ k(function() {
2006
- var A = this.match;
2007
- return A.length < 20 && (A += this._input.substr(0, 20 - A.length)), (A.substr(0, 20) + (A.length > 20 ? "..." : "")).replace(/\n/g, "");
2008
- }, "upcomingInput"),
2009
- // displays the character position where the lexing error occurred, i.e. for error messages
2010
- showPosition: /* @__PURE__ */ k(function() {
2011
- var A = this.pastInput(), E = new Array(A.length + 1).join("-");
2012
- return A + this.upcomingInput() + `
2013
- ` + E + "^";
2014
- }, "showPosition"),
2015
- // test the lexed token: return FALSE when not a match, otherwise return token
2016
- test_match: /* @__PURE__ */ k(function(A, E) {
2017
- var C, o, y;
2018
- if (this.options.backtrack_lexer && (y = {
2019
- yylineno: this.yylineno,
2020
- yylloc: {
2021
- first_line: this.yylloc.first_line,
2022
- last_line: this.last_line,
2023
- first_column: this.yylloc.first_column,
2024
- last_column: this.yylloc.last_column
2025
- },
2026
- yytext: this.yytext,
2027
- match: this.match,
2028
- matches: this.matches,
2029
- matched: this.matched,
2030
- yyleng: this.yyleng,
2031
- offset: this.offset,
2032
- _more: this._more,
2033
- _input: this._input,
2034
- yy: this.yy,
2035
- conditionStack: this.conditionStack.slice(0),
2036
- done: this.done
2037
- }, this.options.ranges && (y.yylloc.range = this.yylloc.range.slice(0))), o = A[0].match(/(?:\r\n?|\n).*/g), o && (this.yylineno += o.length), this.yylloc = {
2038
- first_line: this.yylloc.last_line,
2039
- last_line: this.yylineno + 1,
2040
- first_column: this.yylloc.last_column,
2041
- last_column: o ? o[o.length - 1].length - o[o.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + A[0].length
2042
- }, this.yytext += A[0], this.match += A[0], this.matches = A, this.yyleng = this.yytext.length, this.options.ranges && (this.yylloc.range = [this.offset, this.offset += this.yyleng]), this._more = !1, this._backtrack = !1, this._input = this._input.slice(A[0].length), this.matched += A[0], C = this.performAction.call(this, this.yy, this, E, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), C)
2043
- return C;
2044
- if (this._backtrack) {
2045
- for (var t in y)
2046
- this[t] = y[t];
2047
- return !1;
2048
- }
2049
- return !1;
2050
- }, "test_match"),
2051
- // return next match in input
2052
- next: /* @__PURE__ */ k(function() {
2053
- if (this.done)
2054
- return this.EOF;
2055
- this._input || (this.done = !0);
2056
- var A, E, C, o;
2057
- this._more || (this.yytext = "", this.match = "");
2058
- for (var y = this._currentRules(), t = 0; t < y.length; t++)
2059
- if (C = this._input.match(this.rules[y[t]]), C && (!E || C[0].length > E[0].length)) {
2060
- if (E = C, o = t, this.options.backtrack_lexer) {
2061
- if (A = this.test_match(C, y[t]), A !== !1)
2062
- return A;
2063
- if (this._backtrack) {
2064
- E = !1;
2065
- continue;
2066
- } else
2067
- return !1;
2068
- } else if (!this.options.flex)
2069
- break;
2070
- }
2071
- return E ? (A = this.test_match(E, y[o]), A !== !1 ? A : !1) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + `. Unrecognized text.
2072
- ` + this.showPosition(), {
2073
- text: "",
2074
- token: null,
2075
- line: this.yylineno
2076
- });
2077
- }, "next"),
2078
- // return next match that has a token
2079
- lex: /* @__PURE__ */ k(function() {
2080
- var E = this.next();
2081
- return E || this.lex();
2082
- }, "lex"),
2083
- // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
2084
- begin: /* @__PURE__ */ k(function(E) {
2085
- this.conditionStack.push(E);
2086
- }, "begin"),
2087
- // pop the previously active lexer condition state off the condition stack
2088
- popState: /* @__PURE__ */ k(function() {
2089
- var E = this.conditionStack.length - 1;
2090
- return E > 0 ? this.conditionStack.pop() : this.conditionStack[0];
2091
- }, "popState"),
2092
- // produce the lexer rule set which is active for the currently active lexer condition state
2093
- _currentRules: /* @__PURE__ */ k(function() {
2094
- return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules;
2095
- }, "_currentRules"),
2096
- // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
2097
- topState: /* @__PURE__ */ k(function(E) {
2098
- return E = this.conditionStack.length - 1 - Math.abs(E || 0), E >= 0 ? this.conditionStack[E] : "INITIAL";
2099
- }, "topState"),
2100
- // alias for begin(condition)
2101
- pushState: /* @__PURE__ */ k(function(E) {
2102
- this.begin(E);
2103
- }, "pushState"),
2104
- // return the number of states currently on the stack
2105
- stateStackSize: /* @__PURE__ */ k(function() {
2106
- return this.conditionStack.length;
2107
- }, "stateStackSize"),
2108
- options: {},
2109
- performAction: /* @__PURE__ */ k(function(E, C, o, y) {
2110
- switch (o) {
2111
- case 0:
2112
- return this.begin("acc_title"), 38;
2113
- case 1:
2114
- return this.popState(), "acc_title_value";
2115
- case 2:
2116
- return this.begin("acc_descr"), 40;
2117
- case 3:
2118
- return this.popState(), "acc_descr_value";
2119
- case 4:
2120
- this.begin("acc_descr_multiline");
2121
- break;
2122
- case 5:
2123
- this.popState();
2124
- break;
2125
- case 6:
2126
- return "acc_descr_multiline_value";
2127
- case 7:
2128
- return this.pushState("shapeData"), C.yytext = "", 43;
2129
- case 8:
2130
- return this.pushState("shapeDataStr"), 43;
2131
- case 9:
2132
- return this.popState(), 43;
2133
- case 10:
2134
- const t = /\n\s*/g;
2135
- return C.yytext = C.yytext.replace(t, "<br/>"), 43;
2136
- case 11:
2137
- return 43;
2138
- case 12:
2139
- this.popState();
2140
- break;
2141
- case 13:
2142
- this.begin("callbackname");
2143
- break;
2144
- case 14:
2145
- this.popState();
2146
- break;
2147
- case 15:
2148
- this.popState(), this.begin("callbackargs");
2149
- break;
2150
- case 16:
2151
- return 98;
2152
- case 17:
2153
- this.popState();
2154
- break;
2155
- case 18:
2156
- return 99;
2157
- case 19:
2158
- return "MD_STR";
2159
- case 20:
2160
- this.popState();
2161
- break;
2162
- case 21:
2163
- this.begin("md_string");
2164
- break;
2165
- case 22:
2166
- return "STR";
2167
- case 23:
2168
- this.popState();
2169
- break;
2170
- case 24:
2171
- this.pushState("string");
2172
- break;
2173
- case 25:
2174
- return 87;
2175
- case 26:
2176
- return 105;
2177
- case 27:
2178
- return 88;
2179
- case 28:
2180
- return 107;
2181
- case 29:
2182
- return 89;
2183
- case 30:
2184
- return 90;
2185
- case 31:
2186
- return 100;
2187
- case 32:
2188
- this.begin("click");
2189
- break;
2190
- case 33:
2191
- this.popState();
2192
- break;
2193
- case 34:
2194
- return 91;
2195
- case 35:
2196
- return E.lex.firstGraph() && this.begin("dir"), 13;
2197
- case 36:
2198
- return 28;
2199
- case 37:
2200
- return 36;
2201
- case 38:
2202
- return 35;
2203
- case 39:
2204
- return 33;
2205
- case 40:
2206
- return 101;
2207
- case 41:
2208
- return 101;
2209
- case 42:
2210
- return 101;
2211
- case 43:
2212
- return 101;
2213
- case 44:
2214
- return this.popState(), 14;
2215
- case 45:
2216
- return this.popState(), 15;
2217
- case 46:
2218
- return this.popState(), 15;
2219
- case 47:
2220
- return this.popState(), 15;
2221
- case 48:
2222
- return this.popState(), 15;
2223
- case 49:
2224
- return this.popState(), 15;
2225
- case 50:
2226
- return this.popState(), 15;
2227
- case 51:
2228
- return this.popState(), 15;
2229
- case 52:
2230
- return this.popState(), 15;
2231
- case 53:
2232
- return this.popState(), 15;
2233
- case 54:
2234
- return this.popState(), 15;
2235
- case 55:
2236
- return 124;
2237
- case 56:
2238
- return 125;
2239
- case 57:
2240
- return 126;
2241
- case 58:
2242
- return 127;
2243
- case 59:
2244
- return 128;
2245
- case 60:
2246
- return 81;
2247
- case 61:
2248
- return 108;
2249
- case 62:
2250
- return 114;
2251
- case 63:
2252
- return 49;
2253
- case 64:
2254
- return 63;
2255
- case 65:
2256
- return 47;
2257
- case 66:
2258
- return 9;
2259
- case 67:
2260
- return 109;
2261
- case 68:
2262
- return 118;
2263
- case 69:
2264
- return this.popState(), 80;
2265
- case 70:
2266
- return this.pushState("edgeText"), 78;
2267
- case 71:
2268
- return 122;
2269
- case 72:
2270
- return 80;
2271
- case 73:
2272
- break;
2273
- case 74:
2274
- return this.popState(), 56;
2275
- case 75:
2276
- return "TEXT";
2277
- case 76:
2278
- return this.pushState("ellipseText"), 55;
2279
- case 77:
2280
- return this.popState(), 58;
2281
- case 78:
2282
- return this.pushState("text"), 57;
2283
- case 79:
2284
- return this.popState(), 60;
2285
- case 80:
2286
- return this.pushState("text"), 59;
2287
- case 81:
2288
- return 61;
2289
- case 82:
2290
- return this.pushState("text"), 70;
2291
- case 83:
2292
- return this.popState(), 67;
2293
- case 84:
2294
- return this.pushState("text"), 66;
2295
- case 85:
2296
- return this.popState(), 52;
2297
- case 86:
2298
- return this.pushState("text"), 51;
2299
- case 87:
2300
- break;
2301
- case 88:
2302
- return this.popState(), 72;
2303
- case 89:
2304
- return this.popState(), 74;
2305
- case 90:
2306
- return 120;
2307
- case 91:
2308
- return this.pushState("trapText"), 71;
2309
- case 92:
2310
- return this.pushState("trapText"), 73;
2311
- case 93:
2312
- return 121;
2313
- case 94:
2314
- return 70;
2315
- case 95:
2316
- return 93;
2317
- case 96:
2318
- return "SEP";
2319
- case 97:
2320
- return 92;
2321
- case 98:
2322
- return 118;
2323
- case 99:
2324
- return 114;
2325
- case 100:
2326
- return 47;
2327
- case 101:
2328
- return 8;
2329
- case 102:
2330
- return 112;
2331
- case 103:
2332
- return 117;
2333
- case 104:
2334
- return 119;
2335
- case 105:
2336
- return this.popState(), 65;
2337
- case 106:
2338
- return this.pushState("text"), 65;
2339
- case 107:
2340
- return this.popState(), 54;
2341
- case 108:
2342
- return this.pushState("text"), 53;
2343
- case 109:
2344
- return this.popState(), 32;
2345
- case 110:
2346
- return this.pushState("text"), 30;
2347
- case 111:
2348
- return this.popState(), 69;
2349
- case 112:
2350
- return this.pushState("text"), 68;
2351
- case 113:
2352
- break;
2353
- case 114:
2354
- return "TEXT";
2355
- case 115:
2356
- return "QUOTE";
2357
- case 116:
2358
- return 10;
2359
- case 117:
2360
- return 11;
2361
- case 118:
2362
- return 12;
2363
- }
2364
- }, "anonymous"),
2365
- rules: [/^(?:accTitle\s*:\s*)/, /^(?:(?!\n||)*[^\n]*)/, /^(?:accDescr\s*:\s*)/, /^(?:(?!\n||)*[^\n]*)/, /^(?:accDescr\s*\{\s*)/, /^(?:[\}])/, /^(?:[^\}]*)/, /^(?:@\{)/, /^(?:["])/, /^(?:["])/, /^(?:[^\"]+)/, /^(?:[^}^"]+)/, /^(?:\})/, /^(?:call[\s]+)/, /^(?:\([\s]*\))/, /^(?:\()/, /^(?:[^(]*)/, /^(?:\))/, /^(?:[^)]*)/, /^(?:[^`"]+)/, /^(?:[`]["])/, /^(?:["][`])/, /^(?:[^"]+)/, /^(?:["])/, /^(?:["])/, /^(?:style\b)/, /^(?:default\b)/, /^(?:linkStyle\b)/, /^(?:interpolate\b)/, /^(?:classDef\b)/, /^(?:class\b)/, /^(?:href[\s])/, /^(?:click[\s]+)/, /^(?:[\s\n])/, /^(?:[^\s\n]*)/, /^(?:agentflow-beta\b)/, /^(?:flow\b)/, /^(?:connector\b)/, /^(?:global\b[ \t]*)/, /^(?:end\b[ \t]*)/, /^(?:_self\b)/, /^(?:_blank\b)/, /^(?:_parent\b)/, /^(?:_top\b)/, /^(?:(\r?\n)*\s*\n)/, /^(?:\s*LR\b)/, /^(?:\s*RL\b)/, /^(?:\s*TB\b)/, /^(?:\s*BT\b)/, /^(?:\s*TD\b)/, /^(?:\s*BR\b)/, /^(?:\s*<)/, /^(?:\s*>)/, /^(?:\s*\^)/, /^(?:\s*v\b)/, /^(?:.*direction\s+TB[^\n]*)/, /^(?:.*direction\s+BT[^\n]*)/, /^(?:.*direction\s+RL[^\n]*)/, /^(?:.*direction\s+LR[^\n]*)/, /^(?:.*direction\s+TD[^\n]*)/, /^(?:[^\s\"]+@(?=[^\{\"]))/, /^(?:[0-9]+)/, /^(?:#)/, /^(?::::)/, /^(?::)/, /^(?:&)/, /^(?:;)/, /^(?:,)/, /^(?:\*)/, /^(?:\s*--+[x>]\s*)/, /^(?:\s*--\s*)/, /^(?:[^-]|-(?!-)+)/, /^(?:\s*-\.+-\s*)/, /^(?:%%(?!\{)[^\n]*)/, /^(?:[-/\)][\)])/, /^(?:[^\(\)\[\]\{\}]|!\)+)/, /^(?:\(-)/, /^(?:\]\))/, /^(?:\(\[)/, /^(?:\]\])/, /^(?:\[\[)/, /^(?:\[\|)/, /^(?:>)/, /^(?:\)\])/, /^(?:\[\()/, /^(?:\)\)\))/, /^(?:\(\(\()/, /^(?:%%(?!\{)[^\n]*)/, /^(?:[\\(?=\])][\]])/, /^(?:\/(?=\])\])/, /^(?:\/(?!\])|\\(?!\])|(?:[^\\\[\]\(\)\{\}\/%]+|(?!))+)/, /^(?:\[\/)/, /^(?:\[\\)/, /^(?:<)/, /^(?:>)/, /^(?:\^)/, /^(?:\\\|)/, /^(?:v\b)/, /^(?:\*)/, /^(?:#)/, /^(?:&)/, /^(?:[ \t]*%%(?!\{)[^\n]*)/, /^(?:([A-Za-z0-9!"\#$%&'*+\.`?\\_\/]|-(?=[^\>\-\.])|(?!))+)/, /^(?:-)/, /^(?:[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC])/, /^(?:\|)/, /^(?:\|)/, /^(?:\))/, /^(?:\()/, /^(?:\])/, /^(?:\[)/, /^(?:(\}))/, /^(?:\{)/, /^(?:%%(?!\{)[^\n]*)/, /^(?:(?:[^\[\]\(\)\{\}\|\"%]+|(?!))+)/, /^(?:")/, /^(?:(\r?\n)+)/, /^(?:\s)/, /^(?:$)/],
2366
- conditions: { shapeDataEndBracket: { rules: [21, 24, 76, 78, 80, 84, 86, 91, 92, 106, 108, 110, 112], inclusive: !1 }, shapeDataStr: { rules: [9, 10, 21, 24, 76, 78, 80, 84, 86, 91, 92, 106, 108, 110, 112], inclusive: !1 }, shapeData: { rules: [8, 11, 12, 21, 24, 76, 78, 80, 84, 86, 91, 92, 106, 108, 110, 112], inclusive: !1 }, callbackargs: { rules: [17, 18, 21, 24, 76, 78, 80, 84, 86, 91, 92, 106, 108, 110, 112], inclusive: !1 }, callbackname: { rules: [14, 15, 16, 21, 24, 76, 78, 80, 84, 86, 91, 92, 106, 108, 110, 112], inclusive: !1 }, href: { rules: [21, 24, 76, 78, 80, 84, 86, 91, 92, 106, 108, 110, 112], inclusive: !1 }, click: { rules: [21, 24, 33, 34, 76, 78, 80, 84, 86, 91, 92, 106, 108, 110, 112], inclusive: !1 }, edgeText: { rules: [21, 24, 69, 71, 76, 78, 80, 84, 86, 91, 92, 106, 108, 110, 112], inclusive: !1 }, trapText: { rules: [21, 24, 76, 78, 80, 84, 86, 87, 88, 89, 90, 91, 92, 106, 108, 110, 112], inclusive: !1 }, ellipseText: { rules: [21, 24, 73, 74, 75, 76, 78, 80, 84, 86, 91, 92, 106, 108, 110, 112], inclusive: !1 }, text: { rules: [21, 24, 76, 77, 78, 79, 80, 83, 84, 85, 86, 91, 92, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114], inclusive: !1 }, vertex: { rules: [21, 24, 76, 78, 80, 84, 86, 91, 92, 106, 108, 110, 112], inclusive: !1 }, dir: { rules: [21, 24, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 76, 78, 80, 84, 86, 91, 92, 106, 108, 110, 112], inclusive: !1 }, acc_descr_multiline: { rules: [5, 6, 21, 24, 76, 78, 80, 84, 86, 91, 92, 106, 108, 110, 112], inclusive: !1 }, acc_descr: { rules: [3, 21, 24, 76, 78, 80, 84, 86, 91, 92, 106, 108, 110, 112], inclusive: !1 }, acc_title: { rules: [1, 21, 24, 76, 78, 80, 84, 86, 91, 92, 106, 108, 110, 112], inclusive: !1 }, md_string: { rules: [19, 20, 21, 24, 76, 78, 80, 84, 86, 91, 92, 106, 108, 110, 112], inclusive: !1 }, string: { rules: [21, 22, 23, 24, 76, 78, 80, 84, 86, 91, 92, 106, 108, 110, 112], inclusive: !1 }, INITIAL: { rules: [0, 2, 4, 7, 13, 21, 24, 25, 26, 27, 28, 29, 30, 31, 32, 35, 36, 37, 38, 39, 40, 41, 42, 43, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 72, 76, 78, 80, 81, 82, 84, 86, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 106, 108, 110, 112, 115, 116, 117, 118], inclusive: !0 } }
2367
- };
2368
- return Te;
2369
- })();
2370
- Lt.lexer = p1;
2371
- function _t() {
2372
- this.yy = {};
2373
- }
2374
- return k(_t, "Parser"), _t.prototype = Lt, Lt.Parser = _t, new _t();
2375
- })();
2376
- Gt.parser = Gt;
2377
- var d1 = Gt, h1 = Object.assign({}, d1);
2378
- h1.parse = (e) => {
2379
- const i = e.replace(/}[^\S\n]*\n/g, `}
2380
- `);
2381
- return d1.parse(i);
2382
- };
2383
- var Z1 = h1, $1 = /* @__PURE__ */ k((e) => {
2384
- const { theme: i, bkgColorArray: n, borderColorArray: r } = e;
2385
- if (!y1(i, r))
2386
- return "";
2387
- const u = w1(e.look), l = N1(n), a = R1(e.THEME_COLOR_LIMIT, r), c = /* @__PURE__ */ k((g) => r[g % r.length], "border"), f = /* @__PURE__ */ k((g) => l ? `fill: ${n[g % n.length]};` : "", "fill");
2388
- let p = "";
2389
- for (const g of K1) {
2390
- const b = It.get(g), _ = `[data-look="${u}"].node.${a1(g)}`;
2391
- p += `
2392
-
2393
- ${_} rect,
2394
- ${_} path,
2395
- ${_} polygon {
2396
- stroke: ${c(b)};
2397
- ${f(b)}
2398
- }
2399
- `;
2400
- }
2401
- for (let g = 0; g < o1(a); g++) {
2402
- const b = u1(g, a), _ = `[data-look="${u}"][data-color-id="color-${b}"].cluster`, S = `[data-look="${u}"][data-color-id="color-${b}"].node`, B = /* @__PURE__ */ k((T) => `${_} ${T}, ${S} ${T}`, "rule");
2403
- p += `
2404
-
2405
- ${B("rect")},
2406
- ${B("path")} {
2407
- stroke: ${c(b)};
2408
- ${f(b)}
2409
- }
2410
- `;
2411
- }
2412
- return p;
2413
- }, "genColor"), es = /* @__PURE__ */ k((e, i) => {
2414
- const n = G1, r = n(e, "r"), u = n(e, "g"), l = n(e, "b");
2415
- return O1(r, u, l, i);
2416
- }, "fade"), ts = /* @__PURE__ */ k((e) => `${$1(e)}
2417
- .label {
2418
- font-family: ${e.fontFamily};
2419
- color: ${e.nodeTextColor || e.textColor};
2420
- }
2421
- .cluster-label text {
2422
- fill: ${e.titleColor};
2423
- }
2424
- .cluster-label span {
2425
- color: ${e.titleColor};
2426
- }
2427
- .cluster-label span p {
2428
- background-color: transparent;
2429
- }
2430
-
2431
- .label text,span {
2432
- fill: ${e.nodeTextColor || e.textColor};
2433
- color: ${e.nodeTextColor || e.textColor};
2434
- }
2435
-
2436
- .node rect,
2437
- .node circle,
2438
- .node ellipse,
2439
- .node polygon,
2440
- .node path {
2441
- fill: ${e.mainBkg};
2442
- stroke: ${e.nodeBorder};
2443
- stroke-width: ${e.strokeWidth ?? 1}px;
2444
- }
2445
- .rough-node .label text , .node .label text, .image-shape .label, .icon-shape .label {
2446
- text-anchor: middle;
2447
- }
2448
- .node .katex path {
2449
- fill: ${e.nodeTextColor || e.textColor};
2450
- stroke: ${e.nodeTextColor || e.textColor};
2451
- stroke-width: 1px;
2452
- }
2453
-
2454
- .rough-node .label,.node .label, .image-shape .label, .icon-shape .label {
2455
- text-align: center;
2456
- }
2457
- .node.clickable {
2458
- cursor: pointer;
2459
- }
2460
-
2461
-
2462
- .root .anchor path {
2463
- fill: ${e.lineColor} !important;
2464
- stroke-width: 0;
2465
- stroke: ${e.lineColor};
2466
- }
2467
-
2468
- .arrowheadPath {
2469
- fill: ${e.arrowheadColor};
2470
- }
2471
-
2472
- .edgePaths .path {
2473
- stroke: ${e.lineColor};
2474
- stroke-width: ${e.strokeWidth ?? 2}px;
2475
- }
2476
-
2477
- .flowchart-link {
2478
- stroke: ${e.lineColor};
2479
- fill: none;
2480
- }
2481
-
2482
- .edgeLabel {
2483
- background-color: ${e.edgeLabelBackground};
2484
- p {
2485
- background-color: ${e.edgeLabelBackground};
2486
- }
2487
- rect {
2488
- opacity: 0.5;
2489
- background-color: ${e.edgeLabelBackground};
2490
- fill: ${e.edgeLabelBackground};
2491
- }
2492
- text-align: center;
2493
- }
2494
-
2495
- /* For html labels only */
2496
- .labelBkg {
2497
- background-color: ${es(e.edgeLabelBackground, 0.5)};
2498
- }
2499
-
2500
- .cluster rect {
2501
- fill: ${e.clusterBkg};
2502
- stroke: ${e.clusterBorder};
2503
- stroke-width: 1px;
2504
- }
2505
-
2506
- .flow-cluster rect {
2507
- fill: none;
2508
- stroke: ${e.clusterBorder};
2509
- stroke-width: 0.75px;
2510
- }
2511
-
2512
- .node .collapsed-indicator {
2513
- fill: ${e.nodeBorder};
2514
- stroke: none;
2515
- stroke-width: 0;
2516
- opacity: 0.5;
2517
- }
2518
-
2519
- .node .collapsed-separator {
2520
- stroke-width: 0.75px;
2521
- }
2522
-
2523
- .cluster text {
2524
- fill: ${e.titleColor};
2525
- }
2526
-
2527
- .cluster span {
2528
- color: ${e.titleColor};
2529
- }
2530
- /* .cluster div {
2531
- color: ${e.titleColor};
2532
- } */
2533
-
2534
- div.mermaidTooltip {
2535
- position: absolute;
2536
- text-align: center;
2537
- max-width: 200px;
2538
- padding: 2px;
2539
- font-family: ${e.fontFamily};
2540
- font-size: 12px;
2541
- background: ${e.tertiaryColor};
2542
- border: 1px solid ${e.border2};
2543
- border-radius: 2px;
2544
- pointer-events: none;
2545
- z-index: 100;
2546
- }
2547
-
2548
- .agentflowTitleText {
2549
- text-anchor: middle;
2550
- font-size: 18px;
2551
- fill: ${e.textColor};
2552
- }
2553
-
2554
- rect.text {
2555
- fill: none;
2556
- stroke-width: 0;
2557
- }
2558
-
2559
- .icon-shape, .image-shape {
2560
- background-color: ${e.edgeLabelBackground};
2561
- p {
2562
- background-color: ${e.edgeLabelBackground};
2563
- padding: 2px;
2564
- }
2565
- .label rect {
2566
- opacity: 0.5;
2567
- background-color: ${e.edgeLabelBackground};
2568
- fill: ${e.edgeLabelBackground};
2569
- }
2570
- text-align: center;
2571
- }
2572
- ${A1()}
2573
- `, "getStyles"), ss = ts, ls = {
2574
- parser: Z1,
2575
- get db() {
2576
- return new q1();
2577
- },
2578
- renderer: Q1,
2579
- styles: ss,
2580
- init: /* @__PURE__ */ k((e) => {
2581
- e.agentflow ??= {}, e.layout && e1({ layout: e.layout }), e.flowchart ??= {}, e.flowchart.arrowMarkerAbsolute = e.arrowMarkerAbsolute, e1({ flowchart: { arrowMarkerAbsolute: e.arrowMarkerAbsolute } });
2582
- }, "init")
2583
- };
2584
- export {
2585
- ls as diagram
2586
- };