markdown-flow-ui 0.2.36-dev.1 → 0.3.0-dev.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -11
- package/dist/_virtual/index.es10.js +2 -2
- package/dist/_virtual/index.es3.js +5 -4
- package/dist/_virtual/index.es3.js.map +1 -1
- package/dist/_virtual/index.es4.js +4 -5
- package/dist/_virtual/index.es4.js.map +1 -1
- package/dist/_virtual/index.es5.js +5 -5
- package/dist/_virtual/index.es6.js +5 -3
- package/dist/_virtual/index.es6.js.map +1 -1
- package/dist/_virtual/index.es7.js +3 -5
- package/dist/_virtual/index.es7.js.map +1 -1
- package/dist/_virtual/index.es9.js +2 -2
- package/dist/_virtual/index10.cjs +1 -1
- package/dist/_virtual/index3.cjs +1 -1
- package/dist/_virtual/index4.cjs +1 -1
- package/dist/_virtual/index5.cjs +1 -1
- package/dist/_virtual/index6.cjs +1 -1
- package/dist/_virtual/index7.cjs +1 -1
- package/dist/_virtual/index9.cjs +1 -1
- package/dist/_virtual/variable-marker.cjs +2 -0
- package/dist/_virtual/variable-marker.cjs.map +1 -0
- package/dist/_virtual/variable-marker.es.js +5 -0
- package/dist/_virtual/variable-marker.es.js.map +1 -0
- package/dist/components/ContentRender/ContentRender.cjs +2 -2
- package/dist/components/ContentRender/ContentRender.cjs.map +1 -1
- package/dist/components/ContentRender/ContentRender.es.js +206 -205
- package/dist/components/ContentRender/ContentRender.es.js.map +1 -1
- package/dist/components/ContentRender/utils/inline-code-ranges.cjs +9 -9
- package/dist/components/ContentRender/utils/inline-code-ranges.cjs.map +1 -1
- package/dist/components/ContentRender/utils/inline-code-ranges.d.ts +3 -0
- package/dist/components/ContentRender/utils/inline-code-ranges.es.js +185 -161
- package/dist/components/ContentRender/utils/inline-code-ranges.es.js.map +1 -1
- package/dist/components/ContentRender/utils/mermaid-parse.cjs +4 -4
- package/dist/components/ContentRender/utils/mermaid-parse.cjs.map +1 -1
- package/dist/components/ContentRender/utils/mermaid-parse.es.js +53 -48
- package/dist/components/ContentRender/utils/mermaid-parse.es.js.map +1 -1
- package/dist/components/ContentRender/utils/split-content.cjs +6 -6
- package/dist/components/ContentRender/utils/split-content.cjs.map +1 -1
- package/dist/components/ContentRender/utils/split-content.d.ts +1 -0
- package/dist/components/ContentRender/utils/split-content.es.js +361 -313
- package/dist/components/ContentRender/utils/split-content.es.js.map +1 -1
- package/dist/components/MarkdownFlowEditor/MarkdownFlowEditor.cjs +1 -1
- package/dist/components/MarkdownFlowEditor/MarkdownFlowEditor.cjs.map +1 -1
- package/dist/components/MarkdownFlowEditor/MarkdownFlowEditor.es.js +278 -283
- package/dist/components/MarkdownFlowEditor/MarkdownFlowEditor.es.js.map +1 -1
- package/dist/components/MarkdownFlowEditor/components/VariableSelect.cjs +1 -1
- package/dist/components/MarkdownFlowEditor/components/VariableSelect.cjs.map +1 -1
- package/dist/components/MarkdownFlowEditor/components/VariableSelect.es.js +57 -58
- package/dist/components/MarkdownFlowEditor/components/VariableSelect.es.js.map +1 -1
- package/dist/components/MarkdownFlowEditor/locales/ar-SA.json.cjs +1 -1
- package/dist/components/MarkdownFlowEditor/locales/ar-SA.json.d.ts +1 -1
- package/dist/components/MarkdownFlowEditor/locales/ar-SA.json.es.js +1 -1
- package/dist/components/MarkdownFlowEditor/locales/de-DE.json.cjs +1 -1
- package/dist/components/MarkdownFlowEditor/locales/de-DE.json.d.ts +1 -1
- package/dist/components/MarkdownFlowEditor/locales/de-DE.json.es.js +19 -19
- package/dist/components/MarkdownFlowEditor/locales/en-US.json.cjs +1 -1
- package/dist/components/MarkdownFlowEditor/locales/en-US.json.d.ts +1 -1
- package/dist/components/MarkdownFlowEditor/locales/en-US.json.es.js +5 -5
- package/dist/components/MarkdownFlowEditor/locales/es-ES.json.cjs +1 -1
- package/dist/components/MarkdownFlowEditor/locales/es-ES.json.d.ts +1 -1
- package/dist/components/MarkdownFlowEditor/locales/es-ES.json.es.js +1 -1
- package/dist/components/MarkdownFlowEditor/locales/fil-PH.json.cjs +1 -1
- package/dist/components/MarkdownFlowEditor/locales/fil-PH.json.d.ts +1 -1
- package/dist/components/MarkdownFlowEditor/locales/fil-PH.json.es.js +15 -15
- package/dist/components/MarkdownFlowEditor/locales/fr-FR.json.cjs +1 -1
- package/dist/components/MarkdownFlowEditor/locales/fr-FR.json.d.ts +1 -1
- package/dist/components/MarkdownFlowEditor/locales/fr-FR.json.es.js +13 -13
- package/dist/components/MarkdownFlowEditor/locales/ja-JP.json.cjs +1 -1
- package/dist/components/MarkdownFlowEditor/locales/ja-JP.json.d.ts +1 -1
- package/dist/components/MarkdownFlowEditor/locales/ja-JP.json.es.js +1 -1
- package/dist/components/MarkdownFlowEditor/locales/th-TH.json.cjs +1 -1
- package/dist/components/MarkdownFlowEditor/locales/th-TH.json.d.ts +1 -1
- package/dist/components/MarkdownFlowEditor/locales/th-TH.json.es.js +1 -1
- package/dist/components/MarkdownFlowEditor/locales/ur-PK.json.cjs +1 -1
- package/dist/components/MarkdownFlowEditor/locales/ur-PK.json.d.ts +1 -1
- package/dist/components/MarkdownFlowEditor/locales/ur-PK.json.es.js +1 -1
- package/dist/components/MarkdownFlowEditor/locales/vi-VN.json.cjs +1 -1
- package/dist/components/MarkdownFlowEditor/locales/vi-VN.json.d.ts +1 -1
- package/dist/components/MarkdownFlowEditor/locales/vi-VN.json.es.js +15 -15
- package/dist/components/MarkdownFlowEditor/locales/zh-CN.json.cjs +1 -1
- package/dist/components/MarkdownFlowEditor/locales/zh-CN.json.d.ts +1 -1
- package/dist/components/MarkdownFlowEditor/locales/zh-CN.json.es.js +1 -1
- package/dist/components/MarkdownFlowEditor/plugins/SyntaxHighlighter.cjs +3 -3
- package/dist/components/MarkdownFlowEditor/plugins/SyntaxHighlighter.cjs.map +1 -1
- package/dist/components/MarkdownFlowEditor/plugins/SyntaxHighlighter.es.js +177 -176
- package/dist/components/MarkdownFlowEditor/plugins/SyntaxHighlighter.es.js.map +1 -1
- package/dist/components/MarkdownFlowEditor/plugins/VariablePlaceholder.cjs +2 -1
- package/dist/components/MarkdownFlowEditor/plugins/VariablePlaceholder.cjs.map +1 -1
- package/dist/components/MarkdownFlowEditor/plugins/VariablePlaceholder.d.ts +3 -1
- package/dist/components/MarkdownFlowEditor/plugins/VariablePlaceholder.es.js +38 -55
- package/dist/components/MarkdownFlowEditor/plugins/VariablePlaceholder.es.js.map +1 -1
- package/dist/components/MarkdownFlowEditor/utils.cjs +1 -1
- package/dist/components/MarkdownFlowEditor/utils.cjs.map +1 -1
- package/dist/components/MarkdownFlowEditor/utils.d.ts +2 -2
- package/dist/components/MarkdownFlowEditor/utils.es.js +34 -31
- package/dist/components/MarkdownFlowEditor/utils.es.js.map +1 -1
- package/dist/components/ui/inputGroup/textarea.cjs +1 -1
- package/dist/components/ui/inputGroup/textarea.es.js +1 -1
- package/dist/lib/interaction-defaults.cjs +1 -1
- package/dist/lib/interaction-defaults.cjs.map +1 -1
- package/dist/lib/interaction-defaults.es.js +124 -133
- package/dist/lib/interaction-defaults.es.js.map +1 -1
- package/dist/lib/interaction-defaults.failure.test.d.ts +1 -0
- package/dist/node_modules/classnames/index.cjs +1 -1
- package/dist/node_modules/classnames/index.es.js +1 -1
- package/dist/node_modules/hast-util-to-jsx-runtime/lib/index.cjs +1 -1
- package/dist/node_modules/hast-util-to-jsx-runtime/lib/index.es.js +1 -1
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/c4Diagram-AAMF2YG6.cjs +1 -1
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/c4Diagram-AAMF2YG6.es.js +1 -1
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-OMD6QJNC.cjs +1 -1
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-OMD6QJNC.es.js +1 -1
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-U37J5Y7L.cjs +1 -1
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-U37J5Y7L.es.js +1 -1
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/ganttDiagram-WV7ZQ7D5.cjs +1 -1
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/ganttDiagram-WV7ZQ7D5.es.js +1 -1
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/sequenceDiagram-4MX5Z3NR.cjs +1 -1
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/sequenceDiagram-4MX5Z3NR.es.js +1 -1
- package/dist/node_modules/rc-input/es/BaseInput.cjs +1 -1
- package/dist/node_modules/rc-input/es/BaseInput.es.js +1 -1
- package/dist/node_modules/rc-textarea/es/ResizableTextArea.cjs +1 -1
- package/dist/node_modules/rc-textarea/es/ResizableTextArea.es.js +1 -1
- package/dist/node_modules/rc-textarea/es/TextArea.cjs +1 -1
- package/dist/node_modules/rc-textarea/es/TextArea.es.js +1 -1
- package/dist/node_modules/rc-textarea/es/index.cjs +1 -1
- package/dist/node_modules/rc-textarea/es/index.es.js +1 -1
- package/dist/node_modules/remark-flow/dist/escaping.cjs +2 -2
- package/dist/node_modules/remark-flow/dist/escaping.cjs.map +1 -1
- package/dist/node_modules/remark-flow/dist/escaping.es.js +128 -63
- package/dist/node_modules/remark-flow/dist/escaping.es.js.map +1 -1
- package/dist/node_modules/remark-flow/dist/index.cjs +1 -1
- package/dist/node_modules/remark-flow/dist/index.cjs.map +1 -1
- package/dist/node_modules/remark-flow/dist/index.es.js +49 -37
- package/dist/node_modules/remark-flow/dist/index.es.js.map +1 -1
- package/dist/node_modules/remark-flow/dist/interaction-parser.cjs +1 -1
- package/dist/node_modules/remark-flow/dist/interaction-parser.cjs.map +1 -1
- package/dist/node_modules/remark-flow/dist/interaction-parser.es.js +260 -255
- package/dist/node_modules/remark-flow/dist/interaction-parser.es.js.map +1 -1
- package/dist/node_modules/remark-flow/dist/interaction-plugin-core.cjs +1 -1
- package/dist/node_modules/remark-flow/dist/interaction-plugin-core.cjs.map +1 -1
- package/dist/node_modules/remark-flow/dist/interaction-plugin-core.es.js +71 -42
- package/dist/node_modules/remark-flow/dist/interaction-plugin-core.es.js.map +1 -1
- package/dist/node_modules/remark-flow/dist/interaction-syntax.cjs +1 -1
- package/dist/node_modules/remark-flow/dist/interaction-syntax.cjs.map +1 -1
- package/dist/node_modules/remark-flow/dist/interaction-syntax.es.js +500 -46
- package/dist/node_modules/remark-flow/dist/interaction-syntax.es.js.map +1 -1
- package/dist/node_modules/remark-flow/dist/variable-marker.cjs +2 -0
- package/dist/node_modules/remark-flow/dist/variable-marker.cjs.map +1 -0
- package/dist/node_modules/remark-flow/dist/variable-marker.es.js +77 -0
- package/dist/node_modules/remark-flow/dist/variable-marker.es.js.map +1 -0
- package/dist/node_modules/remark-flow/dist/variable-name.cjs +14 -1
- package/dist/node_modules/remark-flow/dist/variable-name.cjs.map +1 -1
- package/dist/node_modules/remark-flow/dist/variable-name.es.js +742 -25
- package/dist/node_modules/remark-flow/dist/variable-name.es.js.map +1 -1
- package/dist/node_modules/style-to-object/cjs/index.cjs +1 -1
- package/dist/node_modules/style-to-object/cjs/index.cjs.map +1 -1
- package/dist/node_modules/style-to-object/cjs/index.es.js +1 -1
- package/dist/node_modules/unified/lib/index.cjs +1 -1
- package/dist/node_modules/unified/lib/index.es.js +1 -1
- package/package.json +2 -2
|
@@ -1,196 +1,187 @@
|
|
|
1
|
-
import { d } from "../_virtual/index.es.js";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
if (
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
return null;
|
|
13
|
-
const u = [], i = [];
|
|
14
|
-
let c;
|
|
15
|
-
return o.forEach((a) => {
|
|
16
|
-
if (a.startsWith("...")) {
|
|
17
|
-
const m = a.replace(/^\.\.\./, "").trim();
|
|
18
|
-
m && (c = m);
|
|
19
|
-
return;
|
|
1
|
+
import { d as u } from "../_virtual/index.es.js";
|
|
2
|
+
import { getMarkdownSourceAnalysis as b } from "../components/ContentRender/utils/inline-code-ranges.es.js";
|
|
3
|
+
const p = u.createInteractionParser(), T = /<custom-variable\b/i, x = new RegExp(
|
|
4
|
+
`\\?\\[(${u.INTERACTION_CONTENT_SOURCE})\\](?!\\()`
|
|
5
|
+
), V = /^[\[{]/, h = (t) => {
|
|
6
|
+
if (t.type === "flowInteraction" && "value" in t)
|
|
7
|
+
return typeof t.value == "string" ? t.value : null;
|
|
8
|
+
if (t.children)
|
|
9
|
+
for (const e of t.children) {
|
|
10
|
+
const r = h(e);
|
|
11
|
+
if (r !== null) return r;
|
|
20
12
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
variableName: s,
|
|
24
|
-
buttonTexts: u.length ? u : void 0,
|
|
25
|
-
buttonValues: i.length ? i : void 0,
|
|
26
|
-
placeholder: c,
|
|
27
|
-
isMultiSelect: r
|
|
28
|
-
};
|
|
29
|
-
}, E = (t) => {
|
|
13
|
+
return null;
|
|
14
|
+
}, I = (t) => {
|
|
30
15
|
if (!t)
|
|
31
16
|
return null;
|
|
32
17
|
try {
|
|
33
|
-
|
|
34
|
-
|
|
18
|
+
const e = h(b(t).tree) ?? (T.test(t) ? t : null);
|
|
19
|
+
return e === null || p.parse(e).error ? null : p.parseToRemarkFormat(
|
|
20
|
+
e
|
|
35
21
|
);
|
|
36
|
-
} catch (
|
|
37
|
-
console.warn("Failed to parse interaction block",
|
|
22
|
+
} catch (e) {
|
|
23
|
+
console.warn("Failed to parse interaction block", e);
|
|
38
24
|
}
|
|
39
|
-
return
|
|
40
|
-
},
|
|
25
|
+
return null;
|
|
26
|
+
}, g = (t, e) => {
|
|
41
27
|
if (!t)
|
|
42
28
|
return null;
|
|
43
|
-
const
|
|
29
|
+
const r = u.trimVariablePadding(t), n = e.buttonValues || [], i = e.buttonTexts || [], l = n.indexOf(r);
|
|
44
30
|
if (l > -1)
|
|
45
31
|
return {
|
|
46
|
-
value:
|
|
47
|
-
display:
|
|
32
|
+
value: n[l],
|
|
33
|
+
display: i[l]
|
|
48
34
|
};
|
|
49
|
-
const
|
|
50
|
-
return
|
|
51
|
-
value:
|
|
52
|
-
display:
|
|
35
|
+
const s = i.indexOf(r);
|
|
36
|
+
return s > -1 ? {
|
|
37
|
+
value: n[s] || i[s],
|
|
38
|
+
display: i[s]
|
|
53
39
|
} : null;
|
|
54
|
-
},
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
40
|
+
}, v = (t) => t.split(/[,,\n]/).map((e) => u.trimVariablePadding(e)).filter(Boolean), d = (t) => {
|
|
41
|
+
let e = 0;
|
|
42
|
+
for (; e < t.length && (t[e] === "," || t[e] === "," || u.trimVariablePadding(t[e]) === ""); )
|
|
43
|
+
e += 1;
|
|
44
|
+
return t.slice(e);
|
|
45
|
+
}, P = (t) => {
|
|
46
|
+
const e = t.buttonValues || [], r = t.buttonTexts || [], n = [], i = /* @__PURE__ */ new Set();
|
|
47
|
+
return e.forEach((l, s) => {
|
|
48
|
+
const a = u.trimVariablePadding(`${l ?? ""}`), o = u.trimVariablePadding(`${r[s] ?? ""}`);
|
|
49
|
+
[a, o].forEach((c) => {
|
|
59
50
|
if (!c)
|
|
60
51
|
return;
|
|
61
|
-
const
|
|
62
|
-
|
|
52
|
+
const f = `${c}::${a || c}`;
|
|
53
|
+
i.has(f) || (i.add(f), n.push({
|
|
63
54
|
token: c,
|
|
64
|
-
value:
|
|
55
|
+
value: a || c
|
|
65
56
|
}));
|
|
66
57
|
});
|
|
67
|
-
}),
|
|
68
|
-
(l,
|
|
58
|
+
}), n.sort(
|
|
59
|
+
(l, s) => s.token.length - l.token.length
|
|
69
60
|
);
|
|
70
|
-
},
|
|
71
|
-
const
|
|
72
|
-
for (const
|
|
73
|
-
if (!
|
|
61
|
+
}, E = (t, e) => {
|
|
62
|
+
const r = d(t), n = P(e);
|
|
63
|
+
for (const i of n) {
|
|
64
|
+
if (!r.startsWith(i.token))
|
|
74
65
|
continue;
|
|
75
|
-
const l =
|
|
76
|
-
if (!(l &&
|
|
77
|
-
return
|
|
66
|
+
const l = r[i.token.length];
|
|
67
|
+
if (!(l && l !== "," && l !== "," && u.trimVariablePadding(l) !== ""))
|
|
68
|
+
return i;
|
|
78
69
|
}
|
|
79
70
|
return null;
|
|
80
|
-
},
|
|
81
|
-
const
|
|
82
|
-
if (!
|
|
71
|
+
}, S = (t, e) => {
|
|
72
|
+
const r = v(t);
|
|
73
|
+
if (!r.length)
|
|
83
74
|
return {};
|
|
84
|
-
const
|
|
85
|
-
return
|
|
86
|
-
const
|
|
87
|
-
if (
|
|
88
|
-
|
|
75
|
+
const n = [], i = [];
|
|
76
|
+
return r.forEach((l) => {
|
|
77
|
+
const s = g(l, e);
|
|
78
|
+
if (s) {
|
|
79
|
+
n.push(s.value);
|
|
89
80
|
return;
|
|
90
81
|
}
|
|
91
|
-
if (
|
|
92
|
-
|
|
82
|
+
if (e.placeholder) {
|
|
83
|
+
i.push(l);
|
|
93
84
|
return;
|
|
94
85
|
}
|
|
95
|
-
|
|
86
|
+
n.push(l);
|
|
96
87
|
}), {
|
|
97
|
-
selectedValues:
|
|
98
|
-
inputText:
|
|
88
|
+
selectedValues: n.length ? n : void 0,
|
|
89
|
+
inputText: i.length ? i.join(", ") : void 0
|
|
99
90
|
};
|
|
100
|
-
},
|
|
101
|
-
const
|
|
102
|
-
let
|
|
103
|
-
for (;
|
|
104
|
-
const l =
|
|
91
|
+
}, R = (t, e) => {
|
|
92
|
+
const r = [];
|
|
93
|
+
let n = u.trimVariablePadding(t);
|
|
94
|
+
for (; n; ) {
|
|
95
|
+
const l = E(n, e);
|
|
105
96
|
if (!l)
|
|
106
97
|
break;
|
|
107
|
-
|
|
108
|
-
const
|
|
109
|
-
|
|
110
|
-
|
|
98
|
+
r.push(l.value);
|
|
99
|
+
const s = d(n);
|
|
100
|
+
n = d(
|
|
101
|
+
s.slice(l.token.length)
|
|
111
102
|
);
|
|
112
103
|
}
|
|
113
|
-
if (
|
|
104
|
+
if (r.length > 0)
|
|
114
105
|
return {
|
|
115
|
-
selectedValues:
|
|
116
|
-
inputText:
|
|
106
|
+
selectedValues: r,
|
|
107
|
+
inputText: e.placeholder && n.trim() ? n.trim() : void 0
|
|
117
108
|
};
|
|
118
|
-
const
|
|
119
|
-
return
|
|
109
|
+
const i = S(t, e);
|
|
110
|
+
return i.selectedValues?.length ? i : e.placeholder ? {
|
|
120
111
|
inputText: t.trim()
|
|
121
|
-
} :
|
|
122
|
-
},
|
|
112
|
+
} : i;
|
|
113
|
+
}, A = (t) => {
|
|
123
114
|
if (!t || Array.isArray(t))
|
|
124
115
|
return null;
|
|
125
|
-
const
|
|
126
|
-
return !
|
|
127
|
-
buttonText:
|
|
128
|
-
inputText:
|
|
129
|
-
selectedValues:
|
|
116
|
+
const e = Array.isArray(t.selectedValues) ? t.selectedValues.map((i) => u.trimVariablePadding(`${i ?? ""}`)).filter(Boolean) : void 0, r = u.trimVariablePadding(`${t.buttonText ?? ""}`), n = typeof t.inputText == "string" ? t.inputText : void 0;
|
|
117
|
+
return !e?.length && !r && !n ? null : {
|
|
118
|
+
buttonText: r || void 0,
|
|
119
|
+
inputText: n,
|
|
120
|
+
selectedValues: e?.length ? e : void 0
|
|
130
121
|
};
|
|
131
122
|
}, D = (t) => {
|
|
132
|
-
if (!t || !
|
|
123
|
+
if (!t || !V.test(u.trimVariablePadding(t)))
|
|
133
124
|
return null;
|
|
134
125
|
try {
|
|
135
|
-
const
|
|
136
|
-
return
|
|
126
|
+
const e = JSON.parse(t);
|
|
127
|
+
return A(e);
|
|
137
128
|
} catch {
|
|
138
129
|
return null;
|
|
139
130
|
}
|
|
140
|
-
},
|
|
131
|
+
}, N = (t) => !!(t && (T.test(t) || x.test(t))), m = (t, e, r, n) => n?.resolveDefaultValues?.({
|
|
141
132
|
content: t,
|
|
142
|
-
rawValue:
|
|
143
|
-
interactionInfo:
|
|
144
|
-
}) ?? null,
|
|
145
|
-
const
|
|
146
|
-
if (!
|
|
133
|
+
rawValue: e,
|
|
134
|
+
interactionInfo: r
|
|
135
|
+
}) ?? null, O = (t, e, r) => {
|
|
136
|
+
const n = e == null ? void 0 : u.trimVariablePadding(e.toString());
|
|
137
|
+
if (!n)
|
|
147
138
|
return {};
|
|
148
|
-
const
|
|
149
|
-
if (
|
|
150
|
-
return
|
|
151
|
-
const l =
|
|
139
|
+
const i = D(n);
|
|
140
|
+
if (i)
|
|
141
|
+
return i;
|
|
142
|
+
const l = m(
|
|
152
143
|
t,
|
|
153
|
-
|
|
144
|
+
n,
|
|
154
145
|
null,
|
|
155
|
-
|
|
146
|
+
r
|
|
156
147
|
);
|
|
157
148
|
if (l)
|
|
158
149
|
return l;
|
|
159
|
-
if (!
|
|
150
|
+
if (!N(t))
|
|
160
151
|
return {
|
|
161
|
-
buttonText:
|
|
162
|
-
inputText:
|
|
152
|
+
buttonText: n,
|
|
153
|
+
inputText: n
|
|
163
154
|
};
|
|
164
|
-
const
|
|
155
|
+
const s = I(t), a = m(
|
|
165
156
|
t,
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
157
|
+
n,
|
|
158
|
+
s,
|
|
159
|
+
r
|
|
169
160
|
);
|
|
170
|
-
if (
|
|
171
|
-
return
|
|
172
|
-
if (!
|
|
161
|
+
if (a)
|
|
162
|
+
return a;
|
|
163
|
+
if (!s)
|
|
173
164
|
return {
|
|
174
|
-
buttonText:
|
|
175
|
-
inputText:
|
|
165
|
+
buttonText: n,
|
|
166
|
+
inputText: n
|
|
176
167
|
};
|
|
177
|
-
if (
|
|
178
|
-
return
|
|
179
|
-
const
|
|
180
|
-
return
|
|
181
|
-
buttonText:
|
|
182
|
-
} :
|
|
183
|
-
inputText:
|
|
168
|
+
if (s.isMultiSelect)
|
|
169
|
+
return R(n, s);
|
|
170
|
+
const o = g(n, s);
|
|
171
|
+
return o ? {
|
|
172
|
+
buttonText: o.value || o.display || n
|
|
173
|
+
} : s.placeholder ? {
|
|
174
|
+
inputText: n
|
|
184
175
|
} : {
|
|
185
|
-
buttonText:
|
|
186
|
-
inputText:
|
|
176
|
+
buttonText: n,
|
|
177
|
+
inputText: n
|
|
187
178
|
};
|
|
188
|
-
},
|
|
189
|
-
const
|
|
190
|
-
return
|
|
179
|
+
}, y = (t, e, r) => {
|
|
180
|
+
const n = O(t, e, r);
|
|
181
|
+
return n.selectedValues ? n.selectedValues : e ? e.split(",").map((i) => u.trimVariablePadding(i)).filter(Boolean) : void 0;
|
|
191
182
|
};
|
|
192
183
|
export {
|
|
193
|
-
|
|
194
|
-
|
|
184
|
+
y as getInteractionDefaultSelectedValues,
|
|
185
|
+
O as getInteractionDefaultValues
|
|
195
186
|
};
|
|
196
187
|
//# sourceMappingURL=interaction-defaults.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interaction-defaults.es.js","sources":["../../src/lib/interaction-defaults.ts"],"sourcesContent":["import {\n createInteractionParser,\n createVariableExpressionRegex,\n normalizeVariableName,\n INTERACTION_CONTENT_SOURCE,\n} from \"remark-flow\";\n\nexport interface InteractionParseResult {\n buttonTexts?: string[];\n buttonValues?: string[];\n placeholder?: string;\n variableName?: string;\n isMultiSelect?: boolean;\n}\n\nexport interface InteractionDefaultValues {\n buttonText?: string;\n inputText?: string;\n selectedValues?: string[];\n}\n\nexport interface InteractionDefaultResolverParams {\n content?: string | null;\n rawValue?: string | null;\n interactionInfo?: InteractionParseResult | null;\n}\n\nexport type InteractionDefaultResolver = (\n params: InteractionDefaultResolverParams\n) => InteractionDefaultValues | null | undefined;\n\nexport interface InteractionDefaultValueOptions {\n resolveDefaultValues?: InteractionDefaultResolver;\n}\n\ninterface StructuredInteractionPayload {\n buttonText?: unknown;\n inputText?: unknown;\n selectedValues?: unknown;\n}\n\nconst interactionParser = createInteractionParser();\nconst INTERACTION_TAG_PATTERN = /<custom-variable\\b/i;\n// Same definition of where an interaction ends as the parser uses, so an option carrying a\n// `\\]` is read whole instead of being cut at its first bracket. A variable assignment is optional.\nconst INTERACTION_SHORTCODE_PATTERN = new RegExp(\n `\\\\?\\\\[(?:%${createVariableExpressionRegex().source})?(${INTERACTION_CONTENT_SOURCE})\\\\]`\n);\nconst JSON_LIKE_VALUE_PATTERN = /^[\\[{]/;\nconst INTERACTION_VALUE_SEPARATOR_PATTERN = /^[\\s,,\\n]+/;\n\ninterface InteractionOptionCandidate {\n token: string;\n value: string;\n}\n\nconst parseInteractionShortcode = (\n content?: string | null\n): InteractionParseResult | null => {\n if (!content) {\n return null;\n }\n\n const matched = content.match(INTERACTION_SHORTCODE_PATTERN);\n const variableName = matched?.[1]\n ? (normalizeVariableName(matched[1]) ?? undefined)\n : undefined;\n const interactionBody = matched?.[2]?.trim();\n\n if (!interactionBody) {\n return null;\n }\n\n const isMultiSelect = interactionBody.includes(\"||\");\n const separator = isMultiSelect ? \"||\" : \"|\";\n const rawOptions = interactionBody\n .split(separator)\n .map((item) => item.trim())\n .filter(Boolean);\n\n if (!rawOptions.length) {\n return null;\n }\n\n const buttonTexts: string[] = [];\n const buttonValues: string[] = [];\n let placeholder: string | undefined;\n\n rawOptions.forEach((option) => {\n if (option.startsWith(\"...\")) {\n const normalizedPlaceholder = option.replace(/^\\.\\.\\./, \"\").trim();\n if (normalizedPlaceholder) {\n placeholder = normalizedPlaceholder;\n }\n return;\n }\n\n buttonTexts.push(option);\n buttonValues.push(option);\n });\n\n return {\n variableName,\n buttonTexts: buttonTexts.length ? buttonTexts : undefined,\n buttonValues: buttonValues.length ? buttonValues : undefined,\n placeholder,\n isMultiSelect,\n };\n};\n\nconst parseInteractionBlock = (\n content?: string | null\n): InteractionParseResult | null => {\n if (!content) {\n return null;\n }\n\n try {\n return interactionParser.parseToRemarkFormat(\n content\n ) as InteractionParseResult;\n } catch (error) {\n console.warn(\"Failed to parse interaction block\", error);\n }\n\n return parseInteractionShortcode(content);\n};\n\nconst normalizeButtonValue = (\n token: string,\n info: InteractionParseResult\n): { value: string; display?: string } | null => {\n if (!token) {\n return null;\n }\n\n const cleaned = token.trim();\n const buttonValues = info.buttonValues || [];\n const buttonTexts = info.buttonTexts || [];\n const valueIndex = buttonValues.indexOf(cleaned);\n\n if (valueIndex > -1) {\n return {\n value: buttonValues[valueIndex],\n display: buttonTexts[valueIndex],\n };\n }\n\n const textIndex = buttonTexts.indexOf(cleaned);\n\n if (textIndex > -1) {\n return {\n value: buttonValues[textIndex] || buttonTexts[textIndex],\n display: buttonTexts[textIndex],\n };\n }\n\n return null;\n};\n\nconst splitPresetValues = (raw: string) => {\n return raw\n .split(/[,,\\n]/)\n .map((item) => item.trim())\n .filter(Boolean);\n};\n\nconst trimLeadingInteractionSeparators = (raw: string) =>\n raw.replace(INTERACTION_VALUE_SEPARATOR_PATTERN, \"\");\n\nconst buildInteractionOptionCandidates = (\n info: InteractionParseResult\n): InteractionOptionCandidate[] => {\n const buttonValues = info.buttonValues || [];\n const buttonTexts = info.buttonTexts || [];\n const candidates: InteractionOptionCandidate[] = [];\n const seenCandidates = new Set<string>();\n\n buttonValues.forEach((buttonValue, index) => {\n const normalizedValue = `${buttonValue ?? \"\"}`.trim();\n const normalizedText = `${buttonTexts[index] ?? \"\"}`.trim();\n\n [normalizedValue, normalizedText].forEach((token) => {\n if (!token) {\n return;\n }\n\n const candidateKey = `${token}::${normalizedValue || token}`;\n if (seenCandidates.has(candidateKey)) {\n return;\n }\n\n seenCandidates.add(candidateKey);\n candidates.push({\n token,\n value: normalizedValue || token,\n });\n });\n });\n\n return candidates.sort(\n (left, right) => right.token.length - left.token.length\n );\n};\n\nconst matchInteractionOptionPrefix = (\n raw: string,\n info: InteractionParseResult\n): InteractionOptionCandidate | null => {\n const normalizedRaw = trimLeadingInteractionSeparators(raw);\n const candidates = buildInteractionOptionCandidates(info);\n\n for (const candidate of candidates) {\n if (!normalizedRaw.startsWith(candidate.token)) {\n continue;\n }\n\n const trailingChar = normalizedRaw[candidate.token.length];\n if (trailingChar && !/[\\s,,\\n]/.test(trailingChar)) {\n continue;\n }\n\n return candidate;\n }\n\n return null;\n};\n\nconst resolveMultiSelectFallbackDefaults = (\n raw: string,\n info: InteractionParseResult\n): InteractionDefaultValues => {\n const tokens = splitPresetValues(raw);\n\n if (!tokens.length) {\n return {};\n }\n\n const selectedValues: string[] = [];\n const customInputs: string[] = [];\n\n tokens.forEach((token) => {\n const mapped = normalizeButtonValue(token, info);\n\n if (mapped) {\n selectedValues.push(mapped.value);\n return;\n }\n\n if (info.placeholder) {\n customInputs.push(token);\n return;\n }\n\n selectedValues.push(token);\n });\n\n return {\n selectedValues: selectedValues.length ? selectedValues : undefined,\n inputText: customInputs.length ? customInputs.join(\", \") : undefined,\n };\n};\n\nconst resolveMultiSelectInteractionDefaults = (\n raw: string,\n info: InteractionParseResult\n): InteractionDefaultValues => {\n const selectedValues: string[] = [];\n let remainingRaw = raw.trim();\n\n // Prefer option-aware prefix matching before delimiter splitting so\n // option labels that contain commas can still round-trip correctly.\n while (remainingRaw) {\n const matchedCandidate = matchInteractionOptionPrefix(remainingRaw, info);\n\n if (!matchedCandidate) {\n break;\n }\n\n selectedValues.push(matchedCandidate.value);\n const normalizedRemainingRaw =\n trimLeadingInteractionSeparators(remainingRaw);\n remainingRaw = trimLeadingInteractionSeparators(\n normalizedRemainingRaw.slice(matchedCandidate.token.length)\n );\n }\n\n if (selectedValues.length > 0) {\n return {\n selectedValues,\n inputText:\n info.placeholder && remainingRaw.trim()\n ? remainingRaw.trim()\n : undefined,\n };\n }\n\n const fallbackDefaults = resolveMultiSelectFallbackDefaults(raw, info);\n\n if (fallbackDefaults.selectedValues?.length) {\n return fallbackDefaults;\n }\n\n if (info.placeholder) {\n return {\n inputText: raw.trim(),\n };\n }\n\n return fallbackDefaults;\n};\n\nconst normalizeStructuredInteractionDefaults = (\n payload?: StructuredInteractionPayload | null\n): InteractionDefaultValues | null => {\n if (!payload || Array.isArray(payload)) {\n return null;\n }\n\n const selectedValues = Array.isArray(payload.selectedValues)\n ? payload.selectedValues\n .map((item) => `${item ?? \"\"}`.trim())\n .filter(Boolean)\n : undefined;\n const buttonText = `${payload.buttonText ?? \"\"}`.trim();\n const inputText =\n typeof payload.inputText === \"string\" ? payload.inputText : undefined;\n\n if (!selectedValues?.length && !buttonText && !inputText) {\n return null;\n }\n\n return {\n buttonText: buttonText || undefined,\n inputText,\n selectedValues: selectedValues?.length ? selectedValues : undefined,\n };\n};\n\nconst parseStructuredInteractionDefaults = (rawValue?: string | null) => {\n if (!rawValue) {\n return null;\n }\n\n if (!JSON_LIKE_VALUE_PATTERN.test(rawValue.trim())) {\n return null;\n }\n\n try {\n const parsed = JSON.parse(rawValue) as StructuredInteractionPayload;\n return normalizeStructuredInteractionDefaults(parsed);\n } catch {\n return null;\n }\n};\n\nconst hasPotentialInteractionBlock = (content?: string | null) =>\n Boolean(\n content &&\n (INTERACTION_TAG_PATTERN.test(content) ||\n INTERACTION_SHORTCODE_PATTERN.test(content))\n );\n\nconst resolveCustomInteractionDefaults = (\n content?: string | null,\n rawValue?: string | null,\n interactionInfo?: InteractionParseResult | null,\n options?: InteractionDefaultValueOptions\n) => {\n return (\n options?.resolveDefaultValues?.({\n content,\n rawValue,\n interactionInfo,\n }) ?? null\n );\n};\n\nexport const getInteractionDefaultValues = (\n content?: string | null,\n rawValue?: string | null,\n options?: InteractionDefaultValueOptions\n): InteractionDefaultValues => {\n const normalized = rawValue?.toString().trim();\n\n if (!normalized) {\n return {};\n }\n\n const structuredDefaults = parseStructuredInteractionDefaults(normalized);\n\n if (structuredDefaults) {\n return structuredDefaults;\n }\n\n const customDefaults = resolveCustomInteractionDefaults(\n content,\n normalized,\n null,\n options\n );\n\n if (customDefaults) {\n return customDefaults;\n }\n\n if (!hasPotentialInteractionBlock(content)) {\n return {\n buttonText: normalized,\n inputText: normalized,\n };\n }\n\n const interactionInfo = parseInteractionBlock(content);\n const customDefaultsWithInteraction = resolveCustomInteractionDefaults(\n content,\n normalized,\n interactionInfo,\n options\n );\n\n if (customDefaultsWithInteraction) {\n return customDefaultsWithInteraction;\n }\n\n if (!interactionInfo) {\n return {\n buttonText: normalized,\n inputText: normalized,\n };\n }\n\n if (interactionInfo.isMultiSelect) {\n return resolveMultiSelectInteractionDefaults(normalized, interactionInfo);\n }\n\n const mapped = normalizeButtonValue(normalized, interactionInfo);\n\n if (mapped) {\n return {\n buttonText: mapped.value || mapped.display || normalized,\n };\n }\n\n if (interactionInfo.placeholder) {\n return {\n inputText: normalized,\n };\n }\n\n return {\n buttonText: normalized,\n inputText: normalized,\n };\n};\n\nexport const getInteractionDefaultSelectedValues = (\n content?: string | null,\n rawValue?: string | null,\n options?: InteractionDefaultValueOptions\n) => {\n const defaults = getInteractionDefaultValues(content, rawValue, options);\n\n if (defaults.selectedValues) {\n return defaults.selectedValues;\n }\n\n return rawValue\n ? rawValue\n .split(\",\")\n .map((value) => value.trim())\n .filter(Boolean)\n : undefined;\n};\n"],"names":["interactionParser","createInteractionParser","INTERACTION_TAG_PATTERN","INTERACTION_SHORTCODE_PATTERN","createVariableExpressionRegex","INTERACTION_CONTENT_SOURCE","JSON_LIKE_VALUE_PATTERN","INTERACTION_VALUE_SEPARATOR_PATTERN","parseInteractionShortcode","content","matched","variableName","normalizeVariableName","interactionBody","isMultiSelect","separator","rawOptions","item","buttonTexts","buttonValues","placeholder","option","normalizedPlaceholder","parseInteractionBlock","error","normalizeButtonValue","token","info","cleaned","valueIndex","textIndex","splitPresetValues","raw","trimLeadingInteractionSeparators","buildInteractionOptionCandidates","candidates","seenCandidates","buttonValue","index","normalizedValue","normalizedText","candidateKey","left","right","matchInteractionOptionPrefix","normalizedRaw","candidate","trailingChar","resolveMultiSelectFallbackDefaults","tokens","selectedValues","customInputs","mapped","resolveMultiSelectInteractionDefaults","remainingRaw","matchedCandidate","normalizedRemainingRaw","fallbackDefaults","normalizeStructuredInteractionDefaults","payload","buttonText","inputText","parseStructuredInteractionDefaults","rawValue","parsed","hasPotentialInteractionBlock","resolveCustomInteractionDefaults","interactionInfo","options","getInteractionDefaultValues","normalized","structuredDefaults","customDefaults","customDefaultsWithInteraction","getInteractionDefaultSelectedValues","defaults","value"],"mappings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WN,EAA4B5D,GAASsD,GAAUK,CAAO;AAEvE,SAAIO,EAAS,iBACJA,EAAS,iBAGXZ,IACHA,EACG,MAAM,GAAG,EACT,IAAI,CAACa,MAAUA,EAAM,KAAA,CAAM,EAC3B,OAAO,OAAO,IACjB;AACN;"}
|
|
1
|
+
{"version":3,"file":"interaction-defaults.es.js","sources":["../../src/lib/interaction-defaults.ts"],"sourcesContent":["import {\n createInteractionParser,\n trimVariablePadding,\n INTERACTION_CONTENT_SOURCE,\n} from \"remark-flow\";\nimport type { Node } from \"unist\";\nimport { getMarkdownSourceAnalysis } from \"../components/ContentRender/utils/inline-code-ranges\";\n\nexport interface InteractionParseResult {\n buttonTexts?: string[];\n buttonValues?: string[];\n placeholder?: string;\n variableName?: string;\n isMultiSelect?: boolean;\n}\n\nexport interface InteractionDefaultValues {\n buttonText?: string;\n inputText?: string;\n selectedValues?: string[];\n}\n\nexport interface InteractionDefaultResolverParams {\n content?: string | null;\n rawValue?: string | null;\n interactionInfo?: InteractionParseResult | null;\n}\n\nexport type InteractionDefaultResolver = (\n params: InteractionDefaultResolverParams\n) => InteractionDefaultValues | null | undefined;\n\nexport interface InteractionDefaultValueOptions {\n resolveDefaultValues?: InteractionDefaultResolver;\n}\n\ninterface StructuredInteractionPayload {\n buttonText?: unknown;\n inputText?: unknown;\n selectedValues?: unknown;\n}\n\nconst interactionParser = createInteractionParser();\nconst INTERACTION_TAG_PATTERN = /<custom-variable\\b/i;\n// Same definition of where an interaction ends as the parser uses, so an option carrying a\n// `\\]` is read whole instead of being cut at its first bracket. A variable assignment is optional.\nconst INTERACTION_SHORTCODE_PATTERN = new RegExp(\n `\\\\?\\\\[(${INTERACTION_CONTENT_SOURCE})\\\\](?!\\\\()`\n);\nconst JSON_LIKE_VALUE_PATTERN = /^[\\[{]/;\n\ninterface InteractionOptionCandidate {\n token: string;\n value: string;\n}\n\nconst findInteractionSource = (\n node: Node & { value?: unknown; children?: readonly Node[] }\n): string | null => {\n if (node.type === \"flowInteraction\" && \"value\" in node)\n return typeof node.value === \"string\" ? node.value : null;\n if (node.children) {\n for (const child of node.children) {\n const source = findInteractionSource(child);\n if (source !== null) return source;\n }\n }\n return null;\n};\n\nconst parseInteractionBlock = (\n content?: string | null\n): InteractionParseResult | null => {\n if (!content) {\n return null;\n }\n\n try {\n // Read a grammar-owned interaction, so a syntax example cannot supply its key\n // or swallow a later real control. Keep the existing serialized-tag path.\n const source =\n findInteractionSource(getMarkdownSourceAnalysis(content).tree) ??\n (INTERACTION_TAG_PATTERN.test(content) ? content : null);\n if (source === null) return null;\n // The compatibility formatter turns invalid source into a text-input placeholder.\n // Defaults must retain plain replay behavior instead of inventing an interaction.\n if (interactionParser.parse(source).error) return null;\n return interactionParser.parseToRemarkFormat(\n source\n ) as InteractionParseResult;\n } catch (error) {\n console.warn(\"Failed to parse interaction block\", error);\n }\n\n return null;\n};\n\nconst normalizeButtonValue = (\n token: string,\n info: InteractionParseResult\n): { value: string; display?: string } | null => {\n if (!token) {\n return null;\n }\n\n const cleaned = trimVariablePadding(token);\n const buttonValues = info.buttonValues || [];\n const buttonTexts = info.buttonTexts || [];\n const valueIndex = buttonValues.indexOf(cleaned);\n\n if (valueIndex > -1) {\n return {\n value: buttonValues[valueIndex],\n display: buttonTexts[valueIndex],\n };\n }\n\n const textIndex = buttonTexts.indexOf(cleaned);\n\n if (textIndex > -1) {\n return {\n value: buttonValues[textIndex] || buttonTexts[textIndex],\n display: buttonTexts[textIndex],\n };\n }\n\n return null;\n};\n\nconst splitPresetValues = (raw: string) => {\n return raw\n .split(/[,,\\n]/)\n .map((item) => trimVariablePadding(item))\n .filter(Boolean);\n};\n\nconst trimLeadingInteractionSeparators = (raw: string) => {\n let index = 0;\n while (\n index < raw.length &&\n (raw[index] === \",\" ||\n raw[index] === \",\" ||\n trimVariablePadding(raw[index]) === \"\")\n )\n index += 1;\n return raw.slice(index);\n};\n\nconst buildInteractionOptionCandidates = (\n info: InteractionParseResult\n): InteractionOptionCandidate[] => {\n const buttonValues = info.buttonValues || [];\n const buttonTexts = info.buttonTexts || [];\n const candidates: InteractionOptionCandidate[] = [];\n const seenCandidates = new Set<string>();\n\n buttonValues.forEach((buttonValue, index) => {\n const normalizedValue = trimVariablePadding(`${buttonValue ?? \"\"}`);\n const normalizedText = trimVariablePadding(`${buttonTexts[index] ?? \"\"}`);\n\n [normalizedValue, normalizedText].forEach((token) => {\n if (!token) {\n return;\n }\n\n const candidateKey = `${token}::${normalizedValue || token}`;\n if (seenCandidates.has(candidateKey)) {\n return;\n }\n\n seenCandidates.add(candidateKey);\n candidates.push({\n token,\n value: normalizedValue || token,\n });\n });\n });\n\n return candidates.sort(\n (left, right) => right.token.length - left.token.length\n );\n};\n\nconst matchInteractionOptionPrefix = (\n raw: string,\n info: InteractionParseResult\n): InteractionOptionCandidate | null => {\n const normalizedRaw = trimLeadingInteractionSeparators(raw);\n const candidates = buildInteractionOptionCandidates(info);\n\n for (const candidate of candidates) {\n if (!normalizedRaw.startsWith(candidate.token)) {\n continue;\n }\n\n const trailingChar = normalizedRaw[candidate.token.length];\n if (\n trailingChar &&\n trailingChar !== \",\" &&\n trailingChar !== \",\" &&\n trimVariablePadding(trailingChar) !== \"\"\n ) {\n continue;\n }\n\n return candidate;\n }\n\n return null;\n};\n\nconst resolveMultiSelectFallbackDefaults = (\n raw: string,\n info: InteractionParseResult\n): InteractionDefaultValues => {\n const tokens = splitPresetValues(raw);\n\n if (!tokens.length) {\n return {};\n }\n\n const selectedValues: string[] = [];\n const customInputs: string[] = [];\n\n tokens.forEach((token) => {\n const mapped = normalizeButtonValue(token, info);\n\n if (mapped) {\n selectedValues.push(mapped.value);\n return;\n }\n\n if (info.placeholder) {\n customInputs.push(token);\n return;\n }\n\n selectedValues.push(token);\n });\n\n return {\n selectedValues: selectedValues.length ? selectedValues : undefined,\n inputText: customInputs.length ? customInputs.join(\", \") : undefined,\n };\n};\n\nconst resolveMultiSelectInteractionDefaults = (\n raw: string,\n info: InteractionParseResult\n): InteractionDefaultValues => {\n const selectedValues: string[] = [];\n let remainingRaw = trimVariablePadding(raw);\n\n // Prefer option-aware prefix matching before delimiter splitting so\n // option labels that contain commas can still round-trip correctly.\n while (remainingRaw) {\n const matchedCandidate = matchInteractionOptionPrefix(remainingRaw, info);\n\n if (!matchedCandidate) {\n break;\n }\n\n selectedValues.push(matchedCandidate.value);\n const normalizedRemainingRaw =\n trimLeadingInteractionSeparators(remainingRaw);\n remainingRaw = trimLeadingInteractionSeparators(\n normalizedRemainingRaw.slice(matchedCandidate.token.length)\n );\n }\n\n if (selectedValues.length > 0) {\n return {\n selectedValues,\n inputText:\n info.placeholder && remainingRaw.trim()\n ? remainingRaw.trim()\n : undefined,\n };\n }\n\n const fallbackDefaults = resolveMultiSelectFallbackDefaults(raw, info);\n\n if (fallbackDefaults.selectedValues?.length) {\n return fallbackDefaults;\n }\n\n if (info.placeholder) {\n return {\n inputText: raw.trim(),\n };\n }\n\n return fallbackDefaults;\n};\n\nconst normalizeStructuredInteractionDefaults = (\n payload?: StructuredInteractionPayload | null\n): InteractionDefaultValues | null => {\n if (!payload || Array.isArray(payload)) {\n return null;\n }\n\n const selectedValues = Array.isArray(payload.selectedValues)\n ? payload.selectedValues\n .map((item) => trimVariablePadding(`${item ?? \"\"}`))\n .filter(Boolean)\n : undefined;\n const buttonText = trimVariablePadding(`${payload.buttonText ?? \"\"}`);\n const inputText =\n typeof payload.inputText === \"string\" ? payload.inputText : undefined;\n\n if (!selectedValues?.length && !buttonText && !inputText) {\n return null;\n }\n\n return {\n buttonText: buttonText || undefined,\n inputText,\n selectedValues: selectedValues?.length ? selectedValues : undefined,\n };\n};\n\nconst parseStructuredInteractionDefaults = (rawValue?: string | null) => {\n if (!rawValue) {\n return null;\n }\n\n if (!JSON_LIKE_VALUE_PATTERN.test(trimVariablePadding(rawValue))) {\n return null;\n }\n\n try {\n const parsed = JSON.parse(rawValue) as StructuredInteractionPayload;\n return normalizeStructuredInteractionDefaults(parsed);\n } catch {\n return null;\n }\n};\n\nconst hasPotentialInteractionBlock = (content?: string | null) =>\n Boolean(\n content &&\n (INTERACTION_TAG_PATTERN.test(content) ||\n INTERACTION_SHORTCODE_PATTERN.test(content))\n );\n\nconst resolveCustomInteractionDefaults = (\n content?: string | null,\n rawValue?: string | null,\n interactionInfo?: InteractionParseResult | null,\n options?: InteractionDefaultValueOptions\n) => {\n return (\n options?.resolveDefaultValues?.({\n content,\n rawValue,\n interactionInfo,\n }) ?? null\n );\n};\n\nexport const getInteractionDefaultValues = (\n content?: string | null,\n rawValue?: string | null,\n options?: InteractionDefaultValueOptions\n): InteractionDefaultValues => {\n const normalized =\n rawValue === null || rawValue === undefined\n ? undefined\n : trimVariablePadding(rawValue.toString());\n\n if (!normalized) {\n return {};\n }\n\n const structuredDefaults = parseStructuredInteractionDefaults(normalized);\n\n if (structuredDefaults) {\n return structuredDefaults;\n }\n\n const customDefaults = resolveCustomInteractionDefaults(\n content,\n normalized,\n null,\n options\n );\n\n if (customDefaults) {\n return customDefaults;\n }\n\n if (!hasPotentialInteractionBlock(content)) {\n return {\n buttonText: normalized,\n inputText: normalized,\n };\n }\n\n const interactionInfo = parseInteractionBlock(content);\n const customDefaultsWithInteraction = resolveCustomInteractionDefaults(\n content,\n normalized,\n interactionInfo,\n options\n );\n\n if (customDefaultsWithInteraction) {\n return customDefaultsWithInteraction;\n }\n\n if (!interactionInfo) {\n return {\n buttonText: normalized,\n inputText: normalized,\n };\n }\n\n if (interactionInfo.isMultiSelect) {\n return resolveMultiSelectInteractionDefaults(normalized, interactionInfo);\n }\n\n const mapped = normalizeButtonValue(normalized, interactionInfo);\n\n if (mapped) {\n return {\n buttonText: mapped.value || mapped.display || normalized,\n };\n }\n\n if (interactionInfo.placeholder) {\n return {\n inputText: normalized,\n };\n }\n\n return {\n buttonText: normalized,\n inputText: normalized,\n };\n};\n\nexport const getInteractionDefaultSelectedValues = (\n content?: string | null,\n rawValue?: string | null,\n options?: InteractionDefaultValueOptions\n) => {\n const defaults = getInteractionDefaultValues(content, rawValue, options);\n\n if (defaults.selectedValues) {\n return defaults.selectedValues;\n }\n\n return rawValue\n ? rawValue\n .split(\",\")\n .map((value) => trimVariablePadding(value))\n .filter(Boolean)\n : undefined;\n};\n"],"names":["interactionParser","createInteractionParser","INTERACTION_TAG_PATTERN","INTERACTION_SHORTCODE_PATTERN","INTERACTION_CONTENT_SOURCE","JSON_LIKE_VALUE_PATTERN","findInteractionSource","node","child","source","parseInteractionBlock","content","getMarkdownSourceAnalysis","error","normalizeButtonValue","token","info","cleaned","trimVariablePadding","buttonValues","buttonTexts","valueIndex","textIndex","splitPresetValues","raw","item","trimLeadingInteractionSeparators","index","buildInteractionOptionCandidates","candidates","seenCandidates","buttonValue","normalizedValue","normalizedText","candidateKey","left","right","matchInteractionOptionPrefix","normalizedRaw","candidate","trailingChar","resolveMultiSelectFallbackDefaults","tokens","selectedValues","customInputs","mapped","resolveMultiSelectInteractionDefaults","remainingRaw","matchedCandidate","normalizedRemainingRaw","fallbackDefaults","normalizeStructuredInteractionDefaults","payload","buttonText","inputText","parseStructuredInteractionDefaults","rawValue","parsed","hasPotentialInteractionBlock","resolveCustomInteractionDefaults","interactionInfo","options","getInteractionDefaultValues","normalized","structuredDefaults","customDefaults","customDefaultsWithInteraction","getInteractionDefaultSelectedValues","defaults","value"],"mappings":";;AA0CA,MAAMA,IAAoBC,EAAAA,wBAAA,GACpBC,IAA0B,uBAG1BC,IAAgC,IAAI;AAAA,EACxC,UAAUC,EAAAA,0BAA0B;AACtC,GACMC,IAA0B,UAO1BC,IAAwB,CAC5BC,MACkB;AAClB,MAAIA,EAAK,SAAS,qBAAqB,WAAWA;AAChD,WAAO,OAAOA,EAAK,SAAU,WAAWA,EAAK,QAAQ;AACvD,MAAIA,EAAK;AACP,eAAWC,KAASD,EAAK,UAAU;AACjC,YAAME,IAASH,EAAsBE,CAAK;AAC1C,UAAIC,MAAW,KAAM,QAAOA;AAAA,IAC9B;AAEF,SAAO;AACT,GAEMC,IAAwB,CAC5BC,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AAsBC,CAAO,GAC/CuD,IAAgCP;AAAA,IACpChD;AAAA,IACAoD;AAAA,IACAH;AAAA,IACAC;AAAA,EAAA;AAGF,MAAIK;AACF,WAAOA;AAGT,MAAI,CAACN;AACH,WAAO;AAAA,MACL,YAAYG;AAAA,MACZ,WAAWA;AAAA,IAAA;AAIf,MAAIH,EAAgB;AAClB,WAAOd,EAAsCiB,GAAYH,CAAe;AAG1E,QAAMf,IAAS/B,EAAqBiD,GAAYH,CAAe;AAE/D,SAAIf,IACK;AAAA,IACL,YAAYA,EAAO,SAASA,EAAO,WAAWkB;AAAA,EAAA,IAI9CH,EAAgB,cACX;AAAA,IACL,WAAWG;AAAA,EAAA,IAIR;AAAA,IACL,YAAYA;AAAA,IACZ,WAAWA;AAAA,EAAA;AAEf,GAEaI,IAAsC,CACjDxD,GACA6C,GACAK,MACG;AACH,QAAMO,IAAWN,EAA4BnD,GAAS6C,GAAUK,CAAO;AAEvE,SAAIO,EAAS,iBACJA,EAAS,iBAGXZ,IACHA,EACG,MAAM,GAAG,EACT,IAAI,CAACa,MAAUnD,EAAAA,oBAAoBmD,CAAK,CAAC,EACzC,OAAO,OAAO,IACjB;AACN;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("../../_virtual/
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("../../_virtual/index10.cjs");/*!
|
|
2
2
|
Copyright (c) 2018 Jed Watson.
|
|
3
3
|
Licensed under the MIT License (MIT), see
|
|
4
4
|
http://jedwatson.github.io/classnames
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("../../comma-separated-tokens/index.cjs"),u=require("../../devlop/lib/default.cjs"),f=require("../../property-information/index.cjs"),C=require("../../space-separated-tokens/index.cjs"),S=require("../../../_virtual/
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("../../comma-separated-tokens/index.cjs"),u=require("../../devlop/lib/default.cjs"),f=require("../../property-information/index.cjs"),C=require("../../space-separated-tokens/index.cjs"),S=require("../../../_virtual/index6.cjs"),N=require("../../hast-util-whitespace/lib/index.cjs"),x=require("../../estree-util-is-identifier-name/lib/index.cjs"),h=require("../../vfile-message/lib/index.cjs"),j=require("../../property-information/lib/find.cjs"),A=require("../../property-information/lib/hast-to-react.cjs"),T=require("../../unist-util-position/lib/index.cjs"),m={}.hasOwnProperty,F=new Map,P=/[A-Z]/g,q=new Set(["table","tbody","thead","tfoot","tr"]),J=new Set(["td","th"]),g="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function M(t,e){if(!e||e.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const r=e.filePath||void 0;let n;if(e.development){if(typeof e.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");n=K(r,e.jsxDEV)}else{if(typeof e.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof e.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");n=k(r,e.jsx,e.jsxs)}const s={Fragment:e.Fragment,ancestors:[],components:e.components||{},create:n,elementAttributeNameCase:e.elementAttributeNameCase||"react",evaluater:e.createEvaluater?e.createEvaluater():void 0,filePath:r,ignoreInvalidStyle:e.ignoreInvalidStyle||!1,passKeys:e.passKeys!==!1,passNode:e.passNode||!1,schema:e.space==="svg"?f.svg:f.html,stylePropertyNameCase:e.stylePropertyNameCase||"dom",tableCellAlignToStyle:e.tableCellAlignToStyle!==!1},i=E(s,t,void 0);return i&&typeof i!="string"?i:s.create(t,s.Fragment,{children:i||void 0},void 0)}function E(t,e,r){if(e.type==="element")return I(t,e,r);if(e.type==="mdxFlowExpression"||e.type==="mdxTextExpression")return L(t,e);if(e.type==="mdxJsxFlowElement"||e.type==="mdxJsxTextElement")return V(t,e,r);if(e.type==="mdxjsEsm")return $(t,e);if(e.type==="root")return D(t,e,r);if(e.type==="text")return O(t,e)}function I(t,e,r){const n=t.schema;let s=n;e.tagName.toLowerCase()==="svg"&&n.space==="html"&&(s=f.svg,t.schema=s),t.ancestors.push(e);const i=b(t,e.tagName,!1),a=R(t,e);let o=d(t,e);return q.has(e.tagName)&&(o=o.filter(function(l){return typeof l=="string"?!N.whitespace(l):!0})),v(t,a,i,e),y(a,o),t.ancestors.pop(),t.schema=n,t.create(e,i,a,r)}function L(t,e){if(e.data&&e.data.estree&&t.evaluater){const n=e.data.estree.body[0];return u.ok(n.type==="ExpressionStatement"),t.evaluater.evaluateExpression(n.expression)}p(t,e.position)}function $(t,e){if(e.data&&e.data.estree&&t.evaluater)return t.evaluater.evaluateProgram(e.data.estree);p(t,e.position)}function V(t,e,r){const n=t.schema;let s=n;e.name==="svg"&&n.space==="html"&&(s=f.svg,t.schema=s),t.ancestors.push(e);const i=e.name===null?t.Fragment:b(t,e.name,!0),a=_(t,e),o=d(t,e);return v(t,a,i,e),y(a,o),t.ancestors.pop(),t.schema=n,t.create(e,i,a,r)}function D(t,e,r){const n={};return y(n,d(t,e)),t.create(e,t.Fragment,n,r)}function O(t,e){return e.value}function v(t,e,r,n){typeof r!="string"&&r!==t.Fragment&&t.passNode&&(e.node=n)}function y(t,e){if(e.length>0){const r=e.length>1?e:e[0];r&&(t.children=r)}}function k(t,e,r){return n;function n(s,i,a,o){const c=Array.isArray(a.children)?r:e;return o?c(i,a,o):c(i,a)}}function K(t,e){return r;function r(n,s,i,a){const o=Array.isArray(i.children),l=T.pointStart(n);return e(s,i,a,o,{columnNumber:l?l.column-1:void 0,fileName:t,lineNumber:l?l.line:void 0},void 0)}}function R(t,e){const r={};let n,s;for(s in e.properties)if(s!=="children"&&m.call(e.properties,s)){const i=B(t,s,e.properties[s]);if(i){const[a,o]=i;t.tableCellAlignToStyle&&a==="align"&&typeof o=="string"&&J.has(e.tagName)?n=o:r[a]=o}}if(n){const i=r.style||(r.style={});i[t.stylePropertyNameCase==="css"?"text-align":"textAlign"]=n}return r}function _(t,e){const r={};for(const n of e.attributes)if(n.type==="mdxJsxExpressionAttribute")if(n.data&&n.data.estree&&t.evaluater){const i=n.data.estree.body[0];u.ok(i.type==="ExpressionStatement");const a=i.expression;u.ok(a.type==="ObjectExpression");const o=a.properties[0];u.ok(o.type==="SpreadElement"),Object.assign(r,t.evaluater.evaluateExpression(o.argument))}else p(t,e.position);else{const s=n.name;let i;if(n.value&&typeof n.value=="object")if(n.value.data&&n.value.data.estree&&t.evaluater){const o=n.value.data.estree.body[0];u.ok(o.type==="ExpressionStatement"),i=t.evaluater.evaluateExpression(o.expression)}else p(t,e.position);else i=n.value===null?!0:n.value;r[s]=i}return r}function d(t,e){const r=[];let n=-1;const s=t.passKeys?new Map:F;for(;++n<e.children.length;){const i=e.children[n];let a;if(t.passKeys){const l=i.type==="element"?i.tagName:i.type==="mdxJsxFlowElement"||i.type==="mdxJsxTextElement"?i.name:void 0;if(l){const c=s.get(l)||0;a=l+"-"+c,s.set(l,c+1)}}const o=E(t,i,a);o!==void 0&&r.push(o)}return r}function B(t,e,r){const n=j.find(t.schema,e);if(!(r==null||typeof r=="number"&&Number.isNaN(r))){if(Array.isArray(r)&&(r=n.commaSeparated?w.stringify(r):C.stringify(r)),n.property==="style"){let s=typeof r=="object"?r:z(t,String(r));return t.stylePropertyNameCase==="css"&&(s=X(s)),["style",s]}return[t.elementAttributeNameCase==="react"&&n.space?A.hastToReact[n.property]||n.property:n.attribute,r]}}function z(t,e){try{return S.default(e,{reactCompat:!0})}catch(r){if(t.ignoreInvalidStyle)return{};const n=r,s=new h.VFileMessage("Cannot parse `style` attribute",{ancestors:t.ancestors,cause:n,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw s.file=t.filePath||void 0,s.url=g+"#cannot-parse-style-attribute",s}}function b(t,e,r){let n;if(!r)n={type:"Literal",value:e};else if(e.includes(".")){const s=e.split(".");let i=-1,a;for(;++i<s.length;){const o=x.name(s[i])?{type:"Identifier",name:s[i]}:{type:"Literal",value:s[i]};a=a?{type:"MemberExpression",object:a,property:o,computed:!!(i&&o.type==="Literal"),optional:!1}:o}n=a}else n=x.name(e)&&!/^[a-z]/.test(e)?{type:"Identifier",name:e}:{type:"Literal",value:e};if(n.type==="Literal"){const s=n.value;return m.call(t.components,s)?t.components[s]:s}if(t.evaluater)return t.evaluater.evaluateExpression(n);p(t)}function p(t,e){const r=new h.VFileMessage("Cannot handle MDX estrees without `createEvaluater`",{ancestors:t.ancestors,place:e,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw r.file=t.filePath||void 0,r.url=g+"#cannot-handle-mdx-estrees-without-createevaluater",r}function X(t){const e={};let r;for(r in t)m.call(t,r)&&(e[Z(r)]=t[r]);return e}function Z(t){let e=t.replace(P,G);return e.slice(0,3)==="ms-"&&(e="-"+e),e}function G(t){return"-"+t.toLowerCase()}exports.toJsxRuntime=M;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -2,7 +2,7 @@ import { stringify as w } from "../../comma-separated-tokens/index.es.js";
|
|
|
2
2
|
import { ok as u } from "../../devlop/lib/default.es.js";
|
|
3
3
|
import { svg as m, html as C } from "../../property-information/index.es.js";
|
|
4
4
|
import { stringify as N } from "../../space-separated-tokens/index.es.js";
|
|
5
|
-
import S from "../../../_virtual/index.
|
|
5
|
+
import S from "../../../_virtual/index.es6.js";
|
|
6
6
|
import { whitespace as j } from "../../hast-util-whitespace/lib/index.es.js";
|
|
7
7
|
import { name as x } from "../../estree-util-is-identifier-name/lib/index.es.js";
|
|
8
8
|
import { VFileMessage as h } from "../../vfile-message/lib/index.es.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const de=require("./chunk-OMD6QJNC.cjs"),Q=require("./chunk-U37J5Y7L.cjs"),_=require("./chunk-VIW5F6AA.cjs");require("../../../../d3-transition/src/selection/index.cjs");require("../../../../d3-zoom/src/transform.cjs");const we=require("../../../../../_virtual/index6.cjs"),Yt=require("../../../../d3-selection/src/select.cjs");var Ut=(function(){var e=_.__name(function(bt,b,x,v){for(x=x||{},v=bt.length;v--;x[bt[v]]=b);return x},"o"),t=[1,24],s=[1,25],o=[1,26],l=[1,27],a=[1,28],r=[1,63],i=[1,64],n=[1,65],u=[1,66],d=[1,67],y=[1,68],p=[1,69],E=[1,29],O=[1,30],S=[1,31],P=[1,32],M=[1,33],U=[1,34],q=[1,35],G=[1,36],K=[1,37],J=[1,38],Z=[1,39],$=[1,40],tt=[1,41],et=[1,42],at=[1,43],nt=[1,44],it=[1,45],rt=[1,46],st=[1,47],lt=[1,48],ot=[1,50],ct=[1,51],ht=[1,52],ut=[1,53],dt=[1,54],_t=[1,55],ft=[1,56],pt=[1,57],yt=[1,58],gt=[1,59],mt=[1,60],wt=[14,42],Xt=[14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],St=[12,14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],A=[1,82],k=[1,83],C=[1,84],w=[1,85],T=[12,14,42],re=[12,14,33,42],It=[12,14,33,42,76,77,79,80],Et=[12,33],Qt=[34,36,37,38,39,40,41,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],Ht={trace:_.__name(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mermaidDoc:4,direction:5,direction_tb:6,direction_bt:7,direction_rl:8,direction_lr:9,graphConfig:10,C4_CONTEXT:11,NEWLINE:12,statements:13,EOF:14,C4_CONTAINER:15,C4_COMPONENT:16,C4_DYNAMIC:17,C4_DEPLOYMENT:18,otherStatements:19,diagramStatements:20,otherStatement:21,title:22,accDescription:23,acc_title:24,acc_title_value:25,acc_descr:26,acc_descr_value:27,acc_descr_multiline_value:28,boundaryStatement:29,boundaryStartStatement:30,boundaryStopStatement:31,boundaryStart:32,LBRACE:33,ENTERPRISE_BOUNDARY:34,attributes:35,SYSTEM_BOUNDARY:36,BOUNDARY:37,CONTAINER_BOUNDARY:38,NODE:39,NODE_L:40,NODE_R:41,RBRACE:42,diagramStatement:43,PERSON:44,PERSON_EXT:45,SYSTEM:46,SYSTEM_DB:47,SYSTEM_QUEUE:48,SYSTEM_EXT:49,SYSTEM_EXT_DB:50,SYSTEM_EXT_QUEUE:51,CONTAINER:52,CONTAINER_DB:53,CONTAINER_QUEUE:54,CONTAINER_EXT:55,CONTAINER_EXT_DB:56,CONTAINER_EXT_QUEUE:57,COMPONENT:58,COMPONENT_DB:59,COMPONENT_QUEUE:60,COMPONENT_EXT:61,COMPONENT_EXT_DB:62,COMPONENT_EXT_QUEUE:63,REL:64,BIREL:65,REL_U:66,REL_D:67,REL_L:68,REL_R:69,REL_B:70,REL_INDEX:71,UPDATE_EL_STYLE:72,UPDATE_REL_STYLE:73,UPDATE_LAYOUT_CONFIG:74,attribute:75,STR:76,STR_KEY:77,STR_VALUE:78,ATTRIBUTE:79,ATTRIBUTE_EMPTY:80,$accept:0,$end:1},terminals_:{2:"error",6:"direction_tb",7:"direction_bt",8:"direction_rl",9:"direction_lr",11:"C4_CONTEXT",12:"NEWLINE",14:"EOF",15:"C4_CONTAINER",16:"C4_COMPONENT",17:"C4_DYNAMIC",18:"C4_DEPLOYMENT",22:"title",23:"accDescription",24:"acc_title",25:"acc_title_value",26:"acc_descr",27:"acc_descr_value",28:"acc_descr_multiline_value",33:"LBRACE",34:"ENTERPRISE_BOUNDARY",36:"SYSTEM_BOUNDARY",37:"BOUNDARY",38:"CONTAINER_BOUNDARY",39:"NODE",40:"NODE_L",41:"NODE_R",42:"RBRACE",44:"PERSON",45:"PERSON_EXT",46:"SYSTEM",47:"SYSTEM_DB",48:"SYSTEM_QUEUE",49:"SYSTEM_EXT",50:"SYSTEM_EXT_DB",51:"SYSTEM_EXT_QUEUE",52:"CONTAINER",53:"CONTAINER_DB",54:"CONTAINER_QUEUE",55:"CONTAINER_EXT",56:"CONTAINER_EXT_DB",57:"CONTAINER_EXT_QUEUE",58:"COMPONENT",59:"COMPONENT_DB",60:"COMPONENT_QUEUE",61:"COMPONENT_EXT",62:"COMPONENT_EXT_DB",63:"COMPONENT_EXT_QUEUE",64:"REL",65:"BIREL",66:"REL_U",67:"REL_D",68:"REL_L",69:"REL_R",70:"REL_B",71:"REL_INDEX",72:"UPDATE_EL_STYLE",73:"UPDATE_REL_STYLE",74:"UPDATE_LAYOUT_CONFIG",76:"STR",77:"STR_KEY",78:"STR_VALUE",79:"ATTRIBUTE",80:"ATTRIBUTE_EMPTY"},productions_:[0,[3,1],[3,1],[5,1],[5,1],[5,1],[5,1],[4,1],[10,4],[10,4],[10,4],[10,4],[10,4],[13,1],[13,1],[13,2],[19,1],[19,2],[19,3],[21,1],[21,1],[21,2],[21,2],[21,1],[29,3],[30,3],[30,3],[30,4],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[31,1],[20,1],[20,2],[20,3],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,1],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[35,1],[35,2],[75,1],[75,2],[75,1],[75,1]],performAction:_.__name(function(b,x,v,g,R,h,Dt){var f=h.length-1;switch(R){case 3:g.setDirection("TB");break;case 4:g.setDirection("BT");break;case 5:g.setDirection("RL");break;case 6:g.setDirection("LR");break;case 8:case 9:case 10:case 11:case 12:g.setC4Type(h[f-3]);break;case 19:g.setTitle(h[f].substring(6)),this.$=h[f].substring(6);break;case 20:g.setAccDescription(h[f].substring(15)),this.$=h[f].substring(15);break;case 21:this.$=h[f].trim(),g.setTitle(this.$);break;case 22:case 23:this.$=h[f].trim(),g.setAccDescription(this.$);break;case 28:h[f].splice(2,0,"ENTERPRISE"),g.addPersonOrSystemBoundary(...h[f]),this.$=h[f];break;case 29:h[f].splice(2,0,"SYSTEM"),g.addPersonOrSystemBoundary(...h[f]),this.$=h[f];break;case 30:g.addPersonOrSystemBoundary(...h[f]),this.$=h[f];break;case 31:h[f].splice(2,0,"CONTAINER"),g.addContainerBoundary(...h[f]),this.$=h[f];break;case 32:g.addDeploymentNode("node",...h[f]),this.$=h[f];break;case 33:g.addDeploymentNode("nodeL",...h[f]),this.$=h[f];break;case 34:g.addDeploymentNode("nodeR",...h[f]),this.$=h[f];break;case 35:g.popBoundaryParseStack();break;case 39:g.addPersonOrSystem("person",...h[f]),this.$=h[f];break;case 40:g.addPersonOrSystem("external_person",...h[f]),this.$=h[f];break;case 41:g.addPersonOrSystem("system",...h[f]),this.$=h[f];break;case 42:g.addPersonOrSystem("system_db",...h[f]),this.$=h[f];break;case 43:g.addPersonOrSystem("system_queue",...h[f]),this.$=h[f];break;case 44:g.addPersonOrSystem("external_system",...h[f]),this.$=h[f];break;case 45:g.addPersonOrSystem("external_system_db",...h[f]),this.$=h[f];break;case 46:g.addPersonOrSystem("external_system_queue",...h[f]),this.$=h[f];break;case 47:g.addContainer("container",...h[f]),this.$=h[f];break;case 48:g.addContainer("container_db",...h[f]),this.$=h[f];break;case 49:g.addContainer("container_queue",...h[f]),this.$=h[f];break;case 50:g.addContainer("external_container",...h[f]),this.$=h[f];break;case 51:g.addContainer("external_container_db",...h[f]),this.$=h[f];break;case 52:g.addContainer("external_container_queue",...h[f]),this.$=h[f];break;case 53:g.addComponent("component",...h[f]),this.$=h[f];break;case 54:g.addComponent("component_db",...h[f]),this.$=h[f];break;case 55:g.addComponent("component_queue",...h[f]),this.$=h[f];break;case 56:g.addComponent("external_component",...h[f]),this.$=h[f];break;case 57:g.addComponent("external_component_db",...h[f]),this.$=h[f];break;case 58:g.addComponent("external_component_queue",...h[f]),this.$=h[f];break;case 60:g.addRel("rel",...h[f]),this.$=h[f];break;case 61:g.addRel("birel",...h[f]),this.$=h[f];break;case 62:g.addRel("rel_u",...h[f]),this.$=h[f];break;case 63:g.addRel("rel_d",...h[f]),this.$=h[f];break;case 64:g.addRel("rel_l",...h[f]),this.$=h[f];break;case 65:g.addRel("rel_r",...h[f]),this.$=h[f];break;case 66:g.addRel("rel_b",...h[f]),this.$=h[f];break;case 67:h[f].splice(0,1),g.addRel("rel",...h[f]),this.$=h[f];break;case 68:g.updateElStyle("update_el_style",...h[f]),this.$=h[f];break;case 69:g.updateRelStyle("update_rel_style",...h[f]),this.$=h[f];break;case 70:g.updateLayoutConfig("update_layout_config",...h[f]),this.$=h[f];break;case 71:this.$=[h[f]];break;case 72:h[f].unshift(h[f-1]),this.$=h[f];break;case 73:case 75:this.$=h[f].trim();break;case 74:let At={};At[h[f-1].trim()]=h[f].trim(),this.$=At;break;case 76:this.$="";break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],7:[1,6],8:[1,7],9:[1,8],10:4,11:[1,9],15:[1,10],16:[1,11],17:[1,12],18:[1,13]},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,7]},{1:[2,3]},{1:[2,4]},{1:[2,5]},{1:[2,6]},{12:[1,14]},{12:[1,15]},{12:[1,16]},{12:[1,17]},{12:[1,18]},{13:19,19:20,20:21,21:22,22:t,23:s,24:o,26:l,28:a,29:49,30:61,32:62,34:r,36:i,37:n,38:u,39:d,40:y,41:p,43:23,44:E,45:O,46:S,47:P,48:M,49:U,50:q,51:G,52:K,53:J,54:Z,55:$,56:tt,57:et,58:at,59:nt,60:it,61:rt,62:st,63:lt,64:ot,65:ct,66:ht,67:ut,68:dt,69:_t,70:ft,71:pt,72:yt,73:gt,74:mt},{13:70,19:20,20:21,21:22,22:t,23:s,24:o,26:l,28:a,29:49,30:61,32:62,34:r,36:i,37:n,38:u,39:d,40:y,41:p,43:23,44:E,45:O,46:S,47:P,48:M,49:U,50:q,51:G,52:K,53:J,54:Z,55:$,56:tt,57:et,58:at,59:nt,60:it,61:rt,62:st,63:lt,64:ot,65:ct,66:ht,67:ut,68:dt,69:_t,70:ft,71:pt,72:yt,73:gt,74:mt},{13:71,19:20,20:21,21:22,22:t,23:s,24:o,26:l,28:a,29:49,30:61,32:62,34:r,36:i,37:n,38:u,39:d,40:y,41:p,43:23,44:E,45:O,46:S,47:P,48:M,49:U,50:q,51:G,52:K,53:J,54:Z,55:$,56:tt,57:et,58:at,59:nt,60:it,61:rt,62:st,63:lt,64:ot,65:ct,66:ht,67:ut,68:dt,69:_t,70:ft,71:pt,72:yt,73:gt,74:mt},{13:72,19:20,20:21,21:22,22:t,23:s,24:o,26:l,28:a,29:49,30:61,32:62,34:r,36:i,37:n,38:u,39:d,40:y,41:p,43:23,44:E,45:O,46:S,47:P,48:M,49:U,50:q,51:G,52:K,53:J,54:Z,55:$,56:tt,57:et,58:at,59:nt,60:it,61:rt,62:st,63:lt,64:ot,65:ct,66:ht,67:ut,68:dt,69:_t,70:ft,71:pt,72:yt,73:gt,74:mt},{13:73,19:20,20:21,21:22,22:t,23:s,24:o,26:l,28:a,29:49,30:61,32:62,34:r,36:i,37:n,38:u,39:d,40:y,41:p,43:23,44:E,45:O,46:S,47:P,48:M,49:U,50:q,51:G,52:K,53:J,54:Z,55:$,56:tt,57:et,58:at,59:nt,60:it,61:rt,62:st,63:lt,64:ot,65:ct,66:ht,67:ut,68:dt,69:_t,70:ft,71:pt,72:yt,73:gt,74:mt},{14:[1,74]},e(wt,[2,13],{43:23,29:49,30:61,32:62,20:75,34:r,36:i,37:n,38:u,39:d,40:y,41:p,44:E,45:O,46:S,47:P,48:M,49:U,50:q,51:G,52:K,53:J,54:Z,55:$,56:tt,57:et,58:at,59:nt,60:it,61:rt,62:st,63:lt,64:ot,65:ct,66:ht,67:ut,68:dt,69:_t,70:ft,71:pt,72:yt,73:gt,74:mt}),e(wt,[2,14]),e(Xt,[2,16],{12:[1,76]}),e(wt,[2,36],{12:[1,77]}),e(St,[2,19]),e(St,[2,20]),{25:[1,78]},{27:[1,79]},e(St,[2,23]),{35:80,75:81,76:A,77:k,79:C,80:w},{35:86,75:81,76:A,77:k,79:C,80:w},{35:87,75:81,76:A,77:k,79:C,80:w},{35:88,75:81,76:A,77:k,79:C,80:w},{35:89,75:81,76:A,77:k,79:C,80:w},{35:90,75:81,76:A,77:k,79:C,80:w},{35:91,75:81,76:A,77:k,79:C,80:w},{35:92,75:81,76:A,77:k,79:C,80:w},{35:93,75:81,76:A,77:k,79:C,80:w},{35:94,75:81,76:A,77:k,79:C,80:w},{35:95,75:81,76:A,77:k,79:C,80:w},{35:96,75:81,76:A,77:k,79:C,80:w},{35:97,75:81,76:A,77:k,79:C,80:w},{35:98,75:81,76:A,77:k,79:C,80:w},{35:99,75:81,76:A,77:k,79:C,80:w},{35:100,75:81,76:A,77:k,79:C,80:w},{35:101,75:81,76:A,77:k,79:C,80:w},{35:102,75:81,76:A,77:k,79:C,80:w},{35:103,75:81,76:A,77:k,79:C,80:w},{35:104,75:81,76:A,77:k,79:C,80:w},e(T,[2,59]),{35:105,75:81,76:A,77:k,79:C,80:w},{35:106,75:81,76:A,77:k,79:C,80:w},{35:107,75:81,76:A,77:k,79:C,80:w},{35:108,75:81,76:A,77:k,79:C,80:w},{35:109,75:81,76:A,77:k,79:C,80:w},{35:110,75:81,76:A,77:k,79:C,80:w},{35:111,75:81,76:A,77:k,79:C,80:w},{35:112,75:81,76:A,77:k,79:C,80:w},{35:113,75:81,76:A,77:k,79:C,80:w},{35:114,75:81,76:A,77:k,79:C,80:w},{35:115,75:81,76:A,77:k,79:C,80:w},{20:116,29:49,30:61,32:62,34:r,36:i,37:n,38:u,39:d,40:y,41:p,43:23,44:E,45:O,46:S,47:P,48:M,49:U,50:q,51:G,52:K,53:J,54:Z,55:$,56:tt,57:et,58:at,59:nt,60:it,61:rt,62:st,63:lt,64:ot,65:ct,66:ht,67:ut,68:dt,69:_t,70:ft,71:pt,72:yt,73:gt,74:mt},{12:[1,118],33:[1,117]},{35:119,75:81,76:A,77:k,79:C,80:w},{35:120,75:81,76:A,77:k,79:C,80:w},{35:121,75:81,76:A,77:k,79:C,80:w},{35:122,75:81,76:A,77:k,79:C,80:w},{35:123,75:81,76:A,77:k,79:C,80:w},{35:124,75:81,76:A,77:k,79:C,80:w},{35:125,75:81,76:A,77:k,79:C,80:w},{14:[1,126]},{14:[1,127]},{14:[1,128]},{14:[1,129]},{1:[2,8]},e(wt,[2,15]),e(Xt,[2,17],{21:22,19:130,22:t,23:s,24:o,26:l,28:a}),e(wt,[2,37],{19:20,20:21,21:22,43:23,29:49,30:61,32:62,13:131,22:t,23:s,24:o,26:l,28:a,34:r,36:i,37:n,38:u,39:d,40:y,41:p,44:E,45:O,46:S,47:P,48:M,49:U,50:q,51:G,52:K,53:J,54:Z,55:$,56:tt,57:et,58:at,59:nt,60:it,61:rt,62:st,63:lt,64:ot,65:ct,66:ht,67:ut,68:dt,69:_t,70:ft,71:pt,72:yt,73:gt,74:mt}),e(St,[2,21]),e(St,[2,22]),e(T,[2,39]),e(re,[2,71],{75:81,35:132,76:A,77:k,79:C,80:w}),e(It,[2,73]),{78:[1,133]},e(It,[2,75]),e(It,[2,76]),e(T,[2,40]),e(T,[2,41]),e(T,[2,42]),e(T,[2,43]),e(T,[2,44]),e(T,[2,45]),e(T,[2,46]),e(T,[2,47]),e(T,[2,48]),e(T,[2,49]),e(T,[2,50]),e(T,[2,51]),e(T,[2,52]),e(T,[2,53]),e(T,[2,54]),e(T,[2,55]),e(T,[2,56]),e(T,[2,57]),e(T,[2,58]),e(T,[2,60]),e(T,[2,61]),e(T,[2,62]),e(T,[2,63]),e(T,[2,64]),e(T,[2,65]),e(T,[2,66]),e(T,[2,67]),e(T,[2,68]),e(T,[2,69]),e(T,[2,70]),{31:134,42:[1,135]},{12:[1,136]},{33:[1,137]},e(Et,[2,28]),e(Et,[2,29]),e(Et,[2,30]),e(Et,[2,31]),e(Et,[2,32]),e(Et,[2,33]),e(Et,[2,34]),{1:[2,9]},{1:[2,10]},{1:[2,11]},{1:[2,12]},e(Xt,[2,18]),e(wt,[2,38]),e(re,[2,72]),e(It,[2,74]),e(T,[2,24]),e(T,[2,35]),e(Qt,[2,25]),e(Qt,[2,26],{12:[1,138]}),e(Qt,[2,27])],defaultActions:{2:[2,1],3:[2,2],4:[2,7],5:[2,3],6:[2,4],7:[2,5],8:[2,6],74:[2,8],126:[2,9],127:[2,10],128:[2,11],129:[2,12]},parseError:_.__name(function(b,x){if(x.recoverable)this.trace(b);else{var v=new Error(b);throw v.hash=x,v}},"parseError"),parse:_.__name(function(b){var x=this,v=[0],g=[],R=[null],h=[],Dt=this.table,f="",At=0,se=0,Ee=2,le=1,Ae=h.slice.call(arguments,1),D=Object.create(this.lexer),kt={yy:{}};for(var qt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,qt)&&(kt.yy[qt]=this.yy[qt]);D.setInput(b,kt.yy),kt.yy.lexer=D,kt.yy.parser=this,typeof D.yylloc>"u"&&(D.yylloc={});var Gt=D.yylloc;h.push(Gt);var ke=D.options&&D.options.ranges;typeof kt.yy.parseError=="function"?this.parseError=kt.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Ce(L){v.length=v.length-2*L,R.length=R.length-L,h.length=h.length-L}_.__name(Ce,"popStack");function oe(){var L;return L=g.pop()||D.lex()||le,typeof L!="number"&&(L instanceof Array&&(g=L,L=g.pop()),L=x.symbols_[L]||L),L}_.__name(oe,"lex");for(var I,Ct,N,Kt,Tt={},Lt,X,ce,Nt;;){if(Ct=v[v.length-1],this.defaultActions[Ct]?N=this.defaultActions[Ct]:((I===null||typeof I>"u")&&(I=oe()),N=Dt[Ct]&&Dt[Ct][I]),typeof N>"u"||!N.length||!N[0]){var Jt="";Nt=[];for(Lt in Dt[Ct])this.terminals_[Lt]&&Lt>Ee&&Nt.push("'"+this.terminals_[Lt]+"'");D.showPosition?Jt="Parse error on line "+(At+1)+`:
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const de=require("./chunk-OMD6QJNC.cjs"),Q=require("./chunk-U37J5Y7L.cjs"),_=require("./chunk-VIW5F6AA.cjs");require("../../../../d3-transition/src/selection/index.cjs");require("../../../../d3-zoom/src/transform.cjs");const we=require("../../../../../_virtual/index7.cjs"),Yt=require("../../../../d3-selection/src/select.cjs");var Ut=(function(){var e=_.__name(function(bt,b,x,v){for(x=x||{},v=bt.length;v--;x[bt[v]]=b);return x},"o"),t=[1,24],s=[1,25],o=[1,26],l=[1,27],a=[1,28],r=[1,63],i=[1,64],n=[1,65],u=[1,66],d=[1,67],y=[1,68],p=[1,69],E=[1,29],O=[1,30],S=[1,31],P=[1,32],M=[1,33],U=[1,34],q=[1,35],G=[1,36],K=[1,37],J=[1,38],Z=[1,39],$=[1,40],tt=[1,41],et=[1,42],at=[1,43],nt=[1,44],it=[1,45],rt=[1,46],st=[1,47],lt=[1,48],ot=[1,50],ct=[1,51],ht=[1,52],ut=[1,53],dt=[1,54],_t=[1,55],ft=[1,56],pt=[1,57],yt=[1,58],gt=[1,59],mt=[1,60],wt=[14,42],Xt=[14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],St=[12,14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],A=[1,82],k=[1,83],C=[1,84],w=[1,85],T=[12,14,42],re=[12,14,33,42],It=[12,14,33,42,76,77,79,80],Et=[12,33],Qt=[34,36,37,38,39,40,41,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],Ht={trace:_.__name(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mermaidDoc:4,direction:5,direction_tb:6,direction_bt:7,direction_rl:8,direction_lr:9,graphConfig:10,C4_CONTEXT:11,NEWLINE:12,statements:13,EOF:14,C4_CONTAINER:15,C4_COMPONENT:16,C4_DYNAMIC:17,C4_DEPLOYMENT:18,otherStatements:19,diagramStatements:20,otherStatement:21,title:22,accDescription:23,acc_title:24,acc_title_value:25,acc_descr:26,acc_descr_value:27,acc_descr_multiline_value:28,boundaryStatement:29,boundaryStartStatement:30,boundaryStopStatement:31,boundaryStart:32,LBRACE:33,ENTERPRISE_BOUNDARY:34,attributes:35,SYSTEM_BOUNDARY:36,BOUNDARY:37,CONTAINER_BOUNDARY:38,NODE:39,NODE_L:40,NODE_R:41,RBRACE:42,diagramStatement:43,PERSON:44,PERSON_EXT:45,SYSTEM:46,SYSTEM_DB:47,SYSTEM_QUEUE:48,SYSTEM_EXT:49,SYSTEM_EXT_DB:50,SYSTEM_EXT_QUEUE:51,CONTAINER:52,CONTAINER_DB:53,CONTAINER_QUEUE:54,CONTAINER_EXT:55,CONTAINER_EXT_DB:56,CONTAINER_EXT_QUEUE:57,COMPONENT:58,COMPONENT_DB:59,COMPONENT_QUEUE:60,COMPONENT_EXT:61,COMPONENT_EXT_DB:62,COMPONENT_EXT_QUEUE:63,REL:64,BIREL:65,REL_U:66,REL_D:67,REL_L:68,REL_R:69,REL_B:70,REL_INDEX:71,UPDATE_EL_STYLE:72,UPDATE_REL_STYLE:73,UPDATE_LAYOUT_CONFIG:74,attribute:75,STR:76,STR_KEY:77,STR_VALUE:78,ATTRIBUTE:79,ATTRIBUTE_EMPTY:80,$accept:0,$end:1},terminals_:{2:"error",6:"direction_tb",7:"direction_bt",8:"direction_rl",9:"direction_lr",11:"C4_CONTEXT",12:"NEWLINE",14:"EOF",15:"C4_CONTAINER",16:"C4_COMPONENT",17:"C4_DYNAMIC",18:"C4_DEPLOYMENT",22:"title",23:"accDescription",24:"acc_title",25:"acc_title_value",26:"acc_descr",27:"acc_descr_value",28:"acc_descr_multiline_value",33:"LBRACE",34:"ENTERPRISE_BOUNDARY",36:"SYSTEM_BOUNDARY",37:"BOUNDARY",38:"CONTAINER_BOUNDARY",39:"NODE",40:"NODE_L",41:"NODE_R",42:"RBRACE",44:"PERSON",45:"PERSON_EXT",46:"SYSTEM",47:"SYSTEM_DB",48:"SYSTEM_QUEUE",49:"SYSTEM_EXT",50:"SYSTEM_EXT_DB",51:"SYSTEM_EXT_QUEUE",52:"CONTAINER",53:"CONTAINER_DB",54:"CONTAINER_QUEUE",55:"CONTAINER_EXT",56:"CONTAINER_EXT_DB",57:"CONTAINER_EXT_QUEUE",58:"COMPONENT",59:"COMPONENT_DB",60:"COMPONENT_QUEUE",61:"COMPONENT_EXT",62:"COMPONENT_EXT_DB",63:"COMPONENT_EXT_QUEUE",64:"REL",65:"BIREL",66:"REL_U",67:"REL_D",68:"REL_L",69:"REL_R",70:"REL_B",71:"REL_INDEX",72:"UPDATE_EL_STYLE",73:"UPDATE_REL_STYLE",74:"UPDATE_LAYOUT_CONFIG",76:"STR",77:"STR_KEY",78:"STR_VALUE",79:"ATTRIBUTE",80:"ATTRIBUTE_EMPTY"},productions_:[0,[3,1],[3,1],[5,1],[5,1],[5,1],[5,1],[4,1],[10,4],[10,4],[10,4],[10,4],[10,4],[13,1],[13,1],[13,2],[19,1],[19,2],[19,3],[21,1],[21,1],[21,2],[21,2],[21,1],[29,3],[30,3],[30,3],[30,4],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[31,1],[20,1],[20,2],[20,3],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,1],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[35,1],[35,2],[75,1],[75,2],[75,1],[75,1]],performAction:_.__name(function(b,x,v,g,R,h,Dt){var f=h.length-1;switch(R){case 3:g.setDirection("TB");break;case 4:g.setDirection("BT");break;case 5:g.setDirection("RL");break;case 6:g.setDirection("LR");break;case 8:case 9:case 10:case 11:case 12:g.setC4Type(h[f-3]);break;case 19:g.setTitle(h[f].substring(6)),this.$=h[f].substring(6);break;case 20:g.setAccDescription(h[f].substring(15)),this.$=h[f].substring(15);break;case 21:this.$=h[f].trim(),g.setTitle(this.$);break;case 22:case 23:this.$=h[f].trim(),g.setAccDescription(this.$);break;case 28:h[f].splice(2,0,"ENTERPRISE"),g.addPersonOrSystemBoundary(...h[f]),this.$=h[f];break;case 29:h[f].splice(2,0,"SYSTEM"),g.addPersonOrSystemBoundary(...h[f]),this.$=h[f];break;case 30:g.addPersonOrSystemBoundary(...h[f]),this.$=h[f];break;case 31:h[f].splice(2,0,"CONTAINER"),g.addContainerBoundary(...h[f]),this.$=h[f];break;case 32:g.addDeploymentNode("node",...h[f]),this.$=h[f];break;case 33:g.addDeploymentNode("nodeL",...h[f]),this.$=h[f];break;case 34:g.addDeploymentNode("nodeR",...h[f]),this.$=h[f];break;case 35:g.popBoundaryParseStack();break;case 39:g.addPersonOrSystem("person",...h[f]),this.$=h[f];break;case 40:g.addPersonOrSystem("external_person",...h[f]),this.$=h[f];break;case 41:g.addPersonOrSystem("system",...h[f]),this.$=h[f];break;case 42:g.addPersonOrSystem("system_db",...h[f]),this.$=h[f];break;case 43:g.addPersonOrSystem("system_queue",...h[f]),this.$=h[f];break;case 44:g.addPersonOrSystem("external_system",...h[f]),this.$=h[f];break;case 45:g.addPersonOrSystem("external_system_db",...h[f]),this.$=h[f];break;case 46:g.addPersonOrSystem("external_system_queue",...h[f]),this.$=h[f];break;case 47:g.addContainer("container",...h[f]),this.$=h[f];break;case 48:g.addContainer("container_db",...h[f]),this.$=h[f];break;case 49:g.addContainer("container_queue",...h[f]),this.$=h[f];break;case 50:g.addContainer("external_container",...h[f]),this.$=h[f];break;case 51:g.addContainer("external_container_db",...h[f]),this.$=h[f];break;case 52:g.addContainer("external_container_queue",...h[f]),this.$=h[f];break;case 53:g.addComponent("component",...h[f]),this.$=h[f];break;case 54:g.addComponent("component_db",...h[f]),this.$=h[f];break;case 55:g.addComponent("component_queue",...h[f]),this.$=h[f];break;case 56:g.addComponent("external_component",...h[f]),this.$=h[f];break;case 57:g.addComponent("external_component_db",...h[f]),this.$=h[f];break;case 58:g.addComponent("external_component_queue",...h[f]),this.$=h[f];break;case 60:g.addRel("rel",...h[f]),this.$=h[f];break;case 61:g.addRel("birel",...h[f]),this.$=h[f];break;case 62:g.addRel("rel_u",...h[f]),this.$=h[f];break;case 63:g.addRel("rel_d",...h[f]),this.$=h[f];break;case 64:g.addRel("rel_l",...h[f]),this.$=h[f];break;case 65:g.addRel("rel_r",...h[f]),this.$=h[f];break;case 66:g.addRel("rel_b",...h[f]),this.$=h[f];break;case 67:h[f].splice(0,1),g.addRel("rel",...h[f]),this.$=h[f];break;case 68:g.updateElStyle("update_el_style",...h[f]),this.$=h[f];break;case 69:g.updateRelStyle("update_rel_style",...h[f]),this.$=h[f];break;case 70:g.updateLayoutConfig("update_layout_config",...h[f]),this.$=h[f];break;case 71:this.$=[h[f]];break;case 72:h[f].unshift(h[f-1]),this.$=h[f];break;case 73:case 75:this.$=h[f].trim();break;case 74:let At={};At[h[f-1].trim()]=h[f].trim(),this.$=At;break;case 76:this.$="";break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],7:[1,6],8:[1,7],9:[1,8],10:4,11:[1,9],15:[1,10],16:[1,11],17:[1,12],18:[1,13]},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,7]},{1:[2,3]},{1:[2,4]},{1:[2,5]},{1:[2,6]},{12:[1,14]},{12:[1,15]},{12:[1,16]},{12:[1,17]},{12:[1,18]},{13:19,19:20,20:21,21:22,22:t,23:s,24:o,26:l,28:a,29:49,30:61,32:62,34:r,36:i,37:n,38:u,39:d,40:y,41:p,43:23,44:E,45:O,46:S,47:P,48:M,49:U,50:q,51:G,52:K,53:J,54:Z,55:$,56:tt,57:et,58:at,59:nt,60:it,61:rt,62:st,63:lt,64:ot,65:ct,66:ht,67:ut,68:dt,69:_t,70:ft,71:pt,72:yt,73:gt,74:mt},{13:70,19:20,20:21,21:22,22:t,23:s,24:o,26:l,28:a,29:49,30:61,32:62,34:r,36:i,37:n,38:u,39:d,40:y,41:p,43:23,44:E,45:O,46:S,47:P,48:M,49:U,50:q,51:G,52:K,53:J,54:Z,55:$,56:tt,57:et,58:at,59:nt,60:it,61:rt,62:st,63:lt,64:ot,65:ct,66:ht,67:ut,68:dt,69:_t,70:ft,71:pt,72:yt,73:gt,74:mt},{13:71,19:20,20:21,21:22,22:t,23:s,24:o,26:l,28:a,29:49,30:61,32:62,34:r,36:i,37:n,38:u,39:d,40:y,41:p,43:23,44:E,45:O,46:S,47:P,48:M,49:U,50:q,51:G,52:K,53:J,54:Z,55:$,56:tt,57:et,58:at,59:nt,60:it,61:rt,62:st,63:lt,64:ot,65:ct,66:ht,67:ut,68:dt,69:_t,70:ft,71:pt,72:yt,73:gt,74:mt},{13:72,19:20,20:21,21:22,22:t,23:s,24:o,26:l,28:a,29:49,30:61,32:62,34:r,36:i,37:n,38:u,39:d,40:y,41:p,43:23,44:E,45:O,46:S,47:P,48:M,49:U,50:q,51:G,52:K,53:J,54:Z,55:$,56:tt,57:et,58:at,59:nt,60:it,61:rt,62:st,63:lt,64:ot,65:ct,66:ht,67:ut,68:dt,69:_t,70:ft,71:pt,72:yt,73:gt,74:mt},{13:73,19:20,20:21,21:22,22:t,23:s,24:o,26:l,28:a,29:49,30:61,32:62,34:r,36:i,37:n,38:u,39:d,40:y,41:p,43:23,44:E,45:O,46:S,47:P,48:M,49:U,50:q,51:G,52:K,53:J,54:Z,55:$,56:tt,57:et,58:at,59:nt,60:it,61:rt,62:st,63:lt,64:ot,65:ct,66:ht,67:ut,68:dt,69:_t,70:ft,71:pt,72:yt,73:gt,74:mt},{14:[1,74]},e(wt,[2,13],{43:23,29:49,30:61,32:62,20:75,34:r,36:i,37:n,38:u,39:d,40:y,41:p,44:E,45:O,46:S,47:P,48:M,49:U,50:q,51:G,52:K,53:J,54:Z,55:$,56:tt,57:et,58:at,59:nt,60:it,61:rt,62:st,63:lt,64:ot,65:ct,66:ht,67:ut,68:dt,69:_t,70:ft,71:pt,72:yt,73:gt,74:mt}),e(wt,[2,14]),e(Xt,[2,16],{12:[1,76]}),e(wt,[2,36],{12:[1,77]}),e(St,[2,19]),e(St,[2,20]),{25:[1,78]},{27:[1,79]},e(St,[2,23]),{35:80,75:81,76:A,77:k,79:C,80:w},{35:86,75:81,76:A,77:k,79:C,80:w},{35:87,75:81,76:A,77:k,79:C,80:w},{35:88,75:81,76:A,77:k,79:C,80:w},{35:89,75:81,76:A,77:k,79:C,80:w},{35:90,75:81,76:A,77:k,79:C,80:w},{35:91,75:81,76:A,77:k,79:C,80:w},{35:92,75:81,76:A,77:k,79:C,80:w},{35:93,75:81,76:A,77:k,79:C,80:w},{35:94,75:81,76:A,77:k,79:C,80:w},{35:95,75:81,76:A,77:k,79:C,80:w},{35:96,75:81,76:A,77:k,79:C,80:w},{35:97,75:81,76:A,77:k,79:C,80:w},{35:98,75:81,76:A,77:k,79:C,80:w},{35:99,75:81,76:A,77:k,79:C,80:w},{35:100,75:81,76:A,77:k,79:C,80:w},{35:101,75:81,76:A,77:k,79:C,80:w},{35:102,75:81,76:A,77:k,79:C,80:w},{35:103,75:81,76:A,77:k,79:C,80:w},{35:104,75:81,76:A,77:k,79:C,80:w},e(T,[2,59]),{35:105,75:81,76:A,77:k,79:C,80:w},{35:106,75:81,76:A,77:k,79:C,80:w},{35:107,75:81,76:A,77:k,79:C,80:w},{35:108,75:81,76:A,77:k,79:C,80:w},{35:109,75:81,76:A,77:k,79:C,80:w},{35:110,75:81,76:A,77:k,79:C,80:w},{35:111,75:81,76:A,77:k,79:C,80:w},{35:112,75:81,76:A,77:k,79:C,80:w},{35:113,75:81,76:A,77:k,79:C,80:w},{35:114,75:81,76:A,77:k,79:C,80:w},{35:115,75:81,76:A,77:k,79:C,80:w},{20:116,29:49,30:61,32:62,34:r,36:i,37:n,38:u,39:d,40:y,41:p,43:23,44:E,45:O,46:S,47:P,48:M,49:U,50:q,51:G,52:K,53:J,54:Z,55:$,56:tt,57:et,58:at,59:nt,60:it,61:rt,62:st,63:lt,64:ot,65:ct,66:ht,67:ut,68:dt,69:_t,70:ft,71:pt,72:yt,73:gt,74:mt},{12:[1,118],33:[1,117]},{35:119,75:81,76:A,77:k,79:C,80:w},{35:120,75:81,76:A,77:k,79:C,80:w},{35:121,75:81,76:A,77:k,79:C,80:w},{35:122,75:81,76:A,77:k,79:C,80:w},{35:123,75:81,76:A,77:k,79:C,80:w},{35:124,75:81,76:A,77:k,79:C,80:w},{35:125,75:81,76:A,77:k,79:C,80:w},{14:[1,126]},{14:[1,127]},{14:[1,128]},{14:[1,129]},{1:[2,8]},e(wt,[2,15]),e(Xt,[2,17],{21:22,19:130,22:t,23:s,24:o,26:l,28:a}),e(wt,[2,37],{19:20,20:21,21:22,43:23,29:49,30:61,32:62,13:131,22:t,23:s,24:o,26:l,28:a,34:r,36:i,37:n,38:u,39:d,40:y,41:p,44:E,45:O,46:S,47:P,48:M,49:U,50:q,51:G,52:K,53:J,54:Z,55:$,56:tt,57:et,58:at,59:nt,60:it,61:rt,62:st,63:lt,64:ot,65:ct,66:ht,67:ut,68:dt,69:_t,70:ft,71:pt,72:yt,73:gt,74:mt}),e(St,[2,21]),e(St,[2,22]),e(T,[2,39]),e(re,[2,71],{75:81,35:132,76:A,77:k,79:C,80:w}),e(It,[2,73]),{78:[1,133]},e(It,[2,75]),e(It,[2,76]),e(T,[2,40]),e(T,[2,41]),e(T,[2,42]),e(T,[2,43]),e(T,[2,44]),e(T,[2,45]),e(T,[2,46]),e(T,[2,47]),e(T,[2,48]),e(T,[2,49]),e(T,[2,50]),e(T,[2,51]),e(T,[2,52]),e(T,[2,53]),e(T,[2,54]),e(T,[2,55]),e(T,[2,56]),e(T,[2,57]),e(T,[2,58]),e(T,[2,60]),e(T,[2,61]),e(T,[2,62]),e(T,[2,63]),e(T,[2,64]),e(T,[2,65]),e(T,[2,66]),e(T,[2,67]),e(T,[2,68]),e(T,[2,69]),e(T,[2,70]),{31:134,42:[1,135]},{12:[1,136]},{33:[1,137]},e(Et,[2,28]),e(Et,[2,29]),e(Et,[2,30]),e(Et,[2,31]),e(Et,[2,32]),e(Et,[2,33]),e(Et,[2,34]),{1:[2,9]},{1:[2,10]},{1:[2,11]},{1:[2,12]},e(Xt,[2,18]),e(wt,[2,38]),e(re,[2,72]),e(It,[2,74]),e(T,[2,24]),e(T,[2,35]),e(Qt,[2,25]),e(Qt,[2,26],{12:[1,138]}),e(Qt,[2,27])],defaultActions:{2:[2,1],3:[2,2],4:[2,7],5:[2,3],6:[2,4],7:[2,5],8:[2,6],74:[2,8],126:[2,9],127:[2,10],128:[2,11],129:[2,12]},parseError:_.__name(function(b,x){if(x.recoverable)this.trace(b);else{var v=new Error(b);throw v.hash=x,v}},"parseError"),parse:_.__name(function(b){var x=this,v=[0],g=[],R=[null],h=[],Dt=this.table,f="",At=0,se=0,Ee=2,le=1,Ae=h.slice.call(arguments,1),D=Object.create(this.lexer),kt={yy:{}};for(var qt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,qt)&&(kt.yy[qt]=this.yy[qt]);D.setInput(b,kt.yy),kt.yy.lexer=D,kt.yy.parser=this,typeof D.yylloc>"u"&&(D.yylloc={});var Gt=D.yylloc;h.push(Gt);var ke=D.options&&D.options.ranges;typeof kt.yy.parseError=="function"?this.parseError=kt.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Ce(L){v.length=v.length-2*L,R.length=R.length-L,h.length=h.length-L}_.__name(Ce,"popStack");function oe(){var L;return L=g.pop()||D.lex()||le,typeof L!="number"&&(L instanceof Array&&(g=L,L=g.pop()),L=x.symbols_[L]||L),L}_.__name(oe,"lex");for(var I,Ct,N,Kt,Tt={},Lt,X,ce,Nt;;){if(Ct=v[v.length-1],this.defaultActions[Ct]?N=this.defaultActions[Ct]:((I===null||typeof I>"u")&&(I=oe()),N=Dt[Ct]&&Dt[Ct][I]),typeof N>"u"||!N.length||!N[0]){var Jt="";Nt=[];for(Lt in Dt[Ct])this.terminals_[Lt]&&Lt>Ee&&Nt.push("'"+this.terminals_[Lt]+"'");D.showPosition?Jt="Parse error on line "+(At+1)+`:
|
|
2
2
|
`+D.showPosition()+`
|
|
3
3
|
Expecting `+Nt.join(", ")+", got '"+(this.terminals_[I]||I)+"'":Jt="Parse error on line "+(At+1)+": Unexpected "+(I==le?"end of input":"'"+(this.terminals_[I]||I)+"'"),this.parseError(Jt,{text:D.match,token:this.terminals_[I]||I,line:D.yylineno,loc:Gt,expected:Nt})}if(N[0]instanceof Array&&N.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Ct+", token: "+I);switch(N[0]){case 1:v.push(I),R.push(D.yytext),h.push(D.yylloc),v.push(N[1]),I=null,se=D.yyleng,f=D.yytext,At=D.yylineno,Gt=D.yylloc;break;case 2:if(X=this.productions_[N[1]][1],Tt.$=R[R.length-X],Tt._$={first_line:h[h.length-(X||1)].first_line,last_line:h[h.length-1].last_line,first_column:h[h.length-(X||1)].first_column,last_column:h[h.length-1].last_column},ke&&(Tt._$.range=[h[h.length-(X||1)].range[0],h[h.length-1].range[1]]),Kt=this.performAction.apply(Tt,[f,se,At,kt.yy,N[1],R,h].concat(Ae)),typeof Kt<"u")return Kt;X&&(v=v.slice(0,-1*X*2),R=R.slice(0,-1*X),h=h.slice(0,-1*X)),v.push(this.productions_[N[1]][0]),R.push(Tt.$),h.push(Tt._$),ce=Dt[v[v.length-2]][v[v.length-1]],v.push(ce);break;case 3:return!0}}return!0},"parse")},ve=(function(){var bt={EOF:1,parseError:_.__name(function(x,v){if(this.yy.parser)this.yy.parser.parseError(x,v);else throw new Error(x)},"parseError"),setInput:_.__name(function(b,x){return this.yy=x||this.yy||{},this._input=b,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:_.__name(function(){var b=this._input[0];this.yytext+=b,this.yyleng++,this.offset++,this.match+=b,this.matched+=b;var x=b.match(/(?:\r\n?|\n).*/g);return x?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),b},"input"),unput:_.__name(function(b){var x=b.length,v=b.split(/(?:\r\n?|\n)/g);this._input=b+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-x),this.offset-=x;var g=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),v.length-1&&(this.yylineno-=v.length-1);var R=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:v?(v.length===g.length?this.yylloc.first_column:0)+g[g.length-v.length].length-v[0].length:this.yylloc.first_column-x},this.options.ranges&&(this.yylloc.range=[R[0],R[0]+this.yyleng-x]),this.yyleng=this.yytext.length,this},"unput"),more:_.__name(function(){return this._more=!0,this},"more"),reject:_.__name(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else 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).
|
|
4
4
|
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:_.__name(function(b){this.unput(this.match.slice(b))},"less"),pastInput:_.__name(function(){var b=this.matched.substr(0,this.matched.length-this.match.length);return(b.length>20?"...":"")+b.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:_.__name(function(){var b=this.match;return b.length<20&&(b+=this._input.substr(0,20-b.length)),(b.substr(0,20)+(b.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:_.__name(function(){var b=this.pastInput(),x=new Array(b.length+1).join("-");return b+this.upcomingInput()+`
|
|
@@ -3,7 +3,7 @@ import { calculateTextWidth as Tt, wrapLabel as Pe, calculateTextHeight as de }
|
|
|
3
3
|
import { __name as g, setAccDescription as Be, getAccDescription as Ie, getAccTitle as Me, setAccTitle as Le, getConfig2 as Bt, log as fe, configureSvgSize as Ne, assignWithDepth_default as Ye, sanitizeText as ge, common_default as $t } from "./chunk-VIW5F6AA.es.js";
|
|
4
4
|
import "../../../../d3-transition/src/selection/index.es.js";
|
|
5
5
|
import "../../../../d3-zoom/src/transform.es.js";
|
|
6
|
-
import { d as je } from "../../../../../_virtual/index.
|
|
6
|
+
import { d as je } from "../../../../../_virtual/index.es7.js";
|
|
7
7
|
import jt from "../../../../d3-selection/src/select.es.js";
|
|
8
8
|
var Ft = (function() {
|
|
9
9
|
var e = /* @__PURE__ */ g(function(_t, x, m, v) {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./chunk-VIW5F6AA.cjs"),d=require("../../../../../_virtual/
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./chunk-VIW5F6AA.cjs"),d=require("../../../../../_virtual/index7.cjs");var c=s.__name((a,t)=>{const e=a.append("rect");if(e.attr("x",t.x),e.attr("y",t.y),e.attr("fill",t.fill),e.attr("stroke",t.stroke),e.attr("width",t.width),e.attr("height",t.height),t.name&&e.attr("name",t.name),t.rx&&e.attr("rx",t.rx),t.ry&&e.attr("ry",t.ry),t.attrs!==void 0)for(const r in t.attrs)e.attr(r,t.attrs[r]);return t.class&&e.attr("class",t.class),e},"drawRect"),l=s.__name((a,t)=>{const e={x:t.startx,y:t.starty,width:t.stopx-t.startx,height:t.stopy-t.starty,fill:t.fill,stroke:t.stroke,class:"rect"};c(a,e).lower()},"drawBackgroundRect"),o=s.__name((a,t)=>{const e=t.text.replace(s.lineBreakRegex," "),r=a.append("text");r.attr("x",t.x),r.attr("y",t.y),r.attr("class","legend"),r.style("text-anchor",t.anchor),t.class&&r.attr("class",t.class);const n=r.append("tspan");return n.attr("x",t.x+t.textMargin*2),n.text(e),r},"drawText"),x=s.__name((a,t,e,r)=>{const n=a.append("image");n.attr("x",t),n.attr("y",e);const i=d.distExports.sanitizeUrl(r);n.attr("xlink:href",i)},"drawImage"),g=s.__name((a,t,e,r)=>{const n=a.append("use");n.attr("x",t),n.attr("y",e);const i=d.distExports.sanitizeUrl(r);n.attr("xlink:href",`#${i}`)},"drawEmbeddedImage"),m=s.__name(()=>({x:0,y:0,width:100,height:100,fill:"#EDF2AE",stroke:"#666",anchor:"start",rx:0,ry:0}),"getNoteRect"),h=s.__name(()=>({x:0,y:0,width:100,height:100,"text-anchor":"start",style:"#666",textMargin:0,rx:0,ry:0,tspan:!0}),"getTextObj");exports.drawBackgroundRect=l;exports.drawEmbeddedImage=g;exports.drawImage=x;exports.drawRect=c;exports.drawText=o;exports.getNoteRect=m;exports.getTextObj=h;
|
|
2
2
|
//# sourceMappingURL=chunk-OMD6QJNC.cjs.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __name as n, lineBreakRegex as o } from "./chunk-VIW5F6AA.es.js";
|
|
2
|
-
import { d as l } from "../../../../../_virtual/index.
|
|
2
|
+
import { d as l } from "../../../../../_virtual/index.es7.js";
|
|
3
3
|
var x = /* @__PURE__ */ n((s, t) => {
|
|
4
4
|
const r = s.append("rect");
|
|
5
5
|
if (r.attr("x", t.x), r.attr("y", t.y), r.attr("fill", t.fill), r.attr("stroke", t.stroke), r.attr("width", t.width), r.attr("height", t.height), t.name && r.attr("name", t.name), t.rx && r.attr("rx", t.rx), t.ry && r.attr("ry", t.ry), t.attrs !== void 0)
|