dominds 1.18.2 → 1.19.2

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 (277) hide show
  1. package/dist/access-control.js +6 -6
  2. package/dist/apps/runtime.d.ts +2 -2
  3. package/dist/apps/runtime.js +28 -28
  4. package/dist/apps-host/client.d.ts +1 -1
  5. package/dist/apps-host/host.js +7 -7
  6. package/dist/apps-host/ipc-types.d.ts +2 -2
  7. package/dist/apps-host/ipc-types.js +10 -10
  8. package/dist/cli/read.d.ts +0 -1
  9. package/dist/cli/read.js +1 -6
  10. package/dist/dialog-display-state.d.ts +6 -6
  11. package/dist/dialog-display-state.js +46 -46
  12. package/dist/dialog-factory.d.ts +12 -12
  13. package/dist/dialog-factory.js +33 -30
  14. package/dist/dialog-fork.d.ts +2 -2
  15. package/dist/dialog-fork.js +140 -115
  16. package/dist/dialog-global-registry.d.ts +5 -5
  17. package/dist/dialog-global-registry.js +11 -11
  18. package/dist/dialog-instance-registry.d.ts +3 -3
  19. package/dist/dialog-instance-registry.js +52 -41
  20. package/dist/dialog.d.ts +100 -113
  21. package/dist/dialog.js +274 -229
  22. package/dist/docs/agent-priming.md +5 -5
  23. package/dist/docs/agent-priming.zh.md +5 -5
  24. package/dist/docs/app-constitution.md +1 -1
  25. package/dist/docs/app-constitution.zh.md +1 -1
  26. package/dist/docs/cli-usage.md +1 -1
  27. package/dist/docs/cli-usage.zh.md +1 -1
  28. package/dist/docs/design.md +14 -14
  29. package/dist/docs/design.zh.md +14 -14
  30. package/dist/docs/dialog-persistence.md +58 -58
  31. package/dist/docs/dialog-persistence.zh.md +61 -61
  32. package/dist/docs/dialog-system.md +363 -367
  33. package/dist/docs/dialog-system.zh.md +355 -357
  34. package/dist/docs/diligence-push.md +18 -18
  35. package/dist/docs/diligence-push.zh.md +17 -17
  36. package/dist/docs/dominds-agent-collaboration.zh.md +3 -3
  37. package/dist/docs/dominds-terminology.md +46 -47
  38. package/dist/docs/encapsulated-taskdoc.md +4 -4
  39. package/dist/docs/encapsulated-taskdoc.zh.md +3 -3
  40. package/dist/docs/fbr.md +30 -30
  41. package/dist/docs/fbr.zh.md +15 -15
  42. package/dist/docs/i18n.md +2 -2
  43. package/dist/docs/i18n.zh.md +2 -2
  44. package/dist/docs/mcp-support.md +5 -4
  45. package/dist/docs/mcp-support.zh.md +3 -2
  46. package/dist/docs/memory-system.md +4 -4
  47. package/dist/docs/memory-system.zh.md +1 -1
  48. package/dist/docs/mottos.md +1 -1
  49. package/dist/docs/mottos.zh.md +1 -1
  50. package/dist/docs/q4h.md +3 -3
  51. package/dist/docs/q4h.zh.md +1 -1
  52. package/dist/docs/roadmap.md +2 -2
  53. package/dist/docs/team_mgmt-toolset.md +11 -3
  54. package/dist/docs/team_mgmt-toolset.zh.md +9 -2
  55. package/dist/docs/tellask-collab.md +18 -18
  56. package/dist/docs/tellask-collab.zh.md +8 -8
  57. package/dist/docs/tellask-revive-context-refactor.zh.md +591 -0
  58. package/dist/evt-registry.d.ts +1 -2
  59. package/dist/evt-registry.js +2 -7
  60. package/dist/llm/gen/mock.js +9 -0
  61. package/dist/llm/kernel-driver/context.d.ts +1 -2
  62. package/dist/llm/kernel-driver/context.js +12 -26
  63. package/dist/llm/kernel-driver/drive.js +99 -75
  64. package/dist/llm/kernel-driver/engine.d.ts +2 -2
  65. package/dist/llm/kernel-driver/engine.js +10 -10
  66. package/dist/llm/kernel-driver/fbr.js +6 -6
  67. package/dist/llm/kernel-driver/flow.d.ts +1 -1
  68. package/dist/llm/kernel-driver/flow.js +129 -93
  69. package/dist/llm/kernel-driver/guardrails.js +4 -4
  70. package/dist/llm/kernel-driver/index.d.ts +1 -1
  71. package/dist/llm/kernel-driver/index.js +2 -2
  72. package/dist/llm/kernel-driver/loop.js +30 -30
  73. package/dist/llm/kernel-driver/reply-guidance.js +47 -52
  74. package/dist/llm/kernel-driver/restore.d.ts +3 -3
  75. package/dist/llm/kernel-driver/restore.js +23 -28
  76. package/dist/llm/kernel-driver/runtime.d.ts +1 -1
  77. package/dist/llm/kernel-driver/runtime.js +1 -1
  78. package/dist/llm/kernel-driver/sideDialog-txn.d.ts +8 -0
  79. package/dist/llm/kernel-driver/{subdialog-txn.js → sideDialog-txn.js} +13 -13
  80. package/dist/llm/kernel-driver/{subdialog.d.ts → sideDialog.d.ts} +13 -13
  81. package/dist/llm/kernel-driver/{subdialog.js → sideDialog.js} +203 -170
  82. package/dist/llm/kernel-driver/tellask-special.d.ts +7 -3
  83. package/dist/llm/kernel-driver/tellask-special.js +474 -497
  84. package/dist/llm/kernel-driver/types.d.ts +25 -9
  85. package/dist/mcp/config.d.ts +1 -0
  86. package/dist/mcp/config.js +7 -2
  87. package/dist/mcp/supervisor.d.ts +2 -0
  88. package/dist/mcp/supervisor.js +2 -1
  89. package/dist/minds/builtin/pangu/persona.en.md +4 -4
  90. package/dist/minds/load.js +6 -6
  91. package/dist/minds/system-prompt-parts.d.ts +1 -1
  92. package/dist/minds/system-prompt-parts.js +12 -12
  93. package/dist/minds/system-prompt.d.ts +1 -1
  94. package/dist/minds/system-prompt.js +56 -56
  95. package/dist/persistence-errors.d.ts +1 -1
  96. package/dist/persistence.d.ts +126 -121
  97. package/dist/persistence.js +1190 -786
  98. package/dist/priming.d.ts +3 -3
  99. package/dist/priming.js +62 -61
  100. package/dist/recovery/reply-special.js +5 -5
  101. package/dist/runtime/driver-messages.d.ts +3 -2
  102. package/dist/runtime/driver-messages.js +68 -57
  103. package/dist/runtime/inter-dialog-format.d.ts +12 -10
  104. package/dist/runtime/inter-dialog-format.js +80 -35
  105. package/dist/runtime/interjection-pause-stop.js +1 -1
  106. package/dist/runtime/reply-prompt-copy.d.ts +7 -3
  107. package/dist/runtime/reply-prompt-copy.js +39 -14
  108. package/dist/server/api-routes.js +87 -83
  109. package/dist/server/static-server.js +1 -1
  110. package/dist/server/websocket-handler.js +163 -153
  111. package/dist/tool-availability.js +1 -1
  112. package/dist/tools/app-reminders.js +17 -4
  113. package/dist/tools/ctrl.js +5 -5
  114. package/dist/tools/os.js +16 -16
  115. package/dist/tools/pending-tellask-reminder.js +20 -14
  116. package/dist/tools/prompts/control/en/index.md +1 -1
  117. package/dist/tools/prompts/control/en/principles.md +8 -8
  118. package/dist/tools/prompts/control/en/scenarios.md +7 -7
  119. package/dist/tools/prompts/control/en/tools.md +7 -7
  120. package/dist/tools/prompts/control/zh/principles.md +4 -4
  121. package/dist/tools/prompts/control/zh/scenarios.md +5 -5
  122. package/dist/tools/prompts/control/zh/tools.md +3 -3
  123. package/dist/tools/prompts/team_memory/en/scenarios.md +1 -1
  124. package/dist/tools/prompts/team_memory/zh/scenarios.md +1 -1
  125. package/dist/tools/team_mgmt-manual.js +2 -2
  126. package/dist/tools/team_mgmt-mcp-manual.js +10 -0
  127. package/dist/tools/team_mgmt.js +4 -4
  128. package/dist/utils/taskdoc.js +12 -12
  129. package/package.json +3 -3
  130. package/webapp/dist/assets/{_basePickBy-BPJaiZdW.js → _basePickBy-B7M9Q0Fa.js} +3 -3
  131. package/webapp/dist/assets/_basePickBy-B7M9Q0Fa.js.map +1 -0
  132. package/webapp/dist/assets/{_baseUniq-BEetT15i.js → _baseUniq-DAeYoL6j.js} +2 -2
  133. package/webapp/dist/assets/_baseUniq-DAeYoL6j.js.map +1 -0
  134. package/webapp/dist/assets/{arc-Dm7Zf36f.js → arc-Bh4nDbNR.js} +2 -2
  135. package/webapp/dist/assets/arc-Bh4nDbNR.js.map +1 -0
  136. package/webapp/dist/assets/{architectureDiagram-VXUJARFQ-BpTPtkuo.js → architectureDiagram-2XIMDMQ5-CxqmdsIm.js} +26 -8
  137. package/webapp/dist/assets/architectureDiagram-2XIMDMQ5-CxqmdsIm.js.map +1 -0
  138. package/webapp/dist/assets/{blockDiagram-VD42YOAC-C8fLN0iu.js → blockDiagram-WCTKOSBZ-CxIWLtpt.js} +187 -170
  139. package/webapp/dist/assets/blockDiagram-WCTKOSBZ-CxIWLtpt.js.map +1 -0
  140. package/webapp/dist/assets/{c4Diagram-YG6GDRKO-BpPr62CH.js → c4Diagram-IC4MRINW-1qErOIgG.js} +4 -4
  141. package/webapp/dist/assets/c4Diagram-IC4MRINW-1qErOIgG.js.map +1 -0
  142. package/webapp/dist/assets/{channel-EMYoPjW3.js → channel-DkgZHNUe.js} +2 -2
  143. package/webapp/dist/assets/channel-DkgZHNUe.js.map +1 -0
  144. package/webapp/dist/assets/{chunk-4BX2VUAB-CefNtjWG.js → chunk-4BX2VUAB-BmdMbU9v.js} +2 -2
  145. package/webapp/dist/assets/chunk-4BX2VUAB-BmdMbU9v.js.map +1 -0
  146. package/webapp/dist/assets/{chunk-55IACEB6-C_X7T43V.js → chunk-55IACEB6-D6LDTDBy.js} +2 -2
  147. package/webapp/dist/assets/chunk-55IACEB6-D6LDTDBy.js.map +1 -0
  148. package/webapp/dist/assets/{chunk-FMBD7UC4-ORmtkrtS.js → chunk-FMBD7UC4-C-BdCe4C.js} +2 -2
  149. package/webapp/dist/assets/chunk-FMBD7UC4-C-BdCe4C.js.map +1 -0
  150. package/webapp/dist/assets/{chunk-TZMSLE5B-Gao4qrq7.js → chunk-JSJVCQXG-WA_BLIm9.js} +14 -6
  151. package/webapp/dist/assets/chunk-JSJVCQXG-WA_BLIm9.js.map +1 -0
  152. package/webapp/dist/assets/{chunk-QN33PNHL-LTAOVhWu.js → chunk-KX2RTZJC-CA7sDJO5.js} +2 -2
  153. package/webapp/dist/assets/chunk-KX2RTZJC-CA7sDJO5.js.map +1 -0
  154. package/webapp/dist/assets/{chunk-DI55MBZ5-CbvrsI_w.js → chunk-NQ4KR5QH-wlvxalE3.js} +9 -7
  155. package/webapp/dist/assets/chunk-NQ4KR5QH-wlvxalE3.js.map +1 -0
  156. package/webapp/dist/assets/{chunk-QZHKN3VN-ZoUM_4u5.js → chunk-QZHKN3VN-Bo1VMcph.js} +2 -2
  157. package/webapp/dist/assets/chunk-QZHKN3VN-Bo1VMcph.js.map +1 -0
  158. package/webapp/dist/assets/{chunk-B4BG7PRW-BRe3_2oA.js → chunk-WL4C6EOR-B-Pk44be.js} +171 -121
  159. package/webapp/dist/assets/chunk-WL4C6EOR-B-Pk44be.js.map +1 -0
  160. package/webapp/dist/assets/{classDiagram-2ON5EDUG-uha1vIGN.js → classDiagram-VBA2DB6C-BqKuyb49.js} +7 -6
  161. package/webapp/dist/assets/classDiagram-VBA2DB6C-BqKuyb49.js.map +1 -0
  162. package/webapp/dist/assets/{classDiagram-v2-WZHVMYZB-uha1vIGN.js → classDiagram-v2-RAHNMMFH-BqKuyb49.js} +7 -6
  163. package/webapp/dist/assets/classDiagram-v2-RAHNMMFH-BqKuyb49.js.map +1 -0
  164. package/webapp/dist/assets/{clone-_9Ayb1Gp.js → clone-BX5z8WVZ.js} +2 -2
  165. package/webapp/dist/assets/clone-BX5z8WVZ.js.map +1 -0
  166. package/webapp/dist/assets/{cose-bilkent-S5V4N54A-C8wDw3NY.js → cose-bilkent-S5V4N54A-B-s11SgN.js} +2 -2
  167. package/webapp/dist/assets/cose-bilkent-S5V4N54A-B-s11SgN.js.map +1 -0
  168. package/webapp/dist/assets/cytoscape.esm-Bm8DJGmZ.js.map +1 -1
  169. package/webapp/dist/assets/{dagre-6UL2VRFP-BUSeNot0.js → dagre-KLK3FWXG-DmQFV2qK.js} +7 -7
  170. package/webapp/dist/assets/dagre-KLK3FWXG-DmQFV2qK.js.map +1 -0
  171. package/webapp/dist/assets/defaultLocale-B2RvLBDe.js.map +1 -1
  172. package/webapp/dist/assets/{diagram-PSM6KHXK-CMZAksVC.js → diagram-E7M64L7V-QRaBfST8.js} +10 -10
  173. package/webapp/dist/assets/diagram-E7M64L7V-QRaBfST8.js.map +1 -0
  174. package/webapp/dist/assets/{diagram-QEK2KX5R-BQKoRtwy.js → diagram-IFDJBPK2-lrWn1Obo.js} +9 -8
  175. package/webapp/dist/assets/diagram-IFDJBPK2-lrWn1Obo.js.map +1 -0
  176. package/webapp/dist/assets/{diagram-S2PKOQOG-DjMG97kd.js → diagram-P4PSJMXO-sTU7Hh-Y.js} +8 -8
  177. package/webapp/dist/assets/diagram-P4PSJMXO-sTU7Hh-Y.js.map +1 -0
  178. package/webapp/dist/assets/{erDiagram-Q2GNP2WA-BujwA137.js → erDiagram-INFDFZHY-Cx6jc9Wq.js} +96 -75
  179. package/webapp/dist/assets/erDiagram-INFDFZHY-Cx6jc9Wq.js.map +1 -0
  180. package/webapp/dist/assets/{flowDiagram-NV44I4VS-DgwPjg4y.js → flowDiagram-PKNHOUZH-DfGI49Dz.js} +98 -81
  181. package/webapp/dist/assets/flowDiagram-PKNHOUZH-DfGI49Dz.js.map +1 -0
  182. package/webapp/dist/assets/{ganttDiagram-JELNMOA3-Db2ykf3E.js → ganttDiagram-A5KZAMGK-nrcHWWaM.js} +28 -3
  183. package/webapp/dist/assets/ganttDiagram-A5KZAMGK-nrcHWWaM.js.map +1 -0
  184. package/webapp/dist/assets/{gitGraphDiagram-V2S2FVAM-D_gSifkv.js → gitGraphDiagram-K3NZZRJ6-D8ivAqd6.js} +38 -46
  185. package/webapp/dist/assets/gitGraphDiagram-K3NZZRJ6-D8ivAqd6.js.map +1 -0
  186. package/webapp/dist/assets/graph-R5G-y8tB.js +782 -0
  187. package/webapp/dist/assets/graph-R5G-y8tB.js.map +1 -0
  188. package/webapp/dist/assets/{index-DLajsIDJ.js → index--fy89xGh.js} +2214 -2023
  189. package/webapp/dist/assets/index--fy89xGh.js.map +1 -0
  190. package/webapp/dist/assets/{index-xvYYeHuy.css → index-DZFkLLVz.css} +18 -10
  191. package/webapp/dist/assets/{infoDiagram-HS3SLOUP-BDba5pKs.js → infoDiagram-LFFYTUFH-PIoZHr7s.js} +7 -7
  192. package/webapp/dist/assets/infoDiagram-LFFYTUFH-PIoZHr7s.js.map +1 -0
  193. package/webapp/dist/assets/init-ZxktEp_H.js.map +1 -1
  194. package/webapp/dist/assets/ishikawaDiagram-PHBUUO56-oCM-LYk1.js +966 -0
  195. package/webapp/dist/assets/ishikawaDiagram-PHBUUO56-oCM-LYk1.js.map +1 -0
  196. package/webapp/dist/assets/{journeyDiagram-XKPGCS4Q-CmJAbmlm.js → journeyDiagram-4ABVD52K-C2qidjQ5.js} +5 -5
  197. package/webapp/dist/assets/journeyDiagram-4ABVD52K-C2qidjQ5.js.map +1 -0
  198. package/webapp/dist/assets/{kanban-definition-3W4ZIXB7-DxQeBTDk.js → kanban-definition-K7BYSVSG-Du0TC8WS.js} +5 -3
  199. package/webapp/dist/assets/kanban-definition-K7BYSVSG-Du0TC8WS.js.map +1 -0
  200. package/webapp/dist/assets/{layout-DteV_yE8.js → layout-VmEo1OEB.js} +5 -5
  201. package/webapp/dist/assets/layout-VmEo1OEB.js.map +1 -0
  202. package/webapp/dist/assets/{linear-zItbPrND.js → linear-B662YHAc.js} +2 -2
  203. package/webapp/dist/assets/linear-B662YHAc.js.map +1 -0
  204. package/webapp/dist/assets/{mindmap-definition-VGOIOE7T-BJXI7UqO.js → mindmap-definition-YRQLILUH-D7arZj95.js} +7 -5
  205. package/webapp/dist/assets/mindmap-definition-YRQLILUH-D7arZj95.js.map +1 -0
  206. package/webapp/dist/assets/ordinal-CxptdPJm.js.map +1 -1
  207. package/webapp/dist/assets/{pieDiagram-ADFJNKIX-BpM-aH2p.js → pieDiagram-SKSYHLDU-DvjPP4PA.js} +8 -8
  208. package/webapp/dist/assets/pieDiagram-SKSYHLDU-DvjPP4PA.js.map +1 -0
  209. package/webapp/dist/assets/{quadrantDiagram-AYHSOK5B-NXdIpA15.js → quadrantDiagram-337W2JSQ-B_JUGMj_.js} +3 -3
  210. package/webapp/dist/assets/quadrantDiagram-337W2JSQ-B_JUGMj_.js.map +1 -0
  211. package/webapp/dist/assets/{requirementDiagram-UZGBJVZJ-D1AICAA0.js → requirementDiagram-Z7DCOOCP-DF0mpvE3.js} +16 -6
  212. package/webapp/dist/assets/requirementDiagram-Z7DCOOCP-DF0mpvE3.js.map +1 -0
  213. package/webapp/dist/assets/{sankeyDiagram-TZEHDZUN-WiReDPfo.js → sankeyDiagram-WA2Y5GQK-CoXlxv00.js} +2 -2
  214. package/webapp/dist/assets/sankeyDiagram-WA2Y5GQK-CoXlxv00.js.map +1 -0
  215. package/webapp/dist/assets/{sequenceDiagram-WL72ISMW-Cw76oP8t.js → sequenceDiagram-2WXFIKYE-DYqT5Pg7.js} +601 -201
  216. package/webapp/dist/assets/sequenceDiagram-2WXFIKYE-DYqT5Pg7.js.map +1 -0
  217. package/webapp/dist/assets/{stateDiagram-FKZM4ZOC-QjCeRczs.js → stateDiagram-RAJIS63D-D9b1mN8-.js} +9 -9
  218. package/webapp/dist/assets/stateDiagram-RAJIS63D-D9b1mN8-.js.map +1 -0
  219. package/webapp/dist/assets/{stateDiagram-v2-4FDKWEC3-IClqxQ4s.js → stateDiagram-v2-FVOUBMTO-DNzgudL_.js} +5 -5
  220. package/webapp/dist/assets/stateDiagram-v2-FVOUBMTO-DNzgudL_.js.map +1 -0
  221. package/webapp/dist/assets/{timeline-definition-IT6M3QCI-BfyfTY7m.js → timeline-definition-YZTLITO2-CkyKUY7A.js} +3 -3
  222. package/webapp/dist/assets/timeline-definition-YZTLITO2-CkyKUY7A.js.map +1 -0
  223. package/webapp/dist/assets/{treemap-GDKQZRPO-C5MiL6--.js → treemap-KZPCXAKY-CZd09kF-.js} +37 -24
  224. package/webapp/dist/assets/treemap-KZPCXAKY-CZd09kF-.js.map +1 -0
  225. package/webapp/dist/assets/vennDiagram-LZ73GAT5-BxVF5Olo.js +2487 -0
  226. package/webapp/dist/assets/vennDiagram-LZ73GAT5-BxVF5Olo.js.map +1 -0
  227. package/webapp/dist/assets/{xychartDiagram-PRI3JC2R-ybaJrSry.js → xychartDiagram-JWTSCODW-BRwRloPc.js} +4 -4
  228. package/webapp/dist/assets/xychartDiagram-JWTSCODW-BRwRloPc.js.map +1 -0
  229. package/webapp/dist/index.html +2 -2
  230. package/dist/docs/issues/global-dialog-event-broadcaster-missing.md +0 -128
  231. package/dist/llm/kernel-driver/subdialog-txn.d.ts +0 -8
  232. package/webapp/dist/assets/_basePickBy-BPJaiZdW.js.map +0 -1
  233. package/webapp/dist/assets/_baseUniq-BEetT15i.js.map +0 -1
  234. package/webapp/dist/assets/arc-Dm7Zf36f.js.map +0 -1
  235. package/webapp/dist/assets/architectureDiagram-VXUJARFQ-BpTPtkuo.js.map +0 -1
  236. package/webapp/dist/assets/blockDiagram-VD42YOAC-C8fLN0iu.js.map +0 -1
  237. package/webapp/dist/assets/c4Diagram-YG6GDRKO-BpPr62CH.js.map +0 -1
  238. package/webapp/dist/assets/channel-EMYoPjW3.js.map +0 -1
  239. package/webapp/dist/assets/chunk-4BX2VUAB-CefNtjWG.js.map +0 -1
  240. package/webapp/dist/assets/chunk-55IACEB6-C_X7T43V.js.map +0 -1
  241. package/webapp/dist/assets/chunk-B4BG7PRW-BRe3_2oA.js.map +0 -1
  242. package/webapp/dist/assets/chunk-DI55MBZ5-CbvrsI_w.js.map +0 -1
  243. package/webapp/dist/assets/chunk-FMBD7UC4-ORmtkrtS.js.map +0 -1
  244. package/webapp/dist/assets/chunk-QN33PNHL-LTAOVhWu.js.map +0 -1
  245. package/webapp/dist/assets/chunk-QZHKN3VN-ZoUM_4u5.js.map +0 -1
  246. package/webapp/dist/assets/chunk-TZMSLE5B-Gao4qrq7.js.map +0 -1
  247. package/webapp/dist/assets/classDiagram-2ON5EDUG-uha1vIGN.js.map +0 -1
  248. package/webapp/dist/assets/classDiagram-v2-WZHVMYZB-uha1vIGN.js.map +0 -1
  249. package/webapp/dist/assets/clone-_9Ayb1Gp.js.map +0 -1
  250. package/webapp/dist/assets/cose-bilkent-S5V4N54A-C8wDw3NY.js.map +0 -1
  251. package/webapp/dist/assets/dagre-6UL2VRFP-BUSeNot0.js.map +0 -1
  252. package/webapp/dist/assets/diagram-PSM6KHXK-CMZAksVC.js.map +0 -1
  253. package/webapp/dist/assets/diagram-QEK2KX5R-BQKoRtwy.js.map +0 -1
  254. package/webapp/dist/assets/diagram-S2PKOQOG-DjMG97kd.js.map +0 -1
  255. package/webapp/dist/assets/erDiagram-Q2GNP2WA-BujwA137.js.map +0 -1
  256. package/webapp/dist/assets/flowDiagram-NV44I4VS-DgwPjg4y.js.map +0 -1
  257. package/webapp/dist/assets/ganttDiagram-JELNMOA3-Db2ykf3E.js.map +0 -1
  258. package/webapp/dist/assets/gitGraphDiagram-V2S2FVAM-D_gSifkv.js.map +0 -1
  259. package/webapp/dist/assets/graph-BHjCU5xP.js +0 -425
  260. package/webapp/dist/assets/graph-BHjCU5xP.js.map +0 -1
  261. package/webapp/dist/assets/index-DLajsIDJ.js.map +0 -1
  262. package/webapp/dist/assets/infoDiagram-HS3SLOUP-BDba5pKs.js.map +0 -1
  263. package/webapp/dist/assets/journeyDiagram-XKPGCS4Q-CmJAbmlm.js.map +0 -1
  264. package/webapp/dist/assets/kanban-definition-3W4ZIXB7-DxQeBTDk.js.map +0 -1
  265. package/webapp/dist/assets/layout-DteV_yE8.js.map +0 -1
  266. package/webapp/dist/assets/linear-zItbPrND.js.map +0 -1
  267. package/webapp/dist/assets/mindmap-definition-VGOIOE7T-BJXI7UqO.js.map +0 -1
  268. package/webapp/dist/assets/pieDiagram-ADFJNKIX-BpM-aH2p.js.map +0 -1
  269. package/webapp/dist/assets/quadrantDiagram-AYHSOK5B-NXdIpA15.js.map +0 -1
  270. package/webapp/dist/assets/requirementDiagram-UZGBJVZJ-D1AICAA0.js.map +0 -1
  271. package/webapp/dist/assets/sankeyDiagram-TZEHDZUN-WiReDPfo.js.map +0 -1
  272. package/webapp/dist/assets/sequenceDiagram-WL72ISMW-Cw76oP8t.js.map +0 -1
  273. package/webapp/dist/assets/stateDiagram-FKZM4ZOC-QjCeRczs.js.map +0 -1
  274. package/webapp/dist/assets/stateDiagram-v2-4FDKWEC3-IClqxQ4s.js.map +0 -1
  275. package/webapp/dist/assets/timeline-definition-IT6M3QCI-BfyfTY7m.js.map +0 -1
  276. package/webapp/dist/assets/treemap-GDKQZRPO-C5MiL6--.js.map +0 -1
  277. package/webapp/dist/assets/xychartDiagram-PRI3JC2R-ybaJrSry.js.map +0 -1
