@openbkn/workshop 0.2.2-rc.5 → 0.2.2-rc.6

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 (158) hide show
  1. package/README.md +79 -8
  2. package/component.d.ts +10 -0
  3. package/dist/ActionConfirm-DJ91X3ml.js +236 -0
  4. package/dist/ActionFailure-ZgPt_3B-.js +37 -0
  5. package/dist/AgentChat-CRYai8ge.js +1062 -0
  6. package/dist/AppFormModal-D73ucaHK.js +4282 -0
  7. package/dist/AppListPage-D87piiOw.js +1364 -0
  8. package/dist/AskDrawer-BUMYsRnt.js +38 -0
  9. package/dist/ComputedView-CgYrDbx1.js +3221 -0
  10. package/dist/ConclusionApply-sjGfoEBY.js +153 -0
  11. package/dist/CypherEditor-lus6FA5L.js +485 -0
  12. package/dist/LandingList-6JI6864C.js +230 -0
  13. package/dist/MenuUnfoldOutlined-Cdg24l2h.js +27 -0
  14. package/dist/ModelTrial-ClHFGTpQ.js +359 -0
  15. package/dist/PageRenderer-DBd_g6mN.js +85480 -0
  16. package/dist/README-DjRyTQSR.js +76 -0
  17. package/dist/ScenarioApply-DtW_hh47.js +590 -0
  18. package/dist/SimulateForm-C-i08Jjd.js +153 -0
  19. package/dist/Subgraph-CnrkH9AN.js +32586 -0
  20. package/dist/WorkshopLabPage-DiVXQL9e.js +11364 -0
  21. package/dist/WorkshopRunPage-6hjRUf64.js +253 -0
  22. package/dist/abnfDiagram-WEYOIA3C-beRNhN3c.js +87 -0
  23. package/dist/action-type-tool.service-B2B74fKC.js +1060 -0
  24. package/dist/actionButton-DA5CNEzx.js +94 -0
  25. package/dist/actionButton.en-US-qjeqA7hs.js +94 -0
  26. package/dist/agentChat-EoDznd58.js +116 -0
  27. package/dist/agentChat.en-US-B6-pFd9Y.js +116 -0
  28. package/dist/alertList-DqditwM8.js +84 -0
  29. package/dist/alertList.en-US-BAXAgltP.js +84 -0
  30. package/dist/architectureDiagram-ZHVYKT53-DY2l1qxx.js +4779 -0
  31. package/dist/asOfSlider-QPvHWUMV.js +83 -0
  32. package/dist/asOfSlider.en-US-BI4jVfSn.js +83 -0
  33. package/dist/bkn-agent-execution.service-DVh-SHyl.js +205 -0
  34. package/dist/blockDiagram-RJAE7QA3-DR0mjN2h.js +1435 -0
  35. package/dist/c4Diagram-XDPPPE54-DH5zsGug.js +1518 -0
  36. package/dist/channel-B034hcOF.js +5 -0
  37. package/dist/china-C6m7zXIv.js +9 -0
  38. package/dist/chunk-2E7WHVMD-Ba3svxgx.js +664 -0
  39. package/dist/chunk-2Q5K7J3B-rT4eU6_y.js +15 -0
  40. package/dist/chunk-4EMNKR2T-C1kQZYHK.js +262 -0
  41. package/dist/chunk-55XCU76K-dcpLOktb.js +68 -0
  42. package/dist/chunk-5VM5RSS4-BdpQuzmO.js +19 -0
  43. package/dist/chunk-JWPE2WC7-CDBrSjU7.js +8 -0
  44. package/dist/chunk-VQ5W62QI-BiVKc40w.js +19 -0
  45. package/dist/chunk-XXDRQBXY-CPYrcdVW.js +8 -0
  46. package/dist/chunk-ZCHMQSOR-BG8OLpvb.js +451 -0
  47. package/dist/classDiagram-v2-4MYWR3UA-DqbpQpwI.js +1564 -0
  48. package/dist/component.d-DFoMKuUv.js +179 -0
  49. package/dist/cose-bilkent-JH36ORCC-CdXk4sPf.js +2609 -0
  50. package/dist/customComponents-DasaZ6pq.js +4 -0
  51. package/dist/customComponents.en-US-CkabuCXg.js +79 -0
  52. package/dist/customParseFormat-C0uLEpdq.js +182 -0
  53. package/dist/cynefin-EF2NZ3EQ-D7MVnMHu.js +21746 -0
  54. package/dist/cynefinDiagram-WF24UDRP-BYT_KpDL.js +299 -0
  55. package/dist/cytoscape.esm-BCV9V6aO.js +18760 -0
  56. package/dist/d3-scale-DA8IHmf0.js +1841 -0
  57. package/dist/dagre-NK4GIZVX-l-ghPdM8.js +2154 -0
  58. package/dist/dateRange-BbkLMg8L.js +79 -0
  59. package/dist/dateRange.en-US-CV12Q02G.js +79 -0
  60. package/dist/dayjs.min-DZ-YV8Mv.js +284 -0
  61. package/dist/diagram-CBK3MWTC-Bt3HiwvA.js +542 -0
  62. package/dist/diagram-I5XIIV2D-DcbqfBjx.js +150 -0
  63. package/dist/diagram-ODIL2UCW-9PC1n3n5.js +346 -0
  64. package/dist/diagram-PFBEJUXE-DGhr2kc7.js +478 -0
  65. package/dist/diagram-RJA3I4VV-DwzpOjZ_.js +219 -0
  66. package/dist/diagram-TYUNFSNR-B3Bd3TDU.js +2583 -0
  67. package/dist/dropdownFilter-DOi_8-ZT.js +76 -0
  68. package/dist/dropdownFilter.en-US-BiXpvXtF.js +76 -0
  69. package/dist/ebnfDiagram-V4P3TTPT-E5NN2oKc.js +109 -0
  70. package/dist/elk-QONTBCTQ-dFjcujl_.js +49170 -0
  71. package/dist/erDiagram-KYQIGQAA-BMrasBzB.js +1061 -0
  72. package/dist/eventList-CnsAwfDS.js +115 -0
  73. package/dist/eventList.en-US-Cof3rCLq.js +115 -0
  74. package/dist/eventReport-XS-HegnH.js +76 -0
  75. package/dist/eventReport.en-US-DTx4vzWT.js +76 -0
  76. package/dist/flowDiagram-IUGLLWBU-BGIBH0q0.js +1769 -0
  77. package/dist/ganttChart-DEeSvTJA.js +77 -0
  78. package/dist/ganttChart.en-US-SwRKrnoD.js +77 -0
  79. package/dist/ganttDiagram-R7GPNTJY-C0tb1Lpp.js +1741 -0
  80. package/dist/generateCypher-Ch9_lQa6.js +399 -0
  81. package/dist/gitGraphDiagram-PDYL7XHY-DBqcOa-c.js +815 -0
  82. package/dist/graph-CKJmgLki.js +1541 -0
  83. package/dist/index-BA-GzCXt.js +441 -0
  84. package/dist/infoDiagram-MVDRKAX5-Bwuki4JA.js +24 -0
  85. package/dist/ishikawaDiagram-HPEHV2GE-Dz4d6ygx.js +622 -0
  86. package/dist/journeyDiagram-BOSHW7O7-C99m34Bb.js +834 -0
  87. package/dist/kanban-definition-FNSA4HC5-mdqjODsT.js +724 -0
  88. package/dist/katex-BsrBVQKd.js +11314 -0
  89. package/dist/manifest-BjV1PJ6u.js +41 -0
  90. package/dist/mermaid.core-yQghUlIz.js +17642 -0
  91. package/dist/metricCards-CSb-_cT2.js +104 -0
  92. package/dist/metricCards.en-US-BLLhRsQU.js +104 -0
  93. package/dist/mindmap-definition-6OY57UG3-BZhO2wX4.js +834 -0
  94. package/dist/modelTrial-Bvb-RhGt.js +137 -0
  95. package/dist/modelTrial.en-US-DYcuor-G.js +137 -0
  96. package/dist/models-DekiCOuZ.js +6 -0
  97. package/dist/object-metric-numeric-vs3BeDkH.js +42 -0
  98. package/dist/object-metric.service-flZgBMRX.js +233 -0
  99. package/dist/objectDetail-SQUbp4Py.js +117 -0
  100. package/dist/objectDetail.en-US-DW3mlONM.js +117 -0
  101. package/dist/objectList-D99wPtJH.js +97 -0
  102. package/dist/objectList.en-US-PBBNyVLW.js +97 -0
  103. package/dist/objectTable-0jsFFMN3.js +127 -0
  104. package/dist/objectTable.en-US-yWEs8qc_.js +127 -0
  105. package/dist/pegDiagram-ECIUJNBX-BDa5RfZt.js +95 -0
  106. package/dist/pieDiagram-GNMPY74T-DNVtzXPv.js +165 -0
  107. package/dist/pivotTable-CHmQw18-.js +102 -0
  108. package/dist/pivotTable.en-US-B4uv4P08.js +102 -0
  109. package/dist/prompt-DYrjlEFr.js +373 -0
  110. package/dist/quadrantDiagram-D57K4MC3-vK0f2OvQ.js +1023 -0
  111. package/dist/railroadDiagram-Y72NRBL7-j6ZrTmRp.js +77 -0
  112. package/dist/regionMap-Cme-JyV_.js +128 -0
  113. package/dist/regionMap.en-US-Bwr2_p32.js +128 -0
  114. package/dist/requirementDiagram-EQYSW5RA-DgfEyljA.js +886 -0
  115. package/dist/sankeyDiagram-SY24JHO5-CImx-IX0.js +1160 -0
  116. package/dist/scenarioBar-BV43p7n-.js +122 -0
  117. package/dist/scenarioBar.en-US-5KqMQ2Bg.js +122 -0
  118. package/dist/scheduleGantt-CTYO-zYP.js +180 -0
  119. package/dist/scheduleGantt.en-US-hE7mvVUW.js +180 -0
  120. package/dist/searchBox-Ca7w0f_6.js +67 -0
  121. package/dist/searchBox.en-US-ArS_XBvB.js +67 -0
  122. package/dist/segmentedFilter-MhjVcWo0.js +80 -0
  123. package/dist/segmentedFilter.en-US-BxNrQO5T.js +80 -0
  124. package/dist/sequenceDiagram-BLEHNHQU-nWmjd1ci.js +2969 -0
  125. package/dist/sizeCapture-INFHLROL-D3jlbt7h.js +46 -0
  126. package/dist/stageChain-BxBafwjD.js +74 -0
  127. package/dist/stageChain.en-US-CP0G27n8.js +74 -0
  128. package/dist/stateDiagram-v2-A6IESKWZ-DG1ZetEu.js +1514 -0
  129. package/dist/subgraph-7n4SwliR.js +71 -0
  130. package/dist/subgraph.en-US-BNvY18IW.js +71 -0
  131. package/dist/swimlanes-B3ENRKFQ-cCmJE8AU.js +4991 -0
  132. package/dist/swimlanesDiagram-AYQRV4AK-CtuhyguU.js +14 -0
  133. package/dist/taskInbox-DGWYeI2b.js +118 -0
  134. package/dist/taskInbox.en-US-B-OzDmVl.js +118 -0
  135. package/dist/text-BqSVQKS6.js +78 -0
  136. package/dist/text.en-US-BhAxy_LE.js +78 -0
  137. package/dist/timeline-definition-JXYKGLGB-Cc-INsOv.js +1057 -0
  138. package/dist/trendChart-BjEeRS5_.js +135 -0
  139. package/dist/trendChart.en-US-BBGqWUKM.js +135 -0
  140. package/dist/useLabData-Df-jEHKs.js +20470 -0
  141. package/dist/usecaseDiagram-WPOLBNNX-r8wVjopm.js +7920 -0
  142. package/dist/vennDiagram-Q3Y3IDCW-BZiOcgrj.js +1579 -0
  143. package/dist/wardleyDiagram-IVAIDKWA-16jd07C_.js +675 -0
  144. package/dist/workshop-app-DnHNjBqy.js +86038 -0
  145. package/dist/workshop-app.css +1 -0
  146. package/dist/workshop-app.js +4 -0
  147. package/dist/world-Djau1JyJ.js +9 -0
  148. package/dist/xychartDiagram-4URNHDU4-C8DwWQNh.js +1460 -0
  149. package/dist-cli/workshop.js +340 -217
  150. package/example/host.js +109 -0
  151. package/example/index.html +93 -0
  152. package/example/server.mjs +237 -0
  153. package/index.d.ts +48 -0
  154. package/lib/validate.js +47 -1
  155. package/package.json +17 -5
  156. package/runtime/frame-runtime.js +13 -1
  157. package/workshop-component.js +32 -12
  158. package/workshop.js +2 -0
