rasa-pro 3.11.4__py3-none-any.whl → 3.12.0__py3-none-any.whl

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.

Potentially problematic release.


This version of rasa-pro might be problematic. Click here for more details.

Files changed (580) hide show
  1. README.md +10 -13
  2. rasa/__main__.py +7 -7
  3. rasa/anonymization/anonymisation_rule_yaml_reader.py +1 -1
  4. rasa/anonymization/anonymization_pipeline.py +3 -3
  5. rasa/anonymization/anonymization_rule_executor.py +17 -11
  6. rasa/anonymization/anonymization_rule_orchestrator.py +2 -3
  7. rasa/cli/arguments/data.py +2 -2
  8. rasa/cli/arguments/default_arguments.py +1 -1
  9. rasa/cli/arguments/evaluate.py +2 -1
  10. rasa/cli/arguments/interactive.py +1 -1
  11. rasa/cli/arguments/run.py +1 -1
  12. rasa/cli/arguments/test.py +7 -5
  13. rasa/cli/arguments/train.py +3 -3
  14. rasa/cli/arguments/visualize.py +2 -2
  15. rasa/cli/arguments/x.py +1 -0
  16. rasa/cli/data.py +20 -3
  17. rasa/cli/dialogue_understanding_test.py +386 -0
  18. rasa/cli/evaluate.py +1 -1
  19. rasa/cli/export.py +6 -6
  20. rasa/cli/inspect.py +20 -1
  21. rasa/cli/interactive.py +4 -5
  22. rasa/cli/llm_fine_tuning.py +51 -16
  23. rasa/cli/markers.py +1 -2
  24. rasa/cli/project_templates/calm/actions/add_contact.py +1 -1
  25. rasa/cli/project_templates/calm/config.yml +2 -2
  26. rasa/cli/project_templates/calm/domain/list_contacts.yml +1 -2
  27. rasa/cli/project_templates/calm/domain/remove_contact.yml +1 -2
  28. rasa/cli/project_templates/calm/domain/shared.yml +1 -4
  29. rasa/cli/project_templates/calm/endpoints.yml +2 -2
  30. rasa/cli/project_templates/tutorial/actions/actions.py +3 -2
  31. rasa/cli/shell.py +5 -6
  32. rasa/cli/studio/download.py +1 -2
  33. rasa/cli/studio/studio.py +2 -3
  34. rasa/cli/studio/train.py +0 -1
  35. rasa/cli/telemetry.py +2 -2
  36. rasa/cli/test.py +11 -11
  37. rasa/cli/train.py +3 -0
  38. rasa/cli/utils.py +25 -5
  39. rasa/constants.py +0 -1
  40. rasa/core/__init__.py +0 -1
  41. rasa/core/actions/action.py +137 -208
  42. rasa/core/actions/action_handle_digressions.py +164 -0
  43. rasa/core/actions/action_hangup.py +1 -1
  44. rasa/core/actions/action_repeat_bot_messages.py +2 -2
  45. rasa/core/actions/action_run_slot_rejections.py +18 -6
  46. rasa/core/actions/action_trigger_chitchat.py +1 -1
  47. rasa/core/actions/action_trigger_flow.py +5 -5
  48. rasa/core/actions/action_trigger_search.py +1 -1
  49. rasa/core/actions/custom_action_executor.py +1 -1
  50. rasa/core/actions/direct_custom_actions_executor.py +1 -0
  51. rasa/core/actions/forms.py +22 -15
  52. rasa/core/actions/http_custom_action_executor.py +8 -1
  53. rasa/core/actions/loops.py +3 -3
  54. rasa/core/actions/two_stage_fallback.py +13 -13
  55. rasa/core/auth_retry_tracker_store.py +1 -2
  56. rasa/core/brokers/broker.py +2 -1
  57. rasa/core/brokers/file.py +1 -1
  58. rasa/core/brokers/kafka.py +8 -8
  59. rasa/core/brokers/pika.py +8 -9
  60. rasa/core/brokers/sql.py +4 -3
  61. rasa/core/channels/__init__.py +7 -0
  62. rasa/core/channels/botframework.py +2 -2
  63. rasa/core/channels/callback.py +4 -4
  64. rasa/core/channels/channel.py +11 -11
  65. rasa/core/channels/console.py +0 -1
  66. rasa/core/channels/development_inspector.py +80 -24
  67. rasa/core/channels/facebook.py +5 -5
  68. rasa/core/channels/hangouts.py +7 -8
  69. rasa/core/channels/inspector/dist/assets/Tableau10-1b767f5e.js +1 -0
  70. rasa/core/channels/inspector/dist/assets/arc-9f1365dc.js +1 -0
  71. rasa/core/channels/inspector/dist/assets/blockDiagram-38ab4fdb-e0f81b12.js +118 -0
  72. rasa/core/channels/inspector/dist/assets/c4Diagram-3d4e48cf-9deaee1c.js +10 -0
  73. rasa/core/channels/inspector/dist/assets/channel-44956714.js +1 -0
  74. rasa/core/channels/inspector/dist/assets/classDiagram-70f12bd4-20450a96.js +2 -0
  75. rasa/core/channels/inspector/dist/assets/classDiagram-v2-f2320105-749d2abf.js +2 -0
  76. rasa/core/channels/inspector/dist/assets/clone-a9475142.js +1 -0
  77. rasa/core/channels/inspector/dist/assets/{createText-62fc7601-89c73b31.js → createText-2e5e7dd3-bef0b38c.js} +1 -1
  78. rasa/core/channels/inspector/dist/assets/edges-e0da2a9e-943801a7.js +4 -0
  79. rasa/core/channels/inspector/dist/assets/{erDiagram-9d236eb7-907e0440.js → erDiagram-9861fffd-d523a948.js} +4 -4
  80. rasa/core/channels/inspector/dist/assets/flowDb-956e92f1-54e4cf19.js +10 -0
  81. rasa/core/channels/inspector/dist/assets/flowDiagram-66a62f08-48bfbbe8.js +4 -0
  82. rasa/core/channels/inspector/dist/assets/flowDiagram-v2-96b9c2cf-43fa749a.js +1 -0
  83. rasa/core/channels/inspector/dist/assets/flowchart-elk-definition-4a651766-17c30827.js +139 -0
  84. rasa/core/channels/inspector/dist/assets/ganttDiagram-c361ad54-43086f2d.js +257 -0
  85. rasa/core/channels/inspector/dist/assets/gitGraphDiagram-72cf32ee-5c8b693e.js +70 -0
  86. rasa/core/channels/inspector/dist/assets/graph-41a90d26.js +1 -0
  87. rasa/core/channels/inspector/dist/assets/index-3862675e-b43eeae9.js +1 -0
  88. rasa/core/channels/inspector/dist/assets/{index-e793d777.js → index-e8affe45.js} +201 -196
  89. rasa/core/channels/inspector/dist/assets/{infoDiagram-736b4530-8ceba4db.js → infoDiagram-f8f76790-0b20676b.js} +1 -1
  90. rasa/core/channels/inspector/dist/assets/{journeyDiagram-df861f2b-960d3809.js → journeyDiagram-49397b02-39bce7b5.js} +4 -4
  91. rasa/core/channels/inspector/dist/assets/katex-498eb57e.js +261 -0
  92. rasa/core/channels/inspector/dist/assets/layout-dc8eeea4.js +1 -0
  93. rasa/core/channels/inspector/dist/assets/{line-eeccc4e2.js → line-c4d2e756.js} +1 -1
  94. rasa/core/channels/inspector/dist/assets/linear-86f6f2d9.js +1 -0
  95. rasa/core/channels/inspector/dist/assets/mindmap-definition-fc14e90a-4216f771.js +312 -0
  96. rasa/core/channels/inspector/dist/assets/{pieDiagram-dbbf0591-dc9b5e1b.js → pieDiagram-8a3498a8-1a0cfa96.js} +7 -7
  97. rasa/core/channels/inspector/dist/assets/{quadrantDiagram-4d7f4fd6-a08cba6d.js → quadrantDiagram-120e2f19-f91e67cf.js} +1 -1
  98. rasa/core/channels/inspector/dist/assets/{requirementDiagram-6fc4c22a-87242b9e.js → requirementDiagram-deff3bca-d4046bed.js} +2 -2
  99. rasa/core/channels/inspector/dist/assets/sankeyDiagram-04a897e0-2cf6d1d7.js +8 -0
  100. rasa/core/channels/inspector/dist/assets/sequenceDiagram-704730f1-751ac4f5.js +122 -0
  101. rasa/core/channels/inspector/dist/assets/stateDiagram-587899a1-f734f4d4.js +1 -0
  102. rasa/core/channels/inspector/dist/assets/stateDiagram-v2-d93cdb3a-91c65710.js +1 -0
  103. rasa/core/channels/inspector/dist/assets/{styles-9c745c82-cef936a6.js → styles-6aaf32cf-e0cff7be.js} +1 -1
  104. rasa/core/channels/inspector/dist/assets/styles-9a916d00-c8029e5d.js +160 -0
  105. rasa/core/channels/inspector/dist/assets/styles-c10674c1-114f312a.js +116 -0
  106. rasa/core/channels/inspector/dist/assets/svgDrawCommon-08f97a94-b7b9dc00.js +1 -0
  107. rasa/core/channels/inspector/dist/assets/{timeline-definition-5b62e21b-0d39bdb2.js → timeline-definition-85554ec2-9536d189.js} +3 -3
  108. rasa/core/channels/inspector/dist/assets/{xychartDiagram-2b33534f-a03fa445.js → xychartDiagram-e933f94c-bf3b0f36.js} +3 -3
  109. rasa/core/channels/inspector/dist/index.html +1 -1
  110. rasa/core/channels/inspector/package.json +11 -3
  111. rasa/core/channels/inspector/src/App.tsx +15 -2
  112. rasa/core/channels/inspector/src/components/RasaLogo.tsx +31 -0
  113. rasa/core/channels/inspector/src/components/RecruitmentPanel.tsx +68 -0
  114. rasa/core/channels/inspector/src/components/Welcome.tsx +19 -13
  115. rasa/core/channels/inspector/yarn.lock +94 -99
  116. rasa/core/channels/mattermost.py +4 -4
  117. rasa/core/channels/rasa_chat.py +4 -4
  118. rasa/core/channels/rest.py +11 -12
  119. rasa/core/channels/rocketchat.py +4 -3
  120. rasa/core/channels/slack.py +6 -5
  121. rasa/core/channels/socketio.py +8 -28
  122. rasa/core/channels/studio_chat.py +212 -0
  123. rasa/core/channels/telegram.py +105 -55
  124. rasa/core/channels/twilio.py +3 -3
  125. rasa/core/channels/vier_cvg.py +2 -2
  126. rasa/core/channels/voice_ready/audiocodes.py +51 -32
  127. rasa/core/channels/voice_ready/jambonz.py +5 -5
  128. rasa/core/channels/voice_ready/jambonz_protocol.py +3 -4
  129. rasa/core/channels/voice_ready/twilio_voice.py +9 -8
  130. rasa/core/channels/voice_ready/utils.py +2 -2
  131. rasa/core/channels/voice_stream/asr/asr_engine.py +12 -6
  132. rasa/core/channels/voice_stream/asr/asr_event.py +5 -0
  133. rasa/core/channels/voice_stream/asr/azure.py +16 -3
  134. rasa/core/channels/voice_stream/asr/deepgram.py +76 -19
  135. rasa/core/channels/voice_stream/audiocodes.py +292 -0
  136. rasa/core/channels/voice_stream/browser_audio.py +14 -7
  137. rasa/core/channels/voice_stream/call_state.py +6 -2
  138. rasa/core/channels/voice_stream/genesys.py +320 -0
  139. rasa/core/channels/voice_stream/tts/azure.py +13 -5
  140. rasa/core/channels/voice_stream/tts/cartesia.py +34 -14
  141. rasa/core/channels/voice_stream/tts/tts_cache.py +3 -2
  142. rasa/core/channels/voice_stream/tts/tts_engine.py +1 -1
  143. rasa/core/channels/voice_stream/twilio_media_streams.py +12 -8
  144. rasa/core/channels/voice_stream/util.py +1 -1
  145. rasa/core/channels/voice_stream/voice_channel.py +100 -56
  146. rasa/core/channels/webexteams.py +3 -4
  147. rasa/core/constants.py +2 -0
  148. rasa/core/evaluation/marker.py +7 -6
  149. rasa/core/evaluation/marker_base.py +15 -16
  150. rasa/core/evaluation/marker_stats.py +3 -4
  151. rasa/core/evaluation/marker_tracker_loader.py +5 -4
  152. rasa/core/exporter.py +4 -4
  153. rasa/core/featurizers/precomputation.py +8 -8
  154. rasa/core/featurizers/single_state_featurizer.py +7 -7
  155. rasa/core/featurizers/tracker_featurizers.py +13 -13
  156. rasa/core/http_interpreter.py +3 -4
  157. rasa/core/information_retrieval/__init__.py +1 -1
  158. rasa/core/information_retrieval/faiss.py +4 -4
  159. rasa/core/information_retrieval/information_retrieval.py +2 -2
  160. rasa/core/information_retrieval/milvus.py +3 -3
  161. rasa/core/information_retrieval/qdrant.py +3 -3
  162. rasa/core/jobs.py +1 -0
  163. rasa/core/lock.py +2 -3
  164. rasa/core/lock_store.py +3 -3
  165. rasa/core/migrate.py +12 -9
  166. rasa/core/nlg/__init__.py +1 -1
  167. rasa/core/nlg/callback.py +2 -3
  168. rasa/core/nlg/contextual_response_rephraser.py +82 -14
  169. rasa/core/nlg/generator.py +85 -17
  170. rasa/core/nlg/interpolator.py +4 -3
  171. rasa/core/nlg/response.py +9 -7
  172. rasa/core/nlg/summarize.py +1 -0
  173. rasa/core/nlg/translate.py +55 -0
  174. rasa/core/persistor.py +3 -3
  175. rasa/core/policies/ensemble.py +10 -9
  176. rasa/core/policies/enterprise_search_policy.py +87 -21
  177. rasa/core/policies/enterprise_search_prompt_with_citation_template.jinja2 +1 -1
  178. rasa/core/policies/flow_policy.py +13 -14
  179. rasa/core/policies/flows/flow_executor.py +85 -55
  180. rasa/core/policies/intentless_policy.py +6 -7
  181. rasa/core/policies/memoization.py +22 -20
  182. rasa/core/policies/policy.py +24 -22
  183. rasa/core/policies/rule_policy.py +37 -36
  184. rasa/core/policies/ted_policy.py +87 -85
  185. rasa/core/policies/unexpected_intent_policy.py +77 -75
  186. rasa/core/processor.py +167 -74
  187. rasa/core/run.py +5 -4
  188. rasa/core/secrets_manager/endpoints.py +2 -3
  189. rasa/core/secrets_manager/factory.py +2 -3
  190. rasa/core/secrets_manager/secret_manager.py +2 -3
  191. rasa/core/secrets_manager/vault.py +2 -2
  192. rasa/core/test.py +30 -30
  193. rasa/core/tracker_store.py +138 -49
  194. rasa/core/train.py +1 -1
  195. rasa/core/training/__init__.py +2 -2
  196. rasa/core/training/converters/responses_prefix_converter.py +1 -2
  197. rasa/core/training/interactive.py +13 -13
  198. rasa/core/training/story_conflict.py +4 -5
  199. rasa/core/training/training.py +3 -5
  200. rasa/core/utils.py +5 -5
  201. rasa/core/visualize.py +1 -1
  202. rasa/dialogue_understanding/coexistence/intent_based_router.py +2 -2
  203. rasa/dialogue_understanding/coexistence/llm_based_router.py +5 -5
  204. rasa/dialogue_understanding/commands/__init__.py +22 -22
  205. rasa/dialogue_understanding/commands/can_not_handle_command.py +38 -1
  206. rasa/dialogue_understanding/commands/cancel_flow_command.py +96 -9
  207. rasa/dialogue_understanding/commands/change_flow_command.py +36 -2
  208. rasa/dialogue_understanding/commands/chit_chat_answer_command.py +36 -4
  209. rasa/dialogue_understanding/commands/clarify_command.py +46 -4
  210. rasa/dialogue_understanding/commands/command.py +3 -2
  211. rasa/dialogue_understanding/commands/command_syntax_manager.py +55 -0
  212. rasa/dialogue_understanding/commands/correct_slots_command.py +14 -5
  213. rasa/dialogue_understanding/commands/error_command.py +1 -1
  214. rasa/dialogue_understanding/commands/free_form_answer_command.py +2 -1
  215. rasa/dialogue_understanding/commands/handle_code_change_command.py +2 -2
  216. rasa/dialogue_understanding/commands/handle_digressions_command.py +144 -0
  217. rasa/dialogue_understanding/commands/human_handoff_command.py +34 -4
  218. rasa/dialogue_understanding/commands/knowledge_answer_command.py +36 -4
  219. rasa/dialogue_understanding/commands/noop_command.py +2 -1
  220. rasa/dialogue_understanding/commands/prompt_command.py +94 -0
  221. rasa/dialogue_understanding/commands/repeat_bot_messages_command.py +34 -4
  222. rasa/dialogue_understanding/commands/restart_command.py +2 -5
  223. rasa/dialogue_understanding/commands/session_end_command.py +3 -5
  224. rasa/dialogue_understanding/commands/session_start_command.py +3 -5
  225. rasa/dialogue_understanding/commands/set_slot_command.py +55 -16
  226. rasa/dialogue_understanding/commands/skip_question_command.py +34 -4
  227. rasa/dialogue_understanding/commands/start_flow_command.py +78 -2
  228. rasa/dialogue_understanding/commands/user_silence_command.py +3 -5
  229. rasa/dialogue_understanding/commands/utils.py +126 -43
  230. rasa/dialogue_understanding/constants.py +2 -0
  231. rasa/dialogue_understanding/generator/__init__.py +2 -0
  232. rasa/dialogue_understanding/generator/command_generator.py +120 -79
  233. rasa/dialogue_understanding/generator/command_parser.py +245 -0
  234. rasa/dialogue_understanding/generator/constants.py +12 -4
  235. rasa/dialogue_understanding/generator/flow_retrieval.py +7 -7
  236. rasa/dialogue_understanding/generator/llm_based_command_generator.py +187 -59
  237. rasa/dialogue_understanding/generator/llm_command_generator.py +6 -3
  238. rasa/dialogue_understanding/generator/multi_step/multi_step_llm_command_generator.py +106 -110
  239. rasa/dialogue_understanding/generator/nlu_command_adapter.py +53 -11
  240. rasa/dialogue_understanding/generator/prompt_templates/__init__.py +0 -0
  241. rasa/dialogue_understanding/generator/prompt_templates/command_prompt_v2_claude_3_5_sonnet_20240620_template.jinja2 +58 -0
  242. rasa/dialogue_understanding/generator/prompt_templates/command_prompt_v2_gpt_4o_2024_11_20_template.jinja2 +57 -0
  243. rasa/dialogue_understanding/generator/single_step/compact_llm_command_generator.py +574 -0
  244. rasa/dialogue_understanding/generator/single_step/single_step_llm_command_generator.py +41 -386
  245. rasa/dialogue_understanding/generator/utils.py +76 -0
  246. rasa/dialogue_understanding/patterns/cancel.py +2 -1
  247. rasa/dialogue_understanding/patterns/cannot_handle.py +1 -0
  248. rasa/dialogue_understanding/patterns/chitchat.py +1 -1
  249. rasa/dialogue_understanding/patterns/clarify.py +2 -1
  250. rasa/dialogue_understanding/patterns/code_change.py +2 -0
  251. rasa/dialogue_understanding/patterns/collect_information.py +7 -4
  252. rasa/dialogue_understanding/patterns/completed.py +1 -1
  253. rasa/dialogue_understanding/patterns/continue_interrupted.py +1 -1
  254. rasa/dialogue_understanding/patterns/correction.py +17 -3
  255. rasa/dialogue_understanding/patterns/default_flows_for_patterns.yml +78 -2
  256. rasa/dialogue_understanding/patterns/handle_digressions.py +81 -0
  257. rasa/dialogue_understanding/patterns/human_handoff.py +1 -1
  258. rasa/dialogue_understanding/patterns/internal_error.py +1 -0
  259. rasa/dialogue_understanding/patterns/search.py +1 -1
  260. rasa/dialogue_understanding/patterns/session_start.py +1 -1
  261. rasa/dialogue_understanding/patterns/skip_question.py +1 -0
  262. rasa/dialogue_understanding/patterns/user_silence.py +1 -1
  263. rasa/dialogue_understanding/patterns/validate_slot.py +65 -0
  264. rasa/dialogue_understanding/processor/command_processor.py +193 -43
  265. rasa/dialogue_understanding/processor/command_processor_component.py +1 -1
  266. rasa/dialogue_understanding/stack/dialogue_stack.py +4 -3
  267. rasa/dialogue_understanding/stack/frames/__init__.py +2 -2
  268. rasa/dialogue_understanding/stack/frames/chit_chat_frame.py +4 -1
  269. rasa/dialogue_understanding/stack/frames/dialogue_stack_frame.py +2 -3
  270. rasa/dialogue_understanding/stack/frames/flow_stack_frame.py +5 -2
  271. rasa/dialogue_understanding/stack/frames/search_frame.py +4 -1
  272. rasa/dialogue_understanding/stack/utils.py +56 -10
  273. rasa/dialogue_understanding/utils.py +164 -0
  274. rasa/dialogue_understanding_test/README.md +429 -0
  275. rasa/dialogue_understanding_test/__init__.py +0 -0
  276. rasa/dialogue_understanding_test/command_comparison.py +60 -0
  277. rasa/dialogue_understanding_test/command_metric_calculation.py +122 -0
  278. rasa/dialogue_understanding_test/constants.py +22 -0
  279. rasa/dialogue_understanding_test/du_test_case.py +448 -0
  280. rasa/dialogue_understanding_test/du_test_result.py +390 -0
  281. rasa/dialogue_understanding_test/du_test_runner.py +322 -0
  282. rasa/dialogue_understanding_test/du_test_schema.yml +161 -0
  283. rasa/dialogue_understanding_test/io.py +443 -0
  284. rasa/dialogue_understanding_test/test_case_simulation/__init__.py +0 -0
  285. rasa/dialogue_understanding_test/test_case_simulation/exception.py +28 -0
  286. rasa/dialogue_understanding_test/test_case_simulation/test_case_tracker_simulator.py +336 -0
  287. rasa/dialogue_understanding_test/utils.py +70 -0
  288. rasa/dialogue_understanding_test/validation.py +77 -0
  289. rasa/e2e_test/aggregate_test_stats_calculator.py +1 -1
  290. rasa/e2e_test/assertions.py +202 -175
  291. rasa/e2e_test/assertions_schema.yml +6 -0
  292. rasa/e2e_test/constants.py +16 -1
  293. rasa/e2e_test/e2e_config.py +102 -41
  294. rasa/e2e_test/e2e_config_schema.yml +28 -10
  295. rasa/e2e_test/e2e_test_case.py +5 -5
  296. rasa/e2e_test/e2e_test_converter.py +2 -3
  297. rasa/e2e_test/e2e_test_coverage_report.py +6 -6
  298. rasa/e2e_test/e2e_test_result.py +1 -1
  299. rasa/e2e_test/e2e_test_runner.py +143 -38
  300. rasa/e2e_test/llm_judge_prompts/answer_relevance_prompt_template.jinja2 +93 -0
  301. rasa/e2e_test/llm_judge_prompts/groundedness_prompt_template.jinja2 +169 -0
  302. rasa/e2e_test/stub_custom_action.py +1 -1
  303. rasa/e2e_test/utils/generative_assertions.py +243 -0
  304. rasa/e2e_test/utils/io.py +123 -93
  305. rasa/e2e_test/utils/validation.py +101 -3
  306. rasa/engine/caching.py +5 -7
  307. rasa/engine/constants.py +1 -1
  308. rasa/engine/graph.py +3 -2
  309. rasa/engine/language.py +182 -0
  310. rasa/engine/recipes/config_files/default_config.yml +4 -0
  311. rasa/engine/recipes/default_components.py +13 -15
  312. rasa/engine/recipes/default_recipe.py +65 -49
  313. rasa/engine/recipes/graph_recipe.py +10 -7
  314. rasa/engine/recipes/recipe.py +2 -2
  315. rasa/engine/runner/dask.py +2 -2
  316. rasa/engine/runner/interface.py +1 -0
  317. rasa/engine/storage/local_model_storage.py +6 -4
  318. rasa/engine/storage/resource.py +2 -1
  319. rasa/engine/storage/storage.py +8 -3
  320. rasa/engine/training/components.py +2 -1
  321. rasa/engine/training/fingerprinting.py +4 -2
  322. rasa/engine/training/graph_trainer.py +4 -4
  323. rasa/engine/training/hooks.py +2 -2
  324. rasa/engine/validation.py +36 -33
  325. rasa/exceptions.py +3 -2
  326. rasa/graph_components/converters/nlu_message_converter.py +3 -3
  327. rasa/graph_components/providers/domain_for_core_training_provider.py +3 -3
  328. rasa/graph_components/providers/domain_provider.py +3 -2
  329. rasa/graph_components/providers/flows_provider.py +2 -3
  330. rasa/graph_components/providers/forms_provider.py +4 -4
  331. rasa/graph_components/providers/nlu_training_data_provider.py +5 -3
  332. rasa/graph_components/providers/responses_provider.py +4 -4
  333. rasa/graph_components/providers/rule_only_provider.py +3 -2
  334. rasa/graph_components/providers/story_graph_provider.py +8 -8
  335. rasa/graph_components/providers/training_tracker_provider.py +3 -2
  336. rasa/graph_components/validators/default_recipe_validator.py +16 -16
  337. rasa/graph_components/validators/finetuning_validator.py +10 -8
  338. rasa/hooks.py +19 -14
  339. rasa/jupyter.py +2 -2
  340. rasa/llm_fine_tuning/annotation_module.py +4 -4
  341. rasa/llm_fine_tuning/conversations.py +5 -33
  342. rasa/llm_fine_tuning/llm_data_preparation_module.py +6 -4
  343. rasa/llm_fine_tuning/paraphrasing/conversation_rephraser.py +4 -4
  344. rasa/llm_fine_tuning/paraphrasing/rephrase_validator.py +18 -13
  345. rasa/llm_fine_tuning/paraphrasing_module.py +6 -2
  346. rasa/llm_fine_tuning/storage.py +3 -3
  347. rasa/llm_fine_tuning/train_test_split_module.py +27 -27
  348. rasa/llm_fine_tuning/utils.py +7 -0
  349. rasa/markers/marker.py +2 -3
  350. rasa/markers/marker_base.py +1 -2
  351. rasa/markers/upload.py +2 -2
  352. rasa/markers/validate.py +2 -3
  353. rasa/model.py +3 -5
  354. rasa/model_manager/config.py +1 -1
  355. rasa/model_manager/model_api.py +5 -4
  356. rasa/model_manager/runner_service.py +13 -10
  357. rasa/model_manager/socket_bridge.py +15 -9
  358. rasa/model_manager/studio_jwt_auth.py +1 -0
  359. rasa/model_manager/trainer_service.py +9 -7
  360. rasa/model_manager/utils.py +1 -1
  361. rasa/model_manager/warm_rasa_process.py +14 -9
  362. rasa/model_service.py +5 -6
  363. rasa/model_testing.py +13 -15
  364. rasa/model_training.py +29 -29
  365. rasa/nlu/classifiers/diet_classifier.py +72 -73
  366. rasa/nlu/classifiers/fallback_classifier.py +9 -8
  367. rasa/nlu/classifiers/keyword_intent_classifier.py +7 -6
  368. rasa/nlu/classifiers/logistic_regression_classifier.py +3 -3
  369. rasa/nlu/classifiers/mitie_intent_classifier.py +5 -4
  370. rasa/nlu/classifiers/regex_message_handler.py +3 -2
  371. rasa/nlu/classifiers/sklearn_intent_classifier.py +2 -2
  372. rasa/nlu/convert.py +2 -2
  373. rasa/nlu/emulators/dialogflow.py +3 -3
  374. rasa/nlu/emulators/luis.py +5 -5
  375. rasa/nlu/emulators/no_emulator.py +1 -0
  376. rasa/nlu/emulators/wit.py +4 -4
  377. rasa/nlu/extractors/crf_entity_extractor.py +11 -11
  378. rasa/nlu/extractors/duckling_entity_extractor.py +7 -6
  379. rasa/nlu/extractors/entity_synonyms.py +10 -9
  380. rasa/nlu/extractors/extractor.py +16 -16
  381. rasa/nlu/extractors/mitie_entity_extractor.py +10 -9
  382. rasa/nlu/extractors/regex_entity_extractor.py +11 -10
  383. rasa/nlu/extractors/spacy_entity_extractor.py +2 -2
  384. rasa/nlu/featurizers/dense_featurizer/convert_featurizer.py +15 -14
  385. rasa/nlu/featurizers/dense_featurizer/dense_featurizer.py +2 -1
  386. rasa/nlu/featurizers/dense_featurizer/lm_featurizer.py +10 -9
  387. rasa/nlu/featurizers/dense_featurizer/mitie_featurizer.py +9 -7
  388. rasa/nlu/featurizers/dense_featurizer/spacy_featurizer.py +13 -12
  389. rasa/nlu/featurizers/featurizer.py +5 -4
  390. rasa/nlu/featurizers/sparse_featurizer/count_vectors_featurizer.py +6 -6
  391. rasa/nlu/featurizers/sparse_featurizer/lexical_syntactic_featurizer.py +4 -4
  392. rasa/nlu/featurizers/sparse_featurizer/regex_featurizer.py +4 -4
  393. rasa/nlu/featurizers/sparse_featurizer/sparse_featurizer.py +2 -0
  394. rasa/nlu/model.py +0 -1
  395. rasa/nlu/selectors/response_selector.py +67 -68
  396. rasa/nlu/test.py +38 -38
  397. rasa/nlu/tokenizers/jieba_tokenizer.py +1 -2
  398. rasa/nlu/tokenizers/mitie_tokenizer.py +2 -2
  399. rasa/nlu/tokenizers/spacy_tokenizer.py +3 -3
  400. rasa/nlu/tokenizers/tokenizer.py +6 -7
  401. rasa/nlu/tokenizers/whitespace_tokenizer.py +1 -1
  402. rasa/nlu/utils/bilou_utils.py +7 -7
  403. rasa/nlu/utils/hugging_face/registry.py +22 -22
  404. rasa/nlu/utils/hugging_face/transformers_pre_post_processors.py +2 -1
  405. rasa/nlu/utils/mitie_utils.py +2 -1
  406. rasa/nlu/utils/pattern_utils.py +1 -1
  407. rasa/nlu/utils/spacy_utils.py +3 -3
  408. rasa/plugin.py +12 -1
  409. rasa/server.py +6 -3
  410. rasa/shared/constants.py +45 -18
  411. rasa/shared/core/command_payload_reader.py +15 -7
  412. rasa/shared/core/constants.py +34 -4
  413. rasa/shared/core/conversation.py +1 -2
  414. rasa/shared/core/domain.py +19 -20
  415. rasa/shared/core/events.py +60 -39
  416. rasa/shared/core/flows/__init__.py +0 -1
  417. rasa/shared/core/flows/constants.py +11 -0
  418. rasa/shared/core/flows/flow.py +107 -26
  419. rasa/shared/core/flows/flow_step.py +4 -3
  420. rasa/shared/core/flows/flow_step_links.py +1 -2
  421. rasa/shared/core/flows/flow_step_sequence.py +1 -1
  422. rasa/shared/core/flows/flows_list.py +3 -3
  423. rasa/shared/core/flows/flows_yaml_schema.json +69 -3
  424. rasa/shared/core/flows/nlu_trigger.py +1 -1
  425. rasa/shared/core/flows/steps/__init__.py +2 -2
  426. rasa/shared/core/flows/steps/action.py +1 -1
  427. rasa/shared/core/flows/steps/call.py +1 -1
  428. rasa/shared/core/flows/steps/collect.py +22 -40
  429. rasa/shared/core/flows/steps/internal.py +1 -1
  430. rasa/shared/core/flows/steps/link.py +1 -1
  431. rasa/shared/core/flows/steps/no_operation.py +2 -2
  432. rasa/shared/core/flows/steps/set_slots.py +1 -1
  433. rasa/shared/core/flows/utils.py +44 -4
  434. rasa/shared/core/flows/validation.py +4 -6
  435. rasa/shared/core/generator.py +20 -21
  436. rasa/shared/core/slot_mappings.py +360 -121
  437. rasa/shared/core/slots.py +163 -6
  438. rasa/shared/core/trackers.py +108 -33
  439. rasa/shared/core/training_data/loading.py +1 -1
  440. rasa/shared/core/training_data/story_reader/story_reader.py +3 -3
  441. rasa/shared/core/training_data/story_reader/story_step_builder.py +4 -4
  442. rasa/shared/core/training_data/story_reader/yaml_story_reader.py +29 -31
  443. rasa/shared/core/training_data/story_writer/yaml_story_writer.py +22 -24
  444. rasa/shared/core/training_data/structures.py +11 -12
  445. rasa/shared/core/training_data/visualization.py +10 -10
  446. rasa/shared/data.py +6 -6
  447. rasa/shared/engine/caching.py +0 -1
  448. rasa/shared/exceptions.py +2 -2
  449. rasa/shared/importers/importer.py +58 -2
  450. rasa/shared/importers/rasa.py +5 -6
  451. rasa/shared/importers/utils.py +1 -1
  452. rasa/shared/nlu/constants.py +9 -0
  453. rasa/shared/nlu/training_data/entities_parser.py +6 -6
  454. rasa/shared/nlu/training_data/features.py +3 -3
  455. rasa/shared/nlu/training_data/formats/__init__.py +1 -1
  456. rasa/shared/nlu/training_data/formats/dialogflow.py +4 -5
  457. rasa/shared/nlu/training_data/formats/luis.py +7 -8
  458. rasa/shared/nlu/training_data/formats/rasa.py +4 -5
  459. rasa/shared/nlu/training_data/formats/rasa_yaml.py +17 -16
  460. rasa/shared/nlu/training_data/formats/readerwriter.py +8 -11
  461. rasa/shared/nlu/training_data/formats/wit.py +3 -4
  462. rasa/shared/nlu/training_data/loading.py +4 -4
  463. rasa/shared/nlu/training_data/lookup_tables_parser.py +1 -1
  464. rasa/shared/nlu/training_data/message.py +13 -14
  465. rasa/shared/nlu/training_data/schemas/data_schema.py +1 -1
  466. rasa/shared/nlu/training_data/schemas/responses.yml +19 -11
  467. rasa/shared/nlu/training_data/synonyms_parser.py +3 -3
  468. rasa/shared/nlu/training_data/training_data.py +12 -13
  469. rasa/shared/nlu/training_data/util.py +11 -10
  470. rasa/shared/providers/_configs/azure_entra_id_config.py +541 -0
  471. rasa/shared/providers/_configs/azure_openai_client_config.py +150 -15
  472. rasa/shared/providers/_configs/client_config.py +3 -1
  473. rasa/shared/providers/_configs/default_litellm_client_config.py +9 -7
  474. rasa/shared/providers/_configs/huggingface_local_embedding_client_config.py +13 -11
  475. rasa/shared/providers/_configs/litellm_router_client_config.py +12 -10
  476. rasa/shared/providers/_configs/model_group_config.py +8 -5
  477. rasa/shared/providers/_configs/oauth_config.py +33 -0
  478. rasa/shared/providers/_configs/openai_client_config.py +14 -12
  479. rasa/shared/providers/_configs/rasa_llm_client_config.py +5 -3
  480. rasa/shared/providers/_configs/self_hosted_llm_client_config.py +12 -11
  481. rasa/shared/providers/_configs/utils.py +1 -0
  482. rasa/shared/providers/_ssl_verification_utils.py +5 -6
  483. rasa/shared/providers/_utils.py +5 -5
  484. rasa/shared/providers/constants.py +6 -0
  485. rasa/shared/providers/embedding/_base_litellm_embedding_client.py +1 -1
  486. rasa/shared/providers/embedding/azure_openai_embedding_client.py +32 -7
  487. rasa/shared/providers/embedding/embedding_client.py +1 -1
  488. rasa/shared/providers/embedding/litellm_router_embedding_client.py +5 -2
  489. rasa/shared/providers/llm/_base_litellm_client.py +43 -18
  490. rasa/shared/providers/llm/azure_openai_llm_client.py +90 -34
  491. rasa/shared/providers/llm/default_litellm_llm_client.py +4 -2
  492. rasa/shared/providers/llm/litellm_router_llm_client.py +32 -9
  493. rasa/shared/providers/llm/llm_client.py +24 -8
  494. rasa/shared/providers/llm/llm_response.py +61 -2
  495. rasa/shared/providers/llm/openai_llm_client.py +11 -5
  496. rasa/shared/providers/llm/rasa_llm_client.py +17 -14
  497. rasa/shared/providers/llm/self_hosted_llm_client.py +35 -15
  498. rasa/shared/providers/mappings.py +18 -19
  499. rasa/shared/providers/router/_base_litellm_router_client.py +48 -15
  500. rasa/shared/providers/router/router_client.py +3 -1
  501. rasa/shared/utils/cli.py +1 -1
  502. rasa/shared/utils/common.py +15 -1
  503. rasa/shared/utils/constants.py +3 -0
  504. rasa/shared/utils/health_check/embeddings_health_check_mixin.py +1 -1
  505. rasa/shared/utils/health_check/health_check.py +3 -3
  506. rasa/shared/utils/health_check/llm_health_check_mixin.py +1 -1
  507. rasa/shared/utils/io.py +1 -1
  508. rasa/shared/utils/llm.py +100 -18
  509. rasa/shared/utils/pykwalify_extensions.py +25 -1
  510. rasa/shared/utils/schemas/domain.yml +26 -1
  511. rasa/shared/utils/schemas/events.py +1 -1
  512. rasa/shared/utils/yaml.py +24 -20
  513. rasa/studio/auth.py +3 -3
  514. rasa/studio/config.py +1 -2
  515. rasa/studio/data_handler.py +3 -3
  516. rasa/studio/download.py +1 -1
  517. rasa/studio/results_logger.py +3 -3
  518. rasa/studio/upload.py +21 -5
  519. rasa/telemetry.py +127 -48
  520. rasa/tracing/config.py +5 -3
  521. rasa/tracing/constants.py +12 -0
  522. rasa/tracing/instrumentation/attribute_extractors.py +92 -14
  523. rasa/tracing/instrumentation/instrumentation.py +61 -5
  524. rasa/tracing/instrumentation/intentless_policy_instrumentation.py +1 -1
  525. rasa/tracing/instrumentation/metrics.py +52 -11
  526. rasa/tracing/metric_instrument_provider.py +54 -14
  527. rasa/utils/common.py +12 -24
  528. rasa/utils/endpoints.py +1 -1
  529. rasa/utils/io.py +7 -7
  530. rasa/utils/licensing.py +3 -4
  531. rasa/utils/log_utils.py +7 -6
  532. rasa/utils/ml_utils.py +1 -0
  533. rasa/utils/plotting.py +3 -3
  534. rasa/utils/sanic_error_handler.py +1 -1
  535. rasa/utils/tensorflow/callback.py +2 -2
  536. rasa/utils/tensorflow/crf.py +2 -2
  537. rasa/utils/tensorflow/data_generator.py +5 -5
  538. rasa/utils/tensorflow/environment.py +3 -3
  539. rasa/utils/tensorflow/feature_array.py +2 -3
  540. rasa/utils/tensorflow/layers.py +18 -12
  541. rasa/utils/tensorflow/layers_utils.py +2 -1
  542. rasa/utils/tensorflow/metrics.py +2 -2
  543. rasa/utils/tensorflow/model_data.py +7 -7
  544. rasa/utils/tensorflow/model_data_utils.py +10 -9
  545. rasa/utils/tensorflow/models.py +31 -32
  546. rasa/utils/tensorflow/rasa_layers.py +20 -19
  547. rasa/utils/tensorflow/types.py +2 -1
  548. rasa/utils/train_utils.py +23 -21
  549. rasa/utils/url_tools.py +1 -1
  550. rasa/validator.py +594 -115
  551. rasa/version.py +1 -1
  552. {rasa_pro-3.11.4.dist-info → rasa_pro-3.12.0.dist-info}/METADATA +23 -26
  553. rasa_pro-3.12.0.dist-info/RECORD +829 -0
  554. rasa/core/channels/inspector/dist/assets/arc-632a63ec.js +0 -1
  555. rasa/core/channels/inspector/dist/assets/c4Diagram-d0fbc5ce-081e0df4.js +0 -10
  556. rasa/core/channels/inspector/dist/assets/classDiagram-936ed81e-3df0afc2.js +0 -2
  557. rasa/core/channels/inspector/dist/assets/classDiagram-v2-c3cb15f1-8c5ed31e.js +0 -2
  558. rasa/core/channels/inspector/dist/assets/edges-f2ad444c-4fc48c3e.js +0 -4
  559. rasa/core/channels/inspector/dist/assets/flowDb-1972c806-9ec53a3c.js +0 -6
  560. rasa/core/channels/inspector/dist/assets/flowDiagram-7ea5b25a-41da787a.js +0 -4
  561. rasa/core/channels/inspector/dist/assets/flowDiagram-v2-855bc5b3-8bea338b.js +0 -1
  562. rasa/core/channels/inspector/dist/assets/flowchart-elk-definition-abe16c3d-ce370633.js +0 -139
  563. rasa/core/channels/inspector/dist/assets/ganttDiagram-9b5ea136-90a36523.js +0 -266
  564. rasa/core/channels/inspector/dist/assets/gitGraphDiagram-99d0ae7c-41e1aa3f.js +0 -70
  565. rasa/core/channels/inspector/dist/assets/index-2c4b9a3b-e6f2af62.js +0 -1
  566. rasa/core/channels/inspector/dist/assets/layout-498807d8.js +0 -1
  567. rasa/core/channels/inspector/dist/assets/linear-8a078617.js +0 -1
  568. rasa/core/channels/inspector/dist/assets/mindmap-definition-beec6740-396d17dd.js +0 -109
  569. rasa/core/channels/inspector/dist/assets/sankeyDiagram-8f13d901-53f6f391.js +0 -8
  570. rasa/core/channels/inspector/dist/assets/sequenceDiagram-b655622a-715c9c20.js +0 -122
  571. rasa/core/channels/inspector/dist/assets/stateDiagram-59f0c015-2e8fb31f.js +0 -1
  572. rasa/core/channels/inspector/dist/assets/stateDiagram-v2-2b26beab-7e2d2aa0.js +0 -1
  573. rasa/core/channels/inspector/dist/assets/styles-080da4f6-4420cea6.js +0 -110
  574. rasa/core/channels/inspector/dist/assets/styles-3dcbcfbf-28676cf4.js +0 -159
  575. rasa/core/channels/inspector/dist/assets/svgDrawCommon-4835440b-151251e9.js +0 -1
  576. rasa_pro-3.11.4.dist-info/RECORD +0 -779
  577. /rasa/dialogue_understanding/generator/{single_step → prompt_templates}/command_prompt_template.jinja2 +0 -0
  578. {rasa_pro-3.11.4.dist-info → rasa_pro-3.12.0.dist-info}/NOTICE +0 -0
  579. {rasa_pro-3.11.4.dist-info → rasa_pro-3.12.0.dist-info}/WHEEL +0 -0
  580. {rasa_pro-3.11.4.dist-info → rasa_pro-3.12.0.dist-info}/entry_points.txt +0 -0
