@belonguniverseai/react-sdk 0.6.2 → 0.6.4

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 (81) hide show
  1. package/dist/api/agent-grants.d.ts +23 -8
  2. package/dist/api/client.d.ts +53 -4
  3. package/dist/api/queries.d.ts +2 -0
  4. package/dist/app/call-summary.d.ts +30 -0
  5. package/dist/component/abnfDiagram-N423BO3Z-DR3fMT7g.js +90 -0
  6. package/dist/component/arc-DJkYOSuJ.js +86 -0
  7. package/dist/component/{architectureDiagram-3BPJPVTR-DYcaPx2M.js → architectureDiagram-T3A2C74G-BIp4IBPk.js} +1872 -1785
  8. package/dist/component/{blockDiagram-GPEHLZMM-BdjruLO5.js → blockDiagram-VBNYF7ZC-BqryGqC6.js} +895 -894
  9. package/dist/component/{c4Diagram-AAUBKEIU-Bd2ebSgB.js → c4Diagram-5PPSVZJV-GktlF-Di.js} +3 -3
  10. package/dist/component/{channel-CYFijF_t.js → channel-3CusDaXb.js} +2 -2
  11. package/dist/component/{chunk-ND2GUHAM-OX1-DIU1.js → chunk-2GRJ4B5K-DMTs6j_c.js} +5 -5
  12. package/dist/component/{chunk-QZHKN3VN-DLQ8oUCc.js → chunk-2Q5K7J3B-CIU34hPH.js} +2 -2
  13. package/dist/component/{chunk-AQP2D5EJ-D4G4syYu.js → chunk-5RXB4S5H-Ds3vF1Mv.js} +399 -378
  14. package/dist/component/{chunk-FMBD7UC4-CbRxWx_A.js → chunk-5VM5RSS4-DGxDkIm6.js} +2 -2
  15. package/dist/component/chunk-6Q2QTUOP-BI8oZt98.js +673 -0
  16. package/dist/component/{chunk-727SXJPM-A5r5oL1_.js → chunk-GF5L2VYU-D-36xUd5.js} +244 -239
  17. package/dist/component/{chunk-4BX2VUAB-DVpS0I_p.js → chunk-JWPE2WC7-8N_wQ762.js} +2 -2
  18. package/dist/component/{chunk-2J33WTMH-B06Y_xVy.js → chunk-KBJHAD2P-ChxxpkWc.js} +2 -2
  19. package/dist/component/chunk-RYQCIY6F-CSY-95OP.js +316 -0
  20. package/dist/component/{chunk-55IACEB6-DmZctFkK.js → chunk-XXDRQBXY-BQd9yyE1.js} +2 -2
  21. package/dist/component/{classDiagram-4FO5ZUOK-4S9mdFC1.js → classDiagram-JCYQIIEL-BOq63iUL.js} +3 -3
  22. package/dist/component/{classDiagram-v2-Q7XG4LA2-4S9mdFC1.js → classDiagram-v2-OCEON4UE-BOq63iUL.js} +3 -3
  23. package/dist/component/{cose-bilkent-S5V4N54A-BIrVaakt.js → cose-bilkent-JH36ORCC-B9x8cp5w.js} +2 -2
  24. package/dist/component/{wardley-L42UT6IY-HA1eSIS_.js → cynefin-VYW2F7L2-DAyxamLw.js} +9199 -7918
  25. package/dist/component/cynefinDiagram-MW4NZA55-OF6l99SS.js +302 -0
  26. package/dist/component/dagre-VZM6K2ZE-CELO1hFb.js +343 -0
  27. package/dist/component/diagram-7IWD3JNH-COzvm6E2.js +353 -0
  28. package/dist/component/{diagram-KO2AKTUF-Da1E68Eo.js → diagram-B4RE2ZJO-DR9KMRGw.js} +24 -24
  29. package/dist/component/{diagram-LMA3HP47-dRbk5sBa.js → diagram-LBJQPF4R-D47Zqm-k.js} +23 -23
  30. package/dist/component/{diagram-OG6HWLK6-CcKT8mhn.js → diagram-Q27KOJAE-Key1bw_Y.js} +197 -197
  31. package/dist/component/diagram-UB23O5K3-Cxf-sZnK.js +222 -0
  32. package/dist/component/ebnfDiagram-BXEA7PRR-C8uURt_x.js +112 -0
  33. package/dist/component/{erDiagram-TEJ5UH35-3ATYT9J-.js → erDiagram-JOGREHBK-CpCxe8Ib.js} +142 -131
  34. package/dist/component/{flowDiagram-I6XJVG4X-D9PLm9Od.js → flowDiagram-UKHOOZJN-urFG2I71.js} +268 -258
  35. package/dist/component/ganttDiagram-PKOTCBZU-8nA9faYf.js +2714 -0
  36. package/dist/component/{gitGraphDiagram-PVQCEYII-13gVhAGc.js → gitGraphDiagram-DS77QQ5N-u4cbNW8o.js} +33 -33
  37. package/dist/component/{graph-BZLHvygk.js → graph-CWpEkm4G.js} +35 -35
  38. package/dist/component/{highlighted-body-OFNGDK62-DCxRI4UV.js → highlighted-body-OFNGDK62-Bo-15uvJ.js} +2 -2
  39. package/dist/component/index.js +2 -2
  40. package/dist/component/{infoDiagram-5YYISTIA-DymxA7AN.js → infoDiagram-6WML65LV-ZAv4gZpA.js} +4 -4
  41. package/dist/component/{ishikawaDiagram-YF4QCWOH-C3sTn76C.js → ishikawaDiagram-WSZJBQD7-CvB6evSz.js} +27 -27
  42. package/dist/component/{journeyDiagram-JHISSGLW-Cq0hOAfJ.js → journeyDiagram-NVQOT4AX-M5BRYuPr.js} +5 -5
  43. package/dist/component/{kanban-definition-UN3LZRKU-5tBWjkp7.js → kanban-definition-27J2QSJJ-LL6GkmVe.js} +35 -35
  44. package/dist/component/layout-Br2UjHRU.js +1522 -0
  45. package/dist/component/{linear-BT4blD8s.js → linear-DVg61V66.js} +13 -13
  46. package/dist/component/map-CdwokNh2.js +227 -0
  47. package/dist/component/{mermaid-GHXKKRXX-DXPXjnb7.js → mermaid-GHXKKRXX-C2L7fCIM.js} +29577 -29128
  48. package/dist/component/{mindmap-definition-RKZ34NQL-DO-OuAQQ.js → mindmap-definition-FAOFIHXS-BBZzsLh7.js} +26 -26
  49. package/dist/component/pegDiagram-VL7TDLO6-BEG86cY8.js +98 -0
  50. package/dist/component/pieDiagram-7S7Q4E2Y-BTkrNjAi.js +210 -0
  51. package/dist/component/{quadrantDiagram-W4KKPZXB-CaJWg9ep.js → quadrantDiagram-CIZ2JOQS-BsjBAd4w.js} +14 -15
  52. package/dist/component/railroadDiagram-AXF67PYL-DuE0ZFxj.js +80 -0
  53. package/dist/component/{requirementDiagram-4Y6WPE33-CmZrtZqe.js → requirementDiagram-LRYGKXZP-CcshEEMy.js} +15 -15
  54. package/dist/component/{sankeyDiagram-5OEKKPKP-Cp95M1aj.js → sankeyDiagram-W5VNT64P-CFn011ig.js} +2 -2
  55. package/dist/component/{sequenceDiagram-3UESZ5HK-C0x0WvhR.js → sequenceDiagram-SI44F4Z6-DmMZNJDw.js} +960 -963
  56. package/dist/component/sizeCapture-X5ZJPWSS-Ce4PhIAO.js +49 -0
  57. package/dist/component/{stateDiagram-AJRCARHV-H10vaGL3.js → stateDiagram-OKZ733FA-DDVzQKaO.js} +5 -5
  58. package/dist/component/{stateDiagram-v2-BHNVJYJU-rj7ljkc-.js → stateDiagram-v2-UEYNNEHI-DeeW8PDA.js} +3 -3
  59. package/dist/component/swimlanes-SLNWSIFB-CZh2_vzg.js +5335 -0
  60. package/dist/component/swimlanesDiagram-ULZ7WXOC-Wb0Ri7qR.js +16 -0
  61. package/dist/component/{timeline-definition-PNZ67QCA-Cil1QaqZ.js → timeline-definition-Z64GVDOM-rfiLwdTR.js} +15 -15
  62. package/dist/component/vennDiagram-T6HMQDX7-D8l7hqNb.js +1581 -0
  63. package/dist/component/{wardleyDiagram-YWT4CUSO-Xq5Hnmio.js → wardleyDiagram-T6FBY63Y-7YqmpmtC.js} +15 -15
  64. package/dist/component/{xychartDiagram-2RQKCTM6-dinwR4Zm.js → xychartDiagram-ELKLHX3M-Dx2ECqt8.js} +464 -418
  65. package/dist/embed/voice/line-slots.d.ts +37 -2
  66. package/dist/embed/voice-call.d.ts +12 -0
  67. package/dist/i18n/messages/en.d.ts +1 -2
  68. package/dist/lib/web-storage.d.ts +8 -0
  69. package/dist/stream/belong-chat-transport.d.ts +1 -0
  70. package/dist/stream/belong-data-parts.d.ts +2 -0
  71. package/dist/stream/stream-state-store.d.ts +13 -0
  72. package/dist/types/public.d.ts +3 -0
  73. package/package.json +1 -1
  74. package/dist/component/arc-TLcl3N8_.js +0 -86
  75. package/dist/component/dagre-BM42HDAG-BoPUzTvD.js +0 -448
  76. package/dist/component/diagram-2AECGRRQ-PIXCGxIt.js +0 -220
  77. package/dist/component/diagram-5GNKFQAL-CbJxbGBh.js +0 -126
  78. package/dist/component/ganttDiagram-6RSMTGT7-F_XUzD1p.js +0 -2709
  79. package/dist/component/layout-Bu6nRdWm.js +0 -1731
  80. package/dist/component/pieDiagram-4H26LBE5-BkEktPwZ.js +0 -166
  81. package/dist/component/vennDiagram-CIIHVFJN-Dk8PKmfb.js +0 -1560
