@weavecode/weave 0.1.7 → 0.1.9

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 (431) hide show
  1. package/node_modules/@modelcontextprotocol/sdk/node_modules/@hono/node-server/dist/index.cjs +31 -6
  2. package/node_modules/@modelcontextprotocol/sdk/node_modules/@hono/node-server/dist/index.mjs +31 -6
  3. package/node_modules/@modelcontextprotocol/sdk/node_modules/@hono/node-server/package.json +1 -1
  4. package/node_modules/@modelcontextprotocol/sdk/node_modules/express-rate-limit/dist/index.cjs +1 -1
  5. package/node_modules/@modelcontextprotocol/sdk/node_modules/express-rate-limit/dist/index.mjs +1 -1
  6. package/node_modules/@modelcontextprotocol/sdk/node_modules/express-rate-limit/node_modules/ip-address/README.md +39 -39
  7. package/node_modules/@modelcontextprotocol/sdk/node_modules/express-rate-limit/node_modules/ip-address/dist/ipv6.js +1 -1
  8. package/node_modules/@modelcontextprotocol/sdk/node_modules/express-rate-limit/node_modules/ip-address/package.json +1 -1
  9. package/node_modules/@modelcontextprotocol/sdk/node_modules/express-rate-limit/package.json +1 -1
  10. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/cjs/adapter/bun/serve-static.js +1 -1
  11. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/cjs/adapter/bun/websocket.js +1 -1
  12. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/cjs/context.js +1 -1
  13. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/cjs/helper/css/common.js +3 -5
  14. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/cjs/hono-base.js +4 -10
  15. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/cjs/hono.js +0 -1
  16. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/cjs/middleware/basic-auth/index.js +1 -1
  17. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/cjs/middleware/bearer-auth/index.js +1 -1
  18. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/cjs/middleware/csrf/index.js +2 -2
  19. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/cjs/middleware/jwk/jwk.js +2 -2
  20. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/cjs/middleware/jwt/jwt.js +2 -2
  21. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/cjs/middleware/mount/index.js +4 -4
  22. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/cjs/router/reg-exp-router/node.js +13 -11
  23. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/cjs/router/reg-exp-router/prepared-router.js +4 -4
  24. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/cjs/router/reg-exp-router/router.js +39 -51
  25. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/cjs/router/reg-exp-router/trie.js +15 -5
  26. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/cjs/utils/jwt/jwt.js +2 -1
  27. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/cjs/utils/mount.js +35 -0
  28. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/cjs/utils/url.js +10 -0
  29. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/cjs/validator/validator.js +1 -1
  30. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/context.js +1 -1
  31. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/helper/css/common.js +3 -5
  32. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/hono-base.js +4 -10
  33. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/hono.js +0 -1
  34. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/middleware/basic-auth/index.js +1 -1
  35. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/middleware/bearer-auth/index.js +1 -1
  36. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/middleware/csrf/index.js +2 -2
  37. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/middleware/jwk/jwk.js +2 -2
  38. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/middleware/jwt/jwt.js +2 -2
  39. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/middleware/language/language.js +1 -1
  40. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/middleware/mount/index.js +4 -4
  41. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/router/reg-exp-router/node.js +13 -11
  42. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/router/reg-exp-router/prepared-router.js +5 -5
  43. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/router/reg-exp-router/router.js +40 -52
  44. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/router/reg-exp-router/trie.js +15 -5
  45. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/types/middleware/mount/index.d.ts +1 -0
  46. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/types/router/reg-exp-router/node.d.ts +3 -3
  47. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/types/router/reg-exp-router/trie.d.ts +1 -1
  48. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/types/utils/mount.d.ts +4 -0
  49. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/types/utils/url.d.ts +1 -0
  50. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/utils/jwt/jwt.js +2 -1
  51. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/utils/mount.js +34 -0
  52. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/utils/url.js +10 -1
  53. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/validator/validator.js +1 -1
  54. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/package.json +1 -1
  55. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jwks/remote.js +3 -1
  56. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/deflate.js +2 -1
  57. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/jwt_claims_set.js +2 -1
  58. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/package.json +1 -1
  59. package/node_modules/@weavecode/cli/dist/cli.js +4 -4
  60. package/node_modules/@weavecode/cli/dist/commands/chpass.js +1 -1
  61. package/node_modules/@weavecode/cli/dist/commands/daemon-auth.js +1 -1
  62. package/node_modules/@weavecode/cli/dist/commands/daemon.js +2 -2
  63. package/node_modules/@weavecode/cli/dist/commands/dashboard.js +2 -2
  64. package/node_modules/@weavecode/cli/dist/commands/doctor.js +1 -1
  65. package/node_modules/@weavecode/cli/dist/commands/init.js +1 -1
  66. package/node_modules/@weavecode/cli/dist/commands/scan.js +1 -1
  67. package/node_modules/@weavecode/cli/dist/commands/status.js +2 -2
  68. package/node_modules/@weavecode/cli/dist/commands/uninstall.js +1 -1
  69. package/node_modules/@weavecode/cli/dist/i18n/dict/en.js +3 -3
  70. package/node_modules/@weavecode/cli/dist/i18n/dict/zh.d.ts +7 -0
  71. package/node_modules/@weavecode/cli/dist/i18n/dict/zh.js +3 -3
  72. package/node_modules/@weavecode/cli/dist/i18n/index.js +1 -1
  73. package/node_modules/@weavecode/cli/dist/i18n/t.js +1 -1
  74. package/node_modules/@weavecode/cli/dist/init/claudemd-gen.js +5 -5
  75. package/node_modules/@weavecode/cli/dist/init/executor.js +3 -3
  76. package/node_modules/@weavecode/cli/dist/init/git-commit.js +2 -2
  77. package/node_modules/@weavecode/cli/dist/init/git-exclude.d.ts +20 -0
  78. package/node_modules/@weavecode/cli/dist/init/git-exclude.js +7 -0
  79. package/node_modules/@weavecode/cli/dist/init/harnesses/claude.js +7 -7
  80. package/node_modules/@weavecode/cli/dist/init/harnesses/codex.js +1 -1
  81. package/node_modules/@weavecode/cli/dist/init/instruction-files.d.ts +14 -0
  82. package/node_modules/@weavecode/cli/dist/init/instruction-files.js +1 -0
  83. package/node_modules/@weavecode/cli/dist/init/instruction-link.js +1 -1
  84. package/node_modules/@weavecode/cli/dist/init/plugin-templates.js +1 -1
  85. package/node_modules/@weavecode/cli/dist/init/prompt.js +4 -4
  86. package/node_modules/@weavecode/cli/dist/init/provision.js +1 -1
  87. package/node_modules/@weavecode/cli/dist/init/uninstall.js +6 -6
  88. package/node_modules/@weavecode/cli/dist/init/wiring.js +1 -1
  89. package/node_modules/@weavecode/cli/dist/parser.js +1 -1
  90. package/node_modules/@weavecode/cli/dist/statusline/ansi.js +1 -1
  91. package/node_modules/@weavecode/cli/package.json +5 -5
  92. package/node_modules/@weavecode/core/dist/harness-checks.js +1 -1
  93. package/node_modules/@weavecode/core/dist/harness.d.ts +115 -0
  94. package/node_modules/@weavecode/core/dist/harness.js +1 -1
  95. package/node_modules/@weavecode/core/dist/index.d.ts +1 -1
  96. package/node_modules/@weavecode/core/dist/index.js +1 -1
  97. package/node_modules/@weavecode/core/dist/platform.js +1 -1
  98. package/node_modules/@weavecode/core/dist/types.d.ts +4 -4
  99. package/node_modules/@weavecode/core/dist/types.js +1 -1
  100. package/node_modules/@weavecode/core/dist/utils/fs.js +1 -1
  101. package/node_modules/@weavecode/core/package.json +1 -1
  102. package/node_modules/@weavecode/harness/dist/claude/assets.js +3 -3
  103. package/node_modules/@weavecode/harness/dist/claude/capture.js +9 -9
  104. package/node_modules/@weavecode/harness/dist/claude/commands.d.ts +2 -0
  105. package/node_modules/@weavecode/harness/dist/claude/commands.js +3 -2
  106. package/node_modules/@weavecode/harness/dist/claude/config.js +2 -2
  107. package/node_modules/@weavecode/harness/dist/claude/detect.js +1 -1
  108. package/node_modules/@weavecode/harness/dist/claude/edits.js +1 -1
  109. package/node_modules/@weavecode/harness/dist/claude/event-source.js +1 -1
  110. package/node_modules/@weavecode/harness/dist/claude/images.js +2 -2
  111. package/node_modules/@weavecode/harness/dist/claude/index.js +1 -1
  112. package/node_modules/@weavecode/harness/dist/claude/liveness.js +1 -1
  113. package/node_modules/@weavecode/harness/dist/claude/mcp-gen.js +1 -1
  114. package/node_modules/@weavecode/harness/dist/claude/messaging.js +2 -2
  115. package/node_modules/@weavecode/harness/dist/claude/model-aliases.js +1 -1
  116. package/node_modules/@weavecode/harness/dist/claude/narration.js +1 -1
  117. package/node_modules/@weavecode/harness/dist/claude/peers.js +1 -1
  118. package/node_modules/@weavecode/harness/dist/claude/plan.js +1 -1
  119. package/node_modules/@weavecode/harness/dist/claude/plugins.js +4 -4
  120. package/node_modules/@weavecode/harness/dist/claude/prompt-inbox.js +1 -1
  121. package/node_modules/@weavecode/harness/dist/claude/prompt.js +3 -3
  122. package/node_modules/@weavecode/harness/dist/claude/questions.js +2 -2
  123. package/node_modules/@weavecode/harness/dist/claude/resume.js +1 -1
  124. package/node_modules/@weavecode/harness/dist/claude/rewind.js +1 -1
  125. package/node_modules/@weavecode/harness/dist/claude/settings-gen.js +1 -1
  126. package/node_modules/@weavecode/harness/dist/claude/side-question.js +2 -2
  127. package/node_modules/@weavecode/harness/dist/claude/statusline/generator.d.ts +6 -0
  128. package/node_modules/@weavecode/harness/dist/claude/statusline/generator.js +21 -14
  129. package/node_modules/@weavecode/harness/dist/claude/statusline/git-cache.js +1 -1
  130. package/node_modules/@weavecode/harness/dist/claude/statusline/surface.js +2 -2
  131. package/node_modules/@weavecode/harness/dist/claude/transcript-cursor.js +2 -2
  132. package/node_modules/@weavecode/harness/dist/claude/transcript.js +7 -7
  133. package/node_modules/@weavecode/harness/dist/codex/assets.js +1 -1
  134. package/node_modules/@weavecode/harness/dist/codex/capture.js +2 -2
  135. package/node_modules/@weavecode/harness/dist/codex/commands.js +4 -4
  136. package/node_modules/@weavecode/harness/dist/codex/config.js +2 -2
  137. package/node_modules/@weavecode/harness/dist/codex/detect.js +1 -1
  138. package/node_modules/@weavecode/harness/dist/codex/event-source.js +2 -2
  139. package/node_modules/@weavecode/harness/dist/codex/images.js +1 -1
  140. package/node_modules/@weavecode/harness/dist/codex/index.js +1 -1
  141. package/node_modules/@weavecode/harness/dist/codex/liveness.js +1 -1
  142. package/node_modules/@weavecode/harness/dist/codex/mcp.js +1 -1
  143. package/node_modules/@weavecode/harness/dist/codex/messaging.js +2 -2
  144. package/node_modules/@weavecode/harness/dist/codex/narration.js +1 -1
  145. package/node_modules/@weavecode/harness/dist/codex/plugin-state.js +1 -1
  146. package/node_modules/@weavecode/harness/dist/codex/plugins.js +3 -3
  147. package/node_modules/@weavecode/harness/dist/codex/provision.js +1 -1
  148. package/node_modules/@weavecode/harness/dist/codex/questions.js +2 -2
  149. package/node_modules/@weavecode/harness/dist/codex/rollout.js +5 -5
  150. package/node_modules/@weavecode/harness/dist/codex/side-question.js +4 -4
  151. package/node_modules/@weavecode/harness/dist/codex/titles.js +4 -4
  152. package/node_modules/@weavecode/harness/dist/codex/toml.js +13 -13
  153. package/node_modules/@weavecode/harness/dist/codex/transcript.js +2 -2
  154. package/node_modules/@weavecode/harness/dist/driver.d.ts +6 -0
  155. package/node_modules/@weavecode/harness/dist/driver.js +1 -1
  156. package/node_modules/@weavecode/harness/dist/init/generated.js +2 -2
  157. package/node_modules/@weavecode/harness/dist/init/pipeline.js +1 -1
  158. package/node_modules/@weavecode/harness/dist/registry-wiring.js +1 -1
  159. package/node_modules/@weavecode/harness/dist/shared/install-link.js +1 -1
  160. package/node_modules/@weavecode/harness/dist/shared/json-cap.js +1 -1
  161. package/node_modules/@weavecode/harness/package.json +2 -2
  162. package/node_modules/@weavecode/server/dist/config/dotted.js +1 -1
  163. package/node_modules/@weavecode/server/dist/config/profiles.js +2 -2
  164. package/node_modules/@weavecode/server/dist/daemon/ai-config.js +2 -2
  165. package/node_modules/@weavecode/server/dist/daemon/ai-context.js +6 -6
  166. package/node_modules/@weavecode/server/dist/daemon/ai-routes.js +4 -4
  167. package/node_modules/@weavecode/server/dist/daemon/api-log.js +3 -3
  168. package/node_modules/@weavecode/server/dist/daemon/auth-routes.js +1 -1
  169. package/node_modules/@weavecode/server/dist/daemon/auto-start.js +3 -3
  170. package/node_modules/@weavecode/server/dist/daemon/capture-routes.js +1 -1
  171. package/node_modules/@weavecode/server/dist/daemon/config-routes.js +1 -1
  172. package/node_modules/@weavecode/server/dist/daemon/cron.js +1 -1
  173. package/node_modules/@weavecode/server/dist/daemon/dashboard-auth.js +2 -2
  174. package/node_modules/@weavecode/server/dist/daemon/dashboard-pusher.js +1 -1
  175. package/node_modules/@weavecode/server/dist/daemon/decision-config.js +2 -2
  176. package/node_modules/@weavecode/server/dist/daemon/dev-entry.js +1 -1
  177. package/node_modules/@weavecode/server/dist/daemon/entry.js +2 -2
  178. package/node_modules/@weavecode/server/dist/daemon/fs-browser.js +1 -1
  179. package/node_modules/@weavecode/server/dist/daemon/hook-pipeline.js +1 -1
  180. package/node_modules/@weavecode/server/dist/daemon/hooks-routes.js +1 -1
  181. package/node_modules/@weavecode/server/dist/daemon/http.js +1 -1
  182. package/node_modules/@weavecode/server/dist/daemon/liveness.js +1 -1
  183. package/node_modules/@weavecode/server/dist/daemon/mcp-orchestration.js +1 -1
  184. package/node_modules/@weavecode/server/dist/daemon/narration-watcher.js +2 -2
  185. package/node_modules/@weavecode/server/dist/daemon/opener/backend-ghostty.js +1 -1
  186. package/node_modules/@weavecode/server/dist/daemon/opener/backend-iterm.js +1 -1
  187. package/node_modules/@weavecode/server/dist/daemon/opener/backend-konsole.js +2 -2
  188. package/node_modules/@weavecode/server/dist/daemon/opener/backend-terminal-app.js +1 -1
  189. package/node_modules/@weavecode/server/dist/daemon/opener/backend-wezterm.js +1 -1
  190. package/node_modules/@weavecode/server/dist/daemon/opener/backend-wt.js +1 -1
  191. package/node_modules/@weavecode/server/dist/daemon/opener/backend.js +1 -1
  192. package/node_modules/@weavecode/server/dist/daemon/opener/pty-terminals.js +1 -1
  193. package/node_modules/@weavecode/server/dist/daemon/opener/shared.js +1 -1
  194. package/node_modules/@weavecode/server/dist/daemon/opener/wezterm-mux.js +1 -1
  195. package/node_modules/@weavecode/server/dist/daemon/opener/wt.js +3 -3
  196. package/node_modules/@weavecode/server/dist/daemon/opener.js +1 -1
  197. package/node_modules/@weavecode/server/dist/daemon/pet-seed.d.ts +4 -0
  198. package/node_modules/@weavecode/server/dist/daemon/pet-seed.js +2 -0
  199. package/node_modules/@weavecode/server/dist/daemon/pet-window.d.ts +17 -0
  200. package/node_modules/@weavecode/server/dist/daemon/pet-window.js +2 -0
  201. package/node_modules/@weavecode/server/dist/daemon/port.js +1 -1
  202. package/node_modules/@weavecode/server/dist/daemon/project-files.d.ts +1 -1
  203. package/node_modules/@weavecode/server/dist/daemon/project-files.js +2 -2
  204. package/node_modules/@weavecode/server/dist/daemon/project-harnesses.js +2 -2
  205. package/node_modules/@weavecode/server/dist/daemon/project-updates-refresher.js +1 -1
  206. package/node_modules/@weavecode/server/dist/daemon/prompt-images.js +1 -1
  207. package/node_modules/@weavecode/server/dist/daemon/routes/hooks-admin.js +1 -1
  208. package/node_modules/@weavecode/server/dist/daemon/routes/installations.d.ts +29 -0
  209. package/node_modules/@weavecode/server/dist/daemon/routes/installations.js +1 -0
  210. package/node_modules/@weavecode/server/dist/daemon/routes/market.js +1 -1
  211. package/node_modules/@weavecode/server/dist/daemon/routes/orchestration.js +1 -1
  212. package/node_modules/@weavecode/server/dist/daemon/routes/path-refs.js +1 -1
  213. package/node_modules/@weavecode/server/dist/daemon/routes/pets.d.ts +3 -0
  214. package/node_modules/@weavecode/server/dist/daemon/routes/pets.js +1 -0
  215. package/node_modules/@weavecode/server/dist/daemon/routes/project-files.js +1 -1
  216. package/node_modules/@weavecode/server/dist/daemon/routes/projects.js +1 -1
  217. package/node_modules/@weavecode/server/dist/daemon/routes/search.js +1 -1
  218. package/node_modules/@weavecode/server/dist/daemon/routes/session-control.js +1 -1
  219. package/node_modules/@weavecode/server/dist/daemon/routes/session-insights.js +1 -1
  220. package/node_modules/@weavecode/server/dist/daemon/routes/settings-statusline.js +1 -1
  221. package/node_modules/@weavecode/server/dist/daemon/routes/uploads.js +1 -1
  222. package/node_modules/@weavecode/server/dist/daemon/routes/visualizations.js +2 -1
  223. package/node_modules/@weavecode/server/dist/daemon/routes/watches.js +1 -1
  224. package/node_modules/@weavecode/server/dist/daemon/server.d.ts +4 -0
  225. package/node_modules/@weavecode/server/dist/daemon/server.js +8 -8
  226. package/node_modules/@weavecode/server/dist/daemon/session-open.js +1 -1
  227. package/node_modules/@weavecode/server/dist/daemon/session-probe.js +1 -1
  228. package/node_modules/@weavecode/server/dist/daemon/settings.d.ts +21 -0
  229. package/node_modules/@weavecode/server/dist/daemon/settings.js +2 -2
  230. package/node_modules/@weavecode/server/dist/daemon/snapshot-refresher.js +1 -1
  231. package/node_modules/@weavecode/server/dist/daemon/sse-hub.js +1 -1
  232. package/node_modules/@weavecode/server/dist/daemon/start.js +1 -1
  233. package/node_modules/@weavecode/server/dist/daemon/state.js +2 -2
  234. package/node_modules/@weavecode/server/dist/daemon/static.js +1 -1
  235. package/node_modules/@weavecode/server/dist/daemon/terminal-topology-refresher.js +1 -1
  236. package/node_modules/@weavecode/server/dist/daemon/tls.js +1 -1
  237. package/node_modules/@weavecode/server/dist/daemon/toolkit-routes.js +1 -1
  238. package/node_modules/@weavecode/server/dist/daemon/upload-sessions.js +1 -1
  239. package/node_modules/@weavecode/server/dist/db/db.d.ts +4 -1
  240. package/node_modules/@weavecode/server/dist/db/db.js +2 -2
  241. package/node_modules/@weavecode/server/dist/db/layout.d.ts +5 -0
  242. package/node_modules/@weavecode/server/dist/db/layout.js +2 -1
  243. package/node_modules/@weavecode/server/dist/db/paths.d.ts +9 -0
  244. package/node_modules/@weavecode/server/dist/db/paths.js +1 -1
  245. package/node_modules/@weavecode/server/dist/hooks/answer-keys.js +1 -1
  246. package/node_modules/@weavecode/server/dist/hooks/dashboard-rate.js +1 -1
  247. package/node_modules/@weavecode/server/dist/hooks/decision-judge.js +1 -1
  248. package/node_modules/@weavecode/server/dist/hooks/delivery/ack-gate.js +1 -1
  249. package/node_modules/@weavecode/server/dist/hooks/delivery/channels.js +1 -1
  250. package/node_modules/@weavecode/server/dist/hooks/delivery/keys.js +1 -1
  251. package/node_modules/@weavecode/server/dist/hooks/delivery/queue.js +1 -1
  252. package/node_modules/@weavecode/server/dist/hooks/delivery/relay.js +1 -1
  253. package/node_modules/@weavecode/server/dist/hooks/delivery/send.js +2 -2
  254. package/node_modules/@weavecode/server/dist/hooks/delivery/views.js +1 -1
  255. package/node_modules/@weavecode/server/dist/hooks/dispatcher.js +6 -6
  256. package/node_modules/@weavecode/server/dist/hooks/edge-extract.js +1 -1
  257. package/node_modules/@weavecode/server/dist/hooks/handlers/webhook.js +1 -1
  258. package/node_modules/@weavecode/server/dist/hooks/headless-runner.js +2 -2
  259. package/node_modules/@weavecode/server/dist/hooks/inbox-socket.js +2 -2
  260. package/node_modules/@weavecode/server/dist/hooks/inbox-worker.js +3 -3
  261. package/node_modules/@weavecode/server/dist/hooks/match.js +1 -1
  262. package/node_modules/@weavecode/server/dist/hooks/message-deliverer.js +5 -5
  263. package/node_modules/@weavecode/server/dist/hooks/mirror.js +4 -4
  264. package/node_modules/@weavecode/server/dist/hooks/orchestration-engine.js +7 -7
  265. package/node_modules/@weavecode/server/dist/hooks/orchestration-graph.js +1 -1
  266. package/node_modules/@weavecode/server/dist/hooks/plugin-installer.js +3 -3
  267. package/node_modules/@weavecode/server/dist/hooks/plugin-loader.js +1 -1
  268. package/node_modules/@weavecode/server/dist/hooks/plugin-project-state.js +1 -1
  269. package/node_modules/@weavecode/server/dist/hooks/prompt-flusher.js +1 -1
  270. package/node_modules/@weavecode/server/dist/hooks/promptbox.js +8 -8
  271. package/node_modules/@weavecode/server/dist/hooks/push-notify.js +2 -2
  272. package/node_modules/@weavecode/server/dist/hooks/question-tracker.js +1 -1
  273. package/node_modules/@weavecode/server/dist/hooks/registry.js +1 -1
  274. package/node_modules/@weavecode/server/dist/hooks/resume-runner.js +1 -1
  275. package/node_modules/@weavecode/server/dist/hooks/session-purge.js +1 -1
  276. package/node_modules/@weavecode/server/dist/hooks/side-questions.js +1 -1
  277. package/node_modules/@weavecode/server/dist/hooks/synthetic-sessions.js +1 -1
  278. package/node_modules/@weavecode/server/dist/hooks/toolkit-scan.js +1 -1
  279. package/node_modules/@weavecode/server/dist/hooks/toolkit.js +5 -5
  280. package/node_modules/@weavecode/server/dist/hooks/watch-engine.js +1 -1
  281. package/node_modules/@weavecode/server/dist/index.d.ts +1 -1
  282. package/node_modules/@weavecode/server/dist/index.js +1 -1
  283. package/node_modules/@weavecode/server/dist/install/apply-update.js +1 -1
  284. package/node_modules/@weavecode/server/dist/install/capabilities.js +1 -1
  285. package/node_modules/@weavecode/server/dist/install/codex-toml.js +1 -1
  286. package/node_modules/@weavecode/server/dist/install/file-assets.js +1 -1
  287. package/node_modules/@weavecode/server/dist/install/fingerprint.js +1 -1
  288. package/node_modules/@weavecode/server/dist/install/global-config.js +1 -1
  289. package/node_modules/@weavecode/server/dist/install/global-file-assets.js +1 -1
  290. package/node_modules/@weavecode/server/dist/install/init-files.d.ts +0 -9
  291. package/node_modules/@weavecode/server/dist/install/init-files.js +2 -2
  292. package/node_modules/@weavecode/server/dist/install/install-ledger.js +1 -1
  293. package/node_modules/@weavecode/server/dist/install/installer.js +1 -1
  294. package/node_modules/@weavecode/server/dist/install/library-index.js +1 -1
  295. package/node_modules/@weavecode/server/dist/install/mcp-rows.js +1 -1
  296. package/node_modules/@weavecode/server/dist/install/plugin-install.js +1 -1
  297. package/node_modules/@weavecode/server/dist/install/plugin-rows.js +1 -1
  298. package/node_modules/@weavecode/server/dist/install/plugin-templates.js +1 -1
  299. package/node_modules/@weavecode/server/dist/install/project-config.js +1 -1
  300. package/node_modules/@weavecode/server/dist/install/reader.js +1 -1
  301. package/node_modules/@weavecode/server/dist/install/scan-cache.js +1 -1
  302. package/node_modules/@weavecode/server/dist/install/scanner.js +1 -1
  303. package/node_modules/@weavecode/server/dist/install/settings-mcp.js +2 -2
  304. package/node_modules/@weavecode/server/dist/install/updates.js +1 -1
  305. package/node_modules/@weavecode/server/dist/market/builtin.js +1 -1
  306. package/node_modules/@weavecode/server/dist/market/identity.js +1 -1
  307. package/node_modules/@weavecode/server/dist/market/import.js +2 -2
  308. package/node_modules/@weavecode/server/dist/market/refresh.js +1 -1
  309. package/node_modules/@weavecode/server/dist/market/resolve.js +1 -1
  310. package/node_modules/@weavecode/server/dist/market/updates.js +1 -1
  311. package/node_modules/@weavecode/server/dist/registry.js +2 -2
  312. package/node_modules/@weavecode/server/dist/repositories/hook-dispatches.js +4 -4
  313. package/node_modules/@weavecode/server/dist/repositories/hook-events.d.ts +6 -0
  314. package/node_modules/@weavecode/server/dist/repositories/hook-events.js +8 -5
  315. package/node_modules/@weavecode/server/dist/repositories/hook-rules.js +4 -4
  316. package/node_modules/@weavecode/server/dist/repositories/libraries.js +1 -1
  317. package/node_modules/@weavecode/server/dist/repositories/orchestrations.js +7 -7
  318. package/node_modules/@weavecode/server/dist/repositories/plugin-states.js +1 -1
  319. package/node_modules/@weavecode/server/dist/repositories/projects.js +1 -1
  320. package/node_modules/@weavecode/server/dist/repositories/push-subscriptions.js +2 -2
  321. package/node_modules/@weavecode/server/dist/repositories/session-watches.js +4 -4
  322. package/node_modules/@weavecode/server/dist/repositories/sessions.js +2 -2
  323. package/node_modules/@weavecode/server/dist/repositories/uploads.js +11 -11
  324. package/node_modules/@weavecode/server/dist/statusline/cache-sweeper.js +1 -1
  325. package/node_modules/@weavecode/server/dist/statusline/generator.js +1 -1
  326. package/node_modules/@weavecode/server/dist/statusline/manager.js +3 -3
  327. package/node_modules/@weavecode/server/dist/surfaces.js +1 -1
  328. package/node_modules/@weavecode/server/dist/watch/cache.js +1 -1
  329. package/node_modules/@weavecode/server/dist/watch/classifier.js +1 -1
  330. package/node_modules/@weavecode/server/dist/watch/plugin-mods.js +1 -1
  331. package/node_modules/@weavecode/server/dist/watch/sync-scheduler.js +1 -1
  332. package/node_modules/@weavecode/server/dist/watch/watch-service.js +1 -1
  333. package/node_modules/@weavecode/server/package.json +4 -4
  334. package/node_modules/@weavecode/server/web/dist/assets/abnfDiagram-WEYOIA3C-S1lL1V_n.js +1 -0
  335. package/node_modules/@weavecode/server/web/dist/assets/{arc-CRZTRyjb.js → arc-CoTNHyHV.js} +1 -1
  336. package/node_modules/@weavecode/server/web/dist/assets/architectureDiagram-ZHVYKT53-C6ttfnzW.js +36 -0
  337. package/node_modules/@weavecode/server/web/dist/assets/{blockDiagram-RJAE7QA3-BIH8mSIZ.js → blockDiagram-RJAE7QA3-CYr3Cpu9.js} +2 -2
  338. package/node_modules/@weavecode/server/web/dist/assets/{c4Diagram-XDPPPE54-5YoKWFOD.js → c4Diagram-XDPPPE54-BFS7PhLD.js} +2 -2
  339. package/node_modules/@weavecode/server/web/dist/assets/channel-DxQHp3Yc.js +1 -0
  340. package/node_modules/@weavecode/server/web/dist/assets/{chunk-2E7WHVMD-B653kMXt.js → chunk-2E7WHVMD-DJ7X_Shu.js} +1 -1
  341. package/node_modules/@weavecode/server/web/dist/assets/{chunk-2Q5K7J3B-f_A4_eDz.js → chunk-2Q5K7J3B-B8nr2rdz.js} +1 -1
  342. package/node_modules/@weavecode/server/web/dist/assets/{chunk-4EMNKR2T-v5j5qNGj.js → chunk-4EMNKR2T-DmnZmUMU.js} +1 -1
  343. package/node_modules/@weavecode/server/web/dist/assets/chunk-55XCU76K-Xz9a8dmp.js +1 -0
  344. package/node_modules/@weavecode/server/web/dist/assets/{chunk-5VM5RSS4-BeROhLXN.js → chunk-5VM5RSS4-Dg9mg7pf.js} +1 -1
  345. package/node_modules/@weavecode/server/web/dist/assets/{chunk-JWPE2WC7-D6dXb_jr.js → chunk-JWPE2WC7-CmjTZO8o.js} +1 -1
  346. package/node_modules/@weavecode/server/web/dist/assets/{chunk-VQ5W62QI-CnHdSEMi.js → chunk-VQ5W62QI-D3YDdJ3E.js} +1 -1
  347. package/node_modules/@weavecode/server/web/dist/assets/chunk-XXDRQBXY-s1OG9sqW.js +1 -0
  348. package/node_modules/@weavecode/server/web/dist/assets/chunk-ZCHMQSOR-C3hINQU3.js +2 -0
  349. package/node_modules/@weavecode/server/web/dist/assets/{classDiagram-v2-4MYWR3UA-DQe1b_k8.js → classDiagram-v2-4MYWR3UA-BTsbYrVl.js} +2 -2
  350. package/node_modules/@weavecode/server/web/dist/assets/cose-bilkent-JH36ORCC-C0W8Y-jI.js +1 -0
  351. package/node_modules/@weavecode/server/web/dist/assets/{cynefin-EF2NZ3EQ-OZotFKUu.js → cynefin-EF2NZ3EQ-stAu4Rh-.js} +1 -1
  352. package/node_modules/@weavecode/server/web/dist/assets/cynefinDiagram-WF24UDRP-CqYibiiv.js +62 -0
  353. package/node_modules/@weavecode/server/web/dist/assets/dagre-NK4GIZVX-qqcoJAqB.js +4 -0
  354. package/node_modules/@weavecode/server/web/dist/assets/diagram-CBK3MWTC-D0YTopb7.js +24 -0
  355. package/node_modules/@weavecode/server/web/dist/assets/diagram-I5XIIV2D-Csvw6aYr.js +24 -0
  356. package/node_modules/@weavecode/server/web/dist/assets/{diagram-ODIL2UCW-D9A6W8oB.js → diagram-ODIL2UCW-Dl0tYLkF.js} +2 -2
  357. package/node_modules/@weavecode/server/web/dist/assets/{diagram-PFBEJUXE-PeI-eyu2.js → diagram-PFBEJUXE-BCPSWZPe.js} +2 -2
  358. package/node_modules/@weavecode/server/web/dist/assets/diagram-RJA3I4VV-ETg-BrAJ.js +41 -0
  359. package/node_modules/@weavecode/server/web/dist/assets/{diagram-TYUNFSNR-D5KieEw5.js → diagram-TYUNFSNR-_M6ZxBG7.js} +2 -2
  360. package/node_modules/@weavecode/server/web/dist/assets/ebnfDiagram-V4P3TTPT-C-e_W7qx.js +1 -0
  361. package/node_modules/@weavecode/server/web/dist/assets/{elk-QONTBCTQ-D3xrVg0U.js → elk-QONTBCTQ-B5TBharB.js} +3 -3
  362. package/node_modules/@weavecode/server/web/dist/assets/{erDiagram-KYQIGQAA-y_V1cor7.js → erDiagram-KYQIGQAA-D08rj2pv.js} +2 -2
  363. package/node_modules/@weavecode/server/web/dist/assets/{flowDiagram-IUGLLWBU-BJ8Z0MkF.js → flowDiagram-IUGLLWBU-BALTxsKh.js} +1 -1
  364. package/node_modules/@weavecode/server/web/dist/assets/ganttDiagram-R7GPNTJY-Cts193jT.js +292 -0
  365. package/node_modules/@weavecode/server/web/dist/assets/gitGraphDiagram-PDYL7XHY-L9qYUX0v.js +106 -0
  366. package/node_modules/@weavecode/server/web/dist/assets/infoDiagram-MVDRKAX5-Bv47rgU0.js +2 -0
  367. package/node_modules/@weavecode/server/web/dist/assets/{ishikawaDiagram-HPEHV2GE-ChEnND76.js → ishikawaDiagram-HPEHV2GE-Da8_s6cs.js} +2 -2
  368. package/node_modules/@weavecode/server/web/dist/assets/{journeyDiagram-BOSHW7O7-DHcNtpYF.js → journeyDiagram-BOSHW7O7-Bj3CjZOf.js} +2 -2
  369. package/node_modules/@weavecode/server/web/dist/assets/{kanban-definition-FNSA4HC5-Dft7qpW5.js → kanban-definition-FNSA4HC5-D1hicmMu.js} +2 -2
  370. package/node_modules/@weavecode/server/web/dist/assets/linear-CWQg2iA1.js +1 -0
  371. package/node_modules/@weavecode/server/web/dist/assets/main-XLn3EZFh.css +11 -0
  372. package/node_modules/@weavecode/server/web/dist/assets/main-bsb0lQoL.js +1096 -0
  373. package/node_modules/@weavecode/server/web/dist/assets/{mermaid.core-D_Dp_Kl2.js → mermaid.core-C-wP0Zg2.js} +4 -4
  374. package/node_modules/@weavecode/server/web/dist/assets/{mindmap-definition-6OY57UG3-CM6OAd_-.js → mindmap-definition-6OY57UG3-Dk0VKqre.js} +2 -2
  375. package/node_modules/@weavecode/server/web/dist/assets/modulepreload-polyfill-B5Qt9EMX.js +1 -0
  376. package/node_modules/@weavecode/server/web/dist/assets/pegDiagram-ECIUJNBX-Bp1K_F9z.js +1 -0
  377. package/node_modules/@weavecode/server/web/dist/assets/pet-J6izA90s.js +1 -0
  378. package/node_modules/@weavecode/server/web/dist/assets/pieDiagram-GNMPY74T-BZ4rGy3t.js +39 -0
  379. package/node_modules/@weavecode/server/web/dist/assets/{quadrantDiagram-D57K4MC3-D8pQ_PU2.js → quadrantDiagram-D57K4MC3-B4N5KRsR.js} +4 -4
  380. package/node_modules/@weavecode/server/web/dist/assets/railroadDiagram-Y72NRBL7-C8nx8oHf.js +1 -0
  381. package/node_modules/@weavecode/server/web/dist/assets/{requirementDiagram-EQYSW5RA-C90DU5Ny.js → requirementDiagram-EQYSW5RA-VSH57d0d.js} +2 -2
  382. package/node_modules/@weavecode/server/web/dist/assets/{sankeyDiagram-SY24JHO5-B_poYGgJ.js → sankeyDiagram-SY24JHO5-jUb1hcya.js} +2 -2
  383. package/node_modules/@weavecode/server/web/dist/assets/{sequenceDiagram-BLEHNHQU-DDW7b2Dn.js → sequenceDiagram-BLEHNHQU-E2BioCNi.js} +2 -2
  384. package/node_modules/@weavecode/server/web/dist/assets/sizeCapture-INFHLROL-BdKrbRmI.js +1 -0
  385. package/node_modules/@weavecode/server/web/dist/assets/{stateDiagram-v2-A6IESKWZ-CkVMAyxG.js → stateDiagram-v2-A6IESKWZ-tFz7uNM7.js} +2 -2
  386. package/node_modules/@weavecode/server/web/dist/assets/swimlanes-B3ENRKFQ-B9BAPDWw.js +1 -0
  387. package/node_modules/@weavecode/server/web/dist/assets/swimlanesDiagram-AYQRV4AK-DQ2NPLl9.js +8 -0
  388. package/node_modules/@weavecode/server/web/dist/assets/{timeline-definition-JXYKGLGB-DnhkRGLb.js → timeline-definition-JXYKGLGB-CofNnFTK.js} +2 -2
  389. package/node_modules/@weavecode/server/web/dist/assets/{usecaseDiagram-WPOLBNNX-_TdIjC6Z.js → usecaseDiagram-WPOLBNNX-DOvjhJjJ.js} +2 -2
  390. package/node_modules/@weavecode/server/web/dist/assets/{vennDiagram-Q3Y3IDCW-FzgsymXB.js → vennDiagram-Q3Y3IDCW-BcFHWnhS.js} +2 -2
  391. package/node_modules/@weavecode/server/web/dist/assets/{wardleyDiagram-IVAIDKWA-BwqimStC.js → wardleyDiagram-IVAIDKWA-Bz2aqRAs.js} +2 -2
  392. package/node_modules/@weavecode/server/web/dist/assets/{xychartDiagram-4URNHDU4-CFjjVPIV.js → xychartDiagram-4URNHDU4-DpNF6Vsq.js} +2 -2
  393. package/node_modules/@weavecode/server/web/dist/index.html +3 -2
  394. package/node_modules/@weavecode/server/web/dist/pet.html +130 -0
  395. package/node_modules/@weavecode/templates/dist/index.d.ts +2 -0
  396. package/node_modules/@weavecode/templates/dist/index.js +1 -1
  397. package/node_modules/@weavecode/templates/dist/resources/pets/weave-spider/pet.json +7 -0
  398. package/node_modules/@weavecode/templates/dist/resources/pets/weave-spider/spritesheet.png +0 -0
  399. package/node_modules/@weavecode/templates/dist/resources/weave-market/.claude-plugin/marketplace.json +6 -0
  400. package/node_modules/@weavecode/templates/dist/resources/weave-market/plugins/core-skills/weave-pet-hatcher/.claude-plugin/plugin.json +8 -0
  401. package/node_modules/@weavecode/templates/dist/resources/weave-market/plugins/core-skills/weave-pet-hatcher/skills/weave-pet-hatcher/SKILL.md +121 -0
  402. package/node_modules/@weavecode/templates/dist/resources/weave-market/plugins/core-skills/weave-pet-hatcher/skills/weave-pet-hatcher/scripts/assemble-pet.mjs +308 -0
  403. package/node_modules/@weavecode/templates/dist/resources/weave-market/plugins/core-skills/weave-pet-hatcher/weave.json +4 -0
  404. package/node_modules/@weavecode/templates/package.json +2 -2
  405. package/package.json +11 -7
  406. package/scripts/preinstall.mjs +108 -0
  407. package/node_modules/@weavecode/server/web/dist/assets/abnfDiagram-WEYOIA3C-DDeQkTf5.js +0 -1
  408. package/node_modules/@weavecode/server/web/dist/assets/architectureDiagram-ZHVYKT53-Dj54DE3O.js +0 -36
  409. package/node_modules/@weavecode/server/web/dist/assets/channel-5VM93AJ8.js +0 -1
  410. package/node_modules/@weavecode/server/web/dist/assets/chunk-55XCU76K-CgEqeP7j.js +0 -1
  411. package/node_modules/@weavecode/server/web/dist/assets/chunk-XXDRQBXY-BkG_e6PE.js +0 -1
  412. package/node_modules/@weavecode/server/web/dist/assets/chunk-ZCHMQSOR-DxR-fxzs.js +0 -2
  413. package/node_modules/@weavecode/server/web/dist/assets/cose-bilkent-JH36ORCC-DThrA8S5.js +0 -1
  414. package/node_modules/@weavecode/server/web/dist/assets/cynefinDiagram-WF24UDRP-DJjq2hfT.js +0 -62
  415. package/node_modules/@weavecode/server/web/dist/assets/dagre-NK4GIZVX-C2vH93HT.js +0 -4
  416. package/node_modules/@weavecode/server/web/dist/assets/diagram-CBK3MWTC-DrF_ScM-.js +0 -24
  417. package/node_modules/@weavecode/server/web/dist/assets/diagram-I5XIIV2D-D1qoUJ4t.js +0 -24
  418. package/node_modules/@weavecode/server/web/dist/assets/diagram-RJA3I4VV-DITY0Rd8.js +0 -41
  419. package/node_modules/@weavecode/server/web/dist/assets/ebnfDiagram-V4P3TTPT-DDylK-gz.js +0 -1
  420. package/node_modules/@weavecode/server/web/dist/assets/ganttDiagram-R7GPNTJY-C0q-CS1T.js +0 -292
  421. package/node_modules/@weavecode/server/web/dist/assets/gitGraphDiagram-PDYL7XHY-BYTComiB.js +0 -106
  422. package/node_modules/@weavecode/server/web/dist/assets/index-BKxAxaVG.js +0 -1091
  423. package/node_modules/@weavecode/server/web/dist/assets/index-C0Sd4MH7.css +0 -11
  424. package/node_modules/@weavecode/server/web/dist/assets/infoDiagram-MVDRKAX5-DtixgjLP.js +0 -2
  425. package/node_modules/@weavecode/server/web/dist/assets/linear-DEo11t-X.js +0 -1
  426. package/node_modules/@weavecode/server/web/dist/assets/pegDiagram-ECIUJNBX-_QkY0h8Q.js +0 -1
  427. package/node_modules/@weavecode/server/web/dist/assets/pieDiagram-GNMPY74T-ZGr5vtDj.js +0 -39
  428. package/node_modules/@weavecode/server/web/dist/assets/railroadDiagram-Y72NRBL7-DUIo-WmA.js +0 -1
  429. package/node_modules/@weavecode/server/web/dist/assets/sizeCapture-INFHLROL-CmKoqX6K.js +0 -1
  430. package/node_modules/@weavecode/server/web/dist/assets/swimlanes-B3ENRKFQ-Dm_Omzky.js +0 -1
  431. package/node_modules/@weavecode/server/web/dist/assets/swimlanesDiagram-AYQRV4AK-Bjj8ZA4d.js +0 -8