@@ -1,8 +0,0 @@
1
- import{c as rt,g as mt,s as _t,a as kt,b as xt,D as vt,B as bt,E as wt,j as St,aQ as Lt,h as Y,i as Et}from"./index-e793d777.js";import{o as At}from"./ordinal-ba9b4969.js";import"./init-77b53fdd.js";function Tt(t){for(var n=t.length/6|0,i=new Array(n),l=0;l<n;)i[l]="#"+t.slice(l*6,++l*6);return i}const Mt=Tt("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab");function ot(t,n){let i;if(n===void 0)for(const l of t)l!=null&&(i<l||i===void 0&&l>=l)&&(i=l);else{let l=-1;for(let u of t)(u=n(u,++l,t))!=null&&(i<u||i===void 0&&u>=u)&&(i=u)}return i}function yt(t,n){let i;if(n===void 0)for(const l of t)l!=null&&(i>l||i===void 0&&l>=l)&&(i=l);else{let l=-1;for(let u of t)(u=n(u,++l,t))!=null&&(i>u||i===void 0&&u>=u)&&(i=u)}return i}function Z(t,n){let i=0;if(n===void 0)for(let l of t)(l=+l)&&(i+=l);else{let l=-1;for(let u of t)(u=+n(u,++l,t))&&(i+=u)}return i}function Nt(t){return t.target.depth}function Pt(t){return t.depth}function Ct(t,n){return n-1-t.height}function dt(t,n){return t.sourceLinks.length?t.depth:n-1}function It(t){return t.targetLinks.length?t.depth:t.sourceLinks.length?yt(t.sourceLinks,Nt)-1:0}function G(t){return function(){return t}}function lt(t,n){return H(t.source,n.source)||t.index-n.index}function at(t,n){return H(t.target,n.target)||t.index-n.index}function H(t,n){return t.y0-n.y0}function J(t){return t.value}function Ot(t){return t.index}function $t(t){return t.nodes}function zt(t){return t.links}function ct(t,n){const i=t.get(n);if(!i)throw new Error("missing: "+n);return i}function ut({nodes:t}){for(const n of t){let i=n.y0,l=i;for(const u of n.sourceLinks)u.y0=i+u.width/2,i+=u.width;for(const u of n.targetLinks)u.y1=l+u.width/2,l+=u.width}}function jt(){let t=0,n=0,i=1,l=1,u=24,k=8,g,m=Ot,s=dt,o,c,p=$t,b=zt,y=6;function x(){const e={nodes:p.apply(null,arguments),links:b.apply(null,arguments)};return E(e),L(e),A(e),N(e),S(e),ut(e),e}x.update=function(e){return ut(e),e},x.nodeId=function(e){return arguments.length?(m=typeof e=="function"?e:G(e),x):m},x.nodeAlign=function(e){return arguments.length?(s=typeof e=="function"?e:G(e),x):s},x.nodeSort=function(e){return arguments.length?(o=e,x):o},x.nodeWidth=function(e){return arguments.length?(u=+e,x):u},x.nodePadding=function(e){return arguments.length?(k=g=+e,x):k},x.nodes=function(e){return arguments.length?(p=typeof e=="function"?e:G(e),x):p},x.links=function(e){return arguments.length?(b=typeof e=="function"?e:G(e),x):b},x.linkSort=function(e){return arguments.length?(c=e,x):c},x.size=function(e){return arguments.length?(t=n=0,i=+e[0],l=+e[1],x):[i-t,l-n]},x.extent=function(e){return arguments.length?(t=+e[0][0],i=+e[1][0],n=+e[0][1],l=+e[1][1],x):[[t,n],[i,l]]},x.iterations=function(e){return arguments.length?(y=+e,x):y};function E({nodes:e,links:f}){for(const[h,r]of e.entries())r.index=h,r.sourceLinks=[],r.targetLinks=[];const a=new Map(e.map((h,r)=>[m(h,r,e),h]));for(const[h,r]of f.entries()){r.index=h;let{source:_,target:v}=r;typeof _!="object"&&(_=r.source=ct(a,_)),typeof v!="object"&&(v=r.target=ct(a,v)),_.sourceLinks.push(r),v.targetLinks.push(r)}if(c!=null)for(const{sourceLinks:h,targetLinks:r}of e)h.sort(c),r.sort(c)}function L({nodes:e}){for(const f of e)f.value=f.fixedValue===void 0?Math.max(Z(f.sourceLinks,J),Z(f.targetLinks,J)):f.fixedValue}function A({nodes:e}){const f=e.length;let a=new Set(e),h=new Set,r=0;for(;a.size;){for(const _ of a){_.depth=r;for(const{target:v}of _.sourceLinks)h.add(v)}if(++r>f)throw new Error("circular link");a=h,h=new Set}}function N({nodes:e}){const f=e.length;let a=new Set(e),h=new Set,r=0;for(;a.size;){for(const _ of a){_.height=r;for(const{source:v}of _.targetLinks)h.add(v)}if(++r>f)throw new Error("circular link");a=h,h=new Set}}function P({nodes:e}){const f=ot(e,r=>r.depth)+1,a=(i-t-u)/(f-1),h=new Array(f);for(const r of e){const _=Math.max(0,Math.min(f-1,Math.floor(s.call(null,r,f))));r.layer=_,r.x0=t+_*a,r.x1=r.x0+u,h[_]?h[_].push(r):h[_]=[r]}if(o)for(const r of h)r.sort(o);return h}function z(e){const f=yt(e,a=>(l-n-(a.length-1)*g)/Z(a,J));for(const a of e){let h=n;for(const r of a){r.y0=h,r.y1=h+r.value*f,h=r.y1+g;for(const _ of r.sourceLinks)_.width=_.value*f}h=(l-h+g)/(a.length+1);for(let r=0;r<a.length;++r){const _=a[r];_.y0+=h*(r+1),_.y1+=h*(r+1)}O(a)}}function S(e){const f=P(e);g=Math.min(k,(l-n)/(ot(f,a=>a.length)-1)),z(f);for(let a=0;a<y;++a){const h=Math.pow(.99,a),r=Math.max(1-h,(a+1)/y);$(f,h,r),M(f,h,r)}}function M(e,f,a){for(let h=1,r=e.length;h<r;++h){const _=e[h];for(const v of _){let U=0,j=0;for(const{source:F,value:K}of v.targetLinks){let W=K*(v.layer-F.layer);U+=T(F,v)*W,j+=W}if(!(j>0))continue;let V=(U/j-v.y0)*f;v.y0+=V,v.y1+=V,w(v)}o===void 0&&_.sort(H),C(_,a)}}function $(e,f,a){for(let h=e.length,r=h-2;r>=0;--r){const _=e[r];for(const v of _){let U=0,j=0;for(const{target:F,value:K}of v.sourceLinks){let W=K*(F.layer-v.layer);U+=R(v,F)*W,j+=W}if(!(j>0))continue;let V=(U/j-v.y0)*f;v.y0+=V,v.y1+=V,w(v)}o===void 0&&_.sort(H),C(_,a)}}function C(e,f){const a=e.length>>1,h=e[a];d(e,h.y0-g,a-1,f),I(e,h.y1+g,a+1,f),d(e,l,e.length-1,f),I(e,n,0,f)}function I(e,f,a,h){for(;a<e.length;++a){const r=e[a],_=(f-r.y0)*h;_>1e-6&&(r.y0+=_,r.y1+=_),f=r.y1+g}}function d(e,f,a,h){for(;a>=0;--a){const r=e[a],_=(r.y1-f)*h;_>1e-6&&(r.y0-=_,r.y1-=_),f=r.y0-g}}function w({sourceLinks:e,targetLinks:f}){if(c===void 0){for(const{source:{sourceLinks:a}}of f)a.sort(at);for(const{target:{targetLinks:a}}of e)a.sort(lt)}}function O(e){if(c===void 0)for(const{sourceLinks:f,targetLinks:a}of e)f.sort(at),a.sort(lt)}function T(e,f){let a=e.y0-(e.sourceLinks.length-1)*g/2;for(const{target:h,width:r}of e.sourceLinks){if(h===f)break;a+=r+g}for(const{source:h,width:r}of f.targetLinks){if(h===e)break;a-=r}return a}function R(e,f){let a=f.y0-(f.targetLinks.length-1)*g/2;for(const{source:h,width:r}of f.targetLinks){if(h===e)break;a+=r+g}for(const{target:h,width:r}of e.sourceLinks){if(h===f)break;a-=r}return a}return x}var tt=Math.PI,et=2*tt,D=1e-6,Dt=et-D;function nt(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function gt(){return new nt}nt.prototype=gt.prototype={constructor:nt,moveTo:function(t,n){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+n)},closePath:function(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(t,n){this._+="L"+(this._x1=+t)+","+(this._y1=+n)},quadraticCurveTo:function(t,n,i,l){this._+="Q"+ +t+","+ +n+","+(this._x1=+i)+","+(this._y1=+l)},bezierCurveTo:function(t,n,i,l,u,k){this._+="C"+ +t+","+ +n+","+ +i+","+ +l+","+(this._x1=+u)+","+(this._y1=+k)},arcTo:function(t,n,i,l,u){t=+t,n=+n,i=+i,l=+l,u=+u;var k=this._x1,g=this._y1,m=i-t,s=l-n,o=k-t,c=g-n,p=o*o+c*c;if(u<0)throw new Error("negative radius: "+u);if(this._x1===null)this._+="M"+(this._x1=t)+","+(this._y1=n);else if(p>D)if(!(Math.abs(c*m-s*o)>D)||!u)this._+="L"+(this._x1=t)+","+(this._y1=n);else{var b=i-k,y=l-g,x=m*m+s*s,E=b*b+y*y,L=Math.sqrt(x),A=Math.sqrt(p),N=u*Math.tan((tt-Math.acos((x+p-E)/(2*L*A)))/2),P=N/A,z=N/L;Math.abs(P-1)>D&&(this._+="L"+(t+P*o)+","+(n+P*c)),this._+="A"+u+","+u+",0,0,"+ +(c*b>o*y)+","+(this._x1=t+z*m)+","+(this._y1=n+z*s)}},arc:function(t,n,i,l,u,k){t=+t,n=+n,i=+i,k=!!k;var g=i*Math.cos(l),m=i*Math.sin(l),s=t+g,o=n+m,c=1^k,p=k?l-u:u-l;if(i<0)throw new Error("negative radius: "+i);this._x1===null?this._+="M"+s+","+o:(Math.abs(this._x1-s)>D||Math.abs(this._y1-o)>D)&&(this._+="L"+s+","+o),i&&(p<0&&(p=p%et+et),p>Dt?this._+="A"+i+","+i+",0,1,"+c+","+(t-g)+","+(n-m)+"A"+i+","+i+",0,1,"+c+","+(this._x1=s)+","+(this._y1=o):p>D&&(this._+="A"+i+","+i+",0,"+ +(p>=tt)+","+c+","+(this._x1=t+i*Math.cos(u))+","+(this._y1=n+i*Math.sin(u))))},rect:function(t,n,i,l){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+n)+"h"+ +i+"v"+ +l+"h"+-i+"Z"},toString:function(){return this._}};function ht(t){return function(){return t}}function Bt(t){return t[0]}function Rt(t){return t[1]}var Ut=Array.prototype.slice;function Vt(t){return t.source}function Ft(t){return t.target}function Wt(t){var n=Vt,i=Ft,l=Bt,u=Rt,k=null;function g(){var m,s=Ut.call(arguments),o=n.apply(this,s),c=i.apply(this,s);if(k||(k=m=gt()),t(k,+l.apply(this,(s[0]=o,s)),+u.apply(this,s),+l.apply(this,(s[0]=c,s)),+u.apply(this,s)),m)return k=null,m+""||null}return g.source=function(m){return arguments.length?(n=m,g):n},g.target=function(m){return arguments.length?(i=m,g):i},g.x=function(m){return arguments.length?(l=typeof m=="function"?m:ht(+m),g):l},g.y=function(m){return arguments.length?(u=typeof m=="function"?m:ht(+m),g):u},g.context=function(m){return arguments.length?(k=m??null,g):k},g}function Yt(t,n,i,l,u){t.moveTo(n,i),t.bezierCurveTo(n=(n+l)/2,i,n,u,l,u)}function Gt(){return Wt(Yt)}function Ht(t){return[t.source.x1,t.y0]}function Qt(t){return[t.target.x0,t.y1]}function Xt(){return Gt().source(Ht).target(Qt)}var it=function(){var t=function(m,s,o,c){for(o=o||{},c=m.length;c--;o[m[c]]=s);return o},n=[1,9],i=[1,10],l=[1,5,10,12],u={trace:function(){},yy:{},symbols_:{error:2,start:3,SANKEY:4,NEWLINE:5,csv:6,opt_eof:7,record:8,csv_tail:9,EOF:10,"field[source]":11,COMMA:12,"field[target]":13,"field[value]":14,field:15,escaped:16,non_escaped:17,DQUOTE:18,ESCAPED_TEXT:19,NON_ESCAPED_TEXT:20,$accept:0,$end:1},terminals_:{2:"error",4:"SANKEY",5:"NEWLINE",10:"EOF",11:"field[source]",12:"COMMA",13:"field[target]",14:"field[value]",18:"DQUOTE",19:"ESCAPED_TEXT",20:"NON_ESCAPED_TEXT"},productions_:[0,[3,4],[6,2],[9,2],[9,0],[7,1],[7,0],[8,5],[15,1],[15,1],[16,3],[17,1]],performAction:function(s,o,c,p,b,y,x){var E=y.length-1;switch(b){case 7:const L=p.findOrCreateNode(y[E-4].trim().replaceAll('""','"')),A=p.findOrCreateNode(y[E-2].trim().replaceAll('""','"')),N=parseFloat(y[E].trim());p.addLink(L,A,N);break;case 8:case 9:case 11:this.$=y[E];break;case 10:this.$=y[E-1];break}},table:[{3:1,4:[1,2]},{1:[3]},{5:[1,3]},{6:4,8:5,15:6,16:7,17:8,18:n,20:i},{1:[2,6],7:11,10:[1,12]},t(i,[2,4],{9:13,5:[1,14]}),{12:[1,15]},t(l,[2,8]),t(l,[2,9]),{19:[1,16]},t(l,[2,11]),{1:[2,1]},{1:[2,5]},t(i,[2,2]),{6:17,8:5,15:6,16:7,17:8,18:n,20:i},{15:18,16:7,17:8,18:n,20:i},{18:[1,19]},t(i,[2,3]),{12:[1,20]},t(l,[2,10]),{15:21,16:7,17:8,18:n,20:i},t([1,5,10],[2,7])],defaultActions:{11:[2,1],12:[2,5]},parseError:function(s,o){if(o.recoverable)this.trace(s);else{var c=new Error(s);throw c.hash=o,c}},parse:function(s){var o=this,c=[0],p=[],b=[null],y=[],x=this.table,E="",L=0,A=0,N=2,P=1,z=y.slice.call(arguments,1),S=Object.create(this.lexer),M={yy:{}};for(var $ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,$)&&(M.yy[$]=this.yy[$]);S.setInput(s,M.yy),M.yy.lexer=S,M.yy.parser=this,typeof S.yylloc>"u"&&(S.yylloc={});var C=S.yylloc;y.push(C);var I=S.options&&S.options.ranges;typeof M.yy.parseError=="function"?this.parseError=M.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function d(){var v;return v=p.pop()||S.lex()||P,typeof v!="number"&&(v instanceof Array&&(p=v,v=p.pop()),v=o.symbols_[v]||v),v}for(var w,O,T,R,e={},f,a,h,r;;){if(O=c[c.length-1],this.defaultActions[O]?T=this.defaultActions[O]:((w===null||typeof w>"u")&&(w=d()),T=x[O]&&x[O][w]),typeof T>"u"||!T.length||!T[0]){var _="";r=[];for(f in x[O])this.terminals_[f]&&f>N&&r.push("'"+this.terminals_[f]+"'");S.showPosition?_="Parse error on line "+(L+1)+`:
2
- `+S.showPosition()+`
3
- Expecting `+r.join(", ")+", got '"+(this.terminals_[w]||w)+"'":_="Parse error on line "+(L+1)+": Unexpected "+(w==P?"end of input":"'"+(this.terminals_[w]||w)+"'"),this.parseError(_,{text:S.match,token:this.terminals_[w]||w,line:S.yylineno,loc:C,expected:r})}if(T[0]instanceof Array&&T.length>1)throw new Error("Parse Error: multiple actions possible at state: "+O+", token: "+w);switch(T[0]){case 1:c.push(w),b.push(S.yytext),y.push(S.yylloc),c.push(T[1]),w=null,A=S.yyleng,E=S.yytext,L=S.yylineno,C=S.yylloc;break;case 2:if(a=this.productions_[T[1]][1],e.$=b[b.length-a],e._$={first_line:y[y.length-(a||1)].first_line,last_line:y[y.length-1].last_line,first_column:y[y.length-(a||1)].first_column,last_column:y[y.length-1].last_column},I&&(e._$.range=[y[y.length-(a||1)].range[0],y[y.length-1].range[1]]),R=this.performAction.apply(e,[E,A,L,M.yy,T[1],b,y].concat(z)),typeof R<"u")return R;a&&(c=c.slice(0,-1*a*2),b=b.slice(0,-1*a),y=y.slice(0,-1*a)),c.push(this.productions_[T[1]][0]),b.push(e.$),y.push(e._$),h=x[c[c.length-2]][c[c.length-1]],c.push(h);break;case 3:return!0}}return!0}},k=function(){var m={EOF:1,parseError:function(o,c){if(this.yy.parser)this.yy.parser.parseError(o,c);else throw new Error(o)},setInput:function(s,o){return this.yy=o||this.yy||{},this._input=s,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var s=this._input[0];this.yytext+=s,this.yyleng++,this.offset++,this.match+=s,this.matched+=s;var o=s.match(/(?:\r\n?|\n).*/g);return o?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),s},unput:function(s){var o=s.length,c=s.split(/(?:\r\n?|\n)/g);this._input=s+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-o),this.offset-=o;var p=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),c.length-1&&(this.yylineno-=c.length-1);var b=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:c?(c.length===p.length?this.yylloc.first_column:0)+p[p.length-c.length].length-c[0].length:this.yylloc.first_column-o},this.options.ranges&&(this.yylloc.range=[b[0],b[0]+this.yyleng-o]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
4
- `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},less:function(s){this.unput(this.match.slice(s))},pastInput:function(){var s=this.matched.substr(0,this.matched.length-this.match.length);return(s.length>20?"...":"")+s.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var s=this.match;return s.length<20&&(s+=this._input.substr(0,20-s.length)),(s.substr(0,20)+(s.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var s=this.pastInput(),o=new Array(s.length+1).join("-");return s+this.upcomingInput()+`
5
- `+o+"^"},test_match:function(s,o){var c,p,b;if(this.options.backtrack_lexer&&(b={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(b.yylloc.range=this.yylloc.range.slice(0))),p=s[0].match(/(?:\r\n?|\n).*/g),p&&(this.yylineno+=p.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:p?p[p.length-1].length-p[p.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+s[0].length},this.yytext+=s[0],this.match+=s[0],this.matches=s,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(s[0].length),this.matched+=s[0],c=this.performAction.call(this,this.yy,this,o,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),c)return c;if(this._backtrack){for(var y in b)this[y]=b[y];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var s,o,c,p;this._more||(this.yytext="",this.match="");for(var b=this._currentRules(),y=0;y<b.length;y++)if(c=this._input.match(this.rules[b[y]]),c&&(!o||c[0].length>o[0].length)){if(o=c,p=y,this.options.backtrack_lexer){if(s=this.test_match(c,b[y]),s!==!1)return s;if(this._backtrack){o=!1;continue}else return!1}else if(!this.options.flex)break}return o?(s=this.test_match(o,b[p]),s!==!1?s:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
6
- `+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var o=this.next();return o||this.lex()},begin:function(o){this.conditionStack.push(o)},popState:function(){var o=this.conditionStack.length-1;return o>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(o){return o=this.conditionStack.length-1-Math.abs(o||0),o>=0?this.conditionStack[o]:"INITIAL"},pushState:function(o){this.begin(o)},stateStackSize:function(){return this.conditionStack.length},options:{easy_keword_rules:!0},performAction:function(o,c,p,b){switch(p){case 0:return this.pushState("csv"),4;case 1:return 10;case 2:return 5;case 3:return 12;case 4:return this.pushState("escaped_text"),18;case 5:return 20;case 6:return this.popState("escaped_text"),18;case 7:return 19}},rules:[/^(?:sankey-beta\b)/,/^(?:$)/,/^(?:((\u000D\u000A)|(\u000A)))/,/^(?:(\u002C))/,/^(?:(\u0022))/,/^(?:([\u0020-\u0021\u0023-\u002B\u002D-\u007E])*)/,/^(?:(\u0022)(?!(\u0022)))/,/^(?:(([\u0020-\u0021\u0023-\u002B\u002D-\u007E])|(\u002C)|(\u000D)|(\u000A)|(\u0022)(\u0022))*)/],conditions:{csv:{rules:[1,2,3,4,5,6,7],inclusive:!1},escaped_text:{rules:[6,7],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7],inclusive:!0}}};return m}();u.lexer=k;function g(){this.yy={}}return g.prototype=u,u.Parser=g,new g}();it.parser=it;const Q=it;let X=[],q=[],B={};const qt=()=>{X=[],q=[],B={},wt()};class Kt{constructor(n,i,l=0){this.source=n,this.target=i,this.value=l}}const Zt=(t,n,i)=>{X.push(new Kt(t,n,i))};class Jt{constructor(n){this.ID=n}}const te=t=>(t=St.sanitizeText(t,rt()),B[t]||(B[t]=new Jt(t),q.push(B[t])),B[t]),ee=()=>q,ne=()=>X,ie=()=>({nodes:q.map(t=>({id:t.ID})),links:X.map(t=>({source:t.source.ID,target:t.target.ID,value:t.value}))}),se={nodesMap:B,getConfig:()=>rt().sankey,getNodes:ee,getLinks:ne,getGraph:ie,addLink:Zt,findOrCreateNode:te,getAccTitle:mt,setAccTitle:_t,getAccDescription:kt,setAccDescription:xt,getDiagramTitle:vt,setDiagramTitle:bt,clear:qt},pt=class st{static next(n){return new st(n+ ++st.count)}constructor(n){this.id=n,this.href=`#${n}`}toString(){return"url("+this.href+")"}};pt.count=0;let ft=pt;const re={left:Pt,right:Ct,center:It,justify:dt},oe=function(t,n,i,l){const{securityLevel:u,sankey:k}=rt(),g=Lt.sankey;let m;u==="sandbox"&&(m=Y("#i"+n));const s=u==="sandbox"?Y(m.nodes()[0].contentDocument.body):Y("body"),o=u==="sandbox"?s.select(`[id="${n}"]`):Y(`[id="${n}"]`),c=(k==null?void 0:k.width)??g.width,p=(k==null?void 0:k.height)??g.width,b=(k==null?void 0:k.useMaxWidth)??g.useMaxWidth,y=(k==null?void 0:k.nodeAlignment)??g.nodeAlignment,x=(k==null?void 0:k.prefix)??g.prefix,E=(k==null?void 0:k.suffix)??g.suffix,L=(k==null?void 0:k.showValues)??g.showValues;Et(o,p,c,b);const A=l.db.getGraph(),N=re[y],P=10;jt().nodeId(d=>d.id).nodeWidth(P).nodePadding(10+(L?15:0)).nodeAlign(N).extent([[0,0],[c,p]])(A);const S=At(Mt);o.append("g").attr("class","nodes").selectAll(".node").data(A.nodes).join("g").attr("class","node").attr("id",d=>(d.uid=ft.next("node-")).id).attr("transform",function(d){return"translate("+d.x0+","+d.y0+")"}).attr("x",d=>d.x0).attr("y",d=>d.y0).append("rect").attr("height",d=>d.y1-d.y0).attr("width",d=>d.x1-d.x0).attr("fill",d=>S(d.id));const M=({id:d,value:w})=>L?`${d}
7
- ${x}${Math.round(w*100)/100}${E}`:d;o.append("g").attr("class","node-labels").attr("font-family","sans-serif").attr("font-size",14).selectAll("text").data(A.nodes).join("text").attr("x",d=>d.x0<c/2?d.x1+6:d.x0-6).attr("y",d=>(d.y1+d.y0)/2).attr("dy",`${L?"0":"0.35"}em`).attr("text-anchor",d=>d.x0<c/2?"start":"end").text(M);const $=o.append("g").attr("class","links").attr("fill","none").attr("stroke-opacity",.5).selectAll(".link").data(A.links).join("g").attr("class","link").style("mix-blend-mode","multiply"),C=(k==null?void 0:k.linkColor)||"gradient";if(C==="gradient"){const d=$.append("linearGradient").attr("id",w=>(w.uid=ft.next("linearGradient-")).id).attr("gradientUnits","userSpaceOnUse").attr("x1",w=>w.source.x1).attr("x2",w=>w.target.x0);d.append("stop").attr("offset","0%").attr("stop-color",w=>S(w.source.id)),d.append("stop").attr("offset","100%").attr("stop-color",w=>S(w.target.id))}let I;switch(C){case"gradient":I=d=>d.uid;break;case"source":I=d=>S(d.source.id);break;case"target":I=d=>S(d.target.id);break;default:I=C}$.append("path").attr("d",Xt()).attr("stroke",I).attr("stroke-width",d=>Math.max(1,d.width))},le={draw:oe},ae=t=>t.replaceAll(/^[^\S\n\r]+|[^\S\n\r]+$/g,"").replaceAll(/([\n\r])+/g,`
8
- `).trim(),ce=Q.parse.bind(Q);Q.parse=t=>ce(ae(t));const ye={parser:Q,db:se,renderer:le};export{ye as diagram};
@@ -1,122 +0,0 @@
1
- import{g as ke,D as Le,B as Ie,c as dt,s as ae,b as Ae,a as Ne,E as Se,l as U,d as Mt,j as w,e as Me,h as St,i as Re,z as O,m as re,Y as oe,a5 as De,a6 as Ve}from"./index-e793d777.js";import{d as Ce,a as Oe,g as Rt,b as Be,c as Ye,e as Gt}from"./svgDrawCommon-4835440b-151251e9.js";var qt=function(){var t=function(ht,m,_,k){for(_=_||{},k=ht.length;k--;_[ht[k]]=m);return _},e=[1,2],o=[1,3],i=[1,4],s=[2,4],n=[1,9],c=[1,11],h=[1,13],p=[1,14],a=[1,16],x=[1,17],E=[1,18],u=[1,24],g=[1,25],b=[1,26],P=[1,27],I=[1,28],R=[1,29],N=[1,30],F=[1,31],S=[1,32],tt=[1,33],W=[1,34],K=[1,35],Z=[1,36],q=[1,37],Y=[1,38],C=[1,39],G=[1,41],z=[1,42],X=[1,43],Q=[1,44],j=[1,45],y=[1,46],v=[1,4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,47,48,49,50,52,53,54,59,60,61,62,70],L=[4,5,16,50,52,53],pt=[4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,50,52,53,54,59,60,61,62,70],et=[4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,49,50,52,53,54,59,60,61,62,70],A=[4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,48,50,52,53,54,59,60,61,62,70],$t=[4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,47,50,52,53,54,59,60,61,62,70],lt=[68,69,70],nt=[1,120],Ct={trace:function(){},yy:{},symbols_:{error:2,start:3,SPACE:4,NEWLINE:5,SD:6,document:7,line:8,statement:9,box_section:10,box_line:11,participant_statement:12,create:13,box:14,restOfLine:15,end:16,signal:17,autonumber:18,NUM:19,off:20,activate:21,actor:22,deactivate:23,note_statement:24,links_statement:25,link_statement:26,properties_statement:27,details_statement:28,title:29,legacy_title:30,acc_title:31,acc_title_value:32,acc_descr:33,acc_descr_value:34,acc_descr_multiline_value:35,loop:36,rect:37,opt:38,alt:39,else_sections:40,par:41,par_sections:42,par_over:43,critical:44,option_sections:45,break:46,option:47,and:48,else:49,participant:50,AS:51,participant_actor:52,destroy:53,note:54,placement:55,text2:56,over:57,actor_pair:58,links:59,link:60,properties:61,details:62,spaceList:63,",":64,left_of:65,right_of:66,signaltype:67,"+":68,"-":69,ACTOR:70,SOLID_OPEN_ARROW:71,DOTTED_OPEN_ARROW:72,SOLID_ARROW:73,DOTTED_ARROW:74,SOLID_CROSS:75,DOTTED_CROSS:76,SOLID_POINT:77,DOTTED_POINT:78,TXT:79,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NEWLINE",6:"SD",13:"create",14:"box",15:"restOfLine",16:"end",18:"autonumber",19:"NUM",20:"off",21:"activate",23:"deactivate",29:"title",30:"legacy_title",31:"acc_title",32:"acc_title_value",33:"acc_descr",34:"acc_descr_value",35:"acc_descr_multiline_value",36:"loop",37:"rect",38:"opt",39:"alt",41:"par",43:"par_over",44:"critical",46:"break",47:"option",48:"and",49:"else",50:"participant",51:"AS",52:"participant_actor",53:"destroy",54:"note",57:"over",59:"links",60:"link",61:"properties",62:"details",64:",",65:"left_of",66:"right_of",68:"+",69:"-",70:"ACTOR",71:"SOLID_OPEN_ARROW",72:"DOTTED_OPEN_ARROW",73:"SOLID_ARROW",74:"DOTTED_ARROW",75:"SOLID_CROSS",76:"DOTTED_CROSS",77:"SOLID_POINT",78:"DOTTED_POINT",79:"TXT"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[10,0],[10,2],[11,2],[11,1],[11,1],[9,1],[9,2],[9,4],[9,2],[9,4],[9,3],[9,3],[9,2],[9,3],[9,3],[9,2],[9,2],[9,2],[9,2],[9,2],[9,1],[9,1],[9,2],[9,2],[9,1],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[45,1],[45,4],[42,1],[42,4],[40,1],[40,4],[12,5],[12,3],[12,5],[12,3],[12,3],[24,4],[24,4],[25,3],[26,3],[27,3],[28,3],[63,2],[63,1],[58,3],[58,1],[55,1],[55,1],[17,5],[17,5],[17,4],[22,1],[67,1],[67,1],[67,1],[67,1],[67,1],[67,1],[67,1],[67,1],[56,1]],performAction:function(m,_,k,T,M,l,vt){var d=l.length-1;switch(M){case 3:return T.apply(l[d]),l[d];case 4:case 9:this.$=[];break;case 5:case 10:l[d-1].push(l[d]),this.$=l[d-1];break;case 6:case 7:case 11:case 12:this.$=l[d];break;case 8:case 13:this.$=[];break;case 15:l[d].type="createParticipant",this.$=l[d];break;case 16:l[d-1].unshift({type:"boxStart",boxData:T.parseBoxData(l[d-2])}),l[d-1].push({type:"boxEnd",boxText:l[d-2]}),this.$=l[d-1];break;case 18:this.$={type:"sequenceIndex",sequenceIndex:Number(l[d-2]),sequenceIndexStep:Number(l[d-1]),sequenceVisible:!0,signalType:T.LINETYPE.AUTONUMBER};break;case 19:this.$={type:"sequenceIndex",sequenceIndex:Number(l[d-1]),sequenceIndexStep:1,sequenceVisible:!0,signalType:T.LINETYPE.AUTONUMBER};break;case 20:this.$={type:"sequenceIndex",sequenceVisible:!1,signalType:T.LINETYPE.AUTONUMBER};break;case 21:this.$={type:"sequenceIndex",sequenceVisible:!0,signalType:T.LINETYPE.AUTONUMBER};break;case 22:this.$={type:"activeStart",signalType:T.LINETYPE.ACTIVE_START,actor:l[d-1]};break;case 23:this.$={type:"activeEnd",signalType:T.LINETYPE.ACTIVE_END,actor:l[d-1]};break;case 29:T.setDiagramTitle(l[d].substring(6)),this.$=l[d].substring(6);break;case 30:T.setDiagramTitle(l[d].substring(7)),this.$=l[d].substring(7);break;case 31:this.$=l[d].trim(),T.setAccTitle(this.$);break;case 32:case 33:this.$=l[d].trim(),T.setAccDescription(this.$);break;case 34:l[d-1].unshift({type:"loopStart",loopText:T.parseMessage(l[d-2]),signalType:T.LINETYPE.LOOP_START}),l[d-1].push({type:"loopEnd",loopText:l[d-2],signalType:T.LINETYPE.LOOP_END}),this.$=l[d-1];break;case 35:l[d-1].unshift({type:"rectStart",color:T.parseMessage(l[d-2]),signalType:T.LINETYPE.RECT_START}),l[d-1].push({type:"rectEnd",color:T.parseMessage(l[d-2]),signalType:T.LINETYPE.RECT_END}),this.$=l[d-1];break;case 36:l[d-1].unshift({type:"optStart",optText:T.parseMessage(l[d-2]),signalType:T.LINETYPE.OPT_START}),l[d-1].push({type:"optEnd",optText:T.parseMessage(l[d-2]),signalType:T.LINETYPE.OPT_END}),this.$=l[d-1];break;case 37:l[d-1].unshift({type:"altStart",altText:T.parseMessage(l[d-2]),signalType:T.LINETYPE.ALT_START}),l[d-1].push({type:"altEnd",signalType:T.LINETYPE.ALT_END}),this.$=l[d-1];break;case 38:l[d-1].unshift({type:"parStart",parText:T.parseMessage(l[d-2]),signalType:T.LINETYPE.PAR_START}),l[d-1].push({type:"parEnd",signalType:T.LINETYPE.PAR_END}),this.$=l[d-1];break;case 39:l[d-1].unshift({type:"parStart",parText:T.parseMessage(l[d-2]),signalType:T.LINETYPE.PAR_OVER_START}),l[d-1].push({type:"parEnd",signalType:T.LINETYPE.PAR_END}),this.$=l[d-1];break;case 40:l[d-1].unshift({type:"criticalStart",criticalText:T.parseMessage(l[d-2]),signalType:T.LINETYPE.CRITICAL_START}),l[d-1].push({type:"criticalEnd",signalType:T.LINETYPE.CRITICAL_END}),this.$=l[d-1];break;case 41:l[d-1].unshift({type:"breakStart",breakText:T.parseMessage(l[d-2]),signalType:T.LINETYPE.BREAK_START}),l[d-1].push({type:"breakEnd",optText:T.parseMessage(l[d-2]),signalType:T.LINETYPE.BREAK_END}),this.$=l[d-1];break;case 43:this.$=l[d-3].concat([{type:"option",optionText:T.parseMessage(l[d-1]),signalType:T.LINETYPE.CRITICAL_OPTION},l[d]]);break;case 45:this.$=l[d-3].concat([{type:"and",parText:T.parseMessage(l[d-1]),signalType:T.LINETYPE.PAR_AND},l[d]]);break;case 47:this.$=l[d-3].concat([{type:"else",altText:T.parseMessage(l[d-1]),signalType:T.LINETYPE.ALT_ELSE},l[d]]);break;case 48:l[d-3].draw="participant",l[d-3].type="addParticipant",l[d-3].description=T.parseMessage(l[d-1]),this.$=l[d-3];break;case 49:l[d-1].draw="participant",l[d-1].type="addParticipant",this.$=l[d-1];break;case 50:l[d-3].draw="actor",l[d-3].type="addParticipant",l[d-3].description=T.parseMessage(l[d-1]),this.$=l[d-3];break;case 51:l[d-1].draw="actor",l[d-1].type="addParticipant",this.$=l[d-1];break;case 52:l[d-1].type="destroyParticipant",this.$=l[d-1];break;case 53:this.$=[l[d-1],{type:"addNote",placement:l[d-2],actor:l[d-1].actor,text:l[d]}];break;case 54:l[d-2]=[].concat(l[d-1],l[d-1]).slice(0,2),l[d-2][0]=l[d-2][0].actor,l[d-2][1]=l[d-2][1].actor,this.$=[l[d-1],{type:"addNote",placement:T.PLACEMENT.OVER,actor:l[d-2].slice(0,2),text:l[d]}];break;case 55:this.$=[l[d-1],{type:"addLinks",actor:l[d-1].actor,text:l[d]}];break;case 56:this.$=[l[d-1],{type:"addALink",actor:l[d-1].actor,text:l[d]}];break;case 57:this.$=[l[d-1],{type:"addProperties",actor:l[d-1].actor,text:l[d]}];break;case 58:this.$=[l[d-1],{type:"addDetails",actor:l[d-1].actor,text:l[d]}];break;case 61:this.$=[l[d-2],l[d]];break;case 62:this.$=l[d];break;case 63:this.$=T.PLACEMENT.LEFTOF;break;case 64:this.$=T.PLACEMENT.RIGHTOF;break;case 65:this.$=[l[d-4],l[d-1],{type:"addMessage",from:l[d-4].actor,to:l[d-1].actor,signalType:l[d-3],msg:l[d],activate:!0},{type:"activeStart",signalType:T.LINETYPE.ACTIVE_START,actor:l[d-1]}];break;case 66:this.$=[l[d-4],l[d-1],{type:"addMessage",from:l[d-4].actor,to:l[d-1].actor,signalType:l[d-3],msg:l[d]},{type:"activeEnd",signalType:T.LINETYPE.ACTIVE_END,actor:l[d-4]}];break;case 67:this.$=[l[d-3],l[d-1],{type:"addMessage",from:l[d-3].actor,to:l[d-1].actor,signalType:l[d-2],msg:l[d]}];break;case 68:this.$={type:"addParticipant",actor:l[d]};break;case 69:this.$=T.LINETYPE.SOLID_OPEN;break;case 70:this.$=T.LINETYPE.DOTTED_OPEN;break;case 71:this.$=T.LINETYPE.SOLID;break;case 72:this.$=T.LINETYPE.DOTTED;break;case 73:this.$=T.LINETYPE.SOLID_CROSS;break;case 74:this.$=T.LINETYPE.DOTTED_CROSS;break;case 75:this.$=T.LINETYPE.SOLID_POINT;break;case 76:this.$=T.LINETYPE.DOTTED_POINT;break;case 77:this.$=T.parseMessage(l[d].trim().substring(1));break}},table:[{3:1,4:e,5:o,6:i},{1:[3]},{3:5,4:e,5:o,6:i},{3:6,4:e,5:o,6:i},t([1,4,5,13,14,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,50,52,53,54,59,60,61,62,70],s,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:n,5:c,8:8,9:10,12:12,13:h,14:p,17:15,18:a,21:x,22:40,23:E,24:19,25:20,26:21,27:22,28:23,29:u,30:g,31:b,33:P,35:I,36:R,37:N,38:F,39:S,41:tt,43:W,44:K,46:Z,50:q,52:Y,53:C,54:G,59:z,60:X,61:Q,62:j,70:y},t(v,[2,5]),{9:47,12:12,13:h,14:p,17:15,18:a,21:x,22:40,23:E,24:19,25:20,26:21,27:22,28:23,29:u,30:g,31:b,33:P,35:I,36:R,37:N,38:F,39:S,41:tt,43:W,44:K,46:Z,50:q,52:Y,53:C,54:G,59:z,60:X,61:Q,62:j,70:y},t(v,[2,7]),t(v,[2,8]),t(v,[2,14]),{12:48,50:q,52:Y,53:C},{15:[1,49]},{5:[1,50]},{5:[1,53],19:[1,51],20:[1,52]},{22:54,70:y},{22:55,70:y},{5:[1,56]},{5:[1,57]},{5:[1,58]},{5:[1,59]},{5:[1,60]},t(v,[2,29]),t(v,[2,30]),{32:[1,61]},{34:[1,62]},t(v,[2,33]),{15:[1,63]},{15:[1,64]},{15:[1,65]},{15:[1,66]},{15:[1,67]},{15:[1,68]},{15:[1,69]},{15:[1,70]},{22:71,70:y},{22:72,70:y},{22:73,70:y},{67:74,71:[1,75],72:[1,76],73:[1,77],74:[1,78],75:[1,79],76:[1,80],77:[1,81],78:[1,82]},{55:83,57:[1,84],65:[1,85],66:[1,86]},{22:87,70:y},{22:88,70:y},{22:89,70:y},{22:90,70:y},t([5,51,64,71,72,73,74,75,76,77,78,79],[2,68]),t(v,[2,6]),t(v,[2,15]),t(L,[2,9],{10:91}),t(v,[2,17]),{5:[1,93],19:[1,92]},{5:[1,94]},t(v,[2,21]),{5:[1,95]},{5:[1,96]},t(v,[2,24]),t(v,[2,25]),t(v,[2,26]),t(v,[2,27]),t(v,[2,28]),t(v,[2,31]),t(v,[2,32]),t(pt,s,{7:97}),t(pt,s,{7:98}),t(pt,s,{7:99}),t(et,s,{40:100,7:101}),t(A,s,{42:102,7:103}),t(A,s,{7:103,42:104}),t($t,s,{45:105,7:106}),t(pt,s,{7:107}),{5:[1,109],51:[1,108]},{5:[1,111],51:[1,110]},{5:[1,112]},{22:115,68:[1,113],69:[1,114],70:y},t(lt,[2,69]),t(lt,[2,70]),t(lt,[2,71]),t(lt,[2,72]),t(lt,[2,73]),t(lt,[2,74]),t(lt,[2,75]),t(lt,[2,76]),{22:116,70:y},{22:118,58:117,70:y},{70:[2,63]},{70:[2,64]},{56:119,79:nt},{56:121,79:nt},{56:122,79:nt},{56:123,79:nt},{4:[1,126],5:[1,128],11:125,12:127,16:[1,124],50:q,52:Y,53:C},{5:[1,129]},t(v,[2,19]),t(v,[2,20]),t(v,[2,22]),t(v,[2,23]),{4:n,5:c,8:8,9:10,12:12,13:h,14:p,16:[1,130],17:15,18:a,21:x,22:40,23:E,24:19,25:20,26:21,27:22,28:23,29:u,30:g,31:b,33:P,35:I,36:R,37:N,38:F,39:S,41:tt,43:W,44:K,46:Z,50:q,52:Y,53:C,54:G,59:z,60:X,61:Q,62:j,70:y},{4:n,5:c,8:8,9:10,12:12,13:h,14:p,16:[1,131],17:15,18:a,21:x,22:40,23:E,24:19,25:20,26:21,27:22,28:23,29:u,30:g,31:b,33:P,35:I,36:R,37:N,38:F,39:S,41:tt,43:W,44:K,46:Z,50:q,52:Y,53:C,54:G,59:z,60:X,61:Q,62:j,70:y},{4:n,5:c,8:8,9:10,12:12,13:h,14:p,16:[1,132],17:15,18:a,21:x,22:40,23:E,24:19,25:20,26:21,27:22,28:23,29:u,30:g,31:b,33:P,35:I,36:R,37:N,38:F,39:S,41:tt,43:W,44:K,46:Z,50:q,52:Y,53:C,54:G,59:z,60:X,61:Q,62:j,70:y},{16:[1,133]},{4:n,5:c,8:8,9:10,12:12,13:h,14:p,16:[2,46],17:15,18:a,21:x,22:40,23:E,24:19,25:20,26:21,27:22,28:23,29:u,30:g,31:b,33:P,35:I,36:R,37:N,38:F,39:S,41:tt,43:W,44:K,46:Z,49:[1,134],50:q,52:Y,53:C,54:G,59:z,60:X,61:Q,62:j,70:y},{16:[1,135]},{4:n,5:c,8:8,9:10,12:12,13:h,14:p,16:[2,44],17:15,18:a,21:x,22:40,23:E,24:19,25:20,26:21,27:22,28:23,29:u,30:g,31:b,33:P,35:I,36:R,37:N,38:F,39:S,41:tt,43:W,44:K,46:Z,48:[1,136],50:q,52:Y,53:C,54:G,59:z,60:X,61:Q,62:j,70:y},{16:[1,137]},{16:[1,138]},{4:n,5:c,8:8,9:10,12:12,13:h,14:p,16:[2,42],17:15,18:a,21:x,22:40,23:E,24:19,25:20,26:21,27:22,28:23,29:u,30:g,31:b,33:P,35:I,36:R,37:N,38:F,39:S,41:tt,43:W,44:K,46:Z,47:[1,139],50:q,52:Y,53:C,54:G,59:z,60:X,61:Q,62:j,70:y},{4:n,5:c,8:8,9:10,12:12,13:h,14:p,16:[1,140],17:15,18:a,21:x,22:40,23:E,24:19,25:20,26:21,27:22,28:23,29:u,30:g,31:b,33:P,35:I,36:R,37:N,38:F,39:S,41:tt,43:W,44:K,46:Z,50:q,52:Y,53:C,54:G,59:z,60:X,61:Q,62:j,70:y},{15:[1,141]},t(v,[2,49]),{15:[1,142]},t(v,[2,51]),t(v,[2,52]),{22:143,70:y},{22:144,70:y},{56:145,79:nt},{56:146,79:nt},{56:147,79:nt},{64:[1,148],79:[2,62]},{5:[2,55]},{5:[2,77]},{5:[2,56]},{5:[2,57]},{5:[2,58]},t(v,[2,16]),t(L,[2,10]),{12:149,50:q,52:Y,53:C},t(L,[2,12]),t(L,[2,13]),t(v,[2,18]),t(v,[2,34]),t(v,[2,35]),t(v,[2,36]),t(v,[2,37]),{15:[1,150]},t(v,[2,38]),{15:[1,151]},t(v,[2,39]),t(v,[2,40]),{15:[1,152]},t(v,[2,41]),{5:[1,153]},{5:[1,154]},{56:155,79:nt},{56:156,79:nt},{5:[2,67]},{5:[2,53]},{5:[2,54]},{22:157,70:y},t(L,[2,11]),t(et,s,{7:101,40:158}),t(A,s,{7:103,42:159}),t($t,s,{7:106,45:160}),t(v,[2,48]),t(v,[2,50]),{5:[2,65]},{5:[2,66]},{79:[2,61]},{16:[2,47]},{16:[2,45]},{16:[2,43]}],defaultActions:{5:[2,1],6:[2,2],85:[2,63],86:[2,64],119:[2,55],120:[2,77],121:[2,56],122:[2,57],123:[2,58],145:[2,67],146:[2,53],147:[2,54],155:[2,65],156:[2,66],157:[2,61],158:[2,47],159:[2,45],160:[2,43]},parseError:function(m,_){if(_.recoverable)this.trace(m);else{var k=new Error(m);throw k.hash=_,k}},parse:function(m){var _=this,k=[0],T=[],M=[null],l=[],vt=this.table,d="",It=0,te=0,we=2,ee=1,ve=l.slice.call(arguments,1),B=Object.create(this.lexer),ut={yy:{}};for(var Bt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Bt)&&(ut.yy[Bt]=this.yy[Bt]);B.setInput(m,ut.yy),ut.yy.lexer=B,ut.yy.parser=this,typeof B.yylloc>"u"&&(B.yylloc={});var Yt=B.yylloc;l.push(Yt);var _e=B.options&&B.options.ranges;typeof ut.yy.parseError=="function"?this.parseError=ut.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Pe(){var rt;return rt=T.pop()||B.lex()||ee,typeof rt!="number"&&(rt instanceof Array&&(T=rt,rt=T.pop()),rt=_.symbols_[rt]||rt),rt}for(var H,ft,$,Ft,yt={},At,at,ie,Nt;;){if(ft=k[k.length-1],this.defaultActions[ft]?$=this.defaultActions[ft]:((H===null||typeof H>"u")&&(H=Pe()),$=vt[ft]&&vt[ft][H]),typeof $>"u"||!$.length||!$[0]){var Wt="";Nt=[];for(At in vt[ft])this.terminals_[At]&&At>we&&Nt.push("'"+this.terminals_[At]+"'");B.showPosition?Wt="Parse error on line "+(It+1)+`:
2
- `+B.showPosition()+`
3
- Expecting `+Nt.join(", ")+", got '"+(this.terminals_[H]||H)+"'":Wt="Parse error on line "+(It+1)+": Unexpected "+(H==ee?"end of input":"'"+(this.terminals_[H]||H)+"'"),this.parseError(Wt,{text:B.match,token:this.terminals_[H]||H,line:B.yylineno,loc:Yt,expected:Nt})}if($[0]instanceof Array&&$.length>1)throw new Error("Parse Error: multiple actions possible at state: "+ft+", token: "+H);switch($[0]){case 1:k.push(H),M.push(B.yytext),l.push(B.yylloc),k.push($[1]),H=null,te=B.yyleng,d=B.yytext,It=B.yylineno,Yt=B.yylloc;break;case 2:if(at=this.productions_[$[1]][1],yt.$=M[M.length-at],yt._$={first_line:l[l.length-(at||1)].first_line,last_line:l[l.length-1].last_line,first_column:l[l.length-(at||1)].first_column,last_column:l[l.length-1].last_column},_e&&(yt._$.range=[l[l.length-(at||1)].range[0],l[l.length-1].range[1]]),Ft=this.performAction.apply(yt,[d,te,It,ut.yy,$[1],M,l].concat(ve)),typeof Ft<"u")return Ft;at&&(k=k.slice(0,-1*at*2),M=M.slice(0,-1*at),l=l.slice(0,-1*at)),k.push(this.productions_[$[1]][0]),M.push(yt.$),l.push(yt._$),ie=vt[k[k.length-2]][k[k.length-1]],k.push(ie);break;case 3:return!0}}return!0}},me=function(){var ht={EOF:1,parseError:function(_,k){if(this.yy.parser)this.yy.parser.parseError(_,k);else throw new Error(_)},setInput:function(m,_){return this.yy=_||this.yy||{},this._input=m,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var m=this._input[0];this.yytext+=m,this.yyleng++,this.offset++,this.match+=m,this.matched+=m;var _=m.match(/(?:\r\n?|\n).*/g);return _?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),m},unput:function(m){var _=m.length,k=m.split(/(?:\r\n?|\n)/g);this._input=m+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-_),this.offset-=_;var T=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),k.length-1&&(this.yylineno-=k.length-1);var M=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:k?(k.length===T.length?this.yylloc.first_column:0)+T[T.length-k.length].length-k[0].length:this.yylloc.first_column-_},this.options.ranges&&(this.yylloc.range=[M[0],M[0]+this.yyleng-_]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
4
- `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},less:function(m){this.unput(this.match.slice(m))},pastInput:function(){var m=this.matched.substr(0,this.matched.length-this.match.length);return(m.length>20?"...":"")+m.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var m=this.match;return m.length<20&&(m+=this._input.substr(0,20-m.length)),(m.substr(0,20)+(m.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var m=this.pastInput(),_=new Array(m.length+1).join("-");return m+this.upcomingInput()+`
5
- `+_+"^"},test_match:function(m,_){var k,T,M;if(this.options.backtrack_lexer&&(M={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(M.yylloc.range=this.yylloc.range.slice(0))),T=m[0].match(/(?:\r\n?|\n).*/g),T&&(this.yylineno+=T.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:T?T[T.length-1].length-T[T.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+m[0].length},this.yytext+=m[0],this.match+=m[0],this.matches=m,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(m[0].length),this.matched+=m[0],k=this.performAction.call(this,this.yy,this,_,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),k)return k;if(this._backtrack){for(var l in M)this[l]=M[l];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var m,_,k,T;this._more||(this.yytext="",this.match="");for(var M=this._currentRules(),l=0;l<M.length;l++)if(k=this._input.match(this.rules[M[l]]),k&&(!_||k[0].length>_[0].length)){if(_=k,T=l,this.options.backtrack_lexer){if(m=this.test_match(k,M[l]),m!==!1)return m;if(this._backtrack){_=!1;continue}else return!1}else if(!this.options.flex)break}return _?(m=this.test_match(_,M[T]),m!==!1?m:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
6
- `+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var _=this.next();return _||this.lex()},begin:function(_){this.conditionStack.push(_)},popState:function(){var _=this.conditionStack.length-1;return _>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(_){return _=this.conditionStack.length-1-Math.abs(_||0),_>=0?this.conditionStack[_]:"INITIAL"},pushState:function(_){this.begin(_)},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(_,k,T,M){switch(T){case 0:return 5;case 1:break;case 2:break;case 3:break;case 4:break;case 5:break;case 6:return 19;case 7:return this.begin("LINE"),14;case 8:return this.begin("ID"),50;case 9:return this.begin("ID"),52;case 10:return 13;case 11:return this.begin("ID"),53;case 12:return k.yytext=k.yytext.trim(),this.begin("ALIAS"),70;case 13:return this.popState(),this.popState(),this.begin("LINE"),51;case 14:return this.popState(),this.popState(),5;case 15:return this.begin("LINE"),36;case 16:return this.begin("LINE"),37;case 17:return this.begin("LINE"),38;case 18:return this.begin("LINE"),39;case 19:return this.begin("LINE"),49;case 20:return this.begin("LINE"),41;case 21:return this.begin("LINE"),43;case 22:return this.begin("LINE"),48;case 23:return this.begin("LINE"),44;case 24:return this.begin("LINE"),47;case 25:return this.begin("LINE"),46;case 26:return this.popState(),15;case 27:return 16;case 28:return 65;case 29:return 66;case 30:return 59;case 31:return 60;case 32:return 61;case 33:return 62;case 34:return 57;case 35:return 54;case 36:return this.begin("ID"),21;case 37:return this.begin("ID"),23;case 38:return 29;case 39:return 30;case 40:return this.begin("acc_title"),31;case 41:return this.popState(),"acc_title_value";case 42:return this.begin("acc_descr"),33;case 43:return this.popState(),"acc_descr_value";case 44:this.begin("acc_descr_multiline");break;case 45:this.popState();break;case 46:return"acc_descr_multiline_value";case 47:return 6;case 48:return 18;case 49:return 20;case 50:return 64;case 51:return 5;case 52:return k.yytext=k.yytext.trim(),70;case 53:return 73;case 54:return 74;case 55:return 71;case 56:return 72;case 57:return 75;case 58:return 76;case 59:return 77;case 60:return 78;case 61:return 79;case 62:return 68;case 63:return 69;case 64:return 5;case 65:return"INVALID"}},rules:[/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[0-9]+(?=[ \n]+))/i,/^(?:box\b)/i,/^(?:participant\b)/i,/^(?:actor\b)/i,/^(?:create\b)/i,/^(?:destroy\b)/i,/^(?:[^\->:\n,;]+?([\-]*[^\->:\n,;]+?)*?(?=((?!\n)\s)+as(?!\n)\s|[#\n;]|$))/i,/^(?:as\b)/i,/^(?:(?:))/i,/^(?:loop\b)/i,/^(?:rect\b)/i,/^(?:opt\b)/i,/^(?:alt\b)/i,/^(?:else\b)/i,/^(?:par\b)/i,/^(?:par_over\b)/i,/^(?:and\b)/i,/^(?:critical\b)/i,/^(?:option\b)/i,/^(?:break\b)/i,/^(?:(?:[:]?(?:no)?wrap)?[^#\n;]*)/i,/^(?:end\b)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:links\b)/i,/^(?:link\b)/i,/^(?:properties\b)/i,/^(?:details\b)/i,/^(?:over\b)/i,/^(?:note\b)/i,/^(?:activate\b)/i,/^(?:deactivate\b)/i,/^(?:title\s[^#\n;]+)/i,/^(?:title:\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:sequenceDiagram\b)/i,/^(?:autonumber\b)/i,/^(?:off\b)/i,/^(?:,)/i,/^(?:;)/i,/^(?:[^\+\->:\n,;]+((?!(-x|--x|-\)|--\)))[\-]*[^\+\->:\n,;]+)*)/i,/^(?:->>)/i,/^(?:-->>)/i,/^(?:->)/i,/^(?:-->)/i,/^(?:-[x])/i,/^(?:--[x])/i,/^(?:-[\)])/i,/^(?:--[\)])/i,/^(?::(?:(?:no)?wrap)?[^#\n;]+)/i,/^(?:\+)/i,/^(?:-)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[45,46],inclusive:!1},acc_descr:{rules:[43],inclusive:!1},acc_title:{rules:[41],inclusive:!1},ID:{rules:[2,3,12],inclusive:!1},ALIAS:{rules:[2,3,13,14],inclusive:!1},LINE:{rules:[2,3,26],inclusive:!1},INITIAL:{rules:[0,1,3,4,5,6,7,8,9,10,11,15,16,17,18,19,20,21,22,23,24,25,27,28,29,30,31,32,33,34,35,36,37,38,39,40,42,44,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65],inclusive:!0}}};return ht}();Ct.lexer=me;function Ot(){this.yy={}}return Ot.prototype=Ct,Ct.Parser=Ot,new Ot}();qt.parser=qt;const Fe=qt;let _t,ct={},Xt={},Jt={},mt=[],J=[],Dt=!1,zt,ot,Pt,Et;const We=function(t){mt.push({name:t.text,wrap:t.wrap===void 0&&xt()||!!t.wrap,fill:t.color,actorKeys:[]}),ot=mt.slice(-1)[0]},Ht=function(t,e,o,i){let s=ot;const n=ct[t];if(n){if(ot&&n.box&&ot!==n.box)throw new Error("A same participant should only be defined in one Box: "+n.name+" can't be in '"+n.box.name+"' and in '"+ot.name+"' at the same time.");if(s=n.box?n.box:ot,n.box=s,n&&e===n.name&&o==null)return}(o==null||o.text==null)&&(o={text:e,wrap:null,type:i}),(i==null||o.text==null)&&(o={text:e,wrap:null,type:i}),ct[t]={box:s,name:e,description:o.text,wrap:o.wrap===void 0&&xt()||!!o.wrap,prevActor:_t,links:{},properties:{},actorCnt:null,rectData:null,type:i||"participant"},_t&&ct[_t]&&(ct[_t].nextActor=t),ot&&ot.actorKeys.push(t),_t=t},qe=t=>{let e,o=0;for(e=0;e<J.length;e++)J[e].type===kt.ACTIVE_START&&J[e].from.actor===t&&o++,J[e].type===kt.ACTIVE_END&&J[e].from.actor===t&&o--;return o},ze=function(t,e,o,i){J.push({from:t,to:e,message:o.text,wrap:o.wrap===void 0&&xt()||!!o.wrap,answer:i})},D=function(t,e,o={text:void 0,wrap:void 0},i,s=!1){if(i===kt.ACTIVE_END&&qe(t.actor)<1){let c=new Error("Trying to inactivate an inactive participant ("+t.actor+")");throw c.hash={text:"->>-",token:"->>-",line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:["'ACTIVE_PARTICIPANT'"]},c}return J.push({from:t,to:e,message:o.text,wrap:o.wrap===void 0&&xt()||!!o.wrap,type:i,activate:s}),!0},He=function(){return mt.length>0},Ue=function(){return mt.some(t=>t.name)},Ke=function(){return J},Ge=function(){return mt},Xe=function(){return ct},Je=function(){return Xt},Ze=function(){return Jt},Lt=function(t){return ct[t]},Qe=function(){return Object.keys(ct)},je=function(){Dt=!0},$e=function(){Dt=!1},t0=()=>Dt,e0=function(t){zt=t},xt=()=>zt!==void 0?zt:dt().sequence.wrap,i0=function(){ct={},Xt={},Jt={},mt=[],J=[],Dt=!1,Se()},s0=function(t){const e=t.trim(),o={text:e.replace(/^:?(?:no)?wrap:/,"").trim(),wrap:e.match(/^:?wrap:/)!==null?!0:e.match(/^:?nowrap:/)!==null?!1:void 0};return U.debug("parseMessage:",o),o},n0=function(t){const e=t.match(/^((?:rgba?|hsla?)\s*\(.*\)|\w*)(.*)$/);let o=e!=null&&e[1]?e[1].trim():"transparent",i=e!=null&&e[2]?e[2].trim():void 0;if(window&&window.CSS)window.CSS.supports("color",o)||(o="transparent",i=t.trim());else{const n=new Option().style;n.color=o,n.color!==o&&(o="transparent",i=t.trim())}return{color:o,text:i!==void 0?Mt(i.replace(/^:?(?:no)?wrap:/,""),dt()):void 0,wrap:i!==void 0?i.match(/^:?wrap:/)!==null?!0:i.match(/^:?nowrap:/)!==null?!1:void 0:void 0}},kt={SOLID:0,DOTTED:1,NOTE:2,SOLID_CROSS:3,DOTTED_CROSS:4,SOLID_OPEN:5,DOTTED_OPEN:6,LOOP_START:10,LOOP_END:11,ALT_START:12,ALT_ELSE:13,ALT_END:14,OPT_START:15,OPT_END:16,ACTIVE_START:17,ACTIVE_END:18,PAR_START:19,PAR_AND:20,PAR_END:21,RECT_START:22,RECT_END:23,SOLID_POINT:24,DOTTED_POINT:25,AUTONUMBER:26,CRITICAL_START:27,CRITICAL_OPTION:28,CRITICAL_END:29,BREAK_START:30,BREAK_END:31,PAR_OVER_START:32},a0={FILLED:0,OPEN:1},r0={LEFTOF:0,RIGHTOF:1,OVER:2},ce=function(t,e,o){o.text,o.wrap===void 0&&xt()||o.wrap;const i=[].concat(t,t);J.push({from:i[0],to:i[1],message:o.text,wrap:o.wrap===void 0&&xt()||!!o.wrap,type:kt.NOTE,placement:e})},le=function(t,e){const o=Lt(t);try{let i=Mt(e.text,dt());i=i.replace(/&amp;/g,"&"),i=i.replace(/&equals;/g,"=");const s=JSON.parse(i);Zt(o,s)}catch(i){U.error("error while parsing actor link text",i)}},o0=function(t,e){const o=Lt(t);try{const c={};let h=Mt(e.text,dt());var i=h.indexOf("@");h=h.replace(/&amp;/g,"&"),h=h.replace(/&equals;/g,"=");var s=h.slice(0,i-1).trim(),n=h.slice(i+1).trim();c[s]=n,Zt(o,c)}catch(c){U.error("error while parsing actor link text",c)}};function Zt(t,e){if(t.links==null)t.links=e;else for(let o in e)t.links[o]=e[o]}const he=function(t,e){const o=Lt(t);try{let i=Mt(e.text,dt());const s=JSON.parse(i);de(o,s)}catch(i){U.error("error while parsing actor properties text",i)}};function de(t,e){if(t.properties==null)t.properties=e;else for(let o in e)t.properties[o]=e[o]}function c0(){ot=void 0}const pe=function(t,e){const o=Lt(t),i=document.getElementById(e.text);try{const s=i.innerHTML,n=JSON.parse(s);n.properties&&de(o,n.properties),n.links&&Zt(o,n.links)}catch(s){U.error("error while parsing actor details text",s)}},l0=function(t,e){if(t!==void 0&&t.properties!==void 0)return t.properties[e]},ue=function(t){if(Array.isArray(t))t.forEach(function(e){ue(e)});else switch(t.type){case"sequenceIndex":J.push({from:void 0,to:void 0,message:{start:t.sequenceIndex,step:t.sequenceIndexStep,visible:t.sequenceVisible},wrap:!1,type:t.signalType});break;case"addParticipant":Ht(t.actor,t.actor,t.description,t.draw);break;case"createParticipant":if(ct[t.actor])throw new Error("It is not possible to have actors with the same id, even if one is destroyed before the next is created. Use 'AS' aliases to simulate the behavior");Pt=t.actor,Ht(t.actor,t.actor,t.description,t.draw),Xt[t.actor]=J.length;break;case"destroyParticipant":Et=t.actor,Jt[t.actor]=J.length;break;case"activeStart":D(t.actor,void 0,void 0,t.signalType);break;case"activeEnd":D(t.actor,void 0,void 0,t.signalType);break;case"addNote":ce(t.actor,t.placement,t.text);break;case"addLinks":le(t.actor,t.text);break;case"addALink":o0(t.actor,t.text);break;case"addProperties":he(t.actor,t.text);break;case"addDetails":pe(t.actor,t.text);break;case"addMessage":if(Pt){if(t.to!==Pt)throw new Error("The created participant "+Pt+" does not have an associated creating message after its declaration. Please check the sequence diagram.");Pt=void 0}else if(Et){if(t.to!==Et&&t.from!==Et)throw new Error("The destroyed participant "+Et+" does not have an associated destroying message after its declaration. Please check the sequence diagram.");Et=void 0}D(t.from,t.to,t.msg,t.signalType,t.activate);break;case"boxStart":We(t.boxData);break;case"boxEnd":c0();break;case"loopStart":D(void 0,void 0,t.loopText,t.signalType);break;case"loopEnd":D(void 0,void 0,void 0,t.signalType);break;case"rectStart":D(void 0,void 0,t.color,t.signalType);break;case"rectEnd":D(void 0,void 0,void 0,t.signalType);break;case"optStart":D(void 0,void 0,t.optText,t.signalType);break;case"optEnd":D(void 0,void 0,void 0,t.signalType);break;case"altStart":D(void 0,void 0,t.altText,t.signalType);break;case"else":D(void 0,void 0,t.altText,t.signalType);break;case"altEnd":D(void 0,void 0,void 0,t.signalType);break;case"setAccTitle":ae(t.text);break;case"parStart":D(void 0,void 0,t.parText,t.signalType);break;case"and":D(void 0,void 0,t.parText,t.signalType);break;case"parEnd":D(void 0,void 0,void 0,t.signalType);break;case"criticalStart":D(void 0,void 0,t.criticalText,t.signalType);break;case"option":D(void 0,void 0,t.optionText,t.signalType);break;case"criticalEnd":D(void 0,void 0,void 0,t.signalType);break;case"breakStart":D(void 0,void 0,t.breakText,t.signalType);break;case"breakEnd":D(void 0,void 0,void 0,t.signalType);break}},se={addActor:Ht,addMessage:ze,addSignal:D,addLinks:le,addDetails:pe,addProperties:he,autoWrap:xt,setWrap:e0,enableSequenceNumbers:je,disableSequenceNumbers:$e,showSequenceNumbers:t0,getMessages:Ke,getActors:Xe,getCreatedActors:Je,getDestroyedActors:Ze,getActor:Lt,getActorKeys:Qe,getActorProperty:l0,getAccTitle:ke,getBoxes:Ge,getDiagramTitle:Le,setDiagramTitle:Ie,getConfig:()=>dt().sequence,clear:i0,parseMessage:s0,parseBoxData:n0,LINETYPE:kt,ARROWTYPE:a0,PLACEMENT:r0,addNote:ce,setAccTitle:ae,apply:ue,setAccDescription:Ae,getAccDescription:Ne,hasAtLeastOneBox:He,hasAtLeastOneBoxWithTitle:Ue},h0=t=>`.actor {
7
- stroke: ${t.actorBorder};
8
- fill: ${t.actorBkg};
9
- }
10
-
11
- text.actor > tspan {
12
- fill: ${t.actorTextColor};
13
- stroke: none;
14
- }
15
-
16
- .actor-line {
17
- stroke: ${t.actorLineColor};
18
- }
19
-
20
- .messageLine0 {
21
- stroke-width: 1.5;
22
- stroke-dasharray: none;
23
- stroke: ${t.signalColor};
24
- }
25
-
26
- .messageLine1 {
27
- stroke-width: 1.5;
28
- stroke-dasharray: 2, 2;
29
- stroke: ${t.signalColor};
30
- }
31
-
32
- #arrowhead path {
33
- fill: ${t.signalColor};
34
- stroke: ${t.signalColor};
35
- }
36
-
37
- .sequenceNumber {
38
- fill: ${t.sequenceNumberColor};
39
- }
40
-
41
- #sequencenumber {
42
- fill: ${t.signalColor};
43
- }
44
-
45
- #crosshead path {
46
- fill: ${t.signalColor};
47
- stroke: ${t.signalColor};
48
- }
49
-
50
- .messageText {
51
- fill: ${t.signalTextColor};
52
- stroke: none;
53
- }
54
-
55
- .labelBox {
56
- stroke: ${t.labelBoxBorderColor};
57
- fill: ${t.labelBoxBkgColor};
58
- }
59
-
60
- .labelText, .labelText > tspan {
61
- fill: ${t.labelTextColor};
62
- stroke: none;
63
- }
64
-
65
- .loopText, .loopText > tspan {
66
- fill: ${t.loopTextColor};
67
- stroke: none;
68
- }
69
-
70
- .loopLine {
71
- stroke-width: 2px;
72
- stroke-dasharray: 2, 2;
73
- stroke: ${t.labelBoxBorderColor};
74
- fill: ${t.labelBoxBorderColor};
75
- }
76
-
77
- .note {
78
- //stroke: #decc93;
79
- stroke: ${t.noteBorderColor};
80
- fill: ${t.noteBkgColor};
81
- }
82
-
83
- .noteText, .noteText > tspan {
84
- fill: ${t.noteTextColor};
85
- stroke: none;
86
- }
87
-
88
- .activation0 {
89
- fill: ${t.activationBkgColor};
90
- stroke: ${t.activationBorderColor};
91
- }
92
-
93
- .activation1 {
94
- fill: ${t.activationBkgColor};
95
- stroke: ${t.activationBorderColor};
96
- }
97
-
98
- .activation2 {
99
- fill: ${t.activationBkgColor};
100
- stroke: ${t.activationBorderColor};
101
- }
102
-
103
- .actorPopupMenu {
104
- position: absolute;
105
- }
106
-
107
- .actorPopupMenuPanel {
108
- position: absolute;
109
- fill: ${t.actorBkg};
110
- box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
111
- filter: drop-shadow(3px 5px 2px rgb(0 0 0 / 0.4));
112
- }
113
- .actor-man line {
114
- stroke: ${t.actorBorder};
115
- fill: ${t.actorBkg};
116
- }
117
- .actor-man circle, line {
118
- stroke: ${t.actorBorder};
119
- fill: ${t.actorBkg};
120
- stroke-width: 2px;
121
- }
122
- `,d0=h0,gt=18*2,Qt=function(t,e){return Ce(t,e)},fe=(t,e)=>{De(()=>{const o=document.querySelectorAll(t);o.length!==0&&(o[0].addEventListener("mouseover",function(){g0("actor"+e+"_popup")}),o[0].addEventListener("mouseout",function(){x0("actor"+e+"_popup")}))})},p0=function(t,e,o,i,s){if(e.links===void 0||e.links===null||Object.keys(e.links).length===0)return{height:0,width:0};const n=e.links,c=e.actorCnt,h=e.rectData;var p="none";s&&(p="block !important");const a=t.append("g");a.attr("id","actor"+c+"_popup"),a.attr("class","actorPopupMenu"),a.attr("display",p),fe("#actor"+c+"_popup",c);var x="";h.class!==void 0&&(x=" "+h.class);let E=h.width>o?h.width:o;const u=a.append("rect");if(u.attr("class","actorPopupMenuPanel"+x),u.attr("x",h.x),u.attr("y",h.height),u.attr("fill",h.fill),u.attr("stroke",h.stroke),u.attr("width",E),u.attr("height",h.height),u.attr("rx",h.rx),u.attr("ry",h.ry),n!=null){var g=20;for(let I in n){var b=a.append("a"),P=re.sanitizeUrl(n[I]);b.attr("xlink:href",P),b.attr("target","_blank"),M0(i)(I,b,h.x+10,h.height+g,E,20,{class:"actor"},i),g+=30}}return u.attr("height",g),{height:h.height+g,width:E}},u0=function(t){return"var pu = document.getElementById('"+t+"'); if (pu != null) { pu.style.display = 'block'; }"},f0=function(t){return"var pu = document.getElementById('"+t+"'); if (pu != null) { pu.style.display = 'none'; }"},g0=function(t){var e=document.getElementById(t);e!=null&&(e.style.display="block")},x0=function(t){var e=document.getElementById(t);e!=null&&(e.style.display="none")},wt=function(t,e){let o=0,i=0;const s=e.text.split(w.lineBreakRegex),[n,c]=oe(e.fontSize);let h=[],p=0,a=()=>e.y;if(e.valign!==void 0&&e.textMargin!==void 0&&e.textMargin>0)switch(e.valign){case"top":case"start":a=()=>Math.round(e.y+e.textMargin);break;case"middle":case"center":a=()=>Math.round(e.y+(o+i+e.textMargin)/2);break;case"bottom":case"end":a=()=>Math.round(e.y+(o+i+2*e.textMargin)-e.textMargin);break}if(e.anchor!==void 0&&e.textMargin!==void 0&&e.width!==void 0)switch(e.anchor){case"left":case"start":e.x=Math.round(e.x+e.textMargin),e.anchor="start",e.dominantBaseline="middle",e.alignmentBaseline="middle";break;case"middle":case"center":e.x=Math.round(e.x+e.width/2),e.anchor="middle",e.dominantBaseline="middle",e.alignmentBaseline="middle";break;case"right":case"end":e.x=Math.round(e.x+e.width-e.textMargin),e.anchor="end",e.dominantBaseline="middle",e.alignmentBaseline="middle";break}for(let[x,E]of s.entries()){e.textMargin!==void 0&&e.textMargin===0&&n!==void 0&&(p=x*n);const u=t.append("text");u.attr("x",e.x),u.attr("y",a()),e.anchor!==void 0&&u.attr("text-anchor",e.anchor).attr("dominant-baseline",e.dominantBaseline).attr("alignment-baseline",e.alignmentBaseline),e.fontFamily!==void 0&&u.style("font-family",e.fontFamily),c!==void 0&&u.style("font-size",c),e.fontWeight!==void 0&&u.style("font-weight",e.fontWeight),e.fill!==void 0&&u.attr("fill",e.fill),e.class!==void 0&&u.attr("class",e.class),e.dy!==void 0?u.attr("dy",e.dy):p!==0&&u.attr("dy",p);const g=E||Ve;if(e.tspan){const b=u.append("tspan");b.attr("x",e.x),e.fill!==void 0&&b.attr("fill",e.fill),b.text(g)}else u.text(g);e.valign!==void 0&&e.textMargin!==void 0&&e.textMargin>0&&(i+=(u._groups||u)[0][0].getBBox().height,o=i),h.push(u)}return h},ge=function(t,e){function o(s,n,c,h,p){return s+","+n+" "+(s+c)+","+n+" "+(s+c)+","+(n+h-p)+" "+(s+c-p*1.2)+","+(n+h)+" "+s+","+(n+h)}const i=t.append("polygon");return i.attr("points",o(e.x,e.y,e.width,e.height,7)),i.attr("class","labelBox"),e.y=e.y+e.height/2,wt(t,e),i};let it=-1;const xe=(t,e,o,i)=>{t.select&&o.forEach(s=>{const n=e[s],c=t.select("#actor"+n.actorCnt);!i.mirrorActors&&n.stopy?c.attr("y2",n.stopy+n.height/2):i.mirrorActors&&c.attr("y2",n.stopy)})},T0=function(t,e,o,i){const s=i?e.stopy:e.starty,n=e.x+e.width/2,c=s+5,h=t.append("g").lower();var p=h;i||(it++,p.append("line").attr("id","actor"+it).attr("x1",n).attr("y1",c).attr("x2",n).attr("y2",2e3).attr("class","actor-line").attr("class","200").attr("stroke-width","0.5px").attr("stroke","#999"),p=h.append("g"),e.actorCnt=it,e.links!=null&&(p.attr("id","root-"+it),fe("#root-"+it,it)));const a=Rt();var x="actor";e.properties!=null&&e.properties.class?x=e.properties.class:a.fill="#eaeaea",a.x=e.x,a.y=s,a.width=e.width,a.height=e.height,a.class=x,a.rx=3,a.ry=3;const E=Qt(p,a);if(e.rectData=a,e.properties!=null&&e.properties.icon){const g=e.properties.icon.trim();g.charAt(0)==="@"?Be(p,a.x+a.width-20,a.y+10,g.substr(1)):Ye(p,a.x+a.width-20,a.y+10,g)}jt(o)(e.description,p,a.x,a.y,a.width,a.height,{class:"actor"},o);let u=e.height;if(E.node){const g=E.node().getBBox();e.height=g.height,u=g.height}return u},y0=function(t,e,o,i){const s=i?e.stopy:e.starty,n=e.x+e.width/2,c=s+80;t.lower(),i||(it++,t.append("line").attr("id","actor"+it).attr("x1",n).attr("y1",c).attr("x2",n).attr("y2",2e3).attr("class","actor-line").attr("class","200").attr("stroke-width","0.5px").attr("stroke","#999"),e.actorCnt=it);const h=t.append("g");h.attr("class","actor-man");const p=Rt();p.x=e.x,p.y=s,p.fill="#eaeaea",p.width=e.width,p.height=e.height,p.class="actor",p.rx=3,p.ry=3,h.append("line").attr("id","actor-man-torso"+it).attr("x1",n).attr("y1",s+25).attr("x2",n).attr("y2",s+45),h.append("line").attr("id","actor-man-arms"+it).attr("x1",n-gt/2).attr("y1",s+33).attr("x2",n+gt/2).attr("y2",s+33),h.append("line").attr("x1",n-gt/2).attr("y1",s+60).attr("x2",n).attr("y2",s+45),h.append("line").attr("x1",n).attr("y1",s+45).attr("x2",n+gt/2-2).attr("y2",s+60);const a=h.append("circle");a.attr("cx",e.x+e.width/2),a.attr("cy",s+10),a.attr("r",15),a.attr("width",e.width),a.attr("height",e.height);const x=h.node().getBBox();return e.height=x.height,jt(o)(e.description,h,p.x,p.y+35,p.width,p.height,{class:"actor"},o),e.height},E0=function(t,e,o,i){switch(e.type){case"actor":return y0(t,e,o,i);case"participant":return T0(t,e,o,i)}},b0=function(t,e,o){const s=t.append("g");Te(s,e),e.name&&jt(o)(e.name,s,e.x,e.y+(e.textMaxHeight||0)/2,e.width,0,{class:"text"},o),s.lower()},m0=function(t){return t.append("g")},w0=function(t,e,o,i,s){const n=Rt(),c=e.anchored;n.x=e.startx,n.y=e.starty,n.class="activation"+s%3,n.width=e.stopx-e.startx,n.height=o-e.starty,Qt(c,n)},v0=function(t,e,o,i){const{boxMargin:s,boxTextMargin:n,labelBoxHeight:c,labelBoxWidth:h,messageFontFamily:p,messageFontSize:a,messageFontWeight:x}=i,E=t.append("g"),u=function(P,I,R,N){return E.append("line").attr("x1",P).attr("y1",I).attr("x2",R).attr("y2",N).attr("class","loopLine")};u(e.startx,e.starty,e.stopx,e.starty),u(e.stopx,e.starty,e.stopx,e.stopy),u(e.startx,e.stopy,e.stopx,e.stopy),u(e.startx,e.starty,e.startx,e.stopy),e.sections!==void 0&&e.sections.forEach(function(P){u(e.startx,P.y,e.stopx,P.y).style("stroke-dasharray","3, 3")});let g=Gt();g.text=o,g.x=e.startx,g.y=e.starty,g.fontFamily=p,g.fontSize=a,g.fontWeight=x,g.anchor="middle",g.valign="middle",g.tspan=!1,g.width=h||50,g.height=c||20,g.textMargin=n,g.class="labelText",ge(E,g),g=ye(),g.text=e.title,g.x=e.startx+h/2+(e.stopx-e.startx)/2,g.y=e.starty+s+n,g.anchor="middle",g.valign="middle",g.textMargin=n,g.class="loopText",g.fontFamily=p,g.fontSize=a,g.fontWeight=x,g.wrap=!0;let b=wt(E,g);return e.sectionTitles!==void 0&&e.sectionTitles.forEach(function(P,I){if(P.message){g.text=P.message,g.x=e.startx+(e.stopx-e.startx)/2,g.y=e.sections[I].y+s+n,g.class="loopText",g.anchor="middle",g.valign="middle",g.tspan=!1,g.fontFamily=p,g.fontSize=a,g.fontWeight=x,g.wrap=e.wrap,b=wt(E,g);let R=Math.round(b.map(N=>(N._groups||N)[0][0].getBBox().height).reduce((N,F)=>N+F));e.sections[I].height+=R-(s+n)}}),e.height=Math.round(e.stopy-e.starty),E},Te=function(t,e){Oe(t,e)},_0=function(t){t.append("defs").append("symbol").attr("id","database").attr("fill-rule","evenodd").attr("clip-rule","evenodd").append("path").attr("transform","scale(.5)").attr("d","M12.258.001l.256.004.255.005.253.008.251.01.249.012.247.015.246.016.242.019.241.02.239.023.236.024.233.027.231.028.229.031.225.032.223.034.22.036.217.038.214.04.211.041.208.043.205.045.201.046.198.048.194.05.191.051.187.053.183.054.18.056.175.057.172.059.168.06.163.061.16.063.155.064.15.066.074.033.073.033.071.034.07.034.069.035.068.035.067.035.066.035.064.036.064.036.062.036.06.036.06.037.058.037.058.037.055.038.055.038.053.038.052.038.051.039.05.039.048.039.047.039.045.04.044.04.043.04.041.04.04.041.039.041.037.041.036.041.034.041.033.042.032.042.03.042.029.042.027.042.026.043.024.043.023.043.021.043.02.043.018.044.017.043.015.044.013.044.012.044.011.045.009.044.007.045.006.045.004.045.002.045.001.045v17l-.001.045-.002.045-.004.045-.006.045-.007.045-.009.044-.011.045-.012.044-.013.044-.015.044-.017.043-.018.044-.02.043-.021.043-.023.043-.024.043-.026.043-.027.042-.029.042-.03.042-.032.042-.033.042-.034.041-.036.041-.037.041-.039.041-.04.041-.041.04-.043.04-.044.04-.045.04-.047.039-.048.039-.05.039-.051.039-.052.038-.053.038-.055.038-.055.038-.058.037-.058.037-.06.037-.06.036-.062.036-.064.036-.064.036-.066.035-.067.035-.068.035-.069.035-.07.034-.071.034-.073.033-.074.033-.15.066-.155.064-.16.063-.163.061-.168.06-.172.059-.175.057-.18.056-.183.054-.187.053-.191.051-.194.05-.198.048-.201.046-.205.045-.208.043-.211.041-.214.04-.217.038-.22.036-.223.034-.225.032-.229.031-.231.028-.233.027-.236.024-.239.023-.241.02-.242.019-.246.016-.247.015-.249.012-.251.01-.253.008-.255.005-.256.004-.258.001-.258-.001-.256-.004-.255-.005-.253-.008-.251-.01-.249-.012-.247-.015-.245-.016-.243-.019-.241-.02-.238-.023-.236-.024-.234-.027-.231-.028-.228-.031-.226-.032-.223-.034-.22-.036-.217-.038-.214-.04-.211-.041-.208-.043-.204-.045-.201-.046-.198-.048-.195-.05-.19-.051-.187-.053-.184-.054-.179-.056-.176-.057-.172-.059-.167-.06-.164-.061-.159-.063-.155-.064-.151-.066-.074-.033-.072-.033-.072-.034-.07-.034-.069-.035-.068-.035-.067-.035-.066-.035-.064-.036-.063-.036-.062-.036-.061-.036-.06-.037-.058-.037-.057-.037-.056-.038-.055-.038-.053-.038-.052-.038-.051-.039-.049-.039-.049-.039-.046-.039-.046-.04-.044-.04-.043-.04-.041-.04-.04-.041-.039-.041-.037-.041-.036-.041-.034-.041-.033-.042-.032-.042-.03-.042-.029-.042-.027-.042-.026-.043-.024-.043-.023-.043-.021-.043-.02-.043-.018-.044-.017-.043-.015-.044-.013-.044-.012-.044-.011-.045-.009-.044-.007-.045-.006-.045-.004-.045-.002-.045-.001-.045v-17l.001-.045.002-.045.004-.045.006-.045.007-.045.009-.044.011-.045.012-.044.013-.044.015-.044.017-.043.018-.044.02-.043.021-.043.023-.043.024-.043.026-.043.027-.042.029-.042.03-.042.032-.042.033-.042.034-.041.036-.041.037-.041.039-.041.04-.041.041-.04.043-.04.044-.04.046-.04.046-.039.049-.039.049-.039.051-.039.052-.038.053-.038.055-.038.056-.038.057-.037.058-.037.06-.037.061-.036.062-.036.063-.036.064-.036.066-.035.067-.035.068-.035.069-.035.07-.034.072-.034.072-.033.074-.033.151-.066.155-.064.159-.063.164-.061.167-.06.172-.059.176-.057.179-.056.184-.054.187-.053.19-.051.195-.05.198-.048.201-.046.204-.045.208-.043.211-.041.214-.04.217-.038.22-.036.223-.034.226-.032.228-.031.231-.028.234-.027.236-.024.238-.023.241-.02.243-.019.245-.016.247-.015.249-.012.251-.01.253-.008.255-.005.256-.004.258-.001.258.001zm-9.258 20.499v.01l.001.021.003.021.004.022.005.021.006.022.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.023.018.024.019.024.021.024.022.025.023.024.024.025.052.049.056.05.061.051.066.051.07.051.075.051.079.052.084.052.088.052.092.052.097.052.102.051.105.052.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.048.144.049.147.047.152.047.155.047.16.045.163.045.167.043.171.043.176.041.178.041.183.039.187.039.19.037.194.035.197.035.202.033.204.031.209.03.212.029.216.027.219.025.222.024.226.021.23.02.233.018.236.016.24.015.243.012.246.01.249.008.253.005.256.004.259.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.021.224-.024.22-.026.216-.027.212-.028.21-.031.205-.031.202-.034.198-.034.194-.036.191-.037.187-.039.183-.04.179-.04.175-.042.172-.043.168-.044.163-.045.16-.046.155-.046.152-.047.148-.048.143-.049.139-.049.136-.05.131-.05.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.053.083-.051.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.05.023-.024.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.023.01-.022.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.127l-.077.055-.08.053-.083.054-.085.053-.087.052-.09.052-.093.051-.095.05-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.045-.118.044-.12.043-.122.042-.124.042-.126.041-.128.04-.13.04-.132.038-.134.038-.135.037-.138.037-.139.035-.142.035-.143.034-.144.033-.147.032-.148.031-.15.03-.151.03-.153.029-.154.027-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.01-.179.008-.179.008-.181.006-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.006-.179-.008-.179-.008-.178-.01-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.027-.153-.029-.151-.03-.15-.03-.148-.031-.146-.032-.145-.033-.143-.034-.141-.035-.14-.035-.137-.037-.136-.037-.134-.038-.132-.038-.13-.04-.128-.04-.126-.041-.124-.042-.122-.042-.12-.044-.117-.043-.116-.045-.113-.045-.112-.046-.109-.047-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.05-.093-.052-.09-.051-.087-.052-.085-.053-.083-.054-.08-.054-.077-.054v4.127zm0-5.654v.011l.001.021.003.021.004.021.005.022.006.022.007.022.009.022.01.022.011.023.012.023.013.023.015.024.016.023.017.024.018.024.019.024.021.024.022.024.023.025.024.024.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.052.11.051.114.051.119.052.123.05.127.051.131.05.135.049.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.044.171.042.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.022.23.02.233.018.236.016.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.012.241-.015.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.048.139-.05.136-.049.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.051.051-.049.023-.025.023-.024.021-.025.02-.024.019-.024.018-.024.017-.024.015-.023.014-.023.013-.024.012-.022.01-.023.01-.023.008-.022.006-.022.006-.022.004-.021.004-.022.001-.021.001-.021v-4.139l-.077.054-.08.054-.083.054-.085.052-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.044-.118.044-.12.044-.122.042-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.035-.143.033-.144.033-.147.033-.148.031-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.009-.179.009-.179.007-.181.007-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.007-.179-.007-.179-.009-.178-.009-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.031-.146-.033-.145-.033-.143-.033-.141-.035-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.04-.126-.041-.124-.042-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.051-.093-.051-.09-.051-.087-.053-.085-.052-.083-.054-.08-.054-.077-.054v4.139zm0-5.666v.011l.001.02.003.022.004.021.005.022.006.021.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.024.018.023.019.024.021.025.022.024.023.024.024.025.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.051.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.043.171.043.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.021.23.02.233.018.236.017.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.013.241-.014.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.049.139-.049.136-.049.131-.051.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.049.023-.025.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.022.01-.023.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.153l-.077.054-.08.054-.083.053-.085.053-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.048-.105.048-.106.048-.109.046-.111.046-.114.046-.115.044-.118.044-.12.043-.122.043-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.034-.143.034-.144.033-.147.032-.148.032-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.024-.161.024-.162.023-.163.023-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.01-.178.01-.179.009-.179.007-.181.006-.182.006-.182.004-.184.003-.184.001-.185.001-.185-.001-.184-.001-.184-.003-.182-.004-.182-.006-.181-.006-.179-.007-.179-.009-.178-.01-.176-.01-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.023-.162-.023-.161-.024-.159-.024-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.032-.146-.032-.145-.033-.143-.034-.141-.034-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.041-.126-.041-.124-.041-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.048-.105-.048-.102-.048-.1-.05-.097-.049-.095-.051-.093-.051-.09-.052-.087-.052-.085-.053-.083-.053-.08-.054-.077-.054v4.153zm8.74-8.179l-.257.004-.254.005-.25.008-.247.011-.244.012-.241.014-.237.016-.233.018-.231.021-.226.022-.224.023-.22.026-.216.027-.212.028-.21.031-.205.032-.202.033-.198.034-.194.036-.191.038-.187.038-.183.04-.179.041-.175.042-.172.043-.168.043-.163.045-.16.046-.155.046-.152.048-.148.048-.143.048-.139.049-.136.05-.131.05-.126.051-.123.051-.118.051-.114.052-.11.052-.106.052-.101.052-.096.052-.092.052-.088.052-.083.052-.079.052-.074.051-.07.052-.065.051-.06.05-.056.05-.051.05-.023.025-.023.024-.021.024-.02.025-.019.024-.018.024-.017.023-.015.024-.014.023-.013.023-.012.023-.01.023-.01.022-.008.022-.006.023-.006.021-.004.022-.004.021-.001.021-.001.021.001.021.001.021.004.021.004.022.006.021.006.023.008.022.01.022.01.023.012.023.013.023.014.023.015.024.017.023.018.024.019.024.02.025.021.024.023.024.023.025.051.05.056.05.06.05.065.051.07.052.074.051.079.052.083.052.088.052.092.052.096.052.101.052.106.052.11.052.114.052.118.051.123.051.126.051.131.05.136.05.139.049.143.048.148.048.152.048.155.046.16.046.163.045.168.043.172.043.175.042.179.041.183.04.187.038.191.038.194.036.198.034.202.033.205.032.21.031.212.028.216.027.22.026.224.023.226.022.231.021.233.018.237.016.241.014.244.012.247.011.25.008.254.005.257.004.26.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.022.224-.023.22-.026.216-.027.212-.028.21-.031.205-.032.202-.033.198-.034.194-.036.191-.038.187-.038.183-.04.179-.041.175-.042.172-.043.168-.043.163-.045.16-.046.155-.046.152-.048.148-.048.143-.048.139-.049.136-.05.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.05.051-.05.023-.025.023-.024.021-.024.02-.025.019-.024.018-.024.017-.023.015-.024.014-.023.013-.023.012-.023.01-.023.01-.022.008-.022.006-.023.006-.021.004-.022.004-.021.001-.021.001-.021-.001-.021-.001-.021-.004-.021-.004-.022-.006-.021-.006-.023-.008-.022-.01-.022-.01-.023-.012-.023-.013-.023-.014-.023-.015-.024-.017-.023-.018-.024-.019-.024-.02-.025-.021-.024-.023-.024-.023-.025-.051-.05-.056-.05-.06-.05-.065-.051-.07-.052-.074-.051-.079-.052-.083-.052-.088-.052-.092-.052-.096-.052-.101-.052-.106-.052-.11-.052-.114-.052-.118-.051-.123-.051-.126-.051-.131-.05-.136-.05-.139-.049-.143-.048-.148-.048-.152-.048-.155-.046-.16-.046-.163-.045-.168-.043-.172-.043-.175-.042-.179-.041-.183-.04-.187-.038-.191-.038-.194-.036-.198-.034-.202-.033-.205-.032-.21-.031-.212-.028-.216-.027-.22-.026-.224-.023-.226-.022-.231-.021-.233-.018-.237-.016-.241-.014-.244-.012-.247-.011-.25-.008-.254-.005-.257-.004-.26-.001-.26.001z")},P0=function(t){t.append("defs").append("symbol").attr("id","computer").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M2 2v13h20v-13h-20zm18 11h-16v-9h16v9zm-10.228 6l.466-1h3.524l.467 1h-4.457zm14.228 3h-24l2-6h2.104l-1.33 4h18.45l-1.297-4h2.073l2 6zm-5-10h-14v-7h14v7z")},k0=function(t){t.append("defs").append("symbol").attr("id","clock").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M12 2c5.514 0 10 4.486 10 10s-4.486 10-10 10-10-4.486-10-10 4.486-10 10-10zm0-2c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm5.848 12.459c.202.038.202.333.001.372-1.907.361-6.045 1.111-6.547 1.111-.719 0-1.301-.582-1.301-1.301 0-.512.77-5.447 1.125-7.445.034-.192.312-.181.343.014l.985 6.238 5.394 1.011z")},L0=function(t){t.append("defs").append("marker").attr("id","arrowhead").attr("refX",7.9).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z")},I0=function(t){t.append("defs").append("marker").attr("id","filled-head").attr("refX",15.5).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},A0=function(t){t.append("defs").append("marker").attr("id","sequencenumber").attr("refX",15).attr("refY",15).attr("markerWidth",60).attr("markerHeight",40).attr("orient","auto").append("circle").attr("cx",15).attr("cy",15).attr("r",6)},N0=function(t){t.append("defs").append("marker").attr("id","crosshead").attr("markerWidth",15).attr("markerHeight",8).attr("orient","auto").attr("refX",4).attr("refY",4.5).append("path").attr("fill","none").attr("stroke","#000000").style("stroke-dasharray","0, 0").attr("stroke-width","1pt").attr("d","M 1,2 L 6,7 M 6,2 L 1,7")},ye=function(){return{x:0,y:0,fill:void 0,anchor:void 0,style:"#666",width:void 0,height:void 0,textMargin:0,rx:0,ry:0,tspan:!0,valign:void 0}},S0=function(){return{x:0,y:0,fill:"#EDF2AE",stroke:"#666",width:100,anchor:"start",height:100,rx:0,ry:0}},jt=function(){function t(s,n,c,h,p,a,x){const E=n.append("text").attr("x",c+p/2).attr("y",h+a/2+5).style("text-anchor","middle").text(s);i(E,x)}function e(s,n,c,h,p,a,x,E){const{actorFontSize:u,actorFontFamily:g,actorFontWeight:b}=E,[P,I]=oe(u),R=s.split(w.lineBreakRegex);for(let N=0;N<R.length;N++){const F=N*P-P*(R.length-1)/2,S=n.append("text").attr("x",c+p/2).attr("y",h).style("text-anchor","middle").style("font-size",I).style("font-weight",b).style("font-family",g);S.append("tspan").attr("x",c+p/2).attr("dy",F).text(R[N]),S.attr("y",h+a/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),i(S,x)}}function o(s,n,c,h,p,a,x,E){const u=n.append("switch"),b=u.append("foreignObject").attr("x",c).attr("y",h).attr("width",p).attr("height",a).append("xhtml:div").style("display","table").style("height","100%").style("width","100%");b.append("div").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(s),e(s,u,c,h,p,a,x,E),i(b,x)}function i(s,n){for(const c in n)n.hasOwnProperty(c)&&s.attr(c,n[c])}return function(s){return s.textPlacement==="fo"?o:s.textPlacement==="old"?t:e}}(),M0=function(){function t(s,n,c,h,p,a,x){const E=n.append("text").attr("x",c).attr("y",h).style("text-anchor","start").text(s);i(E,x)}function e(s,n,c,h,p,a,x,E){const{actorFontSize:u,actorFontFamily:g,actorFontWeight:b}=E,P=s.split(w.lineBreakRegex);for(let I=0;I<P.length;I++){const R=I*u-u*(P.length-1)/2,N=n.append("text").attr("x",c).attr("y",h).style("text-anchor","start").style("font-size",u).style("font-weight",b).style("font-family",g);N.append("tspan").attr("x",c).attr("dy",R).text(P[I]),N.attr("y",h+a/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),i(N,x)}}function o(s,n,c,h,p,a,x,E){const u=n.append("switch"),b=u.append("foreignObject").attr("x",c).attr("y",h).attr("width",p).attr("height",a).append("xhtml:div").style("display","table").style("height","100%").style("width","100%");b.append("div").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(s),e(s,u,c,h,p,a,x,E),i(b,x)}function i(s,n){for(const c in n)n.hasOwnProperty(c)&&s.attr(c,n[c])}return function(s){return s.textPlacement==="fo"?o:s.textPlacement==="old"?t:e}}(),V={drawRect:Qt,drawText:wt,drawLabel:ge,drawActor:E0,drawBox:b0,drawPopup:p0,anchorElement:m0,drawActivation:w0,drawLoop:v0,drawBackgroundRect:Te,insertArrowHead:L0,insertArrowFilledHead:I0,insertSequenceNumber:A0,insertArrowCrossHead:N0,insertDatabaseIcon:_0,insertComputerIcon:P0,insertClockIcon:k0,getTextObj:ye,getNoteRect:S0,popupMenu:u0,popdownMenu:f0,fixLifeLineHeights:xe,sanitizeUrl:re.sanitizeUrl};let r={};const f={data:{startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},verticalPos:0,sequenceItems:[],activations:[],models:{getHeight:function(){return Math.max.apply(null,this.actors.length===0?[0]:this.actors.map(t=>t.height||0))+(this.loops.length===0?0:this.loops.map(t=>t.height||0).reduce((t,e)=>t+e))+(this.messages.length===0?0:this.messages.map(t=>t.height||0).reduce((t,e)=>t+e))+(this.notes.length===0?0:this.notes.map(t=>t.height||0).reduce((t,e)=>t+e))},clear:function(){this.actors=[],this.boxes=[],this.loops=[],this.messages=[],this.notes=[]},addBox:function(t){this.boxes.push(t)},addActor:function(t){this.actors.push(t)},addLoop:function(t){this.loops.push(t)},addMessage:function(t){this.messages.push(t)},addNote:function(t){this.notes.push(t)},lastActor:function(){return this.actors[this.actors.length-1]},lastLoop:function(){return this.loops[this.loops.length-1]},lastMessage:function(){return this.messages[this.messages.length-1]},lastNote:function(){return this.notes[this.notes.length-1]},actors:[],boxes:[],loops:[],messages:[],notes:[]},init:function(){this.sequenceItems=[],this.activations=[],this.models.clear(),this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0,be(dt())},updateVal:function(t,e,o,i){t[e]===void 0?t[e]=o:t[e]=i(o,t[e])},updateBounds:function(t,e,o,i){const s=this;let n=0;function c(h){return function(a){n++;const x=s.sequenceItems.length-n+1;s.updateVal(a,"starty",e-x*r.boxMargin,Math.min),s.updateVal(a,"stopy",i+x*r.boxMargin,Math.max),s.updateVal(f.data,"startx",t-x*r.boxMargin,Math.min),s.updateVal(f.data,"stopx",o+x*r.boxMargin,Math.max),h!=="activation"&&(s.updateVal(a,"startx",t-x*r.boxMargin,Math.min),s.updateVal(a,"stopx",o+x*r.boxMargin,Math.max),s.updateVal(f.data,"starty",e-x*r.boxMargin,Math.min),s.updateVal(f.data,"stopy",i+x*r.boxMargin,Math.max))}}this.sequenceItems.forEach(c()),this.activations.forEach(c("activation"))},insert:function(t,e,o,i){const s=w.getMin(t,o),n=w.getMax(t,o),c=w.getMin(e,i),h=w.getMax(e,i);this.updateVal(f.data,"startx",s,Math.min),this.updateVal(f.data,"starty",c,Math.min),this.updateVal(f.data,"stopx",n,Math.max),this.updateVal(f.data,"stopy",h,Math.max),this.updateBounds(s,c,n,h)},newActivation:function(t,e,o){const i=o[t.from.actor],s=Vt(t.from.actor).length||0,n=i.x+i.width/2+(s-1)*r.activationWidth/2;this.activations.push({startx:n,starty:this.verticalPos+2,stopx:n+r.activationWidth,stopy:void 0,actor:t.from.actor,anchored:V.anchorElement(e)})},endActivation:function(t){const e=this.activations.map(function(o){return o.actor}).lastIndexOf(t.from.actor);return this.activations.splice(e,1)[0]},createLoop:function(t={message:void 0,wrap:!1,width:void 0},e){return{startx:void 0,starty:this.verticalPos,stopx:void 0,stopy:void 0,title:t.message,wrap:t.wrap,width:t.width,height:0,fill:e}},newLoop:function(t={message:void 0,wrap:!1,width:void 0},e){this.sequenceItems.push(this.createLoop(t,e))},endLoop:function(){return this.sequenceItems.pop()},isLoopOverlap:function(){return this.sequenceItems.length?this.sequenceItems[this.sequenceItems.length-1].overlap:!1},addSectionToLoop:function(t){const e=this.sequenceItems.pop();e.sections=e.sections||[],e.sectionTitles=e.sectionTitles||[],e.sections.push({y:f.getVerticalPos(),height:0}),e.sectionTitles.push(t),this.sequenceItems.push(e)},saveVerticalPos:function(){this.isLoopOverlap()&&(this.savedVerticalPos=this.verticalPos)},resetVerticalPos:function(){this.isLoopOverlap()&&(this.verticalPos=this.savedVerticalPos)},bumpVerticalPos:function(t){this.verticalPos=this.verticalPos+t,this.data.stopy=w.getMax(this.data.stopy,this.verticalPos)},getVerticalPos:function(){return this.verticalPos},getBounds:function(){return{bounds:this.data,models:this.models}}},R0=function(t,e){f.bumpVerticalPos(r.boxMargin),e.height=r.boxMargin,e.starty=f.getVerticalPos();const o=Rt();o.x=e.startx,o.y=e.starty,o.width=e.width||r.width,o.class="note";const i=t.append("g"),s=V.drawRect(i,o),n=Gt();n.x=e.startx,n.y=e.starty,n.width=o.width,n.dy="1em",n.text=e.message,n.class="noteText",n.fontFamily=r.noteFontFamily,n.fontSize=r.noteFontSize,n.fontWeight=r.noteFontWeight,n.anchor=r.noteAlign,n.textMargin=r.noteMargin,n.valign="center";const c=wt(i,n),h=Math.round(c.map(p=>(p._groups||p)[0][0].getBBox().height).reduce((p,a)=>p+a));s.attr("height",h+2*r.noteMargin),e.height+=h+2*r.noteMargin,f.bumpVerticalPos(h+2*r.noteMargin),e.stopy=e.starty+h+2*r.noteMargin,e.stopx=e.startx+o.width,f.insert(e.startx,e.starty,e.stopx,e.stopy),f.models.addNote(e)},Tt=t=>({fontFamily:t.messageFontFamily,fontSize:t.messageFontSize,fontWeight:t.messageFontWeight}),bt=t=>({fontFamily:t.noteFontFamily,fontSize:t.noteFontSize,fontWeight:t.noteFontWeight}),Ut=t=>({fontFamily:t.actorFontFamily,fontSize:t.actorFontSize,fontWeight:t.actorFontWeight});function D0(t,e){f.bumpVerticalPos(10);const{startx:o,stopx:i,message:s}=e,n=w.splitBreaks(s).length,c=O.calculateTextDimensions(s,Tt(r)),h=c.height/n;e.height+=h,f.bumpVerticalPos(h);let p,a=c.height-10;const x=c.width;if(o===i){p=f.getVerticalPos()+a,r.rightAngles||(a+=r.boxMargin,p=f.getVerticalPos()+a),a+=30;const E=w.getMax(x/2,r.width/2);f.insert(o-E,f.getVerticalPos()-10+a,i+E,f.getVerticalPos()+30+a)}else a+=r.boxMargin,p=f.getVerticalPos()+a,f.insert(o,p-10,i,p);return f.bumpVerticalPos(a),e.height+=a,e.stopy=e.starty+e.height,f.insert(e.fromBounds,e.starty,e.toBounds,e.stopy),p}const V0=function(t,e,o,i){const{startx:s,stopx:n,starty:c,message:h,type:p,sequenceIndex:a,sequenceVisible:x}=e,E=O.calculateTextDimensions(h,Tt(r)),u=Gt();u.x=s,u.y=c+10,u.width=n-s,u.class="messageText",u.dy="1em",u.text=h,u.fontFamily=r.messageFontFamily,u.fontSize=r.messageFontSize,u.fontWeight=r.messageFontWeight,u.anchor=r.messageAlign,u.valign="center",u.textMargin=r.wrapPadding,u.tspan=!1,wt(t,u);const g=E.width;let b;s===n?r.rightAngles?b=t.append("path").attr("d",`M ${s},${o} H ${s+w.getMax(r.width/2,g/2)} V ${o+25} H ${s}`):b=t.append("path").attr("d","M "+s+","+o+" C "+(s+60)+","+(o-10)+" "+(s+60)+","+(o+30)+" "+s+","+(o+20)):(b=t.append("line"),b.attr("x1",s),b.attr("y1",o),b.attr("x2",n),b.attr("y2",o)),p===i.db.LINETYPE.DOTTED||p===i.db.LINETYPE.DOTTED_CROSS||p===i.db.LINETYPE.DOTTED_POINT||p===i.db.LINETYPE.DOTTED_OPEN?(b.style("stroke-dasharray","3, 3"),b.attr("class","messageLine1")):b.attr("class","messageLine0");let P="";r.arrowMarkerAbsolute&&(P=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,P=P.replace(/\(/g,"\\("),P=P.replace(/\)/g,"\\)")),b.attr("stroke-width",2),b.attr("stroke","none"),b.style("fill","none"),(p===i.db.LINETYPE.SOLID||p===i.db.LINETYPE.DOTTED)&&b.attr("marker-end","url("+P+"#arrowhead)"),(p===i.db.LINETYPE.SOLID_POINT||p===i.db.LINETYPE.DOTTED_POINT)&&b.attr("marker-end","url("+P+"#filled-head)"),(p===i.db.LINETYPE.SOLID_CROSS||p===i.db.LINETYPE.DOTTED_CROSS)&&b.attr("marker-end","url("+P+"#crosshead)"),(x||r.showSequenceNumbers)&&(b.attr("marker-start","url("+P+"#sequencenumber)"),t.append("text").attr("x",s).attr("y",o+4).attr("font-family","sans-serif").attr("font-size","12px").attr("text-anchor","middle").attr("class","sequenceNumber").text(a))},C0=function(t,e,o,i,s,n,c){let h=0,p=0,a,x=0;for(const E of i){const u=e[E],g=u.box;a&&a!=g&&(c||f.models.addBox(a),p+=r.boxMargin+a.margin),g&&g!=a&&(c||(g.x=h+p,g.y=s),p+=g.margin),u.width=u.width||r.width,u.height=w.getMax(u.height||r.height,r.height),u.margin=u.margin||r.actorMargin,x=w.getMax(x,u.height),o[u.name]&&(p+=u.width/2),u.x=h+p,u.starty=f.getVerticalPos(),f.insert(u.x,s,u.x+u.width,u.height),h+=u.width+p,u.box&&(u.box.width=h+g.margin-u.box.x),p=u.margin,a=u.box,f.models.addActor(u)}a&&!c&&f.models.addBox(a),f.bumpVerticalPos(x)},Kt=function(t,e,o,i){if(i){let s=0;f.bumpVerticalPos(r.boxMargin*2);for(const n of o){const c=e[n];c.stopy||(c.stopy=f.getVerticalPos());const h=V.drawActor(t,c,r,!0);s=w.getMax(s,h)}f.bumpVerticalPos(s+r.boxMargin)}else for(const s of o){const n=e[s];V.drawActor(t,n,r,!1)}},Ee=function(t,e,o,i){let s=0,n=0;for(const c of o){const h=e[c],p=F0(h),a=V.drawPopup(t,h,p,r,r.forceMenus,i);a.height>s&&(s=a.height),a.width+h.x>n&&(n=a.width+h.x)}return{maxHeight:s,maxWidth:n}},be=function(t){Me(r,t),t.fontFamily&&(r.actorFontFamily=r.noteFontFamily=r.messageFontFamily=t.fontFamily),t.fontSize&&(r.actorFontSize=r.noteFontSize=r.messageFontSize=t.fontSize),t.fontWeight&&(r.actorFontWeight=r.noteFontWeight=r.messageFontWeight=t.fontWeight)},Vt=function(t){return f.activations.filter(function(e){return e.actor===t})},ne=function(t,e){const o=e[t],i=Vt(t),s=i.reduce(function(c,h){return w.getMin(c,h.startx)},o.x+o.width/2-1),n=i.reduce(function(c,h){return w.getMax(c,h.stopx)},o.x+o.width/2+1);return[s,n]};function st(t,e,o,i,s){f.bumpVerticalPos(o);let n=i;if(e.id&&e.message&&t[e.id]){const c=t[e.id].width,h=Tt(r);e.message=O.wrapLabel(`[${e.message}]`,c-2*r.wrapPadding,h),e.width=c,e.wrap=!0;const p=O.calculateTextDimensions(e.message,h),a=w.getMax(p.height,r.labelBoxHeight);n=i+a,U.debug(`${a} - ${e.message}`)}s(e),f.bumpVerticalPos(n)}function O0(t,e,o,i,s,n,c){function h(a,x){a.x<s[t.from].x?(f.insert(e.stopx-x,e.starty,e.startx,e.stopy+a.height/2+r.noteMargin),e.stopx=e.stopx+x):(f.insert(e.startx,e.starty,e.stopx+x,e.stopy+a.height/2+r.noteMargin),e.stopx=e.stopx-x)}function p(a,x){a.x<s[t.to].x?(f.insert(e.startx-x,e.starty,e.stopx,e.stopy+a.height/2+r.noteMargin),e.startx=e.startx+x):(f.insert(e.stopx,e.starty,e.startx+x,e.stopy+a.height/2+r.noteMargin),e.startx=e.startx-x)}if(n[t.to]==i){const a=s[t.to],x=a.type=="actor"?gt/2+3:a.width/2+3;h(a,x),a.starty=o-a.height/2,f.bumpVerticalPos(a.height/2)}else if(c[t.from]==i){const a=s[t.from];if(r.mirrorActors){const x=a.type=="actor"?gt/2:a.width/2;p(a,x)}a.stopy=o-a.height/2,f.bumpVerticalPos(a.height/2)}else if(c[t.to]==i){const a=s[t.to];if(r.mirrorActors){const x=a.type=="actor"?gt/2+3:a.width/2+3;h(a,x)}a.stopy=o-a.height/2,f.bumpVerticalPos(a.height/2)}}const B0=function(t,e,o,i){const{securityLevel:s,sequence:n}=dt();r=n;let c;s==="sandbox"&&(c=St("#i"+e));const h=s==="sandbox"?St(c.nodes()[0].contentDocument.body):St("body"),p=s==="sandbox"?c.nodes()[0].contentDocument:document;f.init(),U.debug(i.db);const a=s==="sandbox"?h.select(`[id="${e}"]`):St(`[id="${e}"]`),x=i.db.getActors(),E=i.db.getCreatedActors(),u=i.db.getDestroyedActors(),g=i.db.getBoxes();let b=i.db.getActorKeys();const P=i.db.getMessages(),I=i.db.getDiagramTitle(),R=i.db.hasAtLeastOneBox(),N=i.db.hasAtLeastOneBoxWithTitle(),F=Y0(x,P,i);if(r.height=W0(x,F,g),V.insertComputerIcon(a),V.insertDatabaseIcon(a),V.insertClockIcon(a),R&&(f.bumpVerticalPos(r.boxMargin),N&&f.bumpVerticalPos(g[0].textMaxHeight)),r.hideUnusedParticipants===!0){const y=new Set;P.forEach(v=>{y.add(v.from),y.add(v.to)}),b=b.filter(v=>y.has(v))}C0(a,x,E,b,0,P,!1);const S=H0(P,x,F,i);V.insertArrowHead(a),V.insertArrowCrossHead(a),V.insertArrowFilledHead(a),V.insertSequenceNumber(a);function tt(y,v){const L=f.endActivation(y);L.starty+18>v&&(L.starty=v-6,v+=12),V.drawActivation(a,L,v,r,Vt(y.from.actor).length),f.insert(L.startx,v-10,L.stopx,v)}let W=1,K=1;const Z=[],q=[];P.forEach(function(y,v){let L,pt,et;switch(y.type){case i.db.LINETYPE.NOTE:f.resetVerticalPos(),pt=y.noteModel,R0(a,pt);break;case i.db.LINETYPE.ACTIVE_START:f.newActivation(y,a,x);break;case i.db.LINETYPE.ACTIVE_END:tt(y,f.getVerticalPos());break;case i.db.LINETYPE.LOOP_START:st(S,y,r.boxMargin,r.boxMargin+r.boxTextMargin,A=>f.newLoop(A));break;case i.db.LINETYPE.LOOP_END:L=f.endLoop(),V.drawLoop(a,L,"loop",r),f.bumpVerticalPos(L.stopy-f.getVerticalPos()),f.models.addLoop(L);break;case i.db.LINETYPE.RECT_START:st(S,y,r.boxMargin,r.boxMargin,A=>f.newLoop(void 0,A.message));break;case i.db.LINETYPE.RECT_END:L=f.endLoop(),q.push(L),f.models.addLoop(L),f.bumpVerticalPos(L.stopy-f.getVerticalPos());break;case i.db.LINETYPE.OPT_START:st(S,y,r.boxMargin,r.boxMargin+r.boxTextMargin,A=>f.newLoop(A));break;case i.db.LINETYPE.OPT_END:L=f.endLoop(),V.drawLoop(a,L,"opt",r),f.bumpVerticalPos(L.stopy-f.getVerticalPos()),f.models.addLoop(L);break;case i.db.LINETYPE.ALT_START:st(S,y,r.boxMargin,r.boxMargin+r.boxTextMargin,A=>f.newLoop(A));break;case i.db.LINETYPE.ALT_ELSE:st(S,y,r.boxMargin+r.boxTextMargin,r.boxMargin,A=>f.addSectionToLoop(A));break;case i.db.LINETYPE.ALT_END:L=f.endLoop(),V.drawLoop(a,L,"alt",r),f.bumpVerticalPos(L.stopy-f.getVerticalPos()),f.models.addLoop(L);break;case i.db.LINETYPE.PAR_START:case i.db.LINETYPE.PAR_OVER_START:st(S,y,r.boxMargin,r.boxMargin+r.boxTextMargin,A=>f.newLoop(A)),f.saveVerticalPos();break;case i.db.LINETYPE.PAR_AND:st(S,y,r.boxMargin+r.boxTextMargin,r.boxMargin,A=>f.addSectionToLoop(A));break;case i.db.LINETYPE.PAR_END:L=f.endLoop(),V.drawLoop(a,L,"par",r),f.bumpVerticalPos(L.stopy-f.getVerticalPos()),f.models.addLoop(L);break;case i.db.LINETYPE.AUTONUMBER:W=y.message.start||W,K=y.message.step||K,y.message.visible?i.db.enableSequenceNumbers():i.db.disableSequenceNumbers();break;case i.db.LINETYPE.CRITICAL_START:st(S,y,r.boxMargin,r.boxMargin+r.boxTextMargin,A=>f.newLoop(A));break;case i.db.LINETYPE.CRITICAL_OPTION:st(S,y,r.boxMargin+r.boxTextMargin,r.boxMargin,A=>f.addSectionToLoop(A));break;case i.db.LINETYPE.CRITICAL_END:L=f.endLoop(),V.drawLoop(a,L,"critical",r),f.bumpVerticalPos(L.stopy-f.getVerticalPos()),f.models.addLoop(L);break;case i.db.LINETYPE.BREAK_START:st(S,y,r.boxMargin,r.boxMargin+r.boxTextMargin,A=>f.newLoop(A));break;case i.db.LINETYPE.BREAK_END:L=f.endLoop(),V.drawLoop(a,L,"break",r),f.bumpVerticalPos(L.stopy-f.getVerticalPos()),f.models.addLoop(L);break;default:try{et=y.msgModel,et.starty=f.getVerticalPos(),et.sequenceIndex=W,et.sequenceVisible=i.db.showSequenceNumbers();const A=D0(a,et);O0(y,et,A,v,x,E,u),Z.push({messageModel:et,lineStartY:A}),f.models.addMessage(et)}catch(A){U.error("error while drawing message",A)}}[i.db.LINETYPE.SOLID_OPEN,i.db.LINETYPE.DOTTED_OPEN,i.db.LINETYPE.SOLID,i.db.LINETYPE.DOTTED,i.db.LINETYPE.SOLID_CROSS,i.db.LINETYPE.DOTTED_CROSS,i.db.LINETYPE.SOLID_POINT,i.db.LINETYPE.DOTTED_POINT].includes(y.type)&&(W=W+K)}),U.debug("createdActors",E),U.debug("destroyedActors",u),Kt(a,x,b,!1),Z.forEach(y=>V0(a,y.messageModel,y.lineStartY,i)),r.mirrorActors&&Kt(a,x,b,!0),q.forEach(y=>V.drawBackgroundRect(a,y)),xe(a,x,b,r),f.models.boxes.forEach(function(y){y.height=f.getVerticalPos()-y.y,f.insert(y.x,y.y,y.x+y.width,y.height),y.startx=y.x,y.starty=y.y,y.stopx=y.startx+y.width,y.stopy=y.starty+y.height,y.stroke="rgb(0,0,0, 0.5)",V.drawBox(a,y,r)}),R&&f.bumpVerticalPos(r.boxMargin);const Y=Ee(a,x,b,p),{bounds:C}=f.getBounds();let G=C.stopy-C.starty;G<Y.maxHeight&&(G=Y.maxHeight);let z=G+2*r.diagramMarginY;r.mirrorActors&&(z=z-r.boxMargin+r.bottomMarginAdj);let X=C.stopx-C.startx;X<Y.maxWidth&&(X=Y.maxWidth);const Q=X+2*r.diagramMarginX;I&&a.append("text").text(I).attr("x",(C.stopx-C.startx)/2-2*r.diagramMarginX).attr("y",-25),Re(a,z,Q,r.useMaxWidth);const j=I?40:0;a.attr("viewBox",C.startx-r.diagramMarginX+" -"+(r.diagramMarginY+j)+" "+Q+" "+(z+j)),U.debug("models:",f.models)};function Y0(t,e,o){const i={};return e.forEach(function(s){if(t[s.to]&&t[s.from]){const n=t[s.to];if(s.placement===o.db.PLACEMENT.LEFTOF&&!n.prevActor||s.placement===o.db.PLACEMENT.RIGHTOF&&!n.nextActor)return;const c=s.placement!==void 0,h=!c,p=c?bt(r):Tt(r),a=s.wrap?O.wrapLabel(s.message,r.width-2*r.wrapPadding,p):s.message,E=O.calculateTextDimensions(a,p).width+2*r.wrapPadding;h&&s.from===n.nextActor?i[s.to]=w.getMax(i[s.to]||0,E):h&&s.from===n.prevActor?i[s.from]=w.getMax(i[s.from]||0,E):h&&s.from===s.to?(i[s.from]=w.getMax(i[s.from]||0,E/2),i[s.to]=w.getMax(i[s.to]||0,E/2)):s.placement===o.db.PLACEMENT.RIGHTOF?i[s.from]=w.getMax(i[s.from]||0,E):s.placement===o.db.PLACEMENT.LEFTOF?i[n.prevActor]=w.getMax(i[n.prevActor]||0,E):s.placement===o.db.PLACEMENT.OVER&&(n.prevActor&&(i[n.prevActor]=w.getMax(i[n.prevActor]||0,E/2)),n.nextActor&&(i[s.from]=w.getMax(i[s.from]||0,E/2)))}}),U.debug("maxMessageWidthPerActor:",i),i}const F0=function(t){let e=0;const o=Ut(r);for(const i in t.links){const n=O.calculateTextDimensions(i,o).width+2*r.wrapPadding+2*r.boxMargin;e<n&&(e=n)}return e};function W0(t,e,o){let i=0;Object.keys(t).forEach(n=>{const c=t[n];c.wrap&&(c.description=O.wrapLabel(c.description,r.width-2*r.wrapPadding,Ut(r)));const h=O.calculateTextDimensions(c.description,Ut(r));c.width=c.wrap?r.width:w.getMax(r.width,h.width+2*r.wrapPadding),c.height=c.wrap?w.getMax(h.height,r.height):r.height,i=w.getMax(i,c.height)});for(const n in e){const c=t[n];if(!c)continue;const h=t[c.nextActor];if(!h){const E=e[n]+r.actorMargin-c.width/2;c.margin=w.getMax(E,r.actorMargin);continue}const a=e[n]+r.actorMargin-c.width/2-h.width/2;c.margin=w.getMax(a,r.actorMargin)}let s=0;return o.forEach(n=>{const c=Tt(r);let h=n.actorKeys.reduce((x,E)=>x+=t[E].width+(t[E].margin||0),0);h-=2*r.boxTextMargin,n.wrap&&(n.name=O.wrapLabel(n.name,h-2*r.wrapPadding,c));const p=O.calculateTextDimensions(n.name,c);s=w.getMax(p.height,s);const a=w.getMax(h,p.width+2*r.wrapPadding);if(n.margin=r.boxTextMargin,h<a){const x=(a-h)/2;n.margin+=x}}),o.forEach(n=>n.textMaxHeight=s),w.getMax(i,r.height)}const q0=function(t,e,o){const i=e[t.from].x,s=e[t.to].x,n=t.wrap&&t.message;let c=O.calculateTextDimensions(n?O.wrapLabel(t.message,r.width,bt(r)):t.message,bt(r));const h={width:n?r.width:w.getMax(r.width,c.width+2*r.noteMargin),height:0,startx:e[t.from].x,stopx:0,starty:0,stopy:0,message:t.message};return t.placement===o.db.PLACEMENT.RIGHTOF?(h.width=n?w.getMax(r.width,c.width):w.getMax(e[t.from].width/2+e[t.to].width/2,c.width+2*r.noteMargin),h.startx=i+(e[t.from].width+r.actorMargin)/2):t.placement===o.db.PLACEMENT.LEFTOF?(h.width=n?w.getMax(r.width,c.width+2*r.noteMargin):w.getMax(e[t.from].width/2+e[t.to].width/2,c.width+2*r.noteMargin),h.startx=i-h.width+(e[t.from].width-r.actorMargin)/2):t.to===t.from?(c=O.calculateTextDimensions(n?O.wrapLabel(t.message,w.getMax(r.width,e[t.from].width),bt(r)):t.message,bt(r)),h.width=n?w.getMax(r.width,e[t.from].width):w.getMax(e[t.from].width,r.width,c.width+2*r.noteMargin),h.startx=i+(e[t.from].width-h.width)/2):(h.width=Math.abs(i+e[t.from].width/2-(s+e[t.to].width/2))+r.actorMargin,h.startx=i<s?i+e[t.from].width/2-r.actorMargin/2:s+e[t.to].width/2-r.actorMargin/2),n&&(h.message=O.wrapLabel(t.message,h.width-2*r.wrapPadding,bt(r))),U.debug(`NM:[${h.startx},${h.stopx},${h.starty},${h.stopy}:${h.width},${h.height}=${t.message}]`),h},z0=function(t,e,o){if(![o.db.LINETYPE.SOLID_OPEN,o.db.LINETYPE.DOTTED_OPEN,o.db.LINETYPE.SOLID,o.db.LINETYPE.DOTTED,o.db.LINETYPE.SOLID_CROSS,o.db.LINETYPE.DOTTED_CROSS,o.db.LINETYPE.SOLID_POINT,o.db.LINETYPE.DOTTED_POINT].includes(t.type))return{};const[i,s]=ne(t.from,e),[n,c]=ne(t.to,e),h=i<=n,p=h?s:i;let a=h?n:c;const x=Math.abs(n-c)>2,E=P=>h?-P:P;t.from===t.to?a=p:(t.activate&&!x&&(a+=E(r.activationWidth/2-1)),[o.db.LINETYPE.SOLID_OPEN,o.db.LINETYPE.DOTTED_OPEN].includes(t.type)||(a+=E(3)));const u=[i,s,n,c],g=Math.abs(p-a);t.wrap&&t.message&&(t.message=O.wrapLabel(t.message,w.getMax(g+2*r.wrapPadding,r.width),Tt(r)));const b=O.calculateTextDimensions(t.message,Tt(r));return{width:w.getMax(t.wrap?0:b.width+2*r.wrapPadding,g+2*r.wrapPadding,r.width),height:0,startx:p,stopx:a,starty:0,stopy:0,message:t.message,type:t.type,wrap:t.wrap,fromBounds:Math.min.apply(null,u),toBounds:Math.max.apply(null,u)}},H0=function(t,e,o,i){const s={},n=[];let c,h,p;return t.forEach(function(a){switch(a.id=O.random({length:10}),a.type){case i.db.LINETYPE.LOOP_START:case i.db.LINETYPE.ALT_START:case i.db.LINETYPE.OPT_START:case i.db.LINETYPE.PAR_START:case i.db.LINETYPE.PAR_OVER_START:case i.db.LINETYPE.CRITICAL_START:case i.db.LINETYPE.BREAK_START:n.push({id:a.id,msg:a.message,from:Number.MAX_SAFE_INTEGER,to:Number.MIN_SAFE_INTEGER,width:0});break;case i.db.LINETYPE.ALT_ELSE:case i.db.LINETYPE.PAR_AND:case i.db.LINETYPE.CRITICAL_OPTION:a.message&&(c=n.pop(),s[c.id]=c,s[a.id]=c,n.push(c));break;case i.db.LINETYPE.LOOP_END:case i.db.LINETYPE.ALT_END:case i.db.LINETYPE.OPT_END:case i.db.LINETYPE.PAR_END:case i.db.LINETYPE.CRITICAL_END:case i.db.LINETYPE.BREAK_END:c=n.pop(),s[c.id]=c;break;case i.db.LINETYPE.ACTIVE_START:{const E=e[a.from?a.from.actor:a.to.actor],u=Vt(a.from?a.from.actor:a.to.actor).length,g=E.x+E.width/2+(u-1)*r.activationWidth/2,b={startx:g,stopx:g+r.activationWidth,actor:a.from.actor,enabled:!0};f.activations.push(b)}break;case i.db.LINETYPE.ACTIVE_END:{const E=f.activations.map(u=>u.actor).lastIndexOf(a.from.actor);delete f.activations.splice(E,1)[0]}break}a.placement!==void 0?(h=q0(a,e,i),a.noteModel=h,n.forEach(E=>{c=E,c.from=w.getMin(c.from,h.startx),c.to=w.getMax(c.to,h.startx+h.width),c.width=w.getMax(c.width,Math.abs(c.from-c.to))-r.labelBoxWidth})):(p=z0(a,e,i),a.msgModel=p,p.startx&&p.stopx&&n.length>0&&n.forEach(E=>{if(c=E,p.startx===p.stopx){const u=e[a.from],g=e[a.to];c.from=w.getMin(u.x-p.width/2,u.x-u.width/2,c.from),c.to=w.getMax(g.x+p.width/2,g.x+u.width/2,c.to),c.width=w.getMax(c.width,Math.abs(c.to-c.from))-r.labelBoxWidth}else c.from=w.getMin(p.startx,c.from),c.to=w.getMax(p.stopx,c.to),c.width=w.getMax(c.width,p.width)-r.labelBoxWidth}))}),f.activations=[],U.debug("Loop type widths:",s),s},U0={bounds:f,drawActors:Kt,drawActorsPopup:Ee,setConf:be,draw:B0},X0={parser:Fe,db:se,renderer:U0,styles:d0,init:({wrap:t})=>{se.setWrap(t)}};export{X0 as diagram};
@@ -1 +0,0 @@
1
- import{p as P,d as N,s as W}from"./styles-9c745c82-cef936a6.js";import{c as t,h as H,l as b,i as R,j as T,F as v,z as U}from"./index-e793d777.js";import{G as C,l as F}from"./layout-498807d8.js";import{l as $}from"./line-eeccc4e2.js";import"./array-9f3ba611.js";import"./path-53f90ab3.js";const O=e=>e.append("circle").attr("class","start-state").attr("r",t().state.sizeUnit).attr("cx",t().state.padding+t().state.sizeUnit).attr("cy",t().state.padding+t().state.sizeUnit),X=e=>e.append("line").style("stroke","grey").style("stroke-dasharray","3").attr("x1",t().state.textHeight).attr("class","divider").attr("x2",t().state.textHeight*2).attr("y1",0).attr("y2",0),J=(e,i)=>{const o=e.append("text").attr("x",2*t().state.padding).attr("y",t().state.textHeight+2*t().state.padding).attr("font-size",t().state.fontSize).attr("class","state-title").text(i.id),c=o.node().getBBox();return e.insert("rect",":first-child").attr("x",t().state.padding).attr("y",t().state.padding).attr("width",c.width+2*t().state.padding).attr("height",c.height+2*t().state.padding).attr("rx",t().state.radius),o},Y=(e,i)=>{const o=function(l,m,w){const E=l.append("tspan").attr("x",2*t().state.padding).text(m);w||E.attr("dy",t().state.textHeight)},s=e.append("text").attr("x",2*t().state.padding).attr("y",t().state.textHeight+1.3*t().state.padding).attr("font-size",t().state.fontSize).attr("class","state-title").text(i.descriptions[0]).node().getBBox(),g=s.height,p=e.append("text").attr("x",t().state.padding).attr("y",g+t().state.padding*.4+t().state.dividerMargin+t().state.textHeight).attr("class","state-description");let a=!0,r=!0;i.descriptions.forEach(function(l){a||(o(p,l,r),r=!1),a=!1});const y=e.append("line").attr("x1",t().state.padding).attr("y1",t().state.padding+g+t().state.dividerMargin/2).attr("y2",t().state.padding+g+t().state.dividerMargin/2).attr("class","descr-divider"),x=p.node().getBBox(),d=Math.max(x.width,s.width);return y.attr("x2",d+3*t().state.padding),e.insert("rect",":first-child").attr("x",t().state.padding).attr("y",t().state.padding).attr("width",d+2*t().state.padding).attr("height",x.height+g+2*t().state.padding).attr("rx",t().state.radius),e},I=(e,i,o)=>{const c=t().state.padding,s=2*t().state.padding,g=e.node().getBBox(),p=g.width,a=g.x,r=e.append("text").attr("x",0).attr("y",t().state.titleShift).attr("font-size",t().state.fontSize).attr("class","state-title").text(i.id),x=r.node().getBBox().width+s;let d=Math.max(x,p);d===p&&(d=d+s);let l;const m=e.node().getBBox();i.doc,l=a-c,x>p&&(l=(p-d)/2+c),Math.abs(a-m.x)<c&&x>p&&(l=a-(x-p)/2);const w=1-t().state.textHeight;return e.insert("rect",":first-child").attr("x",l).attr("y",w).attr("class",o?"alt-composit":"composit").attr("width",d).attr("height",m.height+t().state.textHeight+t().state.titleShift+1).attr("rx","0"),r.attr("x",l+c),x<=p&&r.attr("x",a+(d-s)/2-x/2+c),e.insert("rect",":first-child").attr("x",l).attr("y",t().state.titleShift-t().state.textHeight-t().state.padding).attr("width",d).attr("height",t().state.textHeight*3).attr("rx",t().state.radius),e.insert("rect",":first-child").attr("x",l).attr("y",t().state.titleShift-t().state.textHeight-t().state.padding).attr("width",d).attr("height",m.height+3+2*t().state.textHeight).attr("rx",t().state.radius),e},_=e=>(e.append("circle").attr("class","end-state-outer").attr("r",t().state.sizeUnit+t().state.miniPadding).attr("cx",t().state.padding+t().state.sizeUnit+t().state.miniPadding).attr("cy",t().state.padding+t().state.sizeUnit+t().state.miniPadding),e.append("circle").attr("class","end-state-inner").attr("r",t().state.sizeUnit).attr("cx",t().state.padding+t().state.sizeUnit+2).attr("cy",t().state.padding+t().state.sizeUnit+2)),q=(e,i)=>{let o=t().state.forkWidth,c=t().state.forkHeight;if(i.parentId){let s=o;o=c,c=s}return e.append("rect").style("stroke","black").style("fill","black").attr("width",o).attr("height",c).attr("x",t().state.padding).attr("y",t().state.padding)},Z=(e,i,o,c)=>{let s=0;const g=c.append("text");g.style("text-anchor","start"),g.attr("class","noteText");let p=e.replace(/\r\n/g,"<br/>");p=p.replace(/\n/g,"<br/>");const a=p.split(T.lineBreakRegex);let r=1.25*t().state.noteMargin;for(const y of a){const x=y.trim();if(x.length>0){const d=g.append("tspan");if(d.text(x),r===0){const l=d.node().getBBox();r+=l.height}s+=r,d.attr("x",i+t().state.noteMargin),d.attr("y",o+s+1.25*t().state.noteMargin)}}return{textWidth:g.node().getBBox().width,textHeight:s}},j=(e,i)=>{i.attr("class","state-note");const o=i.append("rect").attr("x",0).attr("y",t().state.padding),c=i.append("g"),{textWidth:s,textHeight:g}=Z(e,0,0,c);return o.attr("height",g+2*t().state.noteMargin),o.attr("width",s+t().state.noteMargin*2),o},L=function(e,i){const o=i.id,c={id:o,label:i.id,width:0,height:0},s=e.append("g").attr("id",o).attr("class","stateGroup");i.type==="start"&&O(s),i.type==="end"&&_(s),(i.type==="fork"||i.type==="join")&&q(s,i),i.type==="note"&&j(i.note.text,s),i.type==="divider"&&X(s),i.type==="default"&&i.descriptions.length===0&&J(s,i),i.type==="default"&&i.descriptions.length>0&&Y(s,i);const g=s.node().getBBox();return c.width=g.width+2*t().state.padding,c.height=g.height+2*t().state.padding,c};let G=0;const K=function(e,i,o){const c=function(r){switch(r){case N.relationType.AGGREGATION:return"aggregation";case N.relationType.EXTENSION:return"extension";case N.relationType.COMPOSITION:return"composition";case N.relationType.DEPENDENCY:return"dependency"}};i.points=i.points.filter(r=>!Number.isNaN(r.y));const s=i.points,g=$().x(function(r){return r.x}).y(function(r){return r.y}).curve(v),p=e.append("path").attr("d",g(s)).attr("id","edge"+G).attr("class","transition");let a="";if(t().state.arrowMarkerAbsolute&&(a=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,a=a.replace(/\(/g,"\\("),a=a.replace(/\)/g,"\\)")),p.attr("marker-end","url("+a+"#"+c(N.relationType.DEPENDENCY)+"End)"),o.title!==void 0){const r=e.append("g").attr("class","stateLabel"),{x:y,y:x}=U.calcLabelPosition(i.points),d=T.getRows(o.title);let l=0;const m=[];let w=0,E=0;for(let u=0;u<=d.length;u++){const h=r.append("text").attr("text-anchor","middle").text(d[u]).attr("x",y).attr("y",x+l),f=h.node().getBBox();w=Math.max(w,f.width),E=Math.min(E,f.x),b.info(f.x,y,x+l),l===0&&(l=h.node().getBBox().height,b.info("Title height",l,x)),m.push(h)}let k=l*d.length;if(d.length>1){const u=(d.length-1)*l*.5;m.forEach((h,f)=>h.attr("y",x+f*l-u)),k=l*d.length}const n=r.node().getBBox();r.insert("rect",":first-child").attr("class","box").attr("x",y-w/2-t().state.padding/2).attr("y",x-k/2-t().state.padding/2-3.5).attr("width",w+t().state.padding).attr("height",k+t().state.padding),b.info(n)}G++};let B;const z={},Q=function(){},V=function(e){e.append("defs").append("marker").attr("id","dependencyEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},D=function(e,i,o,c){B=t().state;const s=t().securityLevel;let g;s==="sandbox"&&(g=H("#i"+i));const p=s==="sandbox"?H(g.nodes()[0].contentDocument.body):H("body"),a=s==="sandbox"?g.nodes()[0].contentDocument:document;b.debug("Rendering diagram "+e);const r=p.select(`[id='${i}']`);V(r);const y=c.db.getRootDoc();A(y,r,void 0,!1,p,a,c);const x=B.padding,d=r.node().getBBox(),l=d.width+x*2,m=d.height+x*2,w=l*1.75;R(r,m,w,B.useMaxWidth),r.attr("viewBox",`${d.x-B.padding} ${d.y-B.padding} `+l+" "+m)},tt=e=>e?e.length*B.fontSizeFactor:1,A=(e,i,o,c,s,g,p)=>{const a=new C({compound:!0,multigraph:!0});let r,y=!0;for(r=0;r<e.length;r++)if(e[r].stmt==="relation"){y=!1;break}o?a.setGraph({rankdir:"LR",multigraph:!0,compound:!0,ranker:"tight-tree",ranksep:y?1:B.edgeLengthFactor,nodeSep:y?1:50,isMultiGraph:!0}):a.setGraph({rankdir:"TB",multigraph:!0,compound:!0,ranksep:y?1:B.edgeLengthFactor,nodeSep:y?1:50,ranker:"tight-tree",isMultiGraph:!0}),a.setDefaultEdgeLabel(function(){return{}}),p.db.extract(e);const x=p.db.getStates(),d=p.db.getRelations(),l=Object.keys(x);for(const n of l){const u=x[n];o&&(u.parentId=o);let h;if(u.doc){let f=i.append("g").attr("id",u.id).attr("class","stateGroup");h=A(u.doc,f,u.id,!c,s,g,p);{f=I(f,u,c);let S=f.node().getBBox();h.width=S.width,h.height=S.height+B.padding/2,z[u.id]={y:B.compositTitleSize}}}else h=L(i,u);if(u.note){const f={descriptions:[],id:u.id+"-note",note:u.note,type:"note"},S=L(i,f);u.note.position==="left of"?(a.setNode(h.id+"-note",S),a.setNode(h.id,h)):(a.setNode(h.id,h),a.setNode(h.id+"-note",S)),a.setParent(h.id,h.id+"-group"),a.setParent(h.id+"-note",h.id+"-group")}else a.setNode(h.id,h)}b.debug("Count=",a.nodeCount(),a);let m=0;d.forEach(function(n){m++,b.debug("Setting edge",n),a.setEdge(n.id1,n.id2,{relation:n,width:tt(n.title),height:B.labelHeight*T.getRows(n.title).length,labelpos:"c"},"id"+m)}),F(a),b.debug("Graph after layout",a.nodes());const w=i.node();a.nodes().forEach(function(n){n!==void 0&&a.node(n)!==void 0?(b.warn("Node "+n+": "+JSON.stringify(a.node(n))),s.select("#"+w.id+" #"+n).attr("transform","translate("+(a.node(n).x-a.node(n).width/2)+","+(a.node(n).y+(z[n]?z[n].y:0)-a.node(n).height/2)+" )"),s.select("#"+w.id+" #"+n).attr("data-x-shift",a.node(n).x-a.node(n).width/2),g.querySelectorAll("#"+w.id+" #"+n+" .divider").forEach(h=>{const f=h.parentElement;let S=0,M=0;f&&(f.parentElement&&(S=f.parentElement.getBBox().width),M=parseInt(f.getAttribute("data-x-shift"),10),Number.isNaN(M)&&(M=0)),h.setAttribute("x1",0-M+8),h.setAttribute("x2",S-M-8)})):b.debug("No Node "+n+": "+JSON.stringify(a.node(n)))});let E=w.getBBox();a.edges().forEach(function(n){n!==void 0&&a.edge(n)!==void 0&&(b.debug("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(a.edge(n))),K(i,a.edge(n),a.edge(n).relation))}),E=w.getBBox();const k={id:o||"root",label:o||"root",width:0,height:0};return k.width=E.width+2*B.padding,k.height=E.height+2*B.padding,b.debug("Doc rendered",k,a),k},et={setConf:Q,draw:D},dt={parser:P,db:N,renderer:et,styles:W,init:e=>{e.state||(e.state={}),e.state.arrowMarkerAbsolute=e.arrowMarkerAbsolute,N.clear()}};export{dt as diagram};
@@ -1 +0,0 @@
1
- import{p as J,d as B,s as Q,D as H,a as X,S as Z,b as F,c as I}from"./styles-9c745c82-cef936a6.js";import{G as tt}from"./layout-498807d8.js";import{l as E,c as g,h as x,z as et,i as ot,j as w}from"./index-e793d777.js";import{r as st}from"./index-2c4b9a3b-e6f2af62.js";import"./edges-f2ad444c-4fc48c3e.js";import"./createText-62fc7601-89c73b31.js";import"./line-eeccc4e2.js";import"./array-9f3ba611.js";import"./path-53f90ab3.js";const h="rect",C="rectWithTitle",nt="start",ct="end",it="divider",rt="roundedWithTitle",lt="note",at="noteGroup",_="statediagram",dt="state",Et=`${_}-${dt}`,U="transition",St="note",Tt="note-edge",pt=`${U} ${Tt}`,_t=`${_}-${St}`,ut="cluster",Dt=`${_}-${ut}`,bt="cluster-alt",ft=`${_}-${bt}`,V="parent",Y="note",At="state",N="----",ht=`${N}${Y}`,M=`${N}${V}`,z="fill:none",W="fill: #333",m="c",j="text",q="normal";let y={},d=0;const yt=function(t){const n=Object.keys(t);for(const e of n)t[e]},gt=function(t,n){return n.db.extract(n.db.getRootDocV2()),n.db.getClasses()};function $t(t){return t==null?"":t.classes?t.classes.join(" "):""}function R(t="",n=0,e="",c=N){const i=e!==null&&e.length>0?`${c}${e}`:"";return`${At}-${t}${i}-${n}`}const A=(t,n,e,c,i,r)=>{const o=e.id,u=$t(c[o]);if(o!=="root"){let T=h;e.start===!0&&(T=nt),e.start===!1&&(T=ct),e.type!==H&&(T=e.type),y[o]||(y[o]={id:o,shape:T,description:w.sanitizeText(o,g()),classes:`${u} ${Et}`});const s=y[o];e.description&&(Array.isArray(s.description)?(s.shape=C,s.description.push(e.description)):s.description.length>0?(s.shape=C,s.description===o?s.description=[e.description]:s.description=[s.description,e.description]):(s.shape=h,s.description=e.description),s.description=w.sanitizeTextOrArray(s.description,g())),s.description.length===1&&s.shape===C&&(s.shape=h),!s.type&&e.doc&&(E.info("Setting cluster for ",o,G(e)),s.type="group",s.dir=G(e),s.shape=e.type===X?it:rt,s.classes=s.classes+" "+Dt+" "+(r?ft:""));const p={labelStyle:"",shape:s.shape,labelText:s.description,classes:s.classes,style:"",id:o,dir:s.dir,domId:R(o,d),type:s.type,padding:15};if(p.centerLabel=!0,e.note){const l={labelStyle:"",shape:lt,labelText:e.note.text,classes:_t,style:"",id:o+ht+"-"+d,domId:R(o,d,Y),type:s.type,padding:15},a={labelStyle:"",shape:at,labelText:e.note.text,classes:s.classes,style:"",id:o+M,domId:R(o,d,V),type:"group",padding:0};d++;const D=o+M;t.setNode(D,a),t.setNode(l.id,l),t.setNode(o,p),t.setParent(o,D),t.setParent(l.id,D);let S=o,b=l.id;e.note.position==="left of"&&(S=l.id,b=o),t.setEdge(S,b,{arrowhead:"none",arrowType:"",style:z,labelStyle:"",classes:pt,arrowheadStyle:W,labelpos:m,labelType:j,thickness:q})}else t.setNode(o,p)}n&&n.id!=="root"&&(E.trace("Setting node ",o," to be child of its parent ",n.id),t.setParent(o,n.id)),e.doc&&(E.trace("Adding nodes children "),xt(t,e,e.doc,c,i,!r))},xt=(t,n,e,c,i,r)=>{E.trace("items",e),e.forEach(o=>{switch(o.stmt){case F:A(t,n,o,c,i,r);break;case H:A(t,n,o,c,i,r);break;case Z:{A(t,n,o.state1,c,i,r),A(t,n,o.state2,c,i,r);const u={id:"edge"+d,arrowhead:"normal",arrowTypeEnd:"arrow_barb",style:z,labelStyle:"",label:w.sanitizeText(o.description,g()),arrowheadStyle:W,labelpos:m,labelType:j,thickness:q,classes:U};t.setEdge(o.state1.id,o.state2.id,u,d),d++}break}})},G=(t,n=I)=>{let e=n;if(t.doc)for(let c=0;c<t.doc.length;c++){const i=t.doc[c];i.stmt==="dir"&&(e=i.value)}return e},Ct=async function(t,n,e,c){E.info("Drawing state diagram (v2)",n),y={},c.db.getDirection();const{securityLevel:i,state:r}=g(),o=r.nodeSpacing||50,u=r.rankSpacing||50;E.info(c.db.getRootDocV2()),c.db.extract(c.db.getRootDocV2()),E.info(c.db.getRootDocV2());const T=c.db.getStates(),s=new tt({multigraph:!0,compound:!0}).setGraph({rankdir:G(c.db.getRootDocV2()),nodesep:o,ranksep:u,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});A(s,void 0,c.db.getRootDocV2(),T,c.db,!0);let p;i==="sandbox"&&(p=x("#i"+n));const l=i==="sandbox"?x(p.nodes()[0].contentDocument.body):x("body"),a=l.select(`[id="${n}"]`),D=l.select("#"+n+" g");await st(D,s,["barb"],_,n);const S=8;et.insertTitle(a,"statediagramTitleText",r.titleTopMargin,c.db.getDiagramTitle());const b=a.node().getBBox(),L=b.width+S*2,P=b.height+S*2;a.attr("class",_);const O=a.node().getBBox();ot(a,P,L,r.useMaxWidth);const k=`${O.x-S} ${O.y-S} ${L} ${P}`;E.debug(`viewBox ${k}`),a.attr("viewBox",k);const K=document.querySelectorAll('[id="'+n+'"] .edgeLabel .label');for(const $ of K){const v=$.getBBox(),f=document.createElementNS("http://www.w3.org/2000/svg",h);f.setAttribute("rx",0),f.setAttribute("ry",0),f.setAttribute("width",v.width),f.setAttribute("height",v.height),$.insertBefore(f,$.firstChild)}},Rt={setConf:yt,getClasses:gt,draw:Ct},Mt={parser:J,db:B,renderer:Rt,styles:Q,init:t=>{t.state||(t.state={}),t.state.arrowMarkerAbsolute=t.arrowMarkerAbsolute,B.clear()}};export{Mt as diagram};
@@ -1,110 +0,0 @@
1
- import{G as V}from"./layout-498807d8.js";import{S as D,u as M,v as R,_ as F,C as j,x as U,y as H,o as A,l as y,p as W,c as C,j as z,q as $,n as E,h as _,z as X,r as J,A as K}from"./index-e793d777.js";import{r as Q}from"./index-2c4b9a3b-e6f2af62.js";function Y(e){return typeof e=="string"?new D([document.querySelectorAll(e)],[document.documentElement]):new D([R(e)],M)}const Z=(e,l)=>F.lang.round(j.parse(e)[l]),O=Z;function be(e,l){return!!e.children(l).length}function fe(e){return L(e.v)+":"+L(e.w)+":"+L(e.name)}var ee=/:/g;function L(e){return e?String(e).replace(ee,"\\:"):""}function te(e,l){l&&e.attr("style",l)}function ue(e,l,c){l&&e.attr("class",l).attr("class",c+" "+e.attr("class"))}function we(e,l){var c=l.graph();if(U(c)){var a=c.transition;if(H(a))return a(e)}return e}function re(e,l){var c=e.append("foreignObject").attr("width","100000"),a=c.append("xhtml:div");a.attr("xmlns","http://www.w3.org/1999/xhtml");var i=l.label;switch(typeof i){case"function":a.insert(i);break;case"object":a.insert(function(){return i});break;default:a.html(i)}te(a,l.labelStyle),a.style("display","inline-block"),a.style("white-space","nowrap");var d=a.node().getBoundingClientRect();return c.attr("width",d.width).attr("height",d.height),c}const G={},le=function(e){const l=Object.keys(e);for(const c of l)G[c]=e[c]},q=function(e,l,c,a,i,d){const u=a.select(`[id="${c}"]`);Object.keys(e).forEach(function(p){const r=e[p];let g="default";r.classes.length>0&&(g=r.classes.join(" ")),g=g+" flowchart-label";const w=A(r.styles);let t=r.text!==void 0?r.text:r.id,s;if(y.info("vertex",r,r.labelType),r.labelType==="markdown")y.info("vertex",r,r.labelType);else if(W(C().flowchart.htmlLabels)){const m={label:t.replace(/fa[blrs]?:fa-[\w-]+/g,k=>`<i class='${k.replace(":"," ")}'></i>`)};s=re(u,m).node(),s.parentNode.removeChild(s)}else{const m=i.createElementNS("http://www.w3.org/2000/svg","text");m.setAttribute("style",w.labelStyle.replace("color:","fill:"));const k=t.split(z.lineBreakRegex);for(const T of k){const v=i.createElementNS("http://www.w3.org/2000/svg","tspan");v.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),v.setAttribute("dy","1em"),v.setAttribute("x","1"),v.textContent=T,m.appendChild(v)}s=m}let b=0,o="";switch(r.type){case"round":b=5,o="rect";break;case"square":o="rect";break;case"diamond":o="question";break;case"hexagon":o="hexagon";break;case"odd":o="rect_left_inv_arrow";break;case"lean_right":o="lean_right";break;case"lean_left":o="lean_left";break;case"trapezoid":o="trapezoid";break;case"inv_trapezoid":o="inv_trapezoid";break;case"odd_right":o="rect_left_inv_arrow";break;case"circle":o="circle";break;case"ellipse":o="ellipse";break;case"stadium":o="stadium";break;case"subroutine":o="subroutine";break;case"cylinder":o="cylinder";break;case"group":o="rect";break;case"doublecircle":o="doublecircle";break;default:o="rect"}l.setNode(r.id,{labelStyle:w.labelStyle,shape:o,labelText:t,labelType:r.labelType,rx:b,ry:b,class:g,style:w.style,id:r.id,link:r.link,linkTarget:r.linkTarget,tooltip:d.db.getTooltip(r.id)||"",domId:d.db.lookUpDomId(r.id),haveCallback:r.haveCallback,width:r.type==="group"?500:void 0,dir:r.dir,type:r.type,props:r.props,padding:C().flowchart.padding}),y.info("setNode",{labelStyle:w.labelStyle,labelType:r.labelType,shape:o,labelText:t,rx:b,ry:b,class:g,style:w.style,id:r.id,domId:d.db.lookUpDomId(r.id),width:r.type==="group"?500:void 0,type:r.type,dir:r.dir,props:r.props,padding:C().flowchart.padding})})},P=function(e,l,c){y.info("abc78 edges = ",e);let a=0,i={},d,u;if(e.defaultStyle!==void 0){const n=A(e.defaultStyle);d=n.style,u=n.labelStyle}e.forEach(function(n){a++;const p="L-"+n.start+"-"+n.end;i[p]===void 0?(i[p]=0,y.info("abc78 new entry",p,i[p])):(i[p]++,y.info("abc78 new entry",p,i[p]));let r=p+"-"+i[p];y.info("abc78 new link id to be used is",p,r,i[p]);const g="LS-"+n.start,w="LE-"+n.end,t={style:"",labelStyle:""};switch(t.minlen=n.length||1,n.type==="arrow_open"?t.arrowhead="none":t.arrowhead="normal",t.arrowTypeStart="arrow_open",t.arrowTypeEnd="arrow_open",n.type){case"double_arrow_cross":t.arrowTypeStart="arrow_cross";case"arrow_cross":t.arrowTypeEnd="arrow_cross";break;case"double_arrow_point":t.arrowTypeStart="arrow_point";case"arrow_point":t.arrowTypeEnd="arrow_point";break;case"double_arrow_circle":t.arrowTypeStart="arrow_circle";case"arrow_circle":t.arrowTypeEnd="arrow_circle";break}let s="",b="";switch(n.stroke){case"normal":s="fill:none;",d!==void 0&&(s=d),u!==void 0&&(b=u),t.thickness="normal",t.pattern="solid";break;case"dotted":t.thickness="normal",t.pattern="dotted",t.style="fill:none;stroke-width:2px;stroke-dasharray:3;";break;case"thick":t.thickness="thick",t.pattern="solid",t.style="stroke-width: 3.5px;fill:none;";break;case"invisible":t.thickness="invisible",t.pattern="solid",t.style="stroke-width: 0;fill:none;";break}if(n.style!==void 0){const o=A(n.style);s=o.style,b=o.labelStyle}t.style=t.style+=s,t.labelStyle=t.labelStyle+=b,n.interpolate!==void 0?t.curve=$(n.interpolate,E):e.defaultInterpolate!==void 0?t.curve=$(e.defaultInterpolate,E):t.curve=$(G.curve,E),n.text===void 0?n.style!==void 0&&(t.arrowheadStyle="fill: #333"):(t.arrowheadStyle="fill: #333",t.labelpos="c"),t.labelType=n.labelType,t.label=n.text.replace(z.lineBreakRegex,`
2
- `),n.style===void 0&&(t.style=t.style||"stroke: #333; stroke-width: 1.5px;fill:none;"),t.labelStyle=t.labelStyle.replace("color:","fill:"),t.id=r,t.classes="flowchart-link "+g+" "+w,l.setEdge(n.start,n.end,t,a)})},ae=function(e,l){return l.db.getClasses()},oe=async function(e,l,c,a){y.info("Drawing flowchart");let i=a.db.getDirection();i===void 0&&(i="TD");const{securityLevel:d,flowchart:u}=C(),n=u.nodeSpacing||50,p=u.rankSpacing||50;let r;d==="sandbox"&&(r=_("#i"+l));const g=d==="sandbox"?_(r.nodes()[0].contentDocument.body):_("body"),w=d==="sandbox"?r.nodes()[0].contentDocument:document,t=new V({multigraph:!0,compound:!0}).setGraph({rankdir:i,nodesep:n,ranksep:p,marginx:0,marginy:0}).setDefaultEdgeLabel(function(){return{}});let s;const b=a.db.getSubGraphs();y.info("Subgraphs - ",b);for(let f=b.length-1;f>=0;f--)s=b[f],y.info("Subgraph - ",s),a.db.addVertex(s.id,{text:s.title,type:s.labelType},"group",void 0,s.classes,s.dir);const o=a.db.getVertices(),m=a.db.getEdges();y.info("Edges",m);let k=0;for(k=b.length-1;k>=0;k--){s=b[k],Y("cluster").append("text");for(let f=0;f<s.nodes.length;f++)y.info("Setting up subgraphs",s.nodes[f],s.id),t.setParent(s.nodes[f],s.id)}q(o,t,l,g,w,a),P(m,t);const T=g.select(`[id="${l}"]`),v=g.select("#"+l+" g");if(await Q(v,t,["point","circle","cross"],"flowchart",l),X.insertTitle(T,"flowchartTitleText",u.titleTopMargin,a.db.getDiagramTitle()),J(t,T,u.diagramPadding,u.useMaxWidth),a.db.indexNodes("subGraph"+k),!u.htmlLabels){const f=w.querySelectorAll('[id="'+l+'"] .edgeLabel .label');for(const x of f){const S=x.getBBox(),h=w.createElementNS("http://www.w3.org/2000/svg","rect");h.setAttribute("rx",0),h.setAttribute("ry",0),h.setAttribute("width",S.width),h.setAttribute("height",S.height),x.insertBefore(h,x.firstChild)}}Object.keys(o).forEach(function(f){const x=o[f];if(x.link){const S=_("#"+l+' [id="'+f+'"]');if(S){const h=w.createElementNS("http://www.w3.org/2000/svg","a");h.setAttributeNS("http://www.w3.org/2000/svg","class",x.classes.join(" ")),h.setAttributeNS("http://www.w3.org/2000/svg","href",x.link),h.setAttributeNS("http://www.w3.org/2000/svg","rel","noopener"),d==="sandbox"?h.setAttributeNS("http://www.w3.org/2000/svg","target","_top"):x.linkTarget&&h.setAttributeNS("http://www.w3.org/2000/svg","target",x.linkTarget);const N=S.insert(function(){return h},":first-child"),B=S.select(".label-container");B&&N.append(function(){return B.node()});const I=S.select(".label");I&&N.append(function(){return I.node()})}}})},he={setConf:le,addVertices:q,addEdges:P,getClasses:ae,draw:oe},ne=(e,l)=>{const c=O,a=c(e,"r"),i=c(e,"g"),d=c(e,"b");return K(a,i,d,l)},se=e=>`.label {
3
- font-family: ${e.fontFamily};
4
- color: ${e.nodeTextColor||e.textColor};
5
- }
6
- .cluster-label text {
7
- fill: ${e.titleColor};
8
- }
9
- .cluster-label span,p {
10
- color: ${e.titleColor};
11
- }
12
-
13
- .label text,span,p {
14
- fill: ${e.nodeTextColor||e.textColor};
15
- color: ${e.nodeTextColor||e.textColor};
16
- }
17
-
18
- .node rect,
19
- .node circle,
20
- .node ellipse,
21
- .node polygon,
22
- .node path {
23
- fill: ${e.mainBkg};
24
- stroke: ${e.nodeBorder};
25
- stroke-width: 1px;
26
- }
27
- .flowchart-label text {
28
- text-anchor: middle;
29
- }
30
- // .flowchart-label .text-outer-tspan {
31
- // text-anchor: middle;
32
- // }
33
- // .flowchart-label .text-inner-tspan {
34
- // text-anchor: start;
35
- // }
36
-
37
- .node .label {
38
- text-align: center;
39
- }
40
- .node.clickable {
41
- cursor: pointer;
42
- }
43
-
44
- .arrowheadPath {
45
- fill: ${e.arrowheadColor};
46
- }
47
-
48
- .edgePath .path {
49
- stroke: ${e.lineColor};
50
- stroke-width: 2.0px;
51
- }
52
-
53
- .flowchart-link {
54
- stroke: ${e.lineColor};
55
- fill: none;
56
- }
57
-
58
- .edgeLabel {
59
- background-color: ${e.edgeLabelBackground};
60
- rect {
61
- opacity: 0.5;
62
- background-color: ${e.edgeLabelBackground};
63
- fill: ${e.edgeLabelBackground};
64
- }
65
- text-align: center;
66
- }
67
-
68
- /* For html labels only */
69
- .labelBkg {
70
- background-color: ${ne(e.edgeLabelBackground,.5)};
71
- // background-color:
72
- }
73
-
74
- .cluster rect {
75
- fill: ${e.clusterBkg};
76
- stroke: ${e.clusterBorder};
77
- stroke-width: 1px;
78
- }
79
-
80
- .cluster text {
81
- fill: ${e.titleColor};
82
- }
83
-
84
- .cluster span,p {
85
- color: ${e.titleColor};
86
- }
87
- /* .cluster div {
88
- color: ${e.titleColor};
89
- } */
90
-
91
- div.mermaidTooltip {
92
- position: absolute;
93
- text-align: center;
94
- max-width: 200px;
95
- padding: 2px;
96
- font-family: ${e.fontFamily};
97
- font-size: 12px;
98
- background: ${e.tertiaryColor};
99
- border: 1px solid ${e.border2};
100
- border-radius: 2px;
101
- pointer-events: none;
102
- z-index: 100;
103
- }
104
-
105
- .flowchartTitleText {
106
- text-anchor: middle;
107
- font-size: 18px;
108
- fill: ${e.textColor};
109
- }
110
- `,ye=se;export{te as a,re as b,we as c,ue as d,fe as e,he as f,ye as g,be as i,Y as s};