@@ -0,0 +1,622 @@
1
+ import { _ as o, c as ot, V as ut, T as dt, ai as yt, D as ft, m as pt, v as it, a as gt, b as kt, g as mt, s as wt, x as _t, d as bt } from "./mermaid.core-yQghUlIz.js";
2
+ import "./dayjs.min-DZ-YV8Mv.js";
3
+ var J = (function() {
4
+ var e = /* @__PURE__ */ o(function(T, t, s, i) {
5
+ for (s = s || {}, i = T.length; i--; s[T[i]] = t) ;
6
+ return s;
7
+ }, "o"), h = [1, 4], r = [1, 14], a = [1, 12], l = [1, 13], y = [6, 7, 8], f = [1, 20], d = [1, 18], m = [1, 19], u = [6, 7, 11], k = [1, 6, 13, 14], g = [1, 23], _ = [1, 24], x = [1, 6, 7, 11, 13, 14], D = {
8
+ trace: /* @__PURE__ */ o(function() {
9
+ }, "trace"),
10
+ yy: {},
11
+ symbols_: { error: 2, start: 3, ishikawa: 4, spaceLines: 5, SPACELINE: 6, NL: 7, ISHIKAWA: 8, document: 9, stop: 10, EOF: 11, statement: 12, SPACELIST: 13, TEXT: 14, $accept: 0, $end: 1 },
12
+ terminals_: { 2: "error", 6: "SPACELINE", 7: "NL", 8: "ISHIKAWA", 11: "EOF", 13: "SPACELIST", 14: "TEXT" },
13
+ productions_: [0, [3, 1], [3, 2], [5, 1], [5, 2], [5, 2], [4, 2], [4, 3], [10, 1], [10, 1], [10, 1], [10, 2], [10, 2], [9, 3], [9, 2], [12, 2], [12, 1], [12, 1], [12, 1]],
14
+ performAction: /* @__PURE__ */ o(function(t, s, i, c, p, n, v) {
15
+ var w = n.length - 1;
16
+ switch (p) {
17
+ case 6:
18
+ case 7:
19
+ return c;
20
+ case 15:
21
+ c.addNode(n[w - 1].length, n[w].trim());
22
+ break;
23
+ case 16:
24
+ c.addNode(0, n[w].trim());
25
+ break;
26
+ }
27
+ }, "anonymous"),
28
+ table: [{ 3: 1, 4: 2, 5: 3, 6: [1, 5], 8: h }, { 1: [3] }, { 1: [2, 1] }, { 4: 6, 6: [1, 7], 7: [1, 8], 8: h }, { 6: r, 7: [1, 10], 9: 9, 12: 11, 13: a, 14: l }, e(y, [2, 3]), { 1: [2, 2] }, e(y, [2, 4]), e(y, [2, 5]), { 1: [2, 6], 6: r, 12: 15, 13: a, 14: l }, { 6: r, 9: 16, 12: 11, 13: a, 14: l }, { 6: f, 7: d, 10: 17, 11: m }, e(u, [2, 18], { 14: [1, 21] }), e(u, [2, 16]), e(u, [2, 17]), { 6: f, 7: d, 10: 22, 11: m }, { 1: [2, 7], 6: r, 12: 15, 13: a, 14: l }, e(k, [2, 14], { 7: g, 11: _ }), e(x, [2, 8]), e(x, [2, 9]), e(x, [2, 10]), e(u, [2, 15]), e(k, [2, 13], { 7: g, 11: _ }), e(x, [2, 11]), e(x, [2, 12])],
29
+ defaultActions: { 2: [2, 1], 6: [2, 2] },
30
+ parseError: /* @__PURE__ */ o(function(t, s) {
31
+ if (s.recoverable)
32
+ this.trace(t);
33
+ else {
34
+ var i = new Error(t);
35
+ throw i.hash = s, i;
36
+ }
37
+ }, "parseError"),
38
+ parse: /* @__PURE__ */ o(function(t) {
39
+ var s = this, i = [0], c = [], p = [null], n = [], v = this.table, w = "", I = 0, $ = 0, L = 2, A = 1, V = n.slice.call(arguments, 1), b = Object.create(this.lexer), S = { yy: {} };
40
+ for (var P in this.yy)
41
+ Object.prototype.hasOwnProperty.call(this.yy, P) && (S.yy[P] = this.yy[P]);
42
+ b.setInput(t, S.yy), S.yy.lexer = b, S.yy.parser = this, typeof b.yylloc > "u" && (b.yylloc = {});
43
+ var R = b.yylloc;
44
+ n.push(R);
45
+ var G = b.options && b.options.ranges;
46
+ typeof S.yy.parseError == "function" ? this.parseError = S.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
47
+ function Y(B) {
48
+ i.length = i.length - 2 * B, p.length = p.length - B, n.length = n.length - B;
49
+ }
50
+ o(Y, "popStack");
51
+ function tt() {
52
+ var B;
53
+ return B = c.pop() || b.lex() || A, typeof B != "number" && (B instanceof Array && (c = B, B = c.pop()), B = s.symbols_[B] || B), B;
54
+ }
55
+ o(tt, "lex");
56
+ for (var M, W, N, K, F = {}, U, C, et, Z; ; ) {
57
+ if (W = i[i.length - 1], this.defaultActions[W] ? N = this.defaultActions[W] : ((M === null || typeof M > "u") && (M = tt()), N = v[W] && v[W][M]), typeof N > "u" || !N.length || !N[0]) {
58
+ var q = "";
59
+ Z = [];
60
+ for (U in v[W])
61
+ this.terminals_[U] && U > L && Z.push("'" + this.terminals_[U] + "'");
62
+ b.showPosition ? q = "Parse error on line " + (I + 1) + `:
63
+ ` + b.showPosition() + `
64
+ Expecting ` + Z.join(", ") + ", got '" + (this.terminals_[M] || M) + "'" : q = "Parse error on line " + (I + 1) + ": Unexpected " + (M == A ? "end of input" : "'" + (this.terminals_[M] || M) + "'"), this.parseError(q, {
65
+ text: b.match,
66
+ token: this.terminals_[M] || M,
67
+ line: b.yylineno,
68
+ loc: R,
69
+ expected: Z
70
+ });
71
+ }
72
+ if (N[0] instanceof Array && N.length > 1)
73
+ throw new Error("Parse Error: multiple actions possible at state: " + W + ", token: " + M);
74
+ switch (N[0]) {
75
+ case 1:
76
+ i.push(M), p.push(b.yytext), n.push(b.yylloc), i.push(N[1]), M = null, $ = b.yyleng, w = b.yytext, I = b.yylineno, R = b.yylloc;
77
+ break;
78
+ case 2:
79
+ if (C = this.productions_[N[1]][1], F.$ = p[p.length - C], F._$ = {
80
+ first_line: n[n.length - (C || 1)].first_line,
81
+ last_line: n[n.length - 1].last_line,
82
+ first_column: n[n.length - (C || 1)].first_column,
83
+ last_column: n[n.length - 1].last_column
84
+ }, G && (F._$.range = [
85
+ n[n.length - (C || 1)].range[0],
86
+ n[n.length - 1].range[1]
87
+ ]), K = this.performAction.apply(F, [
88
+ w,
89
+ $,
90
+ I,
91
+ S.yy,
92
+ N[1],
93
+ p,
94
+ n
95
+ ].concat(V)), typeof K < "u")
96
+ return K;
97
+ C && (i = i.slice(0, -1 * C * 2), p = p.slice(0, -1 * C), n = n.slice(0, -1 * C)), i.push(this.productions_[N[1]][0]), p.push(F.$), n.push(F._$), et = v[i[i.length - 2]][i[i.length - 1]], i.push(et);
98
+ break;
99
+ case 3:
100
+ return !0;
101
+ }
102
+ }
103
+ return !0;
104
+ }, "parse")
105
+ }, O = /* @__PURE__ */ (function() {
106
+ var T = {
107
+ EOF: 1,
108
+ parseError: /* @__PURE__ */ o(function(s, i) {
109
+ if (this.yy.parser)
110
+ this.yy.parser.parseError(s, i);
111
+ else
112
+ throw new Error(s);
113
+ }, "parseError"),
114
+ // resets the lexer, sets new input
115
+ setInput: /* @__PURE__ */ o(function(t, s) {
116
+ return this.yy = s || this.yy || {}, this._input = t, this._more = this._backtrack = this.done = !1, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = {
117
+ first_line: 1,
118
+ first_column: 0,
119
+ last_line: 1,
120
+ last_column: 0
121
+ }, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this;
122
+ }, "setInput"),
123
+ // consumes and returns one char from the input
124
+ input: /* @__PURE__ */ o(function() {
125
+ var t = this._input[0];
126
+ this.yytext += t, this.yyleng++, this.offset++, this.match += t, this.matched += t;
127
+ var s = t.match(/(?:\r\n?|\n).*/g);
128
+ return s ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), t;
129
+ }, "input"),
130
+ // unshifts one char (or a string) into the input
131
+ unput: /* @__PURE__ */ o(function(t) {
132
+ var s = t.length, i = t.split(/(?:\r\n?|\n)/g);
133
+ this._input = t + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - s), this.offset -= s;
134
+ var c = this.match.split(/(?:\r\n?|\n)/g);
135
+ this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), i.length - 1 && (this.yylineno -= i.length - 1);
136
+ var p = this.yylloc.range;
137
+ return this.yylloc = {
138
+ first_line: this.yylloc.first_line,
139
+ last_line: this.yylineno + 1,
140
+ first_column: this.yylloc.first_column,
141
+ last_column: i ? (i.length === c.length ? this.yylloc.first_column : 0) + c[c.length - i.length].length - i[0].length : this.yylloc.first_column - s
142
+ }, this.options.ranges && (this.yylloc.range = [p[0], p[0] + this.yyleng - s]), this.yyleng = this.yytext.length, this;
143
+ }, "unput"),
144
+ // When called from action, caches matched text and appends it on next action
145
+ more: /* @__PURE__ */ o(function() {
146
+ return this._more = !0, this;
147
+ }, "more"),
148
+ // When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead.
149
+ reject: /* @__PURE__ */ o(function() {
150
+ if (this.options.backtrack_lexer)
151
+ this._backtrack = !0;
152
+ else
153
+ 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).
154
+ ` + this.showPosition(), {
155
+ text: "",
156
+ token: null,
157
+ line: this.yylineno
158
+ });
159
+ return this;
160
+ }, "reject"),
161
+ // retain first n characters of the match
162
+ less: /* @__PURE__ */ o(function(t) {
163
+ this.unput(this.match.slice(t));
164
+ }, "less"),
165
+ // displays already matched input, i.e. for error messages
166
+ pastInput: /* @__PURE__ */ o(function() {
167
+ var t = this.matched.substr(0, this.matched.length - this.match.length);
168
+ return (t.length > 20 ? "..." : "") + t.substr(-20).replace(/\n/g, "");
169
+ }, "pastInput"),
170
+ // displays upcoming input, i.e. for error messages
171
+ upcomingInput: /* @__PURE__ */ o(function() {
172
+ var t = this.match;
173
+ return t.length < 20 && (t += this._input.substr(0, 20 - t.length)), (t.substr(0, 20) + (t.length > 20 ? "..." : "")).replace(/\n/g, "");
174
+ }, "upcomingInput"),
175
+ // displays the character position where the lexing error occurred, i.e. for error messages
176
+ showPosition: /* @__PURE__ */ o(function() {
177
+ var t = this.pastInput(), s = new Array(t.length + 1).join("-");
178
+ return t + this.upcomingInput() + `
179
+ ` + s + "^";
180
+ }, "showPosition"),
181
+ // test the lexed token: return FALSE when not a match, otherwise return token
182
+ test_match: /* @__PURE__ */ o(function(t, s) {
183
+ var i, c, p;
184
+ if (this.options.backtrack_lexer && (p = {
185
+ yylineno: this.yylineno,
186
+ yylloc: {
187
+ first_line: this.yylloc.first_line,
188
+ last_line: this.last_line,
189
+ first_column: this.yylloc.first_column,
190
+ last_column: this.yylloc.last_column
191
+ },
192
+ yytext: this.yytext,
193
+ match: this.match,
194
+ matches: this.matches,
195
+ matched: this.matched,
196
+ yyleng: this.yyleng,
197
+ offset: this.offset,
198
+ _more: this._more,
199
+ _input: this._input,
200
+ yy: this.yy,
201
+ conditionStack: this.conditionStack.slice(0),
202
+ done: this.done
203
+ }, this.options.ranges && (p.yylloc.range = this.yylloc.range.slice(0))), c = t[0].match(/(?:\r\n?|\n).*/g), c && (this.yylineno += c.length), this.yylloc = {
204
+ first_line: this.yylloc.last_line,
205
+ last_line: this.yylineno + 1,
206
+ first_column: this.yylloc.last_column,
207
+ last_column: c ? c[c.length - 1].length - c[c.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + t[0].length
208
+ }, this.yytext += t[0], this.match += t[0], this.matches = t, this.yyleng = this.yytext.length, this.options.ranges && (this.yylloc.range = [this.offset, this.offset += this.yyleng]), this._more = !1, this._backtrack = !1, this._input = this._input.slice(t[0].length), this.matched += t[0], i = this.performAction.call(this, this.yy, this, s, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), i)
209
+ return i;
210
+ if (this._backtrack) {
211
+ for (var n in p)
212
+ this[n] = p[n];
213
+ return !1;
214
+ }
215
+ return !1;
216
+ }, "test_match"),
217
+ // return next match in input
218
+ next: /* @__PURE__ */ o(function() {
219
+ if (this.done)
220
+ return this.EOF;
221
+ this._input || (this.done = !0);
222
+ var t, s, i, c;
223
+ this._more || (this.yytext = "", this.match = "");
224
+ for (var p = this._currentRules(), n = 0; n < p.length; n++)
225
+ if (i = this._input.match(this.rules[p[n]]), i && (!s || i[0].length > s[0].length)) {
226
+ if (s = i, c = n, this.options.backtrack_lexer) {
227
+ if (t = this.test_match(i, p[n]), t !== !1)
228
+ return t;
229
+ if (this._backtrack) {
230
+ s = !1;
231
+ continue;
232
+ } else
233
+ return !1;
234
+ } else if (!this.options.flex)
235
+ break;
236
+ }
237
+ return s ? (t = this.test_match(s, p[c]), t !== !1 ? t : !1) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + `. Unrecognized text.
238
+ ` + this.showPosition(), {
239
+ text: "",
240
+ token: null,
241
+ line: this.yylineno
242
+ });
243
+ }, "next"),
244
+ // return next match that has a token
245
+ lex: /* @__PURE__ */ o(function() {
246
+ var s = this.next();
247
+ return s || this.lex();
248
+ }, "lex"),
249
+ // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
250
+ begin: /* @__PURE__ */ o(function(s) {
251
+ this.conditionStack.push(s);
252
+ }, "begin"),
253
+ // pop the previously active lexer condition state off the condition stack
254
+ popState: /* @__PURE__ */ o(function() {
255
+ var s = this.conditionStack.length - 1;
256
+ return s > 0 ? this.conditionStack.pop() : this.conditionStack[0];
257
+ }, "popState"),
258
+ // produce the lexer rule set which is active for the currently active lexer condition state
259
+ _currentRules: /* @__PURE__ */ o(function() {
260
+ return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules;
261
+ }, "_currentRules"),
262
+ // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
263
+ topState: /* @__PURE__ */ o(function(s) {
264
+ return s = this.conditionStack.length - 1 - Math.abs(s || 0), s >= 0 ? this.conditionStack[s] : "INITIAL";
265
+ }, "topState"),
266
+ // alias for begin(condition)
267
+ pushState: /* @__PURE__ */ o(function(s) {
268
+ this.begin(s);
269
+ }, "pushState"),
270
+ // return the number of states currently on the stack
271
+ stateStackSize: /* @__PURE__ */ o(function() {
272
+ return this.conditionStack.length;
273
+ }, "stateStackSize"),
274
+ options: { "case-insensitive": !0 },
275
+ performAction: /* @__PURE__ */ o(function(s, i, c, p) {
276
+ switch (c) {
277
+ case 0:
278
+ return 6;
279
+ case 1:
280
+ return 8;
281
+ case 2:
282
+ return 8;
283
+ case 3:
284
+ return 6;
285
+ case 4:
286
+ return 7;
287
+ case 5:
288
+ return 13;
289
+ case 6:
290
+ return 14;
291
+ case 7:
292
+ return 11;
293
+ }
294
+ }, "anonymous"),
295
+ rules: [/^(?:\s*%%.*)/i, /^(?:ishikawa-beta\b)/i, /^(?:ishikawa\b)/i, /^(?:[\s]+[\n])/i, /^(?:[\n]+)/i, /^(?:[\s]+)/i, /^(?:[^\n]+)/i, /^(?:$)/i],
296
+ conditions: { INITIAL: { rules: [0, 1, 2, 3, 4, 5, 6, 7], inclusive: !0 } }
297
+ };
298
+ return T;
299
+ })();
300
+ D.lexer = O;
301
+ function E() {
302
+ this.yy = {};
303
+ }
304
+ return o(E, "Parser"), E.prototype = D, D.Parser = E, new E();
305
+ })();
306
+ J.parser = J;
307
+ var xt = J, H, vt = (H = class {
308
+ constructor() {
309
+ this.stack = [], this.clear = this.clear.bind(this), this.addNode = this.addNode.bind(this), this.getRoot = this.getRoot.bind(this);
310
+ }
311
+ clear() {
312
+ this.root = void 0, this.stack = [], this.baseLevel = void 0, ft();
313
+ }
314
+ getRoot() {
315
+ return this.root;
316
+ }
317
+ addNode(h, r) {
318
+ const a = pt.sanitizeText(r, ot());
319
+ if (!this.root) {
320
+ this.root = { text: a, children: [] }, this.stack = [{ level: 0, node: this.root }], it(a);
321
+ return;
322
+ }
323
+ this.baseLevel ??= h;
324
+ let l = h - this.baseLevel + 1;
325
+ for (l <= 0 && (l = 1); this.stack.length > 1 && this.stack[this.stack.length - 1].level >= l; )
326
+ this.stack.pop();
327
+ const y = this.stack[this.stack.length - 1].node, f = { text: a, children: [] };
328
+ y.children.push(f), this.stack.push({ level: l, node: f });
329
+ }
330
+ getAccTitle() {
331
+ return gt();
332
+ }
333
+ setAccTitle(h) {
334
+ kt(h);
335
+ }
336
+ getAccDescription() {
337
+ return mt();
338
+ }
339
+ setAccDescription(h) {
340
+ wt(h);
341
+ }
342
+ getDiagramTitle() {
343
+ return _t();
344
+ }
345
+ setDiagramTitle(h) {
346
+ it(h);
347
+ }
348
+ }, o(H, "IshikawaDB"), H), St = 14, j = 250, $t = 30, Et = 60, At = 5, ht = 82 * Math.PI / 180, st = Math.cos(ht), nt = Math.sin(ht), at = /* @__PURE__ */ o((e, h, r) => {
349
+ const a = e.node().getBBox(), l = a.width + h * 2, y = a.height + h * 2;
350
+ bt(e, y, l, r), e.attr("viewBox", `${a.x - h} ${a.y - h} ${l} ${y}`);
351
+ }, "applyPaddedViewBox"), It = /* @__PURE__ */ o((e, h, r, a) => {
352
+ const y = a.db.getRoot();
353
+ if (!y)
354
+ return;
355
+ const f = ot(), { look: d, handDrawnSeed: m, themeVariables: u } = f, k = ut(f.fontSize)[0] ?? St, g = d === "handDrawn", _ = y.children ?? [], x = f.ishikawa?.diagramPadding ?? 20, D = f.ishikawa?.useMaxWidth ?? !1, O = dt(h), E = O.append("g").attr("class", "ishikawa"), T = g ? yt.svg(O.node()) : void 0, t = T ? {
356
+ roughSvg: T,
357
+ seed: m ?? 0,
358
+ lineColor: u?.lineColor ?? "#333",
359
+ fillColor: u?.mainBkg ?? "#fff"
360
+ } : void 0, s = `ishikawa-arrow-${h}`;
361
+ g || E.append("defs").append("marker").attr("id", s).attr("viewBox", "0 0 10 10").attr("refX", 0).attr("refY", 5).attr("markerWidth", 6).attr("markerHeight", 6).attr("orient", "auto").append("path").attr("d", "M 10 0 L 0 5 L 10 10 Z").attr("class", "ishikawa-arrow");
362
+ let i = 0, c = j;
363
+ const p = g ? void 0 : z(E, i, c, i, c, "ishikawa-spine");
364
+ if (Lt(E, i, c, y.text, k, t), !_.length) {
365
+ g && z(E, i, c, i, c, "ishikawa-spine", t), at(O, x, D);
366
+ return;
367
+ }
368
+ i -= 20;
369
+ const n = _.filter((S, P) => P % 2 === 0), v = _.filter((S, P) => P % 2 === 1), w = rt(n), I = rt(v), $ = w.total + I.total;
370
+ let L = j, A = j;
371
+ if ($ > 0) {
372
+ const S = j * 2, P = j * 0.3;
373
+ L = Math.max(P, S * (w.total / $)), A = Math.max(P, S * (I.total / $));
374
+ }
375
+ const V = k * 2;
376
+ L = Math.max(L, w.max * V), A = Math.max(A, I.max * V), c = Math.max(L, j), p && p.attr("y1", c).attr("y2", c), E.select(".ishikawa-head-group").attr("transform", `translate(0,${c})`);
377
+ const b = Math.ceil(_.length / 2);
378
+ for (let S = 0; S < b; S++) {
379
+ const P = E.append("g").attr("class", "ishikawa-pair");
380
+ for (const [R, G, Y] of [
381
+ [_[S * 2], -1, L],
382
+ [_[S * 2 + 1], 1, A]
383
+ ])
384
+ R && Pt(P, R, i, c, G, Y, k, t);
385
+ i = P.selectAll("text").nodes().reduce((R, G) => Math.min(R, G.getBBox().x), 1 / 0);
386
+ }
387
+ if (g)
388
+ z(E, i, c, 0, c, "ishikawa-spine", t);
389
+ else {
390
+ p.attr("x1", i);
391
+ const S = `url(#${s})`;
392
+ E.selectAll("line.ishikawa-branch, line.ishikawa-sub-branch").attr("marker-start", S);
393
+ }
394
+ at(O, x, D);
395
+ }, "draw"), rt = /* @__PURE__ */ o((e) => {
396
+ const h = /* @__PURE__ */ o((r) => r.children.reduce((a, l) => a + 1 + h(l), 0), "countDescendants");
397
+ return e.reduce(
398
+ (r, a) => {
399
+ const l = h(a);
400
+ return r.total += l, r.max = Math.max(r.max, l), r;
401
+ },
402
+ { total: 0, max: 0 }
403
+ );
404
+ }, "sideStats"), Lt = /* @__PURE__ */ o((e, h, r, a, l, y) => {
405
+ const f = Math.max(6, Math.floor(110 / (l * 0.6))), d = e.append("g").attr("class", "ishikawa-head-group").attr("transform", `translate(${h},${r})`), m = X(
406
+ d,
407
+ ct(a, f),
408
+ 0,
409
+ 0,
410
+ "ishikawa-head-label",
411
+ "start",
412
+ l
413
+ ), u = m.node().getBBox(), k = Math.max(60, u.width + 6), g = Math.max(40, u.height * 2 + 40), _ = `M 0 ${-g / 2} L 0 ${g / 2} Q ${k * 2.4} 0 0 ${-g / 2} Z`;
414
+ if (y) {
415
+ const x = y.roughSvg.path(_, {
416
+ roughness: 1.5,
417
+ seed: y.seed,
418
+ fill: y.fillColor,
419
+ fillStyle: "hachure",
420
+ fillWeight: 2.5,
421
+ hachureGap: 5,
422
+ stroke: y.lineColor,
423
+ strokeWidth: 2
424
+ });
425
+ d.insert(() => x, ":first-child").attr("class", "ishikawa-head");
426
+ } else
427
+ d.insert("path", ":first-child").attr("class", "ishikawa-head").attr("d", _);
428
+ m.attr("transform", `translate(${(k - u.width) / 2 - u.x + 3},${-u.y - u.height / 2})`);
429
+ }, "drawHead"), Tt = /* @__PURE__ */ o((e, h) => {
430
+ const r = [], a = [], l = /* @__PURE__ */ o((y, f, d) => {
431
+ const m = h === -1 ? [...y].reverse() : y;
432
+ for (const u of m) {
433
+ const k = r.length, g = u.children ?? [];
434
+ r.push({
435
+ depth: d,
436
+ text: ct(u.text, 15),
437
+ parentIndex: f,
438
+ childCount: g.length
439
+ }), d % 2 === 0 ? (a.push(k), g.length && l(g, k, d + 1)) : (g.length && l(g, k, d + 1), a.push(k));
440
+ }
441
+ }, "walk");
442
+ return l(e, -1, 2), { entries: r, yOrder: a };
443
+ }, "flattenTree"), Mt = /* @__PURE__ */ o((e, h, r, a, l, y, f) => {
444
+ const d = e.append("g").attr("class", "ishikawa-label-group"), u = X(
445
+ d,
446
+ h,
447
+ r,
448
+ a + 11 * l,
449
+ "ishikawa-label cause",
450
+ "middle",
451
+ y
452
+ ).node().getBBox();
453
+ if (f) {
454
+ const k = f.roughSvg.rectangle(
455
+ u.x - 20,
456
+ u.y - 2,
457
+ u.width + 40,
458
+ u.height + 4,
459
+ {
460
+ roughness: 1.5,
461
+ seed: f.seed,
462
+ fill: f.fillColor,
463
+ fillStyle: "hachure",
464
+ fillWeight: 2.5,
465
+ hachureGap: 5,
466
+ stroke: f.lineColor,
467
+ strokeWidth: 2
468
+ }
469
+ );
470
+ d.insert(() => k, ":first-child").attr("class", "ishikawa-label-box");
471
+ } else
472
+ d.insert("rect", ":first-child").attr("class", "ishikawa-label-box").attr("x", u.x - 20).attr("y", u.y - 2).attr("width", u.width + 40).attr("height", u.height + 4);
473
+ }, "drawCauseLabel"), Q = /* @__PURE__ */ o((e, h, r, a, l, y) => {
474
+ const f = Math.sqrt(a * a + l * l);
475
+ if (f === 0)
476
+ return;
477
+ const d = a / f, m = l / f, u = 6, k = -m * u, g = d * u, _ = h, x = r, D = `M ${_} ${x} L ${_ - d * u * 2 + k} ${x - m * u * 2 + g} L ${_ - d * u * 2 - k} ${x - m * u * 2 - g} Z`, O = y.roughSvg.path(D, {
478
+ roughness: 1,
479
+ seed: y.seed,
480
+ fill: y.lineColor,
481
+ fillStyle: "solid",
482
+ stroke: y.lineColor,
483
+ strokeWidth: 1
484
+ });
485
+ e.append(() => O);
486
+ }, "drawArrowMarker"), Pt = /* @__PURE__ */ o((e, h, r, a, l, y, f, d) => {
487
+ const m = h.children ?? [], u = y * (m.length ? 1 : 0.2), k = -st * u, g = nt * u * l, _ = r + k, x = a + g;
488
+ if (z(e, r, a, _, x, "ishikawa-branch", d), d && Q(e, r, a, r - _, a - x, d), Mt(e, h.text, _, x, l, f, d), !m.length)
489
+ return;
490
+ const { entries: D, yOrder: O } = Tt(m, l), E = D.length, T = new Array(E);
491
+ for (const [p, n] of O.entries())
492
+ T[n] = a + g * ((p + 1) / (E + 1));
493
+ const t = /* @__PURE__ */ new Map();
494
+ t.set(-1, {
495
+ x0: r,
496
+ y0: a,
497
+ x1: _,
498
+ y1: x,
499
+ childCount: m.length,
500
+ childrenDrawn: 0
501
+ });
502
+ const s = -st, i = nt * l, c = l < 0 ? "ishikawa-label up" : "ishikawa-label down";
503
+ for (const [p, n] of D.entries()) {
504
+ const v = T[p], w = t.get(n.parentIndex), I = e.append("g").attr("class", "ishikawa-sub-group");
505
+ let $ = 0, L = 0, A = 0;
506
+ if (n.depth % 2 === 0) {
507
+ const V = w.y1 - w.y0;
508
+ $ = lt(w.x0, w.x1, V ? (v - w.y0) / V : 0.5), L = v, A = $ - (n.childCount > 0 ? Et + n.childCount * At : $t), z(I, $, v, A, v, "ishikawa-sub-branch", d), d && Q(I, $, v, 1, 0, d), X(I, n.text, A, v, "ishikawa-label align", "end", f);
509
+ } else {
510
+ const V = w.childrenDrawn++;
511
+ $ = lt(w.x0, w.x1, (w.childCount - V) / (w.childCount + 1)), L = w.y0, A = $ + s * ((v - L) / i), z(I, $, L, A, v, "ishikawa-sub-branch", d), d && Q(I, $, L, $ - A, L - v, d), X(I, n.text, A, v, c, "end", f);
512
+ }
513
+ n.childCount > 0 && t.set(p, {
514
+ x0: $,
515
+ y0: L,
516
+ x1: A,
517
+ y1: v,
518
+ childCount: n.childCount,
519
+ childrenDrawn: 0
520
+ });
521
+ }
522
+ }, "drawBranch"), Bt = /* @__PURE__ */ o((e) => e.split(/<br\s*\/?>|\n/), "splitLines"), ct = /* @__PURE__ */ o((e, h) => {
523
+ if (e.length <= h)
524
+ return e;
525
+ const r = [];
526
+ for (const a of e.split(/\s+/)) {
527
+ const l = r.length - 1;
528
+ l >= 0 && r[l].length + 1 + a.length <= h ? r[l] += " " + a : r.push(a);
529
+ }
530
+ return r.join(`
531
+ `);
532
+ }, "wrapText"), X = /* @__PURE__ */ o((e, h, r, a, l, y, f) => {
533
+ const d = Bt(h), m = f * 1.05, u = e.append("text").attr("class", l).attr("text-anchor", y).attr("x", r).attr("y", a - (d.length - 1) * m / 2);
534
+ for (const [k, g] of d.entries())
535
+ u.append("tspan").attr("x", r).attr("dy", k === 0 ? 0 : m).text(g);
536
+ return u;
537
+ }, "drawMultilineText"), lt = /* @__PURE__ */ o((e, h, r) => e + (h - e) * r, "lerp"), z = /* @__PURE__ */ o((e, h, r, a, l, y, f) => {
538
+ if (f) {
539
+ const d = f.roughSvg.line(h, r, a, l, {
540
+ roughness: 1.5,
541
+ seed: f.seed,
542
+ stroke: f.lineColor,
543
+ strokeWidth: 2
544
+ });
545
+ e.append(() => d).attr("class", y);
546
+ return;
547
+ }
548
+ return e.append("line").attr("class", y).attr("x1", h).attr("y1", r).attr("x2", a).attr("y2", l);
549
+ }, "drawLine"), Nt = { draw: It }, Dt = /* @__PURE__ */ o((e) => `
550
+ .ishikawa .ishikawa-spine,
551
+ .ishikawa .ishikawa-branch,
552
+ .ishikawa .ishikawa-sub-branch {
553
+ stroke: ${e.lineColor};
554
+ stroke-width: 2;
555
+ fill: none;
556
+ }
557
+
558
+ .ishikawa .ishikawa-sub-branch {
559
+ stroke-width: 1;
560
+ }
561
+
562
+ .ishikawa .ishikawa-arrow {
563
+ fill: ${e.lineColor};
564
+ }
565
+
566
+ .ishikawa .ishikawa-head {
567
+ fill: ${e.mainBkg};
568
+ stroke: ${e.lineColor};
569
+ stroke-width: 2;
570
+ }
571
+
572
+ .ishikawa .ishikawa-label-box {
573
+ fill: ${e.mainBkg};
574
+ stroke: ${e.lineColor};
575
+ stroke-width: 2;
576
+ }
577
+
578
+ .ishikawa text {
579
+ font-family: ${e.fontFamily};
580
+ font-size: ${e.fontSize};
581
+ fill: ${e.textColor};
582
+ }
583
+
584
+ .ishikawa .ishikawa-head-label {
585
+ font-weight: 600;
586
+ text-anchor: middle;
587
+ dominant-baseline: middle;
588
+ font-size: 14px;
589
+ }
590
+
591
+ .ishikawa .ishikawa-label {
592
+ text-anchor: end;
593
+ }
594
+
595
+ .ishikawa .ishikawa-label.cause {
596
+ text-anchor: middle;
597
+ dominant-baseline: middle;
598
+ }
599
+
600
+ .ishikawa .ishikawa-label.align {
601
+ text-anchor: end;
602
+ dominant-baseline: middle;
603
+ }
604
+
605
+ .ishikawa .ishikawa-label.up {
606
+ dominant-baseline: baseline;
607
+ }
608
+
609
+ .ishikawa .ishikawa-label.down {
610
+ dominant-baseline: hanging;
611
+ }
612
+ `, "getStyles"), Ot = Dt, Rt = {
613
+ parser: xt,
614
+ get db() {
615
+ return new vt();
616
+ },
617
+ renderer: Nt,
618
+ styles: Ot
619
+ };
620
+ export {
621
+ Rt as diagram
622
+ };