dsh-vt-web-chat 1.2.1 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (168) hide show
  1. package/README.md +66 -33
  2. package/client.js +355 -798
  3. package/docs/research/01-chat-demo-embedding.md +322 -0
  4. package/index.js +36 -8
  5. package/locale/en.json +1 -1
  6. package/locale/zh.json +1 -1
  7. package/package.json +15 -6
  8. package/scripts/dev-server.mjs +54 -0
  9. package/scripts/sync-upstream.mjs +106 -0
  10. package/src/auth.js +65 -0
  11. package/src/maintenance.js +240 -0
  12. package/src/proxy.js +139 -0
  13. package/src/route.js +307 -0
  14. package/src/settings.js +74 -0
  15. package/webview/UPSTREAM.json +6 -0
  16. package/webview/dist/LICENSE +21 -0
  17. package/webview/dist/index.html +1 -0
  18. package/webview/dist/static/css/async/4959.1382f613.css +1 -0
  19. package/webview/dist/static/css/main.27198ffe.css +1 -0
  20. package/webview/dist/static/js/async/1031.575fa503.js +1 -0
  21. package/webview/dist/static/js/async/1085.769e13d5.js +1 -0
  22. package/webview/dist/static/js/async/1086.4d3be1fa.js +1 -0
  23. package/webview/dist/static/js/async/1097.4f798919.js +117 -0
  24. package/webview/dist/static/js/async/1299.0ef86619.js +1 -0
  25. package/webview/dist/static/js/async/1393.6ef1efab.js +1 -0
  26. package/webview/dist/static/js/async/1401.88487cba.js +1 -0
  27. package/webview/dist/static/js/async/1505.8913966f.js +1 -0
  28. package/webview/dist/static/js/async/160.81018107.js +55 -0
  29. package/webview/dist/static/js/async/1679.153f9f03.js +1 -0
  30. package/webview/dist/static/js/async/1690.fe25bdfe.js +1 -0
  31. package/webview/dist/static/js/async/2110.a1d33f2f.js +215 -0
  32. package/webview/dist/static/js/async/2152.97b0a90c.js +1 -0
  33. package/webview/dist/static/js/async/2168.9925ab2d.js +1 -0
  34. package/webview/dist/static/js/async/2312.4fd0ef8e.js +1 -0
  35. package/webview/dist/static/js/async/2348.41564e59.js +148 -0
  36. package/webview/dist/static/js/async/2356.631a6aca.js +1 -0
  37. package/webview/dist/static/js/async/2415.00900482.js +1 -0
  38. package/webview/dist/static/js/async/2461.15199935.js +1 -0
  39. package/webview/dist/static/js/async/2541.f8eac009.js +1 -0
  40. package/webview/dist/static/js/async/2607.abb8bc11.js +1 -0
  41. package/webview/dist/static/js/async/265.b43cee3f.js +1 -0
  42. package/webview/dist/static/js/async/2696.60d5ecf0.js +1 -0
  43. package/webview/dist/static/js/async/3014.c8e9b88f.js +1 -0
  44. package/webview/dist/static/js/async/3111.e2cca965.js +1 -0
  45. package/webview/dist/static/js/async/3251.0b9c608e.js +1 -0
  46. package/webview/dist/static/js/async/3339.ed293391.js +1 -0
  47. package/webview/dist/static/js/async/3376.3aa54d1a.js +93 -0
  48. package/webview/dist/static/js/async/3465.845187e8.js +1 -0
  49. package/webview/dist/static/js/async/3477.94bd21ab.js +5 -0
  50. package/webview/dist/static/js/async/3594.edfe4411.js +1 -0
  51. package/webview/dist/static/js/async/3806.28abb895.js +1 -0
  52. package/webview/dist/static/js/async/3909.4b4bd806.js +1 -0
  53. package/webview/dist/static/js/async/4138.104dbc81.js +1 -0
  54. package/webview/dist/static/js/async/426.6fedaabe.js +1 -0
  55. package/webview/dist/static/js/async/4387.151c5858.js +1 -0
  56. package/webview/dist/static/js/async/4468.d0c907eb.js +1 -0
  57. package/webview/dist/static/js/async/4471.b0874c8d.js +158 -0
  58. package/webview/dist/static/js/async/4568.cf5e547d.js +1 -0
  59. package/webview/dist/static/js/async/4580.f1bc120a.js +131 -0
  60. package/webview/dist/static/js/async/4695.8f4b8910.js +1 -0
  61. package/webview/dist/static/js/async/4959.deb41780.js +1 -0
  62. package/webview/dist/static/js/async/509.f3e093b4.js +59 -0
  63. package/webview/dist/static/js/async/5172.e1e3bd11.js +43 -0
  64. package/webview/dist/static/js/async/535.e10ba324.js +1 -0
  65. package/webview/dist/static/js/async/5546.89da376c.js +24 -0
  66. package/webview/dist/static/js/async/5597.3018e134.js +36 -0
  67. package/webview/dist/static/js/async/5636.61075f0b.js +174 -0
  68. package/webview/dist/static/js/async/5638.7cfdcd7e.js +1 -0
  69. package/webview/dist/static/js/async/5706.d34ac064.js +1 -0
  70. package/webview/dist/static/js/async/5856.d75c4e3b.js +1 -0
  71. package/webview/dist/static/js/async/6061.7cfcc3e9.js +1 -0
  72. package/webview/dist/static/js/async/6152.d3a64904.js +1 -0
  73. package/webview/dist/static/js/async/6297.6e694780.js +1 -0
  74. package/webview/dist/static/js/async/6325.cafe9e55.js +1 -0
  75. package/webview/dist/static/js/async/6332.682f48c9.js +1 -0
  76. package/webview/dist/static/js/async/6349.e9992b47.js +56 -0
  77. package/webview/dist/static/js/async/6389.1bb952e3.js +1 -0
  78. package/webview/dist/static/js/async/6443.95da1923.js +1 -0
  79. package/webview/dist/static/js/async/6526.56ce7dc4.js +1 -0
  80. package/webview/dist/static/js/async/6600.6e0dfb69.js +1 -0
  81. package/webview/dist/static/js/async/6689.d0bd8935.js +262 -0
  82. package/webview/dist/static/js/async/6751.54c80aba.js +1 -0
  83. package/webview/dist/static/js/async/680.5aa7dcb4.js +1 -0
  84. package/webview/dist/static/js/async/6948.9cd716f4.js +1 -0
  85. package/webview/dist/static/js/async/7262.f680270f.js +88 -0
  86. package/webview/dist/static/js/async/7515.20c14480.js +1 -0
  87. package/webview/dist/static/js/async/7536.34769b35.js +1 -0
  88. package/webview/dist/static/js/async/7630.ed725458.js +1 -0
  89. package/webview/dist/static/js/async/7853.0a4b794a.js +1 -0
  90. package/webview/dist/static/js/async/8180.4d4299ef.js +1 -0
  91. package/webview/dist/static/js/async/828.56686119.js +1 -0
  92. package/webview/dist/static/js/async/8379.1b75211c.js +1 -0
  93. package/webview/dist/static/js/async/8389.4f120664.js +1 -0
  94. package/webview/dist/static/js/async/8538.d5f92d14.js +24 -0
  95. package/webview/dist/static/js/async/8560.1bdf90ec.js +1 -0
  96. package/webview/dist/static/js/async/8794.759831e8.js +60 -0
  97. package/webview/dist/static/js/async/8821.2b444259.js +29 -0
  98. package/webview/dist/static/js/async/925.548cc1b9.js +1 -0
  99. package/webview/dist/static/js/async/9252.3c22a9cd.js +1 -0
  100. package/webview/dist/static/js/async/9261.1e796956.js +1 -0
  101. package/webview/dist/static/js/async/9324.b3518ebf.js +1 -0
  102. package/webview/dist/static/js/async/9354.4425ac3c.js +1 -0
  103. package/webview/dist/static/js/async/9501.a7851380.js +4 -0
  104. package/webview/dist/static/js/async/9560.d604e606.js +166 -0
  105. package/webview/dist/static/js/async/9640.5f6a6734.js +1 -0
  106. package/webview/dist/static/js/async/9765.ecc8b5dc.js +1 -0
  107. package/webview/dist/static/js/async/9821.b1897048.js +63 -0
  108. package/webview/dist/static/js/main.7c5f914e.js +3 -0
  109. package/webview/dist/static/media/KaTeX_AMS-Regular.1608a09b.woff +0 -0
  110. package/webview/dist/static/media/KaTeX_AMS-Regular.4aafdb68.ttf +0 -0
  111. package/webview/dist/static/media/KaTeX_AMS-Regular.a79f1c31.woff2 +0 -0
  112. package/webview/dist/static/media/KaTeX_Caligraphic-Bold.b6770918.woff +0 -0
  113. package/webview/dist/static/media/KaTeX_Caligraphic-Bold.cce5b8ec.ttf +0 -0
  114. package/webview/dist/static/media/KaTeX_Caligraphic-Bold.ec17d132.woff2 +0 -0
  115. package/webview/dist/static/media/KaTeX_Caligraphic-Regular.07ef19e7.ttf +0 -0
  116. package/webview/dist/static/media/KaTeX_Caligraphic-Regular.55fac258.woff2 +0 -0
  117. package/webview/dist/static/media/KaTeX_Caligraphic-Regular.dad44a7f.woff +0 -0
  118. package/webview/dist/static/media/KaTeX_Fraktur-Bold.9f256b85.woff +0 -0
  119. package/webview/dist/static/media/KaTeX_Fraktur-Bold.b18f59e1.ttf +0 -0
  120. package/webview/dist/static/media/KaTeX_Fraktur-Bold.d42a5579.woff2 +0 -0
  121. package/webview/dist/static/media/KaTeX_Fraktur-Regular.7c187121.woff +0 -0
  122. package/webview/dist/static/media/KaTeX_Fraktur-Regular.d3c882a6.woff2 +0 -0
  123. package/webview/dist/static/media/KaTeX_Fraktur-Regular.ed38e79f.ttf +0 -0
  124. package/webview/dist/static/media/KaTeX_Main-Bold.b74a1a8b.ttf +0 -0
  125. package/webview/dist/static/media/KaTeX_Main-Bold.c3fb5ac2.woff2 +0 -0
  126. package/webview/dist/static/media/KaTeX_Main-Bold.d181c465.woff +0 -0
  127. package/webview/dist/static/media/KaTeX_Main-BoldItalic.6f2bb1df.woff2 +0 -0
  128. package/webview/dist/static/media/KaTeX_Main-BoldItalic.70d8b0a5.ttf +0 -0
  129. package/webview/dist/static/media/KaTeX_Main-BoldItalic.e3f82f9d.woff +0 -0
  130. package/webview/dist/static/media/KaTeX_Main-Italic.47373d1e.ttf +0 -0
  131. package/webview/dist/static/media/KaTeX_Main-Italic.8916142b.woff2 +0 -0
  132. package/webview/dist/static/media/KaTeX_Main-Italic.9024d815.woff +0 -0
  133. package/webview/dist/static/media/KaTeX_Main-Regular.0462f03b.woff2 +0 -0
  134. package/webview/dist/static/media/KaTeX_Main-Regular.7f51fe03.woff +0 -0
  135. package/webview/dist/static/media/KaTeX_Main-Regular.b7f8fe9b.ttf +0 -0
  136. package/webview/dist/static/media/KaTeX_Math-BoldItalic.572d331f.woff2 +0 -0
  137. package/webview/dist/static/media/KaTeX_Math-BoldItalic.a879cf83.ttf +0 -0
  138. package/webview/dist/static/media/KaTeX_Math-BoldItalic.f1035d8d.woff +0 -0
  139. package/webview/dist/static/media/KaTeX_Math-Italic.5295ba48.woff +0 -0
  140. package/webview/dist/static/media/KaTeX_Math-Italic.939bc644.ttf +0 -0
  141. package/webview/dist/static/media/KaTeX_Math-Italic.f28c23ac.woff2 +0 -0
  142. package/webview/dist/static/media/KaTeX_SansSerif-Bold.8c5b5494.woff2 +0 -0
  143. package/webview/dist/static/media/KaTeX_SansSerif-Bold.94e1e8dc.ttf +0 -0
  144. package/webview/dist/static/media/KaTeX_SansSerif-Bold.bf59d231.woff +0 -0
  145. package/webview/dist/static/media/KaTeX_SansSerif-Italic.3b1e59b3.woff2 +0 -0
  146. package/webview/dist/static/media/KaTeX_SansSerif-Italic.7c9bc82b.woff +0 -0
  147. package/webview/dist/static/media/KaTeX_SansSerif-Italic.b4c20c84.ttf +0 -0
  148. package/webview/dist/static/media/KaTeX_SansSerif-Regular.74048478.woff +0 -0
  149. package/webview/dist/static/media/KaTeX_SansSerif-Regular.ba21ed5f.woff2 +0 -0
  150. package/webview/dist/static/media/KaTeX_SansSerif-Regular.d4d7ba48.ttf +0 -0
  151. package/webview/dist/static/media/KaTeX_Script-Regular.03e9641d.woff2 +0 -0
  152. package/webview/dist/static/media/KaTeX_Script-Regular.07505710.woff +0 -0
  153. package/webview/dist/static/media/KaTeX_Script-Regular.fe9cbbe1.ttf +0 -0
  154. package/webview/dist/static/media/KaTeX_Size1-Regular.e1e279cb.woff +0 -0
  155. package/webview/dist/static/media/KaTeX_Size1-Regular.eae34984.woff2 +0 -0
  156. package/webview/dist/static/media/KaTeX_Size1-Regular.fabc004a.ttf +0 -0
  157. package/webview/dist/static/media/KaTeX_Size2-Regular.57727022.woff +0 -0
  158. package/webview/dist/static/media/KaTeX_Size2-Regular.5916a24f.woff2 +0 -0
  159. package/webview/dist/static/media/KaTeX_Size2-Regular.d6b476ec.ttf +0 -0
  160. package/webview/dist/static/media/KaTeX_Size3-Regular.9acaf01c.woff +0 -0
  161. package/webview/dist/static/media/KaTeX_Size3-Regular.a144ef58.ttf +0 -0
  162. package/webview/dist/static/media/KaTeX_Size3-Regular.b4230e7e.woff2 +0 -0
  163. package/webview/dist/static/media/KaTeX_Size4-Regular.10d95fd3.woff2 +0 -0
  164. package/webview/dist/static/media/KaTeX_Size4-Regular.7a996c9d.woff +0 -0
  165. package/webview/dist/static/media/KaTeX_Size4-Regular.fbccdabe.ttf +0 -0
  166. package/webview/dist/static/media/KaTeX_Typewriter-Regular.6258592b.woff +0 -0
  167. package/webview/dist/static/media/KaTeX_Typewriter-Regular.a8709e36.woff2 +0 -0
  168. package/webview/dist/static/media/KaTeX_Typewriter-Regular.d97aaf4a.ttf +0 -0
