@legionworks/facet 1.9.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 (327) hide show
  1. package/LICENSE-APACHE +202 -0
  2. package/LICENSE-MIT +23 -0
  3. package/README.md +158 -0
  4. package/dist/gallery/chunk-4g8rem85.css +656 -0
  5. package/dist/gallery/chunk-c6s9k9ty.js +5970 -0
  6. package/dist/gallery/frame/artifact.css +8424 -0
  7. package/dist/gallery/frame/chunks/abnfDiagram-N423BO3Z-jj74szbm.js +155 -0
  8. package/dist/gallery/frame/chunks/architecture-TIHT7OUA-cvdjn7dt.js +10 -0
  9. package/dist/gallery/frame/chunks/architectureDiagram-T3A2C74G-n4z77eg6.js +8675 -0
  10. package/dist/gallery/frame/chunks/blockDiagram-VBNYF7ZC-7xsqzrd1.js +3529 -0
  11. package/dist/gallery/frame/chunks/c4Diagram-5PPSVZJV-z2zjs7wx.js +2413 -0
  12. package/dist/gallery/frame/chunks/classDiagram-JCYQIIEL-ve8rngqp.js +47 -0
  13. package/dist/gallery/frame/chunks/classDiagram-v2-OCEON4UE-8cfaxb8z.js +47 -0
  14. package/dist/gallery/frame/chunks/cose-bilkent-JH36ORCC-sn92qexx.js +4822 -0
  15. package/dist/gallery/frame/chunks/cynefin-VYW2F7L2-tqjv913d.js +10 -0
  16. package/dist/gallery/frame/chunks/cynefinDiagram-MW4NZA55-c1c0dj12.js +500 -0
  17. package/dist/gallery/frame/chunks/dagre-VZM6K2ZE-7tyg4yt2.js +476 -0
  18. package/dist/gallery/frame/chunks/diagram-7IWD3JNH-y4eng9sc.js +526 -0
  19. package/dist/gallery/frame/chunks/diagram-B4RE2ZJO-rn3p7j5h.js +673 -0
  20. package/dist/gallery/frame/chunks/diagram-LBJQPF4R-w4a2cm9q.js +255 -0
  21. package/dist/gallery/frame/chunks/diagram-Q27KOJAE-aqc2v7wy.js +575 -0
  22. package/dist/gallery/frame/chunks/diagram-UB23O5K3-xncy8nyd.js +355 -0
  23. package/dist/gallery/frame/chunks/ebnfDiagram-BXEA7PRR-acwgxz16.js +175 -0
  24. package/dist/gallery/frame/chunks/erDiagram-JOGREHBK-mzp5nswt.js +1332 -0
  25. package/dist/gallery/frame/chunks/eventmodeling-45OFAUF4-sg07qr0c.js +10 -0
  26. package/dist/gallery/frame/chunks/flowDiagram-UKHOOZJN-2e5ygs44.js +29 -0
  27. package/dist/gallery/frame/chunks/ganttDiagram-PKOTCBZU-p2hhh7hr.js +2620 -0
  28. package/dist/gallery/frame/chunks/gitGraph-TEB2WS4Q-j6kw0naa.js +10 -0
  29. package/dist/gallery/frame/chunks/gitGraphDiagram-DS77QQ5N-4z9z8wjm.js +1347 -0
  30. package/dist/gallery/frame/chunks/info-DKCQHKI2-mpt80jd3.js +10 -0
  31. package/dist/gallery/frame/chunks/infoDiagram-6WML65LV-5rqm3mgg.js +65 -0
  32. package/dist/gallery/frame/chunks/ishikawaDiagram-WSZJBQD7-b51z96jy.js +975 -0
  33. package/dist/gallery/frame/chunks/journeyDiagram-NVQOT4AX-9jbfp0pk.js +1272 -0
  34. package/dist/gallery/frame/chunks/kanban-definition-27J2QSJJ-4x0vx4se.js +1116 -0
  35. package/dist/gallery/frame/chunks/katex-xfgk95tv.js +14034 -0
  36. package/dist/gallery/frame/chunks/markdown-1s5vwkf2.js +9 -0
  37. package/dist/gallery/frame/chunks/markdown-2h6bwsms.js +3239 -0
  38. package/dist/gallery/frame/chunks/markdown-2x113yh8.js +107 -0
  39. package/dist/gallery/frame/chunks/markdown-30b7rwmp.js +1943 -0
  40. package/dist/gallery/frame/chunks/markdown-356bfj4g.js +2031 -0
  41. package/dist/gallery/frame/chunks/markdown-44n9ea69.js +2406 -0
  42. package/dist/gallery/frame/chunks/markdown-56enrf2r.js +39 -0
  43. package/dist/gallery/frame/chunks/markdown-5avymm8t.js +725 -0
  44. package/dist/gallery/frame/chunks/markdown-6r4svars.js +33 -0
  45. package/dist/gallery/frame/chunks/markdown-6zz8efx2.js +24 -0
  46. package/dist/gallery/frame/chunks/markdown-7jp6prnb.js +19 -0
  47. package/dist/gallery/frame/chunks/markdown-809k7q41.js +55 -0
  48. package/dist/gallery/frame/chunks/markdown-82xmzhzd.js +1076 -0
  49. package/dist/gallery/frame/chunks/markdown-92n37gd4.js +7627 -0
  50. package/dist/gallery/frame/chunks/markdown-ag2sssf8.js +36 -0
  51. package/dist/gallery/frame/chunks/markdown-b4s7ntq2.js +19 -0
  52. package/dist/gallery/frame/chunks/markdown-c9k0fvp1.js +100 -0
  53. package/dist/gallery/frame/chunks/markdown-ceefymn8.js +125 -0
  54. package/dist/gallery/frame/chunks/markdown-d1wfbs70.js +243 -0
  55. package/dist/gallery/frame/chunks/markdown-dy5sgjhc.js +11022 -0
  56. package/dist/gallery/frame/chunks/markdown-dz3z5w30.js +30868 -0
  57. package/dist/gallery/frame/chunks/markdown-eg6ngz7y.js +30340 -0
  58. package/dist/gallery/frame/chunks/markdown-ff5wvb43.js +1149 -0
  59. package/dist/gallery/frame/chunks/markdown-ffg06nfz.js +86 -0
  60. package/dist/gallery/frame/chunks/markdown-fvfncadf.js +472 -0
  61. package/dist/gallery/frame/chunks/markdown-gvyszqpv.js +19 -0
  62. package/dist/gallery/frame/chunks/markdown-gx1p0ew0.js +88 -0
  63. package/dist/gallery/frame/chunks/markdown-gxye5frz.js +65 -0
  64. package/dist/gallery/frame/chunks/markdown-h7pzv34e.js +105 -0
  65. package/dist/gallery/frame/chunks/markdown-hab789t9.js +47 -0
  66. package/dist/gallery/frame/chunks/markdown-hjp6sj8t.js +125 -0
  67. package/dist/gallery/frame/chunks/markdown-jka64qgp.js +1993 -0
  68. package/dist/gallery/frame/chunks/markdown-k8xkn8mw.js +56 -0
  69. package/dist/gallery/frame/chunks/markdown-m7frq8x8.js +112 -0
  70. package/dist/gallery/frame/chunks/markdown-p740v4qm.js +36 -0
  71. package/dist/gallery/frame/chunks/markdown-pxfeh231.js +57 -0
  72. package/dist/gallery/frame/chunks/markdown-pzgd8z3s.js +87 -0
  73. package/dist/gallery/frame/chunks/markdown-qx3cngz2.js +1673 -0
  74. package/dist/gallery/frame/chunks/markdown-rawhfvvc.js +85 -0
  75. package/dist/gallery/frame/chunks/markdown-rd8w0ng9.js +49 -0
  76. package/dist/gallery/frame/chunks/markdown-rm2yxfjj.js +2773 -0
  77. package/dist/gallery/frame/chunks/markdown-s1jatrnk.js +993 -0
  78. package/dist/gallery/frame/chunks/markdown-sgfg5vvq.js +59 -0
  79. package/dist/gallery/frame/chunks/markdown-t4ethv9d.js +409 -0
  80. package/dist/gallery/frame/chunks/markdown-tnmabqvz.js +36 -0
  81. package/dist/gallery/frame/chunks/markdown-tvdpppw8.js +5292 -0
  82. package/dist/gallery/frame/chunks/markdown-v0x27twr.js +22 -0
  83. package/dist/gallery/frame/chunks/markdown-v14td68x.js +36 -0
  84. package/dist/gallery/frame/chunks/markdown-w6sgd54z.js +36 -0
  85. package/dist/gallery/frame/chunks/markdown-xw8dsk8b.js +2125 -0
  86. package/dist/gallery/frame/chunks/markdown-y18mve73.js +85 -0
  87. package/dist/gallery/frame/chunks/markdown-yengsms5.js +427 -0
  88. package/dist/gallery/frame/chunks/markdown-z1wc0v0d.js +1826 -0
  89. package/dist/gallery/frame/chunks/markdown-zazx9h4n.js +329 -0
  90. package/dist/gallery/frame/chunks/mermaid-de7p4v0x.js +30 -0
  91. package/dist/gallery/frame/chunks/mindmap-definition-FAOFIHXS-ra44cbem.js +1216 -0
  92. package/dist/gallery/frame/chunks/packet-7NZHBO7P-xppm5913.js +10 -0
  93. package/dist/gallery/frame/chunks/pegDiagram-VL7TDLO6-a2a4wg03.js +163 -0
  94. package/dist/gallery/frame/chunks/pie-RZYD4A2V-hnbxk152.js +10 -0
  95. package/dist/gallery/frame/chunks/pieDiagram-7S7Q4E2Y-f1vxjtmx.js +311 -0
  96. package/dist/gallery/frame/chunks/quadrantDiagram-CIZ2JOQS-ywafa6kh.js +1390 -0
  97. package/dist/gallery/frame/chunks/radar-I7S5WNFK-ewqd27se.js +10 -0
  98. package/dist/gallery/frame/chunks/railroad-3IZDKUUU-5hy4bdx3.js +10 -0
  99. package/dist/gallery/frame/chunks/railroad-abnf-AHOZXSZD-bh5sxz0d.js +10 -0
  100. package/dist/gallery/frame/chunks/railroad-ebnf-EBAXGLYW-6b9c3zeh.js +10 -0
  101. package/dist/gallery/frame/chunks/railroad-peg-LSFZ7HO6-avc8v39s.js +10 -0
  102. package/dist/gallery/frame/chunks/railroadDiagram-AXF67PYL-qc61wax4.js +131 -0
  103. package/dist/gallery/frame/chunks/requirementDiagram-LRYGKXZP-9bs4786c.js +1295 -0
  104. package/dist/gallery/frame/chunks/sankeyDiagram-W5VNT64P-awt1em8b.js +1339 -0
  105. package/dist/gallery/frame/chunks/sequenceDiagram-SI44F4Z6-qaf9mz3t.js +4324 -0
  106. package/dist/gallery/frame/chunks/sizeCapture-X5ZJPWSS-9fq685xd.js +64 -0
  107. package/dist/gallery/frame/chunks/stateDiagram-OKZ733FA-vx7a7hh0.js +456 -0
  108. package/dist/gallery/frame/chunks/stateDiagram-v2-UEYNNEHI-x4m6ws5t.js +46 -0
  109. package/dist/gallery/frame/chunks/swimlanes-SLNWSIFB-e4mxm1gh.js +8287 -0
  110. package/dist/gallery/frame/chunks/swimlanesDiagram-ULZ7WXOC-0h93e2qq.js +42 -0
  111. package/dist/gallery/frame/chunks/timeline-definition-Z64GVDOM-wp0bhbzg.js +1549 -0
  112. package/dist/gallery/frame/chunks/treeView-QDETBFTQ-hcx7n0vt.js +10 -0
  113. package/dist/gallery/frame/chunks/treemap-6X3UGDF4-av02skdw.js +10 -0
  114. package/dist/gallery/frame/chunks/vennDiagram-T6HMQDX7-pmvk1p7n.js +2566 -0
  115. package/dist/gallery/frame/chunks/wardley-OPB4EBWU-njsp6e40.js +10 -0
  116. package/dist/gallery/frame/chunks/wardleyDiagram-T6FBY63Y-eggmnv4z.js +979 -0
  117. package/dist/gallery/frame/chunks/xychartDiagram-ELKLHX3M-q40tnpe5.js +1954 -0
  118. package/dist/gallery/frame/frame.css +183 -0
  119. package/dist/gallery/frame/runtime/chart.js +42744 -0
  120. package/dist/gallery/frame/runtime/html.js +14 -0
  121. package/dist/gallery/frame/runtime/markdown.js +1403 -0
  122. package/dist/gallery/frame/runtime/mermaid.js +32 -0
  123. package/dist/gallery/frame/runtime/svg.js +14 -0
  124. package/dist/gallery/frame/runtime/tsx.js +52 -0
  125. package/dist/gallery/index.html +104 -0
  126. package/docs/reference/cli.md +163 -0
  127. package/docs/reference/export.md +106 -0
  128. package/docs/reference/html.md +215 -0
  129. package/docs/reference/http.md +85 -0
  130. package/docs/reference/mcp.md +78 -0
  131. package/docs/reference/security.md +119 -0
  132. package/docs/reference/storage.md +93 -0
  133. package/docs/reference/tsx.md +101 -0
  134. package/docs/reference/validation.md +212 -0
  135. package/package.json +89 -0
  136. package/scripts/build-gallery.ts +127 -0
  137. package/scripts/launch-netns.sh +67 -0
  138. package/skills/facet/SKILL.md +100 -0
  139. package/src/cli/client.ts +311 -0
  140. package/src/cli/commands/create.ts +49 -0
  141. package/src/cli/commands/doctor.ts +249 -0
  142. package/src/cli/commands/export.ts +179 -0
  143. package/src/cli/commands/instantiate.ts +35 -0
  144. package/src/cli/commands/list.ts +49 -0
  145. package/src/cli/commands/open.ts +75 -0
  146. package/src/cli/commands/pin.ts +39 -0
  147. package/src/cli/commands/promote.ts +49 -0
  148. package/src/cli/commands/publish.ts +122 -0
  149. package/src/cli/commands/read-back.ts +56 -0
  150. package/src/cli/commands/status.ts +114 -0
  151. package/src/cli/commands/watch.ts +146 -0
  152. package/src/cli/main.ts +522 -0
  153. package/src/cli/output.ts +106 -0
  154. package/src/cli/parser.ts +376 -0
  155. package/src/cli/presenter.ts +212 -0
  156. package/src/cli/service-metadata.ts +134 -0
  157. package/src/cli/spawn-service.ts +326 -0
  158. package/src/css.d.ts +4 -0
  159. package/src/gallery-web/app.ts +1581 -0
  160. package/src/gallery-web/export-menu.ts +121 -0
  161. package/src/gallery-web/export.ts +112 -0
  162. package/src/gallery-web/favicon.ts +54 -0
  163. package/src/gallery-web/frame/entries/chart.ts +6 -0
  164. package/src/gallery-web/frame/entries/html.ts +6 -0
  165. package/src/gallery-web/frame/entries/markdown.ts +6 -0
  166. package/src/gallery-web/frame/entries/mermaid.ts +6 -0
  167. package/src/gallery-web/frame/entries/svg.ts +6 -0
  168. package/src/gallery-web/frame/entries/tsx.ts +6 -0
  169. package/src/gallery-web/frame/frame-payload.ts +91 -0
  170. package/src/gallery-web/frame/renderer-validation.ts +13 -0
  171. package/src/gallery-web/frame/renderers/chart.ts +182 -0
  172. package/src/gallery-web/frame/renderers/dompurify-shim.ts +112 -0
  173. package/src/gallery-web/frame/renderers/html.ts +48 -0
  174. package/src/gallery-web/frame/renderers/markdown.ts +81 -0
  175. package/src/gallery-web/frame/renderers/mermaid.ts +120 -0
  176. package/src/gallery-web/frame/renderers/registry.ts +260 -0
  177. package/src/gallery-web/frame/renderers/svg.ts +393 -0
  178. package/src/gallery-web/frame/renderers/tsx.ts +61 -0
  179. package/src/gallery-web/frame/runtime.ts +501 -0
  180. package/src/gallery-web/frame/styles/artifact.css +8424 -0
  181. package/src/gallery-web/frame/styles/frame.css +183 -0
  182. package/src/gallery-web/frame/styles/html-source.css +23 -0
  183. package/src/gallery-web/frame/view-box.ts +33 -0
  184. package/src/gallery-web/frame-html.ts +72 -0
  185. package/src/gallery-web/index.html +104 -0
  186. package/src/gallery-web/session.ts +107 -0
  187. package/src/gallery-web/sse-client.ts +212 -0
  188. package/src/gallery-web/styles/app.css +420 -0
  189. package/src/gallery-web/styles/tokens.css +112 -0
  190. package/src/gallery-web/styles/verdict.css +186 -0
  191. package/src/gallery-web/swap.ts +64 -0
  192. package/src/gallery-web/theme.ts +40 -0
  193. package/src/gallery-web/view-state.ts +93 -0
  194. package/src/harness-adapters/claude-code/README.md +10 -0
  195. package/src/harness-adapters/claude-code/facet.sh +4 -0
  196. package/src/harness-adapters/codex/README.md +10 -0
  197. package/src/harness-adapters/codex/facet.sh +4 -0
  198. package/src/harness-adapters/mcp/README.md +13 -0
  199. package/src/harness-adapters/mcp/cli-bridge.ts +216 -0
  200. package/src/harness-adapters/mcp/main.ts +15 -0
  201. package/src/harness-adapters/mcp/server.ts +164 -0
  202. package/src/harness-adapters/mcp/tool-schemas.ts +53 -0
  203. package/src/harness-adapters/opencode/README.md +10 -0
  204. package/src/harness-adapters/opencode/facet.sh +4 -0
  205. package/src/runtime/compiled-entrypoints.ts +69 -0
  206. package/src/service/dispatcher.ts +717 -0
  207. package/src/service/export.ts +218 -0
  208. package/src/service/http-utils.ts +55 -0
  209. package/src/service/lexical/expectations.ts +210 -0
  210. package/src/service/lifecycle/idle-controller.ts +125 -0
  211. package/src/service/lifecycle/orphan-cleanup.ts +128 -0
  212. package/src/service/lifecycle/process-lock.ts +235 -0
  213. package/src/service/main.ts +136 -0
  214. package/src/service/process.ts +240 -0
  215. package/src/service/router-guards.ts +239 -0
  216. package/src/service/router.ts +627 -0
  217. package/src/service/security/auth.ts +168 -0
  218. package/src/service/security/host-origin.ts +138 -0
  219. package/src/service/security/http-guards.ts +13 -0
  220. package/src/service/security/leases.ts +182 -0
  221. package/src/service/security/token-store.ts +138 -0
  222. package/src/service/server.ts +356 -0
  223. package/src/service/store/database.ts +61 -0
  224. package/src/service/store/evidence-retention.ts +234 -0
  225. package/src/service/store/migrations.ts +167 -0
  226. package/src/service/store/repository-lifecycle.ts +121 -0
  227. package/src/service/store/repository.ts +732 -0
  228. package/src/service/store/schema.ts +218 -0
  229. package/src/service/stored-verdict.ts +97 -0
  230. package/src/service/stream.ts +301 -0
  231. package/src/service/verdict-enrichment.ts +45 -0
  232. package/src/shared/build/frame-bundle-plugins.ts +61 -0
  233. package/src/shared/build-mode.ts +28 -0
  234. package/src/shared/config/evidence-read.ts +98 -0
  235. package/src/shared/config/limits.ts +56 -0
  236. package/src/shared/config/paths.ts +96 -0
  237. package/src/shared/contracts/artifact-types.ts +2 -0
  238. package/src/shared/contracts/artifact.ts +98 -0
  239. package/src/shared/contracts/commands/_shared.ts +59 -0
  240. package/src/shared/contracts/commands/guards.ts +86 -0
  241. package/src/shared/contracts/commands/index.ts +204 -0
  242. package/src/shared/contracts/commands/names.ts +35 -0
  243. package/src/shared/contracts/commands/requests.ts +149 -0
  244. package/src/shared/contracts/commands/results.ts +200 -0
  245. package/src/shared/contracts/envelope.ts +140 -0
  246. package/src/shared/contracts/events.ts +41 -0
  247. package/src/shared/contracts/observed-counts.ts +19 -0
  248. package/src/shared/contracts/renderers.ts +6 -0
  249. package/src/shared/contracts/validation.ts +296 -0
  250. package/src/shared/errors/facet-error.ts +127 -0
  251. package/src/shared/errors/store-error.ts +68 -0
  252. package/src/shared/evidence-image.ts +37 -0
  253. package/src/shared/export.ts +31 -0
  254. package/src/shared/html/policy.ts +108 -0
  255. package/src/shared/html/style-vocabulary.ts +352 -0
  256. package/src/shared/logging/logger.ts +108 -0
  257. package/src/shared/logging/redact.ts +49 -0
  258. package/src/shared/security/frozen-csp.ts +13 -0
  259. package/src/shared/storage-version.ts +2 -0
  260. package/src/shared/tsx/execution.ts +29 -0
  261. package/src/shared/tsx/import-policy.ts +94 -0
  262. package/src/shared/util/dir-permissions.ts +94 -0
  263. package/src/shared/util/mermaid-nodes.ts +230 -0
  264. package/src/shared/util/process.ts +67 -0
  265. package/src/shared/util/time.ts +21 -0
  266. package/src/shared/version.ts +3 -0
  267. package/src/validation/sandbox/limits.ts +41 -0
  268. package/src/validation/sandbox/netns.ts +177 -0
  269. package/src/validation/tier0/chart.ts +177 -0
  270. package/src/validation/tier0/dom-shim.ts +54 -0
  271. package/src/validation/tier0/html.ts +408 -0
  272. package/src/validation/tier0/markdown.ts +285 -0
  273. package/src/validation/tier0/mermaid.ts +98 -0
  274. package/src/validation/tier0/runner.ts +504 -0
  275. package/src/validation/tier0/svg.ts +321 -0
  276. package/src/validation/tier0/tsx/allowlist-resolver.ts +77 -0
  277. package/src/validation/tier0/tsx/ast-policy-capabilities.ts +238 -0
  278. package/src/validation/tier0/tsx/ast-policy-shared.ts +71 -0
  279. package/src/validation/tier0/tsx/ast-policy.ts +181 -0
  280. package/src/validation/tier0/tsx/compiler.ts +156 -0
  281. package/src/validation/tier0/worker-dispatch.ts +211 -0
  282. package/src/validation/tier0/worker-entry.ts +96 -0
  283. package/src/validation/tier0/worker-input.ts +75 -0
  284. package/src/validation/tier1/browser-process.ts +147 -0
  285. package/src/validation/tier1/cdp-pipe.ts +281 -0
  286. package/src/validation/tier1/entries/chart.ts +5 -0
  287. package/src/validation/tier1/entries/html.ts +6 -0
  288. package/src/validation/tier1/entries/markdown.ts +5 -0
  289. package/src/validation/tier1/entries/mermaid.ts +5 -0
  290. package/src/validation/tier1/entries/svg.ts +5 -0
  291. package/src/validation/tier1/entries/tsx.ts +5 -0
  292. package/src/validation/tier1/frame-target.ts +162 -0
  293. package/src/validation/tier1/harness-entry.ts +261 -0
  294. package/src/validation/tier1/harness.ts +215 -0
  295. package/src/validation/tier1/isolated-probe.ts +94 -0
  296. package/src/validation/tier1/launcher.ts +177 -0
  297. package/src/validation/tier1/limits.ts +80 -0
  298. package/src/validation/tier1/nonce.ts +17 -0
  299. package/src/validation/tier1/protocol-probe.ts +519 -0
  300. package/src/validation/tier1/runner.ts +1122 -0
  301. package/src/validation/tier1/verdict.ts +246 -0
  302. package/src/validation/tier1/webp.ts +69 -0
  303. package/templates/README.md +88 -0
  304. package/templates/bar-compare.vl.json +63 -0
  305. package/templates/capacity-report.tsx +102 -0
  306. package/templates/decision-record.md +24 -0
  307. package/templates/deployment-state.mmd +40 -0
  308. package/templates/exemplar.md +91 -0
  309. package/templates/facet-story.tsx +799 -0
  310. package/templates/fleet-dashboard.html +141 -0
  311. package/templates/html-release-ledger.html +91 -0
  312. package/templates/html-status-report.html +114 -0
  313. package/templates/incident-console.tsx +147 -0
  314. package/templates/legion-boundaries.mmd +23 -0
  315. package/templates/legion-flow.mmd +15 -0
  316. package/templates/legion-sequence.mmd +14 -0
  317. package/templates/legion-state.mmd +7 -0
  318. package/templates/metric-card.svg +29 -0
  319. package/templates/observability-map.svg +101 -0
  320. package/templates/pipeline-audit.md +108 -0
  321. package/templates/release-metrics.vl.json +98 -0
  322. package/templates/service-topology.mmd +47 -0
  323. package/templates/status-report.md +32 -0
  324. package/templates/system-map.svg +53 -0
  325. package/templates/timeseries.vl.json +71 -0
  326. package/templates/tsx-interactive-counter.tsx +19 -0
  327. package/templates/tsx-status-report.tsx +31 -0
