@altimateai/ui-components 0.0.77-beta.7 → 0.0.77

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 (405) hide show
  1. package/dist/CoachForm.css +1 -1
  2. package/dist/CoachForm.js +24114 -67797
  3. package/dist/DbtDocsRenderer.js +1 -1
  4. package/dist/Stack.js +2274 -2824
  5. package/dist/Switch.js +87 -128
  6. package/dist/ToggleGroup.js +4788 -5963
  7. package/dist/_basePickBy.js +60 -60
  8. package/dist/_baseUniq.js +152 -152
  9. package/dist/arc.js +53 -53
  10. package/dist/architectureDiagram-VXUJARFQ.js +4315 -480
  11. package/dist/assets/icons/index.js +1 -1
  12. package/dist/blockDiagram-VD42YOAC.js +1 -1
  13. package/dist/c4Diagram-YG6GDRKO.js +22 -22
  14. package/dist/channel.js +2 -2
  15. package/dist/chatbotV2/index.d.ts +19 -57
  16. package/dist/chatbotV2/index.js +56 -91
  17. package/dist/chunk-4BX2VUAB.js +1 -1
  18. package/dist/chunk-55IACEB6.js +2 -2
  19. package/dist/chunk-B4BG7PRW.js +1 -1
  20. package/dist/chunk-DI55MBZ5.js +14 -14
  21. package/dist/chunk-FMBD7UC4.js +1 -1
  22. package/dist/chunk-QN33PNHL.js +5 -5
  23. package/dist/chunk-QZHKN3VN.js +1 -1
  24. package/dist/chunk-TZMSLE5B.js +1 -1
  25. package/dist/classDiagram-2ON5EDUG.js +1 -1
  26. package/dist/classDiagram-v2-WZHVMYZB.js +1 -1
  27. package/dist/cose-bilkent-S5V4N54A.js +2535 -160
  28. package/dist/dagre-6UL2VRFP.js +101 -101
  29. package/dist/dayjs.min.js +2 -2
  30. package/dist/defaultLocale.js +3 -3
  31. package/dist/diagram-PSM6KHXK.js +414 -198
  32. package/dist/diagram-QEK2KX5R.js +26 -26
  33. package/dist/diagram-S2PKOQOG.js +12 -12
  34. package/dist/erDiagram-Q2GNP2WA.js +1 -1
  35. package/dist/flowDiagram-NV44I4VS.js +6 -6
  36. package/dist/ganttDiagram-LVOFAZNH.js +1718 -843
  37. package/dist/gitGraphDiagram-NY62KEGX.js +13 -13
  38. package/dist/graph.js +18 -17
  39. package/dist/index.d.ts +6 -101
  40. package/dist/index.js +37 -37
  41. package/dist/index2.js +684 -216
  42. package/dist/infoDiagram-F6ZHWCRC.js +14 -14
  43. package/dist/journeyDiagram-XKPGCS4Q.js +1 -1
  44. package/dist/kanban-definition-3W4ZIXB7.js +42 -42
  45. package/dist/layout.js +678 -567
  46. package/dist/lineage/index.js +1315 -1308
  47. package/dist/linear.js +1 -1
  48. package/dist/main.css +1 -1
  49. package/dist/main.js +151 -151
  50. package/dist/mermaid-parser.core.js +155 -155
  51. package/dist/mindmap-definition-VGOIOE7T.js +28 -28
  52. package/dist/pieDiagram-ADFJNKIX.js +108 -68
  53. package/dist/quadrantDiagram-AYHSOK5B.js +1 -1
  54. package/dist/redux-toolkit.modern.js +555 -563
  55. package/dist/requirementDiagram-UZGBJVZJ.js +14 -14
  56. package/dist/sankeyDiagram-TZEHDZUN.js +622 -229
  57. package/dist/sequenceDiagram-WL72ISMW.js +1 -1
  58. package/dist/shadcn/index.d.ts +40 -24
  59. package/dist/shadcn/index.js +4733 -6547
  60. package/dist/stateDiagram-FKZM4ZOC.js +33 -33
  61. package/dist/stateDiagram-v2-4FDKWEC3.js +6 -6
  62. package/dist/storybook/Typography.stories.tsx +120 -93
  63. package/dist/timeline-definition-IT6M3QCI.js +63 -63
  64. package/dist/{types-UHJCpYj0.d.ts → types-ByRPUpXR.d.ts} +116 -25
  65. package/dist/xychartDiagram-PRI3JC2R.js +491 -449
  66. package/package.json +1 -1
  67. package/dist/abap.js +0 -6
  68. package/dist/actionscript-3.js +0 -6
  69. package/dist/ada.js +0 -6
  70. package/dist/andromeeda.js +0 -4
  71. package/dist/angular-html.js +0 -32
  72. package/dist/angular-ts.js +0 -21
  73. package/dist/apache.js +0 -6
  74. package/dist/apex.js +0 -6
  75. package/dist/apl.js +0 -16
  76. package/dist/applescript.js +0 -6
  77. package/dist/ara.js +0 -6
  78. package/dist/architectureDiagram-VXUJARFQ2.js +0 -831
  79. package/dist/asciidoc.js +0 -6
  80. package/dist/asm.js +0 -6
  81. package/dist/astro.js +0 -18
  82. package/dist/aurora-x.js +0 -4
  83. package/dist/awk.js +0 -6
  84. package/dist/ayu-dark.js +0 -4
  85. package/dist/ballerina.js +0 -6
  86. package/dist/band.js +0 -46
  87. package/dist/bat.js +0 -6
  88. package/dist/beancount.js +0 -6
  89. package/dist/berry.js +0 -6
  90. package/dist/bibtex.js +0 -6
  91. package/dist/bicep.js +0 -6
  92. package/dist/blade.js +0 -20
  93. package/dist/blockDiagram-VD42YOAC2.js +0 -2266
  94. package/dist/bsl.js +0 -8
  95. package/dist/c.js +0 -6
  96. package/dist/c3.js +0 -6
  97. package/dist/c4Diagram-YG6GDRKO2.js +0 -1582
  98. package/dist/cadence.js +0 -6
  99. package/dist/cairo.js +0 -8
  100. package/dist/catppuccin-frappe.js +0 -4
  101. package/dist/catppuccin-latte.js +0 -4
  102. package/dist/catppuccin-macchiato.js +0 -4
  103. package/dist/catppuccin-mocha.js +0 -4
  104. package/dist/chunk-4BX2VUAB2.js +0 -9
  105. package/dist/chunk-55IACEB62.js +0 -9
  106. package/dist/chunk-B4BG7PRW2.js +0 -1377
  107. package/dist/chunk-DI55MBZ52.js +0 -1382
  108. package/dist/chunk-FMBD7UC42.js +0 -19
  109. package/dist/chunk-QN33PNHL2.js +0 -20
  110. package/dist/chunk-QZHKN3VN2.js +0 -15
  111. package/dist/chunk-TZMSLE5B2.js +0 -64
  112. package/dist/clarity.js +0 -6
  113. package/dist/classDiagram-2ON5EDUG2.js +0 -17
  114. package/dist/classDiagram-v2-WZHVMYZB2.js +0 -17
  115. package/dist/clojure.js +0 -6
  116. package/dist/cmake.js +0 -6
  117. package/dist/cobol.js +0 -10
  118. package/dist/code-block-37QAKDTI.js +0 -27
  119. package/dist/codeowners.js +0 -6
  120. package/dist/codeql.js +0 -6
  121. package/dist/coffee.js +0 -8
  122. package/dist/common-lisp.js +0 -6
  123. package/dist/coq.js +0 -6
  124. package/dist/cose-bilkent-S5V4N54A2.js +0 -231
  125. package/dist/cpp.js +0 -18
  126. package/dist/crystal.js +0 -18
  127. package/dist/csharp.js +0 -6
  128. package/dist/css.js +0 -6
  129. package/dist/csv.js +0 -6
  130. package/dist/cue.js +0 -6
  131. package/dist/cypher.js +0 -6
  132. package/dist/cytoscape-cose-bilkent.js +0 -2380
  133. package/dist/cytoscape-fcose.js +0 -3840
  134. package/dist/d.js +0 -6
  135. package/dist/dagre-6UL2VRFP2.js +0 -447
  136. package/dist/dark-plus.js +0 -4
  137. package/dist/dart.js +0 -6
  138. package/dist/dax.js +0 -6
  139. package/dist/desktop.js +0 -6
  140. package/dist/diagram-PSM6KHXK2.js +0 -319
  141. package/dist/diagram-QEK2KX5R2.js +0 -221
  142. package/dist/diagram-S2PKOQOG2.js +0 -143
  143. package/dist/diff.js +0 -6
  144. package/dist/docker.js +0 -6
  145. package/dist/dotenv.js +0 -6
  146. package/dist/dracula-soft.js +0 -4
  147. package/dist/dracula.js +0 -4
  148. package/dist/dream-maker.js +0 -6
  149. package/dist/edge.js +0 -12
  150. package/dist/elixir.js +0 -8
  151. package/dist/elm.js +0 -8
  152. package/dist/emacs-lisp.js +0 -6
  153. package/dist/erDiagram-Q2GNP2WA2.js +0 -843
  154. package/dist/erb.js +0 -10
  155. package/dist/erlang.js +0 -8
  156. package/dist/everforest-dark.js +0 -4
  157. package/dist/everforest-light.js +0 -4
  158. package/dist/fennel.js +0 -6
  159. package/dist/fish.js +0 -6
  160. package/dist/flowDiagram-NV44I4VS2.js +0 -1628
  161. package/dist/fluent.js +0 -6
  162. package/dist/fortran-fixed-form.js +0 -8
  163. package/dist/fortran-free-form.js +0 -6
  164. package/dist/fsharp.js +0 -8
  165. package/dist/ganttDiagram-JELNMOA3.js +0 -1788
  166. package/dist/gdresource.js +0 -10
  167. package/dist/gdscript.js +0 -6
  168. package/dist/gdshader.js +0 -6
  169. package/dist/genie.js +0 -6
  170. package/dist/gherkin.js +0 -6
  171. package/dist/git-commit.js +0 -8
  172. package/dist/git-rebase.js +0 -8
  173. package/dist/gitGraphDiagram-NY62KEGX2.js +0 -713
  174. package/dist/github-dark-default.js +0 -4
  175. package/dist/github-dark-dimmed.js +0 -4
  176. package/dist/github-dark-high-contrast.js +0 -4
  177. package/dist/github-dark.js +0 -4
  178. package/dist/github-light-default.js +0 -4
  179. package/dist/github-light-high-contrast.js +0 -4
  180. package/dist/github-light.js +0 -4
  181. package/dist/gleam.js +0 -6
  182. package/dist/glimmer-js.js +0 -14
  183. package/dist/glimmer-ts.js +0 -14
  184. package/dist/glsl.js +0 -8
  185. package/dist/gn.js +0 -6
  186. package/dist/gnuplot.js +0 -6
  187. package/dist/go.js +0 -6
  188. package/dist/graph2.js +0 -246
  189. package/dist/graphql.js +0 -14
  190. package/dist/groovy.js +0 -6
  191. package/dist/gruvbox-dark-hard.js +0 -4
  192. package/dist/gruvbox-dark-medium.js +0 -4
  193. package/dist/gruvbox-dark-soft.js +0 -4
  194. package/dist/gruvbox-light-hard.js +0 -4
  195. package/dist/gruvbox-light-medium.js +0 -4
  196. package/dist/gruvbox-light-soft.js +0 -4
  197. package/dist/hack.js +0 -10
  198. package/dist/haml.js +0 -10
  199. package/dist/handlebars.js +0 -14
  200. package/dist/haskell.js +0 -6
  201. package/dist/haxe.js +0 -6
  202. package/dist/hcl.js +0 -6
  203. package/dist/hjson.js +0 -6
  204. package/dist/hlsl.js +0 -6
  205. package/dist/houston.js +0 -4
  206. package/dist/html-derivative.js +0 -8
  207. package/dist/html.js +0 -10
  208. package/dist/http.js +0 -14
  209. package/dist/hurl.js +0 -12
  210. package/dist/hxml.js +0 -8
  211. package/dist/hy.js +0 -6
  212. package/dist/imba.js +0 -6
  213. package/dist/index3.js +0 -689
  214. package/dist/infoDiagram-WHAUD3N6.js +0 -24
  215. package/dist/ini.js +0 -6
  216. package/dist/java.js +0 -6
  217. package/dist/javascript.js +0 -6
  218. package/dist/jinja.js +0 -11
  219. package/dist/jison.js +0 -8
  220. package/dist/journeyDiagram-XKPGCS4Q2.js +0 -837
  221. package/dist/json.js +0 -6
  222. package/dist/json5.js +0 -6
  223. package/dist/jsonc.js +0 -6
  224. package/dist/jsonl.js +0 -6
  225. package/dist/jsonnet.js +0 -6
  226. package/dist/jssm.js +0 -6
  227. package/dist/jsx.js +0 -6
  228. package/dist/julia.js +0 -16
  229. package/dist/kanagawa-dragon.js +0 -4
  230. package/dist/kanagawa-lotus.js +0 -4
  231. package/dist/kanagawa-wave.js +0 -4
  232. package/dist/kanban-definition-3W4ZIXB72.js +0 -720
  233. package/dist/katex2.js +0 -11691
  234. package/dist/kdl.js +0 -6
  235. package/dist/kotlin.js +0 -6
  236. package/dist/kusto.js +0 -6
  237. package/dist/laserwave.js +0 -4
  238. package/dist/latex.js +0 -8
  239. package/dist/layout2.js +0 -1224
  240. package/dist/lean.js +0 -6
  241. package/dist/less.js +0 -6
  242. package/dist/light-plus.js +0 -4
  243. package/dist/liquid.js +0 -14
  244. package/dist/llvm.js +0 -6
  245. package/dist/log.js +0 -6
  246. package/dist/logo.js +0 -6
  247. package/dist/lua.js +0 -8
  248. package/dist/luau.js +0 -6
  249. package/dist/make.js +0 -6
  250. package/dist/markdown.js +0 -6
  251. package/dist/marko.js +0 -14
  252. package/dist/material-theme-darker.js +0 -4
  253. package/dist/material-theme-lighter.js +0 -4
  254. package/dist/material-theme-ocean.js +0 -4
  255. package/dist/material-theme-palenight.js +0 -4
  256. package/dist/material-theme.js +0 -4
  257. package/dist/matlab.js +0 -6
  258. package/dist/mdc.js +0 -12
  259. package/dist/mdx.js +0 -6
  260. package/dist/mermaid-4DMBBIKO.js +0 -4
  261. package/dist/mermaid.js +0 -6
  262. package/dist/min-dark.js +0 -4
  263. package/dist/min-light.js +0 -4
  264. package/dist/mindmap-definition-VGOIOE7T2.js +0 -786
  265. package/dist/mipsasm.js +0 -6
  266. package/dist/mojo.js +0 -6
  267. package/dist/monokai.js +0 -4
  268. package/dist/moonbit.js +0 -6
  269. package/dist/move.js +0 -6
  270. package/dist/narrat.js +0 -6
  271. package/dist/nextflow.js +0 -6
  272. package/dist/nginx.js +0 -8
  273. package/dist/night-owl.js +0 -4
  274. package/dist/nim.js +0 -20
  275. package/dist/nix.js +0 -9
  276. package/dist/nord.js +0 -4
  277. package/dist/nushell.js +0 -6
  278. package/dist/objective-c.js +0 -6
  279. package/dist/objective-cpp.js +0 -6
  280. package/dist/ocaml.js +0 -6
  281. package/dist/one-dark-pro.js +0 -4
  282. package/dist/one-light.js +0 -4
  283. package/dist/openscad.js +0 -6
  284. package/dist/pascal.js +0 -6
  285. package/dist/perl.js +0 -16
  286. package/dist/php.js +0 -18
  287. package/dist/pie.js +0 -45
  288. package/dist/pieDiagram-ADFJNKIX2.js +0 -123
  289. package/dist/pkl.js +0 -6
  290. package/dist/plastic.js +0 -4
  291. package/dist/plsql.js +0 -6
  292. package/dist/po.js +0 -6
  293. package/dist/poimandres.js +0 -4
  294. package/dist/polar.js +0 -6
  295. package/dist/postcss.js +0 -6
  296. package/dist/powerquery.js +0 -6
  297. package/dist/powershell.js +0 -6
  298. package/dist/prisma.js +0 -6
  299. package/dist/prolog.js +0 -6
  300. package/dist/proto.js +0 -6
  301. package/dist/pug.js +0 -12
  302. package/dist/puppet.js +0 -6
  303. package/dist/purescript.js +0 -6
  304. package/dist/python.js +0 -6
  305. package/dist/qml.js +0 -8
  306. package/dist/qmldir.js +0 -6
  307. package/dist/qss.js +0 -6
  308. package/dist/quadrantDiagram-AYHSOK5B2.js +0 -1025
  309. package/dist/r.js +0 -6
  310. package/dist/racket.js +0 -6
  311. package/dist/raku.js +0 -6
  312. package/dist/razor.js +0 -10
  313. package/dist/red.js +0 -4
  314. package/dist/reg.js +0 -6
  315. package/dist/regexp.js +0 -6
  316. package/dist/rel.js +0 -6
  317. package/dist/requirementDiagram-UZGBJVZJ2.js +0 -852
  318. package/dist/riscv.js +0 -6
  319. package/dist/rose-pine-dawn.js +0 -4
  320. package/dist/rose-pine-moon.js +0 -4
  321. package/dist/rose-pine.js +0 -4
  322. package/dist/rosmsg.js +0 -6
  323. package/dist/rst.js +0 -22
  324. package/dist/ruby.js +0 -30
  325. package/dist/rust.js +0 -6
  326. package/dist/sankeyDiagram-TZEHDZUN2.js +0 -418
  327. package/dist/sankeyLinkHorizontal.js +0 -403
  328. package/dist/sas.js +0 -8
  329. package/dist/sass.js +0 -6
  330. package/dist/scala.js +0 -6
  331. package/dist/scheme.js +0 -6
  332. package/dist/scss.js +0 -8
  333. package/dist/sdbl.js +0 -6
  334. package/dist/sequenceDiagram-WL72ISMW2.js +0 -2523
  335. package/dist/shaderlab.js +0 -8
  336. package/dist/shellscript.js +0 -6
  337. package/dist/shellsession.js +0 -8
  338. package/dist/slack-dark.js +0 -4
  339. package/dist/slack-ochin.js +0 -4
  340. package/dist/smalltalk.js +0 -6
  341. package/dist/snazzy-light.js +0 -4
  342. package/dist/solarized-dark.js +0 -4
  343. package/dist/solarized-light.js +0 -4
  344. package/dist/solidity.js +0 -6
  345. package/dist/soy.js +0 -8
  346. package/dist/sparql.js +0 -8
  347. package/dist/splunk.js +0 -6
  348. package/dist/sql.js +0 -6
  349. package/dist/ssh-config.js +0 -6
  350. package/dist/stata.js +0 -8
  351. package/dist/stateDiagram-FKZM4ZOC2.js +0 -264
  352. package/dist/stateDiagram-v2-4FDKWEC32.js +0 -17
  353. package/dist/stylus.js +0 -6
  354. package/dist/svelte.js +0 -14
  355. package/dist/swift.js +0 -6
  356. package/dist/synthwave-84.js +0 -4
  357. package/dist/system-verilog.js +0 -6
  358. package/dist/systemd.js +0 -6
  359. package/dist/talonscript.js +0 -6
  360. package/dist/tasl.js +0 -6
  361. package/dist/tcl.js +0 -6
  362. package/dist/templ.js +0 -12
  363. package/dist/terraform.js +0 -6
  364. package/dist/tex.js +0 -8
  365. package/dist/time.js +0 -900
  366. package/dist/timeline-definition-IT6M3QCI2.js +0 -802
  367. package/dist/tokyo-night.js +0 -4
  368. package/dist/toml.js +0 -6
  369. package/dist/ts-tags.js +0 -41
  370. package/dist/tsv.js +0 -6
  371. package/dist/tsx.js +0 -6
  372. package/dist/turtle.js +0 -6
  373. package/dist/twig.js +0 -18
  374. package/dist/typescript.js +0 -6
  375. package/dist/typespec.js +0 -6
  376. package/dist/typst.js +0 -6
  377. package/dist/union.js +0 -8
  378. package/dist/v.js +0 -6
  379. package/dist/vala.js +0 -6
  380. package/dist/vb.js +0 -6
  381. package/dist/verilog.js +0 -6
  382. package/dist/vesper.js +0 -4
  383. package/dist/vhdl.js +0 -6
  384. package/dist/viml.js +0 -6
  385. package/dist/vitesse-black.js +0 -4
  386. package/dist/vitesse-dark.js +0 -4
  387. package/dist/vitesse-light.js +0 -4
  388. package/dist/vue-html.js +0 -8
  389. package/dist/vue-vine.js +0 -18
  390. package/dist/vue.js +0 -31
  391. package/dist/vyper.js +0 -6
  392. package/dist/wasm.js +0 -7
  393. package/dist/wasm2.js +0 -6
  394. package/dist/wenyan.js +0 -6
  395. package/dist/wgsl.js +0 -6
  396. package/dist/wikitext.js +0 -6
  397. package/dist/wit.js +0 -6
  398. package/dist/wolfram.js +0 -6
  399. package/dist/xml.js +0 -8
  400. package/dist/xsl.js +0 -8
  401. package/dist/xychartDiagram-PRI3JC2R2.js +0 -1299
  402. package/dist/yaml.js +0 -6
  403. package/dist/zenscript.js +0 -6
  404. package/dist/zig.js +0 -6
  405. package/dist/zipObject.js +0 -128