@@ -0,0 +1 @@
1
+ (self.rspackChunkchat_demo=self.rspackChunkchat_demo||[]).push([[4568],{2987(){!function(n){function e(n){return RegExp("((?:^|[^\\\\])(?:\\\\{2})*)(?:"+(n=n.replace(/<inner>/g,function(){return"(?:\\\\.|[^\\\\\n\r]|(?:\n|\r\n?)(?![\r\n]))"}))+")")}var t="(?:\\\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\\\|\r\n`])+",a="\\|?__(?:\\|__)+\\|?(?:(?:\n|\r\n?)|(?![^]))".replace(/__/g,function(){return t}),i="\\|?[ ]*:?-{3,}:?[ ]*(?:\\|[ ]*:?-{3,}:?[ ]*)+\\|?(?:\n|\r\n?)";n.languages.markdown=n.languages.extend("markup",{}),n.languages.insertBefore("markdown","prolog",{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:["yaml","language-yaml"],inside:n.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+a+i+"(?:"+a+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+a+i+")(?:"+a+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(t),inside:n.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+a+")"+i+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+a+"$"),inside:{"table-header":{pattern:RegExp(t),alias:"important",inside:n.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:e("\\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\\b|\\*\\*(?:(?!\\*)<inner>|\\*(?:(?!\\*)<inner>)+\\*)+\\*\\*"),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:e("\\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\\b|\\*(?:(?!\\*)<inner>|\\*\\*(?:(?!\\*)<inner>)+\\*\\*)+\\*"),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:e("(~~?)(?:(?!~)<inner>)+\\2"),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:["code","keyword"]},url:{pattern:e('!?\\[(?:(?!\\])<inner>)+\\](?:\\([^\\s)]+(?:[ ]+"(?:\\\\.|[^"\\\\])*")?\\)|[ ]?\\[(?:(?!\\])<inner>)+\\])'),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),["url","bold","italic","strike"].forEach(function(e){["url","bold","italic","strike","code-snippet"].forEach(function(t){e!==t&&(n.languages.markdown[e].inside.content.inside[t]=n.languages.markdown[t])})}),n.hooks.add("after-tokenize",function(n){"markdown"!==n.language&&"md"!==n.language||function n(e){if(e&&"string"!=typeof e)for(var t=0,a=e.length;t<a;t++){var i=e[t];if("code"===i.type){var r=i.content[1],o=i.content[3];if(r&&o&&"code-language"===r.type&&"code-block"===o.type&&"string"==typeof r.content){var l=r.content.replace(/\b#/g,"sharp").replace(/\b\+\+/g,"pp"),s="language-"+(l=(/[a-z][\w-]*/i.exec(l)||[""])[0].toLowerCase());o.alias?"string"==typeof o.alias?o.alias=[o.alias,s]:o.alias.push(s):o.alias=[s]}}else n(i.content)}}(n.tokens)}),n.hooks.add("wrap",function(e){if("code-block"===e.type){for(var t="",a=0,i=e.classes.length;a<i;a++){var s=e.classes[a],d=/language-(.+)/.exec(s);if(d){t=d[1];break}}var p=n.languages[t];if(p)e.content=n.highlight(e.content.replace(r,"").replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi,function(n,e){return"#"===(e=e.toLowerCase())[0]?l("x"===e[1]?parseInt(e.slice(2),16):Number(e.slice(1))):o[e]||n}),p,t);else if(t&&"none"!==t&&n.plugins.autoloader){var u="md-"+(new Date).valueOf()+"-"+Math.floor(1e16*Math.random());e.attributes.id=u,n.plugins.autoloader.loadLanguages(t,function(){var e=document.getElementById(u);e&&(e.innerHTML=n.highlight(e.textContent,n.languages[t],t))})}}});var r=RegExp(n.languages.markup.tag.pattern.source,"gi"),o={amp:"&",lt:"<",gt:">",quot:'"'},l=String.fromCodePoint||String.fromCharCode;n.languages.md=n.languages.markdown}(Prism)}}]);
@@ -0,0 +1,131 @@
1
+ "use strict";(self.rspackChunkchat_demo=self.rspackChunkchat_demo||[]).push([[4580],{124(t,e,r){r.d(e,{A:()=>s});var a=r(5566),i=r(8479);let s=(t,e)=>a.A.lang.round(i.A.parse(t)[e])},1807(t,e,r){r.d(e,{A:()=>i});var a=r(1208);let i=function(t){return(0,a.A)(t,4)}},8767(t,e,r){r.d(e,{diagram:()=>ed});var a=r(8987),i=r(5939),s=r(5040),n=r(3919),l=r(3218),o=r(8755),d=r(1807),c=r(124),h=r(941),g=r(6040),y=r(7420),u=r(2631),p=function(){var t=(0,o.K2)(function(t,e,r,a){for(r=r||{},a=t.length;a--;r[t[a]]=e);return r},"o"),e=[1,15],r=[1,7],a=[1,13],i=[1,14],s=[1,19],n=[1,16],l=[1,17],d=[1,18],c=[8,30],h=[8,10,21,28,29,30,31,39,43,46],g=[1,23],y=[1,24],u=[8,10,15,16,21,28,29,30,31,39,43,46],p=[8,10,15,16,21,27,28,29,30,31,39,43,46],x=[1,49],b={trace:(0,o.K2)(function(){},"trace"),yy:{},symbols_:{error:2,spaceLines:3,SPACELINE:4,NL:5,separator:6,SPACE:7,EOF:8,start:9,BLOCK_DIAGRAM_KEY:10,document:11,stop:12,statement:13,link:14,LINK:15,START_LINK:16,LINK_LABEL:17,STR:18,nodeStatement:19,columnsStatement:20,SPACE_BLOCK:21,blockStatement:22,classDefStatement:23,cssClassStatement:24,styleStatement:25,node:26,SIZE:27,COLUMNS:28,"id-block":29,end:30,NODE_ID:31,nodeShapeNLabel:32,dirList:33,DIR:34,NODE_DSTART:35,NODE_DEND:36,BLOCK_ARROW_START:37,BLOCK_ARROW_END:38,classDef:39,CLASSDEF_ID:40,CLASSDEF_STYLEOPTS:41,DEFAULT:42,class:43,CLASSENTITY_IDS:44,STYLECLASS:45,style:46,STYLE_ENTITY_IDS:47,STYLE_DEFINITION_DATA:48,$accept:0,$end:1},terminals_:{2:"error",4:"SPACELINE",5:"NL",7:"SPACE",8:"EOF",10:"BLOCK_DIAGRAM_KEY",15:"LINK",16:"START_LINK",17:"LINK_LABEL",18:"STR",21:"SPACE_BLOCK",27:"SIZE",28:"COLUMNS",29:"id-block",30:"end",31:"NODE_ID",34:"DIR",35:"NODE_DSTART",36:"NODE_DEND",37:"BLOCK_ARROW_START",38:"BLOCK_ARROW_END",39:"classDef",40:"CLASSDEF_ID",41:"CLASSDEF_STYLEOPTS",42:"DEFAULT",43:"class",44:"CLASSENTITY_IDS",45:"STYLECLASS",46:"style",47:"STYLE_ENTITY_IDS",48:"STYLE_DEFINITION_DATA"},productions_:[0,[3,1],[3,2],[3,2],[6,1],[6,1],[6,1],[9,3],[12,1],[12,1],[12,2],[12,2],[11,1],[11,2],[14,1],[14,4],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[19,3],[19,2],[19,1],[20,1],[22,4],[22,3],[26,1],[26,2],[33,1],[33,2],[32,3],[32,4],[23,3],[23,3],[24,3],[25,3]],performAction:(0,o.K2)(function(t,e,r,a,i,s,n){var l=s.length-1;switch(i){case 4:a.getLogger().debug("Rule: separator (NL) ");break;case 5:a.getLogger().debug("Rule: separator (Space) ");break;case 6:a.getLogger().debug("Rule: separator (EOF) ");break;case 7:a.getLogger().debug("Rule: hierarchy: ",s[l-1]),a.setHierarchy(s[l-1]);break;case 8:a.getLogger().debug("Stop NL ");break;case 9:a.getLogger().debug("Stop EOF ");break;case 10:a.getLogger().debug("Stop NL2 ");break;case 11:a.getLogger().debug("Stop EOF2 ");break;case 12:a.getLogger().debug("Rule: statement: ",s[l]),"number"==typeof s[l].length?this.$=s[l]:this.$=[s[l]];break;case 13:a.getLogger().debug("Rule: statement #2: ",s[l-1]),this.$=[s[l-1]].concat(s[l]);break;case 14:a.getLogger().debug("Rule: link: ",s[l],t),this.$={edgeTypeStr:s[l],label:""};break;case 15:a.getLogger().debug("Rule: LABEL link: ",s[l-3],s[l-1],s[l]),this.$={edgeTypeStr:s[l],label:s[l-1]};break;case 18:let o=parseInt(s[l]),d=a.generateId();this.$={id:d,type:"space",label:"",width:o,children:[]};break;case 23:a.getLogger().debug("Rule: (nodeStatement link node) ",s[l-2],s[l-1],s[l]," typestr: ",s[l-1].edgeTypeStr);let c=a.edgeStrToEdgeData(s[l-1].edgeTypeStr);this.$=[{id:s[l-2].id,label:s[l-2].label,type:s[l-2].type,directions:s[l-2].directions},{id:s[l-2].id+"-"+s[l].id,start:s[l-2].id,end:s[l].id,label:s[l-1].label,type:"edge",directions:s[l].directions,arrowTypeEnd:c,arrowTypeStart:"arrow_open"},{id:s[l].id,label:s[l].label,type:a.typeStr2Type(s[l].typeStr),directions:s[l].directions}];break;case 24:a.getLogger().debug("Rule: nodeStatement (abc88 node size) ",s[l-1],s[l]),this.$={id:s[l-1].id,label:s[l-1].label,type:a.typeStr2Type(s[l-1].typeStr),directions:s[l-1].directions,widthInColumns:parseInt(s[l],10)};break;case 25:a.getLogger().debug("Rule: nodeStatement (node) ",s[l]),this.$={id:s[l].id,label:s[l].label,type:a.typeStr2Type(s[l].typeStr),directions:s[l].directions,widthInColumns:1};break;case 26:a.getLogger().debug("APA123",this?this:"na"),a.getLogger().debug("COLUMNS: ",s[l]),this.$={type:"column-setting",columns:"auto"===s[l]?-1:parseInt(s[l])};break;case 27:a.getLogger().debug("Rule: id-block statement : ",s[l-2],s[l-1]),a.generateId(),this.$={...s[l-2],type:"composite",children:s[l-1]};break;case 28:a.getLogger().debug("Rule: blockStatement : ",s[l-2],s[l-1],s[l]);let h=a.generateId();this.$={id:h,type:"composite",label:"",children:s[l-1]};break;case 29:a.getLogger().debug("Rule: node (NODE_ID separator): ",s[l]),this.$={id:s[l]};break;case 30:a.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ",s[l-1],s[l]),this.$={id:s[l-1],label:s[l].label,typeStr:s[l].typeStr,directions:s[l].directions};break;case 31:a.getLogger().debug("Rule: dirList: ",s[l]),this.$=[s[l]];break;case 32:a.getLogger().debug("Rule: dirList: ",s[l-1],s[l]),this.$=[s[l-1]].concat(s[l]);break;case 33:a.getLogger().debug("Rule: nodeShapeNLabel: ",s[l-2],s[l-1],s[l]),this.$={typeStr:s[l-2]+s[l],label:s[l-1]};break;case 34:a.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ",s[l-3],s[l-2]," #3:",s[l-1],s[l]),this.$={typeStr:s[l-3]+s[l],label:s[l-2],directions:s[l-1]};break;case 35:case 36:this.$={type:"classDef",id:s[l-1].trim(),css:s[l].trim()};break;case 37:this.$={type:"applyClass",id:s[l-1].trim(),styleClass:s[l].trim()};break;case 38:this.$={type:"applyStyles",id:s[l-1].trim(),stylesStr:s[l].trim()}}},"anonymous"),table:[{9:1,10:[1,2]},{1:[3]},{10:e,11:3,13:4,19:5,20:6,21:r,22:8,23:9,24:10,25:11,26:12,28:a,29:i,31:s,39:n,43:l,46:d},{8:[1,20]},t(c,[2,12],{13:4,19:5,20:6,22:8,23:9,24:10,25:11,26:12,11:21,10:e,21:r,28:a,29:i,31:s,39:n,43:l,46:d}),t(h,[2,16],{14:22,15:g,16:y}),t(h,[2,17]),t(h,[2,18]),t(h,[2,19]),t(h,[2,20]),t(h,[2,21]),t(h,[2,22]),t(u,[2,25],{27:[1,25]}),t(h,[2,26]),{19:26,26:12,31:s},{10:e,11:27,13:4,19:5,20:6,21:r,22:8,23:9,24:10,25:11,26:12,28:a,29:i,31:s,39:n,43:l,46:d},{40:[1,28],42:[1,29]},{44:[1,30]},{47:[1,31]},t(p,[2,29],{32:32,35:[1,33],37:[1,34]}),{1:[2,7]},t(c,[2,13]),{26:35,31:s},{31:[2,14]},{17:[1,36]},t(u,[2,24]),{10:e,11:37,13:4,14:22,15:g,16:y,19:5,20:6,21:r,22:8,23:9,24:10,25:11,26:12,28:a,29:i,31:s,39:n,43:l,46:d},{30:[1,38]},{41:[1,39]},{41:[1,40]},{45:[1,41]},{48:[1,42]},t(p,[2,30]),{18:[1,43]},{18:[1,44]},t(u,[2,23]),{18:[1,45]},{30:[1,46]},t(h,[2,28]),t(h,[2,35]),t(h,[2,36]),t(h,[2,37]),t(h,[2,38]),{36:[1,47]},{33:48,34:x},{15:[1,50]},t(h,[2,27]),t(p,[2,33]),{38:[1,51]},{33:52,34:x,38:[2,31]},{31:[2,15]},t(p,[2,34]),{38:[2,32]}],defaultActions:{20:[2,7],23:[2,14],50:[2,15],52:[2,32]},parseError:(0,o.K2)(function(t,e){if(e.recoverable)this.trace(t);else{var r=Error(t);throw r.hash=e,r}},"parseError"),parse:(0,o.K2)(function(t){var e=this,r=[0],a=[],i=[null],s=[],n=this.table,l="",d=0,c=0,h=0,g=s.slice.call(arguments,1),y=Object.create(this.lexer),u={};for(var p in this.yy)Object.prototype.hasOwnProperty.call(this.yy,p)&&(u[p]=this.yy[p]);y.setInput(t,u),u.lexer=y,u.parser=this,void 0===y.yylloc&&(y.yylloc={});var x=y.yylloc;s.push(x);var b=y.options&&y.options.ranges;function f(){var t;return"number"!=typeof(t=a.pop()||y.lex()||1)&&(t instanceof Array&&(t=(a=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof u.parseError?this.parseError=u.parseError:this.parseError=Object.getPrototypeOf(this).parseError,(0,o.K2)(function(t){r.length=r.length-2*t,i.length=i.length-t,s.length=s.length-t},"popStack"),(0,o.K2)(f,"lex");for(var m,w,L,k,S,_,E,D,R,K={};;){if(L=r[r.length-1],this.defaultActions[L]?k=this.defaultActions[L]:(null==m&&(m=f()),k=n[L]&&n[L][m]),void 0===k||!k.length||!k[0]){var $="";for(_ in R=[],n[L])this.terminals_[_]&&_>2&&R.push("'"+this.terminals_[_]+"'");$=y.showPosition?"Parse error on line "+(d+1)+":\n"+y.showPosition()+"\nExpecting "+R.join(", ")+", got '"+(this.terminals_[m]||m)+"'":"Parse error on line "+(d+1)+": Unexpected "+(1==m?"end of input":"'"+(this.terminals_[m]||m)+"'"),this.parseError($,{text:y.match,token:this.terminals_[m]||m,line:y.yylineno,loc:x,expected:R})}if(k[0]instanceof Array&&k.length>1)throw Error("Parse Error: multiple actions possible at state: "+L+", token: "+m);switch(k[0]){case 1:r.push(m),i.push(y.yytext),s.push(y.yylloc),r.push(k[1]),m=null,w?(m=w,w=null):(c=y.yyleng,l=y.yytext,d=y.yylineno,x=y.yylloc,h>0&&h--);break;case 2:if(E=this.productions_[k[1]][1],K.$=i[i.length-E],K._$={first_line:s[s.length-(E||1)].first_line,last_line:s[s.length-1].last_line,first_column:s[s.length-(E||1)].first_column,last_column:s[s.length-1].last_column},b&&(K._$.range=[s[s.length-(E||1)].range[0],s[s.length-1].range[1]]),void 0!==(S=this.performAction.apply(K,[l,c,d,u,k[1],i,s].concat(g))))return S;E&&(r=r.slice(0,-1*E*2),i=i.slice(0,-1*E),s=s.slice(0,-1*E)),r.push(this.productions_[k[1]][0]),i.push(K.$),s.push(K._$),D=n[r[r.length-2]][r[r.length-1]],r.push(D);break;case 3:return!0}}return!0},"parse")};function f(){this.yy={}}return b.lexer={EOF:1,parseError:(0,o.K2)(function(t,e){if(this.yy.parser)this.yy.parser.parseError(t,e);else throw Error(t)},"parseError"),setInput:(0,o.K2)(function(t,e){return this.yy=e||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={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:(0,o.K2)(function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},"input"),unput:(0,o.K2)(function(t){var e=t.length,r=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var a=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),r.length-1&&(this.yylineno-=r.length-1);var i=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:r?(r.length===a.length?this.yylloc.first_column:0)+a[a.length-r.length].length-r[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},"unput"),more:(0,o.K2)(function(){return this._more=!0,this},"more"),reject:(0,o.K2)(function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):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).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"reject"),less:(0,o.K2)(function(t){this.unput(this.match.slice(t))},"less"),pastInput:(0,o.K2)(function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:(0,o.K2)(function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:(0,o.K2)(function(){var t=this.pastInput(),e=Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},"showPosition"),test_match:(0,o.K2)(function(t,e){var r,a,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),(a=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=a.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:a?a[a.length-1].length-a[a.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},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],r=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),r)return r;if(this._backtrack)for(var s in i)this[s]=i[s];return!1},"test_match"),next:(0,o.K2)(function(){if(this.done)return this.EOF;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var t,e,r,a,i=this._currentRules(),s=0;s<i.length;s++)if((r=this._input.match(this.rules[i[s]]))&&(!e||r[0].length>e[0].length)){if(e=r,a=s,this.options.backtrack_lexer){if(!1!==(t=this.test_match(r,i[s])))return t;if(!this._backtrack)return!1;e=!1;continue}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,i[a]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:(0,o.K2)(function(){var t=this.next();return t||this.lex()},"lex"),begin:(0,o.K2)(function(t){this.conditionStack.push(t)},"begin"),popState:(0,o.K2)(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:(0,o.K2)(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:(0,o.K2)(function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},"topState"),pushState:(0,o.K2)(function(t){this.begin(t)},"pushState"),stateStackSize:(0,o.K2)(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:(0,o.K2)(function(t,e,r,a){switch(r){case 0:return t.getLogger().debug("Found block-beta"),10;case 1:return t.getLogger().debug("Found id-block"),29;case 2:return t.getLogger().debug("Found block"),10;case 3:t.getLogger().debug(".",e.yytext);break;case 4:t.getLogger().debug("_",e.yytext);break;case 5:return 5;case 6:return e.yytext=-1,28;case 7:return e.yytext=e.yytext.replace(/columns\s+/,""),t.getLogger().debug("COLUMNS (LEX)",e.yytext),28;case 8:case 76:case 77:case 99:this.pushState("md_string");break;case 9:return"MD_STR";case 10:case 34:case 79:this.popState();break;case 11:this.pushState("string");break;case 12:t.getLogger().debug("LEX: POPPING STR:",e.yytext),this.popState();break;case 13:return t.getLogger().debug("LEX: STR end:",e.yytext),"STR";case 14:return e.yytext=e.yytext.replace(/space\:/,""),t.getLogger().debug("SPACE NUM (LEX)",e.yytext),21;case 15:return e.yytext="1",t.getLogger().debug("COLUMNS (LEX)",e.yytext),21;case 16:return 42;case 17:return"LINKSTYLE";case 18:return"INTERPOLATE";case 19:return this.pushState("CLASSDEF"),39;case 20:return this.popState(),this.pushState("CLASSDEFID"),"DEFAULT_CLASSDEF_ID";case 21:return this.popState(),this.pushState("CLASSDEFID"),40;case 22:return this.popState(),41;case 23:return this.pushState("CLASS"),43;case 24:return this.popState(),this.pushState("CLASS_STYLE"),44;case 25:return this.popState(),45;case 26:return this.pushState("STYLE_STMNT"),46;case 27:return this.popState(),this.pushState("STYLE_DEFINITION"),47;case 28:return this.popState(),48;case 29:return this.pushState("acc_title"),"acc_title";case 30:return this.popState(),"acc_title_value";case 31:return this.pushState("acc_descr"),"acc_descr";case 32:return this.popState(),"acc_descr_value";case 33:this.pushState("acc_descr_multiline");break;case 35:return"acc_descr_multiline_value";case 36:return 30;case 37:case 38:case 40:case 41:case 44:return this.popState(),t.getLogger().debug("Lex: (("),"NODE_DEND";case 39:return this.popState(),t.getLogger().debug("Lex: ))"),"NODE_DEND";case 42:return this.popState(),t.getLogger().debug("Lex: (-"),"NODE_DEND";case 43:return this.popState(),t.getLogger().debug("Lex: -)"),"NODE_DEND";case 45:return this.popState(),t.getLogger().debug("Lex: ]]"),"NODE_DEND";case 46:return this.popState(),t.getLogger().debug("Lex: ("),"NODE_DEND";case 47:return this.popState(),t.getLogger().debug("Lex: ])"),"NODE_DEND";case 48:case 49:return this.popState(),t.getLogger().debug("Lex: /]"),"NODE_DEND";case 50:return this.popState(),t.getLogger().debug("Lex: )]"),"NODE_DEND";case 51:return this.popState(),t.getLogger().debug("Lex: )"),"NODE_DEND";case 52:return this.popState(),t.getLogger().debug("Lex: ]>"),"NODE_DEND";case 53:return this.popState(),t.getLogger().debug("Lex: ]"),"NODE_DEND";case 54:return t.getLogger().debug("Lexa: -)"),this.pushState("NODE"),35;case 55:return t.getLogger().debug("Lexa: (-"),this.pushState("NODE"),35;case 56:return t.getLogger().debug("Lexa: ))"),this.pushState("NODE"),35;case 57:case 59:case 60:case 61:case 64:return t.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 58:return t.getLogger().debug("Lex: ((("),this.pushState("NODE"),35;case 62:return t.getLogger().debug("Lexc: >"),this.pushState("NODE"),35;case 63:return t.getLogger().debug("Lexa: (["),this.pushState("NODE"),35;case 65:case 66:case 67:case 68:case 69:case 70:case 71:return this.pushState("NODE"),35;case 72:return t.getLogger().debug("Lexa: ["),this.pushState("NODE"),35;case 73:return this.pushState("BLOCK_ARROW"),t.getLogger().debug("LEX ARR START"),37;case 74:return t.getLogger().debug("Lex: NODE_ID",e.yytext),31;case 75:return t.getLogger().debug("Lex: EOF",e.yytext),8;case 78:return"NODE_DESCR";case 80:t.getLogger().debug("Lex: Starting string"),this.pushState("string");break;case 81:t.getLogger().debug("LEX ARR: Starting string"),this.pushState("string");break;case 82:return t.getLogger().debug("LEX: NODE_DESCR:",e.yytext),"NODE_DESCR";case 83:t.getLogger().debug("LEX POPPING"),this.popState();break;case 84:t.getLogger().debug("Lex: =>BAE"),this.pushState("ARROW_DIR");break;case 85:return e.yytext=e.yytext.replace(/^,\s*/,""),t.getLogger().debug("Lex (right): dir:",e.yytext),"DIR";case 86:return e.yytext=e.yytext.replace(/^,\s*/,""),t.getLogger().debug("Lex (left):",e.yytext),"DIR";case 87:return e.yytext=e.yytext.replace(/^,\s*/,""),t.getLogger().debug("Lex (x):",e.yytext),"DIR";case 88:return e.yytext=e.yytext.replace(/^,\s*/,""),t.getLogger().debug("Lex (y):",e.yytext),"DIR";case 89:return e.yytext=e.yytext.replace(/^,\s*/,""),t.getLogger().debug("Lex (up):",e.yytext),"DIR";case 90:return e.yytext=e.yytext.replace(/^,\s*/,""),t.getLogger().debug("Lex (down):",e.yytext),"DIR";case 91:return e.yytext="]>",t.getLogger().debug("Lex (ARROW_DIR end):",e.yytext),this.popState(),this.popState(),"BLOCK_ARROW_END";case 92:return t.getLogger().debug("Lex: LINK","#"+e.yytext+"#"),15;case 93:case 94:case 95:return t.getLogger().debug("Lex: LINK",e.yytext),15;case 96:case 97:case 98:return t.getLogger().debug("Lex: START_LINK",e.yytext),this.pushState("LLABEL"),16;case 100:return t.getLogger().debug("Lex: Starting string"),this.pushState("string"),"LINK_LABEL";case 101:return this.popState(),t.getLogger().debug("Lex: LINK","#"+e.yytext+"#"),15;case 102:case 103:return this.popState(),t.getLogger().debug("Lex: LINK",e.yytext),15;case 104:return t.getLogger().debug("Lex: COLON",e.yytext),e.yytext=e.yytext.slice(1),27}},"anonymous"),rules:[/^(?:block-beta\b)/,/^(?:block:)/,/^(?:block\b)/,/^(?:[\s]+)/,/^(?:[\n]+)/,/^(?:((\u000D\u000A)|(\u000A)))/,/^(?:columns\s+auto\b)/,/^(?:columns\s+[\d]+)/,/^(?:["][`])/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:space[:]\d+)/,/^(?:space\b)/,/^(?:default\b)/,/^(?:linkStyle\b)/,/^(?:interpolate\b)/,/^(?:classDef\s+)/,/^(?:DEFAULT\s+)/,/^(?:\w+\s+)/,/^(?:[^\n]*)/,/^(?:class\s+)/,/^(?:(\w+)+((,\s*\w+)*))/,/^(?:[^\n]*)/,/^(?:style\s+)/,/^(?:(\w+)+((,\s*\w+)*))/,/^(?:[^\n]*)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:end\b\s*)/,/^(?:\(\(\()/,/^(?:\)\)\))/,/^(?:[\)]\))/,/^(?:\}\})/,/^(?:\})/,/^(?:\(-)/,/^(?:-\))/,/^(?:\(\()/,/^(?:\]\])/,/^(?:\()/,/^(?:\]\))/,/^(?:\\\])/,/^(?:\/\])/,/^(?:\)\])/,/^(?:[\)])/,/^(?:\]>)/,/^(?:[\]])/,/^(?:-\))/,/^(?:\(-)/,/^(?:\)\))/,/^(?:\))/,/^(?:\(\(\()/,/^(?:\(\()/,/^(?:\{\{)/,/^(?:\{)/,/^(?:>)/,/^(?:\(\[)/,/^(?:\()/,/^(?:\[\[)/,/^(?:\[\|)/,/^(?:\[\()/,/^(?:\)\)\))/,/^(?:\[\\)/,/^(?:\[\/)/,/^(?:\[\\)/,/^(?:\[)/,/^(?:<\[)/,/^(?:[^\(\[\n\-\)\{\}\s\<\>:]+)/,/^(?:$)/,/^(?:["][`])/,/^(?:["][`])/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["])/,/^(?:["])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:\]>\s*\()/,/^(?:,?\s*right\s*)/,/^(?:,?\s*left\s*)/,/^(?:,?\s*x\s*)/,/^(?:,?\s*y\s*)/,/^(?:,?\s*up\s*)/,/^(?:,?\s*down\s*)/,/^(?:\)\s*)/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?:\s*~~[\~]+\s*)/,/^(?:\s*[xo<]?--\s*)/,/^(?:\s*[xo<]?==\s*)/,/^(?:\s*[xo<]?-\.\s*)/,/^(?:["][`])/,/^(?:["])/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?::\d+)/],conditions:{STYLE_DEFINITION:{rules:[28],inclusive:!1},STYLE_STMNT:{rules:[27],inclusive:!1},CLASSDEFID:{rules:[22],inclusive:!1},CLASSDEF:{rules:[20,21],inclusive:!1},CLASS_STYLE:{rules:[25],inclusive:!1},CLASS:{rules:[24],inclusive:!1},LLABEL:{rules:[99,100,101,102,103],inclusive:!1},ARROW_DIR:{rules:[85,86,87,88,89,90,91],inclusive:!1},BLOCK_ARROW:{rules:[76,81,84],inclusive:!1},NODE:{rules:[37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,77,80],inclusive:!1},md_string:{rules:[9,10,78,79],inclusive:!1},space:{rules:[],inclusive:!1},string:{rules:[12,13,82,83],inclusive:!1},acc_descr_multiline:{rules:[34,35],inclusive:!1},acc_descr:{rules:[32],inclusive:!1},acc_title:{rules:[30],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,11,14,15,16,17,18,19,23,26,29,31,33,36,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,92,93,94,95,96,97,98,104],inclusive:!0}}},(0,o.K2)(f,"Parser"),f.prototype=b,b.Parser=f,new f}();p.parser=p;var x=new Map,b=[],f=new Map,m="color",w="fill",L=(0,o.D7)(),k=new Map,S=(0,o.K2)(t=>o.Y2.sanitizeText(t,L),"sanitizeText"),_=(0,o.K2)(function(t,e=""){let r=k.get(t);r||(r={id:t,styles:[],textStyles:[]},k.set(t,r)),null!=e&&e.split(",").forEach(t=>{let e=t.replace(/([^;]*);/,"$1").trim();if(RegExp(m).exec(t)){let t=e.replace(w,"bgFill").replace(m,w);r.textStyles.push(t)}r.styles.push(e)})},"addStyleClass"),E=(0,o.K2)(function(t,e=""){let r=x.get(t);null!=e&&(r.styles=e.split(","))},"addStyle2Node"),D=(0,o.K2)(function(t,e){t.split(",").forEach(function(t){let r=x.get(t);if(void 0===r){let e=t.trim();r={id:e,type:"na",children:[]},x.set(e,r)}r.classes||(r.classes=[]),r.classes.push(e)})},"setCssClass"),R=(0,o.K2)((t,e)=>{let r=t.flat(),a=[],i=r.find(t=>t?.type==="column-setting"),s=i?.columns??-1;for(let t of r){if("number"==typeof s&&s>0&&"column-setting"!==t.type&&"number"==typeof t.widthInColumns&&t.widthInColumns>s&&o.Rm.warn(`Block ${t.id} width ${t.widthInColumns} exceeds configured column width ${s}`),t.label&&(t.label=S(t.label)),"classDef"===t.type){_(t.id,t.css);continue}if("applyClass"===t.type){D(t.id,t?.styleClass??"");continue}if("applyStyles"===t.type){t?.stylesStr&&E(t.id,t?.stylesStr);continue}if("column-setting"===t.type)e.columns=t.columns??-1;else if("edge"===t.type){let e=(f.get(t.id)??0)+1;f.set(t.id,e),t.id=e+"-"+t.id,b.push(t)}else{t.label||("composite"===t.type?t.label="":t.label=t.id);let e=x.get(t.id);if(void 0===e?x.set(t.id,t):("na"!==t.type&&(e.type=t.type),t.label!==t.id&&(e.label=t.label)),t.children&&R(t.children,t),"space"===t.type){let e=t.width??1;for(let r=0;r<e;r++){let e=(0,d.A)(t);e.id=e.id+"-"+r,x.set(e.id,e),a.push(e)}}else void 0===e&&a.push(t)}}e.children=a},"populateBlockDatabase"),K=[],$={id:"root",type:"composite",children:[],columns:-1},C=(0,o.K2)(()=>{o.Rm.debug("Clear called"),(0,o.IU)(),x=new Map([["root",$={id:"root",type:"composite",children:[],columns:-1}]]),K=[],k=new Map,b=[],f=new Map},"clear");function v(t){switch(o.Rm.debug("typeStr2Type",t),t){case"[]":return"square";case"()":return o.Rm.debug("we have a round"),"round";case"(())":return"circle";case">]":return"rect_left_inv_arrow";case"{}":return"diamond";case"{{}}":return"hexagon";case"([])":return"stadium";case"[[]]":return"subroutine";case"[()]":return"cylinder";case"((()))":return"doublecircle";case"[//]":return"lean_right";case"[\\\\]":return"lean_left";case"[/\\]":return"trapezoid";case"[\\/]":return"inv_trapezoid";case"<[]>":return"block_arrow";default:return"na"}}function T(t){return(o.Rm.debug("typeStr2Type",t),"=="===t)?"thick":"normal"}function N(t){switch(t.replace(/^[\s-]+|[\s-]+$/g,"")){case"x":return"arrow_cross";case"o":return"arrow_circle";case">":return"arrow_point";default:return""}}(0,o.K2)(v,"typeStr2Type"),(0,o.K2)(T,"edgeTypeStr2Type"),(0,o.K2)(N,"edgeStrToEdgeData");var I=0,B=(0,o.K2)(()=>(I++,"id-"+Math.random().toString(36).substr(2,12)+"-"+I),"generateId"),z=(0,o.K2)(t=>{$.children=t,R(t,$),K=$.children},"setHierarchy"),A=(0,o.K2)(t=>{let e=x.get(t);return e?e.columns?e.columns:e.children?e.children.length:-1:-1},"getColumns"),O=(0,o.K2)(()=>[...x.values()],"getBlocksFlat"),M=(0,o.K2)(()=>K||[],"getBlocks"),P=(0,o.K2)(()=>b,"getEdges"),Y=(0,o.K2)(t=>x.get(t),"getBlock"),W=(0,o.K2)(t=>{x.set(t.id,t)},"setBlock"),F=(0,o.K2)(()=>o.Rm,"getLogger"),X=(0,o.K2)(function(){return k},"getClasses"),j={getConfig:(0,o.K2)(()=>(0,o.zj)().block,"getConfig"),typeStr2Type:v,edgeTypeStr2Type:T,edgeStrToEdgeData:N,getLogger:F,getBlocksFlat:O,getBlocks:M,getEdges:P,setHierarchy:z,getBlock:Y,setBlock:W,getColumns:A,getClasses:X,clear:C,generateId:B},U=(0,o.K2)((t,e)=>{let r=c.A,a=r(t,"r"),i=r(t,"g"),s=r(t,"b");return h.A(a,i,s,e)},"fade"),H=(0,o.K2)(t=>`.label {
2
+ font-family: ${t.fontFamily};
3
+ color: ${t.nodeTextColor||t.textColor};
4
+ }
5
+ .cluster-label text {
6
+ fill: ${t.titleColor};
7
+ }
8
+ .cluster-label span,p {
9
+ color: ${t.titleColor};
10
+ }
11
+
12
+
13
+
14
+ .label text,span,p {
15
+ fill: ${t.nodeTextColor||t.textColor};
16
+ color: ${t.nodeTextColor||t.textColor};
17
+ }
18
+
19
+ .node rect,
20
+ .node circle,
21
+ .node ellipse,
22
+ .node polygon,
23
+ .node path {
24
+ fill: ${t.mainBkg};
25
+ stroke: ${t.nodeBorder};
26
+ stroke-width: 1px;
27
+ }
28
+ .flowchart-label text {
29
+ text-anchor: middle;
30
+ }
31
+ // .flowchart-label .text-outer-tspan {
32
+ // text-anchor: middle;
33
+ // }
34
+ // .flowchart-label .text-inner-tspan {
35
+ // text-anchor: start;
36
+ // }
37
+
38
+ .node .label {
39
+ text-align: center;
40
+ }
41
+ .node.clickable {
42
+ cursor: pointer;
43
+ }
44
+
45
+ .arrowheadPath {
46
+ fill: ${t.arrowheadColor};
47
+ }
48
+
49
+ .edgePath .path {
50
+ stroke: ${t.lineColor};
51
+ stroke-width: 2.0px;
52
+ }
53
+
54
+ .flowchart-link {
55
+ stroke: ${t.lineColor};
56
+ fill: none;
57
+ }
58
+
59
+ .edgeLabel {
60
+ background-color: ${t.edgeLabelBackground};
61
+ rect {
62
+ opacity: 0.5;
63
+ background-color: ${t.edgeLabelBackground};
64
+ fill: ${t.edgeLabelBackground};
65
+ }
66
+ text-align: center;
67
+ }
68
+
69
+ /* For html labels only */
70
+ .labelBkg {
71
+ background-color: ${U(t.edgeLabelBackground,.5)};
72
+ // background-color:
73
+ }
74
+
75
+ .node .cluster {
76
+ // fill: ${U(t.mainBkg,.5)};
77
+ fill: ${U(t.clusterBkg,.5)};
78
+ stroke: ${U(t.clusterBorder,.2)};
79
+ box-shadow: rgba(50, 50, 93, 0.25) 0px 13px 27px -5px, rgba(0, 0, 0, 0.3) 0px 8px 16px -8px;
80
+ stroke-width: 1px;
81
+ }
82
+
83
+ .cluster text {
84
+ fill: ${t.titleColor};
85
+ }
86
+
87
+ .cluster span,p {
88
+ color: ${t.titleColor};
89
+ }
90
+ /* .cluster div {
91
+ color: ${t.titleColor};
92
+ } */
93
+
94
+ div.mermaidTooltip {
95
+ position: absolute;
96
+ text-align: center;
97
+ max-width: 200px;
98
+ padding: 2px;
99
+ font-family: ${t.fontFamily};
100
+ font-size: 12px;
101
+ background: ${t.tertiaryColor};
102
+ border: 1px solid ${t.border2};
103
+ border-radius: 2px;
104
+ pointer-events: none;
105
+ z-index: 100;
106
+ }
107
+
108
+ .flowchartTitleText {
109
+ text-anchor: middle;
110
+ font-size: 18px;
111
+ fill: ${t.textColor};
112
+ }
113
+ ${(0,a.o)()}
114
+ `,"getStyles"),Z=(0,o.K2)((t,e,r,a)=>{e.forEach(e=>{tr[e](t,r,a)})},"insertMarkers"),q=(0,o.K2)((t,e,r)=>{o.Rm.trace("Making markers for ",r),t.append("defs").append("marker").attr("id",r+"_"+e+"-extensionStart").attr("class","marker extension "+e).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 1,7 L18,13 V 1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-extensionEnd").attr("class","marker extension "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 1,1 V 13 L18,7 Z")},"extension"),G=(0,o.K2)((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionStart").attr("class","marker composition "+e).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionEnd").attr("class","marker composition "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"composition"),J=(0,o.K2)((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationStart").attr("class","marker aggregation "+e).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationEnd").attr("class","marker aggregation "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"aggregation"),Q=(0,o.K2)((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyStart").attr("class","marker dependency "+e).attr("refX",6).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyEnd").attr("class","marker dependency "+e).attr("refX",13).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"dependency"),V=(0,o.K2)((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopStart").attr("class","marker lollipop "+e).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopEnd").attr("class","marker lollipop "+e).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6)},"lollipop"),tt=(0,o.K2)((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-pointEnd").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",6).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-pointStart").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",4.5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 5 L 10 10 L 10 0 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},"point"),te=(0,o.K2)((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-circleEnd").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",11).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-circleStart").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",-1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},"circle"),tr={extension:q,composition:G,aggregation:J,dependency:Q,lollipop:V,point:tt,circle:te,cross:(0,o.K2)((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-crossEnd").attr("class","marker cross "+e).attr("viewBox","0 0 11 11").attr("refX",12).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-crossStart").attr("class","marker cross "+e).attr("viewBox","0 0 11 11").attr("refX",-1).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0")},"cross"),barb:(0,o.K2)((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","strokeWidth").attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"barb")},ta=(0,o.D7)()?.block?.padding??8;function ti(t,e){if(0===t||!Number.isInteger(t))throw Error("Columns must be an integer !== 0.");if(e<0||!Number.isInteger(e))throw Error("Position must be a non-negative integer."+e);if(t<0)return{px:e,py:0};if(1===t)return{px:0,py:e};let r=Math.floor(e/t);return{px:e%t,py:r}}(0,o.K2)(ti,"calculateBlockPosition");var ts=(0,o.K2)(t=>{let e=0,r=0;for(let a of t.children){let{width:i,height:s,x:n,y:l}=a.size??{width:0,height:0,x:0,y:0};o.Rm.debug("getMaxChildSize abc95 child:",a.id,"width:",i,"height:",s,"x:",n,"y:",l,a.type),"space"!==a.type&&(i>e&&(e=i/(t.widthInColumns??1)),s>r&&(r=s))}return{width:e,height:r}},"getMaxChildSize");function tn(t,e,r=0,a=0){o.Rm.debug("setBlockSizes abc95 (start)",t.id,t?.size?.x,"block width =",t?.size,"siblingWidth",r),t?.size?.width||(t.size={width:r,height:a,x:0,y:0});let i=0,s=0;if(t.children?.length>0){for(let r of t.children)tn(r,e);let n=ts(t);for(let e of(i=n.width,s=n.height,o.Rm.debug("setBlockSizes abc95 maxWidth of",t.id,":s children is ",i,s),t.children))e.size&&(o.Rm.debug(`abc95 Setting size of children of ${t.id} id=${e.id} ${i} ${s} ${JSON.stringify(e.size)}`),e.size.width=i*(e.widthInColumns??1)+ta*((e.widthInColumns??1)-1),e.size.height=s,e.size.x=0,e.size.y=0,o.Rm.debug(`abc95 updating size of ${t.id} children child:${e.id} maxWidth:${i} maxHeight:${s}`));for(let r of t.children)tn(r,e,i,s);let l=t.columns??-1,d=0;for(let e of t.children)d+=e.widthInColumns??1;let c=t.children.length;l>0&&l<d&&(c=l);let h=Math.ceil(d/c),g=c*(i+ta)+ta,y=h*(s+ta)+ta;if(g<r){o.Rm.debug(`Detected to small sibling: abc95 ${t.id} siblingWidth ${r} siblingHeight ${a} width ${g}`),g=r,y=a;let e=(r-c*ta-ta)/c,n=(a-h*ta-ta)/h;for(let r of(o.Rm.debug("Size indata abc88",t.id,"childWidth",e,"maxWidth",i),o.Rm.debug("Size indata abc88",t.id,"childHeight",n,"maxHeight",s),o.Rm.debug("Size indata abc88 xSize",c,"padding",ta),t.children))r.size&&(r.size.width=e,r.size.height=n,r.size.x=0,r.size.y=0)}if(o.Rm.debug(`abc95 (finale calc) ${t.id} xSize ${c} ySize ${h} columns ${l}${t.children.length} width=${Math.max(g,t.size?.width||0)}`),g<(t?.size?.width||0)){g=t?.size?.width||0;let e=l>0?Math.min(t.children.length,l):t.children.length;if(e>0){let r=(g-e*ta-ta)/e;for(let e of(o.Rm.debug("abc95 (growing to fit) width",t.id,g,t.size?.width,r),t.children))e.size&&(e.size.width=r)}}t.size={width:g,height:y,x:0,y:0}}o.Rm.debug("setBlockSizes abc94 (done)",t.id,t?.size?.x,t?.size?.width,t?.size?.y,t?.size?.height)}function tl(t,e){o.Rm.debug(`abc85 layout blocks (=>layoutBlocks) ${t.id} x: ${t?.size?.x} y: ${t?.size?.y} width: ${t?.size?.width}`);let r=t.columns??-1;if(o.Rm.debug("layoutBlocks columns abc95",t.id,"=>",r,t),t.children&&t.children.length>0){let a=t?.children[0]?.size?.width??0,i=t.children.length*a+(t.children.length-1)*ta;o.Rm.debug("widthOfChildren 88",i,"posX");let s=0;o.Rm.debug("abc91 block?.size?.x",t.id,t?.size?.x);let n=t?.size?.x?t?.size?.x+(-t?.size?.width/2||0):-ta,l=0;for(let a of t.children){if(!a.size)continue;let{width:i,height:d}=a.size,{px:c,py:h}=ti(r,s);if(h!=l&&(l=h,n=t?.size?.x?t?.size?.x+(-t?.size?.width/2||0):-ta,o.Rm.debug("New row in layout for block",t.id," and child ",a.id,l)),o.Rm.debug(`abc89 layout blocks (child) id: ${a.id} Pos: ${s} (px, py) ${c},${h} (${t?.size?.x},${t?.size?.y}) parent: ${t.id} width: ${i}${ta}`),t.size){let e=i/2;a.size.x=n+ta+e,o.Rm.debug(`abc91 layout blocks (calc) px, pyid:${a.id} startingPos=X${n} new startingPosX${a.size.x} ${e} padding=${ta} width=${i} halfWidth=${e} => x:${a.size.x} y:${a.size.y} ${a.widthInColumns} (width * (child?.w || 1)) / 2 ${i*(a?.widthInColumns??1)/2}`),n=a.size.x+e,a.size.y=t.size.y-t.size.height/2+h*(d+ta)+d/2+ta,o.Rm.debug(`abc88 layout blocks (calc) px, pyid:${a.id}startingPosX${n}${ta}${e}=>x:${a.size.x}y:${a.size.y}${a.widthInColumns}(width * (child?.w || 1)) / 2${i*(a?.widthInColumns??1)/2}`)}a.children&&tl(a,e);let g=a?.widthInColumns??1;r>0&&(g=Math.min(g,r-s%r)),s+=g,o.Rm.debug("abc88 columnsPos",a,s)}}o.Rm.debug(`layout blocks (<==layoutBlocks) ${t.id} x: ${t?.size?.x} y: ${t?.size?.y} width: ${t?.size?.width}`)}function to(t,{minX:e,minY:r,maxX:a,maxY:i}={minX:0,minY:0,maxX:0,maxY:0}){if(t.size&&"root"!==t.id){let{x:s,y:n,width:l,height:o}=t.size;s-l/2<e&&(e=s-l/2),n-o/2<r&&(r=n-o/2),s+l/2>a&&(a=s+l/2),n+o/2>i&&(i=n+o/2)}if(t.children)for(let s of t.children)({minX:e,minY:r,maxX:a,maxY:i}=to(s,{minX:e,minY:r,maxX:a,maxY:i}));return{minX:e,minY:r,maxX:a,maxY:i}}function td(t){let e=t.getBlock("root");if(!e)return;tn(e,t,0,0),tl(e,t),o.Rm.debug("getBlocks",JSON.stringify(e,null,2));let{minX:r,minY:a,maxX:i,maxY:s}=to(e);return{x:r,y:a,width:i-r,height:s-a}}function tc(t,e){e&&t.attr("style",e)}function th(t,e){let r=(0,g.Lt)(document.createElementNS("http://www.w3.org/2000/svg","foreignObject")),a=r.append("xhtml:div"),i=t.label,s=t.isNode?"nodeLabel":"edgeLabel",n=a.append("span");return n.html((0,o.jZ)(i,e)),tc(n,t.labelStyle),n.attr("class",s),tc(a,t.labelStyle),a.style("display","inline-block"),a.style("white-space","nowrap"),a.attr("xmlns","http://www.w3.org/1999/xhtml"),r.node()}(0,o.K2)(tn,"setBlockSizes"),(0,o.K2)(tl,"layoutBlocks"),(0,o.K2)(to,"findBounds"),(0,o.K2)(td,"layout"),(0,o.K2)(tc,"applyStyle"),(0,o.K2)(th,"addHtmlLabel");var tg=(0,o.K2)(async(t,e,r,a)=>{let i=t||"";"object"==typeof i&&(i=i[0]);let s=(0,o.D7)();if((0,o._3)(s.flowchart.htmlLabels))return i=i.replace(/\\n|\n/g,"<br />"),o.Rm.debug("vertexText"+i),th({isNode:a,label:await (0,n.hE)((0,l.Sm)(i)),labelStyle:e.replace("fill:","color:")},s);{let t=document.createElementNS("http://www.w3.org/2000/svg","text");t.setAttribute("style",e.replace("color:","fill:"));for(let e of"string"==typeof i?i.split(/\\n|\n|<br\s*\/?>/gi):Array.isArray(i)?i:[]){let a=document.createElementNS("http://www.w3.org/2000/svg","tspan");a.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),a.setAttribute("dy","1em"),a.setAttribute("x","0"),r?a.setAttribute("class","title-row"):a.setAttribute("class","row"),a.textContent=e.trim(),t.appendChild(a)}return t}},"createLabel"),ty=(0,o.K2)((t,e,r,a,i)=>{e.arrowTypeStart&&tp(t,"start",e.arrowTypeStart,r,a,i),e.arrowTypeEnd&&tp(t,"end",e.arrowTypeEnd,r,a,i)},"addEdgeMarkers"),tu={arrow_cross:"cross",arrow_point:"point",arrow_barb:"barb",arrow_circle:"circle",aggregation:"aggregation",extension:"extension",composition:"composition",dependency:"dependency",lollipop:"lollipop"},tp=(0,o.K2)((t,e,r,a,i,s)=>{let n=tu[r];n?t.attr(`marker-${e}`,`url(${a}#${i}_${s}-${n}${"start"===e?"Start":"End"})`):o.Rm.warn(`Unknown arrow type: ${r}`)},"addEdgeMarker"),tx={},tb={},tf=(0,o.K2)(async(t,e)=>{let r,a=(0,o.D7)(),i=(0,o._3)(a.flowchart.htmlLabels),s="markdown"===e.labelType?(0,n.GZ)(t,e.label,{style:e.labelStyle,useHtmlLabels:i,addSvgBackground:!0},a):await tg(e.label,e.labelStyle),l=t.insert("g").attr("class","edgeLabel"),d=l.insert("g").attr("class","label");d.node().appendChild(s);let c=s.getBBox();if(i){let t=s.children[0],e=(0,g.Lt)(s);c=t.getBoundingClientRect(),e.attr("width",c.width),e.attr("height",c.height)}if(d.attr("transform","translate("+-c.width/2+", "+-c.height/2+")"),tx[e.id]=l,e.width=c.width,e.height=c.height,e.startLabelLeft){let a=await tg(e.startLabelLeft,e.labelStyle),i=t.insert("g").attr("class","edgeTerminals"),s=i.insert("g").attr("class","inner");r=s.node().appendChild(a);let n=a.getBBox();s.attr("transform","translate("+-n.width/2+", "+-n.height/2+")"),tb[e.id]||(tb[e.id]={}),tb[e.id].startLeft=i,tm(r,e.startLabelLeft)}if(e.startLabelRight){let a=await tg(e.startLabelRight,e.labelStyle),i=t.insert("g").attr("class","edgeTerminals"),s=i.insert("g").attr("class","inner");r=i.node().appendChild(a),s.node().appendChild(a);let n=a.getBBox();s.attr("transform","translate("+-n.width/2+", "+-n.height/2+")"),tb[e.id]||(tb[e.id]={}),tb[e.id].startRight=i,tm(r,e.startLabelRight)}if(e.endLabelLeft){let a=await tg(e.endLabelLeft,e.labelStyle),i=t.insert("g").attr("class","edgeTerminals"),s=i.insert("g").attr("class","inner");r=s.node().appendChild(a);let n=a.getBBox();s.attr("transform","translate("+-n.width/2+", "+-n.height/2+")"),i.node().appendChild(a),tb[e.id]||(tb[e.id]={}),tb[e.id].endLeft=i,tm(r,e.endLabelLeft)}if(e.endLabelRight){let a=await tg(e.endLabelRight,e.labelStyle),i=t.insert("g").attr("class","edgeTerminals"),s=i.insert("g").attr("class","inner");r=s.node().appendChild(a);let n=a.getBBox();s.attr("transform","translate("+-n.width/2+", "+-n.height/2+")"),i.node().appendChild(a),tb[e.id]||(tb[e.id]={}),tb[e.id].endRight=i,tm(r,e.endLabelRight)}return s},"insertEdgeLabel");function tm(t,e){(0,o.D7)().flowchart.htmlLabels&&t&&(t.style.width=9*e.length+"px",t.style.height="12px")}(0,o.K2)(tm,"setTerminalWidth");var tw=(0,o.K2)((t,e)=>{o.Rm.debug("Moving label abc88 ",t.id,t.label,tx[t.id],e);let r=e.updatedPath?e.updatedPath:e.originalPath,a=(0,o.D7)(),{subGraphTitleTotalMargin:i}=(0,s.O)(a);if(t.label){let a=tx[t.id],s=t.x,n=t.y;if(r){let a=l._K.calcLabelPosition(r);o.Rm.debug("Moving label "+t.label+" from (",s,",",n,") to (",a.x,",",a.y,") abc88"),e.updatedPath&&(s=a.x,n=a.y)}a.attr("transform",`translate(${s}, ${n+i/2})`)}if(t.startLabelLeft){let e=tb[t.id].startLeft,a=t.x,i=t.y;if(r){let e=l._K.calcTerminalLabelPosition(10*!!t.arrowTypeStart,"start_left",r);a=e.x,i=e.y}e.attr("transform",`translate(${a}, ${i})`)}if(t.startLabelRight){let e=tb[t.id].startRight,a=t.x,i=t.y;if(r){let e=l._K.calcTerminalLabelPosition(10*!!t.arrowTypeStart,"start_right",r);a=e.x,i=e.y}e.attr("transform",`translate(${a}, ${i})`)}if(t.endLabelLeft){let e=tb[t.id].endLeft,a=t.x,i=t.y;if(r){let e=l._K.calcTerminalLabelPosition(10*!!t.arrowTypeEnd,"end_left",r);a=e.x,i=e.y}e.attr("transform",`translate(${a}, ${i})`)}if(t.endLabelRight){let e=tb[t.id].endRight,a=t.x,i=t.y;if(r){let e=l._K.calcTerminalLabelPosition(10*!!t.arrowTypeEnd,"end_right",r);a=e.x,i=e.y}e.attr("transform",`translate(${a}, ${i})`)}},"positionEdgeLabel"),tL=(0,o.K2)((t,e)=>{let r=t.x,a=t.y,i=Math.abs(e.x-r),s=Math.abs(e.y-a),n=t.width/2,l=t.height/2;return!!(i>=n)||!!(s>=l)},"outsideNode"),tk=(0,o.K2)((t,e,r)=>{o.Rm.debug(`intersection calc abc89:
115
+ outsidePoint: ${JSON.stringify(e)}
116
+ insidePoint : ${JSON.stringify(r)}
117
+ node : x:${t.x} y:${t.y} w:${t.width} h:${t.height}`);let a=t.x,i=t.y,s=Math.abs(a-r.x),n=t.width/2,l=r.x<e.x?n-s:n+s,d=t.height/2,c=Math.abs(e.y-r.y),h=Math.abs(e.x-r.x);if(Math.abs(i-e.y)*n>Math.abs(a-e.x)*d){let t=r.y<e.y?e.y-d-i:i-d-e.y;l=h*t/c;let a={x:r.x<e.x?r.x+l:r.x-h+l,y:r.y<e.y?r.y+c-t:r.y-c+t};return 0===l&&(a.x=e.x,a.y=e.y),0===h&&(a.x=e.x),0===c&&(a.y=e.y),o.Rm.debug(`abc89 topp/bott calc, Q ${c}, q ${t}, R ${h}, r ${l}`,a),a}{let t=c*(l=r.x<e.x?e.x-n-a:a-n-e.x)/h,i=r.x<e.x?r.x+h-l:r.x-h+l,s=r.y<e.y?r.y+t:r.y-t;return o.Rm.debug(`sides calc abc89, Q ${c}, q ${t}, R ${h}, r ${l}`,{_x:i,_y:s}),0===l&&(i=e.x,s=e.y),0===h&&(i=e.x),0===c&&(s=e.y),{x:i,y:s}}},"intersection"),tS=(0,o.K2)((t,e)=>{o.Rm.debug("abc88 cutPathAtIntersect",t,e);let r=[],a=t[0],i=!1;return t.forEach(t=>{if(tL(e,t)||i)a=t,i||r.push(t);else{let s=tk(e,a,t),n=!1;r.forEach(t=>{n=n||t.x===s.x&&t.y===s.y}),r.some(t=>t.x===s.x&&t.y===s.y)||r.push(s),i=!0}}),r},"cutPathAtIntersect"),t_=(0,o.K2)(function(t,e,r,a,s,n,l){let d,c=r.points;o.Rm.debug("abc88 InsertEdge: edge=",r,"e=",e);let h=!1,g=n.node(e.v);var y=n.node(e.w);y?.intersect&&g?.intersect&&((c=c.slice(1,r.points.length-1)).unshift(g.intersect(c[0])),c.push(y.intersect(c[c.length-1]))),r.toCluster&&(o.Rm.debug("to cluster abc88",a[r.toCluster]),c=tS(r.points,a[r.toCluster].node),h=!0),r.fromCluster&&(o.Rm.debug("from cluster abc88",a[r.fromCluster]),c=tS(c.reverse(),a[r.fromCluster].node).reverse(),h=!0);let p=c.filter(t=>!Number.isNaN(t.y)),x=u.qr;r.curve&&("graph"===s||"flowchart"===s)&&(x=r.curve);let{x:b,y:f}=(0,i.R)(r),m=(0,u.n8)().x(b).y(f).curve(x);switch(r.thickness){case"normal":d="edge-thickness-normal";break;case"thick":case"invisible":d="edge-thickness-thick";break;default:d=""}switch(r.pattern){case"solid":d+=" edge-pattern-solid";break;case"dotted":d+=" edge-pattern-dotted";break;case"dashed":d+=" edge-pattern-dashed"}let w=t.append("path").attr("d",m(p)).attr("id",r.id).attr("class"," "+d+(r.classes?" "+r.classes:"")).attr("style",r.style),L="";((0,o.D7)().flowchart.arrowMarkerAbsolute||(0,o.D7)().state.arrowMarkerAbsolute)&&(L=(0,o.ID)(!0)),ty(w,r,L,l,s);let k={};return h&&(k.updatedPath=c),k.originalPath=r.points,k},"insertEdge"),tE=(0,o.K2)(t=>{let e=new Set;for(let r of t)switch(r){case"x":e.add("right"),e.add("left");break;case"y":e.add("up"),e.add("down");break;default:e.add(r)}return e},"expandAndDeduplicateDirections"),tD=(0,o.K2)((t,e,r)=>{let a=tE(t),i=e.height+2*r.padding,s=i/2,n=e.width+2*s+r.padding,l=r.padding/2;return a.has("right")&&a.has("left")&&a.has("up")&&a.has("down")?[{x:0,y:0},{x:s,y:0},{x:n/2,y:2*l},{x:n-s,y:0},{x:n,y:0},{x:n,y:-i/3},{x:n+2*l,y:-i/2},{x:n,y:-2*i/3},{x:n,y:-i},{x:n-s,y:-i},{x:n/2,y:-i-2*l},{x:s,y:-i},{x:0,y:-i},{x:0,y:-2*i/3},{x:-2*l,y:-i/2},{x:0,y:-i/3}]:a.has("right")&&a.has("left")&&a.has("up")?[{x:s,y:0},{x:n-s,y:0},{x:n,y:-i/2},{x:n-s,y:-i},{x:s,y:-i},{x:0,y:-i/2}]:a.has("right")&&a.has("left")&&a.has("down")?[{x:0,y:0},{x:s,y:-i},{x:n-s,y:-i},{x:n,y:0}]:a.has("right")&&a.has("up")&&a.has("down")?[{x:0,y:0},{x:n,y:-s},{x:n,y:-i+s},{x:0,y:-i}]:a.has("left")&&a.has("up")&&a.has("down")?[{x:n,y:0},{x:0,y:-s},{x:0,y:-i+s},{x:n,y:-i}]:a.has("right")&&a.has("left")?[{x:s,y:0},{x:s,y:-l},{x:n-s,y:-l},{x:n-s,y:0},{x:n,y:-i/2},{x:n-s,y:-i},{x:n-s,y:-i+l},{x:s,y:-i+l},{x:s,y:-i},{x:0,y:-i/2}]:a.has("up")&&a.has("down")?[{x:n/2,y:0},{x:0,y:-l},{x:s,y:-l},{x:s,y:-i+l},{x:0,y:-i+l},{x:n/2,y:-i},{x:n,y:-i+l},{x:n-s,y:-i+l},{x:n-s,y:-l},{x:n,y:-l}]:a.has("right")&&a.has("up")?[{x:0,y:0},{x:n,y:-s},{x:0,y:-i}]:a.has("right")&&a.has("down")?[{x:0,y:0},{x:n,y:0},{x:0,y:-i}]:a.has("left")&&a.has("up")?[{x:n,y:0},{x:0,y:-s},{x:n,y:-i}]:a.has("left")&&a.has("down")?[{x:n,y:0},{x:0,y:0},{x:n,y:-i}]:a.has("right")?[{x:s,y:-l},{x:s,y:-l},{x:n-s,y:-l},{x:n-s,y:0},{x:n,y:-i/2},{x:n-s,y:-i},{x:n-s,y:-i+l},{x:s,y:-i+l},{x:s,y:-i+l}]:a.has("left")?[{x:s,y:0},{x:s,y:-l},{x:n-s,y:-l},{x:n-s,y:-i+l},{x:s,y:-i+l},{x:s,y:-i},{x:0,y:-i/2}]:a.has("up")?[{x:s,y:-l},{x:s,y:-i+l},{x:0,y:-i+l},{x:n/2,y:-i},{x:n,y:-i+l},{x:n-s,y:-i+l},{x:n-s,y:-l}]:a.has("down")?[{x:n/2,y:0},{x:0,y:-l},{x:s,y:-l},{x:s,y:-i+l},{x:n-s,y:-i+l},{x:n-s,y:-l},{x:n,y:-l}]:[{x:0,y:0}]},"getArrowPoints");function tR(t,e,r,a){var i=t.x,s=t.y,n=i-a.x,l=s-a.y,o=Math.sqrt(e*e*l*l+r*r*n*n),d=Math.abs(e*r*n/o);a.x<i&&(d=-d);var c=Math.abs(e*r*l/o);return a.y<s&&(c=-c),{x:i+d,y:s+c}}function tK(t,e,r){return tR(t,e,e,r)}function t$(t,e,r,a){var i,s,n,l,o,d,c,h,g,y,u,p,x;if(i=e.y-t.y,n=t.x-e.x,o=e.x*t.y-t.x*e.y,g=i*r.x+n*r.y+o,y=i*a.x+n*a.y+o,!(0!==g&&0!==y&&tC(g,y))){if((s=a.y-r.y,l=r.x-a.x,d=a.x*r.y-r.x*a.y,c=s*t.x+l*t.y+d,h=s*e.x+l*e.y+d,!(0!==c&&0!==h&&tC(c,h)))&&0!=(u=i*l-s*n))return p=Math.abs(u/2),{x:(x=n*d-l*o)<0?(x-p)/u:(x+p)/u,y:(x=s*o-i*d)<0?(x-p)/u:(x+p)/u}}}function tC(t,e){return t*e>0}function tv(t,e,r){var a=t.x,i=t.y,s=[],n=1/0,l=1/0;"function"==typeof e.forEach?e.forEach(function(t){n=Math.min(n,t.x),l=Math.min(l,t.y)}):(n=Math.min(n,e.x),l=Math.min(l,e.y));for(var o=a-t.width/2-n,d=i-t.height/2-l,c=0;c<e.length;c++){var h=e[c],g=e[c<e.length-1?c+1:0],y=t$(t,r,{x:o+h.x,y:d+h.y},{x:o+g.x,y:d+g.y});y&&s.push(y)}return s.length?(s.length>1&&s.sort(function(t,e){var a=t.x-r.x,i=t.y-r.y,s=Math.sqrt(a*a+i*i),n=e.x-r.x,l=e.y-r.y,o=Math.sqrt(n*n+l*l);return s<o?-1:+(s!==o)}),s[0]):t}(0,o.K2)(function(t,e){return t.intersect(e)},"intersectNode"),(0,o.K2)(tR,"intersectEllipse"),(0,o.K2)(tK,"intersectCircle"),(0,o.K2)(t$,"intersectLine"),(0,o.K2)(tC,"sameSign"),(0,o.K2)(tv,"intersectPolygon");var tT=(0,o.K2)((t,e)=>{var r,a,i=t.x,s=t.y,n=e.x-i,l=e.y-s,o=t.width/2,d=t.height/2;return Math.abs(l)*o>Math.abs(n)*d?(l<0&&(d=-d),r=0===l?0:d*n/l,a=d):(n<0&&(o=-o),r=o,a=0===n?0:o*l/n),{x:i+r,y:s+a}},"intersectRect"),tN=(0,o.K2)(async(t,e,r,a)=>{let i,s,d=(0,o.D7)(),c=e.useHtmlLabels||(0,o._3)(d.flowchart.htmlLabels),h=t.insert("g").attr("class",r||"node default").attr("id",e.domId||e.id),y=h.insert("g").attr("class","label").attr("style",e.labelStyle);i=void 0===e.labelText?"":"string"==typeof e.labelText?e.labelText:e.labelText[0];let u=y.node(),p=(s="markdown"===e.labelType?(0,n.GZ)(y,(0,o.jZ)((0,l.Sm)(i),d),{useHtmlLabels:c,width:e.width||d.flowchart.wrappingWidth,classes:"markdown-node-label"},d):u.appendChild(await tg((0,o.jZ)((0,l.Sm)(i),d),e.labelStyle,!1,a))).getBBox(),x=e.padding/2;if((0,o._3)(d.flowchart.htmlLabels)){let t=s.children[0],e=(0,g.Lt)(s),r=t.getElementsByTagName("img");if(r){let t=""===i.replace(/<img[^>]*>/g,"").trim();await Promise.all([...r].map(e=>new Promise(r=>{function a(){if(e.style.display="flex",e.style.flexDirection="column",t){let t=5*parseInt(d.fontSize?d.fontSize:window.getComputedStyle(document.body).fontSize,10)+"px";e.style.minWidth=t,e.style.maxWidth=t}else e.style.width="100%";r(e)}(0,o.K2)(a,"setupImage"),setTimeout(()=>{e.complete&&a()}),e.addEventListener("error",a),e.addEventListener("load",a)})))}p=t.getBoundingClientRect(),e.attr("width",p.width),e.attr("height",p.height)}return c?y.attr("transform","translate("+-p.width/2+", "+-p.height/2+")"):y.attr("transform","translate(0, "+-p.height/2+")"),e.centerLabel&&y.attr("transform","translate("+-p.width/2+", "+-p.height/2+")"),y.insert("rect",":first-child"),{shapeSvg:h,bbox:p,halfPadding:x,label:y}},"labelHelper"),tI=(0,o.K2)((t,e)=>{let r=e.node().getBBox();t.width=r.width,t.height=r.height},"updateNodeBounds");function tB(t,e,r,a){return t.insert("polygon",":first-child").attr("points",a.map(function(t){return t.x+","+t.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-e/2+","+r/2+")")}(0,o.K2)(tB,"insertPolygonShape");var tz=(0,o.K2)(async(t,e)=>{e.useHtmlLabels||(0,o.D7)().flowchart.htmlLabels||(e.centerLabel=!0);let{shapeSvg:r,bbox:a,halfPadding:i}=await tN(t,e,"node "+e.classes,!0);o.Rm.info("Classes = ",e.classes);let s=r.insert("rect",":first-child");return s.attr("rx",e.rx).attr("ry",e.ry).attr("x",-a.width/2-i).attr("y",-a.height/2-i).attr("width",a.width+e.padding).attr("height",a.height+e.padding),tI(e,s),e.intersect=function(t){return tT(e,t)},r},"note"),tA=(0,o.K2)(t=>t?" "+t:"","formatClass"),tO=(0,o.K2)((t,e)=>`${e||"node default"}${tA(t.classes)} ${tA(t.class)}`,"getClassesFromNode"),tM=(0,o.K2)(async(t,e)=>{let{shapeSvg:r,bbox:a}=await tN(t,e,tO(e,void 0),!0),i=a.width+e.padding+(a.height+e.padding),s=[{x:i/2,y:0},{x:i,y:-i/2},{x:i/2,y:-i},{x:0,y:-i/2}];o.Rm.info("Question main (Circle)");let n=tB(r,i,i,s);return n.attr("style",e.style),tI(e,n),e.intersect=function(t){return o.Rm.warn("Intersect called"),tv(e,s,t)},r},"question"),tP=(0,o.K2)((t,e)=>{let r=t.insert("g").attr("class","node default").attr("id",e.domId||e.id);return r.insert("polygon",":first-child").attr("points",[{x:0,y:14},{x:14,y:0},{x:0,y:-14},{x:-14,y:0}].map(function(t){return t.x+","+t.y}).join(" ")).attr("class","state-start").attr("r",7).attr("width",28).attr("height",28),e.width=28,e.height=28,e.intersect=function(t){return tK(e,14,t)},r},"choice"),tY=(0,o.K2)(async(t,e)=>{let{shapeSvg:r,bbox:a}=await tN(t,e,tO(e,void 0),!0),i=a.height+e.padding,s=i/4,n=a.width+2*s+e.padding,l=[{x:s,y:0},{x:n-s,y:0},{x:n,y:-i/2},{x:n-s,y:-i},{x:s,y:-i},{x:0,y:-i/2}],o=tB(r,n,i,l);return o.attr("style",e.style),tI(e,o),e.intersect=function(t){return tv(e,l,t)},r},"hexagon"),tW=(0,o.K2)(async(t,e)=>{let{shapeSvg:r,bbox:a}=await tN(t,e,void 0,!0),i=a.height+2*e.padding,s=i/2,n=a.width+2*s+e.padding,l=tD(e.directions,a,e),o=tB(r,n,i,l);return o.attr("style",e.style),tI(e,o),e.intersect=function(t){return tv(e,l,t)},r},"block_arrow"),tF=(0,o.K2)(async(t,e)=>{let{shapeSvg:r,bbox:a}=await tN(t,e,tO(e,void 0),!0),i=a.width+e.padding,s=a.height+e.padding,n=[{x:-s/2,y:0},{x:i,y:0},{x:i,y:-s},{x:-s/2,y:-s},{x:0,y:-s/2}];return tB(r,i,s,n).attr("style",e.style),e.width=i+s,e.height=s,e.intersect=function(t){return tv(e,n,t)},r},"rect_left_inv_arrow"),tX=(0,o.K2)(async(t,e)=>{let{shapeSvg:r,bbox:a}=await tN(t,e,tO(e),!0),i=a.width+e.padding,s=a.height+e.padding,n=[{x:-2*s/6,y:0},{x:i-s/6,y:0},{x:i+2*s/6,y:-s},{x:s/6,y:-s}],l=tB(r,i,s,n);return l.attr("style",e.style),tI(e,l),e.intersect=function(t){return tv(e,n,t)},r},"lean_right"),tj=(0,o.K2)(async(t,e)=>{let{shapeSvg:r,bbox:a}=await tN(t,e,tO(e,void 0),!0),i=a.width+e.padding,s=a.height+e.padding,n=[{x:2*s/6,y:0},{x:i+s/6,y:0},{x:i-2*s/6,y:-s},{x:-s/6,y:-s}],l=tB(r,i,s,n);return l.attr("style",e.style),tI(e,l),e.intersect=function(t){return tv(e,n,t)},r},"lean_left"),tU=(0,o.K2)(async(t,e)=>{let{shapeSvg:r,bbox:a}=await tN(t,e,tO(e,void 0),!0),i=a.width+e.padding,s=a.height+e.padding,n=[{x:-2*s/6,y:0},{x:i+2*s/6,y:0},{x:i-s/6,y:-s},{x:s/6,y:-s}],l=tB(r,i,s,n);return l.attr("style",e.style),tI(e,l),e.intersect=function(t){return tv(e,n,t)},r},"trapezoid"),tH=(0,o.K2)(async(t,e)=>{let{shapeSvg:r,bbox:a}=await tN(t,e,tO(e,void 0),!0),i=a.width+e.padding,s=a.height+e.padding,n=[{x:s/6,y:0},{x:i-s/6,y:0},{x:i+2*s/6,y:-s},{x:-2*s/6,y:-s}],l=tB(r,i,s,n);return l.attr("style",e.style),tI(e,l),e.intersect=function(t){return tv(e,n,t)},r},"inv_trapezoid"),tZ=(0,o.K2)(async(t,e)=>{let{shapeSvg:r,bbox:a}=await tN(t,e,tO(e,void 0),!0),i=a.width+e.padding,s=a.height+e.padding,n=[{x:0,y:0},{x:i+s/2,y:0},{x:i,y:-s/2},{x:i+s/2,y:-s},{x:0,y:-s}],l=tB(r,i,s,n);return l.attr("style",e.style),tI(e,l),e.intersect=function(t){return tv(e,n,t)},r},"rect_right_inv_arrow"),tq=(0,o.K2)(async(t,e)=>{let{shapeSvg:r,bbox:a}=await tN(t,e,tO(e,void 0),!0),i=a.width+e.padding,s=i/2,n=s/(2.5+i/50),l=a.height+n+e.padding,o="M 0,"+n+" a "+s+","+n+" 0,0,0 "+i+" 0 a "+s+","+n+" 0,0,0 "+-i+" 0 l 0,"+l+" a "+s+","+n+" 0,0,0 "+i+" 0 l 0,"+-l,d=r.attr("label-offset-y",n).insert("path",":first-child").attr("style",e.style).attr("d",o).attr("transform","translate("+-i/2+","+-(l/2+n)+")");return tI(e,d),e.intersect=function(t){let r=tT(e,t),a=r.x-e.x;if(0!=s&&(Math.abs(a)<e.width/2||Math.abs(a)==e.width/2&&Math.abs(r.y-e.y)>e.height/2-n)){let i=n*n*(1-a*a/(s*s));0!=i&&(i=Math.sqrt(i)),i=n-i,t.y-e.y>0&&(i=-i),r.y+=i}return r},r},"cylinder"),tG=(0,o.K2)(async(t,e)=>{let{shapeSvg:r,bbox:a,halfPadding:i}=await tN(t,e,"node "+e.classes+" "+e.class,!0),s=r.insert("rect",":first-child"),n=e.positioned?e.width:a.width+e.padding,l=e.positioned?e.height:a.height+e.padding,d=e.positioned?-n/2:-a.width/2-i,c=e.positioned?-l/2:-a.height/2-i;if(s.attr("class","basic label-container").attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("x",d).attr("y",c).attr("width",n).attr("height",l),e.props){let t=new Set(Object.keys(e.props));e.props.borders&&(tV(s,e.props.borders,n,l),t.delete("borders")),t.forEach(t=>{o.Rm.warn(`Unknown node property ${t}`)})}return tI(e,s),e.intersect=function(t){return tT(e,t)},r},"rect"),tJ=(0,o.K2)(async(t,e)=>{let{shapeSvg:r,bbox:a,halfPadding:i}=await tN(t,e,"node "+e.classes,!0),s=r.insert("rect",":first-child"),n=e.positioned?e.width:a.width+e.padding,l=e.positioned?e.height:a.height+e.padding,d=e.positioned?-n/2:-a.width/2-i,c=e.positioned?-l/2:-a.height/2-i;if(s.attr("class","basic cluster composite label-container").attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("x",d).attr("y",c).attr("width",n).attr("height",l),e.props){let t=new Set(Object.keys(e.props));e.props.borders&&(tV(s,e.props.borders,n,l),t.delete("borders")),t.forEach(t=>{o.Rm.warn(`Unknown node property ${t}`)})}return tI(e,s),e.intersect=function(t){return tT(e,t)},r},"composite"),tQ=(0,o.K2)(async(t,e)=>{let{shapeSvg:r}=await tN(t,e,"label",!0);o.Rm.trace("Classes = ",e.class);let a=r.insert("rect",":first-child");if(a.attr("width",0).attr("height",0),r.attr("class","label edgeLabel"),e.props){let t=new Set(Object.keys(e.props));e.props.borders&&(tV(a,e.props.borders,0,0),t.delete("borders")),t.forEach(t=>{o.Rm.warn(`Unknown node property ${t}`)})}return tI(e,a),e.intersect=function(t){return tT(e,t)},r},"labelRect");function tV(t,e,r,a){let i=[],s=(0,o.K2)(t=>{i.push(t,0)},"addBorder"),n=(0,o.K2)(t=>{i.push(0,t)},"skipBorder");e.includes("t")?(o.Rm.debug("add top border"),s(r)):n(r),e.includes("r")?(o.Rm.debug("add right border"),s(a)):n(a),e.includes("b")?(o.Rm.debug("add bottom border"),s(r)):n(r),e.includes("l")?(o.Rm.debug("add left border"),s(a)):n(a),t.attr("stroke-dasharray",i.join(" "))}(0,o.K2)(tV,"applyNodePropertyBorders");var t0=(0,o.K2)(async(t,e)=>{let r;r=e.classes?"node "+e.classes:"node default";let a=t.insert("g").attr("class",r).attr("id",e.domId||e.id),i=a.insert("rect",":first-child"),s=a.insert("line"),n=a.insert("g").attr("class","label"),l=e.labelText.flat?e.labelText.flat():e.labelText,d="";d="object"==typeof l?l[0]:l,o.Rm.info("Label text abc79",d,l,"object"==typeof l);let c=n.node().appendChild(await tg(d,e.labelStyle,!0,!0)),h={width:0,height:0};if((0,o._3)((0,o.D7)().flowchart.htmlLabels)){let t=c.children[0],e=(0,g.Lt)(c);h=t.getBoundingClientRect(),e.attr("width",h.width),e.attr("height",h.height)}o.Rm.info("Text 2",l);let y=l.slice(1,l.length),u=c.getBBox(),p=n.node().appendChild(await tg(y.join?y.join("<br/>"):y,e.labelStyle,!0,!0));if((0,o._3)((0,o.D7)().flowchart.htmlLabels)){let t=p.children[0],e=(0,g.Lt)(p);h=t.getBoundingClientRect(),e.attr("width",h.width),e.attr("height",h.height)}let x=e.padding/2;return(0,g.Lt)(p).attr("transform","translate( "+(h.width>u.width?0:(u.width-h.width)/2)+", "+(u.height+x+5)+")"),(0,g.Lt)(c).attr("transform","translate( "+(h.width<u.width?0:-(u.width-h.width)/2)+", 0)"),h=n.node().getBBox(),n.attr("transform","translate("+-h.width/2+", "+(-h.height/2-x+3)+")"),i.attr("class","outer title-state").attr("x",-h.width/2-x).attr("y",-h.height/2-x).attr("width",h.width+e.padding).attr("height",h.height+e.padding),s.attr("class","divider").attr("x1",-h.width/2-x).attr("x2",h.width/2+x).attr("y1",-h.height/2-x+u.height+x).attr("y2",-h.height/2-x+u.height+x),tI(e,i),e.intersect=function(t){return tT(e,t)},a},"rectWithTitle"),t2=(0,o.K2)(async(t,e)=>{let{shapeSvg:r,bbox:a}=await tN(t,e,tO(e,void 0),!0),i=a.height+e.padding,s=a.width+i/4+e.padding,n=r.insert("rect",":first-child").attr("style",e.style).attr("rx",i/2).attr("ry",i/2).attr("x",-s/2).attr("y",-i/2).attr("width",s).attr("height",i);return tI(e,n),e.intersect=function(t){return tT(e,t)},r},"stadium"),t1=(0,o.K2)(async(t,e)=>{let{shapeSvg:r,bbox:a,halfPadding:i}=await tN(t,e,tO(e,void 0),!0),s=r.insert("circle",":first-child");return s.attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("r",a.width/2+i).attr("width",a.width+e.padding).attr("height",a.height+e.padding),o.Rm.info("Circle main"),tI(e,s),e.intersect=function(t){return o.Rm.info("Circle intersect",e,a.width/2+i,t),tK(e,a.width/2+i,t)},r},"circle"),t3=(0,o.K2)(async(t,e)=>{let{shapeSvg:r,bbox:a,halfPadding:i}=await tN(t,e,tO(e,void 0),!0),s=r.insert("g",":first-child"),n=s.insert("circle"),l=s.insert("circle");return s.attr("class",e.class),n.attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("r",a.width/2+i+5).attr("width",a.width+e.padding+10).attr("height",a.height+e.padding+10),l.attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("r",a.width/2+i).attr("width",a.width+e.padding).attr("height",a.height+e.padding),o.Rm.info("DoubleCircle main"),tI(e,n),e.intersect=function(t){return o.Rm.info("DoubleCircle intersect",e,a.width/2+i+5,t),tK(e,a.width/2+i+5,t)},r},"doublecircle"),t4=(0,o.K2)(async(t,e)=>{let{shapeSvg:r,bbox:a}=await tN(t,e,tO(e,void 0),!0),i=a.width+e.padding,s=a.height+e.padding,n=[{x:0,y:0},{x:i,y:0},{x:i,y:-s},{x:0,y:-s},{x:0,y:0},{x:-8,y:0},{x:i+8,y:0},{x:i+8,y:-s},{x:-8,y:-s},{x:-8,y:0}],l=tB(r,i,s,n);return l.attr("style",e.style),tI(e,l),e.intersect=function(t){return tv(e,n,t)},r},"subroutine"),t8=(0,o.K2)((t,e)=>{let r=t.insert("g").attr("class","node default").attr("id",e.domId||e.id),a=r.insert("circle",":first-child");return a.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),tI(e,a),e.intersect=function(t){return tK(e,7,t)},r},"start"),t5=(0,o.K2)((t,e,r)=>{let a=t.insert("g").attr("class","node default").attr("id",e.domId||e.id),i=70,s=10;return"LR"===r&&(i=10,s=70),tI(e,a.append("rect").attr("x",-1*i/2).attr("y",-1*s/2).attr("width",i).attr("height",s).attr("class","fork-join")),e.height=e.height+e.padding/2,e.width=e.width+e.padding/2,e.intersect=function(t){return tT(e,t)},a},"forkJoin"),t9={rhombus:tM,composite:tJ,question:tM,rect:tG,labelRect:tQ,rectWithTitle:t0,choice:tP,circle:t1,doublecircle:t3,stadium:t2,hexagon:tY,block_arrow:tW,rect_left_inv_arrow:tF,lean_right:tX,lean_left:tj,trapezoid:tU,inv_trapezoid:tH,rect_right_inv_arrow:tZ,cylinder:tq,start:t8,end:(0,o.K2)((t,e)=>{let r=t.insert("g").attr("class","node default").attr("id",e.domId||e.id),a=r.insert("circle",":first-child"),i=r.insert("circle",":first-child");return i.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),a.attr("class","state-end").attr("r",5).attr("width",10).attr("height",10),tI(e,i),e.intersect=function(t){return tK(e,7,t)},r},"end"),note:tz,subroutine:t4,fork:t5,join:t5,class_box:(0,o.K2)(async(t,e)=>{let r,a=e.padding/2;r=e.classes?"node "+e.classes:"node default";let i=t.insert("g").attr("class",r).attr("id",e.domId||e.id),s=i.insert("rect",":first-child"),n=i.insert("line"),l=i.insert("line"),d=0,c=4,h=i.insert("g").attr("class","label"),y=0,u=e.classData.annotations?.[0],p=e.classData.annotations[0]?"\xab"+e.classData.annotations[0]+"\xbb":"",x=h.node().appendChild(await tg(p,e.labelStyle,!0,!0)),b=x.getBBox();if((0,o._3)((0,o.D7)().flowchart.htmlLabels)){let t=x.children[0],e=(0,g.Lt)(x);b=t.getBoundingClientRect(),e.attr("width",b.width),e.attr("height",b.height)}e.classData.annotations[0]&&(c+=b.height+4,d+=b.width);let f=e.classData.label;void 0!==e.classData.type&&""!==e.classData.type&&((0,o.D7)().flowchart.htmlLabels?f+="&lt;"+e.classData.type+"&gt;":f+="<"+e.classData.type+">");let m=h.node().appendChild(await tg(f,e.labelStyle,!0,!0));(0,g.Lt)(m).attr("class","classTitle");let w=m.getBBox();if((0,o._3)((0,o.D7)().flowchart.htmlLabels)){let t=m.children[0],e=(0,g.Lt)(m);w=t.getBoundingClientRect(),e.attr("width",w.width),e.attr("height",w.height)}c+=w.height+4,w.width>d&&(d=w.width);let L=[];e.classData.members.forEach(async t=>{let r=t.getDisplayDetails(),a=r.displayText;(0,o.D7)().flowchart.htmlLabels&&(a=a.replace(/</g,"&lt;").replace(/>/g,"&gt;"));let i=h.node().appendChild(await tg(a,r.cssStyle?r.cssStyle:e.labelStyle,!0,!0)),s=i.getBBox();if((0,o._3)((0,o.D7)().flowchart.htmlLabels)){let t=i.children[0],e=(0,g.Lt)(i);s=t.getBoundingClientRect(),e.attr("width",s.width),e.attr("height",s.height)}s.width>d&&(d=s.width),c+=s.height+4,L.push(i)}),c+=8;let k=[];if(e.classData.methods.forEach(async t=>{let r=t.getDisplayDetails(),a=r.displayText;(0,o.D7)().flowchart.htmlLabels&&(a=a.replace(/</g,"&lt;").replace(/>/g,"&gt;"));let i=h.node().appendChild(await tg(a,r.cssStyle?r.cssStyle:e.labelStyle,!0,!0)),s=i.getBBox();if((0,o._3)((0,o.D7)().flowchart.htmlLabels)){let t=i.children[0],e=(0,g.Lt)(i);s=t.getBoundingClientRect(),e.attr("width",s.width),e.attr("height",s.height)}s.width>d&&(d=s.width),c+=s.height+4,k.push(i)}),c+=8,u){let t=(d-b.width)/2;(0,g.Lt)(x).attr("transform","translate( "+(-1*d/2+t)+", "+-1*c/2+")"),y=b.height+4}let S=(d-w.width)/2;return(0,g.Lt)(m).attr("transform","translate( "+(-1*d/2+S)+", "+(-1*c/2+y)+")"),y+=w.height+4,n.attr("class","divider").attr("x1",-d/2-a).attr("x2",d/2+a).attr("y1",-c/2-a+8+y).attr("y2",-c/2-a+8+y),y+=8,L.forEach(t=>{(0,g.Lt)(t).attr("transform","translate( "+-d/2+", "+(-1*c/2+y+4)+")");let e=t?.getBBox();y+=(e?.height??0)+4}),y+=8,l.attr("class","divider").attr("x1",-d/2-a).attr("x2",d/2+a).attr("y1",-c/2-a+8+y).attr("y2",-c/2-a+8+y),y+=8,k.forEach(t=>{(0,g.Lt)(t).attr("transform","translate( "+-d/2+", "+(-1*c/2+y)+")");let e=t?.getBBox();y+=(e?.height??0)+4}),s.attr("style",e.style).attr("class","outer title-state").attr("x",-d/2-a).attr("y",-(c/2)-a).attr("width",d+e.padding).attr("height",c+e.padding),tI(e,s),e.intersect=function(t){return tT(e,t)},i},"class_box")},t7={},t6=(0,o.K2)(async(t,e,r)=>{let a,i;if(e.link){let s;"sandbox"===(0,o.D7)().securityLevel?s="_top":e.linkTarget&&(s=e.linkTarget||"_blank"),a=t.insert("svg:a").attr("xlink:href",e.link).attr("target",s),i=await t9[e.shape](a,e,r)}else a=i=await t9[e.shape](t,e,r);return e.tooltip&&i.attr("title",e.tooltip),e.class&&i.attr("class","node default "+e.class),t7[e.id]=a,e.haveCallback&&t7[e.id].attr("class",t7[e.id].attr("class")+" clickable"),a},"insertNode"),et=(0,o.K2)(t=>{let e=t7[t.id];o.Rm.trace("Transforming node",t.diff,t,"translate("+(t.x-t.width/2-5)+", "+t.width/2+")");let r=t.diff||0;return t.clusterNode?e.attr("transform","translate("+(t.x+r-t.width/2)+", "+(t.y-t.height/2-8)+")"):e.attr("transform","translate("+t.x+", "+t.y+")"),r},"positionNode");function ee(t,e,r=!1){let a,i="default";(t?.classes?.length||0)>0&&(i=(t?.classes??[]).join(" ")),i+=" flowchart-label";let s=0,n="";switch(t.type){case"round":s=5,n="rect";break;case"composite":s=0,n="composite",a=0;break;case"square":case"group":default:n="rect";break;case"diamond":n="question";break;case"hexagon":n="hexagon";break;case"block_arrow":n="block_arrow";break;case"odd":case"rect_left_inv_arrow":n="rect_left_inv_arrow";break;case"lean_right":n="lean_right";break;case"lean_left":n="lean_left";break;case"trapezoid":n="trapezoid";break;case"inv_trapezoid":n="inv_trapezoid";break;case"circle":n="circle";break;case"ellipse":n="ellipse";break;case"stadium":n="stadium";break;case"subroutine":n="subroutine";break;case"cylinder":n="cylinder";break;case"doublecircle":n="doublecircle"}let d=(0,l.sM)(t?.styles??[]),c=t.label,h=t.size??{width:0,height:0,x:0,y:0};return{labelStyle:d.labelStyle,shape:n,labelText:c,rx:s,ry:s,class:i,style:d.style,id:t.id,directions:t.directions,width:h.width,height:h.height,x:h.x,y:h.y,positioned:r,intersect:void 0,type:t.type,padding:a??(0,o.zj)()?.block?.padding??0}}async function er(t,e,r){let a=ee(e,r,!1);if("group"===a.type)return;let i=(0,o.zj)(),s=await t6(t,a,{config:i}),n=s.node().getBBox(),l=r.getBlock(a.id);l.size={width:n.width,height:n.height,x:0,y:0,node:s},r.setBlock(l),s.remove()}async function ea(t,e,r){let a=ee(e,r,!0);if("space"!==r.getBlock(a.id).type){let r=(0,o.zj)();await t6(t,a,{config:r}),e.intersect=a?.intersect,et(a)}}async function ei(t,e,r,a){for(let i of e)await a(t,i,r),i.children&&await ei(t,i.children,r,a)}async function es(t,e,r){await ei(t,e,r,er)}async function en(t,e,r){await ei(t,e,r,ea)}async function el(t,e,r,a,i){let s=new y.T({multigraph:!0,compound:!0});for(let t of(s.setGraph({rankdir:"TB",nodesep:10,ranksep:10,marginx:8,marginy:8}),r))t.size&&s.setNode(t.id,{width:t.size.width,height:t.size.height,intersect:t.intersect});for(let r of e)if(r.start&&r.end){let e=a.getBlock(r.start),n=a.getBlock(r.end);if(e?.size&&n?.size){let a=e.size,l=n.size,o=[{x:a.x,y:a.y},{x:a.x+(l.x-a.x)/2,y:a.y+(l.y-a.y)/2},{x:l.x,y:l.y}];t_(t,{v:r.start,w:r.end,name:r.id},{...r,arrowTypeEnd:r.arrowTypeEnd,arrowTypeStart:r.arrowTypeStart,points:o,classes:"edge-thickness-normal edge-pattern-solid flowchart-link LS-a1 LE-b1"},void 0,"block",s,i),r.label&&(await tf(t,{...r,label:r.label,labelStyle:"stroke: #333; stroke-width: 1.5px;fill:none;",arrowTypeEnd:r.arrowTypeEnd,arrowTypeStart:r.arrowTypeStart,points:o,classes:"edge-thickness-normal edge-pattern-solid flowchart-link LS-a1 LE-b1"}),tw({...r,x:o[1].x,y:o[1].y},{originalPath:o}))}}}(0,o.K2)(ee,"getNodeFromBlock"),(0,o.K2)(er,"calculateBlockSize"),(0,o.K2)(ea,"insertBlockPositioned"),(0,o.K2)(ei,"performOperations"),(0,o.K2)(es,"calculateBlockSizes"),(0,o.K2)(en,"insertBlocks"),(0,o.K2)(el,"insertEdges");var eo=(0,o.K2)(function(t,e){return e.db.getClasses()},"getClasses"),ed={parser:p,db:j,renderer:{draw:(0,o.K2)(async function(t,e,r,a){let i,{securityLevel:s,block:n}=(0,o.zj)(),l=a.db;"sandbox"===s&&(i=(0,g.Lt)("#i"+e));let d="sandbox"===s?(0,g.Lt)(i.nodes()[0].contentDocument.body):(0,g.Lt)("body"),c="sandbox"===s?d.select(`[id="${e}"]`):(0,g.Lt)(`[id="${e}"]`);Z(c,["point","circle","cross"],a.type,e);let h=l.getBlocks(),y=l.getBlocksFlat(),u=l.getEdges(),p=c.insert("g").attr("class","block");await es(p,h,l);let x=td(l);if(await en(p,h,l),await el(p,u,y,l,e),x){let t=Math.max(1,Math.round(.125*(x.width/x.height))),e=x.height+t+10,r=x.width+10,{useMaxWidth:a}=n;(0,o.a$)(c,e,r,!!a),o.Rm.debug("Here Bounds",x,x),c.attr("viewBox",`${x.x-5} ${x.y-5} ${x.width+10} ${x.height+10}`)}},"draw"),getClasses:eo},styles:H}},8987(t,e,r){r.d(e,{o:()=>a});var a=(0,r(8755).K2)(()=>`
118
+ /* Font Awesome icon styling - consolidated */
119
+ .label-icon {
120
+ display: inline-block;
121
+ height: 1em;
122
+ overflow: visible;
123
+ vertical-align: -0.125em;
124
+ }
125
+
126
+ .node .label-icon path {
127
+ fill: currentColor;
128
+ stroke: revert;
129
+ stroke-width: revert;
130
+ }
131
+ `,"getIconStyles")}}]);
@@ -0,0 +1 @@
1
+ (self.rspackChunkchat_demo=self.rspackChunkchat_demo||[]).push([[4695],{9050(){Prism.languages.lua={comment:/^#!.+|--(?:\[(=*)\[[\s\S]*?\]\1\]|.*)/m,string:{pattern:/(["'])(?:(?!\1)[^\\\r\n]|\\z(?:\r\n|\s)|\\(?:\r\n|[^z]))*\1|\[(=*)\[[\s\S]*?\]\2\]/,greedy:!0},number:/\b0x[a-f\d]+(?:\.[a-f\d]*)?(?:p[+-]?\d+)?\b|\b\d+(?:\.\B|(?:\.\d*)?(?:e[+-]?\d+)?\b)|\B\.\d+(?:e[+-]?\d+)?\b/i,keyword:/\b(?:and|break|do|else|elseif|end|false|for|function|goto|if|in|local|nil|not|or|repeat|return|then|true|until|while)\b/,function:/(?!\d)\w+(?=\s*(?:[({]))/,operator:[/[-+*%^&|#]|\/\/?|<[<=]?|>[>=]?|[=~]=?/,{pattern:/(^|[^.])\.\.(?!\.)/,lookbehind:!0}],punctuation:/[\[\](){},;]|\.+|:+/}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.rspackChunkchat_demo=self.rspackChunkchat_demo||[]).push([[4959],{4226(s,e,c){c.r(s.exports={})}}]);
@@ -0,0 +1,59 @@
1
+ "use strict";(self.rspackChunkchat_demo=self.rspackChunkchat_demo||[]).push([[509],{4543(e,t,s){s.d(t,{P:()=>r});var i=s(8755),r=(0,i.K2)((e,t,s,r)=>{e.attr("class",s);let{width:l,height:c,x:o,y:h}=n(e,t);(0,i.a$)(e,c,l,r);let u=a(o,h,l,c,t);e.attr("viewBox",u),i.Rm.debug(`viewBox configured: ${u} with padding: ${t}`)},"setupViewPortForSVG"),n=(0,i.K2)((e,t)=>{let s=e.node()?.getBBox()||{width:0,height:0,x:0,y:0};return{width:s.width+2*t,height:s.height+2*t,x:s.x,y:s.y}},"calculateDimensionsWithPadding"),a=(0,i.K2)((e,t,s,i,r)=>`${e-r} ${t-r} ${s} ${i}`,"createViewBox")},6982(e,t,s){s.d(t,{A:()=>n});var i=s(8755),r=s(6040),n=(0,i.K2)((e,t)=>{let s;return"sandbox"===t&&(s=(0,r.Lt)("#i"+e)),("sandbox"===t?(0,r.Lt)(s.nodes()[0].contentDocument.body):(0,r.Lt)("body")).select(`[id="${e}"]`)},"getDiagramElement")},7148(e,t,s){s.d(t,{diagram:()=>m});var i=s(6982),r=s(4543),n=s(5754);s(9462),s(5939),s(7618),s(5040),s(5695),s(3919);var a=s(3218),l=s(8755),c=function(){var e=(0,l.K2)(function(e,t,s,i){for(s=s||{},i=e.length;i--;s[e[i]]=t);return s},"o"),t=[1,3],s=[1,4],i=[1,5],r=[1,6],n=[5,6,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,77,89,90],a=[1,22],c=[2,7],o=[1,26],h=[1,27],u=[1,28],y=[1,29],m=[1,33],E=[1,34],d=[1,35],R=[1,36],p=[1,37],f=[1,38],_=[1,24],g=[1,31],S=[1,32],I=[1,30],b=[1,39],T=[1,40],k=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,77,89,90],N=[1,61],q=[89,90],A=[5,8,9,11,13,21,22,23,24,27,29,41,42,43,44,45,46,54,61,63,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],C=[27,29],v=[1,70],L=[1,71],x=[1,72],D=[1,73],w=[1,74],O=[1,75],$=[1,76],M=[1,83],F=[1,80],K=[1,84],P=[1,85],V=[1,86],U=[1,87],Y=[1,88],B=[1,89],Q=[1,90],H=[1,91],W=[1,92],j=[5,8,9,11,13,21,22,23,24,27,41,42,43,44,45,46,54,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],G=[63,64],z=[1,101],X=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,76,77,89,90],J=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],Z=[1,110],ee=[1,106],et=[1,107],es=[1,108],ei=[1,109],er=[1,111],en=[1,116],ea=[1,117],el=[1,114],ec=[1,115],eo={trace:(0,l.K2)(function(){},"trace"),yy:{},symbols_:{error:2,start:3,directive:4,NEWLINE:5,RD:6,diagram:7,EOF:8,acc_title:9,acc_title_value:10,acc_descr:11,acc_descr_value:12,acc_descr_multiline_value:13,requirementDef:14,elementDef:15,relationshipDef:16,direction:17,styleStatement:18,classDefStatement:19,classStatement:20,direction_tb:21,direction_bt:22,direction_rl:23,direction_lr:24,requirementType:25,requirementName:26,STRUCT_START:27,requirementBody:28,STYLE_SEPARATOR:29,idList:30,ID:31,COLONSEP:32,id:33,TEXT:34,text:35,RISK:36,riskLevel:37,VERIFYMTHD:38,verifyType:39,STRUCT_STOP:40,REQUIREMENT:41,FUNCTIONAL_REQUIREMENT:42,INTERFACE_REQUIREMENT:43,PERFORMANCE_REQUIREMENT:44,PHYSICAL_REQUIREMENT:45,DESIGN_CONSTRAINT:46,LOW_RISK:47,MED_RISK:48,HIGH_RISK:49,VERIFY_ANALYSIS:50,VERIFY_DEMONSTRATION:51,VERIFY_INSPECTION:52,VERIFY_TEST:53,ELEMENT:54,elementName:55,elementBody:56,TYPE:57,type:58,DOCREF:59,ref:60,END_ARROW_L:61,relationship:62,LINE:63,END_ARROW_R:64,CONTAINS:65,COPIES:66,DERIVES:67,SATISFIES:68,VERIFIES:69,REFINES:70,TRACES:71,CLASSDEF:72,stylesOpt:73,CLASS:74,ALPHA:75,COMMA:76,STYLE:77,style:78,styleComponent:79,NUM:80,COLON:81,UNIT:82,SPACE:83,BRKT:84,PCT:85,MINUS:86,LABEL:87,SEMICOLON:88,unqString:89,qString:90,$accept:0,$end:1},terminals_:{2:"error",5:"NEWLINE",6:"RD",8:"EOF",9:"acc_title",10:"acc_title_value",11:"acc_descr",12:"acc_descr_value",13:"acc_descr_multiline_value",21:"direction_tb",22:"direction_bt",23:"direction_rl",24:"direction_lr",27:"STRUCT_START",29:"STYLE_SEPARATOR",31:"ID",32:"COLONSEP",34:"TEXT",36:"RISK",38:"VERIFYMTHD",40:"STRUCT_STOP",41:"REQUIREMENT",42:"FUNCTIONAL_REQUIREMENT",43:"INTERFACE_REQUIREMENT",44:"PERFORMANCE_REQUIREMENT",45:"PHYSICAL_REQUIREMENT",46:"DESIGN_CONSTRAINT",47:"LOW_RISK",48:"MED_RISK",49:"HIGH_RISK",50:"VERIFY_ANALYSIS",51:"VERIFY_DEMONSTRATION",52:"VERIFY_INSPECTION",53:"VERIFY_TEST",54:"ELEMENT",57:"TYPE",59:"DOCREF",61:"END_ARROW_L",63:"LINE",64:"END_ARROW_R",65:"CONTAINS",66:"COPIES",67:"DERIVES",68:"SATISFIES",69:"VERIFIES",70:"REFINES",71:"TRACES",72:"CLASSDEF",74:"CLASS",75:"ALPHA",76:"COMMA",77:"STYLE",80:"NUM",81:"COLON",82:"UNIT",83:"SPACE",84:"BRKT",85:"PCT",86:"MINUS",87:"LABEL",88:"SEMICOLON",89:"unqString",90:"qString"},productions_:[0,[3,3],[3,2],[3,4],[4,2],[4,2],[4,1],[7,0],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[17,1],[17,1],[17,1],[17,1],[14,5],[14,7],[28,5],[28,5],[28,5],[28,5],[28,2],[28,1],[25,1],[25,1],[25,1],[25,1],[25,1],[25,1],[37,1],[37,1],[37,1],[39,1],[39,1],[39,1],[39,1],[15,5],[15,7],[56,5],[56,5],[56,2],[56,1],[16,5],[16,5],[62,1],[62,1],[62,1],[62,1],[62,1],[62,1],[62,1],[19,3],[20,3],[20,3],[30,1],[30,3],[30,1],[30,3],[18,3],[73,1],[73,3],[78,1],[78,2],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[26,1],[26,1],[33,1],[33,1],[35,1],[35,1],[55,1],[55,1],[58,1],[58,1],[60,1],[60,1]],performAction:(0,l.K2)(function(e,t,s,i,r,n,a){var l=n.length-1;switch(r){case 4:this.$=n[l].trim(),i.setAccTitle(this.$);break;case 5:case 6:this.$=n[l].trim(),i.setAccDescription(this.$);break;case 7:this.$=[];break;case 17:i.setDirection("TB");break;case 18:i.setDirection("BT");break;case 19:i.setDirection("RL");break;case 20:i.setDirection("LR");break;case 21:i.addRequirement(n[l-3],n[l-4]);break;case 22:i.addRequirement(n[l-5],n[l-6]),i.setClass([n[l-5]],n[l-3]);break;case 23:i.setNewReqId(n[l-2]);break;case 24:i.setNewReqText(n[l-2]);break;case 25:i.setNewReqRisk(n[l-2]);break;case 26:i.setNewReqVerifyMethod(n[l-2]);break;case 29:this.$=i.RequirementType.REQUIREMENT;break;case 30:this.$=i.RequirementType.FUNCTIONAL_REQUIREMENT;break;case 31:this.$=i.RequirementType.INTERFACE_REQUIREMENT;break;case 32:this.$=i.RequirementType.PERFORMANCE_REQUIREMENT;break;case 33:this.$=i.RequirementType.PHYSICAL_REQUIREMENT;break;case 34:this.$=i.RequirementType.DESIGN_CONSTRAINT;break;case 35:this.$=i.RiskLevel.LOW_RISK;break;case 36:this.$=i.RiskLevel.MED_RISK;break;case 37:this.$=i.RiskLevel.HIGH_RISK;break;case 38:this.$=i.VerifyType.VERIFY_ANALYSIS;break;case 39:this.$=i.VerifyType.VERIFY_DEMONSTRATION;break;case 40:this.$=i.VerifyType.VERIFY_INSPECTION;break;case 41:this.$=i.VerifyType.VERIFY_TEST;break;case 42:i.addElement(n[l-3]);break;case 43:i.addElement(n[l-5]),i.setClass([n[l-5]],n[l-3]);break;case 44:i.setNewElementType(n[l-2]);break;case 45:i.setNewElementDocRef(n[l-2]);break;case 48:i.addRelationship(n[l-2],n[l],n[l-4]);break;case 49:i.addRelationship(n[l-2],n[l-4],n[l]);break;case 50:this.$=i.Relationships.CONTAINS;break;case 51:this.$=i.Relationships.COPIES;break;case 52:this.$=i.Relationships.DERIVES;break;case 53:this.$=i.Relationships.SATISFIES;break;case 54:this.$=i.Relationships.VERIFIES;break;case 55:this.$=i.Relationships.REFINES;break;case 56:this.$=i.Relationships.TRACES;break;case 57:this.$=n[l-2],i.defineClass(n[l-1],n[l]);break;case 58:i.setClass(n[l-1],n[l]);break;case 59:i.setClass([n[l-2]],n[l]);break;case 60:case 62:case 65:this.$=[n[l]];break;case 61:case 63:this.$=n[l-2].concat([n[l]]);break;case 64:this.$=n[l-2],i.setCssStyle(n[l-1],n[l]);break;case 66:n[l-2].push(n[l]),this.$=n[l-2];break;case 68:this.$=n[l-1]+n[l]}},"anonymous"),table:[{3:1,4:2,6:t,9:s,11:i,13:r},{1:[3]},{3:8,4:2,5:[1,7],6:t,9:s,11:i,13:r},{5:[1,9]},{10:[1,10]},{12:[1,11]},e(n,[2,6]),{3:12,4:2,6:t,9:s,11:i,13:r},{1:[2,2]},{4:17,5:a,7:13,8:c,9:s,11:i,13:r,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:o,22:h,23:u,24:y,25:23,33:25,41:m,42:E,43:d,44:R,45:p,46:f,54:_,72:g,74:S,77:I,89:b,90:T},e(n,[2,4]),e(n,[2,5]),{1:[2,1]},{8:[1,41]},{4:17,5:a,7:42,8:c,9:s,11:i,13:r,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:o,22:h,23:u,24:y,25:23,33:25,41:m,42:E,43:d,44:R,45:p,46:f,54:_,72:g,74:S,77:I,89:b,90:T},{4:17,5:a,7:43,8:c,9:s,11:i,13:r,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:o,22:h,23:u,24:y,25:23,33:25,41:m,42:E,43:d,44:R,45:p,46:f,54:_,72:g,74:S,77:I,89:b,90:T},{4:17,5:a,7:44,8:c,9:s,11:i,13:r,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:o,22:h,23:u,24:y,25:23,33:25,41:m,42:E,43:d,44:R,45:p,46:f,54:_,72:g,74:S,77:I,89:b,90:T},{4:17,5:a,7:45,8:c,9:s,11:i,13:r,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:o,22:h,23:u,24:y,25:23,33:25,41:m,42:E,43:d,44:R,45:p,46:f,54:_,72:g,74:S,77:I,89:b,90:T},{4:17,5:a,7:46,8:c,9:s,11:i,13:r,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:o,22:h,23:u,24:y,25:23,33:25,41:m,42:E,43:d,44:R,45:p,46:f,54:_,72:g,74:S,77:I,89:b,90:T},{4:17,5:a,7:47,8:c,9:s,11:i,13:r,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:o,22:h,23:u,24:y,25:23,33:25,41:m,42:E,43:d,44:R,45:p,46:f,54:_,72:g,74:S,77:I,89:b,90:T},{4:17,5:a,7:48,8:c,9:s,11:i,13:r,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:o,22:h,23:u,24:y,25:23,33:25,41:m,42:E,43:d,44:R,45:p,46:f,54:_,72:g,74:S,77:I,89:b,90:T},{4:17,5:a,7:49,8:c,9:s,11:i,13:r,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:o,22:h,23:u,24:y,25:23,33:25,41:m,42:E,43:d,44:R,45:p,46:f,54:_,72:g,74:S,77:I,89:b,90:T},{4:17,5:a,7:50,8:c,9:s,11:i,13:r,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:o,22:h,23:u,24:y,25:23,33:25,41:m,42:E,43:d,44:R,45:p,46:f,54:_,72:g,74:S,77:I,89:b,90:T},{26:51,89:[1,52],90:[1,53]},{55:54,89:[1,55],90:[1,56]},{29:[1,59],61:[1,57],63:[1,58]},e(k,[2,17]),e(k,[2,18]),e(k,[2,19]),e(k,[2,20]),{30:60,33:62,75:N,89:b,90:T},{30:63,33:62,75:N,89:b,90:T},{30:64,33:62,75:N,89:b,90:T},e(q,[2,29]),e(q,[2,30]),e(q,[2,31]),e(q,[2,32]),e(q,[2,33]),e(q,[2,34]),e(A,[2,81]),e(A,[2,82]),{1:[2,3]},{8:[2,8]},{8:[2,9]},{8:[2,10]},{8:[2,11]},{8:[2,12]},{8:[2,13]},{8:[2,14]},{8:[2,15]},{8:[2,16]},{27:[1,65],29:[1,66]},e(C,[2,79]),e(C,[2,80]),{27:[1,67],29:[1,68]},e(C,[2,85]),e(C,[2,86]),{62:69,65:v,66:L,67:x,68:D,69:w,70:O,71:$},{62:77,65:v,66:L,67:x,68:D,69:w,70:O,71:$},{30:78,33:62,75:N,89:b,90:T},{73:79,75:M,76:F,78:81,79:82,80:K,81:P,82:V,83:U,84:Y,85:B,86:Q,87:H,88:W},e(j,[2,60]),e(j,[2,62]),{73:93,75:M,76:F,78:81,79:82,80:K,81:P,82:V,83:U,84:Y,85:B,86:Q,87:H,88:W},{30:94,33:62,75:N,76:F,89:b,90:T},{5:[1,95]},{30:96,33:62,75:N,89:b,90:T},{5:[1,97]},{30:98,33:62,75:N,89:b,90:T},{63:[1,99]},e(G,[2,50]),e(G,[2,51]),e(G,[2,52]),e(G,[2,53]),e(G,[2,54]),e(G,[2,55]),e(G,[2,56]),{64:[1,100]},e(k,[2,59],{76:F}),e(k,[2,64],{76:z}),{33:103,75:[1,102],89:b,90:T},e(X,[2,65],{79:104,75:M,80:K,81:P,82:V,83:U,84:Y,85:B,86:Q,87:H,88:W}),e(J,[2,67]),e(J,[2,69]),e(J,[2,70]),e(J,[2,71]),e(J,[2,72]),e(J,[2,73]),e(J,[2,74]),e(J,[2,75]),e(J,[2,76]),e(J,[2,77]),e(J,[2,78]),e(k,[2,57],{76:z}),e(k,[2,58],{76:F}),{5:Z,28:105,31:ee,34:et,36:es,38:ei,40:er},{27:[1,112],76:F},{5:en,40:ea,56:113,57:el,59:ec},{27:[1,118],76:F},{33:119,89:b,90:T},{33:120,89:b,90:T},{75:M,78:121,79:82,80:K,81:P,82:V,83:U,84:Y,85:B,86:Q,87:H,88:W},e(j,[2,61]),e(j,[2,63]),e(J,[2,68]),e(k,[2,21]),{32:[1,122]},{32:[1,123]},{32:[1,124]},{32:[1,125]},{5:Z,28:126,31:ee,34:et,36:es,38:ei,40:er},e(k,[2,28]),{5:[1,127]},e(k,[2,42]),{32:[1,128]},{32:[1,129]},{5:en,40:ea,56:130,57:el,59:ec},e(k,[2,47]),{5:[1,131]},e(k,[2,48]),e(k,[2,49]),e(X,[2,66],{79:104,75:M,80:K,81:P,82:V,83:U,84:Y,85:B,86:Q,87:H,88:W}),{33:132,89:b,90:T},{35:133,89:[1,134],90:[1,135]},{37:136,47:[1,137],48:[1,138],49:[1,139]},{39:140,50:[1,141],51:[1,142],52:[1,143],53:[1,144]},e(k,[2,27]),{5:Z,28:145,31:ee,34:et,36:es,38:ei,40:er},{58:146,89:[1,147],90:[1,148]},{60:149,89:[1,150],90:[1,151]},e(k,[2,46]),{5:en,40:ea,56:152,57:el,59:ec},{5:[1,153]},{5:[1,154]},{5:[2,83]},{5:[2,84]},{5:[1,155]},{5:[2,35]},{5:[2,36]},{5:[2,37]},{5:[1,156]},{5:[2,38]},{5:[2,39]},{5:[2,40]},{5:[2,41]},e(k,[2,22]),{5:[1,157]},{5:[2,87]},{5:[2,88]},{5:[1,158]},{5:[2,89]},{5:[2,90]},e(k,[2,43]),{5:Z,28:159,31:ee,34:et,36:es,38:ei,40:er},{5:Z,28:160,31:ee,34:et,36:es,38:ei,40:er},{5:Z,28:161,31:ee,34:et,36:es,38:ei,40:er},{5:Z,28:162,31:ee,34:et,36:es,38:ei,40:er},{5:en,40:ea,56:163,57:el,59:ec},{5:en,40:ea,56:164,57:el,59:ec},e(k,[2,23]),e(k,[2,24]),e(k,[2,25]),e(k,[2,26]),e(k,[2,44]),e(k,[2,45])],defaultActions:{8:[2,2],12:[2,1],41:[2,3],42:[2,8],43:[2,9],44:[2,10],45:[2,11],46:[2,12],47:[2,13],48:[2,14],49:[2,15],50:[2,16],134:[2,83],135:[2,84],137:[2,35],138:[2,36],139:[2,37],141:[2,38],142:[2,39],143:[2,40],144:[2,41],147:[2,87],148:[2,88],150:[2,89],151:[2,90]},parseError:(0,l.K2)(function(e,t){if(t.recoverable)this.trace(e);else{var s=Error(e);throw s.hash=t,s}},"parseError"),parse:(0,l.K2)(function(e){var t=this,s=[0],i=[],r=[null],n=[],a=this.table,c="",o=0,h=0,u=0,y=n.slice.call(arguments,1),m=Object.create(this.lexer),E={};for(var d in this.yy)Object.prototype.hasOwnProperty.call(this.yy,d)&&(E[d]=this.yy[d]);m.setInput(e,E),E.lexer=m,E.parser=this,void 0===m.yylloc&&(m.yylloc={});var R=m.yylloc;n.push(R);var p=m.options&&m.options.ranges;function f(){var e;return"number"!=typeof(e=i.pop()||m.lex()||1)&&(e instanceof Array&&(e=(i=e).pop()),e=t.symbols_[e]||e),e}"function"==typeof E.parseError?this.parseError=E.parseError:this.parseError=Object.getPrototypeOf(this).parseError,(0,l.K2)(function(e){s.length=s.length-2*e,r.length=r.length-e,n.length=n.length-e},"popStack"),(0,l.K2)(f,"lex");for(var _,g,S,I,b,T,k,N,q,A={};;){if(S=s[s.length-1],this.defaultActions[S]?I=this.defaultActions[S]:(null==_&&(_=f()),I=a[S]&&a[S][_]),void 0===I||!I.length||!I[0]){var C="";for(T in q=[],a[S])this.terminals_[T]&&T>2&&q.push("'"+this.terminals_[T]+"'");C=m.showPosition?"Parse error on line "+(o+1)+":\n"+m.showPosition()+"\nExpecting "+q.join(", ")+", got '"+(this.terminals_[_]||_)+"'":"Parse error on line "+(o+1)+": Unexpected "+(1==_?"end of input":"'"+(this.terminals_[_]||_)+"'"),this.parseError(C,{text:m.match,token:this.terminals_[_]||_,line:m.yylineno,loc:R,expected:q})}if(I[0]instanceof Array&&I.length>1)throw Error("Parse Error: multiple actions possible at state: "+S+", token: "+_);switch(I[0]){case 1:s.push(_),r.push(m.yytext),n.push(m.yylloc),s.push(I[1]),_=null,g?(_=g,g=null):(h=m.yyleng,c=m.yytext,o=m.yylineno,R=m.yylloc,u>0&&u--);break;case 2:if(k=this.productions_[I[1]][1],A.$=r[r.length-k],A._$={first_line:n[n.length-(k||1)].first_line,last_line:n[n.length-1].last_line,first_column:n[n.length-(k||1)].first_column,last_column:n[n.length-1].last_column},p&&(A._$.range=[n[n.length-(k||1)].range[0],n[n.length-1].range[1]]),void 0!==(b=this.performAction.apply(A,[c,h,o,E,I[1],r,n].concat(y))))return b;k&&(s=s.slice(0,-1*k*2),r=r.slice(0,-1*k),n=n.slice(0,-1*k)),s.push(this.productions_[I[1]][0]),r.push(A.$),n.push(A._$),N=a[s[s.length-2]][s[s.length-1]],s.push(N);break;case 3:return!0}}return!0},"parse")};function eh(){this.yy={}}return eo.lexer={EOF:1,parseError:(0,l.K2)(function(e,t){if(this.yy.parser)this.yy.parser.parseError(e,t);else throw Error(e)},"parseError"),setInput:(0,l.K2)(function(e,t){return this.yy=t||this.yy||{},this._input=e,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:(0,l.K2)(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},"input"),unput:(0,l.K2)(function(e){var t=e.length,s=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var i=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),s.length-1&&(this.yylineno-=s.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:s?(s.length===i.length?this.yylloc.first_column:0)+i[i.length-s.length].length-s[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[r[0],r[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},"unput"),more:(0,l.K2)(function(){return this._more=!0,this},"more"),reject:(0,l.K2)(function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):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).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"reject"),less:(0,l.K2)(function(e){this.unput(this.match.slice(e))},"less"),pastInput:(0,l.K2)(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?"...":"")+e.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:(0,l.K2)(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:(0,l.K2)(function(){var e=this.pastInput(),t=Array(e.length+1).join("-");return e+this.upcomingInput()+"\n"+t+"^"},"showPosition"),test_match:(0,l.K2)(function(e,t){var s,i,r;if(this.options.backtrack_lexer&&(r={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(r.yylloc.range=this.yylloc.range.slice(0))),(i=e[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=i.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:i?i[i.length-1].length-i[i.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,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(e[0].length),this.matched+=e[0],s=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),s)return s;if(this._backtrack)for(var n in r)this[n]=r[n];return!1},"test_match"),next:(0,l.K2)(function(){if(this.done)return this.EOF;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var e,t,s,i,r=this._currentRules(),n=0;n<r.length;n++)if((s=this._input.match(this.rules[r[n]]))&&(!t||s[0].length>t[0].length)){if(t=s,i=n,this.options.backtrack_lexer){if(!1!==(e=this.test_match(s,r[n])))return e;if(!this._backtrack)return!1;t=!1;continue}if(!this.options.flex)break}return t?!1!==(e=this.test_match(t,r[i]))&&e:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:(0,l.K2)(function(){var e=this.next();return e||this.lex()},"lex"),begin:(0,l.K2)(function(e){this.conditionStack.push(e)},"begin"),popState:(0,l.K2)(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:(0,l.K2)(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:(0,l.K2)(function(e){return(e=this.conditionStack.length-1-Math.abs(e||0))>=0?this.conditionStack[e]:"INITIAL"},"topState"),pushState:(0,l.K2)(function(e){this.begin(e)},"pushState"),stateStackSize:(0,l.K2)(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:(0,l.K2)(function(e,t,s,i){switch(s){case 0:return"title";case 1:return this.begin("acc_title"),9;case 2:return this.popState(),"acc_title_value";case 3:return this.begin("acc_descr"),11;case 4:return this.popState(),"acc_descr_value";case 5:this.begin("acc_descr_multiline");break;case 6:case 58:case 65:this.popState();break;case 7:return"acc_descr_multiline_value";case 8:return 21;case 9:return 22;case 10:return 23;case 11:return 24;case 12:return 5;case 13:case 14:case 15:case 56:break;case 16:return 8;case 17:return 6;case 18:return 27;case 19:return 40;case 20:return 29;case 21:return 32;case 22:return 31;case 23:return 34;case 24:return 36;case 25:return 38;case 26:return 41;case 27:return 42;case 28:return 43;case 29:return 44;case 30:return 45;case 31:return 46;case 32:return 47;case 33:return 48;case 34:return 49;case 35:return 50;case 36:return 51;case 37:return 52;case 38:return 53;case 39:return 54;case 40:return 65;case 41:return 66;case 42:return 67;case 43:return 68;case 44:return 69;case 45:return 70;case 46:return 71;case 47:return 57;case 48:return 59;case 49:return this.begin("style"),77;case 50:case 68:return 75;case 51:return 81;case 52:return 88;case 53:return"PERCENT";case 54:return 86;case 55:return 84;case 57:case 64:this.begin("string");break;case 59:return this.begin("style"),72;case 60:return this.begin("style"),74;case 61:return 61;case 62:return 64;case 63:return 63;case 66:return"qString";case 67:return t.yytext=t.yytext.trim(),89;case 69:return 80;case 70:return 76}},"anonymous"),rules:[/^(?:title\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:(\r?\n)+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:%[^\n]*)/i,/^(?:$)/i,/^(?:requirementDiagram\b)/i,/^(?:\{)/i,/^(?:\})/i,/^(?::{3})/i,/^(?::)/i,/^(?:id\b)/i,/^(?:text\b)/i,/^(?:risk\b)/i,/^(?:verifyMethod\b)/i,/^(?:requirement\b)/i,/^(?:functionalRequirement\b)/i,/^(?:interfaceRequirement\b)/i,/^(?:performanceRequirement\b)/i,/^(?:physicalRequirement\b)/i,/^(?:designConstraint\b)/i,/^(?:low\b)/i,/^(?:medium\b)/i,/^(?:high\b)/i,/^(?:analysis\b)/i,/^(?:demonstration\b)/i,/^(?:inspection\b)/i,/^(?:test\b)/i,/^(?:element\b)/i,/^(?:contains\b)/i,/^(?:copies\b)/i,/^(?:derives\b)/i,/^(?:satisfies\b)/i,/^(?:verifies\b)/i,/^(?:refines\b)/i,/^(?:traces\b)/i,/^(?:type\b)/i,/^(?:docref\b)/i,/^(?:style\b)/i,/^(?:\w+)/i,/^(?::)/i,/^(?:;)/i,/^(?:%)/i,/^(?:-)/i,/^(?:#)/i,/^(?: )/i,/^(?:["])/i,/^(?:\n)/i,/^(?:classDef\b)/i,/^(?:class\b)/i,/^(?:<-)/i,/^(?:->)/i,/^(?:-)/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[\w][^:,\r\n\{\<\>\-\=]*)/i,/^(?:\w+)/i,/^(?:[0-9]+)/i,/^(?:,)/i],conditions:{acc_descr_multiline:{rules:[6,7,68,69,70],inclusive:!1},acc_descr:{rules:[4,68,69,70],inclusive:!1},acc_title:{rules:[2,68,69,70],inclusive:!1},style:{rules:[50,51,52,53,54,55,56,57,58,68,69,70],inclusive:!1},unqString:{rules:[68,69,70],inclusive:!1},token:{rules:[68,69,70],inclusive:!1},string:{rules:[65,66,68,69,70],inclusive:!1},INITIAL:{rules:[0,1,3,5,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,59,60,61,62,63,64,67,68,69,70],inclusive:!0}}},(0,l.K2)(eh,"Parser"),eh.prototype=eo,eo.Parser=eh,new eh}();c.parser=c;var o=class{constructor(){this.relations=[],this.latestRequirement=this.getInitialRequirement(),this.requirements=new Map,this.latestElement=this.getInitialElement(),this.elements=new Map,this.classes=new Map,this.direction="TB",this.RequirementType={REQUIREMENT:"Requirement",FUNCTIONAL_REQUIREMENT:"Functional Requirement",INTERFACE_REQUIREMENT:"Interface Requirement",PERFORMANCE_REQUIREMENT:"Performance Requirement",PHYSICAL_REQUIREMENT:"Physical Requirement",DESIGN_CONSTRAINT:"Design Constraint"},this.RiskLevel={LOW_RISK:"Low",MED_RISK:"Medium",HIGH_RISK:"High"},this.VerifyType={VERIFY_ANALYSIS:"Analysis",VERIFY_DEMONSTRATION:"Demonstration",VERIFY_INSPECTION:"Inspection",VERIFY_TEST:"Test"},this.Relationships={CONTAINS:"contains",COPIES:"copies",DERIVES:"derives",SATISFIES:"satisfies",VERIFIES:"verifies",REFINES:"refines",TRACES:"traces"},this.setAccTitle=l.SV,this.getAccTitle=l.iN,this.setAccDescription=l.EI,this.getAccDescription=l.m7,this.setDiagramTitle=l.ke,this.getDiagramTitle=l.ab,this.getConfig=(0,l.K2)(()=>(0,l.D7)().requirement,"getConfig"),this.clear(),this.setDirection=this.setDirection.bind(this),this.addRequirement=this.addRequirement.bind(this),this.setNewReqId=this.setNewReqId.bind(this),this.setNewReqRisk=this.setNewReqRisk.bind(this),this.setNewReqText=this.setNewReqText.bind(this),this.setNewReqVerifyMethod=this.setNewReqVerifyMethod.bind(this),this.addElement=this.addElement.bind(this),this.setNewElementType=this.setNewElementType.bind(this),this.setNewElementDocRef=this.setNewElementDocRef.bind(this),this.addRelationship=this.addRelationship.bind(this),this.setCssStyle=this.setCssStyle.bind(this),this.setClass=this.setClass.bind(this),this.defineClass=this.defineClass.bind(this),this.setAccTitle=this.setAccTitle.bind(this),this.setAccDescription=this.setAccDescription.bind(this)}static{(0,l.K2)(this,"RequirementDB")}getDirection(){return this.direction}setDirection(e){this.direction=e}resetLatestRequirement(){this.latestRequirement=this.getInitialRequirement()}resetLatestElement(){this.latestElement=this.getInitialElement()}getInitialRequirement(){return{requirementId:"",text:"",risk:"",verifyMethod:"",name:"",type:"",cssStyles:[],classes:["default"]}}getInitialElement(){return{name:"",type:"",docRef:"",cssStyles:[],classes:["default"]}}addRequirement(e,t){return this.requirements.has(e)||this.requirements.set(e,{name:e,type:t,requirementId:this.latestRequirement.requirementId,text:this.latestRequirement.text,risk:this.latestRequirement.risk,verifyMethod:this.latestRequirement.verifyMethod,cssStyles:[],classes:["default"]}),this.resetLatestRequirement(),this.requirements.get(e)}getRequirements(){return this.requirements}setNewReqId(e){void 0!==this.latestRequirement&&(this.latestRequirement.requirementId=e)}setNewReqText(e){void 0!==this.latestRequirement&&(this.latestRequirement.text=e)}setNewReqRisk(e){void 0!==this.latestRequirement&&(this.latestRequirement.risk=e)}setNewReqVerifyMethod(e){void 0!==this.latestRequirement&&(this.latestRequirement.verifyMethod=e)}addElement(e){return this.elements.has(e)||(this.elements.set(e,{name:e,type:this.latestElement.type,docRef:this.latestElement.docRef,cssStyles:[],classes:["default"]}),l.Rm.info("Added new element: ",e)),this.resetLatestElement(),this.elements.get(e)}getElements(){return this.elements}setNewElementType(e){void 0!==this.latestElement&&(this.latestElement.type=e)}setNewElementDocRef(e){void 0!==this.latestElement&&(this.latestElement.docRef=e)}addRelationship(e,t,s){this.relations.push({type:e,src:t,dst:s})}getRelationships(){return this.relations}clear(){this.relations=[],this.resetLatestRequirement(),this.requirements=new Map,this.resetLatestElement(),this.elements=new Map,this.classes=new Map,(0,l.IU)()}setCssStyle(e,t){for(let s of e){let e=this.requirements.get(s)??this.elements.get(s);if(!t||!e)return;for(let s of t)s.includes(",")?e.cssStyles.push(...s.split(",")):e.cssStyles.push(s)}}setClass(e,t){for(let s of e){let e=this.requirements.get(s)??this.elements.get(s);if(e)for(let s of t){e.classes.push(s);let t=this.classes.get(s)?.styles;t&&e.cssStyles.push(...t)}}}defineClass(e,t){for(let s of e){let e=this.classes.get(s);void 0===e&&(e={id:s,styles:[],textStyles:[]},this.classes.set(s,e)),t&&t.forEach(function(t){if(/color/.exec(t)){let s=t.replace("fill","bgFill");e.textStyles.push(s)}e.styles.push(t)}),this.requirements.forEach(e=>{e.classes.includes(s)&&e.cssStyles.push(...t.flatMap(e=>e.split(",")))}),this.elements.forEach(e=>{e.classes.includes(s)&&e.cssStyles.push(...t.flatMap(e=>e.split(",")))})}}getClasses(){return this.classes}getData(){let e=(0,l.D7)(),t=[],s=[];for(let s of this.requirements.values())s.id=s.name,s.cssStyles=s.cssStyles,s.cssClasses=s.classes.join(" "),s.shape="requirementBox",s.look=e.look,t.push(s);for(let s of this.elements.values())s.shape="requirementBox",s.look=e.look,s.id=s.name,s.cssStyles=s.cssStyles,s.cssClasses=s.classes.join(" "),t.push(s);for(let t of this.relations){let i=0,r=t.type===this.Relationships.CONTAINS,n={id:`${t.src}-${t.dst}-${i}`,start:this.requirements.get(t.src)?.name??this.elements.get(t.src)?.name,end:this.requirements.get(t.dst)?.name??this.elements.get(t.dst)?.name,label:`&lt;&lt;${t.type}&gt;&gt;`,classes:"relationshipLine",style:["fill:none",r?"":"stroke-dasharray: 10,7"],labelpos:"c",thickness:"normal",type:"normal",pattern:r?"normal":"dashed",arrowTypeStart:r?"requirement_contains":"",arrowTypeEnd:r?"":"requirement_arrow",look:e.look};s.push(n),i++}return{nodes:t,edges:s,other:{},config:e,direction:this.getDirection()}}},h=(0,l.K2)(e=>`
2
+
3
+ marker {
4
+ fill: ${e.relationColor};
5
+ stroke: ${e.relationColor};
6
+ }
7
+
8
+ marker.cross {
9
+ stroke: ${e.lineColor};
10
+ }
11
+
12
+ svg {
13
+ font-family: ${e.fontFamily};
14
+ font-size: ${e.fontSize};
15
+ }
16
+
17
+ .reqBox {
18
+ fill: ${e.requirementBackground};
19
+ fill-opacity: 1.0;
20
+ stroke: ${e.requirementBorderColor};
21
+ stroke-width: ${e.requirementBorderSize};
22
+ }
23
+
24
+ .reqTitle, .reqLabel{
25
+ fill: ${e.requirementTextColor};
26
+ }
27
+ .reqLabelBox {
28
+ fill: ${e.relationLabelBackground};
29
+ fill-opacity: 1.0;
30
+ }
31
+
32
+ .req-title-line {
33
+ stroke: ${e.requirementBorderColor};
34
+ stroke-width: ${e.requirementBorderSize};
35
+ }
36
+ .relationshipLine {
37
+ stroke: ${e.relationColor};
38
+ stroke-width: 1;
39
+ }
40
+ .relationshipLabel {
41
+ fill: ${e.relationLabelColor};
42
+ }
43
+ .divider {
44
+ stroke: ${e.nodeBorder};
45
+ stroke-width: 1;
46
+ }
47
+ .label {
48
+ font-family: ${e.fontFamily};
49
+ color: ${e.nodeTextColor||e.textColor};
50
+ }
51
+ .label text,span {
52
+ fill: ${e.nodeTextColor||e.textColor};
53
+ color: ${e.nodeTextColor||e.textColor};
54
+ }
55
+ .labelBkg {
56
+ background-color: ${e.edgeLabelBackground};
57
+ }
58
+
59
+ `,"getStyles"),u={};(0,l.VA)(u,{draw:()=>y});var y=(0,l.K2)(async function(e,t,s,c){l.Rm.info("REF0:"),l.Rm.info("Drawing requirement diagram (unified)",t);let{securityLevel:o,state:h,layout:u}=(0,l.D7)(),y=c.db.getData(),m=(0,i.A)(t,o);y.type=c.type,y.layoutAlgorithm=(0,n.q7)(u),y.nodeSpacing=h?.nodeSpacing??50,y.rankSpacing=h?.rankSpacing??50,y.markers=["requirement_contains","requirement_arrow"],y.diagramId=t,await (0,n.XX)(y,m),a._K.insertTitle(m,"requirementDiagramTitleText",h?.titleTopMargin??25,c.db.getDiagramTitle()),(0,r.P)(m,8,"requirementDiagram",h?.useMaxWidth??!0)},"draw"),m={parser:c,get db(){return new o},renderer:u,styles:h}}}]);
@@ -0,0 +1,43 @@
1
+ "use strict";(self.rspackChunkchat_demo=self.rspackChunkchat_demo||[]).push([[5172],{2606(t,e,a){function r(t,e){t.accDescr&&e.setAccDescription?.(t.accDescr),t.accTitle&&e.setAccTitle?.(t.accTitle),t.title&&e.setDiagramTitle?.(t.title)}a.d(e,{S:()=>r}),(0,a(8755).K2)(r,"populateCommonDb")},5455(t,e,a){a.d(e,{diagram:()=>D});var r=a(2606),i=a(3218),l=a(5876),n=a(8755),s=a(9342),o={showLegend:!0,ticks:5,max:null,min:0,graticule:"circle"},c={axes:[],curves:[],options:o},d=structuredClone(c),g=n.UI.radar,h=(0,n.K2)(()=>(0,i.$t)({...g,...(0,n.zj)().radar}),"getConfig"),u=(0,n.K2)(()=>d.axes,"getAxes"),p=(0,n.K2)(()=>d.curves,"getCurves"),x=(0,n.K2)(()=>d.options,"getOptions"),m=(0,n.K2)(t=>{d.axes=t.map(t=>({name:t.name,label:t.label??t.name}))},"setAxes"),$=(0,n.K2)(t=>{d.curves=t.map(t=>({name:t.name,label:t.label??t.name,entries:f(t.entries)}))},"setCurves"),f=(0,n.K2)(t=>{if(void 0==t[0].axis)return t.map(t=>t.value);let e=u();if(0===e.length)throw Error("Axes must be populated before curves for reference entries");return e.map(e=>{let a=t.find(t=>t.axis?.$refText===e.name);if(void 0===a)throw Error("Missing entry for axis "+e.label);return a.value})},"computeCurveEntries"),y={getAxes:u,getCurves:p,getOptions:x,setAxes:m,setCurves:$,setOptions:(0,n.K2)(t=>{let e=t.reduce((t,e)=>(t[e.name]=e,t),{});d.options={showLegend:e.showLegend?.value??o.showLegend,ticks:e.ticks?.value??o.ticks,max:e.max?.value??o.max,min:e.min?.value??o.min,graticule:e.graticule?.value??o.graticule}},"setOptions"),getConfig:h,clear:(0,n.K2)(()=>{(0,n.IU)(),d=structuredClone(c)},"clear"),setAccTitle:n.SV,getAccTitle:n.iN,setDiagramTitle:n.ke,getDiagramTitle:n.ab,getAccDescription:n.m7,setAccDescription:n.EI},v=(0,n.K2)(t=>{(0,r.S)(t,y);let{axes:e,curves:a,options:i}=t;y.setAxes(e),y.setCurves(a),y.setOptions(i)},"populate"),w={parse:(0,n.K2)(async t=>{let e=await (0,s.qg)("radar",t);n.Rm.debug(e),v(e)},"parse")},C=(0,n.K2)((t,e,a,r)=>{let i=r.db,n=i.getAxes(),s=i.getCurves(),o=i.getOptions(),c=i.getConfig(),d=i.getDiagramTitle(),g=b((0,l.D)(e),c),h=o.max??Math.max(...s.map(t=>Math.max(...t.entries))),u=o.min,p=Math.min(c.width,c.height)/2;M(g,n,p,o.ticks,o.graticule),K(g,n,p,c),L(g,n,s,u,h,o.graticule,c),A(g,s,o.showLegend,c),g.append("text").attr("class","radarTitle").text(d).attr("x",0).attr("y",-c.height/2-c.marginTop)},"draw"),b=(0,n.K2)((t,e)=>{let a=e.width+e.marginLeft+e.marginRight,r=e.height+e.marginTop+e.marginBottom,i={x:e.marginLeft+e.width/2,y:e.marginTop+e.height/2};return t.attr("viewbox",`0 0 ${a} ${r}`).attr("width",a).attr("height",r),t.append("g").attr("transform",`translate(${i.x}, ${i.y})`)},"drawFrame"),M=(0,n.K2)((t,e,a,r,i)=>{if("circle"===i)for(let e=0;e<r;e++){let i=a*(e+1)/r;t.append("circle").attr("r",i).attr("class","radarGraticule")}else if("polygon"===i){let i=e.length;for(let l=0;l<r;l++){let n=a*(l+1)/r,s=e.map((t,e)=>{let a=2*e*Math.PI/i-Math.PI/2,r=n*Math.cos(a),l=n*Math.sin(a);return`${r},${l}`}).join(" ");t.append("polygon").attr("points",s).attr("class","radarGraticule")}}},"drawGraticule"),K=(0,n.K2)((t,e,a,r)=>{let i=e.length;for(let l=0;l<i;l++){let n=e[l].label,s=2*l*Math.PI/i-Math.PI/2;t.append("line").attr("x1",0).attr("y1",0).attr("x2",a*r.axisScaleFactor*Math.cos(s)).attr("y2",a*r.axisScaleFactor*Math.sin(s)).attr("class","radarAxisLine"),t.append("text").text(n).attr("x",a*r.axisLabelFactor*Math.cos(s)).attr("y",a*r.axisLabelFactor*Math.sin(s)).attr("class","radarAxisLabel")}},"drawAxes");function L(t,e,a,r,i,l,n){let s=e.length,o=Math.min(n.width,n.height)/2;a.forEach((e,a)=>{if(e.entries.length!==s)return;let c=e.entries.map((t,e)=>{let a=2*Math.PI*e/s-Math.PI/2,l=T(t,r,i,o);return{x:l*Math.cos(a),y:l*Math.sin(a)}});"circle"===l?t.append("path").attr("d",k(c,n.curveTension)).attr("class",`radarCurve-${a}`):"polygon"===l&&t.append("polygon").attr("points",c.map(t=>`${t.x},${t.y}`).join(" ")).attr("class",`radarCurve-${a}`)})}function T(t,e,a,r){return r*(Math.min(Math.max(t,e),a)-e)/(a-e)}function k(t,e){let a=t.length,r=`M${t[0].x},${t[0].y}`;for(let i=0;i<a;i++){let l=t[(i-1+a)%a],n=t[i],s=t[(i+1)%a],o=t[(i+2)%a],c={x:n.x+(s.x-l.x)*e,y:n.y+(s.y-l.y)*e},d={x:s.x-(o.x-n.x)*e,y:s.y-(o.y-n.y)*e};r+=` C${c.x},${c.y} ${d.x},${d.y} ${s.x},${s.y}`}return`${r} Z`}function A(t,e,a,r){if(!a)return;let i=(r.width/2+r.marginRight)*3/4,l=-(3*(r.height/2+r.marginTop))/4;e.forEach((e,a)=>{let r=t.append("g").attr("transform",`translate(${i}, ${l+20*a})`);r.append("rect").attr("width",12).attr("height",12).attr("class",`radarLegendBox-${a}`),r.append("text").attr("x",16).attr("y",0).attr("class","radarLegendText").text(e.label)})}(0,n.K2)(L,"drawCurves"),(0,n.K2)(T,"relativeRadius"),(0,n.K2)(k,"closedRoundCurve"),(0,n.K2)(A,"drawLegend");var S=(0,n.K2)((t,e)=>{let a="";for(let r=0;r<t.THEME_COLOR_LIMIT;r++){let i=t[`cScale${r}`];a+=`
2
+ .radarCurve-${r} {
3
+ color: ${i};
4
+ fill: ${i};
5
+ fill-opacity: ${e.curveOpacity};
6
+ stroke: ${i};
7
+ stroke-width: ${e.curveStrokeWidth};
8
+ }
9
+ .radarLegendBox-${r} {
10
+ fill: ${i};
11
+ fill-opacity: ${e.curveOpacity};
12
+ stroke: ${i};
13
+ }
14
+ `}return a},"genIndexStyles"),I=(0,n.K2)(t=>{let e=(0,n.P$)(),a=(0,n.zj)(),r=(0,i.$t)(e,a.themeVariables),l=(0,i.$t)(r.radar,t);return{themeVariables:r,radarOptions:l}},"buildRadarStyleOptions"),D={parser:w,db:y,renderer:{draw:C},styles:(0,n.K2)(({radar:t}={})=>{let{themeVariables:e,radarOptions:a}=I(t);return`
15
+ .radarTitle {
16
+ font-size: ${e.fontSize};
17
+ color: ${e.titleColor};
18
+ dominant-baseline: hanging;
19
+ text-anchor: middle;
20
+ }
21
+ .radarAxisLine {
22
+ stroke: ${a.axisColor};
23
+ stroke-width: ${a.axisStrokeWidth};
24
+ }
25
+ .radarAxisLabel {
26
+ dominant-baseline: middle;
27
+ text-anchor: middle;
28
+ font-size: ${a.axisLabelFontSize}px;
29
+ color: ${a.axisColor};
30
+ }
31
+ .radarGraticule {
32
+ fill: ${a.graticuleColor};
33
+ fill-opacity: ${a.graticuleOpacity};
34
+ stroke: ${a.graticuleColor};
35
+ stroke-width: ${a.graticuleStrokeWidth};
36
+ }
37
+ .radarLegendText {
38
+ text-anchor: start;
39
+ font-size: ${a.legendFontSize}px;
40
+ dominant-baseline: hanging;
41
+ }
42
+ ${S(e,a)}
43
+ `},"styles")}}}]);