@@ -1 +0,0 @@
1
- import{_ as V,l as k}from"./mermaid.core-D_Dp_Kl2.js";import{c as J}from"./cytoscape.esm-DgFJg4rT.js";import{c as $,g as lt,s as gt}from"./index-BKxAxaVG.js";var tt={exports:{}},Z={exports:{}},Q={exports:{}},q;function ut(){return q||(q=1,function(G,b){(function(I,T){G.exports=T()})($,function(){return function(N){var I={};function T(o){if(I[o])return I[o].exports;var e=I[o]={i:o,l:!1,exports:{}};return N[o].call(e.exports,e,e.exports,T),e.l=!0,e.exports}return T.m=N,T.c=I,T.i=function(o){return o},T.d=function(o,e,t){T.o(o,e)||Object.defineProperty(o,e,{configurable:!1,enumerable:!0,get:t})},T.n=function(o){var e=o&&o.__esModule?function(){return o.default}:function(){return o};return T.d(e,"a",e),e},T.o=function(o,e){return Object.prototype.hasOwnProperty.call(o,e)},T.p="",T(T.s=26)}([function(N,I,T){function o(){}o.QUALITY=1,o.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,o.DEFAULT_INCREMENTAL=!1,o.DEFAULT_ANIMATION_ON_LAYOUT=!0,o.DEFAULT_ANIMATION_DURING_LAYOUT=!1,o.DEFAULT_ANIMATION_PERIOD=50,o.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,o.DEFAULT_GRAPH_MARGIN=15,o.NODE_DIMENSIONS_INCLUDE_LABELS=!1,o.SIMPLE_NODE_SIZE=40,o.SIMPLE_NODE_HALF_SIZE=o.SIMPLE_NODE_SIZE/2,o.EMPTY_COMPOUND_NODE_SIZE=40,o.MIN_EDGE_LENGTH=1,o.WORLD_BOUNDARY=1e6,o.INITIAL_WORLD_BOUNDARY=o.WORLD_BOUNDARY/1e3,o.WORLD_CENTER_X=1200,o.WORLD_CENTER_Y=900,N.exports=o},function(N,I,T){var o=T(2),e=T(8),t=T(9);function i(g,n,d){o.call(this,d),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=d,this.bendpoints=[],this.source=g,this.target=n}i.prototype=Object.create(o.prototype);for(var l in o)i[l]=o[l];i.prototype.getSource=function(){return this.source},i.prototype.getTarget=function(){return this.target},i.prototype.isInterGraph=function(){return this.isInterGraph},i.prototype.getLength=function(){return this.length},i.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},i.prototype.getBendpoints=function(){return this.bendpoints},i.prototype.getLca=function(){return this.lca},i.prototype.getSourceInLca=function(){return this.sourceInLca},i.prototype.getTargetInLca=function(){return this.targetInLca},i.prototype.getOtherEnd=function(g){if(this.source===g)return this.target;if(this.target===g)return this.source;throw"Node is not incident with this edge"},i.prototype.getOtherEndInGraph=function(g,n){for(var d=this.getOtherEnd(g),r=n.getGraphManager().getRoot();;){if(d.getOwner()==n)return d;if(d.getOwner()==r)break;d=d.getOwner().getParent()}return null},i.prototype.updateLength=function(){var g=new Array(4);this.isOverlapingSourceAndTarget=e.getIntersection(this.target.getRect(),this.source.getRect(),g),this.isOverlapingSourceAndTarget||(this.lengthX=g[0]-g[2],this.lengthY=g[1]-g[3],Math.abs(this.lengthX)<1&&(this.lengthX=t.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=t.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},i.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1&&(this.lengthX=t.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=t.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},N.exports=i},function(N,I,T){function o(e){this.vGraphObject=e}N.exports=o},function(N,I,T){var o=T(2),e=T(10),t=T(13),i=T(0),l=T(16),g=T(4);function n(r,h,a,p){a==null&&p==null&&(p=h),o.call(this,p),r.graphManager!=null&&(r=r.graphManager),this.estimatedSize=e.MIN_VALUE,this.inclusionTreeDepth=e.MAX_VALUE,this.vGraphObject=p,this.edges=[],this.graphManager=r,a!=null&&h!=null?this.rect=new t(h.x,h.y,a.width,a.height):this.rect=new t}n.prototype=Object.create(o.prototype);for(var d in o)n[d]=o[d];n.prototype.getEdges=function(){return this.edges},n.prototype.getChild=function(){return this.child},n.prototype.getOwner=function(){return this.owner},n.prototype.getWidth=function(){return this.rect.width},n.prototype.setWidth=function(r){this.rect.width=r},n.prototype.getHeight=function(){return this.rect.height},n.prototype.setHeight=function(r){this.rect.height=r},n.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},n.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},n.prototype.getCenter=function(){return new g(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},n.prototype.getLocation=function(){return new g(this.rect.x,this.rect.y)},n.prototype.getRect=function(){return this.rect},n.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},n.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},n.prototype.setRect=function(r,h){this.rect.x=r.x,this.rect.y=r.y,this.rect.width=h.width,this.rect.height=h.height},n.prototype.setCenter=function(r,h){this.rect.x=r-this.rect.width/2,this.rect.y=h-this.rect.height/2},n.prototype.setLocation=function(r,h){this.rect.x=r,this.rect.y=h},n.prototype.moveBy=function(r,h){this.rect.x+=r,this.rect.y+=h},n.prototype.getEdgeListToNode=function(r){var h=[],a=this;return a.edges.forEach(function(p){if(p.target==r){if(p.source!=a)throw"Incorrect edge source!";h.push(p)}}),h},n.prototype.getEdgesBetween=function(r){var h=[],a=this;return a.edges.forEach(function(p){if(!(p.source==a||p.target==a))throw"Incorrect edge source and/or target";(p.target==r||p.source==r)&&h.push(p)}),h},n.prototype.getNeighborsList=function(){var r=new Set,h=this;return h.edges.forEach(function(a){if(a.source==h)r.add(a.target);else{if(a.target!=h)throw"Incorrect incidency!";r.add(a.source)}}),r},n.prototype.withChildren=function(){var r=new Set,h,a;if(r.add(this),this.child!=null)for(var p=this.child.getNodes(),v=0;v<p.length;v++)h=p[v],a=h.withChildren(),a.forEach(function(D){r.add(D)});return r},n.prototype.getNoOfChildren=function(){var r=0,h;if(this.child==null)r=1;else for(var a=this.child.getNodes(),p=0;p<a.length;p++)h=a[p],r+=h.getNoOfChildren();return r==0&&(r=1),r},n.prototype.getEstimatedSize=function(){if(this.estimatedSize==e.MIN_VALUE)throw"assert failed";return this.estimatedSize},n.prototype.calcEstimatedSize=function(){return this.child==null?this.estimatedSize=(this.rect.width+this.rect.height)/2:(this.estimatedSize=this.child.calcEstimatedSize(),this.rect.width=this.estimatedSize,this.rect.height=this.estimatedSize,this.estimatedSize)},n.prototype.scatter=function(){var r,h,a=-i.INITIAL_WORLD_BOUNDARY,p=i.INITIAL_WORLD_BOUNDARY;r=i.WORLD_CENTER_X+l.nextDouble()*(p-a)+a;var v=-i.INITIAL_WORLD_BOUNDARY,D=i.INITIAL_WORLD_BOUNDARY;h=i.WORLD_CENTER_Y+l.nextDouble()*(D-v)+v,this.rect.x=r,this.rect.y=h},n.prototype.updateBounds=function(){if(this.getChild()==null)throw"assert failed";if(this.getChild().getNodes().length!=0){var r=this.getChild();if(r.updateBounds(!0),this.rect.x=r.getLeft(),this.rect.y=r.getTop(),this.setWidth(r.getRight()-r.getLeft()),this.setHeight(r.getBottom()-r.getTop()),i.NODE_DIMENSIONS_INCLUDE_LABELS){var h=r.getRight()-r.getLeft(),a=r.getBottom()-r.getTop();this.labelWidth>h&&(this.rect.x-=(this.labelWidth-h)/2,this.setWidth(this.labelWidth)),this.labelHeight>a&&(this.labelPos=="center"?this.rect.y-=(this.labelHeight-a)/2:this.labelPos=="top"&&(this.rect.y-=this.labelHeight-a),this.setHeight(this.labelHeight))}}},n.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==e.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},n.prototype.transform=function(r){var h=this.rect.x;h>i.WORLD_BOUNDARY?h=i.WORLD_BOUNDARY:h<-i.WORLD_BOUNDARY&&(h=-i.WORLD_BOUNDARY);var a=this.rect.y;a>i.WORLD_BOUNDARY?a=i.WORLD_BOUNDARY:a<-i.WORLD_BOUNDARY&&(a=-i.WORLD_BOUNDARY);var p=new g(h,a),v=r.inverseTransformPoint(p);this.setLocation(v.x,v.y)},n.prototype.getLeft=function(){return this.rect.x},n.prototype.getRight=function(){return this.rect.x+this.rect.width},n.prototype.getTop=function(){return this.rect.y},n.prototype.getBottom=function(){return this.rect.y+this.rect.height},n.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},N.exports=n},function(N,I,T){function o(e,t){e==null&&t==null?(this.x=0,this.y=0):(this.x=e,this.y=t)}o.prototype.getX=function(){return this.x},o.prototype.getY=function(){return this.y},o.prototype.setX=function(e){this.x=e},o.prototype.setY=function(e){this.y=e},o.prototype.getDifference=function(e){return new DimensionD(this.x-e.x,this.y-e.y)},o.prototype.getCopy=function(){return new o(this.x,this.y)},o.prototype.translate=function(e){return this.x+=e.width,this.y+=e.height,this},N.exports=o},function(N,I,T){var o=T(2),e=T(10),t=T(0),i=T(6),l=T(3),g=T(1),n=T(13),d=T(12),r=T(11);function h(p,v,D){o.call(this,D),this.estimatedSize=e.MIN_VALUE,this.margin=t.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=p,v!=null&&v instanceof i?this.graphManager=v:v!=null&&v instanceof Layout&&(this.graphManager=v.graphManager)}h.prototype=Object.create(o.prototype);for(var a in o)h[a]=o[a];h.prototype.getNodes=function(){return this.nodes},h.prototype.getEdges=function(){return this.edges},h.prototype.getGraphManager=function(){return this.graphManager},h.prototype.getParent=function(){return this.parent},h.prototype.getLeft=function(){return this.left},h.prototype.getRight=function(){return this.right},h.prototype.getTop=function(){return this.top},h.prototype.getBottom=function(){return this.bottom},h.prototype.isConnected=function(){return this.isConnected},h.prototype.add=function(p,v,D){if(v==null&&D==null){var u=p;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(u)>-1)throw"Node already in graph!";return u.owner=this,this.getNodes().push(u),u}else{var E=p;if(!(this.getNodes().indexOf(v)>-1&&this.getNodes().indexOf(D)>-1))throw"Source or target not in graph!";if(!(v.owner==D.owner&&v.owner==this))throw"Both owners must be this graph!";return v.owner!=D.owner?null:(E.source=v,E.target=D,E.isInterGraph=!1,this.getEdges().push(E),v.edges.push(E),D!=v&&D.edges.push(E),E)}},h.prototype.remove=function(p){var v=p;if(p instanceof l){if(v==null)throw"Node is null!";if(!(v.owner!=null&&v.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var D=v.edges.slice(),u,E=D.length,y=0;y<E;y++)u=D[y],u.isInterGraph?this.graphManager.remove(u):u.source.owner.remove(u);var O=this.nodes.indexOf(v);if(O==-1)throw"Node not in owner node list!";this.nodes.splice(O,1)}else if(p instanceof g){var u=p;if(u==null)throw"Edge is null!";if(!(u.source!=null&&u.target!=null))throw"Source and/or target is null!";if(!(u.source.owner!=null&&u.target.owner!=null&&u.source.owner==this&&u.target.owner==this))throw"Source and/or target owner is invalid!";var s=u.source.edges.indexOf(u),f=u.target.edges.indexOf(u);if(!(s>-1&&f>-1))throw"Source and/or target doesn't know this edge!";u.source.edges.splice(s,1),u.target!=u.source&&u.target.edges.splice(f,1);var O=u.source.owner.getEdges().indexOf(u);if(O==-1)throw"Not in owner's edge list!";u.source.owner.getEdges().splice(O,1)}},h.prototype.updateLeftTop=function(){for(var p=e.MAX_VALUE,v=e.MAX_VALUE,D,u,E,y=this.getNodes(),O=y.length,s=0;s<O;s++){var f=y[s];D=f.getTop(),u=f.getLeft(),p>D&&(p=D),v>u&&(v=u)}return p==e.MAX_VALUE?null:(y[0].getParent().paddingLeft!=null?E=y[0].getParent().paddingLeft:E=this.margin,this.left=v-E,this.top=p-E,new d(this.left,this.top))},h.prototype.updateBounds=function(p){for(var v=e.MAX_VALUE,D=-e.MAX_VALUE,u=e.MAX_VALUE,E=-e.MAX_VALUE,y,O,s,f,c,L=this.nodes,A=L.length,m=0;m<A;m++){var R=L[m];p&&R.child!=null&&R.updateBounds(),y=R.getLeft(),O=R.getRight(),s=R.getTop(),f=R.getBottom(),v>y&&(v=y),D<O&&(D=O),u>s&&(u=s),E<f&&(E=f)}var C=new n(v,u,D-v,E-u);v==e.MAX_VALUE&&(this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom()),L[0].getParent().paddingLeft!=null?c=L[0].getParent().paddingLeft:c=this.margin,this.left=C.x-c,this.right=C.x+C.width+c,this.top=C.y-c,this.bottom=C.y+C.height+c},h.calculateBounds=function(p){for(var v=e.MAX_VALUE,D=-e.MAX_VALUE,u=e.MAX_VALUE,E=-e.MAX_VALUE,y,O,s,f,c=p.length,L=0;L<c;L++){var A=p[L];y=A.getLeft(),O=A.getRight(),s=A.getTop(),f=A.getBottom(),v>y&&(v=y),D<O&&(D=O),u>s&&(u=s),E<f&&(E=f)}var m=new n(v,u,D-v,E-u);return m},h.prototype.getInclusionTreeDepth=function(){return this==this.graphManager.getRoot()?1:this.parent.getInclusionTreeDepth()},h.prototype.getEstimatedSize=function(){if(this.estimatedSize==e.MIN_VALUE)throw"assert failed";return this.estimatedSize},h.prototype.calcEstimatedSize=function(){for(var p=0,v=this.nodes,D=v.length,u=0;u<D;u++){var E=v[u];p+=E.calcEstimatedSize()}return p==0?this.estimatedSize=t.EMPTY_COMPOUND_NODE_SIZE:this.estimatedSize=p/Math.sqrt(this.nodes.length),this.estimatedSize},h.prototype.updateConnected=function(){var p=this;if(this.nodes.length==0){this.isConnected=!0;return}var v=new r,D=new Set,u=this.nodes[0],E,y,O=u.withChildren();for(O.forEach(function(m){v.push(m),D.add(m)});v.length!==0;){u=v.shift(),E=u.getEdges();for(var s=E.length,f=0;f<s;f++){var c=E[f];if(y=c.getOtherEndInGraph(u,this),y!=null&&!D.has(y)){var L=y.withChildren();L.forEach(function(m){v.push(m),D.add(m)})}}}if(this.isConnected=!1,D.size>=this.nodes.length){var A=0;D.forEach(function(m){m.owner==p&&A++}),A==this.nodes.length&&(this.isConnected=!0)}},N.exports=h},function(N,I,T){var o,e=T(1);function t(i){o=T(5),this.layout=i,this.graphs=[],this.edges=[]}t.prototype.addRoot=function(){var i=this.layout.newGraph(),l=this.layout.newNode(null),g=this.add(i,l);return this.setRootGraph(g),this.rootGraph},t.prototype.add=function(i,l,g,n,d){if(g==null&&n==null&&d==null){if(i==null)throw"Graph is null!";if(l==null)throw"Parent node is null!";if(this.graphs.indexOf(i)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(i),i.parent!=null)throw"Already has a parent!";if(l.child!=null)throw"Already has a child!";return i.parent=l,l.child=i,i}else{d=g,n=l,g=i;var r=n.getOwner(),h=d.getOwner();if(!(r!=null&&r.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(h!=null&&h.getGraphManager()==this))throw"Target not in this graph mgr!";if(r==h)return g.isInterGraph=!1,r.add(g,n,d);if(g.isInterGraph=!0,g.source=n,g.target=d,this.edges.indexOf(g)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(g),!(g.source!=null&&g.target!=null))throw"Edge source and/or target is null!";if(!(g.source.edges.indexOf(g)==-1&&g.target.edges.indexOf(g)==-1))throw"Edge already in source and/or target incidency list!";return g.source.edges.push(g),g.target.edges.push(g),g}},t.prototype.remove=function(i){if(i instanceof o){var l=i;if(l.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(l==this.rootGraph||l.parent!=null&&l.parent.graphManager==this))throw"Invalid parent node!";var g=[];g=g.concat(l.getEdges());for(var n,d=g.length,r=0;r<d;r++)n=g[r],l.remove(n);var h=[];h=h.concat(l.getNodes());var a;d=h.length;for(var r=0;r<d;r++)a=h[r],l.remove(a);l==this.rootGraph&&this.setRootGraph(null);var p=this.graphs.indexOf(l);this.graphs.splice(p,1),l.parent=null}else if(i instanceof e){if(n=i,n==null)throw"Edge is null!";if(!n.isInterGraph)throw"Not an inter-graph edge!";if(!(n.source!=null&&n.target!=null))throw"Source and/or target is null!";if(!(n.source.edges.indexOf(n)!=-1&&n.target.edges.indexOf(n)!=-1))throw"Source and/or target doesn't know this edge!";var p=n.source.edges.indexOf(n);if(n.source.edges.splice(p,1),p=n.target.edges.indexOf(n),n.target.edges.splice(p,1),!(n.source.owner!=null&&n.source.owner.getGraphManager()!=null))throw"Edge owner graph or owner graph manager is null!";if(n.source.owner.getGraphManager().edges.indexOf(n)==-1)throw"Not in owner graph manager's edge list!";var p=n.source.owner.getGraphManager().edges.indexOf(n);n.source.owner.getGraphManager().edges.splice(p,1)}},t.prototype.updateBounds=function(){this.rootGraph.updateBounds(!0)},t.prototype.getGraphs=function(){return this.graphs},t.prototype.getAllNodes=function(){if(this.allNodes==null){for(var i=[],l=this.getGraphs(),g=l.length,n=0;n<g;n++)i=i.concat(l[n].getNodes());this.allNodes=i}return this.allNodes},t.prototype.resetAllNodes=function(){this.allNodes=null},t.prototype.resetAllEdges=function(){this.allEdges=null},t.prototype.resetAllNodesToApplyGravitation=function(){this.allNodesToApplyGravitation=null},t.prototype.getAllEdges=function(){if(this.allEdges==null){var i=[],l=this.getGraphs();l.length;for(var g=0;g<l.length;g++)i=i.concat(l[g].getEdges());i=i.concat(this.edges),this.allEdges=i}return this.allEdges},t.prototype.getAllNodesToApplyGravitation=function(){return this.allNodesToApplyGravitation},t.prototype.setAllNodesToApplyGravitation=function(i){if(this.allNodesToApplyGravitation!=null)throw"assert failed";this.allNodesToApplyGravitation=i},t.prototype.getRoot=function(){return this.rootGraph},t.prototype.setRootGraph=function(i){if(i.getGraphManager()!=this)throw"Root not in this graph mgr!";this.rootGraph=i,i.parent==null&&(i.parent=this.layout.newNode("Root node"))},t.prototype.getLayout=function(){return this.layout},t.prototype.isOneAncestorOfOther=function(i,l){if(!(i!=null&&l!=null))throw"assert failed";if(i==l)return!0;var g=i.getOwner(),n;do{if(n=g.getParent(),n==null)break;if(n==l)return!0;if(g=n.getOwner(),g==null)break}while(!0);g=l.getOwner();do{if(n=g.getParent(),n==null)break;if(n==i)return!0;if(g=n.getOwner(),g==null)break}while(!0);return!1},t.prototype.calcLowestCommonAncestors=function(){for(var i,l,g,n,d,r=this.getAllEdges(),h=r.length,a=0;a<h;a++){if(i=r[a],l=i.source,g=i.target,i.lca=null,i.sourceInLca=l,i.targetInLca=g,l==g){i.lca=l.getOwner();continue}for(n=l.getOwner();i.lca==null;){for(i.targetInLca=g,d=g.getOwner();i.lca==null;){if(d==n){i.lca=d;break}if(d==this.rootGraph)break;if(i.lca!=null)throw"assert failed";i.targetInLca=d.getParent(),d=i.targetInLca.getOwner()}if(n==this.rootGraph)break;i.lca==null&&(i.sourceInLca=n.getParent(),n=i.sourceInLca.getOwner())}if(i.lca==null)throw"assert failed"}},t.prototype.calcLowestCommonAncestor=function(i,l){if(i==l)return i.getOwner();var g=i.getOwner();do{if(g==null)break;var n=l.getOwner();do{if(n==null)break;if(n==g)return n;n=n.getParent().getOwner()}while(!0);g=g.getParent().getOwner()}while(!0);return g},t.prototype.calcInclusionTreeDepths=function(i,l){i==null&&l==null&&(i=this.rootGraph,l=1);for(var g,n=i.getNodes(),d=n.length,r=0;r<d;r++)g=n[r],g.inclusionTreeDepth=l,g.child!=null&&this.calcInclusionTreeDepths(g.child,l+1)},t.prototype.includesInvalidEdge=function(){for(var i,l=this.edges.length,g=0;g<l;g++)if(i=this.edges[g],this.isOneAncestorOfOther(i.source,i.target))return!0;return!1},N.exports=t},function(N,I,T){var o=T(0);function e(){}for(var t in o)e[t]=o[t];e.MAX_ITERATIONS=2500,e.DEFAULT_EDGE_LENGTH=50,e.DEFAULT_SPRING_STRENGTH=.45,e.DEFAULT_REPULSION_STRENGTH=4500,e.DEFAULT_GRAVITY_STRENGTH=.4,e.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,e.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,e.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,e.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,e.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,e.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,e.COOLING_ADAPTATION_FACTOR=.33,e.ADAPTATION_LOWER_NODE_LIMIT=1e3,e.ADAPTATION_UPPER_NODE_LIMIT=5e3,e.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,e.MAX_NODE_DISPLACEMENT=e.MAX_NODE_DISPLACEMENT_INCREMENTAL*3,e.MIN_REPULSION_DIST=e.DEFAULT_EDGE_LENGTH/10,e.CONVERGENCE_CHECK_PERIOD=100,e.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,e.MIN_EDGE_LENGTH=1,e.GRID_CALCULATION_CHECK_PERIOD=10,N.exports=e},function(N,I,T){var o=T(12);function e(){}e.calcSeparationAmount=function(t,i,l,g){if(!t.intersects(i))throw"assert failed";var n=new Array(2);this.decideDirectionsForOverlappingNodes(t,i,n),l[0]=Math.min(t.getRight(),i.getRight())-Math.max(t.x,i.x),l[1]=Math.min(t.getBottom(),i.getBottom())-Math.max(t.y,i.y),t.getX()<=i.getX()&&t.getRight()>=i.getRight()?l[0]+=Math.min(i.getX()-t.getX(),t.getRight()-i.getRight()):i.getX()<=t.getX()&&i.getRight()>=t.getRight()&&(l[0]+=Math.min(t.getX()-i.getX(),i.getRight()-t.getRight())),t.getY()<=i.getY()&&t.getBottom()>=i.getBottom()?l[1]+=Math.min(i.getY()-t.getY(),t.getBottom()-i.getBottom()):i.getY()<=t.getY()&&i.getBottom()>=t.getBottom()&&(l[1]+=Math.min(t.getY()-i.getY(),i.getBottom()-t.getBottom()));var d=Math.abs((i.getCenterY()-t.getCenterY())/(i.getCenterX()-t.getCenterX()));i.getCenterY()===t.getCenterY()&&i.getCenterX()===t.getCenterX()&&(d=1);var r=d*l[0],h=l[1]/d;l[0]<h?h=l[0]:r=l[1],l[0]=-1*n[0]*(h/2+g),l[1]=-1*n[1]*(r/2+g)},e.decideDirectionsForOverlappingNodes=function(t,i,l){t.getCenterX()<i.getCenterX()?l[0]=-1:l[0]=1,t.getCenterY()<i.getCenterY()?l[1]=-1:l[1]=1},e.getIntersection2=function(t,i,l){var g=t.getCenterX(),n=t.getCenterY(),d=i.getCenterX(),r=i.getCenterY();if(t.intersects(i))return l[0]=g,l[1]=n,l[2]=d,l[3]=r,!0;var h=t.getX(),a=t.getY(),p=t.getRight(),v=t.getX(),D=t.getBottom(),u=t.getRight(),E=t.getWidthHalf(),y=t.getHeightHalf(),O=i.getX(),s=i.getY(),f=i.getRight(),c=i.getX(),L=i.getBottom(),A=i.getRight(),m=i.getWidthHalf(),R=i.getHeightHalf(),C=!1,M=!1;if(g===d){if(n>r)return l[0]=g,l[1]=a,l[2]=d,l[3]=L,!1;if(n<r)return l[0]=g,l[1]=D,l[2]=d,l[3]=s,!1}else if(n===r){if(g>d)return l[0]=h,l[1]=n,l[2]=f,l[3]=r,!1;if(g<d)return l[0]=p,l[1]=n,l[2]=O,l[3]=r,!1}else{var S=t.height/t.width,Y=i.height/i.width,w=(r-n)/(d-g),x=void 0,F=void 0,U=void 0,P=void 0,_=void 0,X=void 0;if(-S===w?g>d?(l[0]=v,l[1]=D,C=!0):(l[0]=p,l[1]=a,C=!0):S===w&&(g>d?(l[0]=h,l[1]=a,C=!0):(l[0]=u,l[1]=D,C=!0)),-Y===w?d>g?(l[2]=c,l[3]=L,M=!0):(l[2]=f,l[3]=s,M=!0):Y===w&&(d>g?(l[2]=O,l[3]=s,M=!0):(l[2]=A,l[3]=L,M=!0)),C&&M)return!1;if(g>d?n>r?(x=this.getCardinalDirection(S,w,4),F=this.getCardinalDirection(Y,w,2)):(x=this.getCardinalDirection(-S,w,3),F=this.getCardinalDirection(-Y,w,1)):n>r?(x=this.getCardinalDirection(-S,w,1),F=this.getCardinalDirection(-Y,w,3)):(x=this.getCardinalDirection(S,w,2),F=this.getCardinalDirection(Y,w,4)),!C)switch(x){case 1:P=a,U=g+-y/w,l[0]=U,l[1]=P;break;case 2:U=u,P=n+E*w,l[0]=U,l[1]=P;break;case 3:P=D,U=g+y/w,l[0]=U,l[1]=P;break;case 4:U=v,P=n+-E*w,l[0]=U,l[1]=P;break}if(!M)switch(F){case 1:X=s,_=d+-R/w,l[2]=_,l[3]=X;break;case 2:_=A,X=r+m*w,l[2]=_,l[3]=X;break;case 3:X=L,_=d+R/w,l[2]=_,l[3]=X;break;case 4:_=c,X=r+-m*w,l[2]=_,l[3]=X;break}}return!1},e.getCardinalDirection=function(t,i,l){return t>i?l:1+l%4},e.getIntersection=function(t,i,l,g){if(g==null)return this.getIntersection2(t,i,l);var n=t.x,d=t.y,r=i.x,h=i.y,a=l.x,p=l.y,v=g.x,D=g.y,u=void 0,E=void 0,y=void 0,O=void 0,s=void 0,f=void 0,c=void 0,L=void 0,A=void 0;return y=h-d,s=n-r,c=r*d-n*h,O=D-p,f=a-v,L=v*p-a*D,A=y*f-O*s,A===0?null:(u=(s*L-f*c)/A,E=(O*c-y*L)/A,new o(u,E))},e.angleOfVector=function(t,i,l,g){var n=void 0;return t!==l?(n=Math.atan((g-i)/(l-t)),l<t?n+=Math.PI:g<i&&(n+=this.TWO_PI)):g<i?n=this.ONE_AND_HALF_PI:n=this.HALF_PI,n},e.doIntersect=function(t,i,l,g){var n=t.x,d=t.y,r=i.x,h=i.y,a=l.x,p=l.y,v=g.x,D=g.y,u=(r-n)*(D-p)-(v-a)*(h-d);if(u===0)return!1;var E=((D-p)*(v-n)+(a-v)*(D-d))/u,y=((d-h)*(v-n)+(r-n)*(D-d))/u;return 0<E&&E<1&&0<y&&y<1},e.HALF_PI=.5*Math.PI,e.ONE_AND_HALF_PI=1.5*Math.PI,e.TWO_PI=2*Math.PI,e.THREE_PI=3*Math.PI,N.exports=e},function(N,I,T){function o(){}o.sign=function(e){return e>0?1:e<0?-1:0},o.floor=function(e){return e<0?Math.ceil(e):Math.floor(e)},o.ceil=function(e){return e<0?Math.floor(e):Math.ceil(e)},N.exports=o},function(N,I,T){function o(){}o.MAX_VALUE=2147483647,o.MIN_VALUE=-2147483648,N.exports=o},function(N,I,T){var o=function(){function n(d,r){for(var h=0;h<r.length;h++){var a=r[h];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(d,a.key,a)}}return function(d,r,h){return r&&n(d.prototype,r),h&&n(d,h),d}}();function e(n,d){if(!(n instanceof d))throw new TypeError("Cannot call a class as a function")}var t=function(d){return{value:d,next:null,prev:null}},i=function(d,r,h,a){return d!==null?d.next=r:a.head=r,h!==null?h.prev=r:a.tail=r,r.prev=d,r.next=h,a.length++,r},l=function(d,r){var h=d.prev,a=d.next;return h!==null?h.next=a:r.head=a,a!==null?a.prev=h:r.tail=h,d.prev=d.next=null,r.length--,d},g=function(){function n(d){var r=this;e(this,n),this.length=0,this.head=null,this.tail=null,d!=null&&d.forEach(function(h){return r.push(h)})}return o(n,[{key:"size",value:function(){return this.length}},{key:"insertBefore",value:function(r,h){return i(h.prev,t(r),h,this)}},{key:"insertAfter",value:function(r,h){return i(h,t(r),h.next,this)}},{key:"insertNodeBefore",value:function(r,h){return i(h.prev,r,h,this)}},{key:"insertNodeAfter",value:function(r,h){return i(h,r,h.next,this)}},{key:"push",value:function(r){return i(this.tail,t(r),null,this)}},{key:"unshift",value:function(r){return i(null,t(r),this.head,this)}},{key:"remove",value:function(r){return l(r,this)}},{key:"pop",value:function(){return l(this.tail,this).value}},{key:"popNode",value:function(){return l(this.tail,this)}},{key:"shift",value:function(){return l(this.head,this).value}},{key:"shiftNode",value:function(){return l(this.head,this)}},{key:"get_object_at",value:function(r){if(r<=this.length()){for(var h=1,a=this.head;h<r;)a=a.next,h++;return a.value}}},{key:"set_object_at",value:function(r,h){if(r<=this.length()){for(var a=1,p=this.head;a<r;)p=p.next,a++;p.value=h}}}]),n}();N.exports=g},function(N,I,T){function o(e,t,i){this.x=null,this.y=null,e==null&&t==null&&i==null?(this.x=0,this.y=0):typeof e=="number"&&typeof t=="number"&&i==null?(this.x=e,this.y=t):e.constructor.name=="Point"&&t==null&&i==null&&(i=e,this.x=i.x,this.y=i.y)}o.prototype.getX=function(){return this.x},o.prototype.getY=function(){return this.y},o.prototype.getLocation=function(){return new o(this.x,this.y)},o.prototype.setLocation=function(e,t,i){e.constructor.name=="Point"&&t==null&&i==null?(i=e,this.setLocation(i.x,i.y)):typeof e=="number"&&typeof t=="number"&&i==null&&(parseInt(e)==e&&parseInt(t)==t?this.move(e,t):(this.x=Math.floor(e+.5),this.y=Math.floor(t+.5)))},o.prototype.move=function(e,t){this.x=e,this.y=t},o.prototype.translate=function(e,t){this.x+=e,this.y+=t},o.prototype.equals=function(e){if(e.constructor.name=="Point"){var t=e;return this.x==t.x&&this.y==t.y}return this==e},o.prototype.toString=function(){return new o().constructor.name+"[x="+this.x+",y="+this.y+"]"},N.exports=o},function(N,I,T){function o(e,t,i,l){this.x=0,this.y=0,this.width=0,this.height=0,e!=null&&t!=null&&i!=null&&l!=null&&(this.x=e,this.y=t,this.width=i,this.height=l)}o.prototype.getX=function(){return this.x},o.prototype.setX=function(e){this.x=e},o.prototype.getY=function(){return this.y},o.prototype.setY=function(e){this.y=e},o.prototype.getWidth=function(){return this.width},o.prototype.setWidth=function(e){this.width=e},o.prototype.getHeight=function(){return this.height},o.prototype.setHeight=function(e){this.height=e},o.prototype.getRight=function(){return this.x+this.width},o.prototype.getBottom=function(){return this.y+this.height},o.prototype.intersects=function(e){return!(this.getRight()<e.x||this.getBottom()<e.y||e.getRight()<this.x||e.getBottom()<this.y)},o.prototype.getCenterX=function(){return this.x+this.width/2},o.prototype.getMinX=function(){return this.getX()},o.prototype.getMaxX=function(){return this.getX()+this.width},o.prototype.getCenterY=function(){return this.y+this.height/2},o.prototype.getMinY=function(){return this.getY()},o.prototype.getMaxY=function(){return this.getY()+this.height},o.prototype.getWidthHalf=function(){return this.width/2},o.prototype.getHeightHalf=function(){return this.height/2},N.exports=o},function(N,I,T){var o=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};function e(){}e.lastID=0,e.createID=function(t){return e.isPrimitive(t)?t:(t.uniqueID!=null||(t.uniqueID=e.getString(),e.lastID++),t.uniqueID)},e.getString=function(t){return t==null&&(t=e.lastID),"Object#"+t},e.isPrimitive=function(t){var i=typeof t>"u"?"undefined":o(t);return t==null||i!="object"&&i!="function"},N.exports=e},function(N,I,T){function o(a){if(Array.isArray(a)){for(var p=0,v=Array(a.length);p<a.length;p++)v[p]=a[p];return v}else return Array.from(a)}var e=T(0),t=T(6),i=T(3),l=T(1),g=T(5),n=T(4),d=T(17),r=T(27);function h(a){r.call(this),this.layoutQuality=e.QUALITY,this.createBendsAsNeeded=e.DEFAULT_CREATE_BENDS_AS_NEEDED,this.incremental=e.DEFAULT_INCREMENTAL,this.animationOnLayout=e.DEFAULT_ANIMATION_ON_LAYOUT,this.animationDuringLayout=e.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=e.DEFAULT_ANIMATION_PERIOD,this.uniformLeafNodeSizes=e.DEFAULT_UNIFORM_LEAF_NODE_SIZES,this.edgeToDummyNodes=new Map,this.graphManager=new t(this),this.isLayoutFinished=!1,this.isSubLayout=!1,this.isRemoteUse=!1,a!=null&&(this.isRemoteUse=a)}h.RANDOM_SEED=1,h.prototype=Object.create(r.prototype),h.prototype.getGraphManager=function(){return this.graphManager},h.prototype.getAllNodes=function(){return this.graphManager.getAllNodes()},h.prototype.getAllEdges=function(){return this.graphManager.getAllEdges()},h.prototype.getAllNodesToApplyGravitation=function(){return this.graphManager.getAllNodesToApplyGravitation()},h.prototype.newGraphManager=function(){var a=new t(this);return this.graphManager=a,a},h.prototype.newGraph=function(a){return new g(null,this.graphManager,a)},h.prototype.newNode=function(a){return new i(this.graphManager,a)},h.prototype.newEdge=function(a){return new l(null,null,a)},h.prototype.checkLayoutSuccess=function(){return this.graphManager.getRoot()==null||this.graphManager.getRoot().getNodes().length==0||this.graphManager.includesInvalidEdge()},h.prototype.runLayout=function(){this.isLayoutFinished=!1,this.tilingPreLayout&&this.tilingPreLayout(),this.initParameters();var a;return this.checkLayoutSuccess()?a=!1:a=this.layout(),e.ANIMATE==="during"?!1:(a&&(this.isSubLayout||this.doPostLayout()),this.tilingPostLayout&&this.tilingPostLayout(),this.isLayoutFinished=!0,a)},h.prototype.doPostLayout=function(){this.incremental||this.transform(),this.update()},h.prototype.update2=function(){if(this.createBendsAsNeeded&&(this.createBendpointsFromDummyNodes(),this.graphManager.resetAllEdges()),!this.isRemoteUse){for(var a=this.graphManager.getAllEdges(),p=0;p<a.length;p++)a[p];for(var v=this.graphManager.getRoot().getNodes(),p=0;p<v.length;p++)v[p];this.update(this.graphManager.getRoot())}},h.prototype.update=function(a){if(a==null)this.update2();else if(a instanceof i){var p=a;if(p.getChild()!=null)for(var v=p.getChild().getNodes(),D=0;D<v.length;D++)update(v[D]);if(p.vGraphObject!=null){var u=p.vGraphObject;u.update(p)}}else if(a instanceof l){var E=a;if(E.vGraphObject!=null){var y=E.vGraphObject;y.update(E)}}else if(a instanceof g){var O=a;if(O.vGraphObject!=null){var s=O.vGraphObject;s.update(O)}}},h.prototype.initParameters=function(){this.isSubLayout||(this.layoutQuality=e.QUALITY,this.animationDuringLayout=e.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=e.DEFAULT_ANIMATION_PERIOD,this.animationOnLayout=e.DEFAULT_ANIMATION_ON_LAYOUT,this.incremental=e.DEFAULT_INCREMENTAL,this.createBendsAsNeeded=e.DEFAULT_CREATE_BENDS_AS_NEEDED,this.uniformLeafNodeSizes=e.DEFAULT_UNIFORM_LEAF_NODE_SIZES),this.animationDuringLayout&&(this.animationOnLayout=!1)},h.prototype.transform=function(a){if(a==null)this.transform(new n(0,0));else{var p=new d,v=this.graphManager.getRoot().updateLeftTop();if(v!=null){p.setWorldOrgX(a.x),p.setWorldOrgY(a.y),p.setDeviceOrgX(v.x),p.setDeviceOrgY(v.y);for(var D=this.getAllNodes(),u,E=0;E<D.length;E++)u=D[E],u.transform(p)}}},h.prototype.positionNodesRandomly=function(a){if(a==null)this.positionNodesRandomly(this.getGraphManager().getRoot()),this.getGraphManager().getRoot().updateBounds(!0);else for(var p,v,D=a.getNodes(),u=0;u<D.length;u++)p=D[u],v=p.getChild(),v==null||v.getNodes().length==0?p.scatter():(this.positionNodesRandomly(v),p.updateBounds())},h.prototype.getFlatForest=function(){for(var a=[],p=!0,v=this.graphManager.getRoot().getNodes(),D=!0,u=0;u<v.length;u++)v[u].getChild()!=null&&(D=!1);if(!D)return a;var E=new Set,y=[],O=new Map,s=[];for(s=s.concat(v);s.length>0&&p;){for(y.push(s[0]);y.length>0&&p;){var f=y[0];y.splice(0,1),E.add(f);for(var c=f.getEdges(),u=0;u<c.length;u++){var L=c[u].getOtherEnd(f);if(O.get(f)!=L)if(!E.has(L))y.push(L),O.set(L,f);else{p=!1;break}}}if(!p)a=[];else{var A=[].concat(o(E));a.push(A);for(var u=0;u<A.length;u++){var m=A[u],R=s.indexOf(m);R>-1&&s.splice(R,1)}E=new Set,O=new Map}}return a},h.prototype.createDummyNodesForBendpoints=function(a){for(var p=[],v=a.source,D=this.graphManager.calcLowestCommonAncestor(a.source,a.target),u=0;u<a.bendpoints.length;u++){var E=this.newNode(null);E.setRect(new Point(0,0),new Dimension(1,1)),D.add(E);var y=this.newEdge(null);this.graphManager.add(y,v,E),p.add(E),v=E}var y=this.newEdge(null);return this.graphManager.add(y,v,a.target),this.edgeToDummyNodes.set(a,p),a.isInterGraph()?this.graphManager.remove(a):D.remove(a),p},h.prototype.createBendpointsFromDummyNodes=function(){var a=[];a=a.concat(this.graphManager.getAllEdges()),a=[].concat(o(this.edgeToDummyNodes.keys())).concat(a);for(var p=0;p<a.length;p++){var v=a[p];if(v.bendpoints.length>0){for(var D=this.edgeToDummyNodes.get(v),u=0;u<D.length;u++){var E=D[u],y=new n(E.getCenterX(),E.getCenterY()),O=v.bendpoints.get(u);O.x=y.x,O.y=y.y,E.getOwner().remove(E)}this.graphManager.add(v,v.source,v.target)}}},h.transform=function(a,p,v,D){if(v!=null&&D!=null){var u=p;if(a<=50){var E=p/v;u-=(p-E)/50*(50-a)}else{var y=p*D;u+=(y-p)/50*(a-50)}return u}else{var O,s;return a<=50?(O=9*p/500,s=p/10):(O=9*p/50,s=-8*p),O*a+s}},h.findCenterOfTree=function(a){var p=[];p=p.concat(a);var v=[],D=new Map,u=!1,E=null;(p.length==1||p.length==2)&&(u=!0,E=p[0]);for(var y=0;y<p.length;y++){var O=p[y],s=O.getNeighborsList().size;D.set(O,O.getNeighborsList().size),s==1&&v.push(O)}var f=[];for(f=f.concat(v);!u;){var c=[];c=c.concat(f),f=[];for(var y=0;y<p.length;y++){var O=p[y],L=p.indexOf(O);L>=0&&p.splice(L,1);var A=O.getNeighborsList();A.forEach(function(C){if(v.indexOf(C)<0){var M=D.get(C),S=M-1;S==1&&f.push(C),D.set(C,S)}})}v=v.concat(f),(p.length==1||p.length==2)&&(u=!0,E=p[0])}return E},h.prototype.setGraphManager=function(a){this.graphManager=a},N.exports=h},function(N,I,T){function o(){}o.seed=1,o.x=0,o.nextDouble=function(){return o.x=Math.sin(o.seed++)*1e4,o.x-Math.floor(o.x)},N.exports=o},function(N,I,T){var o=T(4);function e(t,i){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}e.prototype.getWorldOrgX=function(){return this.lworldOrgX},e.prototype.setWorldOrgX=function(t){this.lworldOrgX=t},e.prototype.getWorldOrgY=function(){return this.lworldOrgY},e.prototype.setWorldOrgY=function(t){this.lworldOrgY=t},e.prototype.getWorldExtX=function(){return this.lworldExtX},e.prototype.setWorldExtX=function(t){this.lworldExtX=t},e.prototype.getWorldExtY=function(){return this.lworldExtY},e.prototype.setWorldExtY=function(t){this.lworldExtY=t},e.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},e.prototype.setDeviceOrgX=function(t){this.ldeviceOrgX=t},e.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},e.prototype.setDeviceOrgY=function(t){this.ldeviceOrgY=t},e.prototype.getDeviceExtX=function(){return this.ldeviceExtX},e.prototype.setDeviceExtX=function(t){this.ldeviceExtX=t},e.prototype.getDeviceExtY=function(){return this.ldeviceExtY},e.prototype.setDeviceExtY=function(t){this.ldeviceExtY=t},e.prototype.transformX=function(t){var i=0,l=this.lworldExtX;return l!=0&&(i=this.ldeviceOrgX+(t-this.lworldOrgX)*this.ldeviceExtX/l),i},e.prototype.transformY=function(t){var i=0,l=this.lworldExtY;return l!=0&&(i=this.ldeviceOrgY+(t-this.lworldOrgY)*this.ldeviceExtY/l),i},e.prototype.inverseTransformX=function(t){var i=0,l=this.ldeviceExtX;return l!=0&&(i=this.lworldOrgX+(t-this.ldeviceOrgX)*this.lworldExtX/l),i},e.prototype.inverseTransformY=function(t){var i=0,l=this.ldeviceExtY;return l!=0&&(i=this.lworldOrgY+(t-this.ldeviceOrgY)*this.lworldExtY/l),i},e.prototype.inverseTransformPoint=function(t){var i=new o(this.inverseTransformX(t.x),this.inverseTransformY(t.y));return i},N.exports=e},function(N,I,T){function o(r){if(Array.isArray(r)){for(var h=0,a=Array(r.length);h<r.length;h++)a[h]=r[h];return a}else return Array.from(r)}var e=T(15),t=T(7),i=T(0),l=T(8),g=T(9);function n(){e.call(this),this.useSmartIdealEdgeLengthCalculation=t.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.idealEdgeLength=t.DEFAULT_EDGE_LENGTH,this.springConstant=t.DEFAULT_SPRING_STRENGTH,this.repulsionConstant=t.DEFAULT_REPULSION_STRENGTH,this.gravityConstant=t.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=t.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=t.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=t.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.displacementThresholdPerNode=3*t.DEFAULT_EDGE_LENGTH/100,this.coolingFactor=t.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.initialCoolingFactor=t.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.totalDisplacement=0,this.oldTotalDisplacement=0,this.maxIterations=t.MAX_ITERATIONS}n.prototype=Object.create(e.prototype);for(var d in e)n[d]=e[d];n.prototype.initParameters=function(){e.prototype.initParameters.call(this,arguments),this.totalIterations=0,this.notAnimatedIterations=0,this.useFRGridVariant=t.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION,this.grid=[]},n.prototype.calcIdealEdgeLengths=function(){for(var r,h,a,p,v,D,u=this.getGraphManager().getAllEdges(),E=0;E<u.length;E++)r=u[E],r.idealLength=this.idealEdgeLength,r.isInterGraph&&(a=r.getSource(),p=r.getTarget(),v=r.getSourceInLca().getEstimatedSize(),D=r.getTargetInLca().getEstimatedSize(),this.useSmartIdealEdgeLengthCalculation&&(r.idealLength+=v+D-2*i.SIMPLE_NODE_SIZE),h=r.getLca().getInclusionTreeDepth(),r.idealLength+=t.DEFAULT_EDGE_LENGTH*t.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR*(a.getInclusionTreeDepth()+p.getInclusionTreeDepth()-2*h))},n.prototype.initSpringEmbedder=function(){var r=this.getAllNodes().length;this.incremental?(r>t.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*t.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(r-t.ADAPTATION_LOWER_NODE_LIMIT)/(t.ADAPTATION_UPPER_NODE_LIMIT-t.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-t.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=t.MAX_NODE_DISPLACEMENT_INCREMENTAL):(r>t.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(t.COOLING_ADAPTATION_FACTOR,1-(r-t.ADAPTATION_LOWER_NODE_LIMIT)/(t.ADAPTATION_UPPER_NODE_LIMIT-t.ADAPTATION_LOWER_NODE_LIMIT)*(1-t.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=t.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},n.prototype.calcSpringForces=function(){for(var r=this.getAllEdges(),h,a=0;a<r.length;a++)h=r[a],this.calcSpringForce(h,h.idealLength)},n.prototype.calcRepulsionForces=function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,a,p,v,D,u=this.getAllNodes(),E;if(this.useFRGridVariant)for(this.totalIterations%t.GRID_CALCULATION_CHECK_PERIOD==1&&r&&this.updateGrid(),E=new Set,a=0;a<u.length;a++)v=u[a],this.calculateRepulsionForceOfANode(v,E,r,h),E.add(v);else for(a=0;a<u.length;a++)for(v=u[a],p=a+1;p<u.length;p++)D=u[p],v.getOwner()==D.getOwner()&&this.calcRepulsionForce(v,D)},n.prototype.calcGravitationalForces=function(){for(var r,h=this.getAllNodesToApplyGravitation(),a=0;a<h.length;a++)r=h[a],this.calcGravitationalForce(r)},n.prototype.moveNodes=function(){for(var r=this.getAllNodes(),h,a=0;a<r.length;a++)h=r[a],h.move()},n.prototype.calcSpringForce=function(r,h){var a=r.getSource(),p=r.getTarget(),v,D,u,E;if(this.uniformLeafNodeSizes&&a.getChild()==null&&p.getChild()==null)r.updateLengthSimple();else if(r.updateLength(),r.isOverlapingSourceAndTarget)return;v=r.getLength(),v!=0&&(D=this.springConstant*(v-h),u=D*(r.lengthX/v),E=D*(r.lengthY/v),a.springForceX+=u,a.springForceY+=E,p.springForceX-=u,p.springForceY-=E)},n.prototype.calcRepulsionForce=function(r,h){var a=r.getRect(),p=h.getRect(),v=new Array(2),D=new Array(4),u,E,y,O,s,f,c;if(a.intersects(p)){l.calcSeparationAmount(a,p,v,t.DEFAULT_EDGE_LENGTH/2),f=2*v[0],c=2*v[1];var L=r.noOfChildren*h.noOfChildren/(r.noOfChildren+h.noOfChildren);r.repulsionForceX-=L*f,r.repulsionForceY-=L*c,h.repulsionForceX+=L*f,h.repulsionForceY+=L*c}else this.uniformLeafNodeSizes&&r.getChild()==null&&h.getChild()==null?(u=p.getCenterX()-a.getCenterX(),E=p.getCenterY()-a.getCenterY()):(l.getIntersection(a,p,D),u=D[2]-D[0],E=D[3]-D[1]),Math.abs(u)<t.MIN_REPULSION_DIST&&(u=g.sign(u)*t.MIN_REPULSION_DIST),Math.abs(E)<t.MIN_REPULSION_DIST&&(E=g.sign(E)*t.MIN_REPULSION_DIST),y=u*u+E*E,O=Math.sqrt(y),s=this.repulsionConstant*r.noOfChildren*h.noOfChildren/y,f=s*u/O,c=s*E/O,r.repulsionForceX-=f,r.repulsionForceY-=c,h.repulsionForceX+=f,h.repulsionForceY+=c},n.prototype.calcGravitationalForce=function(r){var h,a,p,v,D,u,E,y;h=r.getOwner(),a=(h.getRight()+h.getLeft())/2,p=(h.getTop()+h.getBottom())/2,v=r.getCenterX()-a,D=r.getCenterY()-p,u=Math.abs(v)+r.getWidth()/2,E=Math.abs(D)+r.getHeight()/2,r.getOwner()==this.graphManager.getRoot()?(y=h.getEstimatedSize()*this.gravityRangeFactor,(u>y||E>y)&&(r.gravitationForceX=-this.gravityConstant*v,r.gravitationForceY=-this.gravityConstant*D)):(y=h.getEstimatedSize()*this.compoundGravityRangeFactor,(u>y||E>y)&&(r.gravitationForceX=-this.gravityConstant*v*this.compoundGravityConstant,r.gravitationForceY=-this.gravityConstant*D*this.compoundGravityConstant))},n.prototype.isConverged=function(){var r,h=!1;return this.totalIterations>this.maxIterations/3&&(h=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),r=this.totalDisplacement<this.totalDisplacementThreshold,this.oldTotalDisplacement=this.totalDisplacement,r||h},n.prototype.animate=function(){this.animationDuringLayout&&!this.isSubLayout&&(this.notAnimatedIterations==this.animationPeriod?(this.update(),this.notAnimatedIterations=0):this.notAnimatedIterations++)},n.prototype.calcNoOfChildrenForAllNodes=function(){for(var r,h=this.graphManager.getAllNodes(),a=0;a<h.length;a++)r=h[a],r.noOfChildren=r.getNoOfChildren()},n.prototype.calcGrid=function(r){var h=0,a=0;h=parseInt(Math.ceil((r.getRight()-r.getLeft())/this.repulsionRange)),a=parseInt(Math.ceil((r.getBottom()-r.getTop())/this.repulsionRange));for(var p=new Array(h),v=0;v<h;v++)p[v]=new Array(a);for(var v=0;v<h;v++)for(var D=0;D<a;D++)p[v][D]=new Array;return p},n.prototype.addNodeToGrid=function(r,h,a){var p=0,v=0,D=0,u=0;p=parseInt(Math.floor((r.getRect().x-h)/this.repulsionRange)),v=parseInt(Math.floor((r.getRect().width+r.getRect().x-h)/this.repulsionRange)),D=parseInt(Math.floor((r.getRect().y-a)/this.repulsionRange)),u=parseInt(Math.floor((r.getRect().height+r.getRect().y-a)/this.repulsionRange));for(var E=p;E<=v;E++)for(var y=D;y<=u;y++)this.grid[E][y].push(r),r.setGridCoordinates(p,v,D,u)},n.prototype.updateGrid=function(){var r,h,a=this.getAllNodes();for(this.grid=this.calcGrid(this.graphManager.getRoot()),r=0;r<a.length;r++)h=a[r],this.addNodeToGrid(h,this.graphManager.getRoot().getLeft(),this.graphManager.getRoot().getTop())},n.prototype.calculateRepulsionForceOfANode=function(r,h,a,p){if(this.totalIterations%t.GRID_CALCULATION_CHECK_PERIOD==1&&a||p){var v=new Set;r.surrounding=new Array;for(var D,u=this.grid,E=r.startX-1;E<r.finishX+2;E++)for(var y=r.startY-1;y<r.finishY+2;y++)if(!(E<0||y<0||E>=u.length||y>=u[0].length)){for(var O=0;O<u[E][y].length;O++)if(D=u[E][y][O],!(r.getOwner()!=D.getOwner()||r==D)&&!h.has(D)&&!v.has(D)){var s=Math.abs(r.getCenterX()-D.getCenterX())-(r.getWidth()/2+D.getWidth()/2),f=Math.abs(r.getCenterY()-D.getCenterY())-(r.getHeight()/2+D.getHeight()/2);s<=this.repulsionRange&&f<=this.repulsionRange&&v.add(D)}}r.surrounding=[].concat(o(v))}for(E=0;E<r.surrounding.length;E++)this.calcRepulsionForce(r,r.surrounding[E])},n.prototype.calcRepulsionRange=function(){return 0},N.exports=n},function(N,I,T){var o=T(1),e=T(7);function t(l,g,n){o.call(this,l,g,n),this.idealLength=e.DEFAULT_EDGE_LENGTH}t.prototype=Object.create(o.prototype);for(var i in o)t[i]=o[i];N.exports=t},function(N,I,T){var o=T(3);function e(i,l,g,n){o.call(this,i,l,g,n),this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0,this.startX=0,this.finishX=0,this.startY=0,this.finishY=0,this.surrounding=[]}e.prototype=Object.create(o.prototype);for(var t in o)e[t]=o[t];e.prototype.setGridCoordinates=function(i,l,g,n){this.startX=i,this.finishX=l,this.startY=g,this.finishY=n},N.exports=e},function(N,I,T){function o(e,t){this.width=0,this.height=0,e!==null&&t!==null&&(this.height=t,this.width=e)}o.prototype.getWidth=function(){return this.width},o.prototype.setWidth=function(e){this.width=e},o.prototype.getHeight=function(){return this.height},o.prototype.setHeight=function(e){this.height=e},N.exports=o},function(N,I,T){var o=T(14);function e(){this.map={},this.keys=[]}e.prototype.put=function(t,i){var l=o.createID(t);this.contains(l)||(this.map[l]=i,this.keys.push(t))},e.prototype.contains=function(t){return o.createID(t),this.map[t]!=null},e.prototype.get=function(t){var i=o.createID(t);return this.map[i]},e.prototype.keySet=function(){return this.keys},N.exports=e},function(N,I,T){var o=T(14);function e(){this.set={}}e.prototype.add=function(t){var i=o.createID(t);this.contains(i)||(this.set[i]=t)},e.prototype.remove=function(t){delete this.set[o.createID(t)]},e.prototype.clear=function(){this.set={}},e.prototype.contains=function(t){return this.set[o.createID(t)]==t},e.prototype.isEmpty=function(){return this.size()===0},e.prototype.size=function(){return Object.keys(this.set).length},e.prototype.addAllTo=function(t){for(var i=Object.keys(this.set),l=i.length,g=0;g<l;g++)t.push(this.set[i[g]])},e.prototype.size=function(){return Object.keys(this.set).length},e.prototype.addAll=function(t){for(var i=t.length,l=0;l<i;l++){var g=t[l];this.add(g)}},N.exports=e},function(N,I,T){var o=function(){function l(g,n){for(var d=0;d<n.length;d++){var r=n[d];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(g,r.key,r)}}return function(g,n,d){return n&&l(g.prototype,n),d&&l(g,d),g}}();function e(l,g){if(!(l instanceof g))throw new TypeError("Cannot call a class as a function")}var t=T(11),i=function(){function l(g,n){e(this,l),(n!==null||n!==void 0)&&(this.compareFunction=this._defaultCompareFunction);var d=void 0;g instanceof t?d=g.size():d=g.length,this._quicksort(g,0,d-1)}return o(l,[{key:"_quicksort",value:function(n,d,r){if(d<r){var h=this._partition(n,d,r);this._quicksort(n,d,h),this._quicksort(n,h+1,r)}}},{key:"_partition",value:function(n,d,r){for(var h=this._get(n,d),a=d,p=r;;){for(;this.compareFunction(h,this._get(n,p));)p--;for(;this.compareFunction(this._get(n,a),h);)a++;if(a<p)this._swap(n,a,p),a++,p--;else return p}}},{key:"_get",value:function(n,d){return n instanceof t?n.get_object_at(d):n[d]}},{key:"_set",value:function(n,d,r){n instanceof t?n.set_object_at(d,r):n[d]=r}},{key:"_swap",value:function(n,d,r){var h=this._get(n,d);this._set(n,d,this._get(n,r)),this._set(n,r,h)}},{key:"_defaultCompareFunction",value:function(n,d){return d>n}}]),l}();N.exports=i},function(N,I,T){var o=function(){function i(l,g){for(var n=0;n<g.length;n++){var d=g[n];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(l,d.key,d)}}return function(l,g,n){return g&&i(l.prototype,g),n&&i(l,n),l}}();function e(i,l){if(!(i instanceof l))throw new TypeError("Cannot call a class as a function")}var t=function(){function i(l,g){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,d=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,r=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;e(this,i),this.sequence1=l,this.sequence2=g,this.match_score=n,this.mismatch_penalty=d,this.gap_penalty=r,this.iMax=l.length+1,this.jMax=g.length+1,this.grid=new Array(this.iMax);for(var h=0;h<this.iMax;h++){this.grid[h]=new Array(this.jMax);for(var a=0;a<this.jMax;a++)this.grid[h][a]=0}this.tracebackGrid=new Array(this.iMax);for(var p=0;p<this.iMax;p++){this.tracebackGrid[p]=new Array(this.jMax);for(var v=0;v<this.jMax;v++)this.tracebackGrid[p][v]=[null,null,null]}this.alignments=[],this.score=-1,this.computeGrids()}return o(i,[{key:"getScore",value:function(){return this.score}},{key:"getAlignments",value:function(){return this.alignments}},{key:"computeGrids",value:function(){for(var g=1;g<this.jMax;g++)this.grid[0][g]=this.grid[0][g-1]+this.gap_penalty,this.tracebackGrid[0][g]=[!1,!1,!0];for(var n=1;n<this.iMax;n++)this.grid[n][0]=this.grid[n-1][0]+this.gap_penalty,this.tracebackGrid[n][0]=[!1,!0,!1];for(var d=1;d<this.iMax;d++)for(var r=1;r<this.jMax;r++){var h=void 0;this.sequence1[d-1]===this.sequence2[r-1]?h=this.grid[d-1][r-1]+this.match_score:h=this.grid[d-1][r-1]+this.mismatch_penalty;var a=this.grid[d-1][r]+this.gap_penalty,p=this.grid[d][r-1]+this.gap_penalty,v=[h,a,p],D=this.arrayAllMaxIndexes(v);this.grid[d][r]=v[D[0]],this.tracebackGrid[d][r]=[D.includes(0),D.includes(1),D.includes(2)]}this.score=this.grid[this.iMax-1][this.jMax-1]}},{key:"alignmentTraceback",value:function(){var g=[];for(g.push({pos:[this.sequence1.length,this.sequence2.length],seq1:"",seq2:""});g[0];){var n=g[0],d=this.tracebackGrid[n.pos[0]][n.pos[1]];d[0]&&g.push({pos:[n.pos[0]-1,n.pos[1]-1],seq1:this.sequence1[n.pos[0]-1]+n.seq1,seq2:this.sequence2[n.pos[1]-1]+n.seq2}),d[1]&&g.push({pos:[n.pos[0]-1,n.pos[1]],seq1:this.sequence1[n.pos[0]-1]+n.seq1,seq2:"-"+n.seq2}),d[2]&&g.push({pos:[n.pos[0],n.pos[1]-1],seq1:"-"+n.seq1,seq2:this.sequence2[n.pos[1]-1]+n.seq2}),n.pos[0]===0&&n.pos[1]===0&&this.alignments.push({sequence1:n.seq1,sequence2:n.seq2}),g.shift()}return this.alignments}},{key:"getAllIndexes",value:function(g,n){for(var d=[],r=-1;(r=g.indexOf(n,r+1))!==-1;)d.push(r);return d}},{key:"arrayAllMaxIndexes",value:function(g){return this.getAllIndexes(g,Math.max.apply(null,g))}}]),i}();N.exports=t},function(N,I,T){var o=function(){};o.FDLayout=T(18),o.FDLayoutConstants=T(7),o.FDLayoutEdge=T(19),o.FDLayoutNode=T(20),o.DimensionD=T(21),o.HashMap=T(22),o.HashSet=T(23),o.IGeometry=T(8),o.IMath=T(9),o.Integer=T(10),o.Point=T(12),o.PointD=T(4),o.RandomSeed=T(16),o.RectangleD=T(13),o.Transform=T(17),o.UniqueIDGeneretor=T(14),o.Quicksort=T(24),o.LinkedList=T(11),o.LGraphObject=T(2),o.LGraph=T(5),o.LEdge=T(1),o.LGraphManager=T(6),o.LNode=T(3),o.Layout=T(15),o.LayoutConstants=T(0),o.NeedlemanWunsch=T(25),N.exports=o},function(N,I,T){function o(){this.listeners=[]}var e=o.prototype;e.addListener=function(t,i){this.listeners.push({event:t,callback:i})},e.removeListener=function(t,i){for(var l=this.listeners.length;l>=0;l--){var g=this.listeners[l];g.event===t&&g.callback===i&&this.listeners.splice(l,1)}},e.emit=function(t,i){for(var l=0;l<this.listeners.length;l++){var g=this.listeners[l];t===g.event&&g.callback(i)}},N.exports=o}])})}(Q)),Q.exports}var z;function ft(){return z||(z=1,function(G,b){(function(I,T){G.exports=T(ut())})($,function(N){return function(I){var T={};function o(e){if(T[e])return T[e].exports;var t=T[e]={i:e,l:!1,exports:{}};return I[e].call(t.exports,t,t.exports,o),t.l=!0,t.exports}return o.m=I,o.c=T,o.i=function(e){return e},o.d=function(e,t,i){o.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:i})},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o(o.s=7)}([function(I,T){I.exports=N},function(I,T,o){var e=o(0).FDLayoutConstants;function t(){}for(var i in e)t[i]=e[i];t.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,t.DEFAULT_RADIAL_SEPARATION=e.DEFAULT_EDGE_LENGTH,t.DEFAULT_COMPONENT_SEPERATION=60,t.TILE=!0,t.TILING_PADDING_VERTICAL=10,t.TILING_PADDING_HORIZONTAL=10,t.TREE_REDUCTION_ON_INCREMENTAL=!1,I.exports=t},function(I,T,o){var e=o(0).FDLayoutEdge;function t(l,g,n){e.call(this,l,g,n)}t.prototype=Object.create(e.prototype);for(var i in e)t[i]=e[i];I.exports=t},function(I,T,o){var e=o(0).LGraph;function t(l,g,n){e.call(this,l,g,n)}t.prototype=Object.create(e.prototype);for(var i in e)t[i]=e[i];I.exports=t},function(I,T,o){var e=o(0).LGraphManager;function t(l){e.call(this,l)}t.prototype=Object.create(e.prototype);for(var i in e)t[i]=e[i];I.exports=t},function(I,T,o){var e=o(0).FDLayoutNode,t=o(0).IMath;function i(g,n,d,r){e.call(this,g,n,d,r)}i.prototype=Object.create(e.prototype);for(var l in e)i[l]=e[l];i.prototype.move=function(){var g=this.graphManager.getLayout();this.displacementX=g.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY=g.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren,Math.abs(this.displacementX)>g.coolingFactor*g.maxNodeDisplacement&&(this.displacementX=g.coolingFactor*g.maxNodeDisplacement*t.sign(this.displacementX)),Math.abs(this.displacementY)>g.coolingFactor*g.maxNodeDisplacement&&(this.displacementY=g.coolingFactor*g.maxNodeDisplacement*t.sign(this.displacementY)),this.child==null?this.moveBy(this.displacementX,this.displacementY):this.child.getNodes().length==0?this.moveBy(this.displacementX,this.displacementY):this.propogateDisplacementToChildren(this.displacementX,this.displacementY),g.totalDisplacement+=Math.abs(this.displacementX)+Math.abs(this.displacementY),this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0},i.prototype.propogateDisplacementToChildren=function(g,n){for(var d=this.getChild().getNodes(),r,h=0;h<d.length;h++)r=d[h],r.getChild()==null?(r.moveBy(g,n),r.displacementX+=g,r.displacementY+=n):r.propogateDisplacementToChildren(g,n)},i.prototype.setPred1=function(g){this.pred1=g},i.prototype.getPred1=function(){return pred1},i.prototype.getPred2=function(){return pred2},i.prototype.setNext=function(g){this.next=g},i.prototype.getNext=function(){return next},i.prototype.setProcessed=function(g){this.processed=g},i.prototype.isProcessed=function(){return processed},I.exports=i},function(I,T,o){var e=o(0).FDLayout,t=o(4),i=o(3),l=o(5),g=o(2),n=o(1),d=o(0).FDLayoutConstants,r=o(0).LayoutConstants,h=o(0).Point,a=o(0).PointD,p=o(0).Layout,v=o(0).Integer,D=o(0).IGeometry,u=o(0).LGraph,E=o(0).Transform;function y(){e.call(this),this.toBeTiled={}}y.prototype=Object.create(e.prototype);for(var O in e)y[O]=e[O];y.prototype.newGraphManager=function(){var s=new t(this);return this.graphManager=s,s},y.prototype.newGraph=function(s){return new i(null,this.graphManager,s)},y.prototype.newNode=function(s){return new l(this.graphManager,s)},y.prototype.newEdge=function(s){return new g(null,null,s)},y.prototype.initParameters=function(){e.prototype.initParameters.call(this,arguments),this.isSubLayout||(n.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=n.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=n.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.springConstant=d.DEFAULT_SPRING_STRENGTH,this.repulsionConstant=d.DEFAULT_REPULSION_STRENGTH,this.gravityConstant=d.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=d.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=d.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=d.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1,this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/d.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=d.CONVERGENCE_CHECK_PERIOD/this.maxIterations,this.coolingAdjuster=1)},y.prototype.layout=function(){var s=r.DEFAULT_CREATE_BENDS_AS_NEEDED;return s&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},y.prototype.classicLayout=function(){if(this.nodesWithGravity=this.calculateNodesToApplyGravitationTo(),this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity),this.calcNoOfChildrenForAllNodes(),this.graphManager.calcLowestCommonAncestors(),this.graphManager.calcInclusionTreeDepths(),this.graphManager.getRoot().calcEstimatedSize(),this.calcIdealEdgeLengths(),this.incremental){if(n.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var f=new Set(this.getAllNodes()),c=this.nodesWithGravity.filter(function(m){return f.has(m)});this.graphManager.setAllNodesToApplyGravitation(c)}}else{var s=this.getFlatForest();if(s.length>0)this.positionNodesRadially(s);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var f=new Set(this.getAllNodes()),c=this.nodesWithGravity.filter(function(L){return f.has(L)});this.graphManager.setAllNodesToApplyGravitation(c),this.positionNodesRandomly()}}return this.initSpringEmbedder(),this.runSpringEmbedder(),!0},y.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.totalIterations%d.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;this.coolingCycle++,this.layoutQuality==0?this.coolingAdjuster=this.coolingCycle:this.layoutQuality==1&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var s=new Set(this.getAllNodes()),f=this.nodesWithGravity.filter(function(A){return s.has(A)});this.graphManager.setAllNodesToApplyGravitation(f),this.graphManager.updateBounds(),this.updateGrid(),this.coolingFactor=d.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),this.coolingFactor=d.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var c=!this.isTreeGrowing&&!this.isGrowthFinished,L=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(c,L),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},y.prototype.getPositionsData=function(){for(var s=this.graphManager.getAllNodes(),f={},c=0;c<s.length;c++){var L=s[c].rect,A=s[c].id;f[A]={id:A,x:L.getCenterX(),y:L.getCenterY(),w:L.width,h:L.height}}return f},y.prototype.runSpringEmbedder=function(){this.initialAnimationPeriod=25,this.animationPeriod=this.initialAnimationPeriod;var s=!1;if(d.ANIMATE==="during")this.emit("layoutstarted");else{for(;!s;)s=this.tick();this.graphManager.updateBounds()}},y.prototype.calculateNodesToApplyGravitationTo=function(){var s=[],f,c=this.graphManager.getGraphs(),L=c.length,A;for(A=0;A<L;A++)f=c[A],f.updateConnected(),f.isConnected||(s=s.concat(f.getNodes()));return s},y.prototype.createBendpoints=function(){var s=[];s=s.concat(this.graphManager.getAllEdges());var f=new Set,c;for(c=0;c<s.length;c++){var L=s[c];if(!f.has(L)){var A=L.getSource(),m=L.getTarget();if(A==m)L.getBendpoints().push(new a),L.getBendpoints().push(new a),this.createDummyNodesForBendpoints(L),f.add(L);else{var R=[];if(R=R.concat(A.getEdgeListToNode(m)),R=R.concat(m.getEdgeListToNode(A)),!f.has(R[0])){if(R.length>1){var C;for(C=0;C<R.length;C++){var M=R[C];M.getBendpoints().push(new a),this.createDummyNodesForBendpoints(M)}}R.forEach(function(S){f.add(S)})}}}if(f.size==s.length)break}},y.prototype.positionNodesRadially=function(s){for(var f=new h(0,0),c=Math.ceil(Math.sqrt(s.length)),L=0,A=0,m=0,R=new a(0,0),C=0;C<s.length;C++){C%c==0&&(m=0,A=L,C!=0&&(A+=n.DEFAULT_COMPONENT_SEPERATION),L=0);var M=s[C],S=p.findCenterOfTree(M);f.x=m,f.y=A,R=y.radialLayout(M,S,f),R.y>L&&(L=Math.floor(R.y)),m=Math.floor(R.x+n.DEFAULT_COMPONENT_SEPERATION)}this.transform(new a(r.WORLD_CENTER_X-R.x/2,r.WORLD_CENTER_Y-R.y/2))},y.radialLayout=function(s,f,c){var L=Math.max(this.maxDiagonalInTree(s),n.DEFAULT_RADIAL_SEPARATION);y.branchRadialLayout(f,null,0,359,0,L);var A=u.calculateBounds(s),m=new E;m.setDeviceOrgX(A.getMinX()),m.setDeviceOrgY(A.getMinY()),m.setWorldOrgX(c.x),m.setWorldOrgY(c.y);for(var R=0;R<s.length;R++){var C=s[R];C.transform(m)}var M=new a(A.getMaxX(),A.getMaxY());return m.inverseTransformPoint(M)},y.branchRadialLayout=function(s,f,c,L,A,m){var R=(L-c+1)/2;R<0&&(R+=180);var C=(R+c)%360,M=C*D.TWO_PI/360,S=A*Math.cos(M),Y=A*Math.sin(M);s.setCenter(S,Y);var w=[];w=w.concat(s.getEdges());var x=w.length;f!=null&&x--;for(var F=0,U=w.length,P,_=s.getEdgesBetween(f);_.length>1;){var X=_[0];_.splice(0,1);var H=w.indexOf(X);H>=0&&w.splice(H,1),U--,x--}f!=null?P=(w.indexOf(_[0])+1)%U:P=0;for(var W=Math.abs(L-c)/x,B=P;F!=x;B=++B%U){var K=w[B].getOtherEnd(s);if(K!=f){var j=(c+F*W)%360,ht=(j+W)%360;y.branchRadialLayout(K,s,j,ht,A+m,m),F++}}},y.maxDiagonalInTree=function(s){for(var f=v.MIN_VALUE,c=0;c<s.length;c++){var L=s[c],A=L.getDiagonal();A>f&&(f=A)}return f},y.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},y.prototype.groupZeroDegreeMembers=function(){var s=this,f={};this.memberGroups={},this.idToDummyNode={};for(var c=[],L=this.graphManager.getAllNodes(),A=0;A<L.length;A++){var m=L[A],R=m.getParent();this.getNodeDegreeWithChildren(m)===0&&(R.id==null||!this.getToBeTiled(R))&&c.push(m)}for(var A=0;A<c.length;A++){var m=c[A],C=m.getParent().id;typeof f[C]>"u"&&(f[C]=[]),f[C]=f[C].concat(m)}Object.keys(f).forEach(function(M){if(f[M].length>1){var S="DummyCompound_"+M;s.memberGroups[S]=f[M];var Y=f[M][0].getParent(),w=new l(s.graphManager);w.id=S,w.paddingLeft=Y.paddingLeft||0,w.paddingRight=Y.paddingRight||0,w.paddingBottom=Y.paddingBottom||0,w.paddingTop=Y.paddingTop||0,s.idToDummyNode[S]=w;var x=s.getGraphManager().add(s.newGraph(),w),F=Y.getChild();F.add(w);for(var U=0;U<f[M].length;U++){var P=f[M][U];F.remove(P),x.add(P)}}})},y.prototype.clearCompounds=function(){var s={},f={};this.performDFSOnCompounds();for(var c=0;c<this.compoundOrder.length;c++)f[this.compoundOrder[c].id]=this.compoundOrder[c],s[this.compoundOrder[c].id]=[].concat(this.compoundOrder[c].getChild().getNodes()),this.graphManager.remove(this.compoundOrder[c].getChild()),this.compoundOrder[c].child=null;this.graphManager.resetAllNodes(),this.tileCompoundMembers(s,f)},y.prototype.clearZeroDegreeMembers=function(){var s=this,f=this.tiledZeroDegreePack=[];Object.keys(this.memberGroups).forEach(function(c){var L=s.idToDummyNode[c];f[c]=s.tileNodes(s.memberGroups[c],L.paddingLeft+L.paddingRight),L.rect.width=f[c].width,L.rect.height=f[c].height})},y.prototype.repopulateCompounds=function(){for(var s=this.compoundOrder.length-1;s>=0;s--){var f=this.compoundOrder[s],c=f.id,L=f.paddingLeft,A=f.paddingTop;this.adjustLocations(this.tiledMemberPack[c],f.rect.x,f.rect.y,L,A)}},y.prototype.repopulateZeroDegreeMembers=function(){var s=this,f=this.tiledZeroDegreePack;Object.keys(f).forEach(function(c){var L=s.idToDummyNode[c],A=L.paddingLeft,m=L.paddingTop;s.adjustLocations(f[c],L.rect.x,L.rect.y,A,m)})},y.prototype.getToBeTiled=function(s){var f=s.id;if(this.toBeTiled[f]!=null)return this.toBeTiled[f];var c=s.getChild();if(c==null)return this.toBeTiled[f]=!1,!1;for(var L=c.getNodes(),A=0;A<L.length;A++){var m=L[A];if(this.getNodeDegree(m)>0)return this.toBeTiled[f]=!1,!1;if(m.getChild()==null){this.toBeTiled[m.id]=!1;continue}if(!this.getToBeTiled(m))return this.toBeTiled[f]=!1,!1}return this.toBeTiled[f]=!0,!0},y.prototype.getNodeDegree=function(s){s.id;for(var f=s.getEdges(),c=0,L=0;L<f.length;L++){var A=f[L];A.getSource().id!==A.getTarget().id&&(c=c+1)}return c},y.prototype.getNodeDegreeWithChildren=function(s){var f=this.getNodeDegree(s);if(s.getChild()==null)return f;for(var c=s.getChild().getNodes(),L=0;L<c.length;L++){var A=c[L];f+=this.getNodeDegreeWithChildren(A)}return f},y.prototype.performDFSOnCompounds=function(){this.compoundOrder=[],this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes())},y.prototype.fillCompexOrderByDFS=function(s){for(var f=0;f<s.length;f++){var c=s[f];c.getChild()!=null&&this.fillCompexOrderByDFS(c.getChild().getNodes()),this.getToBeTiled(c)&&this.compoundOrder.push(c)}},y.prototype.adjustLocations=function(s,f,c,L,A){f+=L,c+=A;for(var m=f,R=0;R<s.rows.length;R++){var C=s.rows[R];f=m;for(var M=0,S=0;S<C.length;S++){var Y=C[S];Y.rect.x=f,Y.rect.y=c,f+=Y.rect.width+s.horizontalPadding,Y.rect.height>M&&(M=Y.rect.height)}c+=M+s.verticalPadding}},y.prototype.tileCompoundMembers=function(s,f){var c=this;this.tiledMemberPack=[],Object.keys(s).forEach(function(L){var A=f[L];c.tiledMemberPack[L]=c.tileNodes(s[L],A.paddingLeft+A.paddingRight),A.rect.width=c.tiledMemberPack[L].width,A.rect.height=c.tiledMemberPack[L].height})},y.prototype.tileNodes=function(s,f){var c=n.TILING_PADDING_VERTICAL,L=n.TILING_PADDING_HORIZONTAL,A={rows:[],rowWidth:[],rowHeight:[],width:0,height:f,verticalPadding:c,horizontalPadding:L};s.sort(function(C,M){return C.rect.width*C.rect.height>M.rect.width*M.rect.height?-1:C.rect.width*C.rect.height<M.rect.width*M.rect.height?1:0});for(var m=0;m<s.length;m++){var R=s[m];A.rows.length==0?this.insertNodeToRow(A,R,0,f):this.canAddHorizontal(A,R.rect.width,R.rect.height)?this.insertNodeToRow(A,R,this.getShortestRowIndex(A),f):this.insertNodeToRow(A,R,A.rows.length,f),this.shiftToLastRow(A)}return A},y.prototype.insertNodeToRow=function(s,f,c,L){var A=L;if(c==s.rows.length){var m=[];s.rows.push(m),s.rowWidth.push(A),s.rowHeight.push(0)}var R=s.rowWidth[c]+f.rect.width;s.rows[c].length>0&&(R+=s.horizontalPadding),s.rowWidth[c]=R,s.width<R&&(s.width=R);var C=f.rect.height;c>0&&(C+=s.verticalPadding);var M=0;C>s.rowHeight[c]&&(M=s.rowHeight[c],s.rowHeight[c]=C,M=s.rowHeight[c]-M),s.height+=M,s.rows[c].push(f)},y.prototype.getShortestRowIndex=function(s){for(var f=-1,c=Number.MAX_VALUE,L=0;L<s.rows.length;L++)s.rowWidth[L]<c&&(f=L,c=s.rowWidth[L]);return f},y.prototype.getLongestRowIndex=function(s){for(var f=-1,c=Number.MIN_VALUE,L=0;L<s.rows.length;L++)s.rowWidth[L]>c&&(f=L,c=s.rowWidth[L]);return f},y.prototype.canAddHorizontal=function(s,f,c){var L=this.getShortestRowIndex(s);if(L<0)return!0;var A=s.rowWidth[L];if(A+s.horizontalPadding+f<=s.width)return!0;var m=0;s.rowHeight[L]<c&&L>0&&(m=c+s.verticalPadding-s.rowHeight[L]);var R;s.width-A>=f+s.horizontalPadding?R=(s.height+m)/(A+f+s.horizontalPadding):R=(s.height+m)/s.width,m=c+s.verticalPadding;var C;return s.width<f?C=(s.height+m)/f:C=(s.height+m)/s.width,C<1&&(C=1/C),R<1&&(R=1/R),R<C},y.prototype.shiftToLastRow=function(s){var f=this.getLongestRowIndex(s),c=s.rowWidth.length-1,L=s.rows[f],A=L[L.length-1],m=A.width+s.horizontalPadding;if(s.width-s.rowWidth[c]>m&&f!=c){L.splice(-1,1),s.rows[c].push(A),s.rowWidth[f]=s.rowWidth[f]-m,s.rowWidth[c]=s.rowWidth[c]+m,s.width=s.rowWidth[instance.getLongestRowIndex(s)];for(var R=Number.MIN_VALUE,C=0;C<L.length;C++)L[C].height>R&&(R=L[C].height);f>0&&(R+=s.verticalPadding);var M=s.rowHeight[f]+s.rowHeight[c];s.rowHeight[f]=R,s.rowHeight[c]<A.height+s.verticalPadding&&(s.rowHeight[c]=A.height+s.verticalPadding);var S=s.rowHeight[f]+s.rowHeight[c];s.height+=S-M,this.shiftToLastRow(s)}},y.prototype.tilingPreLayout=function(){n.TILE&&(this.groupZeroDegreeMembers(),this.clearCompounds(),this.clearZeroDegreeMembers())},y.prototype.tilingPostLayout=function(){n.TILE&&(this.repopulateZeroDegreeMembers(),this.repopulateCompounds())},y.prototype.reduceTrees=function(){for(var s=[],f=!0,c;f;){var L=this.graphManager.getAllNodes(),A=[];f=!1;for(var m=0;m<L.length;m++)c=L[m],c.getEdges().length==1&&!c.getEdges()[0].isInterGraph&&c.getChild()==null&&(A.push([c,c.getEdges()[0],c.getOwner()]),f=!0);if(f==!0){for(var R=[],C=0;C<A.length;C++)A[C][0].getEdges().length==1&&(R.push(A[C]),A[C][0].getOwner().remove(A[C][0]));s.push(R),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()}}this.prunedNodesAll=s},y.prototype.growTree=function(s){for(var f=s.length,c=s[f-1],L,A=0;A<c.length;A++)L=c[A],this.findPlaceforPrunedNode(L),L[2].add(L[0]),L[2].add(L[1],L[1].source,L[1].target);s.splice(s.length-1,1),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()},y.prototype.findPlaceforPrunedNode=function(s){var f,c,L=s[0];L==s[1].source?c=s[1].target:c=s[1].source;var A=c.startX,m=c.finishX,R=c.startY,C=c.finishY,M=0,S=0,Y=0,w=0,x=[M,Y,S,w];if(R>0)for(var F=A;F<=m;F++)x[0]+=this.grid[F][R-1].length+this.grid[F][R].length-1;if(m<this.grid.length-1)for(var F=R;F<=C;F++)x[1]+=this.grid[m+1][F].length+this.grid[m][F].length-1;if(C<this.grid[0].length-1)for(var F=A;F<=m;F++)x[2]+=this.grid[F][C+1].length+this.grid[F][C].length-1;if(A>0)for(var F=R;F<=C;F++)x[3]+=this.grid[A-1][F].length+this.grid[A][F].length-1;for(var U=v.MAX_VALUE,P,_,X=0;X<x.length;X++)x[X]<U?(U=x[X],P=1,_=X):x[X]==U&&P++;if(P==3&&U==0)x[0]==0&&x[1]==0&&x[2]==0?f=1:x[0]==0&&x[1]==0&&x[3]==0?f=0:x[0]==0&&x[2]==0&&x[3]==0?f=3:x[1]==0&&x[2]==0&&x[3]==0&&(f=2);else if(P==2&&U==0){var H=Math.floor(Math.random()*2);x[0]==0&&x[1]==0?H==0?f=0:f=1:x[0]==0&&x[2]==0?H==0?f=0:f=2:x[0]==0&&x[3]==0?H==0?f=0:f=3:x[1]==0&&x[2]==0?H==0?f=1:f=2:x[1]==0&&x[3]==0?H==0?f=1:f=3:H==0?f=2:f=3}else if(P==4&&U==0){var H=Math.floor(Math.random()*4);f=H}else f=_;f==0?L.setCenter(c.getCenterX(),c.getCenterY()-c.getHeight()/2-d.DEFAULT_EDGE_LENGTH-L.getHeight()/2):f==1?L.setCenter(c.getCenterX()+c.getWidth()/2+d.DEFAULT_EDGE_LENGTH+L.getWidth()/2,c.getCenterY()):f==2?L.setCenter(c.getCenterX(),c.getCenterY()+c.getHeight()/2+d.DEFAULT_EDGE_LENGTH+L.getHeight()/2):L.setCenter(c.getCenterX()-c.getWidth()/2-d.DEFAULT_EDGE_LENGTH-L.getWidth()/2,c.getCenterY())},I.exports=y},function(I,T,o){var e={};e.layoutBase=o(0),e.CoSEConstants=o(1),e.CoSEEdge=o(2),e.CoSEGraph=o(3),e.CoSEGraphManager=o(4),e.CoSELayout=o(6),e.CoSENode=o(5),I.exports=e}])})}(Z)),Z.exports}(function(G,b){(function(I,T){G.exports=T(ft())})($,function(N){return function(I){var T={};function o(e){if(T[e])return T[e].exports;var t=T[e]={i:e,l:!1,exports:{}};return I[e].call(t.exports,t,t.exports,o),t.l=!0,t.exports}return o.m=I,o.c=T,o.i=function(e){return e},o.d=function(e,t,i){o.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:i})},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o(o.s=1)}([function(I,T){I.exports=N},function(I,T,o){var e=o(0).layoutBase.LayoutConstants,t=o(0).layoutBase.FDLayoutConstants,i=o(0).CoSEConstants,l=o(0).CoSELayout,g=o(0).CoSENode,n=o(0).layoutBase.PointD,d=o(0).layoutBase.DimensionD,r={ready:function(){},stop:function(){},quality:"default",nodeDimensionsIncludeLabels:!1,refresh:30,fit:!0,padding:10,randomize:!0,nodeRepulsion:4500,idealEdgeLength:50,edgeElasticity:.45,nestingFactor:.1,gravity:.25,numIter:2500,tile:!0,animate:"end",animationDuration:500,tilingPaddingVertical:10,tilingPaddingHorizontal:10,gravityRangeCompound:1.5,gravityCompound:1,gravityRange:3.8,initialEnergyOnIncremental:.5};function h(D,u){var E={};for(var y in D)E[y]=D[y];for(var y in u)E[y]=u[y];return E}function a(D){this.options=h(r,D),p(this.options)}var p=function(u){u.nodeRepulsion!=null&&(i.DEFAULT_REPULSION_STRENGTH=t.DEFAULT_REPULSION_STRENGTH=u.nodeRepulsion),u.idealEdgeLength!=null&&(i.DEFAULT_EDGE_LENGTH=t.DEFAULT_EDGE_LENGTH=u.idealEdgeLength),u.edgeElasticity!=null&&(i.DEFAULT_SPRING_STRENGTH=t.DEFAULT_SPRING_STRENGTH=u.edgeElasticity),u.nestingFactor!=null&&(i.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=t.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=u.nestingFactor),u.gravity!=null&&(i.DEFAULT_GRAVITY_STRENGTH=t.DEFAULT_GRAVITY_STRENGTH=u.gravity),u.numIter!=null&&(i.MAX_ITERATIONS=t.MAX_ITERATIONS=u.numIter),u.gravityRange!=null&&(i.DEFAULT_GRAVITY_RANGE_FACTOR=t.DEFAULT_GRAVITY_RANGE_FACTOR=u.gravityRange),u.gravityCompound!=null&&(i.DEFAULT_COMPOUND_GRAVITY_STRENGTH=t.DEFAULT_COMPOUND_GRAVITY_STRENGTH=u.gravityCompound),u.gravityRangeCompound!=null&&(i.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=t.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=u.gravityRangeCompound),u.initialEnergyOnIncremental!=null&&(i.DEFAULT_COOLING_FACTOR_INCREMENTAL=t.DEFAULT_COOLING_FACTOR_INCREMENTAL=u.initialEnergyOnIncremental),u.quality=="draft"?e.QUALITY=0:u.quality=="proof"?e.QUALITY=2:e.QUALITY=1,i.NODE_DIMENSIONS_INCLUDE_LABELS=t.NODE_DIMENSIONS_INCLUDE_LABELS=e.NODE_DIMENSIONS_INCLUDE_LABELS=u.nodeDimensionsIncludeLabels,i.DEFAULT_INCREMENTAL=t.DEFAULT_INCREMENTAL=e.DEFAULT_INCREMENTAL=!u.randomize,i.ANIMATE=t.ANIMATE=e.ANIMATE=u.animate,i.TILE=u.tile,i.TILING_PADDING_VERTICAL=typeof u.tilingPaddingVertical=="function"?u.tilingPaddingVertical.call():u.tilingPaddingVertical,i.TILING_PADDING_HORIZONTAL=typeof u.tilingPaddingHorizontal=="function"?u.tilingPaddingHorizontal.call():u.tilingPaddingHorizontal};a.prototype.run=function(){var D,u,E=this.options;this.idToLNode={};var y=this.layout=new l,O=this;O.stopped=!1,this.cy=this.options.cy,this.cy.trigger({type:"layoutstart",layout:this});var s=y.newGraphManager();this.gm=s;var f=this.options.eles.nodes(),c=this.options.eles.edges();this.root=s.addRoot(),this.processChildrenList(this.root,this.getTopMostNodes(f),y);for(var L=0;L<c.length;L++){var A=c[L],m=this.idToLNode[A.data("source")],R=this.idToLNode[A.data("target")];if(m!==R&&m.getEdgesBetween(R).length==0){var C=s.add(y.newEdge(),m,R);C.id=A.id()}}var M=function(w,x){typeof w=="number"&&(w=x);var F=w.data("id"),U=O.idToLNode[F];return{x:U.getRect().getCenterX(),y:U.getRect().getCenterY()}},S=function Y(){for(var w=function(){E.fit&&E.cy.fit(E.eles,E.padding),D||(D=!0,O.cy.one("layoutready",E.ready),O.cy.trigger({type:"layoutready",layout:O}))},x=O.options.refresh,F,U=0;U<x&&!F;U++)F=O.stopped||O.layout.tick();if(F){y.checkLayoutSuccess()&&!y.isSubLayout&&y.doPostLayout(),y.tilingPostLayout&&y.tilingPostLayout(),y.isLayoutFinished=!0,O.options.eles.nodes().positions(M),w(),O.cy.one("layoutstop",O.options.stop),O.cy.trigger({type:"layoutstop",layout:O}),u&&cancelAnimationFrame(u),D=!1;return}var P=O.layout.getPositionsData();E.eles.nodes().positions(function(_,X){if(typeof _=="number"&&(_=X),!_.isParent()){for(var H=_.id(),W=P[H],B=_;W==null&&(W=P[B.data("parent")]||P["DummyCompound_"+B.data("parent")],P[H]=W,B=B.parent()[0],B!=null););return W!=null?{x:W.x,y:W.y}:{x:_.position("x"),y:_.position("y")}}}),w(),u=requestAnimationFrame(Y)};return y.addListener("layoutstarted",function(){O.options.animate==="during"&&(u=requestAnimationFrame(S))}),y.runLayout(),this.options.animate!=="during"&&(O.options.eles.nodes().not(":parent").layoutPositions(O,O.options,M),D=!1),this},a.prototype.getTopMostNodes=function(D){for(var u={},E=0;E<D.length;E++)u[D[E].id()]=!0;var y=D.filter(function(O,s){typeof O=="number"&&(O=s);for(var f=O.parent()[0];f!=null;){if(u[f.id()])return!1;f=f.parent()[0]}return!0});return y},a.prototype.processChildrenList=function(D,u,E){for(var y=u.length,O=0;O<y;O++){var s=u[O],f=s.children(),c,L=s.layoutDimensions({nodeDimensionsIncludeLabels:this.options.nodeDimensionsIncludeLabels});if(s.outerWidth()!=null&&s.outerHeight()!=null?c=D.add(new g(E.graphManager,new n(s.position("x")-L.w/2,s.position("y")-L.h/2),new d(parseFloat(L.w),parseFloat(L.h)))):c=D.add(new g(this.graphManager)),c.id=s.data("id"),c.paddingLeft=parseInt(s.css("padding")),c.paddingTop=parseInt(s.css("padding")),c.paddingRight=parseInt(s.css("padding")),c.paddingBottom=parseInt(s.css("padding")),this.options.nodeDimensionsIncludeLabels&&s.isParent()){var A=s.boundingBox({includeLabels:!0,includeNodes:!1}).w,m=s.boundingBox({includeLabels:!0,includeNodes:!1}).h,R=s.css("text-halign");c.labelWidth=A,c.labelHeight=m,c.labelPos=R}if(this.idToLNode[s.data("id")]=c,isNaN(c.rect.x)&&(c.rect.x=0),isNaN(c.rect.y)&&(c.rect.y=0),f!=null&&f.length>0){var C;C=E.getGraphManager().add(E.newGraph(),c),this.processChildrenList(C,f,E)}}},a.prototype.stop=function(){return this.stopped=!0,this};var v=function(u){u("layout","cose-bilkent",a)};typeof cytoscape<"u"&&v(cytoscape),I.exports=v}])})})(tt);var ct=tt.exports;const pt=lt(ct);J.use(pt);function et(G,b){G.forEach(N=>{const I={id:N.id,labelText:N.label,height:N.height,width:N.width,padding:N.padding??0};Object.keys(N).forEach(T=>{["id","label","height","width","padding","x","y"].includes(T)||(I[T]=N[T])}),b.add({group:"nodes",data:I,position:{x:N.x??0,y:N.y??0}})})}V(et,"addNodes");function rt(G,b){G.forEach(N=>{const I={id:N.id,source:N.start,target:N.end};Object.keys(N).forEach(T=>{["id","start","end"].includes(T)||(I[T]=N[T])}),b.add({group:"edges",data:I})})}V(rt,"addEdges");function it(G){return new Promise(b=>{const N=gt("body").append("div").attr("id","cy").attr("style","display:none"),I=J({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"bezier"}}]});N.remove(),et(G.nodes,I),rt(G.edges,I),I.nodes().forEach(function(o){o.layoutDimensions=()=>{const e=o.data();return{w:e.width,h:e.height}}});const T={name:"cose-bilkent",quality:"proof",styleEnabled:!1,animate:!1};I.layout(T).run(),I.ready(o=>{k.info("Cytoscape ready",o),b(I)})})}V(it,"createCytoscapeInstance");function nt(G){return G.nodes().map(b=>{const N=b.data(),I=b.position(),T={id:N.id,x:I.x,y:I.y};return Object.keys(N).forEach(o=>{o!=="id"&&(T[o]=N[o])}),T})}V(nt,"extractPositionedNodes");function ot(G){return G.edges().map(b=>{const N=b.data(),I=b._private.rscratch,T={id:N.id,source:N.source,target:N.target,startX:I.startX,startY:I.startY,midX:I.midX,midY:I.midY,endX:I.endX,endY:I.endY};return Object.keys(N).forEach(o=>{["id","source","target"].includes(o)||(T[o]=N[o])}),T})}V(ot,"extractPositionedEdges");async function st(G,b){k.debug("Starting cose-bilkent layout algorithm");try{at(G);const N=await it(G),I=nt(N),T=ot(N);return k.debug(`Layout completed: ${I.length} nodes, ${T.length} edges`),{nodes:I,edges:T}}catch(N){throw k.error("Error in cose-bilkent layout algorithm:",N),N}}V(st,"executeCoseBilkentLayout");function at(G){if(!G)throw new Error("Layout data is required");if(!G.config)throw new Error("Configuration is required in layout data");if(!G.rootNode)throw new Error("Root node is required");if(!G.nodes||!Array.isArray(G.nodes))throw new Error("No nodes found in layout data");if(!Array.isArray(G.edges))throw new Error("Edges array is required in layout data");return!0}V(at,"validateLayoutData");var dt=V(async(G,b,{insertCluster:N,insertEdge:I,insertEdgeLabel:T,insertMarkers:o,insertNode:e,log:t,positionEdgeLabel:i},{algorithm:l})=>{const g={},n={},d=b.select("g");o(d,G.markers,G.type,G.diagramId);const r=d.insert("g").attr("class","subgraphs"),h=d.insert("g").attr("class","edgePaths"),a=d.insert("g").attr("class","edgeLabels"),p=d.insert("g").attr("class","nodes");t.debug("Inserting nodes into DOM for dimension calculation"),await Promise.all(G.nodes.map(async u=>{if(u.isGroup){const E={...u};n[u.id]=E,g[u.id]=E,await N(r,u)}else{const E={...u};g[u.id]=E;const y=await e(p,u,{config:G.config,dir:G.direction||"TB"}),O=y.node().getBBox();E.width=O.width,E.height=O.height,E.domId=y,t.debug(`Node ${u.id} dimensions: ${O.width}x${O.height}`)}})),t.debug("Running cose-bilkent layout algorithm");const v={...G,nodes:G.nodes.map(u=>{const E=g[u.id];return{...u,width:E.width,height:E.height}})},D=await st(v,G.config);t.debug("Positioning nodes based on layout results"),D.nodes.forEach(u=>{const E=g[u.id];E!=null&&E.domId&&(E.domId.attr("transform",`translate(${u.x}, ${u.y})`),E.x=u.x,E.y=u.y,t.debug(`Positioned node ${E.id} at center (${u.x}, ${u.y})`))}),D.edges.forEach(u=>{const E=G.edges.find(y=>y.id===u.id);E&&(E.points=[{x:u.startX,y:u.startY},{x:u.midX,y:u.midY},{x:u.endX,y:u.endY}])}),t.debug("Inserting and positioning edges"),await Promise.all(G.edges.map(async u=>{await T(a,u);const E=g[u.start??""],y=g[u.end??""];if(E&&y){const O=D.edges.find(s=>s.id===u.id);if(O){t.debug("APA01 positionedEdge",O);const s={...u},f=I(h,s,n,G.type,E,y,G.diagramId);i(s,f)}else{const s={...u,points:[{x:E.x||0,y:E.y||0},{x:y.x||0,y:y.y||0}]},f=I(h,s,n,G.type,E,y,G.diagramId);i(s,f)}}})),t.debug("Cose-bilkent rendering completed")},"render"),Lt=dt;export{Lt as render};
@@ -1,62 +0,0 @@
1
- import{p as xt}from"./chunk-JWPE2WC7-D6dXb_jr.js";import{s as gt,g as $t,q as bt,p as wt,a as Ct,b as vt,_ as s,l as O,P as Dt,d as kt,z as Tt,M as Q,K as U,N as At,Q as ot}from"./mermaid.core-D_Dp_Kl2.js";import{p as Bt}from"./cynefin-EF2NZ3EQ-OZotFKUu.js";import"./index-BKxAxaVG.js";var rt=s(()=>({domains:new Map,transitions:[]}),"createDefaultData"),H=rt(),St=s(()=>H.domains,"getDomains"),Mt=s(()=>H.transitions,"getTransitions"),zt=s(t=>{if(t)for(const e of t){const n=e.domain,a=(e.items??[]).map(c=>({label:c.label}));H.domains.set(n,{name:n,items:a})}},"setDomains"),Lt=s(t=>{t&&(H.transitions=t.filter(e=>e.from===e.to?(O.warn(`Cynefin: self-loop transition on domain "${e.from}" is not meaningful and will be skipped.`),!1):!0).map(e=>({from:e.from,to:e.to,label:e.label||void 0})))},"setTransitions"),Nt=s(()=>Q({...At.cynefin,...U().cynefin}),"getConfig"),Pt=s(()=>{Tt(),H=rt()},"clear"),Y={getDomains:St,getTransitions:Mt,setDomains:zt,setTransitions:Lt,getConfig:Nt,clear:Pt,setAccTitle:vt,getAccTitle:Ct,setDiagramTitle:wt,getDiagramTitle:bt,getAccDescription:$t,setAccDescription:gt},It=s(t=>{xt(t,Y),Y.setDomains(t.domains),Y.setTransitions(t.transitions)},"populate"),Wt={parse:s(async t=>{const e=await Bt("cynefin",t);O.debug(e),It(e)},"parse")};function E(t){let e=t+1831565813|0;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}s(E,"seededRandom");function st(t){let e=0;for(let n=0;n<t.length;n++){const a=t.charCodeAt(n);e=(e<<5)-e+a,e|=0}return e}s(st,"hashString");function it(t,e){return typeof t=="number"&&Number.isFinite(t)&&t!==0?t:st(e)}s(it,"resolveSeed");function ct(t,e,n,a){const c=t/2,m=a??t*.015,v=7,W=e/v,d=[];for(let o=0;o<=v;o++){const p=E(n+o*17)*m*2-m;d.push({x:c+p,y:o*W})}let D=`M${d[0].x},${d[0].y}`;for(let o=0;o<d.length-1;o++){const p=d[o],i=d[o+1],f=(p.y+i.y)/2,b=o%2===0?1:-1,h=m*1.5*b*E(n+o*31+7),R=p.x+h,_=f,F=i.x-h;D+=` C${R},${_} ${F},${f} ${i.x},${i.y}`}return D}s(ct,"generateFoldPath");function lt(t,e,n,a){const c=e/2,m=a??e*.015,v=7,W=t/v,d=[];for(let o=0;o<=v;o++){const p=E(n+o*23)*m*2-m;d.push({x:o*W,y:c+p})}let D=`M${d[0].x},${d[0].y}`;for(let o=0;o<d.length-1;o++){const p=d[o],i=d[o+1],f=(p.x+i.x)/2,b=o%2===0?1:-1,h=m*1.5*b*E(n+o*37+11),R=f,_=p.y+h,F=f,z=i.y-h;D+=` C${R},${_} ${F},${z} ${i.x},${i.y}`}return D}s(lt,"generateHorizontalBoundary");function dt(t,e){const n=t/2,a=e*.5,c=e,m=t*.03;return[`M${n},${a}`,`C${n+m},${a+(c-a)*.2}`,`${n-m*1.5},${a+(c-a)*.55}`,`${n+m*.5},${a+(c-a)*.75}`,`C${n-m},${a+(c-a)*.85}`,`${n+m*.3},${a+(c-a)*.95}`,`${n},${c}`].join(" ")}s(dt,"generateCliffPath");function ft(t,e,n,a){return[`M${t-n},${e}`,`A${n},${a} 0 1,1 ${t+n},${e}`,`A${n},${a} 0 1,1 ${t-n},${e}`,"Z"].join(" ")}s(ft,"generateConfusionPath");var at={complex:{model:"Probe → Sense → Respond",practice:"Emergent Practices"},complicated:{model:"Sense → Analyse → Respond",practice:"Good Practices"},clear:{model:"Sense → Categorise → Respond",practice:"Best Practices"},chaotic:{model:"Act → Sense → Respond",practice:"Novel Practices"},confusion:{model:"",practice:"Disorder"}},Rt=s((t,e)=>{const n=t/2,a=e/2;return{complex:{cx:n/2,cy:a/2,x:0,y:0,w:n,h:a},complicated:{cx:n+n/2,cy:a/2,x:n,y:0,w:n,h:a},chaotic:{cx:n/2,cy:a+a/2,x:0,y:a,w:n,h:a},clear:{cx:n+n/2,cy:a+a/2,x:n,y:a,w:n,h:a},confusion:{cx:n,cy:a,x:n*.7,y:a*.7,w:n*.6,h:a*.6}}},"getDomainLayouts"),_t=s(()=>{const t=ot(),e=U();return Q(t,e.themeVariables).cynefin},"getCynefinDomainColors"),q=3,Ft=s((t,e,n,a)=>{const c=a.db,m=c.getDomains(),v=c.getTransitions(),W=c.getDiagramTitle(),d=c.getAccTitle(),D=c.getAccDescription(),o=c.getConfig(),p=_t();O.debug("Rendering Cynefin diagram");const i=o.width,f=o.height,b=o.padding,h=o.showDomainDescriptions,R=o.boundaryAmplitude,_=i+b*2,F=f+b*2,z={complex:p.complexBg,complicated:p.complicatedBg,clear:p.clearBg,chaotic:p.chaoticBg,confusion:p.confusionBg},k=Dt(e);kt(k,F,_,o.useMaxWidth??!0),k.attr("viewBox",`0 0 ${_} ${F}`),d&&k.append("title").text(d),D&&k.append("desc").text(D);const T=k.append("g").attr("transform",`translate(${b}, ${b})`),V=Rt(i,f),K=it(o.seed,e),mt=T.append("g").attr("class","cynefin-backgrounds"),X=["complex","complicated","chaotic","clear"];for(const l of X){const r=V[l];mt.append("rect").attr("class","cynefinDomain").attr("x",r.x).attr("y",r.y).attr("width",r.w).attr("height",r.h).attr("fill",z[l]).attr("fill-opacity",.4).attr("stroke","none")}const j=T.append("g").attr("class","cynefin-boundaries");j.append("path").attr("class","cynefinBoundary").attr("d",ct(i,f,K,R)).attr("fill","none"),j.append("path").attr("class","cynefinBoundary").attr("d",lt(i,f,K+100,R)).attr("fill","none"),j.append("path").attr("class","cynefinCliff").attr("d",dt(i,f)).attr("fill","none");const pt=i*.15,yt=f*.15;T.append("path").attr("class","cynefinConfusion").attr("d",ft(i/2,f/2,pt,yt)).attr("fill",z.confusion).attr("fill-opacity",.5);const Z=T.append("g").attr("class","cynefin-labels");for(const l of X){const r=V[l];Z.append("text").attr("class","cynefinDomainLabel").attr("x",r.cx).attr("y",h?r.cy-30:r.cy).attr("text-anchor","middle").attr("dominant-baseline","middle").text(l.charAt(0).toUpperCase()+l.slice(1))}if(Z.append("text").attr("class","cynefinDomainLabel").attr("x",i/2).attr("y",h?f/2-10:f/2).attr("text-anchor","middle").attr("dominant-baseline","middle").text("Confusion"),h){const l=T.append("g").attr("class","cynefin-subtitles");for(const r of X){const u=V[r],y=at[r];l.append("text").attr("class","cynefinSubtitle").attr("x",u.cx).attr("y",u.cy-10).attr("text-anchor","middle").attr("dominant-baseline","middle").text(y.model),l.append("text").attr("class","cynefinSubtitle").attr("x",u.cx).attr("y",u.cy+5).attr("text-anchor","middle").attr("dominant-baseline","middle").text(y.practice)}l.append("text").attr("class","cynefinSubtitle").attr("x",i/2).attr("y",f/2+8).attr("text-anchor","middle").attr("dominant-baseline","middle").text(at.confusion.practice)}const J=T.append("g").attr("class","cynefin-items"),A=26,tt=10,ut=["complex","complicated","chaotic","clear","confusion"];for(const l of ut){const r=m.get(l);if(!r||r.items.length===0)continue;const u=V[l],y=l==="confusion";let L=r.items,N=0;y&&r.items.length>q&&(N=r.items.length-q,L=r.items.slice(0,q));let B;if(y){const g=h?22:14;B=u.cy+g}else B=u.cy+(h?25:15);if([...L].forEach((g,S)=>{const w=B+S*(A+4),M=J.append("g"),P=M.append("text").attr("class","cynefinItemText").attr("x",0).attr("y",A/2).attr("text-anchor","middle").attr("dominant-baseline","central").text(g.label);let $=g.label.length*7;const x=P.node();if(x&&typeof x.getBBox=="function"){const G=x.getBBox();G.width>0&&($=G.width)}const C=$+tt*2,I=u.cx-C/2;M.attr("transform",`translate(${I}, ${w})`),M.insert("rect","text").attr("class","cynefinItem").attr("x",0).attr("y",0).attr("width",C).attr("height",A).attr("rx",4).attr("ry",4).attr("fill",z[l]).attr("fill-opacity",.95),P.attr("x",C/2).attr("y",A/2)}),N>0){const g=B+L.length*(A+4),S=`+${N} more`,w=J.append("g"),M=w.append("text").attr("class","cynefinItemText").attr("x",0).attr("y",A/2).attr("text-anchor","middle").attr("dominant-baseline","central").text(S);let P=S.length*7;const $=M.node();if($&&typeof $.getBBox=="function"){const I=$.getBBox();I.width>0&&(P=I.width)}const x=P+tt*2,C=u.cx-x/2;w.attr("transform",`translate(${C}, ${g})`),w.insert("rect","text").attr("class","cynefinItemOverflow").attr("x",0).attr("y",0).attr("width",x).attr("height",A).attr("rx",4).attr("ry",4).attr("fill",z[l]).attr("fill-opacity",.6),M.attr("x",x/2).attr("y",A/2)}}if(v.length>0){const l=k.select("defs").empty()?k.append("defs"):k.select("defs"),r=`cynefin-arrow-${e}`;l.append("marker").attr("id",r).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","cynefinArrowHead");const u=T.append("g").attr("class","cynefin-arrows");v.forEach(y=>{const L=V[y.from],N=V[y.to];if(!L||!N)return;if(y.from===y.to){O.warn(`Cynefin renderer: skipping self-loop on domain "${y.from}"`);return}const B=L.cx,g=L.cy,S=N.cx,w=N.cy,M=(B+S)/2,P=(g+w)/2,$=S-B,x=w-g,C=Math.sqrt($*$+x*x),I=C*.15,G=-x/C,ht=$/C,et=M+G*I,nt=P+ht*I;u.append("path").attr("class","cynefinArrowLine").attr("d",`M${B},${g} Q${et},${nt} ${S},${w}`).attr("fill","none").attr("marker-end",`url(#${r})`),y.label&&u.append("text").attr("class","cynefinArrowLabel").attr("x",et).attr("y",nt-6).attr("text-anchor","middle").attr("dominant-baseline","auto").text(y.label)})}W&&T.append("text").attr("class","cynefinTitle").attr("x",i/2).attr("y",-b/2).attr("text-anchor","middle").attr("dominant-baseline","middle").text(W)},"draw"),Vt={draw:Ft},Et=s(()=>{const t=ot(),e=U();return Q(t,e.themeVariables).cynefin},"getCynefinTheme"),Ht=s(()=>{const t=Et();return`
2
- .cynefinDomain {
3
- stroke: none;
4
- }
5
- .cynefinDomainLabel {
6
- font-size: ${t.domainFontSize}px;
7
- font-weight: bold;
8
- fill: ${t.labelColor};
9
- }
10
- .cynefinSubtitle {
11
- font-size: ${t.itemFontSize-1}px;
12
- fill: ${t.textColor};
13
- font-style: italic;
14
- }
15
- .cynefinItem {
16
- fill-opacity: 0.95;
17
- stroke: ${t.boundaryColor};
18
- stroke-width: 1;
19
- }
20
- .cynefinItemText {
21
- font-size: ${t.itemFontSize}px;
22
- fill: ${t.textColor};
23
- }
24
- .cynefinItemOverflow {
25
- fill-opacity: 0.6;
26
- stroke: ${t.boundaryColor};
27
- stroke-width: 1;
28
- stroke-dasharray: 3 2;
29
- }
30
- .cynefinBoundary {
31
- stroke: ${t.boundaryColor};
32
- stroke-width: ${t.boundaryWidth};
33
- stroke-dasharray: 6 3;
34
- }
35
- .cynefinCliff {
36
- stroke: ${t.cliffColor};
37
- stroke-width: ${t.cliffWidth};
38
- }
39
- .cynefinConfusion {
40
- stroke: ${t.boundaryColor};
41
- stroke-width: 1.5;
42
- stroke-dasharray: 4 2;
43
- }
44
- .cynefinArrowLine {
45
- stroke: ${t.arrowColor};
46
- stroke-width: ${t.arrowWidth};
47
- fill: none;
48
- }
49
- .cynefinArrowHead {
50
- fill: ${t.arrowColor};
51
- stroke: none;
52
- }
53
- .cynefinArrowLabel {
54
- font-size: ${t.itemFontSize-1}px;
55
- fill: ${t.textColor};
56
- }
57
- .cynefinTitle {
58
- font-size: ${t.domainFontSize+2}px;
59
- font-weight: bold;
60
- fill: ${t.labelColor};
61
- }
62
- `},"styles"),Gt=Ht,qt={parser:Wt,db:Y,renderer:Vt,styles:Gt};export{qt as diagram};
@@ -1,4 +0,0 @@
1
- import{s as pe,a as Hn,c as zn,b as Jn,f as Ce,e as T,i as Kn}from"./chunk-ZCHMQSOR-DxR-fxzs.js";import{_ as x,c as Zn,l as m,bl as Qn,bm as er,aC as nr,aB as Ie,am as Re,ak as rr,ay as tr,b6 as ar}from"./mermaid.core-D_Dp_Kl2.js";import{i as q,a as N,d as ke,e as K,b as Z,c as on,f as ge,g as sn,h as ir,j as dn,s as or,o as sr,k as dr,l as ve,m as ur,r as fr,U as _e,S as Me,n as be,p as we,q as H,t as un,u as fn,v as cr,w as R,x as lr,y as hr,z as pr,A as Ae,B as gr,C as cn,D as M,E as vr,F as br,H as wr,I as U,J as ln,K as hn,L as mr,M as me,N as pn,O as yr,P as gn,Q as xr,R as Er,G as P,T as l,V as Lr,W as O,X,Y as k,Z as Q}from"./graph-DGbsTEsI.js";import"./index-BKxAxaVG.js";var Or=/\s/;function Nr(e){for(var n=e.length;n--&&Or.test(e.charAt(n)););return n}var Pr=/^\s+/;function Tr(e){return e&&e.slice(0,Nr(e)+1).replace(Pr,"")}var je=NaN,Sr=/^[-+]0x[0-9a-f]+$/i,Cr=/^0b[01]+$/i,Ir=/^0o[0-7]+$/i,Rr=parseInt;function kr(e){if(typeof e=="number")return e;if(q(e))return je;if(N(e)){var n=typeof e.valueOf=="function"?e.valueOf():e;e=N(n)?n+"":n}if(typeof e!="string")return e===0?e:+e;e=Tr(e);var r=Cr.test(e);return r||Ir.test(e)?Rr(e.slice(2),r?2:8):Sr.test(e)?je:+e}var De=1/0,_r=17976931348623157e292;function V(e){if(!e)return e===0?e:0;if(e=kr(e),e===De||e===-De){var n=e<0?-1:1;return n*_r}return e===e?e:0}function Mr(e){var n=V(e),r=n%1;return n===n?r?n-r:n:0}var Be=Object.create,Ar=function(){function e(){}return function(n){if(!N(n))return{};if(Be)return Be(n);e.prototype=n;var r=new e;return e.prototype=void 0,r}}();function jr(e,n){var r=-1,t=e.length;for(n||(n=Array(t));++r<t;)n[r]=e[r];return n}function ee(e,n,r){n=="__proto__"&&ke?ke(e,n,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[n]=r}var Dr=Object.prototype,Br=Dr.hasOwnProperty;function ne(e,n,r){var t=e[n];(!(Br.call(e,n)&&K(t,r))||r===void 0&&!(n in e))&&ee(e,n,r)}function $r(e,n,r,t){var a=!r;r||(r={});for(var i=-1,o=n.length;++i<o;){var s=n[i],d=void 0;d===void 0&&(d=e[s]),a?ee(r,s,d):ne(r,s,d)}return r}function B(e,n,r){if(!N(r))return!1;var t=typeof n;return(t=="number"?Z(r)&&on(n,r.length):t=="string"&&n in r)?K(r[n],e):!1}function Fr(e){return ge(function(n,r){var t=-1,a=r.length,i=a>1?r[a-1]:void 0,o=a>2?r[2]:void 0;for(i=e.length>3&&typeof i=="function"?(a--,i):void 0,o&&B(r[0],r[1],o)&&(i=a<3?void 0:i,a=1),n=Object(n);++t<a;){var s=r[t];s&&e(n,s,t,i)}return n})}function Xr(e){var n=[];if(e!=null)for(var r in Object(e))n.push(r);return n}var Gr=Object.prototype,Yr=Gr.hasOwnProperty;function Ur(e){if(!N(e))return Xr(e);var n=sn(e),r=[];for(var t in e)t=="constructor"&&(n||!Yr.call(e,t))||r.push(t);return r}function re(e){return Z(e)?ir(e,!0):Ur(e)}function A(e){var n=e==null?0:e.length;return n?dn(e):[]}function Vr(e){return or(sr(e,void 0,A),e+"")}var vn=dr(Object.getPrototypeOf,Object),Wr="[object Object]",qr=Function.prototype,Hr=Object.prototype,bn=qr.toString,zr=Hr.hasOwnProperty,Jr=bn.call(Object);function Kr(e){if(!ve(e)||ur(e)!=Wr)return!1;var n=vn(e);if(n===null)return!0;var r=zr.call(n,"constructor")&&n.constructor;return typeof r=="function"&&r instanceof r&&bn.call(r)==Jr}var wn=typeof exports=="object"&&exports&&!exports.nodeType&&exports,$e=wn&&typeof module=="object"&&module&&!module.nodeType&&module,Zr=$e&&$e.exports===wn,Fe=Zr?fr.Buffer:void 0,Xe=Fe?Fe.allocUnsafe:void 0;function mn(e,n){if(n)return e.slice();var r=e.length,t=Xe?Xe(r):new e.constructor(r);return e.copy(t),t}var Qr=Object.prototype,et=Qr.hasOwnProperty;function nt(e){var n=e.length,r=new e.constructor(n);return n&&typeof e[0]=="string"&&et.call(e,"index")&&(r.index=e.index,r.input=e.input),r}function ye(e){var n=new e.constructor(e.byteLength);return new _e(n).set(new _e(e)),n}function rt(e,n){var r=ye(e.buffer);return new e.constructor(r,e.byteOffset,e.byteLength)}var tt=/\w*$/;function at(e){var n=new e.constructor(e.source,tt.exec(e));return n.lastIndex=e.lastIndex,n}var Ge=Me?Me.prototype:void 0,Ye=Ge?Ge.valueOf:void 0;function it(e){return Ye?Object(Ye.call(e)):{}}function yn(e,n){var r=n?ye(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}var ot="[object Boolean]",st="[object Date]",dt="[object Map]",ut="[object Number]",ft="[object RegExp]",ct="[object Set]",lt="[object String]",ht="[object Symbol]",pt="[object ArrayBuffer]",gt="[object DataView]",vt="[object Float32Array]",bt="[object Float64Array]",wt="[object Int8Array]",mt="[object Int16Array]",yt="[object Int32Array]",xt="[object Uint8Array]",Et="[object Uint8ClampedArray]",Lt="[object Uint16Array]",Ot="[object Uint32Array]";function Nt(e,n,r){var t=e.constructor;switch(n){case pt:return ye(e);case ot:case st:return new t(+e);case gt:return rt(e);case vt:case bt:case wt:case mt:case yt:case xt:case Et:case Lt:case Ot:return yn(e,r);case dt:return new t;case ut:case lt:return new t(e);case ft:return at(e);case ct:return new t;case ht:return it(e)}}function xn(e){return typeof e.constructor=="function"&&!sn(e)?Ar(vn(e)):{}}var Pt="[object Map]";function Tt(e){return ve(e)&&be(e)==Pt}var Ue=H&&H.isMap,St=Ue?we(Ue):Tt,Ct="[object Set]";function It(e){return ve(e)&&be(e)==Ct}var Ve=H&&H.isSet,Rt=Ve?we(Ve):It,kt=1,En="[object Arguments]",_t="[object Array]",Mt="[object Boolean]",At="[object Date]",jt="[object Error]",Ln="[object Function]",Dt="[object GeneratorFunction]",Bt="[object Map]",$t="[object Number]",On="[object Object]",Ft="[object RegExp]",Xt="[object Set]",Gt="[object String]",Yt="[object Symbol]",Ut="[object WeakMap]",Vt="[object ArrayBuffer]",Wt="[object DataView]",qt="[object Float32Array]",Ht="[object Float64Array]",zt="[object Int8Array]",Jt="[object Int16Array]",Kt="[object Int32Array]",Zt="[object Uint8Array]",Qt="[object Uint8ClampedArray]",ea="[object Uint16Array]",na="[object Uint32Array]",y={};y[En]=y[_t]=y[Vt]=y[Wt]=y[Mt]=y[At]=y[qt]=y[Ht]=y[zt]=y[Jt]=y[Kt]=y[Bt]=y[$t]=y[On]=y[Ft]=y[Xt]=y[Gt]=y[Yt]=y[Zt]=y[Qt]=y[ea]=y[na]=!0;y[jt]=y[Ln]=y[Ut]=!1;function W(e,n,r,t,a,i){var o,s=n&kt;if(o!==void 0)return o;if(!N(e))return e;var d=R(e);if(d)o=nt(e);else{var u=be(e),f=u==Ln||u==Dt;if(un(e))return mn(e,s);if(u==On||u==En||f&&!a)o=f?{}:xn(e);else{if(!y[u])return a?e:{};o=Nt(e,u,s)}}i||(i=new fn);var c=i.get(e);if(c)return c;i.set(e,o),Rt(e)?e.forEach(function(p){o.add(W(p,n,r,p,e,i))}):St(e)&&e.forEach(function(p,g){o.set(g,W(p,n,r,g,e,i))});var h=lr,b=d?void 0:h(e);return cr(b||e,function(p,g){b&&(g=p,p=e[g]),ne(o,g,W(p,n,r,g,e,i))}),o}var ra=1,ta=4;function aa(e){return W(e,ra|ta)}var Nn=Object.prototype,ia=Nn.hasOwnProperty,oa=ge(function(e,n){e=Object(e);var r=-1,t=n.length,a=t>2?n[2]:void 0;for(a&&B(n[0],n[1],a)&&(t=1);++r<t;)for(var i=n[r],o=re(i),s=-1,d=o.length;++s<d;){var u=o[s],f=e[u];(f===void 0||K(f,Nn[u])&&!ia.call(e,u))&&(e[u]=i[u])}return e});function fe(e,n,r){(r!==void 0&&!K(e[n],r)||r===void 0&&!(n in e))&&ee(e,n,r)}function ce(e,n){if(!(n==="constructor"&&typeof e[n]=="function")&&n!="__proto__")return e[n]}function sa(e){return $r(e,re(e))}function da(e,n,r,t,a,i,o){var s=ce(e,r),d=ce(n,r),u=o.get(d);if(u){fe(e,r,u);return}var f=i?i(s,d,r+"",e,n,o):void 0,c=f===void 0;if(c){var h=R(d),b=!h&&un(d),p=!h&&!b&&hr(d);f=d,h||b||p?R(s)?f=s:pr(s)?f=jr(s):b?(c=!1,f=mn(d,!0)):p?(c=!1,f=yn(d,!0)):f=[]:Kr(d)||Ae(d)?(f=s,Ae(s)?f=sa(s):(!N(s)||gr(s))&&(f=xn(d))):c=!1}c&&(o.set(d,f),a(f,d,t,i,o),o.delete(d)),fe(e,r,f)}function Pn(e,n,r,t,a){e!==n&&cn(n,function(i,o){if(a||(a=new fn),N(i))da(e,n,o,r,Pn,t,a);else{var s=t?t(ce(e,o),i,o+"",e,n,a):void 0;s===void 0&&(s=i),fe(e,o,s)}},re)}function z(e){var n=e==null?0:e.length;return n?e[n-1]:void 0}function ua(e){return function(n,r,t){var a=Object(n);if(!Z(n)){var i=M(r);n=vr(n),r=function(s){return i(a[s],s,a)}}var o=e(n,r,t);return o>-1?a[i?n[o]:o]:void 0}}var fa=Math.max;function ca(e,n,r){var t=e==null?0:e.length;if(!t)return-1;var a=r==null?0:Mr(r);return a<0&&(a=fa(t+a,0)),br(e,M(n),a)}var xe=ua(ca);function Tn(e,n){var r=-1,t=Z(e)?Array(e.length):[];return wr(e,function(a,i,o){t[++r]=n(a,i,o)}),t}function E(e,n){var r=R(e)?U:Tn;return r(e,M(n))}function la(e,n){return e==null?e:cn(e,ln(n),re)}function ha(e,n){return e&&hn(e,ln(n))}function pa(e,n){return e>n}var ga=Object.prototype,va=ga.hasOwnProperty;function ba(e,n){return e!=null&&va.call(e,n)}function Sn(e,n){return e!=null&&mr(e,n,ba)}function Cn(e,n){return e<n}function te(e,n){var r={};return n=M(n),hn(e,function(t,a,i){ee(r,a,n(t,a,i))}),r}function Ee(e,n,r){for(var t=-1,a=e.length;++t<a;){var i=e[t],o=n(i);if(o!=null&&(s===void 0?o===o&&!q(o):r(o,s)))var s=o,d=i}return d}function C(e){return e&&e.length?Ee(e,me,pa):void 0}var le=Fr(function(e,n,r){Pn(e,n,r)});function $(e){return e&&e.length?Ee(e,me,Cn):void 0}function Le(e,n){return e&&e.length?Ee(e,M(n),Cn):void 0}function wa(e,n,r,t){if(!N(e))return e;n=pn(n,e);for(var a=-1,i=n.length,o=i-1,s=e;s!=null&&++a<i;){var d=yr(n[a]),u=r;if(d==="__proto__"||d==="constructor"||d==="prototype")return e;if(a!=o){var f=s[d];u=void 0,u===void 0&&(u=N(f)?f:on(n[a+1])?[]:{})}ne(s,d,u),s=s[d]}return e}function ma(e,n,r){for(var t=-1,a=n.length,i={};++t<a;){var o=n[t],s=gn(e,o);r(s,o)&&wa(i,pn(o,e),s)}return i}function ya(e,n){var r=e.length;for(e.sort(n);r--;)e[r]=e[r].value;return e}function xa(e,n){if(e!==n){var r=e!==void 0,t=e===null,a=e===e,i=q(e),o=n!==void 0,s=n===null,d=n===n,u=q(n);if(!s&&!u&&!i&&e>n||i&&o&&d&&!s&&!u||t&&o&&d||!r&&d||!a)return 1;if(!t&&!i&&!u&&e<n||u&&r&&a&&!t&&!i||s&&r&&a||!o&&a||!d)return-1}return 0}function Ea(e,n,r){for(var t=-1,a=e.criteria,i=n.criteria,o=a.length,s=r.length;++t<o;){var d=xa(a[t],i[t]);if(d){if(t>=s)return d;var u=r[t];return d*(u=="desc"?-1:1)}}return e.index-n.index}function La(e,n,r){n.length?n=U(n,function(i){return R(i)?function(o){return gn(o,i.length===1?i[0]:i)}:i}):n=[me];var t=-1;n=U(n,we(M));var a=Tn(e,function(i,o,s){var d=U(n,function(u){return u(i)});return{criteria:d,index:++t,value:i}});return ya(a,function(i,o){return Ea(i,o,r)})}function Oa(e,n){return ma(e,n,function(r,t){return xr(e,t)})}var J=Vr(function(e,n){return e==null?{}:Oa(e,n)}),Na=Math.ceil,Pa=Math.max;function Ta(e,n,r,t){for(var a=-1,i=Pa(Na((n-e)/(r||1)),0),o=Array(i);i--;)o[++a]=e,e+=r;return o}function Sa(e){return function(n,r,t){return t&&typeof t!="number"&&B(n,r,t)&&(r=t=void 0),n=V(n),r===void 0?(r=n,n=0):r=V(r),t=t===void 0?n<r?1:-1:V(t),Ta(n,r,t)}}var _=Sa(),G=ge(function(e,n){if(e==null)return[];var r=n.length;return r>1&&B(e,n[0],n[1])?n=[]:r>2&&B(n[0],n[1],n[2])&&(n=[n[0]]),La(e,dn(n),[])}),Ca=0;function Oe(e){var n=++Ca;return Er(e)+n}function Ia(e,n,r){for(var t=-1,a=e.length,i=n.length,o={};++t<a;){var s=t<i?n[t]:void 0;r(o,e[t],s)}return o}function Ra(e,n){return Ia(e||[],n||[],ne)}class ka{constructor(){var n={};n._next=n._prev=n,this._sentinel=n}dequeue(){var n=this._sentinel,r=n._prev;if(r!==n)return We(r),r}enqueue(n){var r=this._sentinel;n._prev&&n._next&&We(n),n._next=r._next,r._next._prev=n,r._next=n,n._prev=r}toString(){for(var n=[],r=this._sentinel,t=r._prev;t!==r;)n.push(JSON.stringify(t,_a)),t=t._prev;return"["+n.join(", ")+"]"}}function We(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function _a(e,n){if(e!=="_next"&&e!=="_prev")return n}var Ma=Lr(1);function Aa(e,n){if(e.nodeCount()<=1)return[];var r=Da(e,n||Ma),t=ja(r.graph,r.buckets,r.zeroIdx);return A(E(t,function(a){return e.outEdges(a.v,a.w)}))}function ja(e,n,r){for(var t=[],a=n[n.length-1],i=n[0],o;e.nodeCount();){for(;o=i.dequeue();)ie(e,n,r,o);for(;o=a.dequeue();)ie(e,n,r,o);if(e.nodeCount()){for(var s=n.length-2;s>0;--s)if(o=n[s].dequeue(),o){t=t.concat(ie(e,n,r,o,!0));break}}}return t}function ie(e,n,r,t,a){var i=a?[]:void 0;return l(e.inEdges(t.v),function(o){var s=e.edge(o),d=e.node(o.v);a&&i.push({v:o.v,w:o.w}),d.out-=s,he(n,r,d)}),l(e.outEdges(t.v),function(o){var s=e.edge(o),d=o.w,u=e.node(d);u.in-=s,he(n,r,u)}),e.removeNode(t.v),i}function Da(e,n){var r=new P,t=0,a=0;l(e.nodes(),function(s){r.setNode(s,{v:s,in:0,out:0})}),l(e.edges(),function(s){var d=r.edge(s.v,s.w)||0,u=n(s),f=d+u;r.setEdge(s.v,s.w,f),a=Math.max(a,r.node(s.v).out+=u),t=Math.max(t,r.node(s.w).in+=u)});var i=_(a+t+3).map(function(){return new ka}),o=t+1;return l(r.nodes(),function(s){he(i,o,r.node(s))}),{graph:r,buckets:i,zeroIdx:o}}function he(e,n,r){r.out?r.in?e[r.out-r.in+n].enqueue(r):e[e.length-1].enqueue(r):e[0].enqueue(r)}function Ba(e){var n=e.graph().acyclicer==="greedy"?Aa(e,r(e)):$a(e);l(n,function(t){var a=e.edge(t);e.removeEdge(t),a.forwardName=t.name,a.reversed=!0,e.setEdge(t.w,t.v,a,Oe("rev"))});function r(t){return function(a){return t.edge(a).weight}}}function $a(e){var n=[],r={},t={};function a(i){Object.prototype.hasOwnProperty.call(t,i)||(t[i]=!0,r[i]=!0,l(e.outEdges(i),function(o){Object.prototype.hasOwnProperty.call(r,o.w)?n.push(o):a(o.w)}),delete r[i])}return l(e.nodes(),a),n}function Fa(e){l(e.edges(),function(n){var r=e.edge(n);if(r.reversed){e.removeEdge(n);var t=r.forwardName;delete r.reversed,delete r.forwardName,e.setEdge(n.w,n.v,r,t)}})}function j(e,n,r,t){var a;do a=Oe(t);while(e.hasNode(a));return r.dummy=n,e.setNode(a,r),a}function Xa(e){var n=new P().setGraph(e.graph());return l(e.nodes(),function(r){n.setNode(r,e.node(r))}),l(e.edges(),function(r){var t=n.edge(r.v,r.w)||{weight:0,minlen:1},a=e.edge(r);n.setEdge(r.v,r.w,{weight:t.weight+a.weight,minlen:Math.max(t.minlen,a.minlen)})}),n}function In(e){var n=new P({multigraph:e.isMultigraph()}).setGraph(e.graph());return l(e.nodes(),function(r){e.children(r).length||n.setNode(r,e.node(r))}),l(e.edges(),function(r){n.setEdge(r,e.edge(r))}),n}function qe(e,n){var r=e.x,t=e.y,a=n.x-r,i=n.y-t,o=e.width/2,s=e.height/2;if(!a&&!i)throw new Error("Not possible to find intersection inside of the rectangle");var d,u;return Math.abs(i)*o>Math.abs(a)*s?(i<0&&(s=-s),d=s*a/i,u=s):(a<0&&(o=-o),d=o,u=o*i/a),{x:r+d,y:t+u}}function ae(e){var n=E(_(Rn(e)+1),function(){return[]});return l(e.nodes(),function(r){var t=e.node(r),a=t.rank;O(a)||(n[a][t.order]=r)}),n}function Ga(e){var n=$(E(e.nodes(),function(r){return e.node(r).rank}));l(e.nodes(),function(r){var t=e.node(r);Sn(t,"rank")&&(t.rank-=n)})}function Ya(e){var n=$(E(e.nodes(),function(i){return e.node(i).rank})),r=[];l(e.nodes(),function(i){var o=e.node(i).rank-n;r[o]||(r[o]=[]),r[o].push(i)});var t=0,a=e.graph().nodeRankFactor;l(r,function(i,o){O(i)&&o%a!==0?--t:t&&l(i,function(s){e.node(s).rank+=t})})}function He(e,n,r,t){var a={width:0,height:0};return arguments.length>=4&&(a.rank=r,a.order=t),j(e,"border",a,n)}function Rn(e){return C(E(e.nodes(),function(n){var r=e.node(n).rank;if(!O(r))return r}))}function Ua(e,n){var r={lhs:[],rhs:[]};return l(e,function(t){n(t)?r.lhs.push(t):r.rhs.push(t)}),r}function Va(e,n){return n()}function Wa(e){function n(r){var t=e.children(r),a=e.node(r);if(t.length&&l(t,n),Object.prototype.hasOwnProperty.call(a,"minRank")){a.borderLeft=[],a.borderRight=[];for(var i=a.minRank,o=a.maxRank+1;i<o;++i)ze(e,"borderLeft","_bl",r,a,i),ze(e,"borderRight","_br",r,a,i)}}l(e.children(),n)}function ze(e,n,r,t,a,i){var o={width:0,height:0,rank:i,borderType:n},s=a[n][i-1],d=j(e,"border",o,r);a[n][i]=d,e.setParent(d,t),s&&e.setEdge(s,d,{weight:1})}function qa(e){var n=e.graph().rankdir.toLowerCase();(n==="lr"||n==="rl")&&kn(e)}function Ha(e){var n=e.graph().rankdir.toLowerCase();(n==="bt"||n==="rl")&&za(e),(n==="lr"||n==="rl")&&(Ja(e),kn(e))}function kn(e){l(e.nodes(),function(n){Je(e.node(n))}),l(e.edges(),function(n){Je(e.edge(n))})}function Je(e){var n=e.width;e.width=e.height,e.height=n}function za(e){l(e.nodes(),function(n){oe(e.node(n))}),l(e.edges(),function(n){var r=e.edge(n);l(r.points,oe),Object.prototype.hasOwnProperty.call(r,"y")&&oe(r)})}function oe(e){e.y=-e.y}function Ja(e){l(e.nodes(),function(n){se(e.node(n))}),l(e.edges(),function(n){var r=e.edge(n);l(r.points,se),Object.prototype.hasOwnProperty.call(r,"x")&&se(r)})}function se(e){var n=e.x;e.x=e.y,e.y=n}function Ka(e){e.graph().dummyChains=[],l(e.edges(),function(n){Za(e,n)})}function Za(e,n){var r=n.v,t=e.node(r).rank,a=n.w,i=e.node(a).rank,o=n.name,s=e.edge(n),d=s.labelRank;if(i!==t+1){e.removeEdge(n);var u=void 0,f,c;for(c=0,++t;t<i;++c,++t)s.points=[],u={width:0,height:0,edgeLabel:s,edgeObj:n,rank:t},f=j(e,"edge",u,"_d"),t===d&&(u.width=s.width,u.height=s.height,u.dummy="edge-label",u.labelpos=s.labelpos),e.setEdge(r,f,{weight:s.weight},o),c===0&&e.graph().dummyChains.push(f),r=f;e.setEdge(r,a,{weight:s.weight},o)}}function Qa(e){l(e.graph().dummyChains,function(n){var r=e.node(n),t=r.edgeLabel,a;for(e.setEdge(r.edgeObj,t);r.dummy;)a=e.successors(n)[0],e.removeNode(n),t.points.push({x:r.x,y:r.y}),r.dummy==="edge-label"&&(t.x=r.x,t.y=r.y,t.width=r.width,t.height=r.height),n=a,r=e.node(n)})}function Ne(e){var n={};function r(t){var a=e.node(t);if(Object.prototype.hasOwnProperty.call(n,t))return a.rank;n[t]=!0;var i=$(E(e.outEdges(t),function(o){return r(o.w)-e.edge(o).minlen}));return(i===Number.POSITIVE_INFINITY||i===void 0||i===null)&&(i=0),a.rank=i}l(e.sources(),r)}function F(e,n){return e.node(n.w).rank-e.node(n.v).rank-e.edge(n).minlen}function _n(e){var n=new P({directed:!1}),r=e.nodes()[0],t=e.nodeCount();n.setNode(r,{});for(var a,i;ei(n,e)<t;)a=ni(n,e),i=n.hasNode(a.v)?F(e,a):-F(e,a),ri(n,e,i);return n}function ei(e,n){function r(t){l(n.nodeEdges(t),function(a){var i=a.v,o=t===i?a.w:i;!e.hasNode(o)&&!F(n,a)&&(e.setNode(o,{}),e.setEdge(t,o,{}),r(o))})}return l(e.nodes(),r),e.nodeCount()}function ni(e,n){return Le(n.edges(),function(r){if(e.hasNode(r.v)!==e.hasNode(r.w))return F(n,r)})}function ri(e,n,r){l(e.nodes(),function(t){n.node(t).rank+=r})}function ti(){}ti.prototype=new Error;function Mn(e,n,r){R(n)||(n=[n]);var t=(e.isDirected()?e.successors:e.neighbors).bind(e),a=[],i={};return l(n,function(o){if(!e.hasNode(o))throw new Error("Graph does not have node: "+o);An(e,o,r==="post",i,t,a)}),a}function An(e,n,r,t,a,i){Object.prototype.hasOwnProperty.call(t,n)||(t[n]=!0,r||i.push(n),l(a(n),function(o){An(e,o,r,t,a,i)}),r&&i.push(n))}function ai(e,n){return Mn(e,n,"post")}function ii(e,n){return Mn(e,n,"pre")}I.initLowLimValues=Te;I.initCutValues=Pe;I.calcCutValue=jn;I.leaveEdge=Bn;I.enterEdge=$n;I.exchangeEdges=Fn;function I(e){e=Xa(e),Ne(e);var n=_n(e);Te(n),Pe(n,e);for(var r,t;r=Bn(n);)t=$n(n,e,r),Fn(n,e,r,t)}function Pe(e,n){var r=ai(e,e.nodes());r=r.slice(0,r.length-1),l(r,function(t){oi(e,n,t)})}function oi(e,n,r){var t=e.node(r),a=t.parent;e.edge(r,a).cutvalue=jn(e,n,r)}function jn(e,n,r){var t=e.node(r),a=t.parent,i=!0,o=n.edge(r,a),s=0;return o||(i=!1,o=n.edge(a,r)),s=o.weight,l(n.nodeEdges(r),function(d){var u=d.v===r,f=u?d.w:d.v;if(f!==a){var c=u===i,h=n.edge(d).weight;if(s+=c?h:-h,di(e,r,f)){var b=e.edge(r,f).cutvalue;s+=c?-b:b}}}),s}function Te(e,n){arguments.length<2&&(n=e.nodes()[0]),Dn(e,{},1,n)}function Dn(e,n,r,t,a){var i=r,o=e.node(t);return n[t]=!0,l(e.neighbors(t),function(s){Object.prototype.hasOwnProperty.call(n,s)||(r=Dn(e,n,r,s,t))}),o.low=i,o.lim=r++,a?o.parent=a:delete o.parent,r}function Bn(e){return xe(e.edges(),function(n){return e.edge(n).cutvalue<0})}function $n(e,n,r){var t=r.v,a=r.w;n.hasEdge(t,a)||(t=r.w,a=r.v);var i=e.node(t),o=e.node(a),s=i,d=!1;i.lim>o.lim&&(s=o,d=!0);var u=X(n.edges(),function(f){return d===Ke(e,e.node(f.v),s)&&d!==Ke(e,e.node(f.w),s)});return Le(u,function(f){return F(n,f)})}function Fn(e,n,r,t){var a=r.v,i=r.w;e.removeEdge(a,i),e.setEdge(t.v,t.w,{}),Te(e),Pe(e,n),si(e,n)}function si(e,n){var r=xe(e.nodes(),function(a){return!n.node(a).parent}),t=ii(e,r);t=t.slice(1),l(t,function(a){var i=e.node(a).parent,o=n.edge(a,i),s=!1;o||(o=n.edge(i,a),s=!0),n.node(a).rank=n.node(i).rank+(s?o.minlen:-o.minlen)})}function di(e,n,r){return e.hasEdge(n,r)}function Ke(e,n,r){return r.low<=n.lim&&n.lim<=r.lim}function ui(e){switch(e.graph().ranker){case"network-simplex":Ze(e);break;case"tight-tree":ci(e);break;case"longest-path":fi(e);break;default:Ze(e)}}var fi=Ne;function ci(e){Ne(e),_n(e)}function Ze(e){I(e)}function li(e){var n=j(e,"root",{},"_root"),r=hi(e),t=C(k(r))-1,a=2*t+1;e.graph().nestingRoot=n,l(e.edges(),function(o){e.edge(o).minlen*=a});var i=pi(e)+1;l(e.children(),function(o){Xn(e,n,a,i,t,r,o)}),e.graph().nodeRankFactor=a}function Xn(e,n,r,t,a,i,o){var s=e.children(o);if(!s.length){o!==n&&e.setEdge(n,o,{weight:0,minlen:r});return}var d=He(e,"_bt"),u=He(e,"_bb"),f=e.node(o);e.setParent(d,o),f.borderTop=d,e.setParent(u,o),f.borderBottom=u,l(s,function(c){Xn(e,n,r,t,a,i,c);var h=e.node(c),b=h.borderTop?h.borderTop:c,p=h.borderBottom?h.borderBottom:c,g=h.borderTop?t:2*t,v=b!==p?1:a-i[o]+1;e.setEdge(d,b,{weight:g,minlen:v,nestingEdge:!0}),e.setEdge(p,u,{weight:g,minlen:v,nestingEdge:!0})}),e.parent(o)||e.setEdge(n,d,{weight:0,minlen:a+i[o]})}function hi(e){var n={};function r(t,a){var i=e.children(t);i&&i.length&&l(i,function(o){r(o,a+1)}),n[t]=a}return l(e.children(),function(t){r(t,1)}),n}function pi(e){return Q(e.edges(),function(n,r){return n+e.edge(r).weight},0)}function gi(e){var n=e.graph();e.removeNode(n.nestingRoot),delete n.nestingRoot,l(e.edges(),function(r){var t=e.edge(r);t.nestingEdge&&e.removeEdge(r)})}function vi(e,n,r){var t={},a;l(r,function(i){for(var o=e.parent(i),s,d;o;){if(s=e.parent(o),s?(d=t[s],t[s]=o):(d=a,a=o),d&&d!==o){n.setEdge(d,o);return}o=s}})}function bi(e,n,r){var t=wi(e),a=new P({compound:!0}).setGraph({root:t}).setDefaultNodeLabel(function(i){return e.node(i)});return l(e.nodes(),function(i){var o=e.node(i),s=e.parent(i);(o.rank===n||o.minRank<=n&&n<=o.maxRank)&&(a.setNode(i),a.setParent(i,s||t),l(e[r](i),function(d){var u=d.v===i?d.w:d.v,f=a.edge(u,i),c=O(f)?0:f.weight;a.setEdge(u,i,{weight:e.edge(d).weight+c})}),Object.prototype.hasOwnProperty.call(o,"minRank")&&a.setNode(i,{borderLeft:o.borderLeft[n],borderRight:o.borderRight[n]}))}),a}function wi(e){for(var n;e.hasNode(n=Oe("_root")););return n}function mi(e,n){for(var r=0,t=1;t<n.length;++t)r+=yi(e,n[t-1],n[t]);return r}function yi(e,n,r){for(var t=Ra(r,E(r,function(u,f){return f})),a=A(E(n,function(u){return G(E(e.outEdges(u),function(f){return{pos:t[f.w],weight:e.edge(f).weight}}),"pos")})),i=1;i<r.length;)i<<=1;var o=2*i-1;i-=1;var s=E(new Array(o),function(){return 0}),d=0;return l(a.forEach(function(u){var f=u.pos+i;s[f]+=u.weight;for(var c=0;f>0;)f%2&&(c+=s[f+1]),f=f-1>>1,s[f]+=u.weight;d+=u.weight*c})),d}function xi(e){var n={},r=X(e.nodes(),function(s){return!e.children(s).length}),t=C(E(r,function(s){return e.node(s).rank})),a=E(_(t+1),function(){return[]});function i(s){if(!Sn(n,s)){n[s]=!0;var d=e.node(s);a[d.rank].push(s),l(e.successors(s),i)}}var o=G(r,function(s){return e.node(s).rank});return l(o,i),a}function Ei(e,n){return E(n,function(r){var t=e.inEdges(r);if(t.length){var a=Q(t,function(i,o){var s=e.edge(o),d=e.node(o.v);return{sum:i.sum+s.weight*d.order,weight:i.weight+s.weight}},{sum:0,weight:0});return{v:r,barycenter:a.sum/a.weight,weight:a.weight}}else return{v:r}})}function Li(e,n){var r={};l(e,function(a,i){var o=r[a.v]={indegree:0,in:[],out:[],vs:[a.v],i};O(a.barycenter)||(o.barycenter=a.barycenter,o.weight=a.weight)}),l(n.edges(),function(a){var i=r[a.v],o=r[a.w];!O(i)&&!O(o)&&(o.indegree++,i.out.push(r[a.w]))});var t=X(r,function(a){return!a.indegree});return Oi(t)}function Oi(e){var n=[];function r(i){return function(o){o.merged||(O(o.barycenter)||O(i.barycenter)||o.barycenter>=i.barycenter)&&Ni(i,o)}}function t(i){return function(o){o.in.push(i),--o.indegree===0&&e.push(o)}}for(;e.length;){var a=e.pop();n.push(a),l(a.in.reverse(),r(a)),l(a.out,t(a))}return E(X(n,function(i){return!i.merged}),function(i){return J(i,["vs","i","barycenter","weight"])})}function Ni(e,n){var r=0,t=0;e.weight&&(r+=e.barycenter*e.weight,t+=e.weight),n.weight&&(r+=n.barycenter*n.weight,t+=n.weight),e.vs=n.vs.concat(e.vs),e.barycenter=r/t,e.weight=t,e.i=Math.min(n.i,e.i),n.merged=!0}function Pi(e,n){var r=Ua(e,function(f){return Object.prototype.hasOwnProperty.call(f,"barycenter")}),t=r.lhs,a=G(r.rhs,function(f){return-f.i}),i=[],o=0,s=0,d=0;t.sort(Ti(!!n)),d=Qe(i,a,d),l(t,function(f){d+=f.vs.length,i.push(f.vs),o+=f.barycenter*f.weight,s+=f.weight,d=Qe(i,a,d)});var u={vs:A(i)};return s&&(u.barycenter=o/s,u.weight=s),u}function Qe(e,n,r){for(var t;n.length&&(t=z(n)).i<=r;)n.pop(),e.push(t.vs),r++;return r}function Ti(e){return function(n,r){return n.barycenter<r.barycenter?-1:n.barycenter>r.barycenter?1:e?r.i-n.i:n.i-r.i}}function Gn(e,n,r,t){var a=e.children(n),i=e.node(n),o=i?i.borderLeft:void 0,s=i?i.borderRight:void 0,d={};o&&(a=X(a,function(p){return p!==o&&p!==s}));var u=Ei(e,a);l(u,function(p){if(e.children(p.v).length){var g=Gn(e,p.v,r,t);d[p.v]=g,Object.prototype.hasOwnProperty.call(g,"barycenter")&&Ci(p,g)}});var f=Li(u,r);Si(f,d);var c=Pi(f,t);if(o&&(c.vs=A([o,c.vs,s]),e.predecessors(o).length)){var h=e.node(e.predecessors(o)[0]),b=e.node(e.predecessors(s)[0]);Object.prototype.hasOwnProperty.call(c,"barycenter")||(c.barycenter=0,c.weight=0),c.barycenter=(c.barycenter*c.weight+h.order+b.order)/(c.weight+2),c.weight+=2}return c}function Si(e,n){l(e,function(r){r.vs=A(r.vs.map(function(t){return n[t]?n[t].vs:t}))})}function Ci(e,n){O(e.barycenter)?(e.barycenter=n.barycenter,e.weight=n.weight):(e.barycenter=(e.barycenter*e.weight+n.barycenter*n.weight)/(e.weight+n.weight),e.weight+=n.weight)}function Ii(e){var n=Rn(e),r=en(e,_(1,n+1),"inEdges"),t=en(e,_(n-1,-1,-1),"outEdges"),a=xi(e);nn(e,a);for(var i=Number.POSITIVE_INFINITY,o,s=0,d=0;d<4;++s,++d){Ri(s%2?r:t,s%4>=2),a=ae(e);var u=mi(e,a);u<i&&(d=0,o=aa(a),i=u)}nn(e,o)}function en(e,n,r){return E(n,function(t){return bi(e,t,r)})}function Ri(e,n){var r=new P;l(e,function(t){var a=t.graph().root,i=Gn(t,a,r,n);l(i.vs,function(o,s){t.node(o).order=s}),vi(t,r,i.vs)})}function nn(e,n){l(n,function(r){l(r,function(t,a){e.node(t).order=a})})}function ki(e){var n=Mi(e);l(e.graph().dummyChains,function(r){for(var t=e.node(r),a=t.edgeObj,i=_i(e,n,a.v,a.w),o=i.path,s=i.lca,d=0,u=o[d],f=!0;r!==a.w;){if(t=e.node(r),f){for(;(u=o[d])!==s&&e.node(u).maxRank<t.rank;)d++;u===s&&(f=!1)}if(!f){for(;d<o.length-1&&e.node(u=o[d+1]).minRank<=t.rank;)d++;u=o[d]}e.setParent(r,u),r=e.successors(r)[0]}})}function _i(e,n,r,t){var a=[],i=[],o=Math.min(n[r].low,n[t].low),s=Math.max(n[r].lim,n[t].lim),d,u;d=r;do d=e.parent(d),a.push(d);while(d&&(n[d].low>o||s>n[d].lim));for(u=d,d=t;(d=e.parent(d))!==u;)i.push(d);return{path:a.concat(i.reverse()),lca:u}}function Mi(e){var n={},r=0;function t(a){var i=r;l(e.children(a),t),n[a]={low:i,lim:r++}}return l(e.children(),t),n}function Ai(e,n){var r={};function t(a,i){var o=0,s=0,d=a.length,u=z(i);return l(i,function(f,c){var h=Di(e,f),b=h?e.node(h).order:d;(h||f===u)&&(l(i.slice(s,c+1),function(p){l(e.predecessors(p),function(g){var v=e.node(g),w=v.order;(w<o||b<w)&&!(v.dummy&&e.node(p).dummy)&&Yn(r,g,p)})}),s=c+1,o=b)}),i}return Q(n,t),r}function ji(e,n){var r={};function t(i,o,s,d,u){var f;l(_(o,s),function(c){f=i[c],e.node(f).dummy&&l(e.predecessors(f),function(h){var b=e.node(h);b.dummy&&(b.order<d||b.order>u)&&Yn(r,h,f)})})}function a(i,o){var s=-1,d,u=0;return l(o,function(f,c){if(e.node(f).dummy==="border"){var h=e.predecessors(f);h.length&&(d=e.node(h[0]).order,t(o,u,c,s,d),u=c,s=d)}t(o,u,o.length,d,i.length)}),o}return Q(n,a),r}function Di(e,n){if(e.node(n).dummy)return xe(e.predecessors(n),function(r){return e.node(r).dummy})}function Yn(e,n,r){if(n>r){var t=n;n=r,r=t}Object.prototype.hasOwnProperty.call(e,n)||Object.defineProperty(e,n,{enumerable:!0,configurable:!0,value:{},writable:!0});var a=e[n];Object.defineProperty(a,r,{enumerable:!0,configurable:!0,value:!0,writable:!0})}function Bi(e,n,r){if(n>r){var t=n;n=r,r=t}return!!e[n]&&Object.prototype.hasOwnProperty.call(e[n],r)}function $i(e,n,r,t){var a={},i={},o={};return l(n,function(s){l(s,function(d,u){a[d]=d,i[d]=d,o[d]=u})}),l(n,function(s){var d=-1;l(s,function(u){var f=t(u);if(f.length){f=G(f,function(g){return o[g]});for(var c=(f.length-1)/2,h=Math.floor(c),b=Math.ceil(c);h<=b;++h){var p=f[h];i[u]===u&&d<o[p]&&!Bi(r,u,p)&&(i[p]=u,i[u]=a[u]=a[p],d=o[p])}}})}),{root:a,align:i}}function Fi(e,n,r,t,a){var i={},o=Xi(e,n,r,a),s=a?"borderLeft":"borderRight";function d(c,h){for(var b=o.nodes(),p=b.pop(),g={};p;)g[p]?c(p):(g[p]=!0,b.push(p),b=b.concat(h(p))),p=b.pop()}function u(c){i[c]=o.inEdges(c).reduce(function(h,b){return Math.max(h,i[b.v]+o.edge(b))},0)}function f(c){var h=o.outEdges(c).reduce(function(p,g){return Math.min(p,i[g.w]-o.edge(g))},Number.POSITIVE_INFINITY),b=e.node(c);h!==Number.POSITIVE_INFINITY&&b.borderType!==s&&(i[c]=Math.max(i[c],h))}return d(u,o.predecessors.bind(o)),d(f,o.successors.bind(o)),l(t,function(c){i[c]=i[r[c]]}),i}function Xi(e,n,r,t){var a=new P,i=e.graph(),o=Wi(i.nodesep,i.edgesep,t);return l(n,function(s){var d;l(s,function(u){var f=r[u];if(a.setNode(f),d){var c=r[d],h=a.edge(c,f);a.setEdge(c,f,Math.max(o(e,u,d),h||0))}d=u})}),a}function Gi(e,n){return Le(k(n),function(r){var t=Number.NEGATIVE_INFINITY,a=Number.POSITIVE_INFINITY;return la(r,function(i,o){var s=qi(e,o)/2;t=Math.max(i+s,t),a=Math.min(i-s,a)}),t-a})}function Yi(e,n){var r=k(n),t=$(r),a=C(r);l(["u","d"],function(i){l(["l","r"],function(o){var s=i+o,d=e[s],u;if(d!==n){var f=k(d);u=o==="l"?t-$(f):a-C(f),u&&(e[s]=te(d,function(c){return c+u}))}})})}function Ui(e,n){return te(e.ul,function(r,t){if(n)return e[n.toLowerCase()][t];var a=G(E(e,t));return(a[1]+a[2])/2})}function Vi(e){var n=ae(e),r=le(Ai(e,n),ji(e,n)),t={},a;l(["u","d"],function(o){a=o==="u"?n:k(n).reverse(),l(["l","r"],function(s){s==="r"&&(a=E(a,function(c){return k(c).reverse()}));var d=(o==="u"?e.predecessors:e.successors).bind(e),u=$i(e,a,r,d),f=Fi(e,a,u.root,u.align,s==="r");s==="r"&&(f=te(f,function(c){return-c})),t[o+s]=f})});var i=Gi(e,t);return Yi(t,i),Ui(t,e.graph().align)}function Wi(e,n,r){return function(t,a,i){var o=t.node(a),s=t.node(i),d=0,u;if(d+=o.width/2,Object.prototype.hasOwnProperty.call(o,"labelpos"))switch(o.labelpos.toLowerCase()){case"l":u=-o.width/2;break;case"r":u=o.width/2;break}if(u&&(d+=r?u:-u),u=0,d+=(o.dummy?n:e)/2,d+=(s.dummy?n:e)/2,d+=s.width/2,Object.prototype.hasOwnProperty.call(s,"labelpos"))switch(s.labelpos.toLowerCase()){case"l":u=s.width/2;break;case"r":u=-s.width/2;break}return u&&(d+=r?u:-u),u=0,d}}function qi(e,n){return e.node(n).width}function Hi(e){e=In(e),zi(e),ha(Vi(e),function(n,r){e.node(r).x=n})}function zi(e){var n=ae(e),r=e.graph().ranksep,t=0;l(n,function(a){var i=C(E(a,function(o){return e.node(o).height}));l(a,function(o){e.node(o).y=t+i/2}),t+=i+r})}function Ji(e,n){var r=Va;r("layout",()=>{var t=r(" buildLayoutGraph",()=>so(e));r(" runLayout",()=>Ki(t,r)),r(" updateInputGraph",()=>Zi(e,t))})}function Ki(e,n){n(" makeSpaceForEdgeLabels",()=>uo(e)),n(" removeSelfEdges",()=>wo(e)),n(" acyclic",()=>Ba(e)),n(" nestingGraph.run",()=>li(e)),n(" rank",()=>ui(In(e))),n(" injectEdgeLabelProxies",()=>fo(e)),n(" removeEmptyRanks",()=>Ya(e)),n(" nestingGraph.cleanup",()=>gi(e)),n(" normalizeRanks",()=>Ga(e)),n(" assignRankMinMax",()=>co(e)),n(" removeEdgeLabelProxies",()=>lo(e)),n(" normalize.run",()=>Ka(e)),n(" parentDummyChains",()=>ki(e)),n(" addBorderSegments",()=>Wa(e)),n(" order",()=>Ii(e)),n(" insertSelfEdges",()=>mo(e)),n(" adjustCoordinateSystem",()=>qa(e)),n(" position",()=>Hi(e)),n(" positionSelfEdges",()=>yo(e)),n(" removeBorderNodes",()=>bo(e)),n(" normalize.undo",()=>Qa(e)),n(" fixupEdgeLabelCoords",()=>go(e)),n(" undoCoordinateSystem",()=>Ha(e)),n(" translateGraph",()=>ho(e)),n(" assignNodeIntersects",()=>po(e)),n(" reversePoints",()=>vo(e)),n(" acyclic.undo",()=>Fa(e))}function Zi(e,n){l(e.nodes(),function(r){var t=e.node(r),a=n.node(r);t&&(t.x=a.x,t.y=a.y,n.children(r).length&&(t.width=a.width,t.height=a.height))}),l(e.edges(),function(r){var t=e.edge(r),a=n.edge(r);t.points=a.points,Object.prototype.hasOwnProperty.call(a,"x")&&(t.x=a.x,t.y=a.y)}),e.graph().width=n.graph().width,e.graph().height=n.graph().height}var Qi=["nodesep","edgesep","ranksep","marginx","marginy"],eo={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},no=["acyclicer","ranker","rankdir","align"],ro=["width","height"],to={width:0,height:0},ao=["minlen","weight","width","height","labeloffset"],io={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},oo=["labelpos"];function so(e){var n=new P({multigraph:!0,compound:!0}),r=ue(e.graph());return n.setGraph(le({},eo,de(r,Qi),J(r,no))),l(e.nodes(),function(t){var a=ue(e.node(t));n.setNode(t,oa(de(a,ro),to)),n.setParent(t,e.parent(t))}),l(e.edges(),function(t){var a=ue(e.edge(t));n.setEdge(t,le({},io,de(a,ao),J(a,oo)))}),n}function uo(e){var n=e.graph();n.ranksep/=2,l(e.edges(),function(r){var t=e.edge(r);t.minlen*=2,t.labelpos.toLowerCase()!=="c"&&(n.rankdir==="TB"||n.rankdir==="BT"?t.width+=t.labeloffset:t.height+=t.labeloffset)})}function fo(e){l(e.edges(),function(n){var r=e.edge(n);if(r.width&&r.height){var t=e.node(n.v),a=e.node(n.w),i={rank:(a.rank-t.rank)/2+t.rank,e:n};j(e,"edge-proxy",i,"_ep")}})}function co(e){var n=0;l(e.nodes(),function(r){var t=e.node(r);t.borderTop&&(t.minRank=e.node(t.borderTop).rank,t.maxRank=e.node(t.borderBottom).rank,n=C(n,t.maxRank))}),e.graph().maxRank=n}function lo(e){l(e.nodes(),function(n){var r=e.node(n);r.dummy==="edge-proxy"&&(e.edge(r.e).labelRank=r.rank,e.removeNode(n))})}function ho(e){var n=Number.POSITIVE_INFINITY,r=0,t=Number.POSITIVE_INFINITY,a=0,i=e.graph(),o=i.marginx||0,s=i.marginy||0;function d(u){var f=u.x,c=u.y,h=u.width,b=u.height;n=Math.min(n,f-h/2),r=Math.max(r,f+h/2),t=Math.min(t,c-b/2),a=Math.max(a,c+b/2)}l(e.nodes(),function(u){d(e.node(u))}),l(e.edges(),function(u){var f=e.edge(u);Object.prototype.hasOwnProperty.call(f,"x")&&d(f)}),n-=o,t-=s,l(e.nodes(),function(u){var f=e.node(u);f.x-=n,f.y-=t}),l(e.edges(),function(u){var f=e.edge(u);l(f.points,function(c){c.x-=n,c.y-=t}),Object.prototype.hasOwnProperty.call(f,"x")&&(f.x-=n),Object.prototype.hasOwnProperty.call(f,"y")&&(f.y-=t)}),i.width=r-n+o,i.height=a-t+s}function po(e){l(e.edges(),function(n){var r=e.edge(n),t=e.node(n.v),a=e.node(n.w),i,o;r.points?(i=r.points[0],o=r.points[r.points.length-1]):(r.points=[],i=a,o=t),r.points.unshift(qe(t,i)),r.points.push(qe(a,o))})}function go(e){l(e.edges(),function(n){var r=e.edge(n);if(Object.prototype.hasOwnProperty.call(r,"x"))switch((r.labelpos==="l"||r.labelpos==="r")&&(r.width-=r.labeloffset),r.labelpos){case"l":r.x-=r.width/2+r.labeloffset;break;case"r":r.x+=r.width/2+r.labeloffset;break}})}function vo(e){l(e.edges(),function(n){var r=e.edge(n);r.reversed&&r.points.reverse()})}function bo(e){l(e.nodes(),function(n){if(e.children(n).length){var r=e.node(n),t=e.node(r.borderTop),a=e.node(r.borderBottom),i=e.node(z(r.borderLeft)),o=e.node(z(r.borderRight));r.width=Math.abs(o.x-i.x),r.height=Math.abs(a.y-t.y),r.x=i.x+r.width/2,r.y=t.y+r.height/2}}),l(e.nodes(),function(n){e.node(n).dummy==="border"&&e.removeNode(n)})}function wo(e){l(e.edges(),function(n){if(n.v===n.w){var r=e.node(n.v);r.selfEdges||(r.selfEdges=[]),r.selfEdges.push({e:n,label:e.edge(n)}),e.removeEdge(n)}})}function mo(e){var n=ae(e);l(n,function(r){var t=0;l(r,function(a,i){var o=e.node(a);o.order=i+t,l(o.selfEdges,function(s){j(e,"selfedge",{width:s.label.width,height:s.label.height,rank:o.rank,order:i+ ++t,e:s.e,label:s.label},"_se")}),delete o.selfEdges})})}function yo(e){l(e.nodes(),function(n){var r=e.node(n);if(r.dummy==="selfedge"){var t=e.node(r.e.v),a=t.x+t.width/2,i=t.y,o=r.x-a,s=t.height/2;e.setEdge(r.e,r.label),e.removeNode(n),r.label.points=[{x:a+2*o/3,y:i-s},{x:a+5*o/6,y:i-s},{x:a+o,y:i},{x:a+5*o/6,y:i+s},{x:a+2*o/3,y:i+s}],r.label.x=r.x,r.label.y=r.y}})}function de(e,n){return te(J(e,n),Number)}function ue(e){var n={};return l(e,function(r,t){n[t.toLowerCase()]=r}),n}var rn=x((e,n,r)=>Math.max(n,Math.min(r,e)),"clamp"),tn=x((e="TB")=>{switch(e){case"BT":return"bottom";case"LR":return"right";case"RL":return"left";case"TB":default:return"top"}},"getDefaultSelfLoopSide"),xo=x(e=>e==="flowchart"||e==="flowchart-v2"||e==="stateDiagram"||e==="er"||e==="classDiagram","shouldMergeSelfLoopSegments"),Eo=["x","y","width","height","labelBBox","intersect","calcIntersect","diff","clusterNode"],Lo=x((e,n,r,t,a)=>{const i=[],o=new Set;if(r.forEach(({start:f,end:c})=>{f!==t&&o.add(f),c!==t&&o.add(c)}),o.forEach(f=>{const c=e.node(f);typeof(c==null?void 0:c.x)=="number"&&typeof(c==null?void 0:c.y)=="number"&&i.push(c)}),i.length===0&&r.forEach(({edge:f})=>{(f.points??[]).forEach(c=>{typeof(c==null?void 0:c.x)=="number"&&typeof(c==null?void 0:c.y)=="number"&&i.push(c)})}),i.length===0)return tn(a);const s=i.reduce((f,c)=>({x:f.x+c.x/i.length,y:f.y+c.y/i.length}),{x:0,y:0}),d=s.x-n.x,u=s.y-n.y;return Math.abs(d)>Math.abs(u)?d>0?"right":"left":Math.abs(u)>0?u>0?"bottom":"top":tn(a)},"getSelfLoopSide"),Oo=x((e,n="top",r=0,t=0)=>{const a=e.x,i=e.y-r,o=e.width/2,s=e.height/2,d=Math.max(36,Math.min(100,e.width*.8)),u=rn(Math.max(t,e.width*.35),36,d),f=rn(Math.min(e.width,e.height)*.45,24,48);switch(n){case"bottom":{const c=i+s;return[{x:a-u/2,y:c},{x:a-u/2,y:c+f},{x:a+u/2,y:c+f},{x:a+u/2,y:c}]}case"right":{const c=a+o;return[{x:c,y:i-u/2},{x:c+f,y:i-u/2},{x:c+f,y:i+u/2},{x:c,y:i+u/2}]}case"left":{const c=a-o;return[{x:c,y:i-u/2},{x:c-f,y:i-u/2},{x:c-f,y:i+u/2},{x:c,y:i+u/2}]}case"top":default:{const c=i-s;return[{x:a-u/2,y:c},{x:a-u/2,y:c-f},{x:a+u/2,y:c-f},{x:a+u/2,y:c}]}}},"getSelfLoopPoints"),No=x((e,n,r="top",t=0,a={})=>{const o=e.x,s=e.y-t,d=a.width??0,u=a.height??0;switch(r){case"bottom":return{x:o,y:Math.max(...n.map(f=>f.y))+u/2+4};case"right":return{x:Math.max(...n.map(f=>f.x))+d/2+4,y:s};case"left":return{x:Math.min(...n.map(f=>f.x))-d/2-4,y:s};case"top":default:return{x:o,y:Math.min(...n.map(f=>f.y))-u/2-4}}},"getSelfLoopLabelPosition"),Un=x((e,n=0,{mergeSelfLoops:r=!0}={})=>{var o;const t=new Map,a=[],i=(o=e.graph())==null?void 0:o.rankdir;return e.edges().forEach(s=>{const d=e.edge(s);if(r&&d.selfLoop){const u=d.selfLoop.id;t.has(u)||t.set(u,[]),t.get(u).push({edge:d,start:s.v,end:s.w})}else a.push({edge:d,start:s.v,end:s.w})}),t.forEach(s=>{if(s.length!==3){s.forEach(L=>a.push(L));return}s.sort((L,S)=>L.edge.selfLoop.order-S.edge.selfLoop.order);const[d,u,f]=s,c=d.edge.originalEdge??u.edge.originalEdge??f.edge.originalEdge??u.edge,h=e.node(c.start);if(!h){s.forEach(L=>a.push(L));return}const b={width:u.edge.width,height:u.edge.height},p=Lo(e,h,s,c.start,i),g=Oo(h,p,n,b.width??0),v=No(h,g,p,n,b),w={...u.edge,...c,id:c.id,points:g,start:c.start,end:c.end,x:v.x,y:v.y,width:b.width,height:b.height,labelStyle:u.edge.labelStyle,fromCluster:d.edge.fromCluster??u.edge.fromCluster??f.edge.fromCluster,toCluster:d.edge.toCluster??u.edge.toCluster??f.edge.toCluster};delete w.selfLoop,delete w.originalEdge,a.push({edge:w,start:w.start,end:w.end})}),a},"getEdgesToRender"),Vn=x(async({element:e,graph:n,diagramType:r,id:t,parentCluster:a,siteConfig:i})=>{const o=n.graph().rankdir;m.trace("Dir in recursive render - dir:",o);const{clusters:s,edgePaths:d,edgeLabels:u,nodes:f,rootGroups:c}=Jn(e,{edgePathsClass:"edgePaths"});n.nodes()?m.info("Recursive render XXX",n.nodes()):m.info("No nodes found for",n),n.edges().length>0&&m.info("Recursive edges",n.edge(n.edges()[0]));const h=xo(r);await Promise.all(n.nodes().map(async function(g){const v=n.node(g);if(a!==void 0){const w=JSON.parse(JSON.stringify(a.clusterData));m.trace(`Setting data for parent cluster XXX
2
- Node.id = `,g,`
3
- data=`,w.height,`
4
- Parent cluster`,a.height),n.setNode(a.id,w),n.parent(g)||(m.trace("Setting parent",g,a.id),n.setParent(g,a.id,w))}if(m.info("(Insert) Node XXX"+g+": "+JSON.stringify(n.node(g))),v!=null&&v.clusterNode){m.info("Cluster identified XBX",g,v.width,n.node(g));const{ranksep:w,nodesep:L}=n.graph();v.graph.setGraph({...v.graph.graph(),ranksep:w+25,nodesep:L});const S=await Io({element:f,graph:v.graph,diagramType:r,id:t,parentCluster:n.node(g),siteConfig:i}),D=S.elem;Qn(v,D),v.diff=S.diff||0,m.info("New compound node after recursive render XAX",g,"width",v.width,"height",v.height),er(D,v)}else n.children(g).length>0?(m.trace("Cluster - the non recursive path XBX",g,v.id,v,v.width,"Graph:",n),m.trace(Ce(v.id,n)),T.set(v.id,{id:Ce(v.id,n),node:v})):(m.trace("Node - the non recursive path XAX",g,f,n.node(g),o),await Kn(f,n.node(g),{config:i,dir:o}))})),await x(async()=>{const g=n.edges().map(async function(v){var L,S,D,Se;const w=n.edge(v.v,v.w,v.name);if(m.info("Edge "+v.v+" -> "+v.w+": "+JSON.stringify(v)),m.info("Edge "+v.v+" -> "+v.w+": ",v," ",JSON.stringify(n.edge(v))),m.info("Fix",T,"ids:",v.v,v.w,"Translating: ",T.get(v.v),T.get(v.w)),h&&w.selfLoop){if(w.selfLoop.order!==1)return;const Y={...w.originalEdge,...w,id:w.selfLoop.id,startLabelLeft:((L=w.originalEdge)==null?void 0:L.startLabelLeft)??w.startLabelLeft,startLabelRight:((S=w.originalEdge)==null?void 0:S.startLabelRight)??w.startLabelRight,endLabelLeft:((D=w.originalEdge)==null?void 0:D.endLabelLeft)??w.endLabelLeft,endLabelRight:((Se=w.originalEdge)==null?void 0:Se.endLabelRight)??w.endLabelRight};await Ie(u,Y),w.width=Y.width,w.height=Y.height,w.labelStyle=Y.labelStyle;return}await Ie(u,w)});await Promise.all(g)},"processEdges")();const{subGraphTitleTotalMargin:p}=nr(i);return{elem:c,graph:n,groups:{clusters:s,edgePaths:d,edgeLabels:u,nodes:f,rootGroups:c},diagramType:r,id:t,mergeSelfLoops:h,subGraphTitleTotalMargin:p}},"measureDagreGraph"),Wn=x(e=>{m.info("############################################# XXX"),m.info("### Layout ### XXX"),m.info("############################################# XXX"),Ji(e)},"runDagreGraphLayout"),Po=x((e,n,r)=>{const t=e.node(n);if(!t)return;const a={...t};return t!=null&&t.clusterNode?a.y=(t.y??0)+r:e.children(n).length>0?a.height=(t.height??0)+r:a.y=(t.y??0)+r/2,a},"normalizeDagreNode"),an=x((e,n)=>{Eo.forEach(r=>{n[r]!==void 0&&(e[r]=n[r])})},"applyDagreNodeLayout"),To=x((e,n,r,t)=>({...e,start:e.start??n,end:e.end??r,points:(e.points??[]).map(a=>({...a,y:typeof a.y=="number"?a.y+t:a.y}))}),"normalizeDagreEdge"),So=x((e,n)=>{const{graph:r,mergeSelfLoops:t,subGraphTitleTotalMargin:a=0}=n,i=new Map(e.nodes.map(s=>[s.id,s]));pe(r).forEach(s=>{const d=Po(r,s,a);if(!d)return;an(r.node(s),d);const u=i.get(s);u&&an(u,d)});const o=a/2;return e.edges=Un(r,o,{mergeSelfLoops:t}).map(({edge:s,start:d,end:u})=>To(s,d,u,o)),e},"applyDagreLayoutResult"),Co=x(async({elem:e,graph:n,groups:{clusters:r,edgePaths:t},diagramType:a,id:i,mergeSelfLoops:o,subGraphTitleTotalMargin:s})=>{let d=0;await Promise.all(pe(n).map(async function(c){var b;const h=n.node(c);if(m.info("Position XBX => "+c+": ("+h.x,","+h.y,") width: ",h.width," height: ",h.height),h!=null&&h.clusterNode)h.y+=s,m.info("A tainted cluster node XBX1",c,h.id,h.width,h.height,h.x,h.y,n.parent(c)),T.get(h.id).node=h,Re(h);else if(n.children(c).length>0){m.info("A pure cluster node XBX1",c,h.id,h.x,h.y,h.width,h.height,n.parent(c)),h.height+=s,n.node(h.parentId);const p=(h==null?void 0:h.padding)/2||0,g=((b=h==null?void 0:h.labelBBox)==null?void 0:b.height)||0,v=g-p||0;m.debug("OffsetY",v,"labelHeight",g,"halfPadding",p),await rr(r,h),T.get(h.id).node=h}else{const p=n.node(h.parentId);h.y+=s/2,m.info("A regular node XBX1 - using the padding",h.id,"parent",h.parentId,h.width,h.height,h.x,h.y,"offsetY",h.offsetY,"parent",p,p==null?void 0:p.offsetY,h),Re(h)}}));const u=s/2;return Un(n,u,{mergeSelfLoops:o}).forEach(function({edge:c,start:h,end:b}){m.info("Edge "+h+" -> "+b+": "+JSON.stringify(c),c),c.points.forEach(w=>w.y+=u);const p=n.node(h),g=n.node(b),v=tr(t,c,T,a,p,g,i);ar(c,v)}),n.nodes().forEach(function(c){const h=n.node(c);m.info(c,h.type,h.diff),h.isGroup&&(d=h.diff)}),m.warn("Returning from recursive render XAX",e,d),{elem:e,diff:d}},"paintDagreLayoutCore"),Io=x(async e=>{const n=await Vn(e);return Wn(n.graph),await Co(n)},"renderDagreSubgraph"),qn=x(e=>{var r,t,a,i,o,s;const n=new P({multigraph:!0,compound:!0}).setGraph({rankdir:e.direction,nodesep:((r=e.config)==null?void 0:r.nodeSpacing)||e.nodeSpacing||((a=(t=e.config)==null?void 0:t.flowchart)==null?void 0:a.nodeSpacing),ranksep:((i=e.config)==null?void 0:i.rankSpacing)||e.rankSpacing||((s=(o=e.config)==null?void 0:o.flowchart)==null?void 0:s.rankSpacing),marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});return e.nodes.forEach(d=>{n.setNode(d.id,{...d}),d.parentId&&n.setParent(d.id,d.parentId)}),m.debug("Edges:",e.edges),e.edges.forEach(d=>{if(d.start===d.end){const u=d.start,f=u+"---"+u+"---1",c=u+"---"+u+"---2",h=n.node(u);n.setNode(f,{domId:f,id:f,parentId:h.parentId,labelStyle:"",label:"",padding:0,shape:"labelRect",style:"",width:10,height:10}),n.setParent(f,h.parentId),n.setNode(c,{domId:c,id:c,parentId:h.parentId,labelStyle:"",padding:0,shape:"labelRect",label:"",style:"",width:10,height:10}),n.setParent(c,h.parentId);const b=structuredClone(d),p=structuredClone(d),g=structuredClone(d),v=structuredClone(d);p.originalEdge=b,p.selfLoop={id:b.id,order:0},g.originalEdge=b,g.selfLoop={id:b.id,order:1},v.originalEdge=b,v.selfLoop={id:b.id,order:2},p.label="",p.arrowTypeEnd="none",p.endLabelLeft="",p.endLabelRight="",p.startLabelLeft="",p.id=u+"-cyclic-special-1",g.startLabelRight="",g.startLabelLeft="",g.endLabelLeft="",g.endLabelRight="",g.arrowTypeStart="none",g.arrowTypeEnd="none",g.id=u+"-cyclic-special-mid",v.label="",v.startLabelRight="",v.startLabelLeft="",v.arrowTypeStart="none",h.isGroup&&(p.fromCluster=u,v.toCluster=u),v.id=u+"-cyclic-special-2",v.arrowTypeStart="none",n.setEdge(u,f,p,u+"-cyclic-special-0"),n.setEdge(f,c,g,u+"-cyclic-special-1"),n.setEdge(c,u,v,u+"-cyclic-special-2")}else n.setEdge(d.start,d.end,{...d},d.id)}),Hn(n),{graph:n}},"prepareLayoutForDagre"),Ro=x(async(e,{element:n,preparedLayout:r})=>{const t=r??qn(e),a=Zn(),i=await Vn({element:n,graph:t.graph,diagramType:e.type,id:e.diagramId,parentCluster:void 0,siteConfig:a});return t.measuredLayout=i,i},"measureDagreLayout"),ko=x((e,n)=>{var t;const r=(t=n.preparedLayout)==null?void 0:t.measuredLayout;if(!r)throw new Error("runDagreLayoutCore requires measureDagreLayout to run first");return Wn(r.graph),So(e,r),r},"runDagreLayoutCore"),_o=x((e,{measure:n})=>pe(n.graph).map(r=>n.graph.node(r)).filter(Boolean),"getDagrePaintNodes"),Mo=x((e,n,{measure:r})=>e?r.graph.node(e):void 0,"getDagreEdgeNode"),$o=zn({prepareLayout:qn,measureLayout:Ro,runLayoutCore:ko,paintOptions:{clusterDb:T,getNodes:_o,getEdgeNode:Mo,skipNode:x((e,{measure:n})=>!n.graph.hasNode(e.id),"skipNode"),isCluster:x((e,{measure:n})=>n.graph.hasNode(e.id)&&(n.graph.children(e.id)??[]).length>0,"isCluster")}});export{So as applyDagreLayoutResult,Un as getEdgesToRender,Ro as measureDagreLayout,qn as prepareLayoutForDagre,$o as render,ko as runDagreLayoutCore};
@@ -1,24 +0,0 @@
1
- import{p as ge}from"./chunk-JWPE2WC7-D6dXb_jr.js";import{_ as w,Q as ye,K as ae,M as ee,P as Se,d as ve,l as te,bh as B,b as xe,a as be,p as we,q as Ce,g as Te,s as Le,N as $e,bi as Ae,z as Fe}from"./mermaid.core-D_Dp_Kl2.js";import{s as Ne}from"./chunk-VQ5W62QI-CnHdSEMi.js";import{p as Me}from"./cynefin-EF2NZ3EQ-OZotFKUu.js";import{s as K}from"./index-BKxAxaVG.js";import{b as O}from"./defaultLocale-DX6XiGOO.js";import{o as J}from"./ordinal-Cboi1Yqb.js";import"./init-Gi6I4Gst.js";function _e(t){var a=0,l=t.children,n=l&&l.length;if(!n)a=1;else for(;--n>=0;)a+=l[n].value;t.value=a}function ke(){return this.eachAfter(_e)}function ze(t,a){let l=-1;for(const n of this)t.call(a,n,++l,this);return this}function Ve(t,a){for(var l=this,n=[l],r,s,h=-1;l=n.pop();)if(t.call(a,l,++h,this),r=l.children)for(s=r.length-1;s>=0;--s)n.push(r[s]);return this}function De(t,a){for(var l=this,n=[l],r=[],s,h,d,g=-1;l=n.pop();)if(r.push(l),s=l.children)for(h=0,d=s.length;h<d;++h)n.push(s[h]);for(;l=r.pop();)t.call(a,l,++g,this);return this}function Pe(t,a){let l=-1;for(const n of this)if(t.call(a,n,++l,this))return n}function Be(t){return this.eachAfter(function(a){for(var l=+t(a.data)||0,n=a.children,r=n&&n.length;--r>=0;)l+=n[r].value;a.value=l})}function Ee(t){return this.eachBefore(function(a){a.children&&a.children.sort(t)})}function Re(t){for(var a=this,l=We(a,t),n=[a];a!==l;)a=a.parent,n.push(a);for(var r=n.length;t!==l;)n.splice(r,0,t),t=t.parent;return n}function We(t,a){if(t===a)return t;var l=t.ancestors(),n=a.ancestors(),r=null;for(t=l.pop(),a=n.pop();t===a;)r=t,t=l.pop(),a=n.pop();return r}function He(){for(var t=this,a=[t];t=t.parent;)a.push(t);return a}function Ie(){return Array.from(this)}function Oe(){var t=[];return this.eachBefore(function(a){a.children||t.push(a)}),t}function qe(){var t=this,a=[];return t.each(function(l){l!==t&&a.push({source:l.parent,target:l})}),a}function*Ge(){var t=this,a,l=[t],n,r,s;do for(a=l.reverse(),l=[];t=a.pop();)if(yield t,n=t.children)for(r=0,s=n.length;r<s;++r)l.push(n[r]);while(l.length)}function ne(t,a){t instanceof Map?(t=[void 0,t],a===void 0&&(a=je)):a===void 0&&(a=Ye);for(var l=new Q(t),n,r=[l],s,h,d,g;n=r.pop();)if((h=a(n.data))&&(g=(h=Array.from(h)).length))for(n.children=h,d=g-1;d>=0;--d)r.push(s=h[d]=new Q(h[d])),s.parent=n,s.depth=n.depth+1;return l.eachBefore(Qe)}function Xe(){return ne(this).eachBefore(Ke)}function Ye(t){return t.children}function je(t){return Array.isArray(t)?t[1]:null}function Ke(t){t.data.value!==void 0&&(t.value=t.data.value),t.data=t.data.data}function Qe(t){var a=0;do t.height=a;while((t=t.parent)&&t.height<++a)}function Q(t){this.data=t,this.depth=this.height=0,this.parent=null}Q.prototype=ne.prototype={constructor:Q,count:ke,each:ze,eachAfter:De,eachBefore:Ve,find:Pe,sum:Be,sort:Ee,path:Re,ancestors:He,descendants:Ie,leaves:Oe,links:qe,copy:Xe,[Symbol.iterator]:Ge};function Ue(t){if(typeof t!="function")throw new Error;return t}function q(){return 0}function G(t){return function(){return t}}function Ze(t){t.x0=Math.round(t.x0),t.y0=Math.round(t.y0),t.x1=Math.round(t.x1),t.y1=Math.round(t.y1)}function Je(t,a,l,n,r){for(var s=t.children,h,d=-1,g=s.length,c=t.value&&(n-a)/t.value;++d<g;)h=s[d],h.y0=l,h.y1=r,h.x0=a,h.x1=a+=h.value*c}function et(t,a,l,n,r){for(var s=t.children,h,d=-1,g=s.length,c=t.value&&(r-l)/t.value;++d<g;)h=s[d],h.x0=a,h.x1=n,h.y0=l,h.y1=l+=h.value*c}var tt=(1+Math.sqrt(5))/2;function at(t,a,l,n,r,s){for(var h=[],d=a.children,g,c,u=0,b=0,i=d.length,x,S,v=a.value,p,y,M,A,V,W,_;u<i;){x=r-l,S=s-n;do p=d[b++].value;while(!p&&b<i);for(y=M=p,W=Math.max(S/x,x/S)/(v*t),_=p*p*W,V=Math.max(M/_,_/y);b<i;++b){if(p+=c=d[b].value,c<y&&(y=c),c>M&&(M=c),_=p*p*W,A=Math.max(M/_,_/y),A>V){p-=c;break}V=A}h.push(g={value:p,dice:x<S,children:d.slice(u,b)}),g.dice?Je(g,l,n,r,v?n+=S*p/v:s):et(g,l,n,v?l+=x*p/v:r,s),v-=p,u=b}return h}const nt=function t(a){function l(n,r,s,h,d){at(a,n,r,s,h,d)}return l.ratio=function(n){return t((n=+n)>1?n:1)},l}(tt);function lt(){var t=nt,a=!1,l=1,n=1,r=[0],s=q,h=q,d=q,g=q,c=q;function u(i){return i.x0=i.y0=0,i.x1=l,i.y1=n,i.eachBefore(b),r=[0],a&&i.eachBefore(Ze),i}function b(i){var x=r[i.depth],S=i.x0+x,v=i.y0+x,p=i.x1-x,y=i.y1-x;p<S&&(S=p=(S+p)/2),y<v&&(v=y=(v+y)/2),i.x0=S,i.y0=v,i.x1=p,i.y1=y,i.children&&(x=r[i.depth+1]=s(i)/2,S+=c(i)-x,v+=h(i)-x,p-=d(i)-x,y-=g(i)-x,p<S&&(S=p=(S+p)/2),y<v&&(v=y=(v+y)/2),t(i,S,v,p,y))}return u.round=function(i){return arguments.length?(a=!!i,u):a},u.size=function(i){return arguments.length?(l=+i[0],n=+i[1],u):[l,n]},u.tile=function(i){return arguments.length?(t=Ue(i),u):t},u.padding=function(i){return arguments.length?u.paddingInner(i).paddingOuter(i):u.paddingInner()},u.paddingInner=function(i){return arguments.length?(s=typeof i=="function"?i:G(+i),u):s},u.paddingOuter=function(i){return arguments.length?u.paddingTop(i).paddingRight(i).paddingBottom(i).paddingLeft(i):u.paddingTop()},u.paddingTop=function(i){return arguments.length?(h=typeof i=="function"?i:G(+i),u):h},u.paddingRight=function(i){return arguments.length?(d=typeof i=="function"?i:G(+i),u):d},u.paddingBottom=function(i){return arguments.length?(g=typeof i=="function"?i:G(+i),u):g},u.paddingLeft=function(i){return arguments.length?(c=typeof i=="function"?i:G(+i),u):c},u}var R,oe=(R=class{constructor(){this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.setAccTitle=xe,this.getAccTitle=be,this.setDiagramTitle=we,this.getDiagramTitle=Ce,this.getAccDescription=Te,this.setAccDescription=Le}getNodes(){return this.nodes}getConfig(){const a=$e,l=ae();return ee({...a.treemap,...l.treemap??{}})}addNode(a,l){this.nodes.push(a),this.levels.set(a,l),l===0&&(this.outerNodes.push(a),this.root??(this.root=a))}getRoot(){return{name:"",children:this.outerNodes}}addClass(a,l){const n=this.classes.get(a)??{id:a,styles:[],textStyles:[]},r=l.replace(/\\,/g,"§§§").replace(/,/g,";").replace(/§§§/g,",").split(";");r&&r.forEach(s=>{Ae(s)&&(n!=null&&n.textStyles?n.textStyles.push(s):n.textStyles=[s]),n!=null&&n.styles?n.styles.push(s):n.styles=[s]}),this.classes.set(a,n)}getClasses(){return this.classes}getStylesForClass(a){var l;return((l=this.classes.get(a))==null?void 0:l.styles)??[]}clear(){Fe(),this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.root=void 0}},w(R,"TreeMapDB"),R);function ce(t){if(!t.length)return[];const a=[],l=[];return t.forEach(n=>{const r={name:n.name,children:n.type==="Leaf"?void 0:[]};for(r.classSelector=n==null?void 0:n.classSelector,n!=null&&n.cssCompiledStyles&&(r.cssCompiledStyles=n.cssCompiledStyles),n.type==="Leaf"&&n.value!==void 0&&(r.value=n.value);l.length>0&&l[l.length-1].level>=n.level;)l.pop();if(l.length===0)a.push(r);else{const s=l[l.length-1].node;s.children?s.children.push(r):s.children=[r]}n.type!=="Leaf"&&l.push({node:r,level:n.level})}),a}w(ce,"buildHierarchy");var rt=w((t,a)=>{ge(t,a);const l=[];for(const s of t.TreemapRows??[])s.$type==="ClassDefStatement"&&a.addClass(s.className??"",s.styleText??"");for(const s of t.TreemapRows??[]){const h=s.item;if(!h)continue;const d=s.indent?parseInt(s.indent):0,g=st(h),c=h.classSelector?a.getStylesForClass(h.classSelector):[],u=c.length>0?c:void 0,b={level:d,name:g,type:h.$type,value:h.value,classSelector:h.classSelector,cssCompiledStyles:u};l.push(b)}const n=ce(l),r=w((s,h)=>{for(const d of s)a.addNode(d,h),d.children&&d.children.length>0&&r(d.children,h+1)},"addNodesRecursively");r(n,0)},"populate"),st=w(t=>t.name?String(t.name):"","getItemName"),he={parser:{yy:void 0},parse:w(async t=>{var a;try{const n=await Me("treemap",t);te.debug("Treemap AST:",n);const r=(a=he.parser)==null?void 0:a.yy;if(!(r instanceof oe))throw new Error("parser.parser?.yy was not a TreemapDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");rt(n,r)}catch(l){throw te.error("Error parsing treemap:",l),l}},"parse")},it=10,E=10,X=25,ot=w((t,a,l,n)=>{const r=n.db,s=r.getConfig(),h=s.padding??it,d=r.getDiagramTitle(),g=r.getRoot(),{themeVariables:c}=ae();if(!g)return;const u=d?30:0,b=Se(a),i=s.nodeWidth?s.nodeWidth*E:960,x=s.nodeHeight?s.nodeHeight*E:500,S=i,v=x+u;b.attr("viewBox",`0 0 ${S} ${v}`),ve(b,v,S,s.useMaxWidth);let p;try{const e=s.valueFormat||",";if(e==="$0,0")p=w(o=>"$"+O(",")(o),"valueFormat");else if(e.startsWith("$")&&e.includes(",")){const o=/\.\d+/.exec(e),f=o?o[0]:"";p=w(C=>"$"+O(","+f)(C),"valueFormat")}else if(e.startsWith("$")){const o=e.substring(1);p=w(f=>"$"+O(o||"")(f),"valueFormat")}else p=O(e)}catch(e){te.error("Error creating format function:",e),p=O(",")}const y=J().range(["transparent",c.cScale0,c.cScale1,c.cScale2,c.cScale3,c.cScale4,c.cScale5,c.cScale6,c.cScale7,c.cScale8,c.cScale9,c.cScale10,c.cScale11]),M=J().range(["transparent",c.cScalePeer0,c.cScalePeer1,c.cScalePeer2,c.cScalePeer3,c.cScalePeer4,c.cScalePeer5,c.cScalePeer6,c.cScalePeer7,c.cScalePeer8,c.cScalePeer9,c.cScalePeer10,c.cScalePeer11]),A=J().range([c.cScaleLabel0,c.cScaleLabel1,c.cScaleLabel2,c.cScaleLabel3,c.cScaleLabel4,c.cScaleLabel5,c.cScaleLabel6,c.cScaleLabel7,c.cScaleLabel8,c.cScaleLabel9,c.cScaleLabel10,c.cScaleLabel11]);d&&b.append("text").attr("x",S/2).attr("y",u/2).attr("class","treemapTitle").attr("text-anchor","middle").attr("dominant-baseline","middle").text(d);const V=b.append("g").attr("transform",`translate(0, ${u})`).attr("class","treemapContainer"),W=ne(g).sum(e=>e.value??0).sort((e,o)=>(o.value??0)-(e.value??0)),le=lt().size([i,x]).paddingTop(e=>e.children&&e.children.length>0?X+E:0).paddingInner(h).paddingLeft(e=>e.children&&e.children.length>0?E:0).paddingRight(e=>e.children&&e.children.length>0?E:0).paddingBottom(e=>e.children&&e.children.length>0?E:0).round(!0)(W),de=le.descendants().filter(e=>e.children&&e.children.length>0),H=V.selectAll(".treemapSection").data(de).enter().append("g").attr("class","treemapSection").attr("transform",e=>`translate(${e.x0},${e.y0})`);H.append("rect").attr("width",e=>e.x1-e.x0).attr("height",X).attr("class","treemapSectionHeader").attr("fill","none").attr("fill-opacity",.6).attr("stroke-width",.6).attr("style",e=>e.depth===0?"display: none;":""),H.append("clipPath").attr("id",(e,o)=>`clip-section-${a}-${o}`).append("rect").attr("width",e=>Math.max(0,e.x1-e.x0-12)).attr("height",X),H.append("rect").attr("width",e=>e.x1-e.x0).attr("height",e=>e.y1-e.y0).attr("class",(e,o)=>`treemapSection section${o}`).attr("fill",e=>y(e.data.name)).attr("fill-opacity",.6).attr("stroke",e=>M(e.data.name)).attr("stroke-width",2).attr("stroke-opacity",.4).attr("style",e=>{if(e.depth===0)return"display: none;";const o=B({cssCompiledStyles:e.data.cssCompiledStyles});return o.nodeStyles+";"+o.borderStyles.join(";")}),H.append("text").attr("class","treemapSectionLabel").attr("x",6).attr("y",X/2).attr("dominant-baseline","middle").text(e=>e.depth===0?"":e.data.name).attr("font-weight","bold").attr("clip-path",(e,o)=>`url(#clip-section-${a}-${o})`).attr("style",e=>{if(e.depth===0)return"display: none;";const o="dominant-baseline: middle; font-size: 12px; fill:"+A(e.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",f=B({cssCompiledStyles:e.data.cssCompiledStyles});return o+f.labelStyles.replace("color:","fill:")}).each(function(e){if(e.depth===0)return;const o=K(this),f=e.data.name;o.text(f);const C=e.x1-e.x0,L=6;let T;s.showValues!==!1&&e.value?T=C-10-30-10-L:T=C-L-6;const m=Math.max(15,T),k=o.node();if(k.getComputedTextLength()>m){const $="...";let z=f;for(;z.length>0;){if(z=f.substring(0,z.length-1),z.length===0){o.text($),k.getComputedTextLength()>m&&o.text("");break}if(o.text(z+$),k.getComputedTextLength()<=m)break}}}),s.showValues!==!1&&H.append("text").attr("class","treemapSectionValue").attr("x",e=>e.x1-e.x0-10).attr("y",X/2).attr("text-anchor","end").attr("dominant-baseline","middle").text(e=>e.value?p(e.value):"").attr("font-style","italic").attr("style",e=>{if(e.depth===0)return"display: none;";const o="text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:"+A(e.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",f=B({cssCompiledStyles:e.data.cssCompiledStyles});return o+f.labelStyles.replace("color:","fill:")});const re=le.leaves(),F=re.length>20,ue=F?16:38,Y=F?14:28,D=F?4:8,I=F?4:6,U=F?2:4,se=F?8:10,Z=F?1:2,j=V.selectAll(".treemapLeafGroup").data(re).enter().append("g").attr("class",(e,o)=>`treemapNode treemapLeafGroup leaf${o}${e.data.classSelector?` ${e.data.classSelector}`:""}x`).attr("transform",e=>`translate(${e.x0},${e.y0})`);j.append("rect").attr("width",e=>e.x1-e.x0).attr("height",e=>e.y1-e.y0).attr("class","treemapLeaf").attr("fill",e=>e.parent?y(e.parent.data.name):y(e.data.name)).attr("style",e=>B({cssCompiledStyles:e.data.cssCompiledStyles}).nodeStyles).attr("fill-opacity",.3).attr("stroke",e=>e.parent?y(e.parent.data.name):y(e.data.name)).attr("stroke-width",3),j.append("clipPath").attr("id",(e,o)=>`clip-${a}-${o}`).append("rect").attr("width",e=>Math.max(0,e.x1-e.x0-4)).attr("height",e=>Math.max(0,e.y1-e.y0-4)),j.append("text").attr("class","treemapLabel").attr("x",e=>(e.x1-e.x0)/2).attr("y",e=>(e.y1-e.y0)/2).attr("style",e=>{const o=`text-anchor: middle; dominant-baseline: middle; font-size: ${ue}px;fill:`+A(e.data.name)+";",f=B({cssCompiledStyles:e.data.cssCompiledStyles});return o+f.labelStyles.replace("color:","fill:")}).attr("clip-path",(e,o)=>`url(#clip-${a}-${o})`).text(e=>e.data.name).each(function(e){const o=K(this),f=e.x1-e.x0,C=e.y1-e.y0,L=o.node(),T=f-2*U,P=C-2*U;if(T<se||P<se){o.style("display","none");return}let m=parseInt(o.style("font-size"),10);const k=.6;for(;L.getComputedTextLength()>T&&m>D;)m--,o.style("font-size",`${m}px`);let N=Math.max(I,Math.min(Y,Math.round(m*k))),$=m+Z+N;for(;$>P&&m>D&&(m--,N=Math.max(I,Math.min(Y,Math.round(m*k))),!(N<I&&m===D));)o.style("font-size",`${m}px`),$=m+Z+N;o.style("font-size",`${m}px`),F?(m<D||P<D)&&o.style("display","none"):(L.getComputedTextLength()>T||m<D||P<m)&&o.style("display","none")}),s.showValues!==!1&&j.append("text").attr("class","treemapValue").attr("x",o=>(o.x1-o.x0)/2).attr("y",function(o){return(o.y1-o.y0)/2}).attr("style",o=>{const f=`text-anchor: middle; dominant-baseline: hanging; font-size: ${Y}px;fill:`+A(o.data.name)+";",C=B({cssCompiledStyles:o.data.cssCompiledStyles});return f+C.labelStyles.replace("color:","fill:")}).attr("clip-path",(o,f)=>`url(#clip-${a}-${f})`).text(o=>o.value?p(o.value):"").each(function(o){const f=K(this),C=this.parentNode;if(!C){f.style("display","none");return}const L=K(C).select(".treemapLabel");if(L.empty()||L.style("display")==="none"){f.style("display","none");return}const T=parseFloat(L.style("font-size")),m=Math.max(I,Math.min(Y,Math.round(T*.6)));f.style("font-size",`${m}px`);const N=(o.y1-o.y0)/2+T/2+Z;f.attr("y",N);const $=o.x1-o.x0,ie=o.y1-o.y0-4,me=$-2*U;f.node().getComputedTextLength()>me||N+m>ie||m<I?f.style("display","none"):f.style("display",null)});const pe=s.diagramPadding??8;Ne(b,pe,"flowchart",(s==null?void 0:s.useMaxWidth)||!1)},"draw"),ct=w(function(t,a){return a.db.getClasses()},"getClasses"),ht={draw:ot,getClasses:ct},dt={sectionStrokeColor:"black",sectionStrokeWidth:"1",sectionFillColor:"#efefef",leafStrokeColor:"black",leafStrokeWidth:"1",leafFillColor:"#efefef",labelFontSize:"12px",valueFontSize:"10px",titleFontSize:"14px"},ut=w(({treemap:t}={})=>{const a=ye(),l=ae(),n=ee(a,l.themeVariables),r=ee(dt,t),s=r.titleColor??n.titleColor,h=r.labelColor??n.textColor,d=r.valueColor??n.textColor;return`
2
- .treemapNode.section {
3
- stroke: ${r.sectionStrokeColor};
4
- stroke-width: ${r.sectionStrokeWidth};
5
- fill: ${r.sectionFillColor};
6
- }
7
- .treemapNode.leaf {
8
- stroke: ${r.leafStrokeColor};
9
- stroke-width: ${r.leafStrokeWidth};
10
- fill: ${r.leafFillColor};
11
- }
12
- .treemapLabel {
13
- fill: ${h};
14
- font-size: ${r.labelFontSize};
15
- }
16
- .treemapValue {
17
- fill: ${d};
18
- font-size: ${r.valueFontSize};
19
- }
20
- .treemapTitle {
21
- fill: ${s};
22
- font-size: ${r.titleFontSize};
23
- }
24
- `},"getStyles"),pt=ut,Ct={parser:he,get db(){return new oe},renderer:ht,styles:pt};export{Ct as diagram};
@@ -1,24 +0,0 @@
1
- import{p as z}from"./chunk-JWPE2WC7-D6dXb_jr.js";import{_ as f,M as B,P,d as E,l as $,b as F,a as A,p as W,q as _,g as N,s as M,K as L,N as Y,z as I}from"./mermaid.core-D_Dp_Kl2.js";import{p as K}from"./cynefin-EF2NZ3EQ-OZotFKUu.js";import"./index-BKxAxaVG.js";var O=Y.packet,b,C=(b=class{constructor(){this.packet=[],this.setAccTitle=F,this.getAccTitle=A,this.setDiagramTitle=W,this.getDiagramTitle=_,this.getAccDescription=N,this.setAccDescription=M}getConfig(){const t=B({...O,...L().packet});return t.showBits&&(t.paddingY+=10),t}getPacket(){return this.packet}pushWord(t){t.length>0&&this.packet.push(t)}clear(){I(),this.packet=[]}},f(b,"PacketDB"),b),j=1e4,q=f((e,t)=>{z(e,t);let s=-1,r=[],i=1;const{bitsPerRow:l}=t.getConfig();for(let{start:a,end:o,bits:d,label:g}of e.blocks){if(a!==void 0&&o!==void 0&&o<a)throw new Error(`Packet block ${a} - ${o} is invalid. End must be greater than start.`);if(a??(a=s+1),a!==s+1)throw new Error(`Packet block ${a} - ${o??a} is not contiguous. It should start from ${s+1}.`);if(d===0)throw new Error(`Packet block ${a} is invalid. Cannot have a zero bit field.`);for(o??(o=a+(d??1)-1),d??(d=o-a+1),s=o,$.debug(`Packet block ${a} - ${s} with label ${g}`);r.length<=l+1&&t.getPacket().length<j;){const[c,p]=G({start:a,end:o,bits:d,label:g},i,l);if(r.push(c),c.end+1===i*l&&(t.pushWord(r),r=[],i++),!p)break;({start:a,end:o,bits:d,label:g}=p)}}t.pushWord(r)},"populate"),G=f((e,t,s)=>{if(e.start===void 0)throw new Error("start should have been set during first phase");if(e.end===void 0)throw new Error("end should have been set during first phase");if(e.start>e.end)throw new Error(`Block start ${e.start} is greater than block end ${e.end}.`);if(e.end+1<=t*s)return[e,void 0];const r=t*s-1,i=t*s;return[{start:e.start,end:r,label:e.label,bits:r-e.start},{start:i,end:e.end,label:e.label,bits:e.end-i}]},"getNextFittingBlock"),S={parser:{yy:void 0},parse:f(async e=>{var r;const t=await K("packet",e),s=(r=S.parser)==null?void 0:r.yy;if(!(s instanceof C))throw new Error("parser.parser?.yy was not a PacketDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");$.debug(t),q(t,s)},"parse")},H=f((e,t,s,r)=>{const i=r.db,l=i.getConfig(),{rowHeight:a,paddingY:o,bitWidth:d,bitsPerRow:g}=l,c=i.getPacket(),p=i.getDiagramTitle(),m=a+o,n=m*(c.length+1)-(p?0:a),h=d*g+2,k=P(t);k.attr("viewBox",`0 0 ${h} ${n}`),E(k,n,h,l.useMaxWidth);for(const[x,u]of c.entries())U(k,u,x,l);k.append("text").text(p).attr("x",h/2).attr("y",n-m/2).attr("dominant-baseline","middle").attr("text-anchor","middle").attr("class","packetTitle")},"draw"),U=f((e,t,s,{rowHeight:r,paddingX:i,paddingY:l,bitWidth:a,bitsPerRow:o,showBits:d,bitOrder:g})=>{const c=e.append("g"),p=s*(r+l)+l,m=g==="descending";for(const n of t){const h=n.end-n.start+1,k=n.start%o,u=(m?o-k-h:k)*a+1,w=h*a-i;if(c.append("rect").attr("x",u).attr("y",p).attr("width",w).attr("height",r).attr("class","packetBlock"),c.append("text").attr("x",u+w/2).attr("y",p+r/2).attr("class","packetLabel").attr("dominant-baseline","middle").attr("text-anchor","middle").text(n.label),!d)continue;const[D,T]=m?[n.end,n.start]:[n.start,n.end],v=h===1,y=p-2;c.append("text").attr("x",u+(v?w/2:0)).attr("y",y).attr("class","packetByte start").attr("dominant-baseline","auto").attr("text-anchor",v?"middle":"start").text(D),v||c.append("text").attr("x",u+w).attr("y",y).attr("class","packetByte end").attr("dominant-baseline","auto").attr("text-anchor","end").text(T)}},"drawWord"),X={draw:H},J={byteFontSize:"10px",startByteColor:"black",endByteColor:"black",labelColor:"black",labelFontSize:"12px",titleColor:"black",titleFontSize:"14px",blockStrokeColor:"black",blockStrokeWidth:"1",blockFillColor:"#efefef"},Q=f(({packet:e}={})=>{const t=B(J,e);return`
2
- .packetByte {
3
- font-size: ${t.byteFontSize};
4
- }
5
- .packetByte.start {
6
- fill: ${t.startByteColor};
7
- }
8
- .packetByte.end {
9
- fill: ${t.endByteColor};
10
- }
11
- .packetLabel {
12
- fill: ${t.labelColor};
13
- font-size: ${t.labelFontSize};
14
- }
15
- .packetTitle {
16
- fill: ${t.titleColor};
17
- font-size: ${t.titleFontSize};
18
- }
19
- .packetBlock {
20
- stroke: ${t.blockStrokeColor};
21
- stroke-width: ${t.blockStrokeWidth};
22
- fill: ${t.blockFillColor};
23
- }
24
- `},"styles"),et={parser:S,get db(){return new C},renderer:X,styles:Q};export{et as diagram};
@@ -1,41 +0,0 @@
1
- import{p as I}from"./chunk-JWPE2WC7-D6dXb_jr.js";import{s as _,g as E,q as F,p as D,a as P,b as z,_ as c,P as G,z as B,M as w,K as C,N as W,l as b,Q as V,d as H}from"./mermaid.core-D_Dp_Kl2.js";import{p as j}from"./cynefin-EF2NZ3EQ-OZotFKUu.js";import"./index-BKxAxaVG.js";var x={showLegend:!0,ticks:5,max:null,min:0,graticule:"circle"},y=32,A={axes:[],curves:[],options:x},m=structuredClone(A),K=W.radar,N=c(()=>w({...K,...C().radar}),"getConfig"),M=c(()=>m.axes,"getAxes"),U=c(()=>m.curves,"getCurves"),X=c(()=>m.options,"getOptions"),q=c(a=>{m.axes=a.map(t=>({name:t.name,label:t.label??t.name}))},"setAxes"),Q=c(a=>{m.curves=a.map(t=>({name:t.name,label:t.label??t.name,entries:Y(t.entries)}))},"setCurves"),Y=c(a=>{if(a[0].axis==null)return a.map(e=>e.value);const t=M();if(t.length===0)throw new Error("Axes must be populated before curves for reference entries");return t.map(e=>{const r=a.find(s=>{var n;return((n=s.axis)==null?void 0:n.$refText)===e.name});if(r===void 0)throw new Error("Missing entry for axis "+e.label);return r.value})},"computeCurveEntries"),Z=c(a=>{var e,r,s,n,l;const t=a.reduce((o,i)=>(o[i.name]=i,o),{});m.options={showLegend:((e=t.showLegend)==null?void 0:e.value)??x.showLegend,ticks:((r=t.ticks)==null?void 0:r.value)??x.ticks,max:((s=t.max)==null?void 0:s.value)??x.max,min:((n=t.min)==null?void 0:n.value)??x.min,graticule:((l=t.graticule)==null?void 0:l.value)??x.graticule},m.options.ticks>y&&(b.warn(`Radar diagram ticks (${m.options.ticks}) exceeds maximum allowed (${y}). Using ${y} instead.`),m.options.ticks=y)},"setOptions"),J=c(()=>{B(),m=structuredClone(A)},"clear"),$={getAxes:M,getCurves:U,getOptions:X,setAxes:q,setCurves:Q,setOptions:Z,getConfig:N,clear:J,setAccTitle:z,getAccTitle:P,setDiagramTitle:D,getDiagramTitle:F,getAccDescription:E,setAccDescription:_},tt=c(a=>{I(a,$);const{axes:t,curves:e,options:r}=a;$.setAxes(t),$.setCurves(e),$.setOptions(r)},"populate"),et={parse:c(async a=>{const t=await j("radar",a);b.debug(t),tt(t)},"parse")},at=c((a,t,e,r)=>{const s=r.db,n=s.getAxes(),l=s.getCurves(),o=s.getOptions(),i=s.getConfig(),d=s.getDiagramTitle(),p=G(t),u=rt(p,i),g=o.max??Math.max(...l.map(f=>Math.max(...f.entries))),h=o.min,v=Math.min(i.width,i.height)/2;st(u,n,v,o.ticks,o.graticule),nt(u,n,v,i),L(u,n,l,h,g,o.graticule,i),k(u,l,o.showLegend,i),u.append("text").attr("class","radarTitle").text(d).attr("x",0).attr("y",-i.height/2-i.marginTop)},"draw"),rt=c((a,t)=>{const e=t.width+t.marginLeft+t.marginRight,r=t.height+t.marginTop+t.marginBottom,s={x:t.marginLeft+t.width/2,y:t.marginTop+t.height/2};return H(a,r,e,t.useMaxWidth??!0),a.attr("viewBox",`0 0 ${e} ${r}`).attr("overflow","visible"),a.append("g").attr("transform",`translate(${s.x}, ${s.y})`)},"drawFrame"),st=c((a,t,e,r,s)=>{if(s==="circle")for(let n=0;n<r;n++){const l=e*(n+1)/r;a.append("circle").attr("r",l).attr("class","radarGraticule")}else if(s==="polygon"){const n=t.length;for(let l=0;l<r;l++){const o=e*(l+1)/r,i=t.map((d,p)=>{const u=2*p*Math.PI/n-Math.PI/2,g=o*Math.cos(u),h=o*Math.sin(u);return`${g},${h}`}).join(" ");a.append("polygon").attr("points",i).attr("class","radarGraticule")}}},"drawGraticule"),nt=c((a,t,e,r)=>{const s=t.length;for(let n=0;n<s;n++){const l=t[n].label,o=2*n*Math.PI/s-Math.PI/2,i=Math.cos(o),d=Math.sin(o);a.append("line").attr("x1",0).attr("y1",0).attr("x2",e*r.axisScaleFactor*i).attr("y2",e*r.axisScaleFactor*d).attr("class","radarAxisLine");const p=i>.01?"start":i<-.01?"end":"middle",u=d>.01?"hanging":d<-.01?"auto":"central",g=4;a.append("text").text(l).attr("x",e*r.axisLabelFactor*i+g*i).attr("y",e*r.axisLabelFactor*d+g*d).attr("text-anchor",p).attr("dominant-baseline",u).attr("class","radarAxisLabel")}},"drawAxes");function L(a,t,e,r,s,n,l){const o=t.length,i=Math.min(l.width,l.height)/2;e.forEach((d,p)=>{if(d.entries.length!==o)return;const u=d.entries.map((g,h)=>{const v=2*Math.PI*h/o-Math.PI/2,f=T(g,r,s,i),O=f*Math.cos(v),R=f*Math.sin(v);return{x:O,y:R}});n==="circle"?a.append("path").attr("d",S(u,l.curveTension)).attr("class",`radarCurve-${p}`):n==="polygon"&&a.append("polygon").attr("points",u.map(g=>`${g.x},${g.y}`).join(" ")).attr("class",`radarCurve-${p}`)})}c(L,"drawCurves");function T(a,t,e,r){const s=Math.min(Math.max(a,t),e);return r*(s-t)/(e-t)}c(T,"relativeRadius");function S(a,t){const e=a.length;let r=`M${a[0].x},${a[0].y}`;for(let s=0;s<e;s++){const n=a[(s-1+e)%e],l=a[s],o=a[(s+1)%e],i=a[(s+2)%e],d={x:l.x+(o.x-n.x)*t,y:l.y+(o.y-n.y)*t},p={x:o.x-(i.x-l.x)*t,y:o.y-(i.y-l.y)*t};r+=` C${d.x},${d.y} ${p.x},${p.y} ${o.x},${o.y}`}return`${r} Z`}c(S,"closedRoundCurve");function k(a,t,e,r){if(!e)return;const s=(r.width/2+r.marginRight)*3/4,n=-(r.height/2+r.marginTop)*3/4,l=20;t.forEach((o,i)=>{const d=a.append("g").attr("transform",`translate(${s}, ${n+i*l})`);d.append("rect").attr("width",12).attr("height",12).attr("class",`radarLegendBox-${i}`),d.append("text").attr("x",16).attr("y",0).attr("class","radarLegendText").text(o.label)})}c(k,"drawLegend");var ot={draw:at},it=c((a,t)=>{let e="";for(let r=0;r<a.THEME_COLOR_LIMIT;r++){const s=a[`cScale${r}`];e+=`
2
- .radarCurve-${r} {
3
- color: ${s};
4
- fill: ${s};
5
- fill-opacity: ${t.curveOpacity};
6
- stroke: ${s};
7
- stroke-width: ${t.curveStrokeWidth};
8
- }
9
- .radarLegendBox-${r} {
10
- fill: ${s};
11
- fill-opacity: ${t.curveOpacity};
12
- stroke: ${s};
13
- }
14
- `}return e},"genIndexStyles"),lt=c(a=>{const t=V(),e=C(),r=w(t,e.themeVariables),s=w(r.radar,a);return{themeVariables:r,radarOptions:s}},"buildRadarStyleOptions"),ct=c(({radar:a}={})=>{const{themeVariables:t,radarOptions:e}=lt(a);return`
15
- .radarTitle {
16
- font-size: ${t.fontSize};
17
- color: ${t.titleColor};
18
- dominant-baseline: hanging;
19
- text-anchor: middle;
20
- }
21
- .radarAxisLine {
22
- stroke: ${e.axisColor};
23
- stroke-width: ${e.axisStrokeWidth};
24
- }
25
- .radarAxisLabel {
26
- font-size: ${e.axisLabelFontSize}px;
27
- color: ${e.axisColor};
28
- }
29
- .radarGraticule {
30
- fill: ${e.graticuleColor};
31
- fill-opacity: ${e.graticuleOpacity};
32
- stroke: ${e.graticuleColor};
33
- stroke-width: ${e.graticuleStrokeWidth};
34
- }
35
- .radarLegendText {
36
- text-anchor: start;
37
- font-size: ${e.legendFontSize}px;
38
- dominant-baseline: hanging;
39
- }
40
- ${it(t,e)}
41
- `},"styles"),mt={parser:et,db:$,renderer:ot,styles:ct};export{mt as diagram};
@@ -1 +0,0 @@
1
- import{g as l,r as m,d as n}from"./chunk-2E7WHVMD-B653kMXt.js";import{p}from"./chunk-JWPE2WC7-D6dXb_jr.js";import{_ as t,l as o}from"./mermaid.core-D_Dp_Kl2.js";import"./index-BKxAxaVG.js";import{M as u,a as f}from"./cynefin-EF2NZ3EQ-OZotFKUu.js";var c=f().RailroadEbnf.parser.LangiumParser,s=t(e=>{const r=e.alternatives.map(E);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformChoice"),E=t(e=>{const r=e.elements.map(d);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformSequence"),i=t(e=>{switch(e.$type){case"EbnfTerminal":return{type:"terminal",value:e.value};case"EbnfNonTerminal":return{type:"nonterminal",name:e.name};case"EbnfSpecial":return{type:"special",text:e.text};case"EbnfGroup":return s(e.element);case"EbnfOptional":return{type:"optional",element:s(e.element)};case"EbnfRepetition":return{type:"repetition",element:s(e.element),min:0,max:1/0};default:throw new Error(`Unsupported EBNF primary node: ${e.$type}`)}},"transformPrimary"),b=t((e,r)=>{switch(r.$type){case"EbnfOptionalPostfix":return{type:"optional",element:e};case"EbnfZeroOrMorePostfix":return{type:"repetition",element:e,min:0,max:1/0};case"EbnfOneOrMorePostfix":return{type:"repetition",element:e,min:1,max:1/0};case"EbnfExceptionPostfix":return{type:"sequence",elements:[e,{type:"terminal",value:"-"},i(r.except)]};default:throw new Error(`Unsupported EBNF postfix node: ${r.$type}`)}},"transformPostfix"),d=t(e=>e.postfixes.reduce((r,a)=>b(r,a),i(e.base)),"transformTerm"),y=t(e=>({name:e.name,definition:s(e.definition)}),"transformRule"),v=t(e=>{p(e,n),e.title&&n.setTitle(e.title),e.rules.map(r=>n.addRule(y(r)))},"populateDb"),g={parse:t(e=>{n.clear(),o.debug("[EBNF Parser] Starting Langium parse");const r=c.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new u(r);const a=r.value;o.debug("[EBNF Parser] Parsed rules:",a.rules.length),v(a),o.debug("[EBNF Parser] Parse complete")},"parse"),parser:{yy:n}},R={parser:g,db:n,renderer:m,styles:l};export{R as diagram};