@@ -1,831 +0,0 @@
1
- import { b6 as ft, aI as ht, aJ as gt, aV as ut, aW as pt, aK as mt, aL as yt, aG as g, b0 as wt, b7 as kt, b8 as xt, bz as bt, bA as vt, aS as K, bb as Et, bo as $t, a_ as St, bu as _, aM as J, bB as G, aR as At } from "./CoachForm.js";
2
- import { p as Dt } from "./chunk-4BX2VUAB2.js";
3
- import { p as Tt } from "./mermaid-parser.core.js";
4
- import { c as Q } from "./cytoscape.esm.js";
5
- import { f as Bt } from "./cytoscape-fcose.js";
6
- import { s as Ct } from "./redux-toolkit.modern.js";
7
- var W = {
8
- L: "left",
9
- R: "right",
10
- T: "top",
11
- B: "bottom"
12
- }, H = {
13
- L: /* @__PURE__ */ g((e) => `${e},${e / 2} 0,${e} 0,0`, "L"),
14
- R: /* @__PURE__ */ g((e) => `0,${e / 2} ${e},0 ${e},${e}`, "R"),
15
- T: /* @__PURE__ */ g((e) => `0,0 ${e},0 ${e / 2},${e}`, "T"),
16
- B: /* @__PURE__ */ g((e) => `${e / 2},0 ${e},${e} 0,${e}`, "B")
17
- }, X = {
18
- L: /* @__PURE__ */ g((e, t) => e - t + 2, "L"),
19
- R: /* @__PURE__ */ g((e, t) => e - 2, "R"),
20
- T: /* @__PURE__ */ g((e, t) => e - t + 2, "T"),
21
- B: /* @__PURE__ */ g((e, t) => e - 2, "B")
22
- }, Lt = /* @__PURE__ */ g(function(e) {
23
- return A(e) ? e === "L" ? "R" : "L" : e === "T" ? "B" : "T";
24
- }, "getOppositeArchitectureDirection"), U = /* @__PURE__ */ g(function(e) {
25
- const t = e;
26
- return t === "L" || t === "R" || t === "T" || t === "B";
27
- }, "isArchitectureDirection"), A = /* @__PURE__ */ g(function(e) {
28
- const t = e;
29
- return t === "L" || t === "R";
30
- }, "isArchitectureDirectionX"), z = /* @__PURE__ */ g(function(e) {
31
- const t = e;
32
- return t === "T" || t === "B";
33
- }, "isArchitectureDirectionY"), Z = /* @__PURE__ */ g(function(e, t) {
34
- const i = A(e) && z(t), o = z(e) && A(t);
35
- return i || o;
36
- }, "isArchitectureDirectionXY"), zt = /* @__PURE__ */ g(function(e) {
37
- const t = e[0], i = e[1], o = A(t) && z(i), r = z(t) && A(i);
38
- return o || r;
39
- }, "isArchitecturePairXY"), jt = /* @__PURE__ */ g(function(e) {
40
- return e !== "LL" && e !== "RR" && e !== "TT" && e !== "BB";
41
- }, "isValidArchitectureDirectionPair"), N = /* @__PURE__ */ g(function(e, t) {
42
- const i = `${e}${t}`;
43
- return jt(i) ? i : void 0;
44
- }, "getArchitectureDirectionPair"), It = /* @__PURE__ */ g(function([e, t], i) {
45
- const o = i[0], r = i[1];
46
- return A(o) ? z(r) ? [e + (o === "L" ? -1 : 1), t + (r === "T" ? 1 : -1)] : [e + (o === "L" ? -1 : 1), t] : A(r) ? [e + (r === "L" ? 1 : -1), t + (o === "T" ? 1 : -1)] : [e, t + (o === "T" ? 1 : -1)];
47
- }, "shiftPositionByArchitectureDirectionPair"), Ft = /* @__PURE__ */ g(function(e) {
48
- return e === "LT" || e === "TL" ? [1, 1] : e === "BL" || e === "LB" ? [1, -1] : e === "BR" || e === "RB" ? [-1, -1] : [-1, 1];
49
- }, "getArchitectureDirectionXYFactors"), Pt = /* @__PURE__ */ g(function(e, t) {
50
- return Z(e, t) ? "bend" : A(e) ? "horizontal" : "vertical";
51
- }, "getArchitectureDirectionAlignment"), Rt = /* @__PURE__ */ g(function(e) {
52
- return e.type === "service";
53
- }, "isArchitectureService"), Xt = /* @__PURE__ */ g(function(e) {
54
- return e.type === "junction";
55
- }, "isArchitectureJunction"), tt = /* @__PURE__ */ g((e) => e.data(), "edgeData"), F = /* @__PURE__ */ g((e) => e.data(), "nodeData"), Yt = ft.architecture, P, et = (P = class {
56
- constructor() {
57
- this.nodes = {}, this.groups = {}, this.edges = [], this.registeredIds = {}, this.elements = {}, this.setAccTitle = ht, this.getAccTitle = gt, this.setDiagramTitle = ut, this.getDiagramTitle = pt, this.getAccDescription = mt, this.setAccDescription = yt, this.clear();
58
- }
59
- clear() {
60
- this.nodes = {}, this.groups = {}, this.edges = [], this.registeredIds = {}, this.dataStructures = void 0, this.elements = {}, wt();
61
- }
62
- addService({
63
- id: t,
64
- icon: i,
65
- in: o,
66
- title: r,
67
- iconText: c
68
- }) {
69
- if (this.registeredIds[t] !== void 0)
70
- throw new Error(
71
- `The service id [${t}] is already in use by another ${this.registeredIds[t]}`
72
- );
73
- if (o !== void 0) {
74
- if (t === o)
75
- throw new Error(`The service [${t}] cannot be placed within itself`);
76
- if (this.registeredIds[o] === void 0)
77
- throw new Error(
78
- `The service [${t}]'s parent does not exist. Please make sure the parent is created before this service`
79
- );
80
- if (this.registeredIds[o] === "node")
81
- throw new Error(`The service [${t}]'s parent is not a group`);
82
- }
83
- this.registeredIds[t] = "node", this.nodes[t] = {
84
- id: t,
85
- type: "service",
86
- icon: i,
87
- iconText: c,
88
- title: r,
89
- edges: [],
90
- in: o
91
- };
92
- }
93
- getServices() {
94
- return Object.values(this.nodes).filter(Rt);
95
- }
96
- addJunction({ id: t, in: i }) {
97
- this.registeredIds[t] = "node", this.nodes[t] = {
98
- id: t,
99
- type: "junction",
100
- edges: [],
101
- in: i
102
- };
103
- }
104
- getJunctions() {
105
- return Object.values(this.nodes).filter(Xt);
106
- }
107
- getNodes() {
108
- return Object.values(this.nodes);
109
- }
110
- getNode(t) {
111
- return this.nodes[t] ?? null;
112
- }
113
- addGroup({ id: t, icon: i, in: o, title: r }) {
114
- var c, l, u;
115
- if (((c = this.registeredIds) == null ? void 0 : c[t]) !== void 0)
116
- throw new Error(
117
- `The group id [${t}] is already in use by another ${this.registeredIds[t]}`
118
- );
119
- if (o !== void 0) {
120
- if (t === o)
121
- throw new Error(`The group [${t}] cannot be placed within itself`);
122
- if (((l = this.registeredIds) == null ? void 0 : l[o]) === void 0)
123
- throw new Error(
124
- `The group [${t}]'s parent does not exist. Please make sure the parent is created before this group`
125
- );
126
- if (((u = this.registeredIds) == null ? void 0 : u[o]) === "node")
127
- throw new Error(`The group [${t}]'s parent is not a group`);
128
- }
129
- this.registeredIds[t] = "group", this.groups[t] = {
130
- id: t,
131
- icon: i,
132
- title: r,
133
- in: o
134
- };
135
- }
136
- getGroups() {
137
- return Object.values(this.groups);
138
- }
139
- addEdge({
140
- lhsId: t,
141
- rhsId: i,
142
- lhsDir: o,
143
- rhsDir: r,
144
- lhsInto: c,
145
- rhsInto: l,
146
- lhsGroup: u,
147
- rhsGroup: d,
148
- title: n
149
- }) {
150
- if (!U(o))
151
- throw new Error(
152
- `Invalid direction given for left hand side of edge ${t}--${i}. Expected (L,R,T,B) got ${String(o)}`
153
- );
154
- if (!U(r))
155
- throw new Error(
156
- `Invalid direction given for right hand side of edge ${t}--${i}. Expected (L,R,T,B) got ${String(r)}`
157
- );
158
- if (this.nodes[t] === void 0 && this.groups[t] === void 0)
159
- throw new Error(
160
- `The left-hand id [${t}] does not yet exist. Please create the service/group before declaring an edge to it.`
161
- );
162
- if (this.nodes[i] === void 0 && this.groups[i] === void 0)
163
- throw new Error(
164
- `The right-hand id [${i}] does not yet exist. Please create the service/group before declaring an edge to it.`
165
- );
166
- const s = this.nodes[t].in, p = this.nodes[i].in;
167
- if (u && s && p && s == p)
168
- throw new Error(
169
- `The left-hand id [${t}] is modified to traverse the group boundary, but the edge does not pass through two groups.`
170
- );
171
- if (d && s && p && s == p)
172
- throw new Error(
173
- `The right-hand id [${i}] is modified to traverse the group boundary, but the edge does not pass through two groups.`
174
- );
175
- const f = {
176
- lhsId: t,
177
- lhsDir: o,
178
- lhsInto: c,
179
- lhsGroup: u,
180
- rhsId: i,
181
- rhsDir: r,
182
- rhsInto: l,
183
- rhsGroup: d,
184
- title: n
185
- };
186
- this.edges.push(f), this.nodes[t] && this.nodes[i] && (this.nodes[t].edges.push(this.edges[this.edges.length - 1]), this.nodes[i].edges.push(this.edges[this.edges.length - 1]));
187
- }
188
- getEdges() {
189
- return this.edges;
190
- }
191
- /**
192
- * Returns the current diagram's adjacency list, spatial map, & group alignments.
193
- * If they have not been created, run the algorithms to generate them.
194
- * @returns
195
- */
196
- getDataStructures() {
197
- if (this.dataStructures === void 0) {
198
- const t = {}, i = Object.entries(this.nodes).reduce((d, [n, s]) => (d[n] = s.edges.reduce((p, f) => {
199
- var m, y;
200
- const a = (m = this.getNode(f.lhsId)) == null ? void 0 : m.in, h = (y = this.getNode(f.rhsId)) == null ? void 0 : y.in;
201
- if (a && h && a !== h) {
202
- const w = Pt(f.lhsDir, f.rhsDir);
203
- w !== "bend" && (t[a] ?? (t[a] = {}), t[a][h] = w, t[h] ?? (t[h] = {}), t[h][a] = w);
204
- }
205
- if (f.lhsId === n) {
206
- const w = N(f.lhsDir, f.rhsDir);
207
- w && (p[w] = f.rhsId);
208
- } else {
209
- const w = N(f.rhsDir, f.lhsDir);
210
- w && (p[w] = f.lhsId);
211
- }
212
- return p;
213
- }, {}), d), {}), o = Object.keys(i)[0], r = { [o]: 1 }, c = Object.keys(i).reduce(
214
- (d, n) => n === o ? d : { ...d, [n]: 1 },
215
- {}
216
- ), l = /* @__PURE__ */ g((d) => {
217
- const n = { [d]: [0, 0] }, s = [d];
218
- for (; s.length > 0; ) {
219
- const p = s.shift();
220
- if (p) {
221
- r[p] = 1, delete c[p];
222
- const f = i[p], [a, h] = n[p];
223
- Object.entries(f).forEach(([m, y]) => {
224
- r[y] || (n[y] = It(
225
- [a, h],
226
- m
227
- ), s.push(y));
228
- });
229
- }
230
- }
231
- return n;
232
- }, "BFS"), u = [l(o)];
233
- for (; Object.keys(c).length > 0; )
234
- u.push(l(Object.keys(c)[0]));
235
- this.dataStructures = {
236
- adjList: i,
237
- spatialMaps: u,
238
- groupAlignments: t
239
- };
240
- }
241
- return this.dataStructures;
242
- }
243
- setElementForId(t, i) {
244
- this.elements[t] = i;
245
- }
246
- getElementById(t) {
247
- return this.elements[t];
248
- }
249
- getConfig() {
250
- return kt({
251
- ...Yt,
252
- ...xt().architecture
253
- });
254
- }
255
- getConfigField(t) {
256
- return this.getConfig()[t];
257
- }
258
- }, g(P, "ArchitectureDB"), P), Ot = /* @__PURE__ */ g((e, t) => {
259
- Dt(e, t), e.groups.map((i) => t.addGroup(i)), e.services.map((i) => t.addService({ ...i, type: "service" })), e.junctions.map((i) => t.addJunction({ ...i, type: "junction" })), e.edges.map((i) => t.addEdge(i));
260
- }, "populateDb"), it = {
261
- parser: {
262
- // @ts-expect-error - ArchitectureDB is not assignable to DiagramDB
263
- yy: void 0
264
- },
265
- parse: /* @__PURE__ */ g(async (e) => {
266
- var o;
267
- const t = await Tt("architecture", e);
268
- K.debug(t);
269
- const i = (o = it.parser) == null ? void 0 : o.yy;
270
- if (!(i instanceof et))
271
- throw new Error(
272
- "parser.parser?.yy was not a ArchitectureDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues."
273
- );
274
- Ot(t, i);
275
- }, "parse")
276
- }, Mt = /* @__PURE__ */ g((e) => `
277
- .edge {
278
- stroke-width: ${e.archEdgeWidth};
279
- stroke: ${e.archEdgeColor};
280
- fill: none;
281
- }
282
-
283
- .arrow {
284
- fill: ${e.archEdgeArrowColor};
285
- }
286
-
287
- .node-bkg {
288
- fill: none;
289
- stroke: ${e.archGroupBorderColor};
290
- stroke-width: ${e.archGroupBorderWidth};
291
- stroke-dasharray: 8;
292
- }
293
- .node-icon-text {
294
- display: flex;
295
- align-items: center;
296
- }
297
-
298
- .node-icon-text > div {
299
- color: #fff;
300
- margin: 1px;
301
- height: fit-content;
302
- text-align: center;
303
- overflow: hidden;
304
- display: -webkit-box;
305
- -webkit-box-orient: vertical;
306
- }
307
- `, "getStyles"), Gt = Mt, I = /* @__PURE__ */ g((e) => `<g><rect width="80" height="80" style="fill: #087ebf; stroke-width: 0px;"/>${e}</g>`, "wrapIcon"), R = {
308
- prefix: "mermaid-architecture",
309
- height: 80,
310
- width: 80,
311
- icons: {
312
- database: {
313
- body: I(
314
- '<path id="b" data-name="4" d="m20,57.86c0,3.94,8.95,7.14,20,7.14s20-3.2,20-7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path id="c" data-name="3" d="m20,45.95c0,3.94,8.95,7.14,20,7.14s20-3.2,20-7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path id="d" data-name="2" d="m20,34.05c0,3.94,8.95,7.14,20,7.14s20-3.2,20-7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse id="e" data-name="1" cx="40" cy="22.14" rx="20" ry="7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="20" y1="57.86" x2="20" y2="22.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="60" y1="57.86" x2="60" y2="22.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/>'
315
- )
316
- },
317
- server: {
318
- body: I(
319
- '<rect x="17.5" y="17.5" width="45" height="45" rx="2" ry="2" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="17.5" y1="32.5" x2="62.5" y2="32.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="17.5" y1="47.5" x2="62.5" y2="47.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><g><path d="m56.25,25c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: #fff; stroke-width: 0px;"/><path d="m56.25,25c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10;"/></g><g><path d="m56.25,40c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: #fff; stroke-width: 0px;"/><path d="m56.25,40c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10;"/></g><g><path d="m56.25,55c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: #fff; stroke-width: 0px;"/><path d="m56.25,55c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10;"/></g><g><circle cx="32.5" cy="25" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="27.5" cy="25" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="22.5" cy="25" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/></g><g><circle cx="32.5" cy="40" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="27.5" cy="40" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="22.5" cy="40" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/></g><g><circle cx="32.5" cy="55" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="27.5" cy="55" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="22.5" cy="55" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/></g>'
320
- )
321
- },
322
- disk: {
323
- body: I(
324
- '<rect x="20" y="15" width="40" height="50" rx="1" ry="1" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="24" cy="19.17" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="56" cy="19.17" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="24" cy="60.83" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="56" cy="60.83" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="40" cy="33.75" rx="14" ry="14.58" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="40" cy="33.75" rx="4" ry="4.17" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path d="m37.51,42.52l-4.83,13.22c-.26.71-1.1,1.02-1.76.64l-4.18-2.42c-.66-.38-.81-1.26-.33-1.84l9.01-10.8c.88-1.05,2.56-.08,2.09,1.2Z" style="fill: #fff; stroke-width: 0px;"/>'
325
- )
326
- },
327
- internet: {
328
- body: I(
329
- '<circle cx="40" cy="40" r="22.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="40" y1="17.5" x2="40" y2="62.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="17.5" y1="40" x2="62.5" y2="40" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path d="m39.99,17.51c-15.28,11.1-15.28,33.88,0,44.98" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path d="m40.01,17.51c15.28,11.1,15.28,33.88,0,44.98" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="19.75" y1="30.1" x2="60.25" y2="30.1" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="19.75" y1="49.9" x2="60.25" y2="49.9" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/>'
330
- )
331
- },
332
- cloud: {
333
- body: I(
334
- '<path d="m65,47.5c0,2.76-2.24,5-5,5H20c-2.76,0-5-2.24-5-5,0-1.87,1.03-3.51,2.56-4.36-.04-.21-.06-.42-.06-.64,0-2.6,2.48-4.74,5.65-4.97,1.65-4.51,6.34-7.76,11.85-7.76.86,0,1.69.08,2.5.23,2.09-1.57,4.69-2.5,7.5-2.5,6.1,0,11.19,4.38,12.28,10.17,2.14.56,3.72,2.51,3.72,4.83,0,.03,0,.07-.01.1,2.29.46,4.01,2.48,4.01,4.9Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/>'
335
- )
336
- },
337
- unknown: bt,
338
- blank: {
339
- body: I("")
340
- }
341
- }
342
- }, Nt = /* @__PURE__ */ g(async function(e, t, i) {
343
- const o = i.getConfigField("padding"), r = i.getConfigField("iconSize"), c = r / 2, l = r / 6, u = l / 2;
344
- await Promise.all(
345
- t.edges().map(async (d) => {
346
- var j, D;
347
- const {
348
- source: n,
349
- sourceDir: s,
350
- sourceArrow: p,
351
- sourceGroup: f,
352
- target: a,
353
- targetDir: h,
354
- targetArrow: m,
355
- targetGroup: y,
356
- label: w
357
- } = tt(d);
358
- let { x: k, y: v } = d[0].sourceEndpoint();
359
- const { x: E, y: b } = d[0].midpoint();
360
- let { x, y: $ } = d[0].targetEndpoint();
361
- const S = o + 4;
362
- if (f && (A(s) ? k += s === "L" ? -S : S : v += s === "T" ? -S : S + 18), y && (A(h) ? x += h === "L" ? -S : S : $ += h === "T" ? -S : S + 18), !f && ((j = i.getNode(n)) == null ? void 0 : j.type) === "junction" && (A(s) ? k += s === "L" ? c : -c : v += s === "T" ? c : -c), !y && ((D = i.getNode(a)) == null ? void 0 : D.type) === "junction" && (A(h) ? x += h === "L" ? c : -c : $ += h === "T" ? c : -c), d[0]._private.rscratch) {
363
- const T = e.insert("g");
364
- if (T.insert("path").attr("d", `M ${k},${v} L ${E},${b} L${x},${$} `).attr("class", "edge").attr("id", St(n, a, { prefix: "L" })), p) {
365
- const B = A(s) ? X[s](k, l) : k - u, C = z(s) ? X[s](v, l) : v - u;
366
- T.insert("polygon").attr("points", H[s](l)).attr("transform", `translate(${B},${C})`).attr("class", "arrow");
367
- }
368
- if (m) {
369
- const B = A(h) ? X[h](x, l) : x - u, C = z(h) ? X[h]($, l) : $ - u;
370
- T.insert("polygon").attr("points", H[h](l)).attr("transform", `translate(${B},${C})`).attr("class", "arrow");
371
- }
372
- if (w) {
373
- const B = Z(s, h) ? "XY" : A(s) ? "X" : "Y";
374
- let C = 0;
375
- B === "X" ? C = Math.abs(k - x) : B === "Y" ? C = Math.abs(v - $) / 1.5 : C = Math.abs(k - x) / 2;
376
- const L = T.append("g");
377
- if (await _(
378
- L,
379
- w,
380
- {
381
- useHtmlLabels: !1,
382
- width: C,
383
- classes: "architecture-service-label"
384
- },
385
- J()
386
- ), L.attr("dy", "1em").attr("alignment-baseline", "middle").attr("dominant-baseline", "middle").attr("text-anchor", "middle"), B === "X")
387
- L.attr("transform", "translate(" + E + ", " + b + ")");
388
- else if (B === "Y")
389
- L.attr("transform", "translate(" + E + ", " + b + ") rotate(-90)");
390
- else if (B === "XY") {
391
- const Y = N(s, h);
392
- if (Y && zt(Y)) {
393
- const q = L.node().getBoundingClientRect(), [O, M] = Ft(Y);
394
- L.attr("dominant-baseline", "auto").attr("transform", `rotate(${-1 * O * M * 45})`);
395
- const V = L.node().getBoundingClientRect();
396
- L.attr(
397
- "transform",
398
- `
399
- translate(${E}, ${b - q.height / 2})
400
- translate(${O * V.width / 2}, ${M * V.height / 2})
401
- rotate(${-1 * O * M * 45}, 0, ${q.height / 2})
402
- `
403
- );
404
- }
405
- }
406
- }
407
- }
408
- })
409
- );
410
- }, "drawEdges"), _t = /* @__PURE__ */ g(async function(e, t, i) {
411
- const r = i.getConfigField("padding") * 0.75, c = i.getConfigField("fontSize"), u = i.getConfigField("iconSize") / 2;
412
- await Promise.all(
413
- t.nodes().map(async (d) => {
414
- const n = F(d);
415
- if (n.type === "group") {
416
- const { h: s, w: p, x1: f, y1: a } = d.boundingBox(), h = e.append("rect");
417
- h.attr("id", `group-${n.id}`).attr("x", f + u).attr("y", a + u).attr("width", p).attr("height", s).attr("class", "node-bkg");
418
- const m = e.append("g");
419
- let y = f, w = a;
420
- if (n.icon) {
421
- const k = m.append("g");
422
- k.html(
423
- `<g>${await G(n.icon, { height: r, width: r, fallbackPrefix: R.prefix })}</g>`
424
- ), k.attr(
425
- "transform",
426
- "translate(" + (y + u + 1) + ", " + (w + u + 1) + ")"
427
- ), y += r, w += c / 2 - 1 - 2;
428
- }
429
- if (n.label) {
430
- const k = m.append("g");
431
- await _(
432
- k,
433
- n.label,
434
- {
435
- useHtmlLabels: !1,
436
- width: p,
437
- classes: "architecture-service-label"
438
- },
439
- J()
440
- ), k.attr("dy", "1em").attr("alignment-baseline", "middle").attr("dominant-baseline", "start").attr("text-anchor", "start"), k.attr(
441
- "transform",
442
- "translate(" + (y + u + 4) + ", " + (w + u + 2) + ")"
443
- );
444
- }
445
- i.setElementForId(n.id, h);
446
- }
447
- })
448
- );
449
- }, "drawGroups"), Jt = /* @__PURE__ */ g(async function(e, t, i) {
450
- const o = J();
451
- for (const r of i) {
452
- const c = t.append("g"), l = e.getConfigField("iconSize");
453
- if (r.title) {
454
- const s = c.append("g");
455
- await _(
456
- s,
457
- r.title,
458
- {
459
- useHtmlLabels: !1,
460
- width: l * 1.5,
461
- classes: "architecture-service-label"
462
- },
463
- o
464
- ), s.attr("dy", "1em").attr("alignment-baseline", "middle").attr("dominant-baseline", "middle").attr("text-anchor", "middle"), s.attr("transform", "translate(" + l / 2 + ", " + l + ")");
465
- }
466
- const u = c.append("g");
467
- if (r.icon)
468
- u.html(
469
- `<g>${await G(r.icon, { height: l, width: l, fallbackPrefix: R.prefix })}</g>`
470
- );
471
- else if (r.iconText) {
472
- u.html(
473
- `<g>${await G("blank", { height: l, width: l, fallbackPrefix: R.prefix })}</g>`
474
- );
475
- const f = u.append("g").append("foreignObject").attr("width", l).attr("height", l).append("div").attr("class", "node-icon-text").attr("style", `height: ${l}px;`).append("div").html(At(r.iconText, o)), a = parseInt(
476
- window.getComputedStyle(f.node(), null).getPropertyValue("font-size").replace(/\D/g, "")
477
- ) ?? 16;
478
- f.attr("style", `-webkit-line-clamp: ${Math.floor((l - 2) / a)};`);
479
- } else
480
- u.append("path").attr("class", "node-bkg").attr("id", "node-" + r.id).attr(
481
- "d",
482
- `M0 ${l} v${-l} q0,-5 5,-5 h${l} q5,0 5,5 v${l} H0 Z`
483
- );
484
- c.attr("id", `service-${r.id}`).attr("class", "architecture-service");
485
- const { width: d, height: n } = c.node().getBBox();
486
- r.width = d, r.height = n, e.setElementForId(r.id, c);
487
- }
488
- return 0;
489
- }, "drawServices"), Zt = /* @__PURE__ */ g(function(e, t, i) {
490
- i.forEach((o) => {
491
- const r = t.append("g"), c = e.getConfigField("iconSize");
492
- r.append("g").append("rect").attr("id", "node-" + o.id).attr("fill-opacity", "0").attr("width", c).attr("height", c), r.attr("class", "architecture-junction");
493
- const { width: u, height: d } = r._groups[0][0].getBBox();
494
- r.width = u, r.height = d, e.setElementForId(o.id, r);
495
- });
496
- }, "drawJunctions");
497
- vt([
498
- {
499
- name: R.prefix,
500
- icons: R
501
- }
502
- ]);
503
- Q.use(Bt);
504
- function rt(e, t, i) {
505
- e.forEach((o) => {
506
- t.add({
507
- group: "nodes",
508
- data: {
509
- type: "service",
510
- id: o.id,
511
- icon: o.icon,
512
- label: o.title,
513
- parent: o.in,
514
- width: i.getConfigField("iconSize"),
515
- height: i.getConfigField("iconSize")
516
- },
517
- classes: "node-service"
518
- });
519
- });
520
- }
521
- g(rt, "addServices");
522
- function st(e, t, i) {
523
- e.forEach((o) => {
524
- t.add({
525
- group: "nodes",
526
- data: {
527
- type: "junction",
528
- id: o.id,
529
- parent: o.in,
530
- width: i.getConfigField("iconSize"),
531
- height: i.getConfigField("iconSize")
532
- },
533
- classes: "node-junction"
534
- });
535
- });
536
- }
537
- g(st, "addJunctions");
538
- function ot(e, t) {
539
- t.nodes().map((i) => {
540
- const o = F(i);
541
- if (o.type === "group")
542
- return;
543
- o.x = i.position().x, o.y = i.position().y, e.getElementById(o.id).attr("transform", "translate(" + (o.x || 0) + "," + (o.y || 0) + ")");
544
- });
545
- }
546
- g(ot, "positionNodes");
547
- function nt(e, t) {
548
- e.forEach((i) => {
549
- t.add({
550
- group: "nodes",
551
- data: {
552
- type: "group",
553
- id: i.id,
554
- icon: i.icon,
555
- label: i.title,
556
- parent: i.in
557
- },
558
- classes: "node-group"
559
- });
560
- });
561
- }
562
- g(nt, "addGroups");
563
- function at(e, t) {
564
- e.forEach((i) => {
565
- const { lhsId: o, rhsId: r, lhsInto: c, lhsGroup: l, rhsInto: u, lhsDir: d, rhsDir: n, rhsGroup: s, title: p } = i, f = Z(i.lhsDir, i.rhsDir) ? "segments" : "straight", a = {
566
- id: `${o}-${r}`,
567
- label: p,
568
- source: o,
569
- sourceDir: d,
570
- sourceArrow: c,
571
- sourceGroup: l,
572
- sourceEndpoint: d === "L" ? "0 50%" : d === "R" ? "100% 50%" : d === "T" ? "50% 0" : "50% 100%",
573
- target: r,
574
- targetDir: n,
575
- targetArrow: u,
576
- targetGroup: s,
577
- targetEndpoint: n === "L" ? "0 50%" : n === "R" ? "100% 50%" : n === "T" ? "50% 0" : "50% 100%"
578
- };
579
- t.add({
580
- group: "edges",
581
- data: a,
582
- classes: f
583
- });
584
- });
585
- }
586
- g(at, "addEdges");
587
- function ct(e, t, i) {
588
- const o = /* @__PURE__ */ g((u, d) => Object.entries(u).reduce(
589
- (n, [s, p]) => {
590
- var h;
591
- let f = 0;
592
- const a = Object.entries(p);
593
- if (a.length === 1)
594
- return n[s] = a[0][1], n;
595
- for (let m = 0; m < a.length - 1; m++)
596
- for (let y = m + 1; y < a.length; y++) {
597
- const [w, k] = a[m], [v, E] = a[y];
598
- if (((h = i[w]) == null ? void 0 : h[v]) === d)
599
- n[s] ?? (n[s] = []), n[s] = [...n[s], ...k, ...E];
600
- else if (w === "default" || v === "default")
601
- n[s] ?? (n[s] = []), n[s] = [...n[s], ...k, ...E];
602
- else {
603
- const x = `${s}-${f++}`;
604
- n[x] = k;
605
- const $ = `${s}-${f++}`;
606
- n[$] = E;
607
- }
608
- }
609
- return n;
610
- },
611
- {}
612
- ), "flattenAlignments"), r = t.map((u) => {
613
- const d = {}, n = {};
614
- return Object.entries(u).forEach(([s, [p, f]]) => {
615
- var h, m, y;
616
- const a = ((h = e.getNode(s)) == null ? void 0 : h.in) ?? "default";
617
- d[f] ?? (d[f] = {}), (m = d[f])[a] ?? (m[a] = []), d[f][a].push(s), n[p] ?? (n[p] = {}), (y = n[p])[a] ?? (y[a] = []), n[p][a].push(s);
618
- }), {
619
- horiz: Object.values(o(d, "horizontal")).filter(
620
- (s) => s.length > 1
621
- ),
622
- vert: Object.values(o(n, "vertical")).filter(
623
- (s) => s.length > 1
624
- )
625
- };
626
- }), [c, l] = r.reduce(
627
- ([u, d], { horiz: n, vert: s }) => [
628
- [...u, ...n],
629
- [...d, ...s]
630
- ],
631
- [[], []]
632
- );
633
- return {
634
- horizontal: c,
635
- vertical: l
636
- };
637
- }
638
- g(ct, "getAlignments");
639
- function lt(e, t) {
640
- const i = [], o = /* @__PURE__ */ g((c) => `${c[0]},${c[1]}`, "posToStr"), r = /* @__PURE__ */ g((c) => c.split(",").map((l) => parseInt(l)), "strToPos");
641
- return e.forEach((c) => {
642
- const l = Object.fromEntries(
643
- Object.entries(c).map(([s, p]) => [o(p), s])
644
- ), u = [o([0, 0])], d = {}, n = {
645
- L: [-1, 0],
646
- R: [1, 0],
647
- T: [0, 1],
648
- B: [0, -1]
649
- };
650
- for (; u.length > 0; ) {
651
- const s = u.shift();
652
- if (s) {
653
- d[s] = 1;
654
- const p = l[s];
655
- if (p) {
656
- const f = r(s);
657
- Object.entries(n).forEach(([a, h]) => {
658
- const m = o([f[0] + h[0], f[1] + h[1]]), y = l[m];
659
- y && !d[m] && (u.push(m), i.push({
660
- [W[a]]: y,
661
- [W[Lt(a)]]: p,
662
- gap: 1.5 * t.getConfigField("iconSize")
663
- }));
664
- });
665
- }
666
- }
667
- }
668
- }), i;
669
- }
670
- g(lt, "getRelativeConstraints");
671
- function dt(e, t, i, o, r, { spatialMaps: c, groupAlignments: l }) {
672
- return new Promise((u) => {
673
- const d = Ct("body").append("div").attr("id", "cy").attr("style", "display:none"), n = Q({
674
- container: document.getElementById("cy"),
675
- style: [
676
- {
677
- selector: "edge",
678
- style: {
679
- "curve-style": "straight",
680
- label: "data(label)",
681
- "source-endpoint": "data(sourceEndpoint)",
682
- "target-endpoint": "data(targetEndpoint)"
683
- }
684
- },
685
- {
686
- selector: "edge.segments",
687
- style: {
688
- "curve-style": "segments",
689
- "segment-weights": "0",
690
- "segment-distances": [0.5],
691
- // @ts-ignore Incorrect library types
692
- "edge-distances": "endpoints",
693
- "source-endpoint": "data(sourceEndpoint)",
694
- "target-endpoint": "data(targetEndpoint)"
695
- }
696
- },
697
- {
698
- selector: "node",
699
- style: {
700
- // @ts-ignore Incorrect library types
701
- "compound-sizing-wrt-labels": "include"
702
- }
703
- },
704
- {
705
- selector: "node[label]",
706
- style: {
707
- "text-valign": "bottom",
708
- "text-halign": "center",
709
- "font-size": `${r.getConfigField("fontSize")}px`
710
- }
711
- },
712
- {
713
- selector: ".node-service",
714
- style: {
715
- label: "data(label)",
716
- width: "data(width)",
717
- height: "data(height)"
718
- }
719
- },
720
- {
721
- selector: ".node-junction",
722
- style: {
723
- width: "data(width)",
724
- height: "data(height)"
725
- }
726
- },
727
- {
728
- selector: ".node-group",
729
- style: {
730
- // @ts-ignore Incorrect library types
731
- padding: `${r.getConfigField("padding")}px`
732
- }
733
- }
734
- ],
735
- layout: {
736
- name: "grid",
737
- boundingBox: {
738
- x1: 0,
739
- x2: 100,
740
- y1: 0,
741
- y2: 100
742
- }
743
- }
744
- });
745
- d.remove(), nt(i, n), rt(e, n, r), st(t, n, r), at(o, n);
746
- const s = ct(r, c, l), p = lt(c, r), f = n.layout({
747
- name: "fcose",
748
- quality: "proof",
749
- styleEnabled: !1,
750
- animate: !1,
751
- nodeDimensionsIncludeLabels: !1,
752
- // Adjust the edge parameters if it passes through the border of a group
753
- // Hacky fix for: https://github.com/iVis-at-Bilkent/cytoscape.js-fcose/issues/67
754
- idealEdgeLength(a) {
755
- const [h, m] = a.connectedNodes(), { parent: y } = F(h), { parent: w } = F(m);
756
- return y === w ? 1.5 * r.getConfigField("iconSize") : 0.5 * r.getConfigField("iconSize");
757
- },
758
- edgeElasticity(a) {
759
- const [h, m] = a.connectedNodes(), { parent: y } = F(h), { parent: w } = F(m);
760
- return y === w ? 0.45 : 1e-3;
761
- },
762
- alignmentConstraint: s,
763
- relativePlacementConstraint: p
764
- });
765
- f.one("layoutstop", () => {
766
- var h;
767
- function a(m, y, w, k) {
768
- let v, E;
769
- const { x: b, y: x } = m, { x: $, y: S } = y;
770
- E = (k - x + (b - w) * (x - S) / (b - $)) / Math.sqrt(1 + Math.pow((x - S) / (b - $), 2)), v = Math.sqrt(Math.pow(k - x, 2) + Math.pow(w - b, 2) - Math.pow(E, 2));
771
- const j = Math.sqrt(Math.pow($ - b, 2) + Math.pow(S - x, 2));
772
- v = v / j;
773
- let D = ($ - b) * (k - x) - (S - x) * (w - b);
774
- switch (!0) {
775
- case D >= 0:
776
- D = 1;
777
- break;
778
- case D < 0:
779
- D = -1;
780
- break;
781
- }
782
- let T = ($ - b) * (w - b) + (S - x) * (k - x);
783
- switch (!0) {
784
- case T >= 0:
785
- T = 1;
786
- break;
787
- case T < 0:
788
- T = -1;
789
- break;
790
- }
791
- return E = Math.abs(E) * D, v = v * T, {
792
- distances: E,
793
- weights: v
794
- };
795
- }
796
- g(a, "getSegmentWeights"), n.startBatch();
797
- for (const m of Object.values(n.edges()))
798
- if ((h = m.data) != null && h.call(m)) {
799
- const { x: y, y: w } = m.source().position(), { x: k, y: v } = m.target().position();
800
- if (y !== k && w !== v) {
801
- const E = m.sourceEndpoint(), b = m.targetEndpoint(), { sourceDir: x } = tt(m), [$, S] = z(x) ? [E.x, b.y] : [b.x, E.y], { weights: j, distances: D } = a(E, b, $, S);
802
- m.style("segment-distances", D), m.style("segment-weights", j);
803
- }
804
- }
805
- n.endBatch(), f.run();
806
- }), f.run(), n.ready((a) => {
807
- K.info("Ready", a), u(n);
808
- });
809
- });
810
- }
811
- g(dt, "layoutArchitecture");
812
- var qt = /* @__PURE__ */ g(async (e, t, i, o) => {
813
- const r = o.db, c = r.getServices(), l = r.getJunctions(), u = r.getGroups(), d = r.getEdges(), n = r.getDataStructures(), s = Et(t), p = s.append("g");
814
- p.attr("class", "architecture-edges");
815
- const f = s.append("g");
816
- f.attr("class", "architecture-services");
817
- const a = s.append("g");
818
- a.attr("class", "architecture-groups"), await Jt(r, f, c), Zt(r, f, l);
819
- const h = await dt(c, l, u, d, r, n);
820
- await Nt(p, h, r), await _t(a, h, r), ot(r, h), $t(void 0, s, r.getConfigField("padding"), r.getConfigField("useMaxWidth"));
821
- }, "draw"), Vt = { draw: qt }, ee = {
822
- parser: it,
823
- get db() {
824
- return new et();
825
- },
826
- renderer: Vt,
827
- styles: Gt
828
- };
829
- export {
830
- ee as diagram
831
- };