@@ -1,4 +1,4 @@
1
- import { _ as l } from "./mermaid-GHXKKRXX-DXPXjnb7.js";
1
+ import { _ as l } from "./mermaid-GHXKKRXX-C2L7fCIM.js";
2
2
  globalThis.process = globalThis.process || { env: {} };
3
3
  globalThis.global = globalThis.global || globalThis;
4
4
  var o = /* @__PURE__ */ l(() => `
@@ -19,4 +19,4 @@ var o = /* @__PURE__ */ l(() => `
19
19
  export {
20
20
  o as g
21
21
  };
22
- //# sourceMappingURL=chunk-FMBD7UC4-CbRxWx_A.js.map
22
+ //# sourceMappingURL=chunk-5VM5RSS4-DGxDkIm6.js.map
@@ -0,0 +1,673 @@
1
+ import { _ as p, l as w, G as L, z as E, q as I, Z as X, e as q, i as G, c as H } from "./mermaid-GHXKKRXX-C2L7fCIM.js";
2
+ globalThis.process = globalThis.process || { env: {} };
3
+ globalThis.global = globalThis.global || globalThis;
4
+ var z = "", b = "", N = "", A = [], R = /* @__PURE__ */ new Map(), k = /* @__PURE__ */ p((e) => G(e, H()), "sanitizeText"), F = /* @__PURE__ */ p((e) => {
5
+ switch (e.type) {
6
+ case "terminal":
7
+ return { ...e, value: k(e.value) };
8
+ case "nonterminal":
9
+ return { ...e, name: k(e.name) };
10
+ case "sequence":
11
+ return { ...e, elements: e.elements.map(F) };
12
+ case "choice":
13
+ return { ...e, alternatives: e.alternatives.map(F) };
14
+ case "optional":
15
+ return { ...e, element: F(e.element) };
16
+ case "repetition":
17
+ return {
18
+ ...e,
19
+ element: F(e.element),
20
+ separator: e.separator ? F(e.separator) : void 0
21
+ };
22
+ case "special":
23
+ return { ...e, text: k(e.text) };
24
+ }
25
+ }, "sanitizeAstNode"), U = /* @__PURE__ */ p(() => {
26
+ z = "", b = "", N = "", A.length = 0, R.clear(), I(), w.debug("[Railroad] Database cleared");
27
+ }, "clear"), _ = /* @__PURE__ */ p((e) => {
28
+ z = k(e), w.debug("[Railroad] Title set:", e);
29
+ }, "setTitle"), W = /* @__PURE__ */ p(() => z, "getTitle"), j = /* @__PURE__ */ p((e) => {
30
+ const i = {
31
+ ...e,
32
+ name: k(e.name),
33
+ definition: F(e.definition),
34
+ comment: e.comment ? k(e.comment) : void 0
35
+ };
36
+ w.debug("[Railroad] Adding rule:", i.name), R.has(i.name) && w.warn(`[Railroad] Rule '${i.name}' is already defined. Overwriting.`), A.push(i), R.set(i.name, i);
37
+ }, "addRule"), K = /* @__PURE__ */ p(() => A, "getRules"), Z = /* @__PURE__ */ p((e) => R.get(e), "getRule"), J = /* @__PURE__ */ p((e) => {
38
+ b = k(e).replace(/^\s+/g, ""), w.debug("[Railroad] Accessibility title set:", e);
39
+ }, "setAccTitle"), Q = /* @__PURE__ */ p(() => b, "getAccTitle"), V = /* @__PURE__ */ p((e) => {
40
+ N = k(e).replace(/\n\s+/g, `
41
+ `), w.debug("[Railroad] Accessibility description set:", e);
42
+ }, "setAccDescription"), ee = /* @__PURE__ */ p(() => N, "getAccDescription"), te = _, re = W, ie = {
43
+ clear: U,
44
+ setTitle: _,
45
+ getTitle: W,
46
+ addRule: j,
47
+ getRules: K,
48
+ getRule: Z,
49
+ setAccTitle: J,
50
+ getAccTitle: Q,
51
+ setAccDescription: V,
52
+ getAccDescription: ee,
53
+ setDiagramTitle: te,
54
+ getDiagramTitle: re
55
+ }, g = {
56
+ // Layout
57
+ compactMode: !1,
58
+ // Spacing
59
+ padding: 10,
60
+ verticalSeparation: 8,
61
+ horizontalSeparation: 10,
62
+ arcRadius: 10,
63
+ // Typography
64
+ fontSize: 14,
65
+ fontFamily: "monospace",
66
+ // Colors - Terminal
67
+ terminalFill: "#FFFFC0",
68
+ terminalStroke: "#000000",
69
+ terminalTextColor: "#000000",
70
+ // Colors - Non-terminal
71
+ nonTerminalFill: "#FFFFFF",
72
+ nonTerminalStroke: "#000000",
73
+ nonTerminalTextColor: "#000000",
74
+ // Colors - Lines
75
+ lineColor: "#000000",
76
+ strokeWidth: 2,
77
+ // Colors - Markers
78
+ markerFill: "#000000",
79
+ // Colors - Comment
80
+ commentFill: "#E8E8E8",
81
+ commentStroke: "#888888",
82
+ commentTextColor: "#666666",
83
+ // Colors - Special
84
+ specialFill: "#F0E0FF",
85
+ specialStroke: "#8800CC",
86
+ // Other
87
+ ruleNameColor: "#000066",
88
+ showMarkers: !0,
89
+ markerRadius: 5
90
+ }, ae = /^#(?:[\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})$|^(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch)\([\d\s%+,./-]+\)$|^[a-z]+$/i, ne = /^[\w "',.-]+$/, oe = /* @__PURE__ */ new Set([
91
+ "compactMode",
92
+ "padding",
93
+ "verticalSeparation",
94
+ "horizontalSeparation",
95
+ "arcRadius",
96
+ "fontSize",
97
+ "fontFamily",
98
+ "terminalFill",
99
+ "terminalStroke",
100
+ "terminalTextColor",
101
+ "nonTerminalFill",
102
+ "nonTerminalStroke",
103
+ "nonTerminalTextColor",
104
+ "lineColor",
105
+ "strokeWidth",
106
+ "markerFill",
107
+ "commentFill",
108
+ "commentStroke",
109
+ "commentTextColor",
110
+ "specialFill",
111
+ "specialStroke",
112
+ "ruleNameColor",
113
+ "showMarkers",
114
+ "markerRadius"
115
+ ]), B = /* @__PURE__ */ p((e) => e ? Object.keys(e).every(
116
+ (i) => i === "railroad" || oe.has(i)
117
+ ) : !1, "isRailroadStyleOptions"), le = /* @__PURE__ */ p((e) => e ? "railroad" in e && e.railroad ? e.railroad : B(e) ? e : {} : {}, "extractRailroadOverrides"), se = /* @__PURE__ */ p((e) => {
118
+ if (!e || B(e))
119
+ return {};
120
+ const {
121
+ railroad: i,
122
+ svgId: n,
123
+ theme: r,
124
+ look: t,
125
+ ...a
126
+ } = e;
127
+ return a;
128
+ }, "extractThemeOverrides"), m = /* @__PURE__ */ p((e, i) => {
129
+ if (typeof e != "string")
130
+ return i;
131
+ const n = e.trim();
132
+ return ae.test(n) ? n : i;
133
+ }, "sanitizeColorValue"), Y = /* @__PURE__ */ p((e, i) => {
134
+ if (typeof e != "string")
135
+ return i;
136
+ const n = e.trim();
137
+ return ne.test(n) ? n : i;
138
+ }, "sanitizeFontFamilyValue"), S = /* @__PURE__ */ p((e, i) => {
139
+ const n = typeof e == "number" ? e : typeof e == "string" ? Number.parseFloat(e) : Number.NaN;
140
+ return Number.isFinite(n) && n >= 0 ? n : i;
141
+ }, "sanitizeNumberValue"), de = /* @__PURE__ */ p((e) => {
142
+ const i = typeof e == "number" ? e : typeof e == "string" ? Number.parseFloat(e) : Number.NaN;
143
+ return Number.isFinite(i) && i > 0 ? i : void 0;
144
+ }, "parseThemeFontSize"), ce = /* @__PURE__ */ p((e) => {
145
+ const i = Y(
146
+ e.fontFamily,
147
+ g.fontFamily
148
+ ), n = de(e.fontSize) ?? g.fontSize;
149
+ return {
150
+ ...g,
151
+ fontFamily: i,
152
+ fontSize: n,
153
+ terminalFill: m(
154
+ e.secondBkg ?? e.secondaryColor,
155
+ g.terminalFill
156
+ ),
157
+ terminalStroke: m(
158
+ e.secondaryBorderColor ?? e.lineColor,
159
+ g.terminalStroke
160
+ ),
161
+ terminalTextColor: m(
162
+ e.secondaryTextColor ?? e.textColor,
163
+ g.terminalTextColor
164
+ ),
165
+ nonTerminalFill: m(
166
+ e.mainBkg ?? e.background,
167
+ g.nonTerminalFill
168
+ ),
169
+ nonTerminalStroke: m(
170
+ e.primaryBorderColor ?? e.lineColor,
171
+ g.nonTerminalStroke
172
+ ),
173
+ nonTerminalTextColor: m(
174
+ e.primaryTextColor ?? e.textColor,
175
+ g.nonTerminalTextColor
176
+ ),
177
+ lineColor: m(e.lineColor, g.lineColor),
178
+ markerFill: m(e.lineColor, g.markerFill),
179
+ commentFill: m(
180
+ e.labelBackground ?? e.tertiaryColor,
181
+ g.commentFill
182
+ ),
183
+ commentStroke: m(
184
+ e.tertiaryBorderColor ?? e.lineColor,
185
+ g.commentStroke
186
+ ),
187
+ commentTextColor: m(
188
+ e.tertiaryTextColor ?? e.textColor,
189
+ g.commentTextColor
190
+ ),
191
+ specialFill: m(
192
+ e.tertiaryColor ?? e.secondaryColor,
193
+ g.specialFill
194
+ ),
195
+ specialStroke: m(
196
+ e.tertiaryBorderColor ?? e.secondaryBorderColor,
197
+ g.specialStroke
198
+ ),
199
+ ruleNameColor: m(
200
+ e.titleColor ?? e.textColor,
201
+ g.ruleNameColor
202
+ )
203
+ };
204
+ }, "buildThemeDefaults"), M = /* @__PURE__ */ p((e) => {
205
+ const i = E(), n = {
206
+ ...X(),
207
+ ...i.themeVariables ?? {},
208
+ ...se(e)
209
+ }, r = ce(n), t = {
210
+ ...i.railroad ?? {},
211
+ ...le(e)
212
+ };
213
+ return {
214
+ compactMode: t.compactMode ?? r.compactMode,
215
+ padding: S(t.padding, r.padding),
216
+ verticalSeparation: S(
217
+ t.verticalSeparation,
218
+ r.verticalSeparation
219
+ ),
220
+ horizontalSeparation: S(
221
+ t.horizontalSeparation,
222
+ r.horizontalSeparation
223
+ ),
224
+ arcRadius: S(t.arcRadius, r.arcRadius),
225
+ fontSize: S(t.fontSize, r.fontSize),
226
+ fontFamily: Y(t.fontFamily, r.fontFamily),
227
+ terminalFill: m(t.terminalFill, r.terminalFill),
228
+ terminalStroke: m(
229
+ t.terminalStroke,
230
+ r.terminalStroke
231
+ ),
232
+ terminalTextColor: m(
233
+ t.terminalTextColor,
234
+ r.terminalTextColor
235
+ ),
236
+ nonTerminalFill: m(
237
+ t.nonTerminalFill,
238
+ r.nonTerminalFill
239
+ ),
240
+ nonTerminalStroke: m(
241
+ t.nonTerminalStroke,
242
+ r.nonTerminalStroke
243
+ ),
244
+ nonTerminalTextColor: m(
245
+ t.nonTerminalTextColor,
246
+ r.nonTerminalTextColor
247
+ ),
248
+ lineColor: m(t.lineColor, r.lineColor),
249
+ strokeWidth: S(t.strokeWidth, r.strokeWidth),
250
+ markerFill: m(t.markerFill, r.markerFill),
251
+ commentFill: m(t.commentFill, r.commentFill),
252
+ commentStroke: m(t.commentStroke, r.commentStroke),
253
+ commentTextColor: m(
254
+ t.commentTextColor,
255
+ r.commentTextColor
256
+ ),
257
+ specialFill: m(t.specialFill, r.specialFill),
258
+ specialStroke: m(t.specialStroke, r.specialStroke),
259
+ ruleNameColor: m(t.ruleNameColor, r.ruleNameColor),
260
+ showMarkers: t.showMarkers ?? r.showMarkers,
261
+ markerRadius: S(t.markerRadius, r.markerRadius)
262
+ };
263
+ }, "buildRailroadStyleOptions"), ue = /* @__PURE__ */ p((e) => {
264
+ const {
265
+ fontFamily: i,
266
+ fontSize: n,
267
+ terminalFill: r,
268
+ terminalStroke: t,
269
+ terminalTextColor: a,
270
+ nonTerminalFill: h,
271
+ nonTerminalStroke: s,
272
+ nonTerminalTextColor: o,
273
+ lineColor: u,
274
+ strokeWidth: c,
275
+ markerFill: d,
276
+ commentFill: x,
277
+ commentStroke: l,
278
+ commentTextColor: f,
279
+ specialFill: y,
280
+ specialStroke: v,
281
+ ruleNameColor: C
282
+ } = M(e);
283
+ return `
284
+ .railroad-diagram {
285
+ font-family: ${i};
286
+ font-size: ${n}px;
287
+ }
288
+
289
+ .railroad-terminal rect {
290
+ fill: ${r};
291
+ stroke: ${t};
292
+ stroke-width: ${c}px;
293
+ }
294
+
295
+ .railroad-terminal text {
296
+ fill: ${a};
297
+ font-family: ${i};
298
+ font-size: ${n}px;
299
+ text-anchor: middle;
300
+ dominant-baseline: middle;
301
+ }
302
+
303
+ .railroad-nonterminal rect {
304
+ fill: ${h};
305
+ stroke: ${s};
306
+ stroke-width: ${c}px;
307
+ }
308
+
309
+ .railroad-nonterminal text {
310
+ fill: ${o};
311
+ font-family: ${i};
312
+ font-size: ${n}px;
313
+ text-anchor: middle;
314
+ dominant-baseline: middle;
315
+ }
316
+
317
+ .railroad-line {
318
+ stroke: ${u};
319
+ stroke-width: ${c}px;
320
+ fill: none;
321
+ }
322
+
323
+ .railroad-start circle,
324
+ .railroad-end circle {
325
+ fill: ${d};
326
+ }
327
+
328
+ .railroad-comment ellipse {
329
+ fill: ${x};
330
+ stroke: ${l};
331
+ stroke-width: ${c}px;
332
+ }
333
+
334
+ .railroad-comment text {
335
+ fill: ${f};
336
+ font-style: italic;
337
+ font-family: ${i};
338
+ font-size: ${n}px;
339
+ text-anchor: middle;
340
+ dominant-baseline: middle;
341
+ }
342
+
343
+ .railroad-special rect {
344
+ fill: ${y};
345
+ stroke: ${v};
346
+ stroke-width: ${c}px;
347
+ stroke-dasharray: 5,3;
348
+ }
349
+
350
+ .railroad-special text {
351
+ fill: ${o};
352
+ font-family: ${i};
353
+ font-size: ${n}px;
354
+ text-anchor: middle;
355
+ dominant-baseline: middle;
356
+ }
357
+
358
+ .railroad-rule-name {
359
+ font-weight: bold;
360
+ fill: ${C};
361
+ font-family: ${i};
362
+ font-size: ${n}px;
363
+ }
364
+
365
+ .railroad-group {
366
+ /* Grouping container, no specific styles */
367
+ }
368
+ `;
369
+ }, "getStyles"), T = class {
370
+ constructor() {
371
+ this.d = "";
372
+ }
373
+ static {
374
+ p(this, "PathBuilder");
375
+ }
376
+ moveTo(e, i) {
377
+ return this.d += `M ${e} ${i} `, this;
378
+ }
379
+ lineTo(e, i) {
380
+ return this.d += `L ${e} ${i} `, this;
381
+ }
382
+ horizontalTo(e) {
383
+ return this.d += `H ${e} `, this;
384
+ }
385
+ verticalTo(e) {
386
+ return this.d += `V ${e} `, this;
387
+ }
388
+ arcTo(e, i, n, r, t, a, h) {
389
+ return this.d += `A ${e} ${i} ${n} ${r ? 1 : 0} ${t ? 1 : 0} ${a} ${h} `, this;
390
+ }
391
+ build() {
392
+ return this.d.trim();
393
+ }
394
+ }, me = class {
395
+ constructor(e, i = M()) {
396
+ this.textCache = /* @__PURE__ */ new Map(), this.svg = e, this.config = i;
397
+ }
398
+ static {
399
+ p(this, "RailroadRenderer");
400
+ }
401
+ /**
402
+ * Measure text dimensions
403
+ */
404
+ measureText(e) {
405
+ if (this.textCache.has(e))
406
+ return this.textCache.get(e);
407
+ const i = this.svg.append("text").attr("font-family", this.config.fontFamily).attr("font-size", this.config.fontSize).text(e), n = i.node().getBBox(), r = { width: n.width, height: n.height };
408
+ return i.remove(), this.textCache.set(e, r), r;
409
+ }
410
+ /**
411
+ * Render terminal symbol (rounded rectangle)
412
+ */
413
+ renderTerminal(e, i) {
414
+ const n = this.measureText(i), r = n.width + this.config.padding * 2, t = n.height + this.config.padding * 2, a = e.append("g").attr("class", "railroad-terminal");
415
+ return a.append("rect").attr("x", 0).attr("y", 0).attr("width", r).attr("height", t).attr("rx", 10).attr("ry", 10), a.append("text").attr("x", r / 2).attr("y", t / 2).text(i), {
416
+ element: a.node(),
417
+ dimensions: {
418
+ width: r,
419
+ height: t,
420
+ up: t / 2,
421
+ down: t / 2
422
+ }
423
+ };
424
+ }
425
+ /**
426
+ * Render non-terminal symbol (rectangle)
427
+ */
428
+ renderNonTerminal(e, i) {
429
+ const n = this.measureText(i), r = n.width + this.config.padding * 2, t = n.height + this.config.padding * 2, a = e.append("g").attr("class", "railroad-nonterminal");
430
+ return a.append("rect").attr("x", 0).attr("y", 0).attr("width", r).attr("height", t), a.append("text").attr("x", r / 2).attr("y", t / 2).text(i), {
431
+ element: a.node(),
432
+ dimensions: {
433
+ width: r,
434
+ height: t,
435
+ up: t / 2,
436
+ down: t / 2
437
+ }
438
+ };
439
+ }
440
+ /**
441
+ * Render sequence (horizontal concatenation)
442
+ */
443
+ renderSequence(e, i) {
444
+ const n = i.map((o) => this.renderExpression(e, o));
445
+ let r = 0, t = 0, a = 0;
446
+ for (const o of n)
447
+ r += o.dimensions.width, t = Math.max(t, o.dimensions.up), a = Math.max(a, o.dimensions.down);
448
+ r += (n.length - 1) * this.config.horizontalSeparation;
449
+ const h = e.append("g").attr("class", "railroad-sequence");
450
+ let s = 0;
451
+ for (let o = 0; o < n.length; o++) {
452
+ const u = n[o], c = t - u.dimensions.up;
453
+ if (h.node().appendChild(u.element).setAttribute("transform", `translate(${s}, ${c})`), o < n.length - 1) {
454
+ const x = s + u.dimensions.width, l = x + this.config.horizontalSeparation, f = t;
455
+ h.append("path").attr("class", "railroad-line").attr("d", new T().moveTo(x, f).lineTo(l, f).build());
456
+ }
457
+ s += u.dimensions.width + this.config.horizontalSeparation;
458
+ }
459
+ return {
460
+ element: h.node(),
461
+ dimensions: {
462
+ width: r,
463
+ height: t + a,
464
+ up: t,
465
+ down: a
466
+ }
467
+ };
468
+ }
469
+ /**
470
+ * Render choice (vertical alternatives)
471
+ */
472
+ renderChoice(e, i) {
473
+ const n = i.map((d) => this.renderExpression(e, d));
474
+ let r = 0, t = 0;
475
+ for (const d of n)
476
+ r = Math.max(r, d.dimensions.width), t += d.dimensions.height;
477
+ t += (n.length - 1) * this.config.verticalSeparation;
478
+ const a = this.config.arcRadius, h = a * 4, s = r + h, o = e.append("g").attr("class", "railroad-choice");
479
+ let u = 0;
480
+ const c = t / 2;
481
+ for (const d of n) {
482
+ const x = u, l = x + d.dimensions.up, f = a * 2 + (r - d.dimensions.width) / 2;
483
+ o.node().appendChild(d.element).setAttribute("transform", `translate(${f}, ${x})`);
484
+ const v = new T(), C = l > c;
485
+ l === c ? v.moveTo(0, c).lineTo(f, l) : v.moveTo(0, c).arcTo(
486
+ a,
487
+ a,
488
+ 0,
489
+ !1,
490
+ C,
491
+ a,
492
+ c + (C ? a : -a)
493
+ ).lineTo(a, l - (C ? a : -a)).arcTo(a, a, 0, !1, !C, a * 2, l).lineTo(f, l), o.append("path").attr("class", "railroad-line").attr("d", v.build());
494
+ const $ = new T(), O = f + d.dimensions.width, P = s - a * 2;
495
+ l === c ? $.moveTo(O, l).lineTo(s, c) : $.moveTo(O, l).lineTo(P, l).arcTo(
496
+ a,
497
+ a,
498
+ 0,
499
+ !1,
500
+ !C,
501
+ s - a,
502
+ l + (C ? -a : a)
503
+ ).lineTo(s - a, c + (C ? a : -a)).arcTo(a, a, 0, !1, C, s, c), o.append("path").attr("class", "railroad-line").attr("d", $.build()), u += d.dimensions.height + this.config.verticalSeparation;
504
+ }
505
+ return {
506
+ element: o.node(),
507
+ dimensions: {
508
+ width: s,
509
+ height: t,
510
+ up: c,
511
+ down: t - c
512
+ }
513
+ };
514
+ }
515
+ /**
516
+ * Render optional (bypass path above)
517
+ */
518
+ renderOptional(e, i) {
519
+ const n = this.renderExpression(e, i), r = this.config.arcRadius, t = r * 2, a = n.dimensions.width + r * 4, h = n.dimensions.height + t, s = e.append("g").attr("class", "railroad-optional"), o = r * 2, u = t;
520
+ s.node().appendChild(n.element).setAttribute("transform", `translate(${o}, ${u})`);
521
+ const d = u + n.dimensions.up, x = new T().moveTo(0, d).lineTo(r * 2, d);
522
+ s.append("path").attr("class", "railroad-line").attr("d", x.build());
523
+ const l = new T().moveTo(o + n.dimensions.width, d).lineTo(a, d);
524
+ s.append("path").attr("class", "railroad-line").attr("d", l.build());
525
+ const f = new T().moveTo(0, d).arcTo(r, r, 0, !1, !1, r, d - r).lineTo(r, r).arcTo(r, r, 0, !1, !0, r * 2, 0).lineTo(a - r * 2, 0).arcTo(r, r, 0, !1, !0, a - r, r).lineTo(a - r, d - r).arcTo(r, r, 0, !1, !1, a, d);
526
+ return s.append("path").attr("class", "railroad-line").attr("d", f.build()), {
527
+ element: s.node(),
528
+ dimensions: {
529
+ width: a,
530
+ height: h,
531
+ up: d,
532
+ down: h - d
533
+ }
534
+ };
535
+ }
536
+ /**
537
+ * Render repetition (loop back path)
538
+ */
539
+ renderRepetition(e, i, n) {
540
+ const r = this.renderExpression(e, i), t = this.config.arcRadius, a = t * 2, h = r.dimensions.width + t * 4, s = n === 0, o = r.dimensions.height + a + (s ? a : 0), u = e.append("g").attr("class", "railroad-repetition"), c = t * 2, d = s ? a : 0;
541
+ u.node().appendChild(r.element).setAttribute("transform", `translate(${c}, ${d})`);
542
+ const l = d + r.dimensions.up;
543
+ u.append("path").attr("class", "railroad-line").attr(
544
+ "d",
545
+ new T().moveTo(0, l).lineTo(t * 2, l).build()
546
+ ), u.append("path").attr("class", "railroad-line").attr(
547
+ "d",
548
+ new T().moveTo(c + r.dimensions.width, l).lineTo(h, l).build()
549
+ );
550
+ const f = d + r.dimensions.height + t, y = new T().moveTo(c + r.dimensions.width, l).arcTo(
551
+ t,
552
+ t,
553
+ 0,
554
+ !1,
555
+ !0,
556
+ c + r.dimensions.width + t,
557
+ l + t
558
+ ).lineTo(c + r.dimensions.width + t, f).arcTo(
559
+ t,
560
+ t,
561
+ 0,
562
+ !1,
563
+ !0,
564
+ c + r.dimensions.width,
565
+ f + t
566
+ ).lineTo(t * 2, f + t).arcTo(t, t, 0, !1, !0, t, f).lineTo(t, l + t).arcTo(t, t, 0, !1, !0, t * 2, l);
567
+ if (u.append("path").attr("class", "railroad-line").attr("d", y.build()), s) {
568
+ const v = new T().moveTo(0, l).arcTo(t, t, 0, !1, !1, t, l - t).lineTo(t, t).arcTo(t, t, 0, !1, !0, t * 2, 0).lineTo(h - t * 2, 0).arcTo(t, t, 0, !1, !0, h - t, t).lineTo(h - t, l - t).arcTo(t, t, 0, !1, !1, h, l);
569
+ u.append("path").attr("class", "railroad-line").attr("d", v.build());
570
+ }
571
+ return {
572
+ element: u.node(),
573
+ dimensions: {
574
+ width: h,
575
+ height: o,
576
+ up: l,
577
+ down: o - l
578
+ }
579
+ };
580
+ }
581
+ /**
582
+ * Render special sequence
583
+ */
584
+ renderSpecial(e, i) {
585
+ const n = this.measureText("? " + i + " ?"), r = n.width + this.config.padding * 2, t = n.height + this.config.padding * 2, a = e.append("g").attr("class", "railroad-special");
586
+ return a.append("rect").attr("x", 0).attr("y", 0).attr("width", r).attr("height", t), a.append("text").attr("x", r / 2).attr("y", t / 2).text("? " + i + " ?"), {
587
+ element: a.node(),
588
+ dimensions: {
589
+ width: r,
590
+ height: t,
591
+ up: t / 2,
592
+ down: t / 2
593
+ }
594
+ };
595
+ }
596
+ /**
597
+ * Render an expression (recursive)
598
+ */
599
+ renderExpression(e, i) {
600
+ switch (i.type) {
601
+ case "terminal":
602
+ return this.renderTerminal(e, i.value);
603
+ case "nonterminal":
604
+ return this.renderNonTerminal(e, i.name);
605
+ case "sequence":
606
+ return this.renderSequence(e, i.elements);
607
+ case "choice":
608
+ return this.renderChoice(e, i.alternatives);
609
+ case "optional":
610
+ return this.renderOptional(e, i.element);
611
+ case "repetition":
612
+ return this.renderRepetition(e, i.element, i.min);
613
+ case "special":
614
+ return this.renderSpecial(e, i.text);
615
+ default:
616
+ throw new Error(`Unknown node type: ${i.type}`);
617
+ }
618
+ }
619
+ /**
620
+ * Render a single rule
621
+ */
622
+ renderRule(e, i) {
623
+ const n = this.svg.append("g").attr("class", "railroad-rule").attr("transform", `translate(0, ${i})`), r = e.name + " =", t = this.measureText(r).width + 20, a = t + 20, h = n.append("g"), s = this.renderExpression(h, e.definition), o = Math.max(20, s.dimensions.up), u = o - s.dimensions.up;
624
+ return h.attr("transform", `translate(${a}, ${u})`), n.append("g").attr("class", "railroad-rule-name-group").append("text").attr("class", "railroad-rule-name").attr("x", 0).attr("y", o).text(r), n.append("g").attr("class", "railroad-start").append("circle").attr("cx", t).attr("cy", o).attr("r", this.config.markerRadius), n.append("g").attr("class", "railroad-end").append("circle").attr("cx", a + s.dimensions.width + 10).attr("cy", o).attr("r", this.config.markerRadius), n.append("path").attr("class", "railroad-line").attr(
625
+ "d",
626
+ new T().moveTo(t + this.config.markerRadius, o).lineTo(a, o).build()
627
+ ), n.append("path").attr("class", "railroad-line").attr(
628
+ "d",
629
+ new T().moveTo(a + s.dimensions.width, o).lineTo(a + s.dimensions.width + 10 - this.config.markerRadius, o).build()
630
+ ), {
631
+ height: Math.max(40, u + s.dimensions.height + this.config.padding * 2),
632
+ width: a + s.dimensions.width + 10 + this.config.markerRadius
633
+ };
634
+ }
635
+ /**
636
+ * Render all rules
637
+ */
638
+ renderDiagram(e) {
639
+ let i = this.config.padding, n = 0;
640
+ for (const r of e) {
641
+ const t = this.renderRule(r, i);
642
+ i += t.height + this.config.verticalSeparation, n = Math.max(n, t.width);
643
+ }
644
+ return {
645
+ width: n + this.config.padding * 2,
646
+ height: i + this.config.padding
647
+ };
648
+ }
649
+ }, D = /* @__PURE__ */ p((e, i, n) => {
650
+ q(e, i.height, i.width, n), e.attr("viewBox", `0 0 ${i.width} ${i.height}`);
651
+ }, "configureRailroadSvgSize"), he = /* @__PURE__ */ p((e, i, n) => {
652
+ w.debug(`[Railroad] Rendering diagram
653
+ ` + e);
654
+ try {
655
+ const r = L(i);
656
+ r.attr("class", "railroad-diagram");
657
+ const a = E().railroad?.useMaxWidth ?? !0, h = ie.getRules();
658
+ if (w.debug(`[Railroad] Rendering ${h.length} rules`), h.length === 0) {
659
+ w.warn("[Railroad] No rules to render"), D(r, { height: 100, width: 200 }, a);
660
+ return;
661
+ }
662
+ const o = new me(r, M()).renderDiagram(h);
663
+ D(r, o, a), w.debug("[Railroad] Render complete");
664
+ } catch (r) {
665
+ throw w.error("[Railroad] Render error:", r), r;
666
+ }
667
+ }, "draw"), ge = { draw: he };
668
+ export {
669
+ ie as d,
670
+ ue as g,
671
+ ge as r
672
+ };
673
+ //# sourceMappingURL=chunk-6Q2QTUOP-BI8oZt98.js.map