@@ -0,0 +1,1549 @@
1
+ import {
2
+ selectSvgElement
3
+ } from "./markdown-6zz8efx2.js";
4
+ import {
5
+ parseFontSize
6
+ } from "./markdown-ff5wvb43.js";
7
+ import"./markdown-pzgd8z3s.js";
8
+ import {
9
+ clear,
10
+ commonDb_exports,
11
+ darken_default,
12
+ getConfig,
13
+ getConfig2,
14
+ is_dark_default,
15
+ lighten_default,
16
+ setupGraphViewbox
17
+ } from "./markdown-92n37gd4.js";
18
+ import {
19
+ log,
20
+ select_default
21
+ } from "./markdown-xw8dsk8b.js";
22
+ import {
23
+ __export,
24
+ __name
25
+ } from "./markdown-1s5vwkf2.js";
26
+ import {
27
+ arc_default
28
+ } from "./markdown-dy5sgjhc.js";
29
+ import"./markdown-809k7q41.js";
30
+
31
+ // node_modules/mermaid/dist/chunks/mermaid.core/timeline-definition-Z64GVDOM.mjs
32
+ var parser = function() {
33
+ var o = /* @__PURE__ */ __name(function(k, v, o2, l) {
34
+ for (o2 = o2 || {}, l = k.length;l--; o2[k[l]] = v)
35
+ ;
36
+ return o2;
37
+ }, "o"), $V0 = [6, 11, 13, 14, 15, 17, 19, 20, 23, 24], $V1 = [1, 12], $V2 = [1, 13], $V3 = [1, 14], $V4 = [1, 15], $V5 = [1, 16], $V6 = [1, 19], $V7 = [1, 20];
38
+ var parser2 = {
39
+ trace: /* @__PURE__ */ __name(function trace() {}, "trace"),
40
+ yy: {},
41
+ symbols_: { error: 2, start: 3, timeline_header: 4, document: 5, EOF: 6, timeline: 7, timeline_lr: 8, timeline_td: 9, line: 10, SPACE: 11, statement: 12, NEWLINE: 13, title: 14, acc_title: 15, acc_title_value: 16, acc_descr: 17, acc_descr_value: 18, acc_descr_multiline_value: 19, section: 20, period_statement: 21, event_statement: 22, period: 23, event: 24, $accept: 0, $end: 1 },
42
+ terminals_: { 2: "error", 6: "EOF", 7: "timeline", 8: "timeline_lr", 9: "timeline_td", 11: "SPACE", 13: "NEWLINE", 14: "title", 15: "acc_title", 16: "acc_title_value", 17: "acc_descr", 18: "acc_descr_value", 19: "acc_descr_multiline_value", 20: "section", 23: "period", 24: "event" },
43
+ productions_: [0, [3, 3], [4, 1], [4, 1], [4, 1], [5, 0], [5, 2], [10, 2], [10, 1], [10, 1], [10, 1], [12, 1], [12, 2], [12, 2], [12, 1], [12, 1], [12, 1], [12, 1], [21, 1], [22, 1]],
44
+ performAction: /* @__PURE__ */ __name(function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) {
45
+ var $0 = $$.length - 1;
46
+ switch (yystate) {
47
+ case 1:
48
+ return $$[$0 - 1];
49
+ break;
50
+ case 3:
51
+ yy.setDirection("LR");
52
+ break;
53
+ case 4:
54
+ yy.setDirection("TD");
55
+ break;
56
+ case 5:
57
+ this.$ = [];
58
+ break;
59
+ case 6:
60
+ $$[$0 - 1].push($$[$0]);
61
+ this.$ = $$[$0 - 1];
62
+ break;
63
+ case 7:
64
+ case 8:
65
+ this.$ = $$[$0];
66
+ break;
67
+ case 9:
68
+ case 10:
69
+ this.$ = [];
70
+ break;
71
+ case 11:
72
+ yy.getCommonDb().setDiagramTitle($$[$0].substr(6));
73
+ this.$ = $$[$0].substr(6);
74
+ break;
75
+ case 12:
76
+ this.$ = $$[$0].trim();
77
+ yy.getCommonDb().setAccTitle(this.$);
78
+ break;
79
+ case 13:
80
+ case 14:
81
+ this.$ = $$[$0].trim();
82
+ yy.getCommonDb().setAccDescription(this.$);
83
+ break;
84
+ case 15:
85
+ yy.addSection($$[$0].substr(8));
86
+ this.$ = $$[$0].substr(8);
87
+ break;
88
+ case 18:
89
+ yy.addTask($$[$0], 0, "");
90
+ this.$ = $$[$0];
91
+ break;
92
+ case 19:
93
+ yy.addEvent($$[$0].substr(2));
94
+ this.$ = $$[$0];
95
+ break;
96
+ }
97
+ }, "anonymous"),
98
+ table: [{ 3: 1, 4: 2, 7: [1, 3], 8: [1, 4], 9: [1, 5] }, { 1: [3] }, o($V0, [2, 5], { 5: 6 }), o($V0, [2, 2]), o($V0, [2, 3]), o($V0, [2, 4]), { 6: [1, 7], 10: 8, 11: [1, 9], 12: 10, 13: [1, 11], 14: $V1, 15: $V2, 17: $V3, 19: $V4, 20: $V5, 21: 17, 22: 18, 23: $V6, 24: $V7 }, o($V0, [2, 10], { 1: [2, 1] }), o($V0, [2, 6]), { 12: 21, 14: $V1, 15: $V2, 17: $V3, 19: $V4, 20: $V5, 21: 17, 22: 18, 23: $V6, 24: $V7 }, o($V0, [2, 8]), o($V0, [2, 9]), o($V0, [2, 11]), { 16: [1, 22] }, { 18: [1, 23] }, o($V0, [2, 14]), o($V0, [2, 15]), o($V0, [2, 16]), o($V0, [2, 17]), o($V0, [2, 18]), o($V0, [2, 19]), o($V0, [2, 7]), o($V0, [2, 12]), o($V0, [2, 13])],
99
+ defaultActions: {},
100
+ parseError: /* @__PURE__ */ __name(function parseError(str, hash) {
101
+ if (hash.recoverable) {
102
+ this.trace(str);
103
+ } else {
104
+ var error = new Error(str);
105
+ error.hash = hash;
106
+ throw error;
107
+ }
108
+ }, "parseError"),
109
+ parse: /* @__PURE__ */ __name(function parse(input) {
110
+ var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1;
111
+ var args = lstack.slice.call(arguments, 1);
112
+ var lexer2 = Object.create(this.lexer);
113
+ var sharedState = { yy: {} };
114
+ for (var k in this.yy) {
115
+ if (Object.prototype.hasOwnProperty.call(this.yy, k)) {
116
+ sharedState.yy[k] = this.yy[k];
117
+ }
118
+ }
119
+ lexer2.setInput(input, sharedState.yy);
120
+ sharedState.yy.lexer = lexer2;
121
+ sharedState.yy.parser = this;
122
+ if (typeof lexer2.yylloc == "undefined") {
123
+ lexer2.yylloc = {};
124
+ }
125
+ var yyloc = lexer2.yylloc;
126
+ lstack.push(yyloc);
127
+ var ranges = lexer2.options && lexer2.options.ranges;
128
+ if (typeof sharedState.yy.parseError === "function") {
129
+ this.parseError = sharedState.yy.parseError;
130
+ } else {
131
+ this.parseError = Object.getPrototypeOf(this).parseError;
132
+ }
133
+ function popStack(n) {
134
+ stack.length = stack.length - 2 * n;
135
+ vstack.length = vstack.length - n;
136
+ lstack.length = lstack.length - n;
137
+ }
138
+ __name(popStack, "popStack");
139
+ function lex() {
140
+ var token;
141
+ token = tstack.pop() || lexer2.lex() || EOF;
142
+ if (typeof token !== "number") {
143
+ if (token instanceof Array) {
144
+ tstack = token;
145
+ token = tstack.pop();
146
+ }
147
+ token = self.symbols_[token] || token;
148
+ }
149
+ return token;
150
+ }
151
+ __name(lex, "lex");
152
+ var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected;
153
+ while (true) {
154
+ state = stack[stack.length - 1];
155
+ if (this.defaultActions[state]) {
156
+ action = this.defaultActions[state];
157
+ } else {
158
+ if (symbol === null || typeof symbol == "undefined") {
159
+ symbol = lex();
160
+ }
161
+ action = table[state] && table[state][symbol];
162
+ }
163
+ if (typeof action === "undefined" || !action.length || !action[0]) {
164
+ var errStr = "";
165
+ expected = [];
166
+ for (p in table[state]) {
167
+ if (this.terminals_[p] && p > TERROR) {
168
+ expected.push("'" + this.terminals_[p] + "'");
169
+ }
170
+ }
171
+ if (lexer2.showPosition) {
172
+ errStr = "Parse error on line " + (yylineno + 1) + `:
173
+ ` + lexer2.showPosition() + `
174
+ Expecting ` + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'";
175
+ } else {
176
+ errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == EOF ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'");
177
+ }
178
+ this.parseError(errStr, {
179
+ text: lexer2.match,
180
+ token: this.terminals_[symbol] || symbol,
181
+ line: lexer2.yylineno,
182
+ loc: yyloc,
183
+ expected
184
+ });
185
+ }
186
+ if (action[0] instanceof Array && action.length > 1) {
187
+ throw new Error("Parse Error: multiple actions possible at state: " + state + ", token: " + symbol);
188
+ }
189
+ switch (action[0]) {
190
+ case 1:
191
+ stack.push(symbol);
192
+ vstack.push(lexer2.yytext);
193
+ lstack.push(lexer2.yylloc);
194
+ stack.push(action[1]);
195
+ symbol = null;
196
+ if (!preErrorSymbol) {
197
+ yyleng = lexer2.yyleng;
198
+ yytext = lexer2.yytext;
199
+ yylineno = lexer2.yylineno;
200
+ yyloc = lexer2.yylloc;
201
+ if (recovering > 0) {
202
+ recovering--;
203
+ }
204
+ } else {
205
+ symbol = preErrorSymbol;
206
+ preErrorSymbol = null;
207
+ }
208
+ break;
209
+ case 2:
210
+ len = this.productions_[action[1]][1];
211
+ yyval.$ = vstack[vstack.length - len];
212
+ yyval._$ = {
213
+ first_line: lstack[lstack.length - (len || 1)].first_line,
214
+ last_line: lstack[lstack.length - 1].last_line,
215
+ first_column: lstack[lstack.length - (len || 1)].first_column,
216
+ last_column: lstack[lstack.length - 1].last_column
217
+ };
218
+ if (ranges) {
219
+ yyval._$.range = [
220
+ lstack[lstack.length - (len || 1)].range[0],
221
+ lstack[lstack.length - 1].range[1]
222
+ ];
223
+ }
224
+ r = this.performAction.apply(yyval, [
225
+ yytext,
226
+ yyleng,
227
+ yylineno,
228
+ sharedState.yy,
229
+ action[1],
230
+ vstack,
231
+ lstack
232
+ ].concat(args));
233
+ if (typeof r !== "undefined") {
234
+ return r;
235
+ }
236
+ if (len) {
237
+ stack = stack.slice(0, -1 * len * 2);
238
+ vstack = vstack.slice(0, -1 * len);
239
+ lstack = lstack.slice(0, -1 * len);
240
+ }
241
+ stack.push(this.productions_[action[1]][0]);
242
+ vstack.push(yyval.$);
243
+ lstack.push(yyval._$);
244
+ newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
245
+ stack.push(newState);
246
+ break;
247
+ case 3:
248
+ return true;
249
+ }
250
+ }
251
+ return true;
252
+ }, "parse")
253
+ };
254
+ var lexer = /* @__PURE__ */ function() {
255
+ var lexer2 = {
256
+ EOF: 1,
257
+ parseError: /* @__PURE__ */ __name(function parseError(str, hash) {
258
+ if (this.yy.parser) {
259
+ this.yy.parser.parseError(str, hash);
260
+ } else {
261
+ throw new Error(str);
262
+ }
263
+ }, "parseError"),
264
+ setInput: /* @__PURE__ */ __name(function(input, yy) {
265
+ this.yy = yy || this.yy || {};
266
+ this._input = input;
267
+ this._more = this._backtrack = this.done = false;
268
+ this.yylineno = this.yyleng = 0;
269
+ this.yytext = this.matched = this.match = "";
270
+ this.conditionStack = ["INITIAL"];
271
+ this.yylloc = {
272
+ first_line: 1,
273
+ first_column: 0,
274
+ last_line: 1,
275
+ last_column: 0
276
+ };
277
+ if (this.options.ranges) {
278
+ this.yylloc.range = [0, 0];
279
+ }
280
+ this.offset = 0;
281
+ return this;
282
+ }, "setInput"),
283
+ input: /* @__PURE__ */ __name(function() {
284
+ var ch = this._input[0];
285
+ this.yytext += ch;
286
+ this.yyleng++;
287
+ this.offset++;
288
+ this.match += ch;
289
+ this.matched += ch;
290
+ var lines = ch.match(/(?:\r\n?|\n).*/g);
291
+ if (lines) {
292
+ this.yylineno++;
293
+ this.yylloc.last_line++;
294
+ } else {
295
+ this.yylloc.last_column++;
296
+ }
297
+ if (this.options.ranges) {
298
+ this.yylloc.range[1]++;
299
+ }
300
+ this._input = this._input.slice(1);
301
+ return ch;
302
+ }, "input"),
303
+ unput: /* @__PURE__ */ __name(function(ch) {
304
+ var len = ch.length;
305
+ var lines = ch.split(/(?:\r\n?|\n)/g);
306
+ this._input = ch + this._input;
307
+ this.yytext = this.yytext.substr(0, this.yytext.length - len);
308
+ this.offset -= len;
309
+ var oldLines = this.match.split(/(?:\r\n?|\n)/g);
310
+ this.match = this.match.substr(0, this.match.length - 1);
311
+ this.matched = this.matched.substr(0, this.matched.length - 1);
312
+ if (lines.length - 1) {
313
+ this.yylineno -= lines.length - 1;
314
+ }
315
+ var r = this.yylloc.range;
316
+ this.yylloc = {
317
+ first_line: this.yylloc.first_line,
318
+ last_line: this.yylineno + 1,
319
+ first_column: this.yylloc.first_column,
320
+ last_column: lines ? (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length : this.yylloc.first_column - len
321
+ };
322
+ if (this.options.ranges) {
323
+ this.yylloc.range = [r[0], r[0] + this.yyleng - len];
324
+ }
325
+ this.yyleng = this.yytext.length;
326
+ return this;
327
+ }, "unput"),
328
+ more: /* @__PURE__ */ __name(function() {
329
+ this._more = true;
330
+ return this;
331
+ }, "more"),
332
+ reject: /* @__PURE__ */ __name(function() {
333
+ if (this.options.backtrack_lexer) {
334
+ this._backtrack = true;
335
+ } else {
336
+ return this.parseError("Lexical error on line " + (this.yylineno + 1) + `. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
337
+ ` + this.showPosition(), {
338
+ text: "",
339
+ token: null,
340
+ line: this.yylineno
341
+ });
342
+ }
343
+ return this;
344
+ }, "reject"),
345
+ less: /* @__PURE__ */ __name(function(n) {
346
+ this.unput(this.match.slice(n));
347
+ }, "less"),
348
+ pastInput: /* @__PURE__ */ __name(function() {
349
+ var past = this.matched.substr(0, this.matched.length - this.match.length);
350
+ return (past.length > 20 ? "..." : "") + past.substr(-20).replace(/\n/g, "");
351
+ }, "pastInput"),
352
+ upcomingInput: /* @__PURE__ */ __name(function() {
353
+ var next = this.match;
354
+ if (next.length < 20) {
355
+ next += this._input.substr(0, 20 - next.length);
356
+ }
357
+ return (next.substr(0, 20) + (next.length > 20 ? "..." : "")).replace(/\n/g, "");
358
+ }, "upcomingInput"),
359
+ showPosition: /* @__PURE__ */ __name(function() {
360
+ var pre = this.pastInput();
361
+ var c = new Array(pre.length + 1).join("-");
362
+ return pre + this.upcomingInput() + `
363
+ ` + c + "^";
364
+ }, "showPosition"),
365
+ test_match: /* @__PURE__ */ __name(function(match, indexed_rule) {
366
+ var token, lines, backup;
367
+ if (this.options.backtrack_lexer) {
368
+ backup = {
369
+ yylineno: this.yylineno,
370
+ yylloc: {
371
+ first_line: this.yylloc.first_line,
372
+ last_line: this.last_line,
373
+ first_column: this.yylloc.first_column,
374
+ last_column: this.yylloc.last_column
375
+ },
376
+ yytext: this.yytext,
377
+ match: this.match,
378
+ matches: this.matches,
379
+ matched: this.matched,
380
+ yyleng: this.yyleng,
381
+ offset: this.offset,
382
+ _more: this._more,
383
+ _input: this._input,
384
+ yy: this.yy,
385
+ conditionStack: this.conditionStack.slice(0),
386
+ done: this.done
387
+ };
388
+ if (this.options.ranges) {
389
+ backup.yylloc.range = this.yylloc.range.slice(0);
390
+ }
391
+ }
392
+ lines = match[0].match(/(?:\r\n?|\n).*/g);
393
+ if (lines) {
394
+ this.yylineno += lines.length;
395
+ }
396
+ this.yylloc = {
397
+ first_line: this.yylloc.last_line,
398
+ last_line: this.yylineno + 1,
399
+ first_column: this.yylloc.last_column,
400
+ last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length
401
+ };
402
+ this.yytext += match[0];
403
+ this.match += match[0];
404
+ this.matches = match;
405
+ this.yyleng = this.yytext.length;
406
+ if (this.options.ranges) {
407
+ this.yylloc.range = [this.offset, this.offset += this.yyleng];
408
+ }
409
+ this._more = false;
410
+ this._backtrack = false;
411
+ this._input = this._input.slice(match[0].length);
412
+ this.matched += match[0];
413
+ token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);
414
+ if (this.done && this._input) {
415
+ this.done = false;
416
+ }
417
+ if (token) {
418
+ return token;
419
+ } else if (this._backtrack) {
420
+ for (var k in backup) {
421
+ this[k] = backup[k];
422
+ }
423
+ return false;
424
+ }
425
+ return false;
426
+ }, "test_match"),
427
+ next: /* @__PURE__ */ __name(function() {
428
+ if (this.done) {
429
+ return this.EOF;
430
+ }
431
+ if (!this._input) {
432
+ this.done = true;
433
+ }
434
+ var token, match, tempMatch, index;
435
+ if (!this._more) {
436
+ this.yytext = "";
437
+ this.match = "";
438
+ }
439
+ var rules = this._currentRules();
440
+ for (var i = 0;i < rules.length; i++) {
441
+ tempMatch = this._input.match(this.rules[rules[i]]);
442
+ if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
443
+ match = tempMatch;
444
+ index = i;
445
+ if (this.options.backtrack_lexer) {
446
+ token = this.test_match(tempMatch, rules[i]);
447
+ if (token !== false) {
448
+ return token;
449
+ } else if (this._backtrack) {
450
+ match = false;
451
+ continue;
452
+ } else {
453
+ return false;
454
+ }
455
+ } else if (!this.options.flex) {
456
+ break;
457
+ }
458
+ }
459
+ }
460
+ if (match) {
461
+ token = this.test_match(match, rules[index]);
462
+ if (token !== false) {
463
+ return token;
464
+ }
465
+ return false;
466
+ }
467
+ if (this._input === "") {
468
+ return this.EOF;
469
+ } else {
470
+ return this.parseError("Lexical error on line " + (this.yylineno + 1) + `. Unrecognized text.
471
+ ` + this.showPosition(), {
472
+ text: "",
473
+ token: null,
474
+ line: this.yylineno
475
+ });
476
+ }
477
+ }, "next"),
478
+ lex: /* @__PURE__ */ __name(function lex() {
479
+ var r = this.next();
480
+ if (r) {
481
+ return r;
482
+ } else {
483
+ return this.lex();
484
+ }
485
+ }, "lex"),
486
+ begin: /* @__PURE__ */ __name(function begin(condition) {
487
+ this.conditionStack.push(condition);
488
+ }, "begin"),
489
+ popState: /* @__PURE__ */ __name(function popState() {
490
+ var n = this.conditionStack.length - 1;
491
+ if (n > 0) {
492
+ return this.conditionStack.pop();
493
+ } else {
494
+ return this.conditionStack[0];
495
+ }
496
+ }, "popState"),
497
+ _currentRules: /* @__PURE__ */ __name(function _currentRules() {
498
+ if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {
499
+ return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;
500
+ } else {
501
+ return this.conditions["INITIAL"].rules;
502
+ }
503
+ }, "_currentRules"),
504
+ topState: /* @__PURE__ */ __name(function topState(n) {
505
+ n = this.conditionStack.length - 1 - Math.abs(n || 0);
506
+ if (n >= 0) {
507
+ return this.conditionStack[n];
508
+ } else {
509
+ return "INITIAL";
510
+ }
511
+ }, "topState"),
512
+ pushState: /* @__PURE__ */ __name(function pushState(condition) {
513
+ this.begin(condition);
514
+ }, "pushState"),
515
+ stateStackSize: /* @__PURE__ */ __name(function stateStackSize() {
516
+ return this.conditionStack.length;
517
+ }, "stateStackSize"),
518
+ options: { "case-insensitive": true },
519
+ performAction: /* @__PURE__ */ __name(function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) {
520
+ var YYSTATE = YY_START;
521
+ switch ($avoiding_name_collisions) {
522
+ case 0:
523
+ break;
524
+ case 1:
525
+ break;
526
+ case 2:
527
+ return 13;
528
+ break;
529
+ case 3:
530
+ break;
531
+ case 4:
532
+ break;
533
+ case 5:
534
+ return 8;
535
+ break;
536
+ case 6:
537
+ return 9;
538
+ break;
539
+ case 7:
540
+ return 7;
541
+ break;
542
+ case 8:
543
+ return 14;
544
+ break;
545
+ case 9:
546
+ this.begin("acc_title");
547
+ return 15;
548
+ break;
549
+ case 10:
550
+ this.popState();
551
+ return "acc_title_value";
552
+ break;
553
+ case 11:
554
+ this.begin("acc_descr");
555
+ return 17;
556
+ break;
557
+ case 12:
558
+ this.popState();
559
+ return "acc_descr_value";
560
+ break;
561
+ case 13:
562
+ this.begin("acc_descr_multiline");
563
+ break;
564
+ case 14:
565
+ this.popState();
566
+ break;
567
+ case 15:
568
+ return "acc_descr_multiline_value";
569
+ break;
570
+ case 16:
571
+ return 20;
572
+ break;
573
+ case 17:
574
+ return 24;
575
+ break;
576
+ case 18:
577
+ return 23;
578
+ break;
579
+ case 19:
580
+ return 6;
581
+ break;
582
+ case 20:
583
+ return "INVALID";
584
+ break;
585
+ }
586
+ }, "anonymous"),
587
+ rules: [/^(?:%(?!\{)[^\n]*)/i, /^(?:[^\}]%%[^\n]*)/i, /^(?:[\n]+)/i, /^(?:\s+)/i, /^(?:#[^\n]*)/i, /^(?:timeline[ \t]+LR\b)/i, /^(?:timeline[ \t]+TD\b)/i, /^(?:timeline\b)/i, /^(?:title\s[^\n]+)/i, /^(?:accTitle\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*\{\s*)/i, /^(?:[\}])/i, /^(?:[^\}]*)/i, /^(?:section\s[^:\n]+)/i, /^(?::\s(?:[^:\n]|:(?!\s))+)/i, /^(?:[^#:\n]+)/i, /^(?:$)/i, /^(?:.)/i],
588
+ conditions: { acc_descr_multiline: { rules: [14, 15], inclusive: false }, acc_descr: { rules: [12], inclusive: false }, acc_title: { rules: [10], inclusive: false }, INITIAL: { rules: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 13, 16, 17, 18, 19, 20], inclusive: true } }
589
+ };
590
+ return lexer2;
591
+ }();
592
+ parser2.lexer = lexer;
593
+ function Parser() {
594
+ this.yy = {};
595
+ }
596
+ __name(Parser, "Parser");
597
+ Parser.prototype = parser2;
598
+ parser2.Parser = Parser;
599
+ return new Parser;
600
+ }();
601
+ parser.parser = parser;
602
+ var timeline_default = parser;
603
+ var timelineDb_exports = {};
604
+ __export(timelineDb_exports, {
605
+ addEvent: () => addEvent,
606
+ addSection: () => addSection,
607
+ addTask: () => addTask,
608
+ addTaskOrg: () => addTaskOrg,
609
+ clear: () => clear2,
610
+ default: () => timelineDb_default,
611
+ getCommonDb: () => getCommonDb,
612
+ getDirection: () => getDirection,
613
+ getSections: () => getSections,
614
+ getTasks: () => getTasks,
615
+ setDirection: () => setDirection
616
+ });
617
+ var currentSection = "";
618
+ var currentTaskId = 0;
619
+ var direction = "LR";
620
+ var sections = [];
621
+ var tasks = [];
622
+ var rawTasks = [];
623
+ var getCommonDb = /* @__PURE__ */ __name(() => commonDb_exports, "getCommonDb");
624
+ var clear2 = /* @__PURE__ */ __name(function() {
625
+ sections.length = 0;
626
+ tasks.length = 0;
627
+ currentSection = "";
628
+ rawTasks.length = 0;
629
+ direction = "LR";
630
+ clear();
631
+ }, "clear");
632
+ var setDirection = /* @__PURE__ */ __name(function(dir) {
633
+ direction = dir;
634
+ }, "setDirection");
635
+ var getDirection = /* @__PURE__ */ __name(function() {
636
+ return direction;
637
+ }, "getDirection");
638
+ var addSection = /* @__PURE__ */ __name(function(txt) {
639
+ currentSection = txt;
640
+ sections.push(txt);
641
+ }, "addSection");
642
+ var getSections = /* @__PURE__ */ __name(function() {
643
+ return sections;
644
+ }, "getSections");
645
+ var getTasks = /* @__PURE__ */ __name(function() {
646
+ let allItemsProcessed = compileTasks();
647
+ const maxDepth = 100;
648
+ let iterationCount = 0;
649
+ while (!allItemsProcessed && iterationCount < maxDepth) {
650
+ allItemsProcessed = compileTasks();
651
+ iterationCount++;
652
+ }
653
+ tasks.push(...rawTasks);
654
+ return tasks;
655
+ }, "getTasks");
656
+ var addTask = /* @__PURE__ */ __name(function(period, length, event) {
657
+ const rawTask = {
658
+ id: currentTaskId++,
659
+ section: currentSection,
660
+ type: currentSection,
661
+ task: period,
662
+ score: length ? length : 0,
663
+ events: event ? [event] : []
664
+ };
665
+ rawTasks.push(rawTask);
666
+ }, "addTask");
667
+ var addEvent = /* @__PURE__ */ __name(function(event) {
668
+ const currentTask = rawTasks.find((task) => task.id === currentTaskId - 1);
669
+ currentTask.events.push(event);
670
+ }, "addEvent");
671
+ var addTaskOrg = /* @__PURE__ */ __name(function(descr) {
672
+ const newTask = {
673
+ section: currentSection,
674
+ type: currentSection,
675
+ description: descr,
676
+ task: descr,
677
+ classes: []
678
+ };
679
+ tasks.push(newTask);
680
+ }, "addTaskOrg");
681
+ var compileTasks = /* @__PURE__ */ __name(function() {
682
+ const compileTask = /* @__PURE__ */ __name(function(pos) {
683
+ return rawTasks[pos].processed;
684
+ }, "compileTask");
685
+ let allProcessed = true;
686
+ for (const [i, rawTask] of rawTasks.entries()) {
687
+ compileTask(i);
688
+ allProcessed = allProcessed && rawTask.processed;
689
+ }
690
+ return allProcessed;
691
+ }, "compileTasks");
692
+ var timelineDb_default = {
693
+ clear: clear2,
694
+ getCommonDb,
695
+ getDirection,
696
+ setDirection,
697
+ addSection,
698
+ getSections,
699
+ getTasks,
700
+ addTask,
701
+ addTaskOrg,
702
+ addEvent
703
+ };
704
+ var nodeCount = 0;
705
+ var drawRect = /* @__PURE__ */ __name(function(elem, rectData) {
706
+ const rectElem = elem.append("rect");
707
+ rectElem.attr("x", rectData.x);
708
+ rectElem.attr("y", rectData.y);
709
+ rectElem.attr("fill", rectData.fill);
710
+ rectElem.attr("stroke", rectData.stroke);
711
+ rectElem.attr("width", rectData.width);
712
+ rectElem.attr("height", rectData.height);
713
+ rectElem.attr("rx", rectData.rx);
714
+ rectElem.attr("ry", rectData.ry);
715
+ if (rectData.class !== undefined) {
716
+ rectElem.attr("class", rectData.class);
717
+ }
718
+ return rectElem;
719
+ }, "drawRect");
720
+ var drawFace = /* @__PURE__ */ __name(function(element, faceData) {
721
+ const radius = 15;
722
+ const circleElement = element.append("circle").attr("cx", faceData.cx).attr("cy", faceData.cy).attr("class", "face").attr("r", radius).attr("stroke-width", 2).attr("overflow", "visible");
723
+ const face = element.append("g");
724
+ face.append("circle").attr("cx", faceData.cx - radius / 3).attr("cy", faceData.cy - radius / 3).attr("r", 1.5).attr("stroke-width", 2).attr("fill", "#666").attr("stroke", "#666");
725
+ face.append("circle").attr("cx", faceData.cx + radius / 3).attr("cy", faceData.cy - radius / 3).attr("r", 1.5).attr("stroke-width", 2).attr("fill", "#666").attr("stroke", "#666");
726
+ function smile(face2) {
727
+ const arc = arc_default().startAngle(Math.PI / 2).endAngle(3 * (Math.PI / 2)).innerRadius(radius / 2).outerRadius(radius / 2.2);
728
+ face2.append("path").attr("class", "mouth").attr("d", arc).attr("transform", "translate(" + faceData.cx + "," + (faceData.cy + 2) + ")");
729
+ }
730
+ __name(smile, "smile");
731
+ function sad(face2) {
732
+ const arc = arc_default().startAngle(3 * Math.PI / 2).endAngle(5 * (Math.PI / 2)).innerRadius(radius / 2).outerRadius(radius / 2.2);
733
+ face2.append("path").attr("class", "mouth").attr("d", arc).attr("transform", "translate(" + faceData.cx + "," + (faceData.cy + 7) + ")");
734
+ }
735
+ __name(sad, "sad");
736
+ function ambivalent(face2) {
737
+ face2.append("line").attr("class", "mouth").attr("stroke", 2).attr("x1", faceData.cx - 5).attr("y1", faceData.cy + 7).attr("x2", faceData.cx + 5).attr("y2", faceData.cy + 7).attr("class", "mouth").attr("stroke-width", "1px").attr("stroke", "#666");
738
+ }
739
+ __name(ambivalent, "ambivalent");
740
+ if (faceData.score > 3) {
741
+ smile(face);
742
+ } else if (faceData.score < 3) {
743
+ sad(face);
744
+ } else {
745
+ ambivalent(face);
746
+ }
747
+ return circleElement;
748
+ }, "drawFace");
749
+ var drawCircle = /* @__PURE__ */ __name(function(element, circleData) {
750
+ const circleElement = element.append("circle");
751
+ circleElement.attr("cx", circleData.cx);
752
+ circleElement.attr("cy", circleData.cy);
753
+ circleElement.attr("class", "actor-" + circleData.pos);
754
+ circleElement.attr("fill", circleData.fill);
755
+ circleElement.attr("stroke", circleData.stroke);
756
+ circleElement.attr("r", circleData.r);
757
+ if (circleElement.class !== undefined) {
758
+ circleElement.attr("class", circleElement.class);
759
+ }
760
+ if (circleData.title !== undefined) {
761
+ circleElement.append("title").text(circleData.title);
762
+ }
763
+ return circleElement;
764
+ }, "drawCircle");
765
+ var drawText = /* @__PURE__ */ __name(function(elem, textData) {
766
+ const nText = textData.text.replace(/<br\s*\/?>/gi, " ");
767
+ const textElem = elem.append("text");
768
+ textElem.attr("x", textData.x);
769
+ textElem.attr("y", textData.y);
770
+ textElem.attr("class", "legend");
771
+ textElem.style("text-anchor", textData.anchor);
772
+ if (textData.class !== undefined) {
773
+ textElem.attr("class", textData.class);
774
+ }
775
+ const span = textElem.append("tspan");
776
+ span.attr("x", textData.x + textData.textMargin * 2);
777
+ span.text(nText);
778
+ return textElem;
779
+ }, "drawText");
780
+ var drawLabel = /* @__PURE__ */ __name(function(elem, txtObject) {
781
+ function genPoints(x, y, width, height, cut) {
782
+ return x + "," + y + " " + (x + width) + "," + y + " " + (x + width) + "," + (y + height - cut) + " " + (x + width - cut * 1.2) + "," + (y + height) + " " + x + "," + (y + height);
783
+ }
784
+ __name(genPoints, "genPoints");
785
+ const polygon = elem.append("polygon");
786
+ polygon.attr("points", genPoints(txtObject.x, txtObject.y, 50, 20, 7));
787
+ polygon.attr("class", "labelBox");
788
+ txtObject.y = txtObject.y + txtObject.labelMargin;
789
+ txtObject.x = txtObject.x + 0.5 * txtObject.labelMargin;
790
+ drawText(elem, txtObject);
791
+ }, "drawLabel");
792
+ var drawSection = /* @__PURE__ */ __name(function(elem, section, conf) {
793
+ const g = elem.append("g");
794
+ const rect = getNoteRect();
795
+ rect.x = section.x;
796
+ rect.y = section.y;
797
+ rect.fill = section.fill;
798
+ rect.width = conf.width;
799
+ rect.height = conf.height;
800
+ rect.class = "journey-section section-type-" + section.num;
801
+ rect.rx = 3;
802
+ rect.ry = 3;
803
+ drawRect(g, rect);
804
+ _drawTextCandidateFunc(conf)(section.text, g, rect.x, rect.y, rect.width, rect.height, { class: "journey-section section-type-" + section.num }, conf, section.colour);
805
+ }, "drawSection");
806
+ var taskCount = -1;
807
+ var drawTask = /* @__PURE__ */ __name(function(elem, task, conf, diagramId) {
808
+ const center = task.x + conf.width / 2;
809
+ const g = elem.append("g");
810
+ taskCount++;
811
+ const maxHeight = 300 + 5 * 30;
812
+ g.append("line").attr("id", diagramId + "-task" + taskCount).attr("x1", center).attr("y1", task.y).attr("x2", center).attr("y2", maxHeight).attr("class", "task-line").attr("stroke-width", "1px").attr("stroke-dasharray", "4 2").attr("stroke", "#666");
813
+ drawFace(g, {
814
+ cx: center,
815
+ cy: 300 + (5 - task.score) * 30,
816
+ score: task.score
817
+ });
818
+ const rect = getNoteRect();
819
+ rect.x = task.x;
820
+ rect.y = task.y;
821
+ rect.fill = task.fill;
822
+ rect.width = conf.width;
823
+ rect.height = conf.height;
824
+ rect.class = "task task-type-" + task.num;
825
+ rect.rx = 3;
826
+ rect.ry = 3;
827
+ drawRect(g, rect);
828
+ _drawTextCandidateFunc(conf)(task.task, g, rect.x, rect.y, rect.width, rect.height, { class: "task" }, conf, task.colour);
829
+ }, "drawTask");
830
+ var drawBackgroundRect = /* @__PURE__ */ __name(function(elem, bounds) {
831
+ const rectElem = drawRect(elem, {
832
+ x: bounds.startx,
833
+ y: bounds.starty,
834
+ width: bounds.stopx - bounds.startx,
835
+ height: bounds.stopy - bounds.starty,
836
+ fill: bounds.fill,
837
+ class: "rect"
838
+ });
839
+ rectElem.lower();
840
+ }, "drawBackgroundRect");
841
+ var getTextObj = /* @__PURE__ */ __name(function() {
842
+ return {
843
+ x: 0,
844
+ y: 0,
845
+ fill: undefined,
846
+ "text-anchor": "start",
847
+ width: 100,
848
+ height: 100,
849
+ textMargin: 0,
850
+ rx: 0,
851
+ ry: 0
852
+ };
853
+ }, "getTextObj");
854
+ var getNoteRect = /* @__PURE__ */ __name(function() {
855
+ return {
856
+ x: 0,
857
+ y: 0,
858
+ width: 100,
859
+ anchor: "start",
860
+ height: 100,
861
+ rx: 0,
862
+ ry: 0
863
+ };
864
+ }, "getNoteRect");
865
+ var _drawTextCandidateFunc = /* @__PURE__ */ function() {
866
+ function byText(content, g, x, y, width, height, textAttrs, colour) {
867
+ const text = g.append("text").attr("x", x + width / 2).attr("y", y + height / 2 + 5).style("font-color", colour).style("text-anchor", "middle").text(content);
868
+ _setTextAttrs(text, textAttrs);
869
+ }
870
+ __name(byText, "byText");
871
+ function byTspan(content, g, x, y, width, height, textAttrs, conf, colour) {
872
+ const { taskFontSize, taskFontFamily } = conf;
873
+ const lines = content.split(/<br\s*\/?>/gi);
874
+ for (let i = 0;i < lines.length; i++) {
875
+ const dy = i * taskFontSize - taskFontSize * (lines.length - 1) / 2;
876
+ const text = g.append("text").attr("x", x + width / 2).attr("y", y).attr("fill", colour).style("text-anchor", "middle").style("font-size", taskFontSize).style("font-family", taskFontFamily);
877
+ text.append("tspan").attr("x", x + width / 2).attr("dy", dy).text(lines[i]);
878
+ text.attr("y", y + height / 2).attr("dominant-baseline", "central").attr("alignment-baseline", "central");
879
+ _setTextAttrs(text, textAttrs);
880
+ }
881
+ }
882
+ __name(byTspan, "byTspan");
883
+ function byFo(content, g, x, y, width, height, textAttrs, conf) {
884
+ const body = g.append("switch");
885
+ const f = body.append("foreignObject").attr("x", x).attr("y", y).attr("width", width).attr("height", height).attr("position", "fixed");
886
+ const text = f.append("xhtml:div").style("display", "table").style("height", "100%").style("width", "100%");
887
+ text.append("div").attr("class", "label").style("display", "table-cell").style("text-align", "center").style("vertical-align", "middle").text(content);
888
+ byTspan(content, body, x, y, width, height, textAttrs, conf);
889
+ _setTextAttrs(text, textAttrs);
890
+ }
891
+ __name(byFo, "byFo");
892
+ function _setTextAttrs(toText, fromTextAttrsDict) {
893
+ for (const key in fromTextAttrsDict) {
894
+ if (key in fromTextAttrsDict) {
895
+ toText.attr(key, fromTextAttrsDict[key]);
896
+ }
897
+ }
898
+ }
899
+ __name(_setTextAttrs, "_setTextAttrs");
900
+ return function(conf) {
901
+ return conf.textPlacement === "fo" ? byFo : conf.textPlacement === "old" ? byText : byTspan;
902
+ };
903
+ }();
904
+ var initGraphics = /* @__PURE__ */ __name(function(graphics, id) {
905
+ nodeCount = 0;
906
+ taskCount = -1;
907
+ graphics.append("defs").append("marker").attr("id", id + "-arrowhead").attr("refX", 5).attr("refY", 2).attr("markerWidth", 6).attr("markerHeight", 4).attr("orient", "auto").append("path").attr("d", "M 0,0 V 4 L6,2 Z");
908
+ }, "initGraphics");
909
+ function wrap(text, width) {
910
+ text.each(function() {
911
+ var text2 = select_default(this), words = text2.text().split(/(\s+|<br>)/).reverse(), word, line = [], lineHeight = 1.1, y = text2.attr("y"), dy = parseFloat(text2.attr("dy")), tspan = text2.text(null).append("tspan").attr("x", 0).attr("y", y).attr("dy", dy + "em");
912
+ for (let j = 0;j < words.length; j++) {
913
+ word = words[words.length - 1 - j];
914
+ line.push(word);
915
+ tspan.text(line.join(" ").trim());
916
+ if (tspan.node().getComputedTextLength() > width || word === "<br>") {
917
+ line.pop();
918
+ tspan.text(line.join(" ").trim());
919
+ if (word === "<br>") {
920
+ line = [""];
921
+ } else {
922
+ line = [word];
923
+ }
924
+ tspan = text2.append("tspan").attr("x", 0).attr("y", y).attr("dy", lineHeight + "em").text(word);
925
+ }
926
+ }
927
+ });
928
+ }
929
+ __name(wrap, "wrap");
930
+ var drawNode = /* @__PURE__ */ __name(function(elem, node, fullSection, conf, diagramId, isEvent = false) {
931
+ const { theme, look } = conf;
932
+ const isReduxTheme = theme?.includes("redux");
933
+ const maxSections = conf?.themeVariables?.THEME_COLOR_LIMIT ?? 12;
934
+ const section = fullSection % maxSections - 1;
935
+ const nodeElem = elem.append("g");
936
+ node.section = section;
937
+ nodeElem.attr("class", (node.class ? node.class + " " : "") + "timeline-node " + ("section-" + section));
938
+ const bkgElem = nodeElem.append("g");
939
+ const textElem = nodeElem.append("g");
940
+ const txt = textElem.append("text").text(node.descr).attr("dy", "1em").attr("alignment-baseline", "middle").attr("dominant-baseline", "middle").attr("text-anchor", "middle").call(wrap, node.width);
941
+ const bbox = txt.node().getBBox();
942
+ const fontSize = conf.fontSize?.replace ? conf.fontSize.replace("px", "") : conf.fontSize;
943
+ node.height = bbox.height + fontSize * 1.1 * 0.5 + node.padding;
944
+ node.height = Math.max(node.height, node.maxHeight);
945
+ node.width = node.width + 2 * node.padding;
946
+ textElem.attr("transform", "translate(" + node.width / 2 + ", " + node.padding / 2 + ")");
947
+ if (isReduxTheme) {
948
+ textElem.attr("transform", `translate(${node.width / 2}, ${isEvent ? node.padding / 2 + 3 : node.padding})`);
949
+ }
950
+ defaultBkg(bkgElem, node, section, diagramId, conf);
951
+ if (look === "neo") {
952
+ nodeElem.attr("data-look", `neo`);
953
+ if (isReduxTheme) {
954
+ const isDark2 = theme.includes("dark");
955
+ const rootSvgNode = elem.node()?.ownerSVGElement ?? elem.node();
956
+ const rootSvg = select_default(rootSvgNode);
957
+ const svgId = rootSvg.attr("id") ?? "";
958
+ const dropShadowId = svgId ? `${svgId}-drop-shadow` : "drop-shadow";
959
+ if (rootSvg.select(`#${dropShadowId}`).empty()) {
960
+ const existingDefs = rootSvg.select("defs");
961
+ const defsEl = existingDefs.empty() ? rootSvg.append("defs") : existingDefs;
962
+ defsEl.append("filter").attr("id", dropShadowId).attr("height", "130%").attr("width", "130%").append("feDropShadow").attr("dx", "4").attr("dy", "4").attr("stdDeviation", 0).attr("flood-opacity", isDark2 ? "0.2" : "0.06").attr("flood-color", isDark2 ? "#FFFFFF" : "#000000");
963
+ }
964
+ }
965
+ }
966
+ return node;
967
+ }, "drawNode");
968
+ var getVirtualNodeHeight = /* @__PURE__ */ __name(function(elem, node, conf) {
969
+ const textElem = elem.append("g");
970
+ const txt = textElem.append("text").text(node.descr).attr("dy", "1em").attr("alignment-baseline", "middle").attr("dominant-baseline", "middle").attr("text-anchor", "middle").call(wrap, node.width);
971
+ const bbox = txt.node().getBBox();
972
+ const fontSize = conf.fontSize?.replace ? conf.fontSize.replace("px", "") : conf.fontSize;
973
+ textElem.remove();
974
+ return bbox.height + fontSize * 1.1 * 0.5 + node.padding;
975
+ }, "getVirtualNodeHeight");
976
+ var defaultBkg = /* @__PURE__ */ __name(function(elem, node, section, diagramId, config) {
977
+ const { theme } = config;
978
+ const r = theme?.includes("redux") ? 0 : 5;
979
+ const rd = 5;
980
+ const d = r > 0 ? `M0 ${node.height - rd} v${-node.height + 2 * rd} q0,-${r},${r},-${r} h${node.width - 2 * rd} q${r},0,${r},${r} v${node.height - rd} H0 Z` : `M0 ${node.height - rd} v${-(node.height - rd)} h${node.width} v${node.height} H0 Z`;
981
+ elem.append("path").attr("id", diagramId + "-node-" + nodeCount++).attr("class", "node-bkg node-" + node.type).attr("d", d);
982
+ if (!theme?.includes("redux")) {
983
+ elem.append("line").attr("class", "node-line-" + section).attr("x1", 0).attr("y1", node.height).attr("x2", node.width).attr("y2", node.height);
984
+ }
985
+ }, "defaultBkg");
986
+ var svgDraw_default = {
987
+ drawRect,
988
+ drawCircle,
989
+ drawSection,
990
+ drawText,
991
+ drawLabel,
992
+ drawTask,
993
+ drawBackgroundRect,
994
+ getTextObj,
995
+ getNoteRect,
996
+ initGraphics,
997
+ drawNode,
998
+ getVirtualNodeHeight
999
+ };
1000
+ var draw = /* @__PURE__ */ __name(function(text, id, version, diagObj) {
1001
+ const conf = getConfig2();
1002
+ const { look, theme, themeVariables } = conf;
1003
+ const { useGradient, gradientStart, gradientStop } = themeVariables;
1004
+ const LEFT_MARGIN = conf.timeline?.leftMargin ?? 50;
1005
+ log.debug("timeline", diagObj.db);
1006
+ const securityLevel = conf.securityLevel;
1007
+ let sandboxElement;
1008
+ if (securityLevel === "sandbox") {
1009
+ sandboxElement = select_default("#i" + id);
1010
+ }
1011
+ const root = securityLevel === "sandbox" ? select_default(sandboxElement.nodes()[0].contentDocument.body) : select_default("body");
1012
+ const svg = root.select("#" + id);
1013
+ svg.append("g");
1014
+ const tasks2 = diagObj.db.getTasks();
1015
+ const title = diagObj.db.getCommonDb().getDiagramTitle();
1016
+ log.debug("task", tasks2);
1017
+ svgDraw_default.initGraphics(svg, id);
1018
+ const sections2 = diagObj.db.getSections();
1019
+ log.debug("sections", sections2);
1020
+ let maxSectionHeight = 0;
1021
+ let maxTaskHeight = 0;
1022
+ let depthY = 0;
1023
+ let sectionBeginY = 0;
1024
+ let masterX = 50 + LEFT_MARGIN;
1025
+ let masterY = 50;
1026
+ sectionBeginY = 50;
1027
+ let sectionNumber = 0;
1028
+ let hasSections = true;
1029
+ sections2.forEach(function(section) {
1030
+ const sectionNode = {
1031
+ number: sectionNumber,
1032
+ descr: section,
1033
+ section: sectionNumber,
1034
+ width: 150,
1035
+ padding: 20,
1036
+ maxHeight: maxSectionHeight
1037
+ };
1038
+ const sectionHeight = svgDraw_default.getVirtualNodeHeight(svg, sectionNode, conf);
1039
+ log.debug("sectionHeight before draw", sectionHeight);
1040
+ maxSectionHeight = Math.max(maxSectionHeight, sectionHeight + 20);
1041
+ });
1042
+ let maxEventCount = 0;
1043
+ let maxEventLineLength = 0;
1044
+ log.debug("tasks.length", tasks2.length);
1045
+ for (const [i, task] of tasks2.entries()) {
1046
+ const taskNode = {
1047
+ number: i,
1048
+ descr: task,
1049
+ section: task.section,
1050
+ width: 150,
1051
+ padding: 20,
1052
+ maxHeight: maxTaskHeight
1053
+ };
1054
+ const taskHeight = svgDraw_default.getVirtualNodeHeight(svg, taskNode, conf);
1055
+ log.debug("taskHeight before draw", taskHeight);
1056
+ maxTaskHeight = Math.max(maxTaskHeight, taskHeight + 20);
1057
+ maxEventCount = Math.max(maxEventCount, task.events.length);
1058
+ let maxEventLineLengthTemp = 0;
1059
+ for (const event of task.events) {
1060
+ const eventNode = {
1061
+ descr: event,
1062
+ section: task.section,
1063
+ number: task.section,
1064
+ width: 150,
1065
+ padding: 20,
1066
+ maxHeight: 50
1067
+ };
1068
+ maxEventLineLengthTemp += svgDraw_default.getVirtualNodeHeight(svg, eventNode, conf);
1069
+ }
1070
+ if (task.events.length > 0) {
1071
+ maxEventLineLengthTemp += (task.events.length - 1) * 10;
1072
+ }
1073
+ maxEventLineLength = Math.max(maxEventLineLength, maxEventLineLengthTemp);
1074
+ }
1075
+ log.debug("maxSectionHeight before draw", maxSectionHeight);
1076
+ log.debug("maxTaskHeight before draw", maxTaskHeight);
1077
+ if (sections2 && sections2.length > 0) {
1078
+ sections2.forEach((section) => {
1079
+ const tasksForSection = tasks2.filter((task) => task.section === section);
1080
+ const sectionNode = {
1081
+ number: sectionNumber,
1082
+ descr: section,
1083
+ section: sectionNumber,
1084
+ width: 200 * Math.max(tasksForSection.length, 1) - 50,
1085
+ padding: 20,
1086
+ maxHeight: maxSectionHeight
1087
+ };
1088
+ log.debug("sectionNode", sectionNode);
1089
+ const sectionNodeWrapper = svg.append("g");
1090
+ const node = svgDraw_default.drawNode(sectionNodeWrapper, sectionNode, sectionNumber, conf, id);
1091
+ log.debug("sectionNode output", node);
1092
+ sectionNodeWrapper.attr("transform", `translate(${masterX}, ${sectionBeginY})`);
1093
+ masterY += maxSectionHeight + 50;
1094
+ if (tasksForSection.length > 0) {
1095
+ drawTasks(svg, tasksForSection, sectionNumber, masterX, masterY, maxTaskHeight, conf, maxEventCount, maxEventLineLength, maxSectionHeight, false, id);
1096
+ }
1097
+ masterX += 200 * Math.max(tasksForSection.length, 1);
1098
+ masterY = sectionBeginY;
1099
+ sectionNumber++;
1100
+ });
1101
+ } else {
1102
+ hasSections = false;
1103
+ drawTasks(svg, tasks2, sectionNumber, masterX, masterY, maxTaskHeight, conf, maxEventCount, maxEventLineLength, maxSectionHeight, true, id);
1104
+ }
1105
+ const box = svg.node().getBBox();
1106
+ log.debug("bounds", box);
1107
+ if (title) {
1108
+ svg.append("text").text(title).attr("x", look === "neo" ? box.x * 2 + LEFT_MARGIN : box.width / 2 - LEFT_MARGIN).attr("font-size", "4ex").attr("font-weight", "bold").attr("y", 20);
1109
+ }
1110
+ depthY = hasSections ? maxSectionHeight + maxTaskHeight + 150 : maxTaskHeight + 100;
1111
+ const lineWrapper = svg.append("g").attr("class", "lineWrapper");
1112
+ lineWrapper.append("line").attr("x1", LEFT_MARGIN).attr("y1", depthY).attr("x2", box.width + 3 * LEFT_MARGIN).attr("y2", depthY).attr("stroke-width", 4).attr("stroke", "black").attr("marker-end", `url(#${id}-arrowhead)`);
1113
+ if (look === "neo" && useGradient && theme !== "neutral") {
1114
+ const existingDefs = svg.select("defs");
1115
+ const defsEl = existingDefs.empty() ? svg.append("defs") : existingDefs;
1116
+ const gradient = defsEl.append("linearGradient").attr("id", svg.attr("id") + "-gradient").attr("gradientUnits", "objectBoundingBox").attr("x1", "0%").attr("y1", "0%").attr("x2", "100%").attr("y2", "0%");
1117
+ gradient.append("stop").attr("offset", "0%").attr("stop-color", gradientStart).attr("stop-opacity", 1);
1118
+ gradient.append("stop").attr("offset", "100%").attr("stop-color", gradientStop).attr("stop-opacity", 1);
1119
+ }
1120
+ setupGraphViewbox(undefined, svg, conf.timeline?.padding ?? 50, conf.timeline?.useMaxWidth ?? false);
1121
+ }, "draw");
1122
+ var drawTasks = /* @__PURE__ */ __name(function(diagram2, tasks2, sectionColor, masterX, masterY, maxTaskHeight, conf, maxEventCount, maxEventLineLength, maxSectionHeight, isWithoutSections, diagramId) {
1123
+ for (const task of tasks2) {
1124
+ const taskNode = {
1125
+ descr: task.task,
1126
+ section: sectionColor,
1127
+ number: sectionColor,
1128
+ width: 150,
1129
+ padding: 20,
1130
+ maxHeight: maxTaskHeight
1131
+ };
1132
+ log.debug("taskNode", taskNode);
1133
+ const taskWrapper = diagram2.append("g").attr("class", "taskWrapper");
1134
+ const node = svgDraw_default.drawNode(taskWrapper, taskNode, sectionColor, conf, diagramId);
1135
+ const taskHeight = node.height;
1136
+ log.debug("taskHeight after draw", taskHeight);
1137
+ taskWrapper.attr("transform", `translate(${masterX}, ${masterY})`);
1138
+ maxTaskHeight = Math.max(maxTaskHeight, taskHeight);
1139
+ if (task.events) {
1140
+ const lineWrapper = diagram2.append("g").attr("class", "lineWrapper");
1141
+ let lineLength = maxTaskHeight;
1142
+ masterY += 100;
1143
+ lineLength = lineLength + drawEvents(diagram2, task.events, sectionColor, masterX, masterY, conf, diagramId);
1144
+ masterY -= 100;
1145
+ lineWrapper.append("line").attr("x1", masterX + 190 / 2).attr("y1", masterY + maxTaskHeight).attr("x2", masterX + 190 / 2).attr("y2", masterY + maxTaskHeight + 100 + maxEventLineLength + 100).attr("stroke-width", 2).attr("stroke", "black").attr("marker-end", `url(#${diagramId}-arrowhead)`).attr("stroke-dasharray", "5,5");
1146
+ }
1147
+ masterX = masterX + 200;
1148
+ if (isWithoutSections && !conf.timeline?.disableMulticolor) {
1149
+ sectionColor++;
1150
+ }
1151
+ }
1152
+ masterY = masterY - 10;
1153
+ }, "drawTasks");
1154
+ var drawEvents = /* @__PURE__ */ __name(function(diagram2, events, sectionColor, masterX, masterY, conf, diagramId) {
1155
+ let maxEventHeight = 0;
1156
+ const eventBeginY = masterY;
1157
+ masterY = masterY + 100;
1158
+ for (const event of events) {
1159
+ const eventNode = {
1160
+ descr: event,
1161
+ section: sectionColor,
1162
+ number: sectionColor,
1163
+ width: 150,
1164
+ padding: 20,
1165
+ maxHeight: 50
1166
+ };
1167
+ log.debug("eventNode", eventNode);
1168
+ const eventWrapper = diagram2.append("g").attr("class", "eventWrapper");
1169
+ const node = svgDraw_default.drawNode(eventWrapper, eventNode, sectionColor, conf, diagramId, true);
1170
+ const eventHeight = node.height;
1171
+ maxEventHeight = maxEventHeight + eventHeight;
1172
+ eventWrapper.attr("transform", `translate(${masterX}, ${masterY})`);
1173
+ masterY = masterY + 10 + eventHeight;
1174
+ }
1175
+ masterY = eventBeginY;
1176
+ return maxEventHeight;
1177
+ }, "drawEvents");
1178
+ var timelineRenderer_default = {
1179
+ setConf: /* @__PURE__ */ __name(() => {}, "setConf"),
1180
+ draw
1181
+ };
1182
+ var NODE_WIDTH = 200;
1183
+ var NODE_PADDING = 5;
1184
+ var NODE_TOTAL_WIDTH = NODE_WIDTH + NODE_PADDING * 2;
1185
+ var EVENT_WIDTH = NODE_WIDTH + 100;
1186
+ var EVENT_TOTAL_WIDTH = EVENT_WIDTH + NODE_PADDING * 2;
1187
+ var EVENT_SPACING = 10;
1188
+ var EVENT_VERTICAL_GAP = 0;
1189
+ var SECTION_TASK_GAP = 20;
1190
+ var TASK_AXIS_GAP = 20;
1191
+ var TASK_VERTICAL_GAP = 30;
1192
+ var EVENT_AXIS_GAP = 50;
1193
+ var draw2 = /* @__PURE__ */ __name(function(text, id, version, diagObj) {
1194
+ const conf = getConfig2();
1195
+ const LEFT_MARGIN = conf.timeline?.leftMargin ?? 50;
1196
+ log.debug("timeline", diagObj.db);
1197
+ const svg = selectSvgElement(id);
1198
+ svg.append("g");
1199
+ const tasks2 = diagObj.db.getTasks();
1200
+ const title = diagObj.db.getCommonDb().getDiagramTitle();
1201
+ log.debug("task", tasks2);
1202
+ svgDraw_default.initGraphics(svg);
1203
+ const sections2 = diagObj.db.getSections();
1204
+ log.debug("sections", sections2);
1205
+ let maxSectionHeight = 0;
1206
+ let maxTaskHeight = 0;
1207
+ const masterX = 50 + LEFT_MARGIN;
1208
+ let masterY = 50;
1209
+ const contentTopY = masterY;
1210
+ const sectionBeginX = masterX;
1211
+ const leftWidth = NODE_TOTAL_WIDTH + TASK_AXIS_GAP;
1212
+ const rightWidth = EVENT_TOTAL_WIDTH + EVENT_AXIS_GAP;
1213
+ const axisX = sectionBeginX + leftWidth;
1214
+ let sectionNumber = 0;
1215
+ const hasSections = sections2 && sections2.length > 0;
1216
+ const timelineX = hasSections ? axisX : masterX + leftWidth;
1217
+ const sectionWidth = Math.max(50, leftWidth + rightWidth - NODE_PADDING * 2);
1218
+ sections2.forEach(function(section) {
1219
+ const sectionNode = {
1220
+ number: sectionNumber,
1221
+ descr: section,
1222
+ section: sectionNumber,
1223
+ width: sectionWidth,
1224
+ padding: NODE_PADDING,
1225
+ maxHeight: maxSectionHeight
1226
+ };
1227
+ const sectionHeight = svgDraw_default.getVirtualNodeHeight(svg, sectionNode, conf);
1228
+ log.debug("sectionHeight before draw", sectionHeight);
1229
+ maxSectionHeight = Math.max(maxSectionHeight, sectionHeight);
1230
+ });
1231
+ let maxEventStackHeight = 0;
1232
+ log.debug("tasks.length", tasks2.length);
1233
+ for (const [i, task] of tasks2.entries()) {
1234
+ const taskNode = {
1235
+ number: i,
1236
+ descr: task,
1237
+ section: task.section,
1238
+ width: NODE_WIDTH,
1239
+ padding: NODE_PADDING,
1240
+ maxHeight: maxTaskHeight
1241
+ };
1242
+ const taskHeight = svgDraw_default.getVirtualNodeHeight(svg, taskNode, conf);
1243
+ log.debug("taskHeight before draw", taskHeight);
1244
+ maxTaskHeight = Math.max(maxTaskHeight, taskHeight);
1245
+ let maxEventStackHeightTemp = 0;
1246
+ for (const event of task.events) {
1247
+ const eventNode = {
1248
+ descr: event,
1249
+ section: task.section,
1250
+ number: task.section,
1251
+ width: EVENT_WIDTH,
1252
+ padding: NODE_PADDING,
1253
+ maxHeight: 50
1254
+ };
1255
+ maxEventStackHeightTemp += svgDraw_default.getVirtualNodeHeight(svg, eventNode, conf);
1256
+ }
1257
+ if (task.events.length > 0) {
1258
+ maxEventStackHeightTemp += (task.events.length - 1) * EVENT_SPACING;
1259
+ }
1260
+ maxEventStackHeight = Math.max(maxEventStackHeight, maxEventStackHeightTemp) + EVENT_VERTICAL_GAP;
1261
+ }
1262
+ log.debug("maxSectionHeight before draw", maxSectionHeight);
1263
+ log.debug("maxTaskHeight before draw", maxTaskHeight);
1264
+ const taskBlockHeight = Math.max(maxTaskHeight, maxEventStackHeight);
1265
+ const taskSpacing = taskBlockHeight + TASK_VERTICAL_GAP;
1266
+ if (hasSections) {
1267
+ sections2.forEach((section) => {
1268
+ const tasksForSection = tasks2.filter((task) => task.section === section);
1269
+ const sectionNode = {
1270
+ number: sectionNumber,
1271
+ descr: section,
1272
+ section: sectionNumber,
1273
+ width: sectionWidth,
1274
+ padding: NODE_PADDING,
1275
+ maxHeight: maxSectionHeight
1276
+ };
1277
+ log.debug("sectionNode", sectionNode);
1278
+ const sectionNodeWrapper = svg.append("g");
1279
+ const node = svgDraw_default.drawNode(sectionNodeWrapper, sectionNode, sectionNumber, conf);
1280
+ log.debug("sectionNode output", node);
1281
+ const sectionX = timelineX - leftWidth;
1282
+ sectionNodeWrapper.attr("transform", `translate(${sectionX}, ${masterY})`);
1283
+ const taskStartY = masterY + node.height + SECTION_TASK_GAP;
1284
+ if (tasksForSection.length > 0) {
1285
+ drawTasks2(svg, tasksForSection, sectionNumber, timelineX, taskStartY, maxTaskHeight, conf, taskSpacing, false);
1286
+ }
1287
+ const taskCount2 = tasksForSection.length;
1288
+ const sectionHeight = node.height + SECTION_TASK_GAP + taskSpacing * Math.max(taskCount2, 1) - (taskCount2 > 0 ? TASK_VERTICAL_GAP * 2 : 0);
1289
+ masterY += sectionHeight;
1290
+ sectionNumber++;
1291
+ });
1292
+ } else {
1293
+ drawTasks2(svg, tasks2, sectionNumber, timelineX, masterY, maxTaskHeight, conf, taskSpacing, true);
1294
+ }
1295
+ let box = svg.node()?.getBBox();
1296
+ if (!box) {
1297
+ throw new Error("bbox not found");
1298
+ }
1299
+ log.debug("bounds", box);
1300
+ if (title) {
1301
+ svg.append("text").text(title).attr("x", box.width / 2 - LEFT_MARGIN).attr("font-size", "4ex").attr("font-weight", "bold").attr("y", 20);
1302
+ box = svg.node()?.getBBox();
1303
+ if (!box) {
1304
+ throw new Error("bbox not found");
1305
+ }
1306
+ log.debug("bounds after title", box);
1307
+ }
1308
+ const [fontSize] = parseFontSize(conf.fontSize);
1309
+ const arrowTopOffset = (fontSize ?? 16) * 2;
1310
+ const arrowBottomPadding = (fontSize ?? 16) * 0.5 + 20;
1311
+ const lineWrapper = svg.append("g").attr("class", "lineWrapper");
1312
+ lineWrapper.append("line").attr("x1", timelineX).attr("y1", contentTopY - arrowTopOffset).attr("x2", timelineX).attr("y2", box.y + box.height + arrowBottomPadding).attr("stroke-width", 4).attr("stroke", "black").attr("marker-end", "url(#arrowhead)");
1313
+ lineWrapper.lower();
1314
+ setupGraphViewbox(undefined, svg, conf.timeline?.padding ?? 50, conf.timeline?.useMaxWidth ?? false);
1315
+ }, "draw");
1316
+ var drawTasks2 = /* @__PURE__ */ __name(function(diagram2, tasks2, sectionColor, timelineX, masterY, maxTaskHeight, conf, taskSpacing, isWithoutSections) {
1317
+ for (const task of tasks2) {
1318
+ const taskNode = {
1319
+ descr: task.task,
1320
+ section: sectionColor,
1321
+ number: sectionColor,
1322
+ width: NODE_WIDTH,
1323
+ padding: NODE_PADDING,
1324
+ maxHeight: maxTaskHeight
1325
+ };
1326
+ log.debug("taskNode", taskNode);
1327
+ const taskWrapper = diagram2.append("g").attr("class", "taskWrapper");
1328
+ const node = svgDraw_default.drawNode(taskWrapper, taskNode, sectionColor, conf);
1329
+ const taskHeight = node.height;
1330
+ log.debug("taskHeight after draw", taskHeight);
1331
+ const taskX = timelineX - TASK_AXIS_GAP - node.width;
1332
+ taskWrapper.attr("transform", `translate(${taskX}, ${masterY})`);
1333
+ maxTaskHeight = Math.max(maxTaskHeight, taskHeight);
1334
+ if (task.events && task.events.length > 0) {
1335
+ const eventsStartY = masterY;
1336
+ const eventsX = timelineX + EVENT_AXIS_GAP;
1337
+ drawEvents2(diagram2, task.events, sectionColor, timelineX, eventsX, eventsStartY, conf);
1338
+ }
1339
+ masterY = masterY + taskSpacing;
1340
+ if (isWithoutSections && !conf.timeline?.disableMulticolor) {
1341
+ sectionColor++;
1342
+ }
1343
+ }
1344
+ }, "drawTasks");
1345
+ var drawEvents2 = /* @__PURE__ */ __name(function(diagram2, events, sectionColor, axisX, eventsX, startY, conf) {
1346
+ let currentY = startY;
1347
+ for (const event of events) {
1348
+ const eventNode = {
1349
+ descr: event,
1350
+ section: sectionColor,
1351
+ number: sectionColor,
1352
+ width: EVENT_WIDTH,
1353
+ padding: NODE_PADDING,
1354
+ maxHeight: 0
1355
+ };
1356
+ log.debug("eventNode", eventNode);
1357
+ const eventWrapper = diagram2.append("g").attr("class", "eventWrapper");
1358
+ const node = svgDraw_default.drawNode(eventWrapper, eventNode, sectionColor, conf);
1359
+ const eventHeight = node.height;
1360
+ eventWrapper.attr("transform", `translate(${eventsX}, ${currentY})`);
1361
+ const lineWrapper = diagram2.append("g").attr("class", "lineWrapper");
1362
+ const lineY = currentY + eventHeight / 2;
1363
+ lineWrapper.append("line").attr("x1", axisX).attr("y1", lineY).attr("x2", eventsX).attr("y2", lineY).attr("stroke-width", 2).attr("stroke", "black").attr("marker-end", "url(#arrowhead)").attr("stroke-dasharray", "5,5");
1364
+ currentY = currentY + eventHeight + EVENT_SPACING;
1365
+ }
1366
+ return currentY - startY;
1367
+ }, "drawEvents");
1368
+ var timelineRendererVertical_default = {
1369
+ setConf: /* @__PURE__ */ __name(() => {}, "setConf"),
1370
+ draw: draw2
1371
+ };
1372
+ var genReduxSections = /* @__PURE__ */ __name((options) => {
1373
+ const { theme } = getConfig();
1374
+ const isDarkTheme = theme?.includes("dark");
1375
+ const isColorTheme = theme?.includes("color");
1376
+ const rawSvgId = options.svgId?.replace(/^#/, "") ?? "";
1377
+ const scopedDropShadow = rawSvgId ? `url(#${rawSvgId}-drop-shadow)` : options.dropShadow ?? "none";
1378
+ let sections2 = "";
1379
+ for (let i = 0;i < options.THEME_COLOR_LIMIT; i++) {
1380
+ const sw = `${17 - 3 * i}`;
1381
+ const color = isColorTheme ? options.borderColorArray[i] : options.mainBkg;
1382
+ const stroke = isColorTheme ? options.borderColorArray[i] : options.nodeBorder;
1383
+ sections2 += `
1384
+ .section-${i - 1} rect,
1385
+ .section-${i - 1} path,
1386
+ .section-${i - 1} circle {
1387
+ fill: ${isDarkTheme && isColorTheme ? options.mainBkg : color};
1388
+ stroke: ${stroke};
1389
+ stroke-width: ${options.strokeWidth};
1390
+ filter: ${scopedDropShadow};
1391
+ }
1392
+
1393
+ .section-${i - 1} text {
1394
+ fill: ${options.nodeBorder};
1395
+ font-weight: ${options.fontWeight}
1396
+ }
1397
+
1398
+ .node-icon-${i - 1} {
1399
+ font-size: 40px;
1400
+ color: ${options["cScaleLabel" + i]};
1401
+ }
1402
+
1403
+ .section-edge-${i - 1} {
1404
+ stroke: ${options["cScale" + i]};
1405
+ }
1406
+
1407
+ .edge-depth-${i - 1} {
1408
+ stroke-width: ${sw};
1409
+ }
1410
+
1411
+ .section-${i - 1} line {
1412
+ stroke: ${options["cScaleInv" + i]};
1413
+ stroke-width: 3;
1414
+ }
1415
+
1416
+ .lineWrapper line {
1417
+ stroke: ${options.nodeBorder};
1418
+ stroke-width:${options.strokeWidth}
1419
+ }
1420
+
1421
+ .disabled,
1422
+ .disabled circle,
1423
+ .disabled text {
1424
+ fill: ${options.tertiaryColor ?? "lightgray"};
1425
+ }
1426
+
1427
+ .disabled text {
1428
+ fill: ${options.clusterBorder ?? "#efefef"};
1429
+ }
1430
+ `;
1431
+ }
1432
+ return sections2;
1433
+ }, "genReduxSections");
1434
+ var genSections = /* @__PURE__ */ __name((options) => {
1435
+ let sections2 = "";
1436
+ for (let i = 0;i < options.THEME_COLOR_LIMIT; i++) {
1437
+ options["lineColor" + i] = options["lineColor" + i] || options["cScaleInv" + i];
1438
+ if (is_dark_default(options["lineColor" + i])) {
1439
+ options["lineColor" + i] = lighten_default(options["lineColor" + i], 20);
1440
+ } else {
1441
+ options["lineColor" + i] = darken_default(options["lineColor" + i], 20);
1442
+ }
1443
+ }
1444
+ for (let i = 0;i < options.THEME_COLOR_LIMIT; i++) {
1445
+ const sw = "" + (17 - 3 * i);
1446
+ sections2 += `
1447
+ .section-${i - 1} rect, .section-${i - 1} path, .section-${i - 1} circle, .section-${i - 1} path {
1448
+ fill: ${options["cScale" + i]};
1449
+ }
1450
+ .section-${i - 1} text {
1451
+ fill: ${options["cScaleLabel" + i]};
1452
+ }
1453
+ .node-icon-${i - 1} {
1454
+ font-size: 40px;
1455
+ color: ${options["cScaleLabel" + i]};
1456
+ }
1457
+ .section-edge-${i - 1}{
1458
+ stroke: ${options["cScale" + i]};
1459
+ }
1460
+ .edge-depth-${i - 1}{
1461
+ stroke-width: ${sw};
1462
+ }
1463
+ .section-${i - 1} line {
1464
+ stroke: ${options["cScaleInv" + i]} ;
1465
+ stroke-width: 3;
1466
+ }
1467
+
1468
+ .lineWrapper line{
1469
+ stroke: ${options["cScaleLabel" + i]} ;
1470
+ }
1471
+
1472
+ .disabled, .disabled circle, .disabled text {
1473
+ fill: ${options.tertiaryColor ?? "lightgray"};
1474
+ }
1475
+ .disabled text {
1476
+ fill: ${options.clusterBorder ?? "#efefef"};
1477
+ }
1478
+ `;
1479
+ }
1480
+ return sections2;
1481
+ }, "genSections");
1482
+ var getStyles = /* @__PURE__ */ __name((options) => {
1483
+ const { theme } = getConfig();
1484
+ const isReduxTheme = theme?.includes("redux");
1485
+ const isNeutralTheme = theme === "neutral";
1486
+ const rawSvgId = options.svgId?.replace(/^#/, "") ?? "";
1487
+ let gradientSections = "";
1488
+ if (options.useGradient && rawSvgId && options.THEME_COLOR_LIMIT && !isNeutralTheme) {
1489
+ for (let i = 0;i < options.THEME_COLOR_LIMIT; i++) {
1490
+ gradientSections += `
1491
+ .section-${i - 1}[data-look="neo"] rect,
1492
+ .section-${i - 1}[data-look="neo"] path,
1493
+ .section-${i - 1}[data-look="neo"] circle {
1494
+ fill: ${options.mainBkg};
1495
+ stroke: url(#${rawSvgId}-gradient);
1496
+ stroke-width: 2;
1497
+ }
1498
+ .section-${i - 1}[data-look="neo"] line {
1499
+ stroke: url(#${rawSvgId}-gradient);
1500
+ stroke-width: 2;
1501
+ }`;
1502
+ }
1503
+ }
1504
+ return `
1505
+ .edge {
1506
+ stroke-width: 3;
1507
+ }
1508
+ ${isReduxTheme ? genReduxSections(options) : genSections(options)}
1509
+ ${gradientSections}
1510
+ .section-root rect, .section-root path, .section-root circle {
1511
+ fill: ${options.git0};
1512
+ }
1513
+ .section-root text {
1514
+ fill: ${options.gitBranchLabel0};
1515
+ }
1516
+ .icon-container {
1517
+ height:100%;
1518
+ display: flex;
1519
+ justify-content: center;
1520
+ align-items: center;
1521
+ }
1522
+ .edge {
1523
+ fill: none;
1524
+ }
1525
+ .eventWrapper {
1526
+ filter: brightness(120%);
1527
+ }
1528
+ `;
1529
+ }, "getStyles");
1530
+ var styles_default = getStyles;
1531
+ var rendererSelector = {
1532
+ setConf: /* @__PURE__ */ __name(() => {}, "setConf"),
1533
+ draw: /* @__PURE__ */ __name((text, id, version, diagObj) => {
1534
+ const direction2 = diagObj?.db?.getDirection?.() ?? "LR";
1535
+ if (direction2 === "TD") {
1536
+ return timelineRendererVertical_default.draw(text, id, version, diagObj);
1537
+ }
1538
+ return timelineRenderer_default.draw(text, id, version, diagObj);
1539
+ }, "draw")
1540
+ };
1541
+ var diagram = {
1542
+ db: timelineDb_exports,
1543
+ renderer: rendererSelector,
1544
+ parser: timeline_default,
1545
+ styles: styles_default
1546
+ };
1547
+ export {
1548
+ diagram
1549
+ };