@@ -0,0 +1,782 @@
1
+ import { aC as baseRest, aD as isArrayLikeObject, aE as constant, aF as isFunction, aG as isEmpty } from "./index--fy89xGh.js";
2
+ import { a as baseUniq, c as baseFlatten, k as keys, f as filter, d as forEach, i as isUndefined, v as values, r as reduce } from "./_baseUniq-DAeYoL6j.js";
3
+ var union = baseRest(function(arrays) {
4
+ return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));
5
+ });
6
+ var DEFAULT_EDGE_NAME = "\0";
7
+ var GRAPH_NODE = "\0";
8
+ var EDGE_KEY_DELIM = "";
9
+ class Graph {
10
+ /**
11
+ * @param {GraphOptions} [opts] - Graph options.
12
+ */
13
+ constructor(opts = {}) {
14
+ this._isDirected = Object.prototype.hasOwnProperty.call(opts, "directed") ? opts.directed : true;
15
+ this._isMultigraph = Object.prototype.hasOwnProperty.call(opts, "multigraph") ? opts.multigraph : false;
16
+ this._isCompound = Object.prototype.hasOwnProperty.call(opts, "compound") ? opts.compound : false;
17
+ this._label = void 0;
18
+ this._defaultNodeLabelFn = constant(void 0);
19
+ this._defaultEdgeLabelFn = constant(void 0);
20
+ this._nodes = {};
21
+ if (this._isCompound) {
22
+ this._parent = {};
23
+ this._children = {};
24
+ this._children[GRAPH_NODE] = {};
25
+ }
26
+ this._in = {};
27
+ this._preds = {};
28
+ this._out = {};
29
+ this._sucs = {};
30
+ this._edgeObjs = {};
31
+ this._edgeLabels = {};
32
+ }
33
+ /* === Graph functions ========= */
34
+ /**
35
+ *
36
+ * @returns {boolean} `true` if the graph is [directed](https://en.wikipedia.org/wiki/Directed_graph).
37
+ * A directed graph treats the order of nodes in an edge as significant whereas an
38
+ * [undirected](https://en.wikipedia.org/wiki/Graph_(mathematics)#Undirected_graph)
39
+ * graph does not.
40
+ * This example demonstrates the difference:
41
+ *
42
+ * @example
43
+ *
44
+ * ```js
45
+ * var directed = new Graph({ directed: true });
46
+ * directed.setEdge("a", "b", "my-label");
47
+ * directed.edge("a", "b"); // returns "my-label"
48
+ * directed.edge("b", "a"); // returns undefined
49
+ *
50
+ * var undirected = new Graph({ directed: false });
51
+ * undirected.setEdge("a", "b", "my-label");
52
+ * undirected.edge("a", "b"); // returns "my-label"
53
+ * undirected.edge("b", "a"); // returns "my-label"
54
+ * ```
55
+ */
56
+ isDirected() {
57
+ return this._isDirected;
58
+ }
59
+ /**
60
+ * @returns {boolean} `true` if the graph is a multigraph.
61
+ */
62
+ isMultigraph() {
63
+ return this._isMultigraph;
64
+ }
65
+ /**
66
+ * @returns {boolean} `true` if the graph is compound.
67
+ */
68
+ isCompound() {
69
+ return this._isCompound;
70
+ }
71
+ /**
72
+ * Sets the label for the graph to `label`.
73
+ *
74
+ * @param {GraphLabel} label - Label for the graph.
75
+ * @returns {this}
76
+ */
77
+ setGraph(label) {
78
+ this._label = label;
79
+ return this;
80
+ }
81
+ /**
82
+ * @returns {GraphLabel | undefined} the currently assigned label for the graph.
83
+ * If no label has been assigned, returns `undefined`.
84
+ *
85
+ * @example
86
+ *
87
+ * ```js
88
+ * var g = new Graph();
89
+ * g.graph(); // returns undefined
90
+ * g.setGraph("graph-label");
91
+ * g.graph(); // returns "graph-label"
92
+ * ```
93
+ */
94
+ graph() {
95
+ return this._label;
96
+ }
97
+ /* === Node functions ========== */
98
+ /**
99
+ * Sets a new default value that is assigned to nodes that are created without
100
+ * a label.
101
+ *
102
+ * @param {typeof this._defaultNodeLabelFn | NodeLabel} newDefault - If a function,
103
+ * it is called with the id of the node being created.
104
+ * Otherwise, it is assigned as the label directly.
105
+ * @returns {this}
106
+ */
107
+ setDefaultNodeLabel(newDefault) {
108
+ if (!isFunction(newDefault)) {
109
+ newDefault = constant(newDefault);
110
+ }
111
+ this._defaultNodeLabelFn = newDefault;
112
+ return this;
113
+ }
114
+ /**
115
+ * @returns {number} the number of nodes in the graph.
116
+ */
117
+ nodeCount() {
118
+ return this._nodeCount;
119
+ }
120
+ /**
121
+ * @returns {NodeID[]} the ids of the nodes in the graph.
122
+ *
123
+ * @remarks
124
+ * Use {@link node()} to get the label for each node.
125
+ * Takes `O(|V|)` time.
126
+ */
127
+ nodes() {
128
+ return keys(this._nodes);
129
+ }
130
+ /**
131
+ * @returns {NodeID[]} those nodes in the graph that have no in-edges.
132
+ * @remarks Takes `O(|V|)` time.
133
+ */
134
+ sources() {
135
+ var self = this;
136
+ return filter(this.nodes(), function(v) {
137
+ return isEmpty(self._in[v]);
138
+ });
139
+ }
140
+ /**
141
+ * @returns {NodeID[]} those nodes in the graph that have no out-edges.
142
+ * @remarks Takes `O(|V|)` time.
143
+ */
144
+ sinks() {
145
+ var self = this;
146
+ return filter(this.nodes(), function(v) {
147
+ return isEmpty(self._out[v]);
148
+ });
149
+ }
150
+ /**
151
+ * Invokes setNode method for each node in `vs` list.
152
+ *
153
+ * @param {Collection<NodeID | number>} vs - List of node IDs to create/set.
154
+ * @param {NodeLabel} [value] - If set, update all nodes with this value.
155
+ * @returns {this}
156
+ * @remarks Complexity: O(|names|).
157
+ */
158
+ setNodes(vs, value) {
159
+ var args = arguments;
160
+ var self = this;
161
+ forEach(vs, function(v) {
162
+ if (args.length > 1) {
163
+ self.setNode(v, value);
164
+ } else {
165
+ self.setNode(v);
166
+ }
167
+ });
168
+ return this;
169
+ }
170
+ /**
171
+ * Creates or updates the value for the node `v` in the graph.
172
+ *
173
+ * @param {NodeID | number} v - ID of the node to create/set.
174
+ * @param {NodeLabel} [value] - If supplied, it is set as the value for the node.
175
+ * If not supplied and the node was created by this call then
176
+ * {@link setDefaultNodeLabel} will be used to set the node's value.
177
+ * @returns {this} the graph, allowing this to be chained with other functions.
178
+ * @remarks Takes `O(1)` time.
179
+ */
180
+ setNode(v, value) {
181
+ if (Object.prototype.hasOwnProperty.call(this._nodes, v)) {
182
+ if (arguments.length > 1) {
183
+ this._nodes[v] = value;
184
+ }
185
+ return this;
186
+ }
187
+ this._nodes[v] = arguments.length > 1 ? value : this._defaultNodeLabelFn(v);
188
+ if (this._isCompound) {
189
+ this._parent[v] = GRAPH_NODE;
190
+ this._children[v] = {};
191
+ this._children[GRAPH_NODE][v] = true;
192
+ }
193
+ this._in[v] = {};
194
+ this._preds[v] = {};
195
+ this._out[v] = {};
196
+ this._sucs[v] = {};
197
+ ++this._nodeCount;
198
+ return this;
199
+ }
200
+ /**
201
+ * Gets the label of node with specified name.
202
+ *
203
+ * @param {NodeID | number} v - Node ID.
204
+ * @returns {NodeLabel | undefined} the label assigned to the node with the id `v`
205
+ * if it is in the graph.
206
+ * Otherwise returns `undefined`.
207
+ * @remarks Takes `O(1)` time.
208
+ */
209
+ node(v) {
210
+ return this._nodes[v];
211
+ }
212
+ /**
213
+ * Detects whether graph has a node with specified name or not.
214
+ *
215
+ * @param {NodeID | number} v - Node ID.
216
+ * @returns {boolean} Returns `true` the graph has a node with the id.
217
+ * @remarks Takes `O(1)` time.
218
+ */
219
+ hasNode(v) {
220
+ return Object.prototype.hasOwnProperty.call(this._nodes, v);
221
+ }
222
+ /**
223
+ * Remove the node with the id `v` in the graph or do nothing if the node is
224
+ * not in the graph.
225
+ *
226
+ * If the node was removed this function also removes any incident edges.
227
+ *
228
+ * @param {NodeID | number} v - Node ID to remove.
229
+ * @returns {this} the graph, allowing this to be chained with other functions.
230
+ * @remarks Takes `O(|E|)` time.
231
+ */
232
+ removeNode(v) {
233
+ if (Object.prototype.hasOwnProperty.call(this._nodes, v)) {
234
+ var removeEdge = (e) => this.removeEdge(this._edgeObjs[e]);
235
+ delete this._nodes[v];
236
+ if (this._isCompound) {
237
+ this._removeFromParentsChildList(v);
238
+ delete this._parent[v];
239
+ forEach(this.children(v), (child) => {
240
+ this.setParent(child);
241
+ });
242
+ delete this._children[v];
243
+ }
244
+ forEach(keys(this._in[v]), removeEdge);
245
+ delete this._in[v];
246
+ delete this._preds[v];
247
+ forEach(keys(this._out[v]), removeEdge);
248
+ delete this._out[v];
249
+ delete this._sucs[v];
250
+ --this._nodeCount;
251
+ }
252
+ return this;
253
+ }
254
+ /**
255
+ * Sets the parent for `v` to `parent` if it is defined or removes the parent
256
+ * for `v` if `parent` is undefined.
257
+ *
258
+ * @param {NodeID | number} v - Node ID to set the parent for.
259
+ * @param {NodeID | number} [parent] - Parent node ID. If not defined, removes the parent.
260
+ * @returns {this} the graph, allowing this to be chained with other functions.
261
+ * @throws if the graph is not compound.
262
+ * @throws if setting the parent would create a cycle.
263
+ * @remarks Takes `O(1)` time.
264
+ */
265
+ setParent(v, parent) {
266
+ if (!this._isCompound) {
267
+ throw new Error("Cannot set parent in a non-compound graph");
268
+ }
269
+ if (isUndefined(parent)) {
270
+ parent = GRAPH_NODE;
271
+ } else {
272
+ parent += "";
273
+ for (var ancestor = parent; !isUndefined(ancestor); ancestor = this.parent(ancestor)) {
274
+ if (ancestor === v) {
275
+ throw new Error("Setting " + parent + " as parent of " + v + " would create a cycle");
276
+ }
277
+ }
278
+ this.setNode(parent);
279
+ }
280
+ this.setNode(v);
281
+ this._removeFromParentsChildList(v);
282
+ this._parent[v] = parent;
283
+ this._children[parent][v] = true;
284
+ return this;
285
+ }
286
+ /**
287
+ * @private
288
+ * @param {NodeID | number} v - Node ID.
289
+ */
290
+ _removeFromParentsChildList(v) {
291
+ delete this._children[this._parent[v]][v];
292
+ }
293
+ /**
294
+ * Get parent node for node `v`.
295
+ *
296
+ * @param {NodeID | number} v - Node ID.
297
+ * @returns {NodeID | undefined} the node that is a parent of node `v`
298
+ * or `undefined` if node `v` does not have a parent or is not a member of
299
+ * the graph.
300
+ * Always returns `undefined` for graphs that are not compound.
301
+ * @remarks Takes `O(1)` time.
302
+ */
303
+ parent(v) {
304
+ if (this._isCompound) {
305
+ var parent = this._parent[v];
306
+ if (parent !== GRAPH_NODE) {
307
+ return parent;
308
+ }
309
+ }
310
+ }
311
+ /**
312
+ * Gets list of direct children of node v.
313
+ *
314
+ * @param {NodeID | number} [v] - Node ID. If not specified, gets nodes
315
+ * with no parent (top-level nodes).
316
+ * @returns {NodeID[] | undefined} all nodes that are children of node `v` or
317
+ * `undefined` if node `v` is not in the graph.
318
+ * Always returns `[]` for graphs that are not compound.
319
+ * @remarks Takes `O(|V|)` time.
320
+ */
321
+ children(v) {
322
+ if (isUndefined(v)) {
323
+ v = GRAPH_NODE;
324
+ }
325
+ if (this._isCompound) {
326
+ var children = this._children[v];
327
+ if (children) {
328
+ return keys(children);
329
+ }
330
+ } else if (v === GRAPH_NODE) {
331
+ return this.nodes();
332
+ } else if (this.hasNode(v)) {
333
+ return [];
334
+ }
335
+ }
336
+ /**
337
+ * @param {NodeID | number} v - Node ID.
338
+ * @returns {NodeID[] | undefined} all nodes that are predecessors of the
339
+ * specified node or `undefined` if node `v` is not in the graph.
340
+ * @remarks
341
+ * Behavior is undefined for undirected graphs - use {@link neighbors} instead.
342
+ * Takes `O(|V|)` time.
343
+ */
344
+ predecessors(v) {
345
+ var predsV = this._preds[v];
346
+ if (predsV) {
347
+ return keys(predsV);
348
+ }
349
+ }
350
+ /**
351
+ * @param {NodeID | number} v - Node ID.
352
+ * @returns {NodeID[] | undefined} all nodes that are successors of the
353
+ * specified node or `undefined` if node `v` is not in the graph.
354
+ * @remarks
355
+ * Behavior is undefined for undirected graphs - use {@link neighbors} instead.
356
+ * Takes `O(|V|)` time.
357
+ */
358
+ successors(v) {
359
+ var sucsV = this._sucs[v];
360
+ if (sucsV) {
361
+ return keys(sucsV);
362
+ }
363
+ }
364
+ /**
365
+ * @param {NodeID | number} v - Node ID.
366
+ * @returns {NodeID[] | undefined} all nodes that are predecessors or
367
+ * successors of the specified node
368
+ * or `undefined` if node `v` is not in the graph.
369
+ * @remarks Takes `O(|V|)` time.
370
+ */
371
+ neighbors(v) {
372
+ var preds = this.predecessors(v);
373
+ if (preds) {
374
+ return union(preds, this.successors(v));
375
+ }
376
+ }
377
+ /**
378
+ * @param {NodeID | number} v - Node ID.
379
+ * @returns {boolean} True if the node is a leaf (has no successors), false otherwise.
380
+ */
381
+ isLeaf(v) {
382
+ var neighbors;
383
+ if (this.isDirected()) {
384
+ neighbors = this.successors(v);
385
+ } else {
386
+ neighbors = this.neighbors(v);
387
+ }
388
+ return neighbors.length === 0;
389
+ }
390
+ /**
391
+ * Creates new graph with nodes filtered via `filter`.
392
+ * Edges incident to rejected node
393
+ * are also removed.
394
+ *
395
+ * In case of compound graph, if parent is rejected by `filter`,
396
+ * than all its children are rejected too.
397
+
398
+ * @param {(v: NodeID) => boolean} filter - Function that returns `true` for nodes to keep.
399
+ * @returns {Graph<GraphLabel, NodeLabel, EdgeLabel>} A new graph containing only the nodes for which `filter` returns `true`.
400
+ * @remarks Average-case complexity: O(|E|+|V|).
401
+ */
402
+ filterNodes(filter2) {
403
+ var copy = new this.constructor({
404
+ directed: this._isDirected,
405
+ multigraph: this._isMultigraph,
406
+ compound: this._isCompound
407
+ });
408
+ copy.setGraph(this.graph());
409
+ var self = this;
410
+ forEach(this._nodes, function(value, v) {
411
+ if (filter2(v)) {
412
+ copy.setNode(v, value);
413
+ }
414
+ });
415
+ forEach(this._edgeObjs, function(e) {
416
+ if (copy.hasNode(e.v) && copy.hasNode(e.w)) {
417
+ copy.setEdge(e, self.edge(e));
418
+ }
419
+ });
420
+ var parents = {};
421
+ function findParent(v) {
422
+ var parent = self.parent(v);
423
+ if (parent === void 0 || copy.hasNode(parent)) {
424
+ parents[v] = parent;
425
+ return parent;
426
+ } else if (parent in parents) {
427
+ return parents[parent];
428
+ } else {
429
+ return findParent(parent);
430
+ }
431
+ }
432
+ if (this._isCompound) {
433
+ forEach(copy.nodes(), function(v) {
434
+ copy.setParent(v, findParent(v));
435
+ });
436
+ }
437
+ return copy;
438
+ }
439
+ /* === Edge functions ========== */
440
+ /**
441
+ * Sets a new default value that is assigned to edges that are created without
442
+ * a label.
443
+ *
444
+ * @param {typeof this._defaultEdgeLabelFn | EdgeLabel} newDefault - If a function,
445
+ * it is called with the parameters `(v, w, name)`.
446
+ * Otherwise, it is assigned as the label directly.
447
+ * @returns {this}
448
+ */
449
+ setDefaultEdgeLabel(newDefault) {
450
+ if (!isFunction(newDefault)) {
451
+ newDefault = constant(newDefault);
452
+ }
453
+ this._defaultEdgeLabelFn = newDefault;
454
+ return this;
455
+ }
456
+ /**
457
+ * @returns {number} the number of edges in the graph.
458
+ * @remarks Complexity: O(1).
459
+ */
460
+ edgeCount() {
461
+ return this._edgeCount;
462
+ }
463
+ /**
464
+ * Gets edges of the graph.
465
+ *
466
+ * @returns {EdgeObj[]} the {@link EdgeObj} for each edge in the graph.
467
+ *
468
+ * @remarks
469
+ * In case of compound graph subgraphs are not considered.
470
+ * Use {@link edge()} to get the label for each edge.
471
+ * Takes `O(|E|)` time.
472
+ */
473
+ edges() {
474
+ return values(this._edgeObjs);
475
+ }
476
+ /**
477
+ * Establish an edges path over the nodes in nodes list.
478
+ *
479
+ * If some edge is already exists, it will update its label, otherwise it will
480
+ * create an edge between pair of nodes with label provided or default label
481
+ * if no label provided.
482
+ *
483
+ * @param {Collection<NodeID>} vs - List of node IDs to create edges between.
484
+ * @param {EdgeLabel} [value] - If set, update all edges with this value.
485
+ * @returns {this}
486
+ * @remarks Complexity: O(|nodes|).
487
+ */
488
+ setPath(vs, value) {
489
+ var self = this;
490
+ var args = arguments;
491
+ reduce(vs, function(v, w) {
492
+ if (args.length > 1) {
493
+ self.setEdge(v, w, value);
494
+ } else {
495
+ self.setEdge(v, w);
496
+ }
497
+ return w;
498
+ });
499
+ return this;
500
+ }
501
+ /**
502
+ * Creates or updates the label for the edge (`v`, `w`) with the optionally
503
+ * supplied `name`.
504
+ *
505
+ * @overload
506
+ * @param {EdgeObj} arg0 - Edge object.
507
+ * @param {EdgeLabel} [value] - If supplied, it is set as the label for the edge.
508
+ * If not supplied and the edge was created by this call then
509
+ * {@link setDefaultEdgeLabel} will be used to assign the edge's label.
510
+ * @returns {this} the graph, allowing this to be chained with other functions.
511
+ * @remarks Takes `O(1)` time.
512
+ */
513
+ /**
514
+ * Creates or updates the label for the edge (`v`, `w`) with the optionally
515
+ * supplied `name`.
516
+ *
517
+ * @overload
518
+ * @param {NodeID | number} v - Source node ID. Number values will be coerced to strings.
519
+ * @param {NodeID | number} w - Target node ID. Number values will be coerced to strings.
520
+ * @param {EdgeLabel} [value] - If supplied, it is set as the label for the edge.
521
+ * If not supplied and the edge was created by this call then
522
+ * {@link setDefaultEdgeLabel} will be used to assign the edge's label.
523
+ * @param {string | number} [name] - Edge name. Only useful with multigraphs.
524
+ * @returns {this} the graph, allowing this to be chained with other functions.
525
+ * @remarks Takes `O(1)` time.
526
+ */
527
+ setEdge() {
528
+ var v, w, name, value;
529
+ var valueSpecified = false;
530
+ var arg0 = arguments[0];
531
+ if (typeof arg0 === "object" && arg0 !== null && "v" in arg0) {
532
+ v = arg0.v;
533
+ w = arg0.w;
534
+ name = arg0.name;
535
+ if (arguments.length === 2) {
536
+ value = arguments[1];
537
+ valueSpecified = true;
538
+ }
539
+ } else {
540
+ v = arg0;
541
+ w = arguments[1];
542
+ name = arguments[3];
543
+ if (arguments.length > 2) {
544
+ value = arguments[2];
545
+ valueSpecified = true;
546
+ }
547
+ }
548
+ v = "" + v;
549
+ w = "" + w;
550
+ if (!isUndefined(name)) {
551
+ name = "" + name;
552
+ }
553
+ var e = edgeArgsToId(this._isDirected, v, w, name);
554
+ if (Object.prototype.hasOwnProperty.call(this._edgeLabels, e)) {
555
+ if (valueSpecified) {
556
+ this._edgeLabels[e] = value;
557
+ }
558
+ return this;
559
+ }
560
+ if (!isUndefined(name) && !this._isMultigraph) {
561
+ throw new Error("Cannot set a named edge when isMultigraph = false");
562
+ }
563
+ this.setNode(v);
564
+ this.setNode(w);
565
+ this._edgeLabels[e] = valueSpecified ? value : this._defaultEdgeLabelFn(v, w, name);
566
+ var edgeObj = edgeArgsToObj(this._isDirected, v, w, name);
567
+ v = edgeObj.v;
568
+ w = edgeObj.w;
569
+ Object.freeze(edgeObj);
570
+ this._edgeObjs[e] = edgeObj;
571
+ incrementOrInitEntry(this._preds[w], v);
572
+ incrementOrInitEntry(this._sucs[v], w);
573
+ this._in[w][e] = edgeObj;
574
+ this._out[v][e] = edgeObj;
575
+ this._edgeCount++;
576
+ return this;
577
+ }
578
+ /**
579
+ * Gets the label for the specified edge.
580
+ *
581
+ * @overload
582
+ * @param {EdgeObj} v - Edge object.
583
+ * @returns {EdgeLabel | undefined} the label for the edge (`v`, `w`) if the
584
+ * graph has an edge between `v` and `w` with the optional `name`.
585
+ * Returned `undefined` if there is no such edge in the graph.
586
+ * @remarks
587
+ * `v` and `w` can be interchanged for undirected graphs.
588
+ * Takes `O(1)` time.
589
+ */
590
+ /**
591
+ * Gets the label for the specified edge.
592
+ *
593
+ * @overload
594
+ * @param {NodeID | number} v - Source node ID.
595
+ * @param {NodeID | number} w - Target node ID.
596
+ * @param {string | number} [name] - Edge name. Only useful with multigraphs.
597
+ * @returns {EdgeLabel | undefined} the label for the edge (`v`, `w`) if the
598
+ * graph has an edge between `v` and `w` with the optional `name`.
599
+ * Returned `undefined` if there is no such edge in the graph.
600
+ * @remarks
601
+ * `v` and `w` can be interchanged for undirected graphs.
602
+ * Takes `O(1)` time.
603
+ */
604
+ edge(v, w, name) {
605
+ var e = arguments.length === 1 ? edgeObjToId(this._isDirected, arguments[0]) : edgeArgsToId(this._isDirected, v, w, name);
606
+ return this._edgeLabels[e];
607
+ }
608
+ /**
609
+ * Detects whether the graph contains specified edge or not.
610
+ *
611
+ * @overload
612
+ * @param {EdgeObj} v - Edge object.
613
+ * @returns {boolean} `true` if the graph has an edge between `v` and `w`
614
+ * with the optional `name`.
615
+ * @remarks
616
+ * `v` and `w` can be interchanged for undirected graphs.
617
+ * No subgraphs are considered.
618
+ * Takes `O(1)` time.
619
+ */
620
+ /**
621
+ * Detects whether the graph contains specified edge or not.
622
+ *
623
+ * @overload
624
+ * @param {NodeID | number} v - Source node ID.
625
+ * @param {NodeID | number} w - Target node ID.
626
+ * @param {string | number} [name] - Edge name. Only useful with multigraphs.
627
+ * @returns {boolean} `true` if the graph has an edge between `v` and `w`
628
+ * with the optional `name`.
629
+ * @remarks
630
+ * `v` and `w` can be interchanged for undirected graphs.
631
+ * No subgraphs are considered.
632
+ * Takes `O(1)` time.
633
+ */
634
+ hasEdge(v, w, name) {
635
+ var e = arguments.length === 1 ? edgeObjToId(this._isDirected, arguments[0]) : edgeArgsToId(this._isDirected, v, w, name);
636
+ return Object.prototype.hasOwnProperty.call(this._edgeLabels, e);
637
+ }
638
+ /**
639
+ * Removes the edge (`v`, `w`) if the graph has an edge between `v` and `w`
640
+ * with the optional `name`. If not this function does nothing.
641
+ *
642
+ * @overload
643
+ * @param {EdgeObj} v - Edge object.
644
+ * @returns {this}
645
+ * @remarks
646
+ * `v` and `w` can be interchanged for undirected graphs.
647
+ * No subgraphs are considered.
648
+ * Takes `O(1)` time.
649
+ */
650
+ /**
651
+ * Removes the edge (`v`, `w`) if the graph has an edge between `v` and `w`
652
+ * with the optional `name`. If not this function does nothing.
653
+ *
654
+ * @overload
655
+ * @param {NodeID | number} v - Source node ID.
656
+ * @param {NodeID | number} w - Target node ID.
657
+ * @param {string | number} [name] - Edge name. Only useful with multigraphs.
658
+ * @returns {this}
659
+ * @remarks
660
+ * `v` and `w` can be interchanged for undirected graphs.
661
+ * Takes `O(1)` time.
662
+ */
663
+ removeEdge(v, w, name) {
664
+ var e = arguments.length === 1 ? edgeObjToId(this._isDirected, arguments[0]) : edgeArgsToId(this._isDirected, v, w, name);
665
+ var edge = this._edgeObjs[e];
666
+ if (edge) {
667
+ v = edge.v;
668
+ w = edge.w;
669
+ delete this._edgeLabels[e];
670
+ delete this._edgeObjs[e];
671
+ decrementOrRemoveEntry(this._preds[w], v);
672
+ decrementOrRemoveEntry(this._sucs[v], w);
673
+ delete this._in[w][e];
674
+ delete this._out[v][e];
675
+ this._edgeCount--;
676
+ }
677
+ return this;
678
+ }
679
+ /**
680
+ * @param {NodeID | number} v - Target node ID.
681
+ * @param {NodeID | number} [u] - Optionally filters edges down to just those
682
+ * coming from node `u`.
683
+ * @returns {EdgeObj[] | undefined} all edges that point to the node `v`.
684
+ * Returns `undefined` if node `v` is not in the graph.
685
+ * @remarks
686
+ * Behavior is undefined for undirected graphs - use {@link nodeEdges} instead.
687
+ * Takes `O(|E|)` time.
688
+ */
689
+ inEdges(v, u) {
690
+ var inV = this._in[v];
691
+ if (inV) {
692
+ var edges = values(inV);
693
+ if (!u) {
694
+ return edges;
695
+ }
696
+ return filter(edges, function(edge) {
697
+ return edge.v === u;
698
+ });
699
+ }
700
+ }
701
+ /**
702
+ * @param {NodeID | number} v - Target node ID.
703
+ * @param {NodeID | number} [w] - Optionally filters edges down to just those
704
+ * that point to `w`.
705
+ * @returns {EdgeObj[] | undefined} all edges that point to the node `v`.
706
+ * Returns `undefined` if node `v` is not in the graph.
707
+ * @remarks
708
+ * Behavior is undefined for undirected graphs - use {@link nodeEdges} instead.
709
+ * Takes `O(|E|)` time.
710
+ */
711
+ outEdges(v, w) {
712
+ var outV = this._out[v];
713
+ if (outV) {
714
+ var edges = values(outV);
715
+ if (!w) {
716
+ return edges;
717
+ }
718
+ return filter(edges, function(edge) {
719
+ return edge.w === w;
720
+ });
721
+ }
722
+ }
723
+ /**
724
+ * @param {NodeID | number} v - Target Node ID.
725
+ * @param {NodeID | number} [w] - If set, filters those edges down to just
726
+ * those between nodes `v` and `w` regardless of direction
727
+ * @returns {EdgeObj[] | undefined} all edges to or from node `v` regardless
728
+ * of direction. Returns `undefined` if node `v` is not in the graph.
729
+ * @remarks Takes `O(|E|)` time.
730
+ */
731
+ nodeEdges(v, w) {
732
+ var inEdges = this.inEdges(v, w);
733
+ if (inEdges) {
734
+ return inEdges.concat(this.outEdges(v, w));
735
+ }
736
+ }
737
+ }
738
+ Graph.prototype._nodeCount = 0;
739
+ Graph.prototype._edgeCount = 0;
740
+ function incrementOrInitEntry(map, k) {
741
+ if (map[k]) {
742
+ map[k]++;
743
+ } else {
744
+ map[k] = 1;
745
+ }
746
+ }
747
+ function decrementOrRemoveEntry(map, k) {
748
+ if (!--map[k]) {
749
+ delete map[k];
750
+ }
751
+ }
752
+ function edgeArgsToId(isDirected, v_, w_, name) {
753
+ var v = "" + v_;
754
+ var w = "" + w_;
755
+ if (!isDirected && v > w) {
756
+ var tmp = v;
757
+ v = w;
758
+ w = tmp;
759
+ }
760
+ return v + EDGE_KEY_DELIM + w + EDGE_KEY_DELIM + (isUndefined(name) ? DEFAULT_EDGE_NAME : name);
761
+ }
762
+ function edgeArgsToObj(isDirected, v_, w_, name) {
763
+ var v = "" + v_;
764
+ var w = "" + w_;
765
+ if (!isDirected && v > w) {
766
+ var tmp = v;
767
+ v = w;
768
+ w = tmp;
769
+ }
770
+ var edgeObj = { v, w };
771
+ if (name) {
772
+ edgeObj.name = name;
773
+ }
774
+ return edgeObj;
775
+ }
776
+ function edgeObjToId(isDirected, edgeObj) {
777
+ return edgeArgsToId(isDirected, edgeObj.v, edgeObj.w, edgeObj.name);
778
+ }
779
+ export {
780
+ Graph as G
781
+ };
782
+ //# sourceMappingURL=graph-R5G-y8tB.js.map