@lancc/cmark 1.2.0 → 1.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (127) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/LICENSE +21 -21
  3. package/README.md +47 -107
  4. package/assets/abnfDiagram-WEYOIA3C-CKV_7Upb.js +1 -0
  5. package/assets/architectureDiagram-ZHVYKT53-BvLudDvk.js +1 -0
  6. package/assets/blockDiagram-RJAE7QA3--gzkMGi2.js +1 -0
  7. package/assets/c4Diagram-XDPPPE54-ByfRiJGR.js +1 -0
  8. package/assets/chunk-2E7WHVMD-TfbC_dmh.js +1 -0
  9. package/assets/chunk-2Q5K7J3B-0YJgChVo.js +1 -0
  10. package/assets/chunk-4EMNKR2T-DHoYW7g5.js +1 -0
  11. package/assets/chunk-55XCU76K-Cq25Yw_G.js +1 -0
  12. package/assets/chunk-5VM5RSS4-CJaRXFHK.js +1 -0
  13. package/assets/chunk-JWPE2WC7-BP2iXBhe.js +1 -0
  14. package/assets/chunk-VQ5W62QI-B95zur4F.js +1 -0
  15. package/assets/chunk-XXDRQBXY-Ct0MhvQo.js +1 -0
  16. package/assets/chunk-ZCHMQSOR-C5VhW-wL.js +2 -0
  17. package/assets/classDiagram-v2-4MYWR3UA-C1G-Vkj0.js +1 -0
  18. package/assets/cose-bilkent-JH36ORCC-qIQoIBv0.js +1 -0
  19. package/assets/cynefin-EF2NZ3EQ-CR1E3YiZ.js +1 -0
  20. package/assets/cynefinDiagram-WF24UDRP-DaJFvZ3b.js +1 -0
  21. package/assets/cytoscape.esm-SjxgSg6I.js +9 -0
  22. package/assets/dagre-NK4GIZVX-BFRQhpii.js +1 -0
  23. package/assets/diagram-CBK3MWTC-DlueL6XZ.js +1 -0
  24. package/assets/diagram-I5XIIV2D-bITyafYX.js +1 -0
  25. package/assets/diagram-ODIL2UCW-Dlb4hg_-.js +1 -0
  26. package/assets/diagram-PFBEJUXE-CRfen0O7.js +1 -0
  27. package/assets/diagram-RJA3I4VV-CK-FlhGV.js +1 -0
  28. package/assets/diagram-TYUNFSNR-DmgVsxqa.js +1 -0
  29. package/assets/ebnfDiagram-V4P3TTPT-B9KGI9eQ.js +1 -0
  30. package/assets/echarts-CytsvCdp.js +25 -0
  31. package/assets/elk-QONTBCTQ-VgDftvsU.js +1 -0
  32. package/assets/erDiagram-KYQIGQAA-DkpP7sS4.js +1 -0
  33. package/assets/flowDiagram-IUGLLWBU-CRXa9Kxy.js +1 -0
  34. package/assets/ganttDiagram-R7GPNTJY-Cu2I55Wb.js +1 -0
  35. package/assets/gitGraphDiagram-PDYL7XHY-CwSo663I.js +1 -0
  36. package/assets/graph-Dz7AM1Q5.js +1 -0
  37. package/assets/index-BJ-NdQc4.js +100 -0
  38. package/assets/infoDiagram-MVDRKAX5-D3Qknzuo.js +1 -0
  39. package/assets/ishikawaDiagram-HPEHV2GE-9qYT75tk.js +1 -0
  40. package/assets/journeyDiagram-BOSHW7O7-DeSrJg9o.js +1 -0
  41. package/assets/kanban-definition-FNSA4HC5-DINkB6G7.js +1 -0
  42. package/assets/katex-DN8cTsI3.js +1 -0
  43. package/assets/markdown-S2mWvoE-.js +5 -0
  44. package/assets/mermaid-T_6Ze_cT.js +7 -0
  45. package/assets/mindmap-definition-6OY57UG3-DW5hqiAe.js +1 -0
  46. package/assets/pegDiagram-ECIUJNBX-BWy_tkzy.js +1 -0
  47. package/assets/pieDiagram-GNMPY74T-CniJbr6l.js +1 -0
  48. package/assets/quadrantDiagram-D57K4MC3-BVnDJkCv.js +1 -0
  49. package/assets/railroadDiagram-Y72NRBL7-BNKZpJJb.js +1 -0
  50. package/assets/requirementDiagram-EQYSW5RA-BETipHj0.js +1 -0
  51. package/assets/sankeyDiagram-SY24JHO5-ByEYqT7T.js +1 -0
  52. package/assets/sequenceDiagram-BLEHNHQU-BqCJ2tKG.js +1 -0
  53. package/assets/sizeCapture-INFHLROL-DlhrWFj-.js +1 -0
  54. package/assets/stateDiagram-v2-A6IESKWZ-DJUBWLTP.js +1 -0
  55. package/assets/swimlanes-B3ENRKFQ-D7k7tF5U.js +1 -0
  56. package/assets/swimlanesDiagram-AYQRV4AK-DoQBgB9o.js +1 -0
  57. package/assets/timeline-definition-JXYKGLGB-BCNhwnn6.js +1 -0
  58. package/assets/usecaseDiagram-WPOLBNNX-DRa_Rgl3.js +1 -0
  59. package/assets/vennDiagram-Q3Y3IDCW-Ba2eaO68.js +1 -0
  60. package/assets/wardleyDiagram-IVAIDKWA-W_i9vzY-.js +1 -0
  61. package/assets/xychartDiagram-4URNHDU4-ByfaGjvc.js +1 -0
  62. package/index.html +3 -3
  63. package/package.json +1 -1
  64. package/plugin.json +1 -1
  65. package/preload/git-panel.js +29 -5
  66. package/preload/git-service.js +48 -15
  67. package/preload/remote-setup.js +66 -33
  68. package/preload/remote-wizard.js +2 -0
  69. package/preload.js +30 -0
  70. package/assets/abnfDiagram-WEYOIA3C-BgXsTF7a.js +0 -1
  71. package/assets/architectureDiagram-ZHVYKT53-BsCWa_qC.js +0 -36
  72. package/assets/blockDiagram-RJAE7QA3-wbIxEiYN.js +0 -140
  73. package/assets/c4Diagram-XDPPPE54-5zdyxFvA.js +0 -38
  74. package/assets/chunk-2E7WHVMD-F85Lca-i.js +0 -88
  75. package/assets/chunk-2Q5K7J3B-CjpAZ0OI.js +0 -1
  76. package/assets/chunk-4EMNKR2T-C8Kbh83c.js +0 -1
  77. package/assets/chunk-55XCU76K-BINcFiLN.js +0 -1
  78. package/assets/chunk-5VM5RSS4-Diy5h2LS.js +0 -15
  79. package/assets/chunk-JWPE2WC7-BXnjDdh1.js +0 -1
  80. package/assets/chunk-VQ5W62QI-BM7ZZo1I.js +0 -1
  81. package/assets/chunk-XXDRQBXY-CW8CjB1w.js +0 -1
  82. package/assets/chunk-ZCHMQSOR-C7ATz1L1.js +0 -2
  83. package/assets/classDiagram-v2-4MYWR3UA-CMoqNk-b.js +0 -217
  84. package/assets/cose-bilkent-JH36ORCC-6rqR5iJk.js +0 -1
  85. package/assets/cynefin-EF2NZ3EQ-DypLIJxl.js +0 -141
  86. package/assets/cynefinDiagram-WF24UDRP-8b2CEBlR.js +0 -62
  87. package/assets/cytoscape.esm-CjX6Hyah.js +0 -331
  88. package/assets/dagre-NK4GIZVX-Dv6vuUbR.js +0 -4
  89. package/assets/diagram-CBK3MWTC-DJgMDeYd.js +0 -24
  90. package/assets/diagram-I5XIIV2D-BB9cMoRW.js +0 -24
  91. package/assets/diagram-ODIL2UCW-BVcRtsdy.js +0 -30
  92. package/assets/diagram-PFBEJUXE-BbGSOtJx.js +0 -3
  93. package/assets/diagram-RJA3I4VV-CzkY_8Fo.js +0 -41
  94. package/assets/diagram-TYUNFSNR-YTl5QdfL.js +0 -200
  95. package/assets/ebnfDiagram-V4P3TTPT-COVjPAjE.js +0 -1
  96. package/assets/echarts-BAPDkhe3.js +0 -61
  97. package/assets/elk-QONTBCTQ-DHsjY8Z_.js +0 -27
  98. package/assets/erDiagram-KYQIGQAA-CUAbTUl1.js +0 -99
  99. package/assets/flowDiagram-IUGLLWBU-CWsiqTQC.js +0 -213
  100. package/assets/ganttDiagram-R7GPNTJY-DetBW0Wm.js +0 -292
  101. package/assets/gitGraphDiagram-PDYL7XHY-ByrdgJmw.js +0 -106
  102. package/assets/graph-D8UmR1vK.js +0 -1
  103. package/assets/index-B17NCAw4.js +0 -758
  104. package/assets/infoDiagram-MVDRKAX5-BM48fjhU.js +0 -2
  105. package/assets/ishikawaDiagram-HPEHV2GE-DtHYywHZ.js +0 -70
  106. package/assets/journeyDiagram-BOSHW7O7-DJ1LiRh3.js +0 -139
  107. package/assets/kanban-definition-FNSA4HC5-DPPt8pwJ.js +0 -89
  108. package/assets/katex-CQL9J12G.js +0 -257
  109. package/assets/markdown-DVehI1Sg.js +0 -314
  110. package/assets/mermaid-C_q9pug0.js +0 -312
  111. package/assets/mindmap-definition-6OY57UG3-zbqYOEY6.js +0 -98
  112. package/assets/pegDiagram-ECIUJNBX-e7QG7TMq.js +0 -1
  113. package/assets/pieDiagram-GNMPY74T-Duf6YP0N.js +0 -39
  114. package/assets/quadrantDiagram-D57K4MC3-B2eYoUUy.js +0 -7
  115. package/assets/railroadDiagram-Y72NRBL7-BWCzPcI_.js +0 -1
  116. package/assets/requirementDiagram-EQYSW5RA-HhPMEqB1.js +0 -84
  117. package/assets/sankeyDiagram-SY24JHO5-CMUTwFBB.js +0 -40
  118. package/assets/sequenceDiagram-BLEHNHQU-C9wR2ll7.js +0 -169
  119. package/assets/sizeCapture-INFHLROL-DXfz37S6.js +0 -1
  120. package/assets/stateDiagram-v2-A6IESKWZ-D_gtonhE.js +0 -291
  121. package/assets/swimlanes-B3ENRKFQ-DdJOuuMV.js +0 -1
  122. package/assets/swimlanesDiagram-AYQRV4AK-BWt3HxHV.js +0 -8
  123. package/assets/timeline-definition-JXYKGLGB-DQsdwJe-.js +0 -120
  124. package/assets/usecaseDiagram-WPOLBNNX-DTRyFq7d.js +0 -370
  125. package/assets/vennDiagram-Q3Y3IDCW-dihYszm0.js +0 -34
  126. package/assets/wardleyDiagram-IVAIDKWA-BoPpgYfK.js +0 -78
  127. package/assets/xychartDiagram-4URNHDU4-DoLjYxeB.js +0 -7
@@ -0,0 +1 @@
1
+ import{I as t}from"./chunk-2Q5K7J3B-0YJgChVo.js";import{_ as e,o as a,c as r,k as s,l as i,$ as n,d as o,e as c,m as d,b as l,s as h,q as p,a as T,g as E,t as g,v as u,J as y,z as O,j as _,u as x,a0 as m,a1 as b,R as I,a2 as f,L as R,a3 as L,a4 as N}from"./mermaid-T_6Ze_cT.js";import{a as S,g as w,b as P,d as D,e as A,f as k}from"./chunk-55XCU76K-Cq25Yw_G.js";import"./markdown-S2mWvoE-.js";var C=function(){var t=e(function(t,e,a,r){for(a=a||{},r=t.length;r--;a[t[r]]=e);return a},"o"),a=[1,2],r=[1,3],s=[1,4],i=[2,4],n=[1,9],o=[1,11],c=[1,12],d=[1,14],l=[1,15],h=[1,17],p=[1,18],T=[1,19],E=[1,25],g=[1,26],u=[1,27],y=[1,28],O=[1,29],_=[1,30],x=[1,31],m=[1,32],b=[1,33],I=[1,34],f=[1,35],R=[1,36],L=[1,37],N=[1,38],S=[1,39],w=[1,40],P=[1,42],D=[1,43],A=[1,44],k=[1,45],C=[1,46],M=[1,47],v=[1,4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,48,49,50,51,53,54,56,61,62,63,64,73],Y=[1,56],B=[1,75],$=[1,81],V=[1,82],W=[1,83],F=[1,84],K=[1,85],q=[1,86],H=[1,87],z=[1,88],U=[1,89],j=[1,90],G=[1,91],X=[1,92],J=[1,93],Z=[1,94],Q=[1,95],tt=[1,96],et=[1,97],at=[1,98],rt=[1,99],st=[1,100],it=[1,101],nt=[1,102],ot=[1,103],ct=[1,104],dt=[1,105],lt=[1,106],ht=[2,79],pt=[2,78],Tt=[4,5,17,51,53,54],Et=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,51,53,54,56,61,62,63,64,73],gt=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,50,51,53,54,56,61,62,63,64,73],ut=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,49,51,53,54,56,61,62,63,64,73],yt=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,48,51,53,54,56,61,62,63,64,73],Ot=[5,52],_t=[62,70,71,72,73],xt=[62,73],mt=[1,152],bt={trace:e(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SPACE:4,NEWLINE:5,SD:6,document:7,line:8,statement:9,INVALID:10,box_section:11,box_line:12,participant_statement:13,create:14,box:15,restOfLine:16,end:17,signal:18,autonumber:19,NUM:20,off:21,activate:22,actor:23,deactivate:24,note_statement:25,links_statement:26,link_statement:27,properties_statement:28,details_statement: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:40,else_sections:41,par:42,par_sections:43,par_over:44,critical:45,option_sections:46,break:47,option:48,and:49,else:50,participant:51,AS:52,participant_actor:53,destroy:54,actor_with_config:55,note:56,placement:57,text2:58,over:59,actor_pair:60,links:61,link:62,properties:63,details:64,spaceList:65,",":66,left_of:67,right_of:68,signaltype:69,"+":70,"-":71,"()":72,ACTOR:73,config_object:74,CONFIG_START:75,CONFIG_CONTENT:76,CONFIG_END:77,SOLID_OPEN_ARROW:78,DOTTED_OPEN_ARROW:79,SOLID_ARROW:80,SOLID_ARROW_TOP:81,SOLID_ARROW_BOTTOM:82,STICK_ARROW_TOP:83,STICK_ARROW_BOTTOM:84,SOLID_ARROW_TOP_DOTTED:85,SOLID_ARROW_BOTTOM_DOTTED:86,STICK_ARROW_TOP_DOTTED:87,STICK_ARROW_BOTTOM_DOTTED:88,SOLID_ARROW_TOP_REVERSE:89,SOLID_ARROW_BOTTOM_REVERSE:90,STICK_ARROW_TOP_REVERSE:91,STICK_ARROW_BOTTOM_REVERSE:92,SOLID_ARROW_TOP_REVERSE_DOTTED:93,SOLID_ARROW_BOTTOM_REVERSE_DOTTED:94,STICK_ARROW_TOP_REVERSE_DOTTED:95,STICK_ARROW_BOTTOM_REVERSE_DOTTED:96,BIDIRECTIONAL_SOLID_ARROW:97,DOTTED_ARROW:98,BIDIRECTIONAL_DOTTED_ARROW:99,SOLID_CROSS:100,DOTTED_CROSS:101,SOLID_POINT:102,DOTTED_POINT:103,TXT:104,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NEWLINE",6:"SD",10:"INVALID",14:"create",15:"box",16:"restOfLine",17:"end",19:"autonumber",20:"NUM",21:"off",22:"activate",24:"deactivate",30:"title",31:"legacy_title",32:"acc_title",33:"acc_title_value",34:"acc_descr",35:"acc_descr_value",36:"acc_descr_multiline_value",37:"loop",38:"rect",39:"opt",40:"alt",42:"par",44:"par_over",45:"critical",47:"break",48:"option",49:"and",50:"else",51:"participant",52:"AS",53:"participant_actor",54:"destroy",56:"note",59:"over",61:"links",62:"link",63:"properties",64:"details",66:",",67:"left_of",68:"right_of",70:"+",71:"-",72:"()",73:"ACTOR",75:"CONFIG_START",76:"CONFIG_CONTENT",77:"CONFIG_END",78:"SOLID_OPEN_ARROW",79:"DOTTED_OPEN_ARROW",80:"SOLID_ARROW",81:"SOLID_ARROW_TOP",82:"SOLID_ARROW_BOTTOM",83:"STICK_ARROW_TOP",84:"STICK_ARROW_BOTTOM",85:"SOLID_ARROW_TOP_DOTTED",86:"SOLID_ARROW_BOTTOM_DOTTED",87:"STICK_ARROW_TOP_DOTTED",88:"STICK_ARROW_BOTTOM_DOTTED",89:"SOLID_ARROW_TOP_REVERSE",90:"SOLID_ARROW_BOTTOM_REVERSE",91:"STICK_ARROW_TOP_REVERSE",92:"STICK_ARROW_BOTTOM_REVERSE",93:"SOLID_ARROW_TOP_REVERSE_DOTTED",94:"SOLID_ARROW_BOTTOM_REVERSE_DOTTED",95:"STICK_ARROW_TOP_REVERSE_DOTTED",96:"STICK_ARROW_BOTTOM_REVERSE_DOTTED",97:"BIDIRECTIONAL_SOLID_ARROW",98:"DOTTED_ARROW",99:"BIDIRECTIONAL_DOTTED_ARROW",100:"SOLID_CROSS",101:"DOTTED_CROSS",102:"SOLID_POINT",103:"DOTTED_POINT",104:"TXT"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[8,1],[11,0],[11,2],[12,2],[12,1],[12,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],[46,1],[46,4],[43,1],[43,4],[41,1],[41,4],[13,5],[13,3],[13,5],[13,3],[13,3],[13,5],[13,3],[13,5],[13,3],[25,4],[25,4],[26,3],[27,3],[28,3],[29,3],[65,2],[65,1],[60,3],[60,1],[57,1],[57,1],[18,5],[18,5],[18,5],[18,5],[18,6],[18,4],[55,2],[74,3],[23,1],[23,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[58,1]],performAction:e(function(t,e,a,r,s,i,n){var o=i.length-1;switch(s){case 3:return r.apply(i[o]),i[o];case 4:case 10:case 8:case 9:case 14:this.$=[];break;case 5:case 11:i[o-1].push(i[o]),this.$=i[o-1];break;case 6:case 7:case 12:case 13:case 67:this.$=i[o];break;case 16:i[o].type="createParticipant",this.$=i[o];break;case 17:i[o-1].unshift({type:"boxStart",boxData:r.parseBoxData(i[o-2])}),i[o-1].push({type:"boxEnd",boxText:i[o-2]}),this.$=i[o-1];break;case 19:this.$={type:"sequenceIndex",sequenceIndex:Number(i[o-2]),sequenceIndexStep:Number(i[o-1]),sequenceVisible:!0,signalType:r.LINETYPE.AUTONUMBER};break;case 20:this.$={type:"sequenceIndex",sequenceIndex:Number(i[o-1]),sequenceIndexStep:1,sequenceVisible:!0,signalType:r.LINETYPE.AUTONUMBER};break;case 21:this.$={type:"sequenceIndex",sequenceVisible:!1,signalType:r.LINETYPE.AUTONUMBER};break;case 22:this.$={type:"sequenceIndex",sequenceVisible:!0,signalType:r.LINETYPE.AUTONUMBER};break;case 23:this.$={type:"activeStart",signalType:r.LINETYPE.ACTIVE_START,actor:i[o-1].actor};break;case 24:this.$={type:"activeEnd",signalType:r.LINETYPE.ACTIVE_END,actor:i[o-1].actor};break;case 30:r.setDiagramTitle(i[o].substring(6)),this.$=i[o].substring(6);break;case 31:r.setDiagramTitle(i[o].substring(7)),this.$=i[o].substring(7);break;case 32:this.$=i[o].trim(),r.setAccTitle(this.$);break;case 33:case 34:this.$=i[o].trim(),r.setAccDescription(this.$);break;case 35:i[o-1].unshift({type:"loopStart",loopText:r.parseMessage(i[o-2]),signalType:r.LINETYPE.LOOP_START}),i[o-1].push({type:"loopEnd",loopText:i[o-2],signalType:r.LINETYPE.LOOP_END}),this.$=i[o-1];break;case 36:i[o-1].unshift({type:"rectStart",color:r.parseMessage(i[o-2]),signalType:r.LINETYPE.RECT_START}),i[o-1].push({type:"rectEnd",color:r.parseMessage(i[o-2]),signalType:r.LINETYPE.RECT_END}),this.$=i[o-1];break;case 37:i[o-1].unshift({type:"optStart",optText:r.parseMessage(i[o-2]),signalType:r.LINETYPE.OPT_START}),i[o-1].push({type:"optEnd",optText:r.parseMessage(i[o-2]),signalType:r.LINETYPE.OPT_END}),this.$=i[o-1];break;case 38:i[o-1].unshift({type:"altStart",altText:r.parseMessage(i[o-2]),signalType:r.LINETYPE.ALT_START}),i[o-1].push({type:"altEnd",signalType:r.LINETYPE.ALT_END}),this.$=i[o-1];break;case 39:i[o-1].unshift({type:"parStart",parText:r.parseMessage(i[o-2]),signalType:r.LINETYPE.PAR_START}),i[o-1].push({type:"parEnd",signalType:r.LINETYPE.PAR_END}),this.$=i[o-1];break;case 40:i[o-1].unshift({type:"parStart",parText:r.parseMessage(i[o-2]),signalType:r.LINETYPE.PAR_OVER_START}),i[o-1].push({type:"parEnd",signalType:r.LINETYPE.PAR_END}),this.$=i[o-1];break;case 41:i[o-1].unshift({type:"criticalStart",criticalText:r.parseMessage(i[o-2]),signalType:r.LINETYPE.CRITICAL_START}),i[o-1].push({type:"criticalEnd",signalType:r.LINETYPE.CRITICAL_END}),this.$=i[o-1];break;case 42:i[o-1].unshift({type:"breakStart",breakText:r.parseMessage(i[o-2]),signalType:r.LINETYPE.BREAK_START}),i[o-1].push({type:"breakEnd",optText:r.parseMessage(i[o-2]),signalType:r.LINETYPE.BREAK_END}),this.$=i[o-1];break;case 44:this.$=i[o-3].concat([{type:"option",optionText:r.parseMessage(i[o-1]),signalType:r.LINETYPE.CRITICAL_OPTION},i[o]]);break;case 46:this.$=i[o-3].concat([{type:"and",parText:r.parseMessage(i[o-1]),signalType:r.LINETYPE.PAR_AND},i[o]]);break;case 48:this.$=i[o-3].concat([{type:"else",altText:r.parseMessage(i[o-1]),signalType:r.LINETYPE.ALT_ELSE},i[o]]);break;case 49:case 54:i[o-3].draw="participant",i[o-3].type="addParticipant",i[o-3].description=r.parseMessage(i[o-1]),this.$=i[o-3];break;case 50:case 55:i[o-1].draw="participant",i[o-1].type="addParticipant",this.$=i[o-1];break;case 51:case 56:i[o-3].draw="actor",i[o-3].type="addParticipant",i[o-3].description=r.parseMessage(i[o-1]),this.$=i[o-3];break;case 52:case 57:i[o-1].draw="actor",i[o-1].type="addParticipant",this.$=i[o-1];break;case 53:i[o-1].type="destroyParticipant",this.$=i[o-1];break;case 58:this.$=[i[o-1],{type:"addNote",placement:i[o-2],actor:i[o-1].actor,text:i[o]}];break;case 59:i[o-2]=[].concat(i[o-1],i[o-1]).slice(0,2),i[o-2][0]=i[o-2][0].actor,i[o-2][1]=i[o-2][1].actor,this.$=[i[o-1],{type:"addNote",placement:r.PLACEMENT.OVER,actor:i[o-2].slice(0,2),text:i[o]}];break;case 60:this.$=[i[o-1],{type:"addLinks",actor:i[o-1].actor,text:i[o]}];break;case 61:this.$=[i[o-1],{type:"addALink",actor:i[o-1].actor,text:i[o]}];break;case 62:this.$=[i[o-1],{type:"addProperties",actor:i[o-1].actor,text:i[o]}];break;case 63:this.$=[i[o-1],{type:"addDetails",actor:i[o-1].actor,text:i[o]}];break;case 66:this.$=[i[o-2],i[o]];break;case 68:this.$=r.PLACEMENT.LEFTOF;break;case 69:this.$=r.PLACEMENT.RIGHTOF;break;case 70:this.$=[i[o-4],i[o-1],{type:"addMessage",from:i[o-4].actor,to:i[o-1].actor,signalType:i[o-3],msg:i[o],activate:!0},{type:"activeStart",signalType:r.LINETYPE.ACTIVE_START,actor:i[o-1].actor}];break;case 71:this.$=[i[o-4],i[o-1],{type:"addMessage",from:i[o-4].actor,to:i[o-1].actor,signalType:i[o-3],msg:i[o]},{type:"activeEnd",signalType:r.LINETYPE.ACTIVE_END,actor:i[o-4].actor}];break;case 72:this.$=[i[o-4],i[o-1],{type:"addMessage",from:i[o-4].actor,to:i[o-1].actor,signalType:i[o-3],msg:i[o],activate:!0,centralConnection:r.LINETYPE.CENTRAL_CONNECTION},{type:"centralConnection",signalType:r.LINETYPE.CENTRAL_CONNECTION,actor:i[o-1].actor}];break;case 73:this.$=[i[o-4],i[o-1],{type:"addMessage",from:i[o-4].actor,to:i[o-1].actor,signalType:i[o-2],msg:i[o],activate:!1,centralConnection:r.LINETYPE.CENTRAL_CONNECTION_REVERSE},{type:"centralConnectionReverse",signalType:r.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:i[o-4].actor}];break;case 74:this.$=[i[o-5],i[o-1],{type:"addMessage",from:i[o-5].actor,to:i[o-1].actor,signalType:i[o-3],msg:i[o],activate:!0,centralConnection:r.LINETYPE.CENTRAL_CONNECTION_DUAL},{type:"centralConnection",signalType:r.LINETYPE.CENTRAL_CONNECTION,actor:i[o-1].actor},{type:"centralConnectionReverse",signalType:r.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:i[o-5].actor}];break;case 75:this.$=[i[o-3],i[o-1],{type:"addMessage",from:i[o-3].actor,to:i[o-1].actor,signalType:i[o-2],msg:i[o]}];break;case 76:this.$={type:"addParticipant",actor:i[o-1],config:i[o]};break;case 77:this.$=i[o-1].trim();break;case 78:case 79:this.$={type:"addParticipant",actor:i[o]};break;case 80:this.$=r.LINETYPE.SOLID_OPEN;break;case 81:this.$=r.LINETYPE.DOTTED_OPEN;break;case 82:this.$=r.LINETYPE.SOLID;break;case 83:this.$=r.LINETYPE.SOLID_TOP;break;case 84:this.$=r.LINETYPE.SOLID_BOTTOM;break;case 85:this.$=r.LINETYPE.STICK_TOP;break;case 86:this.$=r.LINETYPE.STICK_BOTTOM;break;case 87:this.$=r.LINETYPE.SOLID_TOP_DOTTED;break;case 88:this.$=r.LINETYPE.SOLID_BOTTOM_DOTTED;break;case 89:this.$=r.LINETYPE.STICK_TOP_DOTTED;break;case 90:this.$=r.LINETYPE.STICK_BOTTOM_DOTTED;break;case 91:this.$=r.LINETYPE.SOLID_ARROW_TOP_REVERSE;break;case 92:this.$=r.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE;break;case 93:this.$=r.LINETYPE.STICK_ARROW_TOP_REVERSE;break;case 94:this.$=r.LINETYPE.STICK_ARROW_BOTTOM_REVERSE;break;case 95:this.$=r.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED;break;case 96:this.$=r.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED;break;case 97:this.$=r.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED;break;case 98:this.$=r.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED;break;case 99:this.$=r.LINETYPE.BIDIRECTIONAL_SOLID;break;case 100:this.$=r.LINETYPE.DOTTED;break;case 101:this.$=r.LINETYPE.BIDIRECTIONAL_DOTTED;break;case 102:this.$=r.LINETYPE.SOLID_CROSS;break;case 103:this.$=r.LINETYPE.DOTTED_CROSS;break;case 104:this.$=r.LINETYPE.SOLID_POINT;break;case 105:this.$=r.LINETYPE.DOTTED_POINT;break;case 106:this.$=r.parseMessage(i[o].trim().substring(1))}},"anonymous"),table:[{3:1,4:a,5:r,6:s},{1:[3]},{3:5,4:a,5:r,6:s},{3:6,4:a,5:r,6:s},t([1,4,5,10,14,15,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,51,53,54,56,61,62,63,64,73],i,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:n,5:o,8:8,9:10,10:c,13:13,14:d,15:l,18:16,19:h,22:p,23:41,24:T,25:20,26:21,27:22,28:23,29:24,30:E,31:g,32:u,34:y,36:O,37:_,38:x,39:m,40:b,42:I,44:f,45:R,47:L,51:N,53:S,54:w,56:P,61:D,62:A,63:k,64:C,73:M},t(v,[2,5]),{9:48,13:13,14:d,15:l,18:16,19:h,22:p,23:41,24:T,25:20,26:21,27:22,28:23,29:24,30:E,31:g,32:u,34:y,36:O,37:_,38:x,39:m,40:b,42:I,44:f,45:R,47:L,51:N,53:S,54:w,56:P,61:D,62:A,63:k,64:C,73:M},t(v,[2,7]),t(v,[2,8]),t(v,[2,9]),t(v,[2,15]),{13:49,51:N,53:S,54:w},{16:[1,50]},{5:[1,51]},{5:[1,54],20:[1,52],21:[1,53]},{23:55,62:Y,73:M},{23:57,62:Y,73:M},{5:[1,58]},{5:[1,59]},{5:[1,60]},{5:[1,61]},{5:[1,62]},t(v,[2,30]),t(v,[2,31]),{33:[1,63]},{35:[1,64]},t(v,[2,34]),{16:[1,65]},{16:[1,66]},{16:[1,67]},{16:[1,68]},{16:[1,69]},{16:[1,70]},{16:[1,71]},{16:[1,72]},{23:73,55:74,62:Y,73:B},{23:76,55:77,62:Y,73:B},{23:78,62:Y,73:M},{69:79,72:[1,80],78:$,79:V,80:W,81:F,82:K,83:q,84:H,85:z,86:U,87:j,88:G,89:X,90:J,91:Z,92:Q,93:tt,94:et,95:at,96:rt,97:st,98:it,99:nt,100:ot,101:ct,102:dt,103:lt},{57:107,59:[1,108],67:[1,109],68:[1,110]},{23:111,62:Y,73:M},t([72,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103],ht,{23:112,62:Y,73:M}),{23:113,62:Y,73:M},{23:114,62:Y,73:M},t([5,66,72,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104],pt),t(v,[2,6]),t(v,[2,16]),t(Tt,[2,10],{11:115}),t(v,[2,18]),{5:[1,117],20:[1,116]},{5:[1,118]},t(v,[2,22]),{5:[1,119]},t([5,52,66,104],ht),{5:[1,120]},t(v,[2,25]),t(v,[2,26]),t(v,[2,27]),t(v,[2,28]),t(v,[2,29]),t(v,[2,32]),t(v,[2,33]),t(Et,i,{7:121}),t(Et,i,{7:122}),t(Et,i,{7:123}),t(gt,i,{41:124,7:125}),t(ut,i,{43:126,7:127}),t(ut,i,{7:127,43:128}),t(yt,i,{46:129,7:130}),t(Et,i,{7:131}),{5:[1,133],52:[1,132]},{5:[1,135],52:[1,134]},t(Ot,pt,{74:136,75:[1,137]}),{5:[1,139],52:[1,138]},{5:[1,141],52:[1,140]},{5:[1,142]},{23:146,62:Y,70:[1,143],71:[1,144],72:[1,145],73:M},{69:147,78:$,79:V,80:W,81:F,82:K,83:q,84:H,85:z,86:U,87:j,88:G,89:X,90:J,91:Z,92:Q,93:tt,94:et,95:at,96:rt,97:st,98:it,99:nt,100:ot,101:ct,102:dt,103:lt},t(_t,[2,80]),t(_t,[2,81]),t(_t,[2,82]),t(_t,[2,83]),t(_t,[2,84]),t(_t,[2,85]),t(_t,[2,86]),t(_t,[2,87]),t(_t,[2,88]),t(_t,[2,89]),t(_t,[2,90]),t(_t,[2,91]),t(_t,[2,92]),t(_t,[2,93]),t(_t,[2,94]),t(_t,[2,95]),t(_t,[2,96]),t(_t,[2,97]),t(_t,[2,98]),t(_t,[2,99]),t(_t,[2,100]),t(_t,[2,101]),t(_t,[2,102]),t(_t,[2,103]),t(_t,[2,104]),t(_t,[2,105]),{23:148,62:Y,73:M},{23:150,60:149,62:Y,73:M},t(xt,[2,68]),t(xt,[2,69]),{58:151,104:mt},{58:153,104:mt},{58:154,104:mt},{58:155,104:mt},{4:[1,158],5:[1,160],12:157,13:159,17:[1,156],51:N,53:S,54:w},{5:[1,161]},t(v,[2,20]),t(v,[2,21]),t(v,[2,23]),t(v,[2,24]),{4:n,5:o,8:8,9:10,10:c,13:13,14:d,15:l,17:[1,162],18:16,19:h,22:p,23:41,24:T,25:20,26:21,27:22,28:23,29:24,30:E,31:g,32:u,34:y,36:O,37:_,38:x,39:m,40:b,42:I,44:f,45:R,47:L,51:N,53:S,54:w,56:P,61:D,62:A,63:k,64:C,73:M},{4:n,5:o,8:8,9:10,10:c,13:13,14:d,15:l,17:[1,163],18:16,19:h,22:p,23:41,24:T,25:20,26:21,27:22,28:23,29:24,30:E,31:g,32:u,34:y,36:O,37:_,38:x,39:m,40:b,42:I,44:f,45:R,47:L,51:N,53:S,54:w,56:P,61:D,62:A,63:k,64:C,73:M},{4:n,5:o,8:8,9:10,10:c,13:13,14:d,15:l,17:[1,164],18:16,19:h,22:p,23:41,24:T,25:20,26:21,27:22,28:23,29:24,30:E,31:g,32:u,34:y,36:O,37:_,38:x,39:m,40:b,42:I,44:f,45:R,47:L,51:N,53:S,54:w,56:P,61:D,62:A,63:k,64:C,73:M},{17:[1,165]},{4:n,5:o,8:8,9:10,10:c,13:13,14:d,15:l,17:[2,47],18:16,19:h,22:p,23:41,24:T,25:20,26:21,27:22,28:23,29:24,30:E,31:g,32:u,34:y,36:O,37:_,38:x,39:m,40:b,42:I,44:f,45:R,47:L,50:[1,166],51:N,53:S,54:w,56:P,61:D,62:A,63:k,64:C,73:M},{17:[1,167]},{4:n,5:o,8:8,9:10,10:c,13:13,14:d,15:l,17:[2,45],18:16,19:h,22:p,23:41,24:T,25:20,26:21,27:22,28:23,29:24,30:E,31:g,32:u,34:y,36:O,37:_,38:x,39:m,40:b,42:I,44:f,45:R,47:L,49:[1,168],51:N,53:S,54:w,56:P,61:D,62:A,63:k,64:C,73:M},{17:[1,169]},{17:[1,170]},{4:n,5:o,8:8,9:10,10:c,13:13,14:d,15:l,17:[2,43],18:16,19:h,22:p,23:41,24:T,25:20,26:21,27:22,28:23,29:24,30:E,31:g,32:u,34:y,36:O,37:_,38:x,39:m,40:b,42:I,44:f,45:R,47:L,48:[1,171],51:N,53:S,54:w,56:P,61:D,62:A,63:k,64:C,73:M},{4:n,5:o,8:8,9:10,10:c,13:13,14:d,15:l,17:[1,172],18:16,19:h,22:p,23:41,24:T,25:20,26:21,27:22,28:23,29:24,30:E,31:g,32:u,34:y,36:O,37:_,38:x,39:m,40:b,42:I,44:f,45:R,47:L,51:N,53:S,54:w,56:P,61:D,62:A,63:k,64:C,73:M},{16:[1,173]},t(v,[2,50]),{16:[1,174]},t(v,[2,55]),t(Ot,[2,76]),{76:[1,175]},{16:[1,176]},t(v,[2,52]),{16:[1,177]},t(v,[2,57]),t(v,[2,53]),{23:178,62:Y,73:M},{23:179,62:Y,73:M},{23:180,62:Y,73:M},{58:181,104:mt},{23:182,62:Y,72:[1,183],73:M},{58:184,104:mt},{58:185,104:mt},{66:[1,186],104:[2,67]},{5:[2,60]},{5:[2,106]},{5:[2,61]},{5:[2,62]},{5:[2,63]},t(v,[2,17]),t(Tt,[2,11]),{13:187,51:N,53:S,54:w},t(Tt,[2,13]),t(Tt,[2,14]),t(v,[2,19]),t(v,[2,35]),t(v,[2,36]),t(v,[2,37]),t(v,[2,38]),{16:[1,188]},t(v,[2,39]),{16:[1,189]},t(v,[2,40]),t(v,[2,41]),{16:[1,190]},t(v,[2,42]),{5:[1,191]},{5:[1,192]},{77:[1,193]},{5:[1,194]},{5:[1,195]},{58:196,104:mt},{58:197,104:mt},{58:198,104:mt},{5:[2,75]},{58:199,104:mt},{23:200,62:Y,73:M},{5:[2,58]},{5:[2,59]},{23:201,62:Y,73:M},t(Tt,[2,12]),t(gt,i,{7:125,41:202}),t(ut,i,{7:127,43:203}),t(yt,i,{7:130,46:204}),t(v,[2,49]),t(v,[2,54]),t(Ot,[2,77]),t(v,[2,51]),t(v,[2,56]),{5:[2,70]},{5:[2,71]},{5:[2,72]},{5:[2,73]},{58:205,104:mt},{104:[2,66]},{17:[2,48]},{17:[2,46]},{17:[2,44]},{5:[2,74]}],defaultActions:{5:[2,1],6:[2,2],151:[2,60],152:[2,106],153:[2,61],154:[2,62],155:[2,63],181:[2,75],184:[2,58],185:[2,59],196:[2,70],197:[2,71],198:[2,72],199:[2,73],201:[2,66],202:[2,48],203:[2,46],204:[2,44],205:[2,74]},parseError:e(function(t,e){if(!e.recoverable){var a=new Error(t);throw a.hash=e,a}this.trace(t)},"parseError"),parse:e(function(t){var a=this,r=[0],s=[],i=[null],n=[],o=this.table,c="",d=0,l=0,h=n.slice.call(arguments,1),p=Object.create(this.lexer),T={yy:{}};for(var E in this.yy)Object.prototype.hasOwnProperty.call(this.yy,E)&&(T.yy[E]=this.yy[E]);p.setInput(t,T.yy),T.yy.lexer=p,T.yy.parser=this,void 0===p.yylloc&&(p.yylloc={});var g=p.yylloc;n.push(g);var u=p.options&&p.options.ranges;function y(){var t;return"number"!=typeof(t=s.pop()||p.lex()||1)&&(t instanceof Array&&(t=(s=t).pop()),t=a.symbols_[t]||t),t}"function"==typeof T.yy.parseError?this.parseError=T.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,e(function(t){r.length=r.length-2*t,i.length=i.length-t,n.length=n.length-t},"popStack"),e(y,"lex");for(var O,_,x,m,b,I,f,R,L={};;){if(_=r[r.length-1],this.defaultActions[_]?x=this.defaultActions[_]:(null==O&&(O=y()),x=o[_]&&o[_][O]),void 0===x||!x.length||!x[0]){var N="";for(b in R=[],o[_])this.terminals_[b]&&b>2&&R.push("'"+this.terminals_[b]+"'");N=p.showPosition?"Parse error on line "+(d+1)+":\n"+p.showPosition()+"\nExpecting "+R.join(", ")+", got '"+(this.terminals_[O]||O)+"'":"Parse error on line "+(d+1)+": Unexpected "+(1==O?"end of input":"'"+(this.terminals_[O]||O)+"'"),this.parseError(N,{text:p.match,token:this.terminals_[O]||O,line:p.yylineno,loc:g,expected:R})}if(x[0]instanceof Array&&x.length>1)throw new Error("Parse Error: multiple actions possible at state: "+_+", token: "+O);switch(x[0]){case 1:r.push(O),i.push(p.yytext),n.push(p.yylloc),r.push(x[1]),O=null,l=p.yyleng,c=p.yytext,d=p.yylineno,g=p.yylloc;break;case 2:if(I=this.productions_[x[1]][1],L.$=i[i.length-I],L._$={first_line:n[n.length-(I||1)].first_line,last_line:n[n.length-1].last_line,first_column:n[n.length-(I||1)].first_column,last_column:n[n.length-1].last_column},u&&(L._$.range=[n[n.length-(I||1)].range[0],n[n.length-1].range[1]]),void 0!==(m=this.performAction.apply(L,[c,l,d,T.yy,x[1],i,n].concat(h))))return m;I&&(r=r.slice(0,-1*I*2),i=i.slice(0,-1*I),n=n.slice(0,-1*I)),r.push(this.productions_[x[1]][0]),i.push(L.$),n.push(L._$),f=o[r[r.length-2]][r[r.length-1]],r.push(f);break;case 3:return!0}}return!0},"parse")},It=function(){return{EOF:1,parseError:e(function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},"parseError"),setInput:e(function(t,e){return this.yy=e||this.yy||{},this._input=t,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},"setInput"),input:e(function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},"input"),unput:e(function(t){var e=t.length,a=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var r=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),a.length-1&&(this.yylineno-=a.length-1);var s=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:a?(a.length===r.length?this.yylloc.first_column:0)+r[r.length-a.length].length-a[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[s[0],s[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},"unput"),more:e(function(){return this._more=!0,this},"more"),reject:e(function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):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).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"reject"),less:e(function(t){this.unput(this.match.slice(t))},"less"),pastInput:e(function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:e(function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:e(function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},"showPosition"),test_match:e(function(t,e){var a,r,s;if(this.options.backtrack_lexer&&(s={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&&(s.yylloc.range=this.yylloc.range.slice(0))),(r=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,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(t[0].length),this.matched+=t[0],a=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),a)return a;if(this._backtrack){for(var i in s)this[i]=s[i];return!1}return!1},"test_match"),next:e(function(){if(this.done)return this.EOF;var t,e,a,r;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var s=this._currentRules(),i=0;i<s.length;i++)if((a=this._input.match(this.rules[s[i]]))&&(!e||a[0].length>e[0].length)){if(e=a,r=i,this.options.backtrack_lexer){if(!1!==(t=this.test_match(a,s[i])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,s[r]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:e(function(){var t=this.next();return t||this.lex()},"lex"),begin:e(function(t){this.conditionStack.push(t)},"begin"),popState:e(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:e(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:e(function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},"topState"),pushState:e(function(t){this.begin(t)},"pushState"),stateStackSize:e(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:e(function(t,e,a,r){switch(a){case 0:case 59:case 92:return 5;case 1:case 2:case 3:case 4:case 5:break;case 6:return 20;case 7:return this.begin("CONFIG"),75;case 8:return 76;case 9:return this.popState(),this.begin("ALIAS"),77;case 10:return this.popState(),this.popState(),77;case 11:case 60:return e.yytext=e.yytext.trim(),73;case 12:return e.yytext=e.yytext.trim(),this.begin("ALIAS"),73;case 13:return e.yytext=e.yytext.trim(),this.popState(),73;case 14:return this.popState(),10;case 15:return e.yytext=e.yytext.trim(),this.popState(),10;case 16:return this.begin("LINE"),15;case 17:return this.begin("ID"),51;case 18:return this.begin("ID"),53;case 19:return 14;case 20:return this.begin("ID"),54;case 21:return this.popState(),this.popState(),this.begin("LINE"),52;case 22:return this.popState(),this.popState(),5;case 23:return this.begin("LINE"),37;case 24:return this.begin("LINE"),38;case 25:return this.begin("LINE"),39;case 26:return this.begin("LINE"),40;case 27:return this.begin("LINE"),50;case 28:return this.begin("LINE"),42;case 29:return this.begin("LINE"),44;case 30:return this.begin("LINE"),49;case 31:return this.begin("LINE"),45;case 32:return this.begin("LINE"),48;case 33:return this.begin("LINE"),47;case 34:return this.popState(),16;case 35:return 17;case 36:return 67;case 37:return 68;case 38:return 61;case 39:return 62;case 40:return 63;case 41:return 64;case 42:return 59;case 43:return 56;case 44:return this.begin("ID"),22;case 45:return this.begin("ID"),24;case 46:return 30;case 47:return 31;case 48:return this.begin("acc_title"),32;case 49:return this.popState(),"acc_title_value";case 50:return this.begin("acc_descr"),34;case 51:return this.popState(),"acc_descr_value";case 52:this.begin("acc_descr_multiline");break;case 53:this.popState();break;case 54:return"acc_descr_multiline_value";case 55:return 6;case 56:return 19;case 57:return 21;case 58:return 66;case 61:return 80;case 62:return 97;case 63:return 98;case 64:return 99;case 65:return 78;case 66:return 79;case 67:return 100;case 68:return 101;case 69:return 102;case 70:return 103;case 71:return 85;case 72:return 86;case 73:return 87;case 74:return 88;case 75:return 93;case 76:return 94;case 77:return 95;case 78:return 96;case 79:return 81;case 80:return 82;case 81:return 83;case 82:return 84;case 83:return 89;case 84:return 90;case 85:return 91;case 86:return 92;case 87:case 88:return 104;case 89:return 70;case 90:return 71;case 91:return 72;case 93:return 10}},"anonymous"),rules:[/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:([0-9]+(\.[0-9]{1,2})?|\.[0-9]{1,2})(?=[ \n]+))/i,/^(?:@\{)/i,/^(?:[^\}]+)/i,/^(?:\}(?=\s+as\s))/i,/^(?:\})/i,/^(?:[^<>:\n,;@\s]+(?=\s*@\{))/i,/^(?:[^<>:\n,;@\s]+(?=\s+as\s))/i,/^(?:[^<>:\n,;@]+(?=\s*[\n;#]|$))/i,/^(?:[^<>:\n,;@]*<[^\n]*)/i,/^(?:[^\n]+)/i,/^(?:box\b)/i,/^(?:participant\b)/i,/^(?:actor\b)/i,/^(?:create\b)/i,/^(?:destroy\b)/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(?=[ \t]+[^\/\\\+\(\)<>:\n,;\s\-]))/i,/^(?:link(?=[ \t]+[^\/\\\+\(\)<>:\n,;\s\-]))/i,/^(?:properties(?=[ \t]+[^\/\\\+\(\)<>:\n,;\s\-]))/i,/^(?:details(?=[ \t]+[^\/\\\+\(\)<>:\n,;\s\-]))/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,/^(?:->)/i,/^(?:-->)/i,/^(?:-[x])/i,/^(?:--[x])/i,/^(?:-[\)])/i,/^(?:--[\)])/i,/^(?:--\|\\)/i,/^(?:--\|\/)/i,/^(?:--\\\\)/i,/^(?:--\/\/)/i,/^(?:\/\|--)/i,/^(?:\\\|--)/i,/^(?:\/\/--)/i,/^(?:\\\\--)/i,/^(?:-\|\\)/i,/^(?:-\|\/)/i,/^(?:-\\\\)/i,/^(?:-\/\/)/i,/^(?:\/\|-)/i,/^(?:\\\|-)/i,/^(?:\/\/-)/i,/^(?:\\\\-)/i,/^(?::(?:(?:no)?wrap)?[^#\n;]*)/i,/^(?::)/i,/^(?:\+)/i,/^(?:-)/i,/^(?:\(\))/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[53,54],inclusive:!1},acc_descr:{rules:[51],inclusive:!1},acc_title:{rules:[49],inclusive:!1},ID:{rules:[2,3,7,11,12,13,14,15],inclusive:!1},ALIAS:{rules:[2,3,21,22],inclusive:!1},LINE:{rules:[2,3,34],inclusive:!1},CONFIG:{rules:[8,9,10],inclusive:!1},CONFIG_DATA:{rules:[],inclusive:!1},INITIAL:{rules:[0,1,3,4,5,6,16,17,18,19,20,23,24,25,26,27,28,29,30,31,32,33,35,36,37,38,39,40,41,42,43,44,45,46,47,48,50,52,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93],inclusive:!0}}}}();function ft(){this.yy={}}return bt.lexer=It,e(ft,"Parser"),ft.prototype=bt,bt.Parser=ft,new ft}();C.parser=C;var M=C,v={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,BIDIRECTIONAL_SOLID:33,BIDIRECTIONAL_DOTTED:34,SOLID_TOP:41,SOLID_BOTTOM:42,STICK_TOP:43,STICK_BOTTOM:44,SOLID_ARROW_TOP_REVERSE:45,SOLID_ARROW_BOTTOM_REVERSE:46,STICK_ARROW_TOP_REVERSE:47,STICK_ARROW_BOTTOM_REVERSE:48,SOLID_TOP_DOTTED:51,SOLID_BOTTOM_DOTTED:52,STICK_TOP_DOTTED:53,STICK_BOTTOM_DOTTED:54,SOLID_ARROW_TOP_REVERSE_DOTTED:55,SOLID_ARROW_BOTTOM_REVERSE_DOTTED:56,STICK_ARROW_TOP_REVERSE_DOTTED:57,STICK_ARROW_BOTTOM_REVERSE_DOTTED:58,CENTRAL_CONNECTION:59,CENTRAL_CONNECTION_REVERSE:60,CENTRAL_CONNECTION_DUAL:61},Y={FILLED:0,OPEN:1},B={LEFTOF:0,RIGHTOF:1,OVER:2},$="actor",V="control",W="database",F="entity",K=class{constructor(){this.state=new t(()=>({prevActor:void 0,actors:new Map,createdActors:new Map,destroyedActors:new Map,boxes:[],messages:[],notes:[],sequenceNumbersEnabled:!1,wrapEnabled:void 0,currentBox:void 0,lastCreated:void 0,lastDestroyed:void 0})),this.setAccTitle=l,this.setAccDescription=h,this.setDiagramTitle=p,this.getAccTitle=T,this.getAccDescription=E,this.getDiagramTitle=g,this.apply=this.apply.bind(this),this.parseBoxData=this.parseBoxData.bind(this),this.parseMessage=this.parseMessage.bind(this),this.clear(),this.setWrap(r().wrap),this.LINETYPE=v,this.ARROWTYPE=Y,this.PLACEMENT=B}static{e(this,"SequenceDB")}addBox(t){this.state.records.boxes.push({name:t.text,wrap:t.wrap??this.autoWrap(),fill:t.color,actorKeys:[]}),this.state.records.currentBox=this.state.records.boxes.slice(-1)[0]}addActor(t,e,a,r,s){let i,n=this.state.records.currentBox;if(void 0!==s){let t;t=s.includes("\n")?s+"\n":"{\n"+s+"\n}",i=u(t,{schema:y})}r=i?.type??r,!i?.alias||a&&a.text!==e||(a={text:i.alias,wrap:a?.wrap,type:r});const o=this.state.records.actors.get(t);if(o){if(this.state.records.currentBox&&o.box&&this.state.records.currentBox!==o.box)throw new Error(`A same participant should only be defined in one Box: ${o.name} can't be in '${o.box.name}' and in '${this.state.records.currentBox.name}' at the same time.`);if(n=o.box?o.box:this.state.records.currentBox,o.box=n,o&&e===o.name&&null==a)return}if(null==a?.text&&(a={text:e,type:r}),null!=r&&null!=a.text||(a={text:e,type:r}),this.state.records.actors.set(t,{box:n,name:e,description:a.text,wrap:a.wrap??this.autoWrap(),prevActor:this.state.records.prevActor,links:{},properties:{},actorCnt:null,rectData:null,type:r??"participant"}),this.state.records.prevActor){const e=this.state.records.actors.get(this.state.records.prevActor);e&&(e.nextActor=t)}this.state.records.currentBox&&this.state.records.currentBox.actorKeys.push(t),this.state.records.prevActor=t}activationCount(t){let e,a=0;if(!t)return 0;for(e=0;e<this.state.records.messages.length;e++)this.state.records.messages[e].type===this.LINETYPE.ACTIVE_START&&this.state.records.messages[e].from===t&&a++,this.state.records.messages[e].type===this.LINETYPE.ACTIVE_END&&this.state.records.messages[e].from===t&&a--;return a}addMessage(t,e,a,r){this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:t,to:e,message:a.text,wrap:a.wrap??this.autoWrap(),answer:r})}addSignal(t,e,a,r,s=!1,i){if(r===this.LINETYPE.ACTIVE_END){if(this.activationCount(t??"")<1){const e=new Error("Trying to inactivate an inactive participant ("+t+")");throw e.hash={text:"->>-",token:"->>-",line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:["'ACTIVE_PARTICIPANT'"]},e}}return this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:t,to:e,message:a?.text??"",wrap:a?.wrap??this.autoWrap(),type:r,activate:s,centralConnection:i??0}),!0}hasAtLeastOneBox(){return this.state.records.boxes.length>0}hasAtLeastOneBoxWithTitle(){return this.state.records.boxes.some(t=>t.name)}getMessages(){return this.state.records.messages}getBoxes(){return this.state.records.boxes}getActors(){return this.state.records.actors}getCreatedActors(){return this.state.records.createdActors}getDestroyedActors(){return this.state.records.destroyedActors}getActor(t){return this.state.records.actors.get(t)}getActorKeys(){return[...this.state.records.actors.keys()]}enableSequenceNumbers(){this.state.records.sequenceNumbersEnabled=!0}disableSequenceNumbers(){this.state.records.sequenceNumbersEnabled=!1}showSequenceNumbers(){return this.state.records.sequenceNumbersEnabled}setWrap(t){this.state.records.wrapEnabled=t}extractWrap(t){if(void 0===t)return{};t=t.trim();const e=null!==/^:?wrap:/.exec(t)||null===/^:?nowrap:/.exec(t)&&void 0;return{cleanedText:(void 0===e?t:t.replace(/^:?(?:no)?wrap:/,"")).trim(),wrap:e}}autoWrap(){return void 0!==this.state.records.wrapEnabled?this.state.records.wrapEnabled:r().sequence?.wrap??!1}clear(){this.state.reset(),O()}parseMessage(t){const e=t.trim(),{wrap:a,cleanedText:r}=this.extractWrap(e),s={text:r,wrap:a};return i.debug(`parseMessage: ${JSON.stringify(s)}`),s}parseBoxData(t){const e=/^((?:rgba?|hsla?)\s*\(.*\)|\w*)(.*)$/.exec(t);let a=e?.[1]?e[1].trim():"transparent",s=e?.[2]?e[2].trim():void 0;if(window?.CSS)window.CSS.supports("color",a)||(a="transparent",s=t.trim());else{const e=(new Option).style;e.color=a,e.color!==a&&(a="transparent",s=t.trim())}const{wrap:i,cleanedText:n}=this.extractWrap(s);return{text:n?_(n,r()):void 0,color:a,wrap:i}}addNote(t,e,a){const r={actor:t,placement:e,message:a.text,wrap:a.wrap??this.autoWrap()},s=[].concat(t,t);this.state.records.notes.push(r),this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:s[0],to:s[1],message:a.text,wrap:a.wrap??this.autoWrap(),type:this.LINETYPE.NOTE,placement:e})}addLinks(t,e){const a=this.getActor(t);try{let t=_(e.text,r());t=t.replace(/&equals;/g,"="),t=t.replace(/&amp;/g,"&");const s=JSON.parse(t);this.insertLinks(a,s)}catch(s){i.error("error while parsing actor link text",s)}}addALink(t,e){const a=this.getActor(t);try{const t={};let s=_(e.text,r());const i=s.indexOf("@");s=s.replace(/&equals;/g,"="),s=s.replace(/&amp;/g,"&");const n=s.slice(0,i-1).trim(),o=s.slice(i+1).trim();t[n]=o,this.insertLinks(a,t)}catch(s){i.error("error while parsing actor link text",s)}}insertLinks(t,e){if(null==t.links)t.links=e;else for(const a in e)t.links[a]=e[a]}addProperties(t,e){const a=this.getActor(t);try{const t=_(e.text,r()),s=JSON.parse(t);this.insertProperties(a,s)}catch(s){i.error("error while parsing actor properties text",s)}}insertProperties(t,e){if(null==t.properties)t.properties=e;else for(const a in e)t.properties[a]=e[a]}boxEnd(){this.state.records.currentBox=void 0}addDetails(t,e){const a=this.getActor(t),r=document.getElementById(e.text);try{const t=r.innerHTML,e=JSON.parse(t);e.properties&&this.insertProperties(a,e.properties),e.links&&this.insertLinks(a,e.links)}catch(s){i.error("error while parsing actor details text",s)}}getActorProperty(t,e){if(void 0!==t?.properties)return t.properties[e]}apply(t){if(Array.isArray(t))t.forEach(t=>{this.apply(t)});else switch(t.type){case"sequenceIndex":this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:void 0,to:void 0,message:{start:t.sequenceIndex,step:t.sequenceIndexStep,visible:t.sequenceVisible},wrap:!1,type:t.signalType});break;case"addParticipant":this.addActor(t.actor,t.actor,t.description,t.draw,t.config);break;case"createParticipant":if(this.state.records.actors.has(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");this.state.records.lastCreated=t.actor,this.addActor(t.actor,t.actor,t.description,t.draw,t.config),this.state.records.createdActors.set(t.actor,this.state.records.messages.length);break;case"destroyParticipant":this.state.records.lastDestroyed=t.actor,this.state.records.destroyedActors.set(t.actor,this.state.records.messages.length);break;case"activeStart":case"centralConnection":case"centralConnectionReverse":case"activeEnd":this.addSignal(t.actor,void 0,void 0,t.signalType);break;case"addNote":this.addNote(t.actor,t.placement,t.text);break;case"addLinks":this.addLinks(t.actor,t.text);break;case"addALink":this.addALink(t.actor,t.text);break;case"addProperties":this.addProperties(t.actor,t.text);break;case"addDetails":this.addDetails(t.actor,t.text);break;case"addMessage":if(this.state.records.lastCreated){if(t.to!==this.state.records.lastCreated)throw new Error("The created participant "+this.state.records.lastCreated.name+" does not have an associated creating message after its declaration. Please check the sequence diagram.");this.state.records.lastCreated=void 0}else if(this.state.records.lastDestroyed){if(t.to!==this.state.records.lastDestroyed&&t.from!==this.state.records.lastDestroyed)throw new Error("The destroyed participant "+this.state.records.lastDestroyed.name+" does not have an associated destroying message after its declaration. Please check the sequence diagram.");this.state.records.lastDestroyed=void 0}this.addSignal(t.from,t.to,t.msg,t.signalType,t.activate,t.centralConnection);break;case"boxStart":this.addBox(t.boxData);break;case"boxEnd":this.boxEnd();break;case"loopStart":this.addSignal(void 0,void 0,t.loopText,t.signalType);break;case"loopEnd":case"rectEnd":case"optEnd":case"altEnd":case"parEnd":case"criticalEnd":case"breakEnd":this.addSignal(void 0,void 0,void 0,t.signalType);break;case"rectStart":this.addSignal(void 0,void 0,t.color,t.signalType);break;case"optStart":this.addSignal(void 0,void 0,t.optText,t.signalType);break;case"altStart":case"else":this.addSignal(void 0,void 0,t.altText,t.signalType);break;case"setAccTitle":l(t.text);break;case"parStart":case"and":this.addSignal(void 0,void 0,t.parText,t.signalType);break;case"criticalStart":this.addSignal(void 0,void 0,t.criticalText,t.signalType);break;case"option":this.addSignal(void 0,void 0,t.optionText,t.signalType);break;case"breakStart":this.addSignal(void 0,void 0,t.breakText,t.signalType)}}getConfig(){return r().sequence}},q=e(t=>{const e=t.dropShadow??"none",{look:a}=r();return`.actor {\n stroke: ${t.actorBorder};\n fill: ${t.actorBkg};\n stroke-width: ${t.strokeWidth??1};\n }\n\n rect.actor.outer-path[data-look="neo"] {\n filter: ${e};\n }\n\n rect.note[data-look="neo"] {\n stroke:${t.noteBorderColor};\n fill:${t.noteBkgColor};\n filter: ${e};\n }\n\n text.actor > tspan {\n fill: ${t.actorTextColor};\n stroke: none;\n }\n\n .actor-line {\n stroke: ${t.actorLineColor};\n }\n\n .innerArc {\n stroke-width: 1.5;\n stroke-dasharray: none;\n }\n\n .messageLine0 {\n stroke-width: 1.5;\n stroke-dasharray: none;\n stroke: ${t.signalColor};\n }\n\n .messageLine1 {\n stroke-width: 1.5;\n stroke-dasharray: 2, 2;\n stroke: ${t.signalColor};\n }\n\n [id$="-arrowhead"] path {\n fill: ${t.signalColor};\n stroke: ${t.signalColor};\n }\n\n .sequenceNumber {\n fill: ${t.sequenceNumberColor};\n }\n\n [id$="-sequencenumber"] {\n fill: ${t.signalColor};\n }\n\n [id$="-crosshead"] path {\n fill: ${t.signalColor};\n stroke: ${t.signalColor};\n }\n\n .messageText {\n fill: ${t.signalTextColor};\n stroke: none;\n }\n\n .labelBox {\n stroke: ${t.labelBoxBorderColor};\n fill: ${t.labelBoxBkgColor};\n filter: ${"neo"===a?e:"none"};\n }\n\n .labelText, .labelText > tspan {\n fill: ${t.labelTextColor};\n stroke: none;\n }\n\n .loopText, .loopText > tspan {\n fill: ${t.loopTextColor};\n stroke: none;\n }\n\n .sectionTitle, .sectionTitle > tspan {\n fill: ${t.loopTextColor};\n stroke: none;\n }\n\n .loopLine {\n stroke-width: 2px;\n stroke-dasharray: 2, 2;\n stroke: ${t.labelBoxBorderColor};\n fill: ${t.labelBoxBorderColor};\n }\n\n .note {\n //stroke: #decc93;\n stroke: ${t.noteBorderColor};\n fill: ${t.noteBkgColor};\n }\n\n /*\n * No font-weight here, deliberately. Note text renders inside tspan elements, and a weight emitted at\n * tspan level outranks the inline style drawText puts on the parent text element from the\n * sequence.noteFontWeight config key -- so that documented key would never reach the glyphs.\n * The theme variable formerly emitted here is a different value from that config key, and\n * git/styles.js reads it as its own bold-label weight under redux and neo, so it cannot be\n * lowered there either.\n */\n .noteText, .noteText > tspan {\n fill: ${t.noteTextColor};\n stroke: none;\n }\n\n .activation0 {\n fill: ${t.activationBkgColor};\n stroke: ${t.activationBorderColor};\n }\n\n .activation1 {\n fill: ${t.activationBkgColor};\n stroke: ${t.activationBorderColor};\n }\n\n .activation2 {\n fill: ${t.activationBkgColor};\n stroke: ${t.activationBorderColor};\n }\n\n .actorPopupMenu {\n position: absolute;\n }\n\n .actorPopupMenuPanel {\n position: absolute;\n fill: ${t.actorBkg};\n box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);\n filter: drop-shadow(3px 5px 2px rgb(0 0 0 / 0.4));\n}\n .actor-man circle, line {\n fill: ${t.actorBkg};\n stroke-width: 2px;\n }\n\n g rect.rect {\n filter: ${e};\n stroke: ${t.nodeBorder};\n }\n`},"getStyles"),H=e((t,e)=>t.actorTextHeight??x.calculateTextDimensions(t.description??"",{fontFamily:e.actorFontFamily,fontSize:e.actorFontSize,fontWeight:e.actorFontWeight}).height,"actorLabelHeight"),z=e(t=>50+t+6,"actorStackHeight"),U=e((t,e,a)=>{const r=t+e;return{lifelineStartY:r,glyphBottomY:r-6-a-6,labelCenterY:r-6-a/2}},"headerBands"),j=e((t,e)=>{const a=t+6,r=a+44;return{glyphTopY:a,glyphBottomY:r,labelCenterY:r+6+e/2,stackHeight:z(e)}},"footerBands"),G=e((t,e,a,r)=>{if("neo"!==e.look)return null;const s=H(t,e);return a?j(r,s):U(r,t.height,s)},"neoBands"),X="actor-top",J="actor-bottom",Z="actor-box",Q="actor-man",tt=new Set(["redux-color","redux-dark-color"]),et=e((t,e)=>t?.length?t[e%t.length]:void 0,"paletteColor"),at=e(function(t,e){const a=D(t,e);return"neo"===R().look&&a.attr("data-look","neo"),a},"drawRect"),rt=e(function(t,e,a,r,s){if(void 0===e.links||null===e.links||0===Object.keys(e.links).length)return{height:0,width:0};const i=e.links,o=e.actorCnt,c=e.rectData;var d="none";s&&(d="block !important");const l=t.append("g");l.attr("id","actor"+o+"_popup"),l.attr("class","actorPopupMenu"),l.attr("display",d);var h="";void 0!==c.class&&(h=" "+c.class);let p=c.width>a?c.width:a;const T=l.append("rect");if(T.attr("class","actorPopupMenuPanel"+h),T.attr("x",c.x),T.attr("y",c.height),T.attr("fill",c.fill),T.attr("stroke",c.stroke),T.attr("width",p),T.attr("height",c.height),T.attr("rx",c.rx),T.attr("ry",c.ry),null!=i){var E=20;for(let t in i){var g=l.append("a"),u=n.sanitizeUrl(i[t]);g.attr("xlink:href",u),g.attr("target","_blank"),vt(r)(t,g,c.x+10,c.height+E,p,20,{class:"actor"},r),E+=30}}return T.attr("height",E),{height:c.height+E,width:p}},"drawPopup"),st=e(function(t){return"var pu = document.getElementById('"+t+"'); if (pu != null) { pu.style.display = pu.style.display == 'block' ? 'none' : 'block'; }"},"popupMenuToggle"),it=e(async function(t,e,a=null){let r=t.append("foreignObject");const s=await N(e.text,R()),i=r.append("xhtml:div").attr("style","width: fit-content;").attr("xmlns","http://www.w3.org/1999/xhtml").html(s).node().getBoundingClientRect();if(r.attr("height",Math.round(i.height)).attr("width",Math.round(i.width)),"noteText"===e.class){const a=t.node().firstChild;a.setAttribute("height",i.height+2*e.textMargin);const s=a.getBBox();r.attr("x",Math.round(s.x+s.width/2-i.width/2)).attr("y",Math.round(s.y+s.height/2-i.height/2))}else if(a){let{startx:t,stopx:s,starty:n}=a;if(t>s){const e=t;t=s,s=e}r.attr("x",Math.round(t+Math.abs(t-s)/2-i.width/2)),"loopText"===e.class?r.attr("y",Math.round(n)):r.attr("y",Math.round(n-i.height))}return[r]},"drawKatex"),nt=e(function(t,a){let r=0,s=0;const i=a.text.split(d.lineBreakRegex),[n,o]=I(a.fontSize);let c=[],l=0,h=e(()=>a.y,"yfunc");if(void 0!==a.valign&&void 0!==a.textMargin&&a.textMargin>0)switch(a.valign){case"top":case"start":h=e(()=>Math.round(a.y+a.textMargin),"yfunc");break;case"middle":case"center":h=e(()=>Math.round(a.y+(r+s+a.textMargin)/2),"yfunc");break;case"bottom":case"end":h=e(()=>Math.round(a.y+(r+s+2*a.textMargin)-a.textMargin),"yfunc")}if(void 0!==a.anchor&&void 0!==a.textMargin&&void 0!==a.width)switch(a.anchor){case"left":case"start":a.x=Math.round(a.x+a.textMargin),a.anchor="start",a.dominantBaseline="middle",a.alignmentBaseline="middle";break;case"middle":case"center":a.x=Math.round(a.x+a.width/2),a.anchor="middle",a.dominantBaseline="middle",a.alignmentBaseline="middle";break;case"right":case"end":a.x=Math.round(a.x+a.width-a.textMargin),a.anchor="end",a.dominantBaseline="middle",a.alignmentBaseline="middle"}for(let[e,d]of i.entries()){void 0!==a.textMargin&&0===a.textMargin&&void 0!==n&&(l=e*n);const i=t.append("text");i.attr("x",a.x),i.attr("y",h()),void 0!==a.anchor&&i.attr("text-anchor",a.anchor).attr("dominant-baseline",a.dominantBaseline).attr("alignment-baseline",a.alignmentBaseline),void 0!==a.fontFamily&&i.style("font-family",a.fontFamily),void 0!==o&&i.style("font-size",o),void 0!==a.fontWeight&&i.style("font-weight",a.fontWeight),void 0!==a.fill&&i.attr("fill",a.fill),void 0!==a.class&&i.attr("class",a.class),void 0!==a.dy?i.attr("dy",a.dy):0!==l&&i.attr("dy",l);const p=d||f;if(a.tspan){const t=i.append("tspan");t.attr("x",a.x),void 0!==a.fill&&t.attr("fill",a.fill),t.text(p)}else i.text(p);void 0!==a.valign&&void 0!==a.textMargin&&a.textMargin>0&&(s+=(i._groups||i)[0][0].getBBox().height,r=s),c.push(i)}return c},"drawText"),ot=e(function(t,a){function r(t,e,a,r,s){return t+","+e+" "+(t+a)+","+e+" "+(t+a)+","+(e+r-s)+" "+(t+a-1.2*s)+","+(e+r)+" "+t+","+(e+r)}e(r,"genPoints");const s=t.append("polygon");return s.attr("points",r(a.x,a.y,a.width,a.height,7)),s.attr("class","labelBox"),a.y=a.y+a.height/2,nt(t,a),s},"drawLabel"),ct=-1,dt=e((t,e,a,r)=>{t.select&&a.forEach(a=>{const s=e.get(a),i=t.select("#actor"+s.actorCnt);!r.mirrorActors&&s.stopy?i.attr("y2",s.stopy+s.height/2):r.mirrorActors&&i.attr("y2",s.stopy)})},"fixLifeLineHeights"),lt=e(function(t,e,a,r,s,i){const n=r?e.stopy:e.starty,o=e.x+e.width/2,c=n+e.height,{look:d,theme:l,themeVariables:h}=a,{bkgColorArray:p,borderColorArray:T}=h,E=t.append("g").lower();var g=E;r||(ct++,Object.keys(e.links||{}).length&&!a.forceMenus&&g.attr("onclick",st(`actor${ct}_popup`)).attr("cursor","pointer"),g.append("line").attr("id","actor"+ct).attr("x1",o).attr("y1",c).attr("x2",o).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),g=E.append("g"),e.actorCnt=ct,null!=e.links&&g.attr("id","root-"+ct),"neo"===d&&g.attr("data-look","neo"));const u=P();var y="actor";e.properties?.class?y=e.properties.class:u.fill="#eaeaea",y+=r?` ${J}`:` ${X}`,u.x=e.x,u.y=n,u.width=e.width,u.height=e.height,u.class=y,u.rx=3,u.ry=3,u.name=e.name,"neo"===d&&(u.rx=6,u.ry=6);const O=at(g,u),_=i.get(e.name)??0;if(tt.has(l)&&(O.style("stroke",et(T,_)),O.style("fill",et(p,_))),"neo"===d&&O.attr("filter",`url(#${Dt(s)})`),e.rectData=u,e.properties?.icon){const t=e.properties.icon.trim();"@"===t.charAt(0)?A(g,u.x+u.width-20,u.y+10,t.substr(1)):k(g,u.x+u.width-20,u.y+10,t)}r||(g.attr("data-et","participant"),g.attr("data-type","participant"),g.attr("data-id",e.name)),Mt(a,m(e.description))(e.description,g,u.x,u.y,u.width,u.height,{class:`actor ${Z}`},a);let x=e.height;if(O.node){const t=O.node().getBBox();"neo"!==a.look&&(e.height=t.height,x=t.height)}return x},"drawActorTypeParticipant"),ht=e(function(t,e,a,r,s,i){const n=r?e.stopy:e.starty,o=e.x+e.width/2,c=n+e.height,{look:d,theme:l,themeVariables:h}=a,{bkgColorArray:p,borderColorArray:T}=h,E=t.append("g").lower();var g=E;r||(ct++,Object.keys(e.links||{}).length&&!a.forceMenus&&g.attr("onclick",st(`actor${ct}_popup`)).attr("cursor","pointer"),g.append("line").attr("id","actor"+ct).attr("x1",o).attr("y1",c).attr("x2",o).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),g=E.append("g"),e.actorCnt=ct,null!=e.links&&g.attr("id","root-"+ct),"neo"===d&&g.attr("data-look","neo"));const u=P();var y="actor";e.properties?.class?y=e.properties.class:u.fill="#eaeaea",y+=r?` ${J}`:` ${X}`,u.x=e.x,u.y=n,u.width=e.width,u.height=e.height,u.class=y,u.name=e.name;"neo"===a.look&&(u.height=e.height-6);const O={...u,x:u.x+-6,y:u.y+6,class:"actor"},_=at(g,u),x=at(g,O);e.rectData=u,"neo"===d&&g.attr("filter",`url(#${Dt(s)})`);const b=i.get(e.name)??0;if(tt.has(l)&&(_.style("stroke",et(T,b)),_.style("fill",et(p,b)),x.style("stroke",et(T,b)),x.style("fill",et(p,b))),e.properties?.icon){const t=e.properties.icon.trim();"@"===t.charAt(0)?A(g,u.x+u.width-20,u.y+10,t.substr(1)):k(g,u.x+u.width-20,u.y+10,t)}Mt(a,m(e.description))(e.description,g,u.x-6,u.y+6,u.width,u.height,{class:`actor ${Z}`},a);let I=e.height;if(_.node){const t=_.node().getBBox();"neo"!==a.look&&(e.height=t.height,I=t.height)}return r||(g.attr("data-et","participant"),g.attr("data-type","collections"),g.attr("data-id",e.name)),I},"drawActorTypeCollections"),pt=e(function(t,e,a,r,s,i){const n=r?e.stopy:e.starty,o=e.x+e.width/2,c=n+e.height,{look:d,theme:l,themeVariables:h}=a,{bkgColorArray:p,borderColorArray:T}=h,E=t.append("g").lower();let g=E;r||(ct++,Object.keys(e.links||{}).length&&!a.forceMenus&&g.attr("onclick",st(`actor${ct}_popup`)).attr("cursor","pointer"),g.append("line").attr("id","actor"+ct).attr("x1",o).attr("y1",c).attr("x2",o).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),g=E.append("g"),e.actorCnt=ct,null!=e.links&&g.attr("id","root-"+ct),"neo"===d&&g.attr("data-look","neo"));const u=P();let y="actor";e.properties?.class?y=e.properties.class:u.fill="#eaeaea",y+=r?` ${J}`:` ${X}`,g.attr("class",y),u.x=e.x,u.y=n,u.width=e.width,u.height=e.height,u.name=e.name;const O=u.height/2,_=O/(2.5+u.height/50),x=g.append("g"),b=g.append("g"),I=`M ${u.x},${u.y+O}\n a ${_},${O} 0 0 0 0,${u.height}\n h ${u.width-2*_}\n a ${_},${O} 0 0 0 0,-${u.height}\n Z\n `;x.append("path").attr("d",I),b.append("path").attr("d",`M ${u.x},${u.y+O}\n a ${_},${O} 0 0 0 0,${u.height}`),x.attr("transform",`translate(${_}, ${-u.height/2})`),b.attr("transform",`translate(${u.width-_}, ${-u.height/2})`),e.rectData=u,"neo"===d&&x.attr("filter",`url(#${Dt(s)})`);const f=i.get(e.name)??0;if(tt.has(l)&&(x.style("stroke",et(T,f)),x.style("fill",et(p,f)),b.style("stroke",et(T,f)),b.style("fill",et(p,f))),e.properties?.icon){const t=e.properties.icon.trim(),a=u.x+u.width-20,r=u.y+10;"@"===t.charAt(0)?A(g,a,r,t.substr(1)):k(g,a,r,t)}Mt(a,m(e.description))(e.description,g,u.x,u.y,u.width,u.height,{class:`actor ${Z}`},a);let R=e.height;const L=x.select("path:last-child");if(L.node()){const t=L.node().getBBox();"neo"!==a.look&&(e.height=t.height,R=t.height)}return r||(g.attr("data-et","participant"),g.attr("data-type","queue"),g.attr("data-id",e.name)),R},"drawActorTypeQueue"),Tt=e(function(t,e,a,r,s,i){const n=r?e.stopy:e.starty,o=e.x+e.width/2,c=G(e,a,r,n),d=c?c.lifelineStartY:n+75,{look:l,theme:h,themeVariables:p}=a,{bkgColorArray:T,borderColorArray:E,actorBorder:g,actorBkg:u}=p,y=t.append("g").lower();r||(ct++,y.append("line").attr("id","actor"+ct).attr("x1",o).attr("y1",d).attr("x2",o).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),e.actorCnt=ct);const O=t.append("g");let _=Q;_+=r?` ${J}`:` ${X}`,O.attr("class",_),O.attr("name",e.name);const x=P();x.x=e.x,x.y=n,x.fill="#eaeaea",x.width=e.width,x.height=e.height,x.class="actor";const b=e.x+e.width/2,I=c?c.glyphBottomY-22:n+32;O.append("defs").append("marker").attr("id",s+"-filled-head-control").attr("refX",11).attr("refY",5.8).attr("markerWidth",20).attr("markerHeight",28).attr("orient","172.5").attr("stroke-width",1.2).append("path").attr("d","M 14.4 5.6 L 7.2 10.4 L 8.8 5.6 L 7.2 0.8 Z"),O.append("circle").attr("cx",b).attr("cy",I).attr("r",22).attr("filter",""+("neo"===l?`url(#${Dt(s)})`:"")),O.append("line").attr("marker-end","url(#"+s+"-filled-head-control)").attr("transform",`translate(${b}, ${I-22})`);const f=i.get(e.name)??0;if(tt.has(h)?(O.style("stroke",et(E,f)),O.style("fill",et(T,f))):(O.style("stroke",g),O.style("fill",u)),!c){const t=O.node().getBBox();e.height=t.height+2*(a?.sequence?.labelBoxHeight??0)}return Mt(a,m(e.description))(e.description,O,x.x,c?c.labelCenterY-x.height/2:x.y+22+(r?5:12),x.width,x.height,{class:`actor ${Q}`},a),r||(O.attr("data-et","participant"),O.attr("data-type","control"),O.attr("data-id",e.name)),e.height},"drawActorTypeControl"),Et=e(function(t,e,a,r,s,i){const n=r?e.stopy:e.starty,o=e.x+e.width/2,c=G(e,a,r,n),d=c?c.lifelineStartY:n+75,{look:l,theme:h,themeVariables:p}=a,{bkgColorArray:T,borderColorArray:E}=p,g=t.append("g").lower(),u=t.append("g");let y="actor";y+=r?` ${J}`:` ${X}`,u.attr("class",y),u.attr("name",e.name);const O=P();O.x=e.x,O.y=n,O.fill="#eaeaea",O.width=e.width,O.height=e.height,O.class="actor";const _=e.x+e.width/2,x=c?c.glyphBottomY-22:n+(r?10:25),b=22;u.append("circle").attr("cx",_).attr("cy",x).attr("r",b).attr("width",e.width).attr("height",e.height),u.append("line").attr("x1",_-b).attr("x2",_+b).attr("y1",x+b).attr("y2",x+b).attr("stroke-width",2),"neo"===l&&u.attr("filter",`url(#${Dt(s)})`);const I=i.get(e.name)??0;if(tt.has(h)&&(u.style("stroke",et(E,I)),u.style("fill",et(T,I))),!c){const t=u.node().getBBox();e.height=t.height+(a?.sequence?.labelBoxHeight??0)}return r||(ct++,g.append("line").attr("id","actor"+ct).attr("x1",o).attr("y1",d).attr("x2",o).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),e.actorCnt=ct),Mt(a,m(e.description))(e.description,u,O.x,c?c.labelCenterY-O.height/2:O.y+(r?15:30),O.width,O.height,{class:`actor ${Q}`},a),c||u.attr("transform",`translate(0, ${r?b:6})`),r||(u.attr("data-et","participant"),u.attr("data-type","entity"),u.attr("data-id",e.name)),e.height},"drawActorTypeEntity"),gt=e(function(t,e,a,r,s,i){const n=r?e.stopy:e.starty,o=e.x+e.width/2,c=G(e,a,r,n),d=c?c.lifelineStartY:n+e.height+2*a.boxTextMargin,{theme:l,themeVariables:h,look:p}=a,{bkgColorArray:T,borderColorArray:E,actorBorder:g}=h,u=t.append("g").lower();let y=u;r||(ct++,Object.keys(e.links||{}).length&&!a.forceMenus&&y.attr("onclick",st(`actor${ct}_popup`)).attr("cursor","pointer"),y.append("line").attr("id","actor"+ct).attr("x1",o).attr("y1",d).attr("x2",o).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),y=u.append("g"),e.actorCnt=ct,null!=e.links&&y.attr("id","root-"+ct),"neo"===p&&y.attr("data-look","neo"));const O=P();let _="actor";e.properties?.class?_=e.properties.class:O.fill="#eaeaea",_+=r?` ${J}`:` ${X}`,O.x=e.x,O.y=n,O.width=e.width,O.height=e.height,O.class=_,O.name=e.name,O.x=e.x,O.y=n;const x=O.width/3,b=x/2,I=b/(2.5+x/50),f=c?44:O.width/3,R=c?c.glyphBottomY-f-I:O.y,L=y.append("g");L.attr("class",_);const N=`\n M ${O.x},${R+I}\n a ${b},${I} 0 0 0 ${x},0\n a ${b},${I} 0 0 0 -${x},0\n l 0,${f-2*I}\n a ${b},${I} 0 0 0 ${x},0\n l 0,-${f-2*I}\n`;L.append("path").attr("d",N),"neo"===p&&L.attr("filter",`url(#${Dt(s)})`);const S=i.get(e.name)??0;if(tt.has(l)?(L.style("stroke",et(E,S)),L.style("fill",et(T,S))):L.style("stroke",g),L.attr("transform",`translate(${x}, ${I})`),e.rectData=O,Mt(a,m(e.description))(e.description,y,O.x,c?c.labelCenterY-O.height/2:O.y+35,O.width,O.height,{class:`actor ${Z}`},a),!c){const t=L.select("path:last-child");if(t.node()){const r=t.node().getBBox();e.height=r.height+(a.sequence.labelBoxHeight??0)}}return r||(y.attr("data-et","participant"),y.attr("data-type","database"),y.attr("data-id",e.name)),e.height},"drawActorTypeDatabase"),ut=e(function(t,e,a,r,s,i){const n=r?e.stopy:e.starty,o=e.x+e.width/2,c=G(e,a,r,n),d=c?c.lifelineStartY:n+80,l=22,h=c?c.glyphBottomY-l:n+12,p=t.append("g").lower(),{look:T,theme:E,themeVariables:g}=a,{bkgColorArray:u,borderColorArray:y,actorBorder:O}=g;r||(ct++,p.append("line").attr("id","actor"+ct).attr("x1",o).attr("y1",d).attr("x2",o).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),e.actorCnt=ct);const _=t.append("g");let x=Q;x+=r?` ${J}`:` ${X}`,_.attr("class",x),_.attr("name",e.name);const b=P();b.x=e.x,b.y=n,b.fill="#eaeaea",b.width=e.width,b.height=e.height,b.class="actor",_.append("line").attr("id","actor-man-torso"+ct).attr("x1",e.x+e.width/2-55).attr("y1",h).attr("x2",e.x+e.width/2-15).attr("y2",h),_.append("line").attr("id","actor-man-arms"+ct).attr("x1",e.x+e.width/2-55).attr("y1",h-10).attr("x2",e.x+e.width/2-55).attr("y2",h+10),_.append("circle").attr("cx",e.x+e.width/2).attr("cy",h).attr("r",l),"neo"===T&&_.attr("filter",`url(#${Dt(s)})`);const I=i.get(e.name)??0;if(tt.has(E)?(_.style("stroke",et(y,I)),_.style("fill",et(u,I))):_.style("stroke",O),!c){const t=_.node().getBBox();e.height=t.height+(a.sequence.labelBoxHeight??0)}return Mt(a,m(e.description))(e.description,_,b.x,c?c.labelCenterY-b.height/2:b.y+15,b.width,b.height,{class:`actor ${Q}`},a),c||_.attr("transform","translate(0,21)"),r||(_.attr("data-et","participant"),_.attr("data-type","boundary"),_.attr("data-id",e.name)),e.height},"drawActorTypeBoundary"),yt=e(function(t,a,r,s,i){const n=s?a.stopy:a.starty,o=a.x+a.width/2,c=G(a,r,s,n),d=c?c.lifelineStartY:n+80,{theme:l,themeVariables:h}=r,{bkgColorArray:p,borderColorArray:T,actorBorder:E}=h,g=t.append("g").lower();s||(ct++,g.append("line").attr("id","actor"+ct).attr("x1",o).attr("y1",d).attr("x2",o).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",a.name).attr("data-et","life-line").attr("data-id",a.name),a.actorCnt=ct);const u=t.append("g");let y=Q;y+=s?` ${J}`:` ${X}`,u.attr("class",y),u.attr("name",a.name),s||u.attr("data-et","participant").attr("data-type","actor").attr("data-id",a.name);const O=c?44/65:1,_=e(t=>c?c.glyphBottomY-(60-t)*O:n+t,"gy"),x=e(t=>o+t*O,"gx");u.append("line").attr("id","actor-man-torso"+ct).attr("x1",o).attr("y1",_(25)).attr("x2",o).attr("y2",_(45)),u.append("line").attr("id","actor-man-arms"+ct).attr("x1",x(-18)).attr("y1",_(33)).attr("x2",x(18)).attr("y2",_(33)),u.append("line").attr("x1",x(-18)).attr("y1",_(60)).attr("x2",o).attr("y2",_(45)),u.append("line").attr("x1",o).attr("y1",_(45)).attr("x2",x(16)).attr("y2",_(60));const b=u.append("circle");b.attr("cx",a.x+a.width/2),b.attr("cy",_(10)),b.attr("r",15*O),b.attr("width",a.width),b.attr("height",a.height),c||(a.height=65);const I=P();I.x=a.x,I.y=n,I.fill="#eaeaea",I.width=a.width,I.height=a.height,I.class="actor",I.rx=3,I.ry=3;const f=i.get(a.name)??0;return tt.has(l)?(u.style("stroke",et(T,f)),u.style("fill",et(p,f))):u.style("stroke",E),Mt(r,m(a.description))(a.description,u,I.x,c?c.labelCenterY-I.height/2:n+35,I.width,I.height,{class:`actor ${Q}`},r),a.height},"drawActorTypeActor"),Ot=e(async function(t,e,a,r,s,i,n){const o=n??new Map([...i.db.getActors().values()].map((t,e)=>[t.name,e]));switch(e.type){case"actor":return await yt(t,e,a,r,o);case"participant":return await lt(t,e,a,r,s,o);case"boundary":return await ut(t,e,a,r,s,o);case"control":return await Tt(t,e,a,r,s,o);case"entity":return await Et(t,e,a,r,s,o);case"database":return await gt(t,e,a,r,s,o);case"collections":return await ht(t,e,a,r,s,o);case"queue":return await pt(t,e,a,r,s,o)}},"drawActor"),_t=e(function(t,e,a){const r=t.append("g");It(r,e),e.name&&Mt(a)(e.name,r,e.x,e.y+a.boxTextMargin+(e.textMaxHeight||0)/2,e.width,0,{class:"text"},a),r.lower()},"drawBox"),xt=e(function(t){return t.append("g")},"anchorElement"),mt=e(function(t,e,a,r,s,i,n){const{theme:o,themeVariables:c}=r,{bkgColorArray:d,borderColorArray:l,mainBkg:h}=c,p=P(),T=e.anchored,E=e.actor;p.x=e.startx,p.y=e.starty,p.class="activation"+s%3,p.width=e.stopx-e.startx,p.height=a-e.starty;const g=at(T,p),u=(n??new Map([...i.db.getActors().values()].map((t,e)=>[t.name,e]))).get(E)??0;tt.has(o)&&(g.style("stroke",et(l,u)),g.style("fill",et(d,u)??h))},"drawActivation"),bt=e(async function(t,a,r,s,i){const{boxMargin:n,boxTextMargin:o,labelBoxHeight:c,labelBoxWidth:d,messageFontFamily:l,messageFontSize:h,messageFontWeight:p}=s,T=t.append("g").attr("data-et","control-structure").attr("data-id","i"+i.id),E=e(function(t,e,a,r){return T.append("line").attr("x1",t).attr("y1",e).attr("x2",a).attr("y2",r).attr("class","loopLine")},"drawLoopLine");E(a.startx,a.starty,a.stopx,a.starty),E(a.stopx,a.starty,a.stopx,a.stopy),E(a.startx,a.stopy,a.stopx,a.stopy),E(a.startx,a.starty,a.startx,a.stopy),void 0!==a.sections&&a.sections.forEach(function(t){E(a.startx,t.y,a.stopx,t.y).style("stroke-dasharray","3, 3")});let g=w();g.text=r,g.x=a.startx,g.y=a.starty,g.fontFamily=l,g.fontSize=h,g.fontWeight=p,g.anchor="middle",g.valign="middle",g.tspan=!1,g.width=Math.max(d??0,50),g.height=c+("neo"===s.look?15:0)||20,g.textMargin=o,g.class="labelText",ot(T,g),g=kt(),g.text=a.title,g.x=a.startx+d/2+(a.stopx-a.startx)/2,g.y=a.starty+n+o,g.anchor="middle",g.valign="middle",g.textMargin=o,g.class="loopText",g.fontFamily=l,g.fontSize=h,g.fontWeight=p,g.wrap=!0;let u=m(g.text)?await it(T,g,a):nt(T,g);if(void 0!==a.sectionTitles)for(const[e,y]of Object.entries(a.sectionTitles))if(y.message){g.text=y.message,g.x=a.startx+(a.stopx-a.startx)/2,g.y=a.sections[e].y+n+o,g.class="sectionTitle",g.anchor="middle",g.valign="middle",g.tspan=!1,g.fontFamily=l,g.fontSize=h,g.fontWeight=p,g.wrap=a.wrap,m(g.text)?(a.starty=a.sections[e].y,await it(T,g,a)):nt(T,g);let t=Math.round(u.map(t=>(t._groups||t)[0][0].getBBox().height).reduce((t,e)=>t+e));a.sections[e].height+=t-(n+o)}return a.height=Math.round(a.stopy-a.starty),T},"drawLoop"),It=e(function(t,e){S(t,e)},"drawBackgroundRect"),ft=e(function(t,e){t.append("defs").append("symbol").attr("id",e+"-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")},"insertDatabaseIcon"),Rt=e(function(t,e){t.append("defs").append("symbol").attr("id",e+"-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")},"insertComputerIcon"),Lt=e(function(t,e){t.append("defs").append("symbol").attr("id",e+"-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")},"insertClockIcon"),Nt=e(function(t,e){t.append("defs").append("marker").attr("id",e+"-arrowhead").attr("refX",7.9).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto-start-reverse").append("path").attr("d","M -1 0 L 10 5 L 0 10 z")},"insertArrowHead"),St=e(function(t,e){t.append("defs").append("marker").attr("id",e+"-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")},"insertArrowFilledHead"),wt=e(function(t,e){t.append("defs").append("marker").attr("id",e+"-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)},"insertSequenceNumber"),Pt=e(function(t,e){t.append("defs").append("marker").attr("id",e+"-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")},"insertArrowCrossHead"),Dt=e(t=>t?`${t}-drop-shadow`:"drop-shadow","dropShadowId"),At=e(function(t,e,a){const{theme:r}=e;t.append("defs").append("filter").attr("id",Dt(a)).attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",""+("redux"===r||"redux-color"===r?"#000000":"#FFFFFF"))},"insertDropShadow"),kt=e(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}},"getTextObj"),Ct=e(function(){return{x:0,y:0,fill:"#EDF2AE",stroke:"#666",width:100,anchor:"start",height:100,rx:0,ry:0}},"getNoteRect"),Mt=function(){function t(t,e,a,r,s,n,o){i(e.append("text").attr("x",a+s/2).attr("y",r+n/2+5).style("text-anchor","middle").text(t),o)}function a(t,e,a,r,s,n,o,c){const{actorFontSize:l,actorFontFamily:h,actorFontWeight:p}=c,[T,E]=I(l),g=t.split(d.lineBreakRegex);for(let d=0;d<g.length;d++){const t=d*T-T*(g.length-1)/2,c=e.append("text").attr("x",a+s/2).attr("y",r).style("text-anchor","middle").style("font-size",E).style("font-weight",p).style("font-family",h);c.append("tspan").attr("x",a+s/2).attr("dy",t).text(g[d]),c.attr("y",r+n/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),i(c,o)}}function r(t,e,r,s,n,o,c,d){const l=e.append("switch"),h=l.append("foreignObject").attr("x",r).attr("y",s).attr("width",n).attr("height",o).append("xhtml:div").style("display","table").style("height","100%").style("width","100%");h.append("div").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(t),a(t,l,r,s,n,o,c,d),i(h,c)}async function s(t,e,r,s,n,o,c,d){const l=await b(t,R()),h=e.append("switch"),p=h.append("foreignObject").attr("x",r+n/2-l.width/2).attr("y",s+o/2-l.height/2).attr("width",l.width).attr("height",l.height).append("xhtml:div").style("height","100%").style("width","100%");p.append("div").style("text-align","center").style("vertical-align","middle").html(await N(t,R())),a(t,h,r,s,n,o,c,d),i(p,c)}function i(t,e){for(const a in e)e.hasOwnProperty(a)&&t.attr(a,e[a])}return e(t,"byText"),e(a,"byTspan"),e(r,"byFo"),e(s,"byKatex"),e(i,"_setTextAttrs"),function(e,i=!1){return i?s:"fo"===e.textPlacement?r:"old"===e.textPlacement?t:a}}(),vt=function(){function t(t,e,a,r,i,n,o){s(e.append("text").attr("x",a).attr("y",r).style("text-anchor","start").text(t),o)}function a(t,e,a,r,i,n,o,c){const{actorFontSize:l,actorFontFamily:h,actorFontWeight:p}=c,T=t.split(d.lineBreakRegex);for(let d=0;d<T.length;d++){const t=d*l-l*(T.length-1)/2,i=e.append("text").attr("x",a).attr("y",r).style("text-anchor","start").style("font-size",l).style("font-weight",p).style("font-family",h);i.append("tspan").attr("x",a).attr("dy",t).text(T[d]),i.attr("y",r+n/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),s(i,o)}}function r(t,e,r,i,n,o,c,d){const l=e.append("switch"),h=l.append("foreignObject").attr("x",r).attr("y",i).attr("width",n).attr("height",o).append("xhtml:div").style("display","table").style("height","100%").style("width","100%");h.append("div").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(t),a(t,l,r,i,0,o,c,d),s(h,c)}function s(t,e){for(const a in e)e.hasOwnProperty(a)&&t.attr(a,e[a])}return e(t,"byText"),e(a,"byTspan"),e(r,"byFo"),e(s,"_setTextAttrs"),function(e){return"fo"===e.textPlacement?r:"old"===e.textPlacement?t:a}}(),Yt=e(function(t,e){t.append("defs").append("marker").attr("id",e+"-solidTopArrowHead").attr("refX",7.9).attr("refY",7.25).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L 10 8 L 0 8 z")},"insertSolidTopArrowHead"),Bt=e(function(t,e){t.append("defs").append("marker").attr("id",e+"-solidBottomArrowHead").attr("refX",7.9).attr("refY",.75).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L 10 0 L 0 8 z")},"insertSolidBottomArrowHead"),$t=e(function(t,e){t.append("defs").append("marker").attr("id",e+"-stickTopArrowHead").attr("refX",7.5).attr("refY",7).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L 7 7").attr("stroke","black").attr("stroke-width",1.5).attr("fill","none")},"insertStickTopArrowHead"),Vt=e(function(t,e){t.append("defs").append("marker").attr("id",e+"-stickBottomArrowHead").attr("refX",7.5).attr("refY",0).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto-start-reverse").append("path").attr("d","M 0 7 L 7 0").attr("stroke","black").attr("stroke-width",1.5).attr("fill","none")},"insertStickBottomArrowHead"),Wt={drawRect:at,drawText:nt,drawLabel:ot,drawActor:Ot,drawBox:_t,drawPopup:rt,anchorElement:xt,drawActivation:mt,drawLoop:bt,drawBackgroundRect:It,insertArrowHead:Nt,insertArrowFilledHead:St,insertSequenceNumber:wt,insertArrowCrossHead:Pt,insertDatabaseIcon:ft,insertComputerIcon:Rt,insertClockIcon:Lt,getTextObj:kt,getNoteRect:Ct,fixLifeLineHeights:dt,sanitizeUrl:n.sanitizeUrl,insertDropShadow:At,insertSolidTopArrowHead:Yt,insertSolidBottomArrowHead:Bt,insertStickTopArrowHead:$t,insertStickBottomArrowHead:Vt},Ft={},Kt={data:{startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},verticalPos:0,sequenceItems:[],activations:[],models:{getHeight:e(function(){return Math.max.apply(null,0===this.actors.length?[0]:this.actors.map(t=>t.height||0))+(0===this.loops.length?0:this.loops.map(t=>t.height||0).reduce((t,e)=>t+e))+(0===this.messages.length?0:this.messages.map(t=>t.height||0).reduce((t,e)=>t+e))+(0===this.notes.length?0:this.notes.map(t=>t.height||0).reduce((t,e)=>t+e))},"getHeight"),clear:e(function(){this.actors=[],this.boxes=[],this.loops=[],this.messages=[],this.notes=[]},"clear"),addBox:e(function(t){this.boxes.push(t)},"addBox"),addActor:e(function(t){this.actors.push(t)},"addActor"),addLoop:e(function(t){this.loops.push(t)},"addLoop"),addMessage:e(function(t){this.messages.push(t)},"addMessage"),addNote:e(function(t){this.notes.push(t)},"addNote"),lastActor:e(function(){return this.actors[this.actors.length-1]},"lastActor"),lastLoop:e(function(){return this.loops[this.loops.length-1]},"lastLoop"),lastMessage:e(function(){return this.messages[this.messages.length-1]},"lastMessage"),lastNote:e(function(){return this.notes[this.notes.length-1]},"lastNote"),actors:[],boxes:[],loops:[],messages:[],notes:[]},init:e(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,te(r())},"init"),updateVal:e(function(t,e,a,r){void 0===t[e]?t[e]=a:t[e]=r(a,t[e])},"updateVal"),updateBounds:e(function(t,a,r,s){const i=this;let n=0;function o(o){return e(function(e){n++;const c=i.sequenceItems.length-n+1;i.updateVal(e,"starty",a-c*Ft.boxMargin,Math.min),i.updateVal(e,"stopy",s+c*Ft.boxMargin,Math.max),i.updateVal(Kt.data,"startx",t-c*Ft.boxMargin,Math.min),i.updateVal(Kt.data,"stopx",r+c*Ft.boxMargin,Math.max),"activation"!==o&&(i.updateVal(e,"startx",t-c*Ft.boxMargin,Math.min),i.updateVal(e,"stopx",r+c*Ft.boxMargin,Math.max),i.updateVal(Kt.data,"starty",a-c*Ft.boxMargin,Math.min),i.updateVal(Kt.data,"stopy",s+c*Ft.boxMargin,Math.max))},"updateItemBounds")}e(o,"updateFn"),this.sequenceItems.forEach(o()),this.activations.forEach(o("activation"))},"updateBounds"),insert:e(function(t,e,a,r){const s=d.getMin(t,a),i=d.getMax(t,a),n=d.getMin(e,r),o=d.getMax(e,r);this.updateVal(Kt.data,"startx",s,Math.min),this.updateVal(Kt.data,"starty",n,Math.min),this.updateVal(Kt.data,"stopx",i,Math.max),this.updateVal(Kt.data,"stopy",o,Math.max),this.updateBounds(s,n,i,o)},"insert"),newActivation:e(function(t,e,a){const r=a.get(t.from),s=ee(t.from).length||0,i=r.x+r.width/2+(s-1)*Ft.activationWidth/2;this.activations.push({startx:i,starty:this.verticalPos+2,stopx:i+Ft.activationWidth,stopy:void 0,actor:t.from,anchored:Wt.anchorElement(e)})},"newActivation"),endActivation:e(function(t){const e=this.activations.map(function(t){return t.actor}).lastIndexOf(t.from);return this.activations.splice(e,1)[0]},"endActivation"),createLoop:e(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}},"createLoop"),newLoop:e(function(t={message:void 0,wrap:!1,width:void 0},e){this.sequenceItems.push(this.createLoop(t,e))},"newLoop"),endLoop:e(function(){return this.sequenceItems.pop()},"endLoop"),isLoopOverlap:e(function(){return!!this.sequenceItems.length&&this.sequenceItems[this.sequenceItems.length-1].overlap},"isLoopOverlap"),addSectionToLoop:e(function(t){const e=this.sequenceItems.pop();e.sections=e.sections||[],e.sectionTitles=e.sectionTitles||[],e.sections.push({y:Kt.getVerticalPos(),height:0}),e.sectionTitles.push(t),this.sequenceItems.push(e)},"addSectionToLoop"),saveVerticalPos:e(function(){this.isLoopOverlap()&&(this.savedVerticalPos=this.verticalPos)},"saveVerticalPos"),resetVerticalPos:e(function(){this.isLoopOverlap()&&(this.verticalPos=this.savedVerticalPos)},"resetVerticalPos"),bumpVerticalPos:e(function(t){this.verticalPos=this.verticalPos+t,this.data.stopy=d.getMax(this.data.stopy,this.verticalPos)},"bumpVerticalPos"),getVerticalPos:e(function(){return this.verticalPos},"getVerticalPos"),getBounds:e(function(){return{bounds:this.data,models:this.models}},"getBounds")},qt=e(async function(t,e,a){Kt.bumpVerticalPos(Ft.boxMargin),e.height=Ft.boxMargin,e.starty=Kt.getVerticalPos();const r=P();r.x=e.startx,r.y=e.starty,r.width=e.width||Ft.width,r.class="note";const s=t.append("g");s.attr("data-et","note"),s.attr("data-id","i"+a);const i=Wt.drawRect(s,r),n=w();n.x=e.startx,n.y=e.starty,n.width=r.width,n.dy="1em",n.text=e.message,n.class="noteText",n.fontFamily=Ft.noteFontFamily,n.fontSize=Ft.noteFontSize,n.fontWeight=Ft.noteFontWeight,n.anchor=Ft.noteAlign,n.textMargin=Ft.noteMargin,n.valign="center";const o=m(n.text)?await it(s,n):nt(s,n),c=Math.round(o.map(t=>(t._groups||t)[0][0].getBBox().height).reduce((t,e)=>t+e));i.attr("height",c+2*Ft.noteMargin),e.height+=c+2*Ft.noteMargin,Kt.bumpVerticalPos(c+2*Ft.noteMargin),e.stopy=e.starty+c+2*Ft.noteMargin,e.stopx=e.startx+r.width,Kt.insert(e.startx,e.starty,e.stopx,e.stopy),Kt.models.addNote(e)},"drawNote"),Ht=e(function(t,a,r,s,i,n,o){const c=s.db.getActors(),d=c.get(a.from),l=c.get(a.to),h=r.sequenceVisible;let p=d.x+d.width/2,T=l.x+l.width/2;const E=p<=T,g=pe(a,s),u=t.append("g"),y=e((t,e)=>{const a=t?16.5:-16.5;return e?-a:a},"getCircleOffset"),O=e(t=>{u.append("circle").attr("cx",t).attr("cy",o).attr("r",5).attr("width",10).attr("height",10)},"drawCircle"),{CENTRAL_CONNECTION:_,CENTRAL_CONNECTION_REVERSE:x,CENTRAL_CONNECTION_DUAL:m}=s.db.LINETYPE;if(h)switch(a.centralConnection){case _:g&&(T+=y(E,!0));break;case x:g||(p+=y(E,!1));break;case m:g?T+=y(E,!0):p+=y(E,!1)}switch(a.centralConnection){case _:O(T);break;case x:O(p);break;case m:O(p),O(T)}},"drawCentralConnection"),zt=e(t=>({fontFamily:t.messageFontFamily,fontSize:t.messageFontSize,fontWeight:t.messageFontWeight}),"messageFont"),Ut=e(t=>({fontFamily:t.noteFontFamily,fontSize:t.noteFontSize,fontWeight:t.noteFontWeight}),"noteFont"),jt=e(t=>({fontFamily:t.actorFontFamily,fontSize:t.actorFontSize,fontWeight:t.actorFontWeight}),"actorFont");async function Gt(t,e){Kt.bumpVerticalPos(10);const{startx:a,stopx:s,message:i}=e,n=d.splitBreaks(i).length,o=m(i),c=o?await b(i,r()):x.calculateTextDimensions(i,zt(Ft));if(!o){const t=c.height/n;e.height+=t,Kt.bumpVerticalPos(t)}let l,h=c.height-10;const p=c.width;if(a===s){l=Kt.getVerticalPos()+h,Ft.rightAngles||(h+=Ft.boxMargin,l=Kt.getVerticalPos()+h),h+=30;const t=d.getMax(p/2,Ft.width/2);Kt.insert(a-t,Kt.getVerticalPos()-10+h,s+t,Kt.getVerticalPos()+30+h)}else h+=Ft.boxMargin,l=Kt.getVerticalPos()+h,Kt.insert(a,l-10,s,l);return Kt.bumpVerticalPos(h),e.height+=h,e.stopy=e.starty+e.height,Kt.insert(e.fromBounds,e.starty,e.toBounds,e.stopy),l}e(Gt,"boundMessage");var Xt=e(async function(t,e,a,r,s,i){const{startx:n,stopx:o,starty:c,message:l,type:h,sequenceIndex:p,sequenceVisible:T}=e,E=x.calculateTextDimensions(l,zt(Ft)),g=w();g.x=Math.min(n,o),g.y=c+10,g.width=Math.abs(o-n),g.class="messageText",g.dy="1em",g.text=l,g.fontFamily=Ft.messageFontFamily,g.fontSize=Ft.messageFontSize,g.fontWeight=Ft.messageFontWeight,g.anchor=Ft.messageAlign,g.valign="center",g.textMargin=Ft.wrapPadding,g.tspan=!1,m(g.text)?await it(t,g,{startx:n,stopx:o,starty:a}):nt(t,g);const u=E.width;let y;if(n===o){const i=T||Ft.showSequenceNumbers,c=pe(s,r),l=Te(s,r),h=n+(i&&(c||l)?10:0);y=Ft.rightAngles?t.append("path").attr("d",`M ${h},${a} H ${n+d.getMax(Ft.width/2,u/2)} V ${a+25} H ${n}`):t.append("path").attr("d","M "+h+","+a+" C "+(h+60)+","+(a-10)+" "+(n+60)+","+(a+30)+" "+n+","+(a+20)),le(s,r)&&Ht(t,s,e,r,n,o,a)}else y=t.append("line"),y.attr("x1",n),y.attr("y1",a),y.attr("x2",o),y.attr("y2",a),le(s,r)&&Ht(t,s,e,r,n,o,a);h===r.db.LINETYPE.DOTTED||h===r.db.LINETYPE.DOTTED_CROSS||h===r.db.LINETYPE.DOTTED_POINT||h===r.db.LINETYPE.DOTTED_OPEN||h===r.db.LINETYPE.BIDIRECTIONAL_DOTTED||h===r.db.LINETYPE.SOLID_TOP_DOTTED||h===r.db.LINETYPE.SOLID_BOTTOM_DOTTED||h===r.db.LINETYPE.STICK_TOP_DOTTED||h===r.db.LINETYPE.STICK_BOTTOM_DOTTED||h===r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED||h===r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED||h===r.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED||h===r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED?(y.style("stroke-dasharray","3, 3"),y.attr("class","messageLine1")):y.attr("class","messageLine0"),y.attr("data-et","message"),y.attr("data-id","i"+e.id),y.attr("data-from",e.from),y.attr("data-to",e.to);let O="";if(Ft.arrowMarkerAbsolute&&(O=L(!0)),y.attr("stroke-width",2),y.attr("stroke","none"),y.style("fill","none"),h!==r.db.LINETYPE.SOLID_TOP&&h!==r.db.LINETYPE.SOLID_TOP_DOTTED||y.attr("marker-end","url("+O+"#"+i+"-solidTopArrowHead)"),h!==r.db.LINETYPE.SOLID_BOTTOM&&h!==r.db.LINETYPE.SOLID_BOTTOM_DOTTED||y.attr("marker-end","url("+O+"#"+i+"-solidBottomArrowHead)"),h!==r.db.LINETYPE.STICK_TOP&&h!==r.db.LINETYPE.STICK_TOP_DOTTED||y.attr("marker-end","url("+O+"#"+i+"-stickTopArrowHead)"),h!==r.db.LINETYPE.STICK_BOTTOM&&h!==r.db.LINETYPE.STICK_BOTTOM_DOTTED||y.attr("marker-end","url("+O+"#"+i+"-stickBottomArrowHead)"),h!==r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE&&h!==r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED||y.attr("marker-start","url("+O+"#"+i+"-solidBottomArrowHead)"),h!==r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE&&h!==r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED||y.attr("marker-start","url("+O+"#"+i+"-solidTopArrowHead)"),h!==r.db.LINETYPE.STICK_ARROW_TOP_REVERSE&&h!==r.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED||y.attr("marker-start","url("+O+"#"+i+"-stickBottomArrowHead)"),h!==r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE&&h!==r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED||y.attr("marker-start","url("+O+"#"+i+"-stickTopArrowHead)"),h!==r.db.LINETYPE.SOLID&&h!==r.db.LINETYPE.DOTTED||y.attr("marker-end","url("+O+"#"+i+"-arrowhead)"),h!==r.db.LINETYPE.BIDIRECTIONAL_SOLID&&h!==r.db.LINETYPE.BIDIRECTIONAL_DOTTED||(y.attr("marker-start","url("+O+"#"+i+"-arrowhead)"),y.attr("marker-end","url("+O+"#"+i+"-arrowhead)")),h!==r.db.LINETYPE.SOLID_POINT&&h!==r.db.LINETYPE.DOTTED_POINT||y.attr("marker-end","url("+O+"#"+i+"-filled-head)"),h!==r.db.LINETYPE.SOLID_CROSS&&h!==r.db.LINETYPE.DOTTED_CROSS||y.attr("marker-end","url("+O+"#"+i+"-crosshead)"),T||Ft.showSequenceNumbers){const c=h===r.db.LINETYPE.BIDIRECTIONAL_SOLID||h===r.db.LINETYPE.BIDIRECTIONAL_DOTTED,d=h===r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE||h===r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED||h===r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE||h===r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED||h===r.db.LINETYPE.STICK_ARROW_TOP_REVERSE||h===r.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED||h===r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE||h===r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,l=6,T=le(s,r);let E=n,g=o;c?(n<o?E=n+2*l:(E=n-l+(T?-5:0),E+=s?.centralConnection===r.db.LINETYPE.CENTRAL_CONNECTION_DUAL||s?.centralConnection===r.db.LINETYPE.CENTRAL_CONNECTION_REVERSE?-7.5:0),y.attr("x1",E)):d?(o>n?g=o-2*l:(g=o-l,E+=s?.centralConnection===r.db.LINETYPE.CENTRAL_CONNECTION_DUAL||s?.centralConnection===r.db.LINETYPE.CENTRAL_CONNECTION_REVERSE?-7.5:0),g+=T?15:0,y.attr("x2",g),y.attr("x1",E)):y.attr("x1",n+l);let u=0;const _=n<=o;u=n===o?e.fromBounds+1:d?_?e.toBounds-1:e.fromBounds+1:_?e.fromBounds+1:e.toBounds-1;let x="12px";const m=p.toString().length;m>5?x="7px":m>3&&(x="9px"),t.append("line").attr("x1",u).attr("y1",a).attr("x2",u).attr("y2",a).attr("stroke-width",0).attr("marker-start","url("+O+"#"+i+"-sequencenumber)"),t.append("text").attr("x",u).attr("y",a+4).attr("font-family","sans-serif").attr("font-size",x).attr("text-anchor","middle").attr("class","sequenceNumber").text(p)}},"drawMessage"),Jt=e(function(t,e,a,r,s,i,n){let o,c=0,l=0,h=0;for(const p of r){const t=e.get(p),r=t.box;o&&o!=r&&(n||Kt.models.addBox(o),l+=Ft.boxMargin+o.margin),r&&r!=o&&(n||(r.x=c+l,r.y=s),l+=r.margin),t.width=d.getMax(t.width||Ft.width,Ft.width),t.height=d.getMax(t.height||Ft.height,Ft.height),t.margin=t.margin||Ft.actorMargin,h=d.getMax(h,t.height),a.get(t.name)&&(l+=t.width/2),t.x=c+l,t.starty=Kt.getVerticalPos(),Kt.insert(t.x,s,t.x+t.width,t.height),c+=t.width+l,t.box&&(t.box.width=c+r.margin-t.box.x),l=t.margin,o=t.box,Kt.models.addActor(t)}o&&!n&&Kt.models.addBox(o),Kt.bumpVerticalPos(h)},"addActorRenderingData"),Zt=e(async function(t,e,a,r,s,i,n){if(r){let r=0;Kt.bumpVerticalPos(2*Ft.boxMargin);for(const o of a){const a=e.get(o);a.stopy||(a.stopy=Kt.getVerticalPos());const c=await Wt.drawActor(t,a,Ft,!0,s,i,n);r=d.getMax(r,c)}Kt.bumpVerticalPos(r+Ft.boxMargin)}else for(const o of a){const a=e.get(o);await Wt.drawActor(t,a,Ft,!1,s,i,n)}},"drawActors"),Qt=e(function(t,e,a,r){let s=0,i=0;for(const n of a){const a=e.get(n),o=oe(a),c=Wt.drawPopup(t,a,o,Ft,Ft.forceMenus,r);c.height>s&&(s=c.height),c.width+a.x>i&&(i=c.width+a.x)}return{maxHeight:s,maxWidth:i}},"drawActorsPopup"),te=e(function(t){c(Ft,t),t.fontFamily&&(Ft.actorFontFamily=Ft.noteFontFamily=Ft.messageFontFamily=t.fontFamily),t.fontSize&&(Ft.actorFontSize=Ft.noteFontSize=Ft.messageFontSize=t.fontSize),t.fontWeight&&(Ft.actorFontWeight=Ft.noteFontWeight=Ft.messageFontWeight=t.fontWeight)},"setConf"),ee=e(function(t){return Kt.activations.filter(function(e){return e.actor===t})},"actorActivations"),ae=e(function(t,e){const a=e.get(t),r=ee(t);return[r.reduce(function(t,e){return d.getMin(t,e.startx)},a.x+a.width/2-1),r.reduce(function(t,e){return d.getMax(t,e.stopx)},a.x+a.width/2+1)]},"activationBounds");function re(t,e,a,r,s){Kt.bumpVerticalPos(a);let n=r;if(e.id&&e.message&&t[e.id]){const a=t[e.id].width,s=zt(Ft);e.message=x.wrapLabel(`[${e.message}]`,a-2*Ft.wrapPadding,s),e.width=a,e.wrap=!0;const o=x.calculateTextDimensions(e.message,s),c=d.getMax(o.height,Ft.labelBoxHeight);n=r+c,i.debug(`${c} - ${e.message}`)}s(e),Kt.bumpVerticalPos(n)}function se(t,a,r,s,i,n,o){function c(e,r){e.x<i.get(t.from).x?(Kt.insert(a.stopx-r,a.starty,a.startx,a.stopy+e.height/2+Ft.noteMargin),a.stopx=a.stopx+r):(Kt.insert(a.startx,a.starty,a.stopx+r,a.stopy+e.height/2+Ft.noteMargin),a.stopx=a.stopx-r)}function d(e,r){e.x<i.get(t.to).x?(Kt.insert(a.startx-r,a.starty,a.stopx,a.stopy+e.height/2+Ft.noteMargin),a.startx=a.startx+r):(Kt.insert(a.stopx,a.starty,a.startx+r,a.stopy+e.height/2+Ft.noteMargin),a.startx=a.startx-r)}e(c,"receiverAdjustment"),e(d,"senderAdjustment");const l=[$,V,F,W];if(n.get(t.to)==s){const e=i.get(t.to);c(e,l.includes(e.type)?21:e.width/2+3),e.starty=r-e.height/2,Kt.bumpVerticalPos(e.height/2)}else if(o.get(t.from)==s){const e=i.get(t.from);if(Ft.mirrorActors){d(e,l.includes(e.type)?18:e.width/2)}e.stopy=r-e.height/2,Kt.bumpVerticalPos(e.height/2)}else if(o.get(t.to)==s){const e=i.get(t.to);if(Ft.mirrorActors){c(e,l.includes(e.type)?21:e.width/2+3)}e.stopy=r-e.height/2,Kt.bumpVerticalPos(e.height/2)}}e(re,"adjustLoopHeightForWrap"),e(se,"adjustCreatedDestroyedData");var ie=e(async function(t,a,n,c){const{securityLevel:d,sequence:l,look:h,themeVariables:p}=r();let T;Ft=l,"sandbox"===d&&(T=s("#i"+a));const E=s("sandbox"===d?T.nodes()[0].contentDocument.body:"body"),g="sandbox"===d?T.nodes()[0].contentDocument:document;Kt.init(),i.debug(c.db);const u="sandbox"===d?E.select(`[id="${a}"]`):s(`[id="${a}"]`),y=c.db.getActors(),O=c.db.getCreatedActors(),_=c.db.getDestroyedActors(),x=c.db.getBoxes();let m=c.db.getActorKeys();const b=c.db.getMessages(),I=c.db.getDiagramTitle(),f=c.db.hasAtLeastOneBox(),R=c.db.hasAtLeastOneBoxWithTitle(),L=await ne(y,b,c);if(Ft.height=await ce(y,L,x),Wt.insertComputerIcon(u,a),Wt.insertDatabaseIcon(u,a),Wt.insertClockIcon(u,a),f&&(Kt.bumpVerticalPos(Ft.boxMargin),R&&Kt.bumpVerticalPos(x[0].textMaxHeight)),!0===Ft.hideUnusedParticipants){const t=new Set;b.forEach(e=>{t.add(e.from),t.add(e.to)}),m=m.filter(e=>t.has(e))}const N=new Map(m.map((t,e)=>[y.get(t)?.name??t,e]));Jt(u,y,O,m,0,b,!1);const S=await ge(b,y,L,c);function w(t,e){const a=Kt.endActivation(t);a.starty+18>e&&(a.starty=e-6,e+=12),Wt.drawActivation(u,a,e,Ft,ee(t.from).length,c,N),Kt.insert(a.startx,e-10,a.stopx,e)}Wt.insertArrowHead(u,a),Wt.insertArrowCrossHead(u,a),Wt.insertArrowFilledHead(u,a),Wt.insertSequenceNumber(u,a),Wt.insertSolidTopArrowHead(u,a),Wt.insertSolidBottomArrowHead(u,a),Wt.insertStickTopArrowHead(u,a),Wt.insertStickBottomArrowHead(u,a),"neo"===h&&Wt.insertDropShadow(u,Ft,a),e(w,"activeEnd");let P=1,D=1;const A=[],k=[];let C=0;for(const e of b){let t,a,r;switch(e.type){case c.db.LINETYPE.NOTE:Kt.resetVerticalPos(),a=e.noteModel,await qt(u,a,e.id);break;case c.db.LINETYPE.ACTIVE_START:case c.db.LINETYPE.CENTRAL_CONNECTION:case c.db.LINETYPE.CENTRAL_CONNECTION_REVERSE:Kt.newActivation(e,u,y);break;case c.db.LINETYPE.ACTIVE_END:w(e,Kt.getVerticalPos());break;case c.db.LINETYPE.LOOP_START:re(S,e,Ft.boxMargin,Ft.boxMargin+Ft.boxTextMargin,t=>Kt.newLoop(t));break;case c.db.LINETYPE.LOOP_END:t=Kt.endLoop(),await Wt.drawLoop(u,t,"loop",Ft,e),Kt.bumpVerticalPos(t.stopy-Kt.getVerticalPos()),Kt.models.addLoop(t);break;case c.db.LINETYPE.RECT_START:re(S,e,Ft.boxMargin,Ft.boxMargin,t=>{let e=t.message;e||(e=p?.rectBkgColor||p?.actorBkg||"rgba(128, 128, 128, 0.5)"),Kt.newLoop(void 0,e)});break;case c.db.LINETYPE.RECT_END:t=Kt.endLoop(),k.push(t),Kt.models.addLoop(t),Kt.bumpVerticalPos(t.stopy-Kt.getVerticalPos());break;case c.db.LINETYPE.OPT_START:re(S,e,Ft.boxMargin,Ft.boxMargin+Ft.boxTextMargin,t=>Kt.newLoop(t));break;case c.db.LINETYPE.OPT_END:t=Kt.endLoop(),await Wt.drawLoop(u,t,"opt",Ft,e),Kt.bumpVerticalPos(t.stopy-Kt.getVerticalPos()),Kt.models.addLoop(t);break;case c.db.LINETYPE.ALT_START:re(S,e,Ft.boxMargin,Ft.boxMargin+Ft.boxTextMargin,t=>Kt.newLoop(t));break;case c.db.LINETYPE.ALT_ELSE:re(S,e,Ft.boxMargin+Ft.boxTextMargin,Ft.boxMargin,t=>Kt.addSectionToLoop(t));break;case c.db.LINETYPE.ALT_END:t=Kt.endLoop(),await Wt.drawLoop(u,t,"alt",Ft,e),Kt.bumpVerticalPos(t.stopy-Kt.getVerticalPos()),Kt.models.addLoop(t);break;case c.db.LINETYPE.PAR_START:case c.db.LINETYPE.PAR_OVER_START:re(S,e,Ft.boxMargin,Ft.boxMargin+Ft.boxTextMargin,t=>Kt.newLoop(t)),Kt.saveVerticalPos();break;case c.db.LINETYPE.PAR_AND:re(S,e,Ft.boxMargin+Ft.boxTextMargin,Ft.boxMargin,t=>Kt.addSectionToLoop(t));break;case c.db.LINETYPE.PAR_END:t=Kt.endLoop(),await Wt.drawLoop(u,t,"par",Ft,e),Kt.bumpVerticalPos(t.stopy-Kt.getVerticalPos()),Kt.models.addLoop(t);break;case c.db.LINETYPE.AUTONUMBER:P=e.message.start||P,D=e.message.step||D,e.message.visible?c.db.enableSequenceNumbers():c.db.disableSequenceNumbers();break;case c.db.LINETYPE.CRITICAL_START:re(S,e,Ft.boxMargin,Ft.boxMargin+Ft.boxTextMargin,t=>Kt.newLoop(t));break;case c.db.LINETYPE.CRITICAL_OPTION:re(S,e,Ft.boxMargin+Ft.boxTextMargin,Ft.boxMargin,t=>Kt.addSectionToLoop(t));break;case c.db.LINETYPE.CRITICAL_END:t=Kt.endLoop(),await Wt.drawLoop(u,t,"critical",Ft,e),Kt.bumpVerticalPos(t.stopy-Kt.getVerticalPos()),Kt.models.addLoop(t);break;case c.db.LINETYPE.BREAK_START:re(S,e,Ft.boxMargin,Ft.boxMargin+Ft.boxTextMargin,t=>Kt.newLoop(t));break;case c.db.LINETYPE.BREAK_END:t=Kt.endLoop(),await Wt.drawLoop(u,t,"break",Ft,e),Kt.bumpVerticalPos(t.stopy-Kt.getVerticalPos()),Kt.models.addLoop(t);break;default:try{r=e.msgModel,r.starty=Kt.getVerticalPos(),r.sequenceIndex=P,r.sequenceVisible=c.db.showSequenceNumbers(),r.id=e.id,r.from=e.from,r.to=e.to;const t=await Gt(0,r);se(e,r,t,C,y,O,_),A.push({messageModel:r,lineStartY:t,msg:e}),Kt.models.addMessage(r)}catch(K){i.error("error while drawing message",K)}}[c.db.LINETYPE.SOLID_OPEN,c.db.LINETYPE.DOTTED_OPEN,c.db.LINETYPE.SOLID,c.db.LINETYPE.SOLID_TOP,c.db.LINETYPE.SOLID_BOTTOM,c.db.LINETYPE.STICK_TOP,c.db.LINETYPE.STICK_BOTTOM,c.db.LINETYPE.SOLID_TOP_DOTTED,c.db.LINETYPE.SOLID_BOTTOM_DOTTED,c.db.LINETYPE.STICK_TOP_DOTTED,c.db.LINETYPE.STICK_BOTTOM_DOTTED,c.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,c.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE,c.db.LINETYPE.STICK_ARROW_TOP_REVERSE,c.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE,c.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,c.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,c.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED,c.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,c.db.LINETYPE.DOTTED,c.db.LINETYPE.SOLID_CROSS,c.db.LINETYPE.DOTTED_CROSS,c.db.LINETYPE.SOLID_POINT,c.db.LINETYPE.DOTTED_POINT,c.db.LINETYPE.BIDIRECTIONAL_SOLID,c.db.LINETYPE.BIDIRECTIONAL_DOTTED].includes(e.type)&&(P=Math.round(100*(P+D))/100),C++}i.debug("createdActors",O),i.debug("destroyedActors",_),await Zt(u,y,m,!1,a,c,N);for(const e of A)await Xt(u,e.messageModel,e.lineStartY,c,e.msg,a);Ft.mirrorActors&&await Zt(u,y,m,!0,a,c,N),k.forEach(t=>Wt.drawBackgroundRect(u,t)),dt(u,y,m,Ft);for(const e of Kt.models.boxes){e.height=Kt.getVerticalPos()-e.y,Kt.insert(e.x,e.y,e.x+e.width,e.height);const t=2*Ft.boxMargin;e.startx=e.x-t,e.starty=e.y-.25*t,e.stopx=e.startx+e.width+2*t,e.stopy=e.starty+e.height+.75*t,e.stroke="rgb(0,0,0, 0.5)",Wt.drawBox(u,e,Ft)}f&&Kt.bumpVerticalPos(Ft.boxMargin);const M=Qt(u,y,m,g),{bounds:v}=Kt.getBounds();void 0===v.startx&&(v.startx=0),void 0===v.starty&&(v.starty=0),void 0===v.stopx&&(v.stopx=0),void 0===v.stopy&&(v.stopy=0);let Y=v.stopy-v.starty;Y<M.maxHeight&&(Y=M.maxHeight);let B=Y+2*Ft.diagramMarginY;Ft.mirrorActors&&(B=B-Ft.boxMargin+Ft.bottomMarginAdj);let $=v.stopx-v.startx;$<M.maxWidth&&($=M.maxWidth);const V=$+2*Ft.diagramMarginX;I&&u.append("text").text(I).attr("x",(v.stopx-v.startx)/2-2*Ft.diagramMarginX).attr("y",-25),o(u,B,V,Ft.useMaxWidth);const W=I?40:0,F=y.size&&"neo"===h?30:0;u.attr("viewBox",v.startx-Ft.diagramMarginX+" -"+(Ft.diagramMarginY+W)+" "+V+" "+(B+W+F)),i.debug("models:",Kt.models)},"draw");async function ne(t,e,a){const s={};for(const i of e)if(t.get(i.to)&&t.get(i.from)){const e=t.get(i.to);if(i.placement===a.db.PLACEMENT.LEFTOF&&!e.prevActor)continue;if(i.placement===a.db.PLACEMENT.RIGHTOF&&!e.nextActor)continue;const n=void 0!==i.placement,o=!n,c=n?Ut(Ft):zt(Ft),l=i.wrap?x.wrapLabel(i.message,Ft.width-2*Ft.wrapPadding,c):i.message,h=(m(l)?await b(i.message,r()):x.calculateTextDimensions(l,c)).width+2*Ft.wrapPadding;o&&i.from===e.nextActor?s[i.to]=d.getMax(s[i.to]||0,h):o&&i.from===e.prevActor?s[i.from]=d.getMax(s[i.from]||0,h):o&&i.from===i.to?(s[i.from]=d.getMax(s[i.from]||0,h/2),s[i.to]=d.getMax(s[i.to]||0,h/2)):i.placement===a.db.PLACEMENT.RIGHTOF?s[i.from]=d.getMax(s[i.from]||0,h):i.placement===a.db.PLACEMENT.LEFTOF?s[e.prevActor]=d.getMax(s[e.prevActor]||0,h):i.placement===a.db.PLACEMENT.OVER&&(e.prevActor&&(s[e.prevActor]=d.getMax(s[e.prevActor]||0,h/2)),e.nextActor&&(s[i.from]=d.getMax(s[i.from]||0,h/2)))}return i.debug("maxMessageWidthPerActor:",s),s}e(ne,"getMaxMessageWidthPerActor");var oe=e(function(t){let e=0;const a=jt(Ft);for(const r in t.links){const t=x.calculateTextDimensions(r,a).width+2*Ft.wrapPadding+2*Ft.boxMargin;e<t&&(e=t)}return e},"getRequiredPopupWidth");async function ce(t,e,a){let s=0;for(const n of t.keys()){const e=t.get(n);e.wrap&&(e.description=x.wrapLabel(e.description,Ft.width-2*Ft.wrapPadding,jt(Ft)));const a=m(e.description)?await b(e.description,r()):x.calculateTextDimensions(e.description,jt(Ft));e.width=e.wrap?Ft.width:d.getMax(Ft.width,a.width+2*Ft.wrapPadding),"neo"===r().look?(e.actorTextHeight=a.height,e.height=d.getMax(z(a.height),Ft.height)):e.height=e.wrap?d.getMax(a.height,Ft.height):Ft.height,s=d.getMax(s,e.height)}for(const r in e){const a=t.get(r);if(!a)continue;const s=t.get(a.nextActor);if(!s){const t=e[r]+Ft.actorMargin-a.width/2;a.margin=d.getMax(t,Ft.actorMargin);continue}const i=e[r]+Ft.actorMargin-a.width/2-s.width/2;a.margin=d.getMax(i,Ft.actorMargin)}let i=0;return a.forEach(e=>{const a=zt(Ft);let r=e.actorKeys.reduce((e,a)=>e+(t.get(a).width+(t.get(a).margin||0)),0);r+=8*Ft.boxMargin,r-=2*Ft.boxTextMargin,e.wrap&&(e.name=x.wrapLabel(e.name,r-2*Ft.wrapPadding,a));const s=x.calculateTextDimensions(e.name,a);i=d.getMax(s.height,i);const n=d.getMax(r,s.width+2*Ft.wrapPadding);if(e.margin=Ft.boxTextMargin,r<n){const t=(n-r)/2;e.margin+=t}}),a.forEach(t=>t.textMaxHeight=i),d.getMax(s,Ft.height)}e(ce,"calculateActorMargins");var de=e(async function(t,e,a){const s=e.get(t.from),n=e.get(t.to),o=s.x,c=n.x,l=t.wrap&&t.message;let h=m(t.message)?await b(t.message,r()):x.calculateTextDimensions(l?x.wrapLabel(t.message,Ft.width,Ut(Ft)):t.message,Ut(Ft));const p={width:l?Ft.width:d.getMax(Ft.width,h.width+2*Ft.noteMargin),height:0,startx:s.x,stopx:0,starty:0,stopy:0,message:t.message};return t.placement===a.db.PLACEMENT.RIGHTOF?(p.width=l?d.getMax(Ft.width,h.width):d.getMax(s.width/2+n.width/2,h.width+2*Ft.noteMargin),p.startx=o+(s.width+Ft.actorMargin)/2):t.placement===a.db.PLACEMENT.LEFTOF?(p.width=l?d.getMax(Ft.width,h.width+2*Ft.noteMargin):d.getMax(s.width/2+n.width/2,h.width+2*Ft.noteMargin),p.startx=o-p.width+(s.width-Ft.actorMargin)/2):t.to===t.from?(h=x.calculateTextDimensions(l?x.wrapLabel(t.message,d.getMax(Ft.width,s.width),Ut(Ft)):t.message,Ut(Ft)),p.width=l?d.getMax(Ft.width,s.width):d.getMax(s.width,Ft.width,h.width+2*Ft.noteMargin),p.startx=o+(s.width-p.width)/2):(p.width=Math.abs(o+s.width/2-(c+n.width/2))+Ft.actorMargin,p.startx=o<c?o+s.width/2-Ft.actorMargin/2:c+n.width/2-Ft.actorMargin/2),l&&(p.message=x.wrapLabel(t.message,p.width-2*Ft.wrapPadding,Ut(Ft))),i.debug(`NM:[${p.startx},${p.stopx},${p.starty},${p.stopy}:${p.width},${p.height}=${t.message}]`),p},"buildNoteModel"),le=e(function(t,e){const{CENTRAL_CONNECTION:a,CENTRAL_CONNECTION_REVERSE:r,CENTRAL_CONNECTION_DUAL:s}=e.db.LINETYPE;return[a,r,s].includes(t.centralConnection)},"hasCentralConnection"),he=e(function(t,e,a){const{CENTRAL_CONNECTION_REVERSE:r,CENTRAL_CONNECTION_DUAL:s,BIDIRECTIONAL_SOLID:i,BIDIRECTIONAL_DOTTED:n}=e.db.LINETYPE;let o=0;return t.centralConnection!==r&&t.centralConnection!==s||(o+=4),t.centralConnection!==r&&t.centralConnection!==s||t.type!==i&&t.type!==n||(o+=a?0:-6),o},"calculateCentralConnectionOffset"),pe=e(function(t,e){const{SOLID_ARROW_TOP_REVERSE:a,SOLID_ARROW_TOP_REVERSE_DOTTED:r,SOLID_ARROW_BOTTOM_REVERSE:s,SOLID_ARROW_BOTTOM_REVERSE_DOTTED:i,STICK_ARROW_TOP_REVERSE:n,STICK_ARROW_TOP_REVERSE_DOTTED:o,STICK_ARROW_BOTTOM_REVERSE:c,STICK_ARROW_BOTTOM_REVERSE_DOTTED:d}=e.db.LINETYPE;return[a,r,s,i,n,o,c,d].includes(t.type)},"isReverseArrowType"),Te=e(function(t,e){const{BIDIRECTIONAL_SOLID:a,BIDIRECTIONAL_DOTTED:r}=e.db.LINETYPE;return[a,r].includes(t.type)},"isBidirectionalArrowType"),Ee=e(function(t,a,s){const{look:i}=r();if(![s.db.LINETYPE.SOLID_OPEN,s.db.LINETYPE.DOTTED_OPEN,s.db.LINETYPE.SOLID,s.db.LINETYPE.SOLID_TOP,s.db.LINETYPE.SOLID_BOTTOM,s.db.LINETYPE.STICK_TOP,s.db.LINETYPE.STICK_BOTTOM,s.db.LINETYPE.SOLID_TOP_DOTTED,s.db.LINETYPE.SOLID_BOTTOM_DOTTED,s.db.LINETYPE.STICK_TOP_DOTTED,s.db.LINETYPE.STICK_BOTTOM_DOTTED,s.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,s.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE,s.db.LINETYPE.STICK_ARROW_TOP_REVERSE,s.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE,s.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,s.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,s.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED,s.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,s.db.LINETYPE.DOTTED,s.db.LINETYPE.SOLID_CROSS,s.db.LINETYPE.DOTTED_CROSS,s.db.LINETYPE.SOLID_POINT,s.db.LINETYPE.DOTTED_POINT,s.db.LINETYPE.BIDIRECTIONAL_SOLID,s.db.LINETYPE.BIDIRECTIONAL_DOTTED].includes(t.type))return{};const[n,o]=ae(t.from,a),[c,l]=ae(t.to,a),h=n<=c;let p=h?o:n,T=h?c:l;if("neo"===i){const e=3;t.type!==s.db.LINETYPE.SOLID_OPEN&&(T+=h?-e:e),t.type!==s.db.LINETYPE.BIDIRECTIONAL_SOLID&&t.type!==s.db.LINETYPE.BIDIRECTIONAL_DOTTED||(p+=h?e:-e)}p+=he(t,s,h);const E=Math.abs(c-l)>2,g=e(t=>h?-t:t,"adjustValue");t.from===t.to?T=p:(t.activate&&!E&&(T+=g(Ft.activationWidth/2-1)),[s.db.LINETYPE.SOLID_OPEN,s.db.LINETYPE.DOTTED_OPEN,s.db.LINETYPE.STICK_TOP,s.db.LINETYPE.STICK_BOTTOM,s.db.LINETYPE.STICK_TOP_DOTTED,s.db.LINETYPE.STICK_BOTTOM_DOTTED,s.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,s.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,s.db.LINETYPE.STICK_ARROW_TOP_REVERSE,s.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE,s.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED,s.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,s.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,s.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE].includes(t.type)||(T+=g(3)),[s.db.LINETYPE.BIDIRECTIONAL_SOLID,s.db.LINETYPE.BIDIRECTIONAL_DOTTED,s.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,s.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,s.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,s.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE].includes(t.type)&&(p-=g(3)));const u=[n,o,c,l],y=Math.abs(p-T);t.wrap&&t.message&&(t.message=x.wrapLabel(t.message,d.getMax(y+2*Ft.wrapPadding,Ft.width),zt(Ft)));const O=x.calculateTextDimensions(t.message,zt(Ft));return{width:d.getMax(t.wrap?0:O.width+2*Ft.wrapPadding,y+2*Ft.wrapPadding,Ft.width),height:0,startx:p,stopx:T,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)}},"buildMessageModel"),ge=e(async function(t,e,a,r){const s={},n=[];let o,c,l;for(const i of t){switch(i.type){case r.db.LINETYPE.LOOP_START:case r.db.LINETYPE.ALT_START:case r.db.LINETYPE.OPT_START:case r.db.LINETYPE.PAR_START:case r.db.LINETYPE.PAR_OVER_START:case r.db.LINETYPE.CRITICAL_START:case r.db.LINETYPE.BREAK_START:n.push({id:i.id,msg:i.message,from:Number.MAX_SAFE_INTEGER,to:Number.MIN_SAFE_INTEGER,width:0});break;case r.db.LINETYPE.ALT_ELSE:case r.db.LINETYPE.PAR_AND:case r.db.LINETYPE.CRITICAL_OPTION:i.message&&(o=n.pop(),s[o.id]=o,s[i.id]=o,n.push(o));break;case r.db.LINETYPE.LOOP_END:case r.db.LINETYPE.ALT_END:case r.db.LINETYPE.OPT_END:case r.db.LINETYPE.PAR_END:case r.db.LINETYPE.CRITICAL_END:case r.db.LINETYPE.BREAK_END:o=n.pop(),s[o.id]=o;break;case r.db.LINETYPE.ACTIVE_START:{const t=e.get(i.from?i.from:i.to.actor),a=ee(i.from?i.from:i.to.actor).length,r=t.x+t.width/2+(a-1)*Ft.activationWidth/2,s={startx:r,stopx:r+Ft.activationWidth,actor:i.from,enabled:!0};Kt.activations.push(s)}break;case r.db.LINETYPE.ACTIVE_END:{const t=Kt.activations.map(t=>t.actor).lastIndexOf(i.from);Kt.activations.splice(t,1).splice(0,1)}}void 0!==i.placement?(c=await de(i,e,r),i.noteModel=c,n.forEach(t=>{o=t,o.from=d.getMin(o.from,c.startx),o.to=d.getMax(o.to,c.startx+c.width),o.width=d.getMax(o.width,Math.abs(o.from-o.to))-Ft.labelBoxWidth})):(l=Ee(i,e,r),i.msgModel=l,l.startx&&l.stopx&&n.length>0&&n.forEach(t=>{if(o=t,l.startx===l.stopx){const t=e.get(i.from),a=e.get(i.to);o.from=d.getMin(t.x-l.width/2,t.x-t.width/2,o.from),o.to=d.getMax(a.x+l.width/2,a.x+t.width/2,o.to),o.width=d.getMax(o.width,Math.abs(o.to-o.from))-Ft.labelBoxWidth}else o.from=d.getMin(l.startx,o.from),o.to=d.getMax(l.stopx,o.to),o.width=d.getMax(o.width,l.width)-Ft.labelBoxWidth}))}return Kt.activations=[],i.debug("Loop type widths:",s),s},"calculateLoopBounds"),ue={bounds:Kt,drawActors:Zt,drawActorsPopup:Qt,setConf:te,draw:ie},ye={parser:M,get db(){return new K},renderer:ue,styles:q,init:e(t=>{t.sequence||(t.sequence={}),t.wrap&&(t.sequence.wrap=t.wrap,a({sequence:{wrap:t.wrap}}))},"init")};export{ye as diagram};
@@ -0,0 +1 @@
1
+ import{_ as e}from"./mermaid-T_6Ze_cT.js";import"./markdown-S2mWvoE-.js";function t(){if("undefined"!=typeof globalThis)return globalThis}function n(){return Boolean(t()?.mermaidCaptureSizes)}function o(){return"undefined"==typeof location?"browser-dev":`${location.pathname}${location.search}`}function i(e,n){const o=t();if(!o)return;const i=n.node(),r=(i&&"ownerSVGElement"in i?i.ownerSVGElement:null)??i,a=r?.id??"(unknown)";o.mermaidCapturedSizes??=[];const d={svgId:a,sizes:e};o.mermaidCapturedSizes.push(d),o.mermaidLastCapturedSizes=d}function r(e,t){const n=[];for(const o of t.nodes)o.isGroup||n.push({id:o.id,width:o.width??0,height:o.height??0});0!==n.length&&i({metadata:{captureVersion:1,capturedAt:(new Date).toISOString(),capturedFrom:o()},nodes:n},e)}e(t,"getCaptureGlobal"),e(n,"shouldCaptureSizes"),e(o,"capturedFromLocation"),e(i,"emitCapturedSizes"),e(r,"captureNodeSizes");export{r as captureNodeSizes,n as shouldCaptureSizes};
@@ -0,0 +1 @@
1
+ import{g as t}from"./chunk-XXDRQBXY-Ct0MhvQo.js";import{s as e}from"./chunk-VQ5W62QI-B95zur4F.js";import{_ as s,l as i,c as n,p as r,r as o,u as a,a as l,b as c,g as h,s as d,q as u,t as p,a6 as y,m as g,z as f,k as m,B as S,C as k,D as b,I as T}from"./mermaid-T_6Ze_cT.js";import{c as _}from"./chunk-55XCU76K-Cq25Yw_G.js";import{p as E}from"./markdown-S2mWvoE-.js";var $=function(){var t=s(function(t,e,s,i){for(s=s||{},i=t.length;i--;s[t[i]]=e);return s},"o"),e=[1,2],i=[1,3],n=[1,4],r=[2,4],o=[1,9],a=[1,11],l=[1,16],c=[1,17],h=[1,18],d=[1,19],u=[1,33],p=[1,20],y=[1,21],g=[1,22],f=[1,23],m=[1,24],S=[1,26],k=[1,27],b=[1,28],T=[1,29],_=[1,30],E=[1,31],$=[1,32],x=[1,35],C=[1,36],D=[1,37],v=[1,38],w=[1,34],I=[1,4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],A=[1,4,5,14,15,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,39,40,41,45,48,51,52,53,54,57],L=[4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],N={trace:s(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SPACE:4,NL:5,SD:6,document:7,line:8,statement:9,classDefStatement:10,styleStatement:11,cssClassStatement:12,idStatement:13,DESCR:14,"--\x3e":15,HIDE_EMPTY:16,scale:17,WIDTH:18,COMPOSIT_STATE:19,STRUCT_START:20,STRUCT_STOP:21,STATE_DESCR:22,AS:23,ID:24,FORK:25,JOIN:26,CHOICE:27,CONCURRENT:28,note:29,notePosition:30,NOTE_TEXT:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,CLICK:38,STRING:39,HREF:40,classDef:41,CLASSDEF_ID:42,CLASSDEF_STYLEOPTS:43,DEFAULT:44,style:45,STYLE_IDS:46,STYLEDEF_STYLEOPTS:47,class:48,CLASSENTITY_IDS:49,STYLECLASS:50,direction_tb:51,direction_bt:52,direction_rl:53,direction_lr:54,eol:55,";":56,EDGE_STATE:57,STYLE_SEPARATOR:58,left_of:59,right_of:60,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NL",6:"SD",14:"DESCR",15:"--\x3e",16:"HIDE_EMPTY",17:"scale",18:"WIDTH",19:"COMPOSIT_STATE",20:"STRUCT_START",21:"STRUCT_STOP",22:"STATE_DESCR",23:"AS",24:"ID",25:"FORK",26:"JOIN",27:"CHOICE",28:"CONCURRENT",29:"note",31:"NOTE_TEXT",33:"acc_title",34:"acc_title_value",35:"acc_descr",36:"acc_descr_value",37:"acc_descr_multiline_value",38:"CLICK",39:"STRING",40:"HREF",41:"classDef",42:"CLASSDEF_ID",43:"CLASSDEF_STYLEOPTS",44:"DEFAULT",45:"style",46:"STYLE_IDS",47:"STYLEDEF_STYLEOPTS",48:"class",49:"CLASSENTITY_IDS",50:"STYLECLASS",51:"direction_tb",52:"direction_bt",53:"direction_rl",54:"direction_lr",56:";",57:"EDGE_STATE",58:"STYLE_SEPARATOR",59:"left_of",60:"right_of"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,3],[9,4],[9,1],[9,2],[9,1],[9,4],[9,3],[9,6],[9,1],[9,1],[9,1],[9,1],[9,4],[9,4],[9,1],[9,2],[9,2],[9,1],[9,5],[9,5],[10,3],[10,3],[11,3],[12,3],[32,1],[32,1],[32,1],[32,1],[55,1],[55,1],[13,1],[13,1],[13,3],[13,3],[30,1],[30,1]],performAction:s(function(t,e,s,i,n,r,o){var a=r.length-1;switch(n){case 3:return i.setRootDoc(r[a]),r[a];case 4:this.$=[];break;case 5:"nl"!=r[a]&&(r[a-1].push(r[a]),this.$=r[a-1]);break;case 6:case 7:case 12:this.$=r[a];break;case 8:this.$="nl";break;case 13:const t=r[a-1];t.description=i.trimColon(r[a]),this.$=t;break;case 14:this.$={stmt:"relation",state1:r[a-2],state2:r[a]};break;case 15:const e=i.trimColon(r[a]);this.$={stmt:"relation",state1:r[a-3],state2:r[a-1],description:e};break;case 19:this.$={stmt:"state",id:r[a-3],type:"default",description:"",doc:r[a-1]};break;case 20:var l=r[a],c=r[a-2].trim();if(r[a].match(":")){var h=r[a].split(":");l=h[0],c=[c,h[1]]}this.$={stmt:"state",id:l,type:"default",description:c};break;case 21:this.$={stmt:"state",id:r[a-3],type:"default",description:r[a-5],doc:r[a-1]};break;case 22:this.$={stmt:"state",id:r[a],type:"fork"};break;case 23:this.$={stmt:"state",id:r[a],type:"join"};break;case 24:this.$={stmt:"state",id:r[a],type:"choice"};break;case 25:this.$={stmt:"state",id:i.getDividerId(),type:"divider"};break;case 26:this.$={stmt:"state",id:r[a-1].trim(),note:{position:r[a-2].trim(),text:r[a].trim()}};break;case 29:this.$=r[a].trim(),i.setAccTitle(this.$);break;case 30:case 31:this.$=r[a].trim(),i.setAccDescription(this.$);break;case 32:this.$={stmt:"click",id:r[a-3],url:r[a-2],tooltip:r[a-1]};break;case 33:this.$={stmt:"click",id:r[a-3],url:r[a-1],tooltip:""};break;case 34:case 35:this.$={stmt:"classDef",id:r[a-1].trim(),classes:r[a].trim()};break;case 36:this.$={stmt:"style",id:r[a-1].trim(),styleClass:r[a].trim()};break;case 37:this.$={stmt:"applyClass",id:r[a-1].trim(),styleClass:r[a].trim()};break;case 38:i.setDirection("TB"),this.$={stmt:"dir",value:"TB"};break;case 39:i.setDirection("BT"),this.$={stmt:"dir",value:"BT"};break;case 40:i.setDirection("RL"),this.$={stmt:"dir",value:"RL"};break;case 41:i.setDirection("LR"),this.$={stmt:"dir",value:"LR"};break;case 44:case 45:this.$={stmt:"state",id:r[a].trim(),type:"default",description:""};break;case 46:case 47:this.$={stmt:"state",id:r[a-2].trim(),classes:[r[a].trim()],type:"default",description:""}}},"anonymous"),table:[{3:1,4:e,5:i,6:n},{1:[3]},{3:5,4:e,5:i,6:n},{3:6,4:e,5:i,6:n},t([1,4,5,16,17,19,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],r,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:o,5:a,8:8,9:10,10:12,11:13,12:14,13:15,16:l,17:c,19:h,22:d,24:u,25:p,26:y,27:g,28:f,29:m,32:25,33:S,35:k,37:b,38:T,41:_,45:E,48:$,51:x,52:C,53:D,54:v,57:w},t(I,[2,5]),{9:39,10:12,11:13,12:14,13:15,16:l,17:c,19:h,22:d,24:u,25:p,26:y,27:g,28:f,29:m,32:25,33:S,35:k,37:b,38:T,41:_,45:E,48:$,51:x,52:C,53:D,54:v,57:w},t(I,[2,7]),t(I,[2,8]),t(I,[2,9]),t(I,[2,10]),t(I,[2,11]),t(I,[2,12],{14:[1,40],15:[1,41]}),t(I,[2,16]),{18:[1,42]},t(I,[2,18],{20:[1,43]}),{23:[1,44]},t(I,[2,22]),t(I,[2,23]),t(I,[2,24]),t(I,[2,25]),{30:45,31:[1,46],59:[1,47],60:[1,48]},t(I,[2,28]),{34:[1,49]},{36:[1,50]},t(I,[2,31]),{13:51,24:u,57:w},{42:[1,52],44:[1,53]},{46:[1,54]},{49:[1,55]},t(A,[2,44],{58:[1,56]}),t(A,[2,45],{58:[1,57]}),t(I,[2,38]),t(I,[2,39]),t(I,[2,40]),t(I,[2,41]),t(I,[2,6]),t(I,[2,13]),{13:58,24:u,57:w},t(I,[2,17]),t(L,r,{7:59}),{24:[1,60]},{24:[1,61]},{23:[1,62]},{24:[2,48]},{24:[2,49]},t(I,[2,29]),t(I,[2,30]),{39:[1,63],40:[1,64]},{43:[1,65]},{43:[1,66]},{47:[1,67]},{50:[1,68]},{24:[1,69]},{24:[1,70]},t(I,[2,14],{14:[1,71]}),{4:o,5:a,8:8,9:10,10:12,11:13,12:14,13:15,16:l,17:c,19:h,21:[1,72],22:d,24:u,25:p,26:y,27:g,28:f,29:m,32:25,33:S,35:k,37:b,38:T,41:_,45:E,48:$,51:x,52:C,53:D,54:v,57:w},t(I,[2,20],{20:[1,73]}),{31:[1,74]},{24:[1,75]},{39:[1,76]},{39:[1,77]},t(I,[2,34]),t(I,[2,35]),t(I,[2,36]),t(I,[2,37]),t(A,[2,46]),t(A,[2,47]),t(I,[2,15]),t(I,[2,19]),t(L,r,{7:78}),t(I,[2,26]),t(I,[2,27]),{5:[1,79]},{5:[1,80]},{4:o,5:a,8:8,9:10,10:12,11:13,12:14,13:15,16:l,17:c,19:h,21:[1,81],22:d,24:u,25:p,26:y,27:g,28:f,29:m,32:25,33:S,35:k,37:b,38:T,41:_,45:E,48:$,51:x,52:C,53:D,54:v,57:w},t(I,[2,32]),t(I,[2,33]),t(I,[2,21])],defaultActions:{5:[2,1],6:[2,2],47:[2,48],48:[2,49]},parseError:s(function(t,e){if(!e.recoverable){var s=new Error(t);throw s.hash=e,s}this.trace(t)},"parseError"),parse:s(function(t){var e=this,i=[0],n=[],r=[null],o=[],a=this.table,l="",c=0,h=0,d=o.slice.call(arguments,1),u=Object.create(this.lexer),p={yy:{}};for(var y in this.yy)Object.prototype.hasOwnProperty.call(this.yy,y)&&(p.yy[y]=this.yy[y]);u.setInput(t,p.yy),p.yy.lexer=u,p.yy.parser=this,void 0===u.yylloc&&(u.yylloc={});var g=u.yylloc;o.push(g);var f=u.options&&u.options.ranges;function m(){var t;return"number"!=typeof(t=n.pop()||u.lex()||1)&&(t instanceof Array&&(t=(n=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof p.yy.parseError?this.parseError=p.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,s(function(t){i.length=i.length-2*t,r.length=r.length-t,o.length=o.length-t},"popStack"),s(m,"lex");for(var S,k,b,T,_,E,$,x,C={};;){if(k=i[i.length-1],this.defaultActions[k]?b=this.defaultActions[k]:(null==S&&(S=m()),b=a[k]&&a[k][S]),void 0===b||!b.length||!b[0]){var D="";for(_ in x=[],a[k])this.terminals_[_]&&_>2&&x.push("'"+this.terminals_[_]+"'");D=u.showPosition?"Parse error on line "+(c+1)+":\n"+u.showPosition()+"\nExpecting "+x.join(", ")+", got '"+(this.terminals_[S]||S)+"'":"Parse error on line "+(c+1)+": Unexpected "+(1==S?"end of input":"'"+(this.terminals_[S]||S)+"'"),this.parseError(D,{text:u.match,token:this.terminals_[S]||S,line:u.yylineno,loc:g,expected:x})}if(b[0]instanceof Array&&b.length>1)throw new Error("Parse Error: multiple actions possible at state: "+k+", token: "+S);switch(b[0]){case 1:i.push(S),r.push(u.yytext),o.push(u.yylloc),i.push(b[1]),S=null,h=u.yyleng,l=u.yytext,c=u.yylineno,g=u.yylloc;break;case 2:if(E=this.productions_[b[1]][1],C.$=r[r.length-E],C._$={first_line:o[o.length-(E||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(E||1)].first_column,last_column:o[o.length-1].last_column},f&&(C._$.range=[o[o.length-(E||1)].range[0],o[o.length-1].range[1]]),void 0!==(T=this.performAction.apply(C,[l,h,c,p.yy,b[1],r,o].concat(d))))return T;E&&(i=i.slice(0,-1*E*2),r=r.slice(0,-1*E),o=o.slice(0,-1*E)),i.push(this.productions_[b[1]][0]),r.push(C.$),o.push(C._$),$=a[i[i.length-2]][i[i.length-1]],i.push($);break;case 3:return!0}}return!0},"parse")},O=function(){return{EOF:1,parseError:s(function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},"parseError"),setInput:s(function(t,e){return this.yy=e||this.yy||{},this._input=t,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},"setInput"),input:s(function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},"input"),unput:s(function(t){var e=t.length,s=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var i=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),s.length-1&&(this.yylineno-=s.length-1);var n=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:s?(s.length===i.length?this.yylloc.first_column:0)+i[i.length-s.length].length-s[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[n[0],n[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},"unput"),more:s(function(){return this._more=!0,this},"more"),reject:s(function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):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).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"reject"),less:s(function(t){this.unput(this.match.slice(t))},"less"),pastInput:s(function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:s(function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:s(function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},"showPosition"),test_match:s(function(t,e){var s,i,n;if(this.options.backtrack_lexer&&(n={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&&(n.yylloc.range=this.yylloc.range.slice(0))),(i=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=i.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:i?i[i.length-1].length-i[i.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,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(t[0].length),this.matched+=t[0],s=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),s)return s;if(this._backtrack){for(var r in n)this[r]=n[r];return!1}return!1},"test_match"),next:s(function(){if(this.done)return this.EOF;var t,e,s,i;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var n=this._currentRules(),r=0;r<n.length;r++)if((s=this._input.match(this.rules[n[r]]))&&(!e||s[0].length>e[0].length)){if(e=s,i=r,this.options.backtrack_lexer){if(!1!==(t=this.test_match(s,n[r])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,n[i]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:s(function(){var t=this.next();return t||this.lex()},"lex"),begin:s(function(t){this.conditionStack.push(t)},"begin"),popState:s(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:s(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:s(function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},"topState"),pushState:s(function(t){this.begin(t)},"pushState"),stateStackSize:s(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:s(function(t,e,i,n){function r(){const s=e.yytext.indexOf("%%");if(0===s)return!1;if(s>0){const i=e.yytext.slice(0,s),n=e.yytext.slice(s);n&&t.lexer.unput(n),e.yytext=i}return!0}switch(s(r,"processId"),i){case 0:return 38;case 1:return 40;case 2:return 39;case 3:return 44;case 4:case 43:return 51;case 5:case 44:return 52;case 6:case 45:return 53;case 7:case 46:return 54;case 8:case 78:return 5;case 9:case 10:case 11:case 12:case 57:case 63:break;case 13:case 33:return this.pushState("SCALE"),17;case 14:case 34:return 18;case 15:case 21:case 35:case 50:case 54:this.popState();break;case 16:return this.begin("acc_title"),33;case 17:return this.popState(),"acc_title_value";case 18:return this.begin("acc_descr"),35;case 19:return this.popState(),"acc_descr_value";case 20:this.begin("acc_descr_multiline");break;case 22:return"acc_descr_multiline_value";case 23:return this.pushState("CLASSDEF"),41;case 24:return this.popState(),this.pushState("CLASSDEFID"),"DEFAULT_CLASSDEF_ID";case 25:return this.popState(),this.pushState("CLASSDEFID"),42;case 26:return this.popState(),43;case 27:return this.pushState("CLASS"),48;case 28:return this.popState(),this.pushState("CLASS_STYLE"),49;case 29:return this.popState(),50;case 30:return this.pushState("STYLE"),45;case 31:return this.popState(),this.pushState("STYLEDEF_STYLES"),46;case 32:return this.popState(),47;case 36:this.pushState("STATE");break;case 37:case 40:return this.popState(),e.yytext=e.yytext.slice(0,-8).trim(),25;case 38:case 41:return this.popState(),e.yytext=e.yytext.slice(0,-8).trim(),26;case 39:case 42:return this.popState(),e.yytext=e.yytext.slice(0,-10).trim(),27;case 47:this.pushState("STATE_STRING");break;case 48:return this.pushState("STATE_ID"),"AS";case 49:case 65:if(!r())return;return this.popState(),"ID";case 51:return"STATE_DESCR";case 52:throw new Error('Error: State name must be a single word. Found: "'+e.yytext.trim()+'"');case 53:return 19;case 55:return this.popState(),this.pushState("struct"),20;case 56:return this.popState(),21;case 58:return this.begin("NOTE"),29;case 59:return this.popState(),this.pushState("NOTE_ID"),59;case 60:return this.popState(),this.pushState("NOTE_ID"),60;case 61:this.popState(),this.pushState("FLOATING_NOTE");break;case 62:return this.popState(),this.pushState("FLOATING_NOTE_ID"),"AS";case 64:return"NOTE_TEXT";case 66:if(!r())return;return this.popState(),this.pushState("NOTE_TEXT"),24;case 67:return this.popState(),e.yytext=e.yytext.substr(2).trim(),31;case 68:return this.popState(),e.yytext=e.yytext.slice(0,-8).trim(),31;case 69:case 70:return 6;case 71:return 16;case 72:return 57;case 73:if(!r())return;return 24;case 74:return e.yytext=e.yytext.trim(),14;case 75:return 15;case 76:return 28;case 77:return 58;case 79:return"INVALID"}},"anonymous"),rules:[/^(?:click\b)/i,/^(?:href\b)/i,/^(?:"[^"]*")/i,/^(?:default\b)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:[\n]+)/i,/^(?:[\s]+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%%(?!\{)[^\n]*)/i,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:classDef\s+)/i,/^(?:DEFAULT\s+)/i,/^(?:\w+\s+)/i,/^(?:[^\n]*)/i,/^(?:class\s+)/i,/^(?:(\w+)+((,\s*\w+)*))/i,/^(?:[^\n]*)/i,/^(?:style\s+)/i,/^(?:[\w,]+\s+)/i,/^(?:[^\n]*)/i,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:state\s+)/i,/^(?:.*<<fork>>)/i,/^(?:.*<<join>>)/i,/^(?:.*<<choice>>)/i,/^(?:.*\[\[fork\]\])/i,/^(?:.*\[\[join\]\])/i,/^(?:.*\[\[choice\]\])/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:["])/i,/^(?:\s*as\s+)/i,/^(?:[^\n\{]*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:\w+\s+\w+.*?\{)/i,/^(?:[^\n\s\{]+)/i,/^(?:\n)/i,/^(?:\{)/i,/^(?:\})/i,/^(?:[\n])/i,/^(?:note\s+)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:")/i,/^(?:\s*as\s*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[^\n]*)/i,/^(?:\s*[^:\n\s\-]+)/i,/^(?:\s*:[^:\n;]+)/i,/^(?:[\s\S]*?\n\s*end note\b)/i,/^(?:stateDiagram\s+)/i,/^(?:stateDiagram-v2\s+)/i,/^(?:hide empty description\b)/i,/^(?:\[\*\])/i,/^(?:[^:\n\s\-\{]+)/i,/^(?:\s*:(?:[^:\n;]|:[^:\n;])+)/i,/^(?:-->)/i,/^(?:--)/i,/^(?::::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{LINE:{rules:[10,11,12],inclusive:!1},struct:{rules:[10,11,12,23,27,30,36,43,44,45,46,56,57,58,72,73,74,75,76,77],inclusive:!1},FLOATING_NOTE_ID:{rules:[65],inclusive:!1},FLOATING_NOTE:{rules:[62,63,64],inclusive:!1},NOTE_TEXT:{rules:[67,68],inclusive:!1},NOTE_ID:{rules:[66],inclusive:!1},NOTE:{rules:[59,60,61],inclusive:!1},STYLEDEF_STYLEOPTS:{rules:[],inclusive:!1},STYLEDEF_STYLES:{rules:[32],inclusive:!1},STYLE_IDS:{rules:[],inclusive:!1},STYLE:{rules:[31],inclusive:!1},CLASS_STYLE:{rules:[29],inclusive:!1},CLASS:{rules:[28],inclusive:!1},CLASSDEFID:{rules:[26],inclusive:!1},CLASSDEF:{rules:[24,25],inclusive:!1},acc_descr_multiline:{rules:[21,22],inclusive:!1},acc_descr:{rules:[19],inclusive:!1},acc_title:{rules:[17],inclusive:!1},SCALE:{rules:[14,15,34,35],inclusive:!1},ALIAS:{rules:[],inclusive:!1},STATE_ID:{rules:[49],inclusive:!1},STATE_STRING:{rules:[50,51],inclusive:!1},FORK_STATE:{rules:[],inclusive:!1},STATE:{rules:[10,11,12,37,38,39,40,41,42,47,48,52,53,54,55],inclusive:!1},ID:{rules:[10,11,12],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,11,12,13,16,18,20,23,27,30,33,36,55,58,69,70,71,72,73,74,75,77,78,79],inclusive:!0}}}}();function R(){this.yy={}}return N.lexer=O,s(R,"Parser"),R.prototype=N,N.Parser=R,new R}();$.parser=$;var x=$,C="state",D="root",v="relation",w="default",I="divider",A="fill:none",L="fill: #333",N="markdown",O="normal",R="rect",B="rectWithTitle",F="divider",P="roundedWithTitle",Y="statediagram",j=`${Y}-state`,G="transition",W=`${G} note-edge`,M=`${Y}-note`,z=`${Y}-cluster`,U=`${Y}-cluster-alt`,X="parent",H="note",K="----",V=`${K}${H}`,J=`${K}${X}`,q=new Map,Q=0,Z=0,tt=new Map,et=s((t,e,s,i)=>{if(t===F&&void 0!==s?.id&&tt.has(s.id)){const t=tt.get(s.id);return tt.set(e,t),t}const n=Z++,r=i?void 0:n;return tt.set(e,r),r},"colorSlotFor");function st(t="",e=0,s="",i=K){return`state-${t}${null!==s&&s.length>0?`${i}${s}`:""}-${e}`}s(st,"stateDomId");var it=s((t,e,s,r,o,a,l,c)=>{i.trace("items",e),e.forEach(e=>{switch(e.stmt){case C:case w:lt(t,e,s,r,o,a,l,c);break;case v:{lt(t,e.state1,s,r,o,a,l,c),lt(t,e.state2,s,r,o,a,l,c);const i="neo"===l,h={id:"edge"+Q,start:e.state1.id,end:e.state2.id,arrowhead:"normal",arrowTypeEnd:i?"arrow_barb_neo":"arrow_barb",style:A,labelStyle:"",label:g.sanitizeText(e.description??"",n()),arrowheadStyle:L,labelpos:"c",labelType:N,thickness:O,classes:G,look:l};o.push(h),Q++}}})},"setupDoc"),nt=s((t,e="TB")=>{let s=e;if(t.doc)for(const i of t.doc)"dir"===i.stmt&&(s=i.value);return s},"getDir");function rt(t,e,s){if(!e.id||"</join></fork>"===e.id||"</choice>"===e.id)return;e.cssClasses&&(Array.isArray(e.cssCompiledStyles)||(e.cssCompiledStyles=[]),e.cssClasses.split(" ").forEach(t=>{const i=s.get(t);i&&(e.cssCompiledStyles=[...e.cssCompiledStyles??[],...i.styles])}));const i=t.find(t=>t.id===e.id);i?Object.assign(i,e):t.push(e)}function ot(t){return t?.classes?.join(" ")??""}function at(t){return t?.styles??[]}s(rt,"insertOrUpdateNode"),s(ot,"getClassesFromDbInfo"),s(at,"getStylesFromDbInfo");var lt=s((t,e,s,r,o,a,l,c)=>{const h=e.id,d=s.get(h),u=ot(d),p=at(d),y=n(),f=""!==u.trim()||p.length>0;if(i.info("dataFetcher parsedItem",e,d,p),"root"!==h){let s=R;!0===e.start?s="stateStart":!1===e.start&&(s="stateEnd"),e.type!==w&&(s=e.type),q.get(h)||q.set(h,{id:h,shape:s,description:g.sanitizeText(h,y),cssClasses:`${u} ${j}`,cssStyles:p});const n=q.get(h);e.description&&(Array.isArray(n.description)?(n.shape=B,n.description.push(e.description)):n.description?.length&&n.description.length>0?(n.shape=B,n.description===h?n.description=[e.description]:n.description=[n.description,e.description]):(n.shape=R,n.description=e.description),n.description=g.sanitizeTextOrArray(n.description,y)),1===n.description?.length&&n.shape===B&&("group"===n.type?n.shape=P:n.shape=R),!n.type&&e.doc&&(i.info("Setting cluster for XCX",h,nt(e)),n.type="group",n.isGroup=!0,n.dir=nt(e),n.shape=e.type===I?F:P,n.colorIndex=et(n.shape,h,t,f),n.cssClasses=`${n.cssClasses} ${z} ${a?U:""}`);const d={labelStyle:"",shape:n.shape,label:n.description,cssClasses:n.cssClasses,cssCompiledStyles:[],cssStyles:n.cssStyles,id:h,dir:n.dir,domId:st(h,Q),type:n.type,isGroup:"group"===n.type,colorIndex:n.colorIndex,padding:8,rx:10,ry:10,look:l,labelType:"markdown"};if(d.shape===F&&(d.label=""),t&&"root"!==t.id&&(i.trace("Setting node ",h," to be child of its parent ",t.id),d.parentId=t.id),d.centerLabel=!0,e.note){const t={labelStyle:"",shape:"note",label:e.note.text,labelType:"markdown",cssClasses:M,cssStyles:[],cssCompiledStyles:[],id:h+V+"-"+Q,domId:st(h,Q,H),type:"node",isGroup:!1,padding:y.flowchart?.padding,look:l,position:e.note.position},s=h+J,i={labelStyle:"",shape:"noteGroup",label:e.note.text,cssClasses:n.cssClasses,cssStyles:[],id:h+J,domId:st(h,Q,X),type:"group",isGroup:!0,padding:16,look:l,position:e.note.position};Q++,i.id=s,t.parentId=s,rt(r,i,c),rt(r,t,c),rt(r,d,c);let a=h,u=t.id;"left of"===e.note.position&&(a=t.id,u=h),o.push({id:a+"-"+u,start:a,end:u,arrowhead:"none",arrowTypeEnd:"",style:A,labelStyle:"",classes:W,pattern:"dashed",arrowheadStyle:L,labelpos:"c",labelType:N,thickness:O,look:l})}else rt(r,d,c)}e.doc&&(i.trace("Adding nodes children "),it(e,e.doc,s,r,o,!a,l,c))},"dataFetcher"),ct=s(()=>{q.clear(),Q=0,Z=0,tt.clear()},"reset"),ht=s((t,e="TB")=>{if(!t.doc)return e;let s=e;for(const i of t.doc)"dir"===i.stmt&&(s=i.value);return s},"getDir"),dt={getClasses:s(function(t,e){return e.db.getClasses()},"getClasses"),draw:s(async function(s,l,c,h){i.info("REF0:"),i.info("Drawing state diagram (v2)",l);const{securityLevel:d,state:u,layout:p}=n();h.db.extract(h.db.getRootDocV2());const y=h.db.getData(),g=t(l,d);y.type=h.type,y.layoutAlgorithm=r(p),y.nodeSpacing=u?.nodeSpacing||50,y.rankSpacing=u?.rankSpacing||50;"neo"===n().look?y.markers=["barbNeo"]:y.markers=["barb"],y.diagramId=l,await o(y,g);try{("function"==typeof h.db.getLinks?h.db.getLinks():new Map).forEach((t,e)=>{const s="string"==typeof e?e:"string"==typeof e?.id?e.id:"",n=y.nodes.find(t=>t.id===s);if(!s)return void i.warn("⚠️ Invalid or missing stateId from key:",JSON.stringify(e));const r=g.node()?.querySelectorAll("g.node, g.rough-node");let o;if(r?.forEach(t=>{const e=t.textContent?.trim();t.id!==n?.domId&&e!==s||(o=t)}),!o)return void i.warn("⚠️ Could not find node matching text:",s);const a=o.parentNode;if(!a)return void i.warn("⚠️ Node has no parent, cannot wrap:",s);const l=document.createElementNS("http://www.w3.org/2000/svg","a"),c=t.url.replace(/^"+|"+$/g,"");if(l.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",c),l.setAttribute("target","_blank"),t.tooltip){const e=t.tooltip.replace(/^"+|"+$/g,"");l.setAttribute("title",e),o.setAttribute("title",e)}a.replaceChild(l,o),l.appendChild(o),i.info("🔗 Wrapped node in <a> tag for:",s,t.url)})}catch(f){i.error("❌ Error injecting clickable links:",f)}a.insertTitle(g,"statediagramTitleText",u?.titleTopMargin??25,h.db.getDiagramTitle()),e(g,8,Y,u?.useMaxWidth??!0)},"draw"),getDir:ht},ut="[*]",pt="start",yt="[*]",gt="end",ft="color",mt="fill",St="bgFill",kt=",",bt=s(()=>new Map,"newClassesList"),Tt=s(()=>({relations:[],states:new Map,documents:{}}),"newDoc"),_t=s(t=>JSON.parse(JSON.stringify(t)),"clone"),Et=class{constructor(t){this.version=t,this.nodes=[],this.edges=[],this.rootDoc=[],this.classes=bt(),this.documents={root:Tt()},this.currentDocument=this.documents.root,this.startEndCount=0,this.dividerCnt=0,this.links=new Map,this.funs=[],this.getAccTitle=l,this.setAccTitle=c,this.getAccDescription=h,this.setAccDescription=d,this.setDiagramTitle=u,this.getDiagramTitle=p,this.clear(),this.setRootDoc=this.setRootDoc.bind(this),this.getDividerId=this.getDividerId.bind(this),this.setDirection=this.setDirection.bind(this),this.trimColon=this.trimColon.bind(this),this.bindFunctions=this.bindFunctions.bind(this)}static{s(this,"StateDB")}static{this.relationType={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3}}extract(t){this.clear(!0);for(const i of Array.isArray(t)?t:t.doc)switch(i.stmt){case C:this.addState(i.id.trim(),i.type,i.doc,i.description,i.note);break;case v:this.addRelation(i.state1,i.state2,i.description);break;case"classDef":this.addStyleClass(i.id.trim(),i.classes);break;case"style":this.handleStyleDef(i);break;case"applyClass":this.setCssClass(i.id.trim(),i.styleClass);break;case"click":this.addLink(i.id,i.url,i.tooltip)}const e=this.getStates(),s=n();ct(),lt(void 0,this.getRootDocV2(),e,this.nodes,this.edges,!0,s.look,this.classes);for(const i of this.nodes)if(Array.isArray(i.label)){if(i.description=i.label.slice(1),i.isGroup&&i.description.length>0)throw new Error(`Group nodes can only have label. Remove the additional description for node [${i.id}]`);i.label=i.label[0]}}handleStyleDef(t){const e=t.id.trim().split(","),s=t.styleClass.split(",");for(const i of e){let t=this.getState(i);if(!t){const e=i.trim();this.addState(e),t=this.getState(e)}t&&(t.styles=s.map(t=>t.replace(/;/g,"")?.trim()))}}setRootDoc(t){i.info("Setting root doc",t),this.rootDoc=t,1===this.version?this.extract(t):this.extract(this.getRootDocV2())}docTranslator(t,e,s){if(e.stmt===v)return this.docTranslator(t,e.state1,!0),void this.docTranslator(t,e.state2,!1);if(e.stmt===C&&(e.id===ut?(e.id=t.id+(s?"_start":"_end"),e.start=s):e.id=e.id.trim()),e.stmt!==D&&e.stmt!==C||!e.doc)return;const i=[];let n=[];for(const r of e.doc)if(r.type===I){const t=_t(r);t.doc=_t(n),i.push(t),n=[]}else n.push(r);if(i.length>0&&n.length>0){const t={stmt:C,id:y(),type:"divider",doc:_t(n)};i.push(_t(t)),e.doc=i}e.doc.forEach(t=>this.docTranslator(e,t,!0))}getRootDocV2(){return this.docTranslator({id:D,stmt:D},{id:D,stmt:D,doc:this.rootDoc},!0),{id:D,doc:this.rootDoc}}addState(t,e=w,s=void 0,r=void 0,o=void 0,a=void 0,l=void 0,c=void 0){const h=t?.trim();if(this.currentDocument.states.has(h)){const t=this.currentDocument.states.get(h);if(!t)throw new Error(`State not found: ${h}`);t.doc||(t.doc=s),t.type||(t.type=e)}else i.info("Adding state ",h,r),this.currentDocument.states.set(h,{stmt:C,id:h,descriptions:[],type:e,doc:s,note:o,classes:[],styles:[],textStyles:[]});if(r){i.info("Setting state description",h,r);(Array.isArray(r)?r:[r]).forEach(t=>this.addDescription(h,t.trim()))}if(o){const t=this.currentDocument.states.get(h);if(!t)throw new Error(`State not found: ${h}`);t.note=o,t.note.text=g.sanitizeText(t.note.text,n())}if(a){i.info("Setting state classes",h,a);(Array.isArray(a)?a:[a]).forEach(t=>this.setCssClass(h,t.trim()))}if(l){i.info("Setting state styles",h,l);(Array.isArray(l)?l:[l]).forEach(t=>this.setStyle(h,t.trim()))}if(c){i.info("Setting state styles",h,l);(Array.isArray(c)?c:[c]).forEach(t=>this.setTextStyle(h,t.trim()))}}clear(t){this.nodes=[],this.edges=[],this.funs=[this.setupToolTips.bind(this)],this.documents={root:Tt()},this.currentDocument=this.documents.root,this.startEndCount=0,this.classes=bt(),t||(this.links=new Map,f())}getState(t){return this.currentDocument.states.get(t)}getStates(){return this.currentDocument.states}logDocuments(){i.info("Documents = ",this.documents)}getRelations(){return this.currentDocument.relations}addLink(t,e,s){this.links.set(t,{url:e,tooltip:s}),i.warn("Adding link",t,e,s)}getLinks(){return this.links}startIdIfNeeded(t=""){return t===ut?(this.startEndCount++,`${pt}${this.startEndCount}`):t}startTypeIfNeeded(t="",e=w){return t===ut?pt:e}endIdIfNeeded(t=""){return t===yt?(this.startEndCount++,`${gt}${this.startEndCount}`):t}endTypeIfNeeded(t="",e=w){return t===yt?gt:e}addRelationObjs(t,e,s=""){const i=this.startIdIfNeeded(t.id.trim()),r=this.startTypeIfNeeded(t.id.trim(),t.type),o=this.startIdIfNeeded(e.id.trim()),a=this.startTypeIfNeeded(e.id.trim(),e.type);this.addState(i,r,t.doc,t.description,t.note,t.classes,t.styles,t.textStyles),this.addState(o,a,e.doc,e.description,e.note,e.classes,e.styles,e.textStyles),this.currentDocument.relations.push({id1:i,id2:o,relationTitle:g.sanitizeText(s,n())})}addRelation(t,e,s){if("object"==typeof t&&"object"==typeof e)this.addRelationObjs(t,e,s);else if("string"==typeof t&&"string"==typeof e){const i=this.startIdIfNeeded(t.trim()),r=this.startTypeIfNeeded(t),o=this.endIdIfNeeded(e.trim()),a=this.endTypeIfNeeded(e);this.addState(i,r),this.addState(o,a),this.currentDocument.relations.push({id1:i,id2:o,relationTitle:s?g.sanitizeText(s,n()):void 0})}}addDescription(t,e){const s=this.currentDocument.states.get(t),i=e.startsWith(":")?e.replace(":","").trim():e;s?.descriptions?.push(g.sanitizeText(i,n()))}cleanupLabel(t){return t.startsWith(":")?t.slice(2).trim():t.trim()}getDividerId(){return this.dividerCnt++,`divider-id-${this.dividerCnt}`}addStyleClass(t,e=""){this.classes.has(t)||this.classes.set(t,{id:t,styles:[],textStyles:[]});const s=this.classes.get(t);e&&s&&e.split(kt).forEach(t=>{const e=t.replace(/([^;]*);/,"$1").trim();if(RegExp(ft).exec(t)){const t=e.replace(mt,St).replace(ft,mt);s.textStyles.push(t)}s.styles.push(e)})}getClasses(){return this.classes}setupToolTips(t){const e=_();m(t).select("svg").selectAll("g.node, g.rough-node").on("mouseover",t=>{const s=m(t.currentTarget),i=s.attr("title");if(null===i)return;const n=t.currentTarget?.getBoundingClientRect();e.transition().duration(200).style("opacity",".9"),e.style("left",window.scrollX+n.left+(n.right-n.left)/2+"px").style("top",window.scrollY+n.bottom+"px"),e.html(E.sanitize(i)),s.classed("hover",!0)}).on("mouseout",t=>{e.transition().duration(500).style("opacity",0);m(t.currentTarget).classed("hover",!1)})}setCssClass(t,e){t.split(",").forEach(t=>{let s=this.getState(t);if(!s){const e=t.trim();this.addState(e),s=this.getState(e)}s?.classes?.push(e)})}setStyle(t,e){this.getState(t)?.styles?.push(e)}setTextStyle(t,e){this.getState(t)?.textStyles?.push(e)}bindFunctions(t){this.funs.forEach(e=>{e(t)})}getDirectionStatement(){return this.rootDoc.find(t=>"dir"===t.stmt)}getDirection(){return this.getDirectionStatement()?.value??"TB"}setDirection(t){const e=this.getDirectionStatement();e?e.value=t:this.rootDoc.unshift({stmt:"dir",value:t})}trimColon(t){return t.startsWith(":")?t.slice(1).trim():t.trim()}getData(){const t=n();for(const e of this.nodes)e.wrappingWidth??=t.state?.wrappingWidth,e.isGroup||(e.minWidth??=t.state?.minNodeWidth);return{nodes:this.nodes,edges:this.edges,other:{},config:t,direction:ht(this.getRootDocV2())}}getConfig(){return n().state}},$t=s(t=>{const{theme:e,bkgColorArray:s,borderColorArray:i}=t;if(!S(e,i))return"";const n=k(t.look),r=b(s);let o="";for(let a=0;a<T(i);a++){const t=i[a],e=r?`fill: ${s[a%s.length]};`:"",l=`[data-look="${n}"][data-color-id="color-${a}"]`;o+=`\n\n /* The title strip: \`rect.outer\` spans the whole composite and \`rect.inner\` covers\n the body, so what stays visible of \`outer\` is the band behind the label. */\n ${l}.statediagram-cluster rect.outer {\n stroke: ${t};\n ${e}\n }\n\n ${l}.statediagram-cluster rect.inner {\n stroke: ${t};\n }\n\n /* Concurrency regions. Siblings of one composite share a slot, so a divided composite\n reads as one thing split into parts rather than as several composites. */\n ${l}.statediagram-cluster rect.divider {\n stroke: ${t};\n ${e}\n }\n\n /* handDrawn draws the same container as roughjs shapes rather than plain rects, so it\n needs its own rules. \`roundedWithTitle\` and \`divider\` name those groups \`outer\`,\n \`inner\` and \`divider\` to match the classic branch, which is what lets these\n discriminate -- a bare \`.statediagram-cluster path\` rule reached the body as well and\n tinted the whole composite, losing \`compositeBackground\` and diverging from what\n classic and neo do.\n\n roughjs emits two paths per shape and marks them: the filled shape carries\n \`stroke="none"\` and the sketched outline carries \`fill="none"\`. Splitting on that is\n what keeps \`fill\` off the outline -- a rough outline is open squiggles, not a closed\n region, so filling it produces smears -- and keeps \`stroke\` off the fill shape, which\n would otherwise gain an edge it was drawn without. */\n ${l}.statediagram-cluster .outer path[stroke='none'] {\n ${e}\n }\n\n ${l}.statediagram-cluster .outer path[fill='none'] {\n stroke: ${t};\n }\n\n /* No \`.inner\` rule on purpose. The body shape is left entirely alone under handDrawn,\n where a rect's \`inner\` counterpart cannot be recoloured safely: roughjs draws a\n hachure fill as *stroked* lines, so its fill paths carry \`fill="none"\` exactly like\n the outline and no selector separates them. An \`.inner\` stroke rule therefore\n repainted the hatching of every alt composite in the palette colour instead of\n leaving it on \`altBackground\`. The container still reads as palette-coloured: the\n \`outer\` shape spans the whole composite, so its outline already frames the body. */\n\n /* Regions split the same way, which is why \`divider\` fills solid rather than taking\n roughjs's default hachure -- see the note on that call. Hatched, both of its paths\n carried \`fill="none"\` and these two rules degenerated: the tint matched nothing and\n the border rule repainted the hatching. */\n ${l}.statediagram-cluster .divider path[stroke='none'] {\n ${e}\n }\n\n ${l}.statediagram-cluster .divider path[fill='none'] {\n stroke: ${t};\n }\n `}return o},"genColor"),xt=s(t=>`\n${$t(t)}\ndefs [id$="-barbEnd"] {\n fill: ${t.transitionColor};\n stroke: ${t.transitionColor};\n }\ng.stateGroup text {\n fill: ${t.nodeBorder};\n stroke: none;\n font-size: 10px;\n}\ng.stateGroup text {\n fill: ${t.textColor};\n stroke: none;\n font-size: 10px;\n\n}\ng.stateGroup .state-title {\n font-weight: bolder;\n fill: ${t.stateLabelColor};\n}\n\ng.stateGroup rect {\n fill: ${t.mainBkg};\n stroke: ${t.nodeBorder};\n}\n\ng.stateGroup line {\n stroke: ${t.lineColor};\n stroke-width: ${t.strokeWidth||1};\n}\n\n.transition {\n stroke: ${t.transitionColor};\n stroke-width: ${t.strokeWidth||1};\n fill: none;\n}\n\n.stateGroup .composit {\n fill: ${t.background};\n border-bottom: 1px\n}\n\n.stateGroup .alt-composit {\n fill: #e0e0e0;\n border-bottom: 1px\n}\n\n.state-note {\n stroke: ${t.noteBorderColor};\n fill: ${t.noteBkgColor};\n\n text {\n fill: ${t.noteTextColor};\n stroke: none;\n font-size: 10px;\n }\n}\n\n.stateLabel .box {\n stroke: none;\n stroke-width: 0;\n fill: ${t.mainBkg};\n opacity: 0.5;\n}\n\n.edgeLabel .label rect {\n fill: ${t.labelBackgroundColor};\n opacity: 0.5;\n}\n.edgeLabel {\n background-color: ${t.edgeLabelBackground};\n p {\n background-color: ${t.edgeLabelBackground};\n }\n rect {\n opacity: 0.5;\n background-color: ${t.edgeLabelBackground};\n fill: ${t.edgeLabelBackground};\n }\n text-align: center;\n}\n.edgeLabel .label text {\n fill: ${t.transitionLabelColor||t.tertiaryTextColor};\n}\n.label div .edgeLabel {\n color: ${t.transitionLabelColor||t.tertiaryTextColor};\n}\n\n.stateLabel text {\n fill: ${t.stateLabelColor};\n font-size: 10px;\n font-weight: bold;\n}\n\n.node circle.state-start {\n fill: ${t.specialStateColor};\n stroke: ${t.specialStateColor};\n}\n\n.node .fork-join {\n fill: ${t.specialStateColor};\n stroke: ${t.specialStateColor};\n}\n\n.node circle.state-end {\n fill: ${t.innerEndBackground};\n stroke: ${t.background};\n stroke-width: 1.5\n}\n.end-state-inner {\n fill: ${t.compositeBackground||t.background};\n // stroke: ${t.background};\n stroke-width: 1.5\n}\n\n.node rect {\n fill: ${t.stateBkg||t.mainBkg};\n stroke: ${t.stateBorder||t.nodeBorder};\n stroke-width: ${t.strokeWidth||1}px;\n}\n.node polygon {\n fill: ${t.mainBkg};\n stroke: ${t.stateBorder||t.nodeBorder};;\n stroke-width: ${t.strokeWidth||1}px;\n}\n[id$="-barbEnd"] {\n fill: ${t.lineColor};\n}\n\n.statediagram-cluster rect {\n fill: ${t.compositeTitleBackground};\n stroke: ${t.stateBorder||t.nodeBorder};\n stroke-width: ${t.strokeWidth||1}px;\n}\n\n.cluster-label, .nodeLabel {\n color: ${t.stateLabelColor};\n // line-height: 1;\n}\n\n.statediagram-cluster rect.outer {\n rx: 5px;\n ry: 5px;\n}\n.statediagram-state .divider {\n stroke: ${t.stateBorder||t.nodeBorder};\n}\n\n.statediagram-state .title-state {\n rx: 5px;\n ry: 5px;\n}\n.statediagram-cluster.statediagram-cluster .inner {\n fill: ${t.compositeBackground||t.background};\n}\n.statediagram-cluster.statediagram-cluster-alt .inner {\n fill: ${t.altBackground?t.altBackground:"#efefef"};\n}\n\n.statediagram-cluster .inner {\n rx:0;\n ry:0;\n}\n\n.statediagram-state rect.basic {\n rx: 5px;\n ry: 5px;\n}\n.statediagram-state rect.divider {\n stroke-dasharray: 10,10;\n fill: ${t.altBackground?t.altBackground:"#efefef"};\n}\n\n.note-edge {\n stroke-dasharray: 5;\n}\n\n.statediagram-note rect {\n fill: ${t.noteBkgColor};\n stroke: ${t.noteBorderColor};\n stroke-width: 1px;\n rx: 0;\n ry: 0;\n}\n.statediagram-note rect {\n fill: ${t.noteBkgColor};\n stroke: ${t.noteBorderColor};\n stroke-width: 1px;\n rx: 0;\n ry: 0;\n}\n\n.statediagram-note text {\n fill: ${t.noteTextColor};\n}\n\n.statediagram-note .nodeLabel {\n color: ${t.noteTextColor};\n}\n.statediagram .edgeLabel {\n color: red; // ${t.noteTextColor};\n}\n\n[id$="-dependencyStart"], [id$="-dependencyEnd"] {\n fill: ${t.lineColor};\n stroke: ${t.lineColor};\n stroke-width: ${t.strokeWidth||1};\n}\n\n.statediagramTitleText {\n text-anchor: middle;\n font-size: 18px;\n fill: ${t.textColor};\n}\n\n[data-look="neo"].statediagram-cluster rect {\n fill: ${t.mainBkg};\n stroke: ${t.useGradient?"url("+t.svgId+"-gradient)":t.stateBorder||t.nodeBorder};\n stroke-width: ${t.strokeWidth??1};\n}\n[data-look="neo"].statediagram-cluster rect.outer {\n rx: ${t.radius}px;\n ry: ${t.radius}px;\n filter: ${t.dropShadow?t.dropShadow.replace("url(#drop-shadow)",`url(${t.svgId}-drop-shadow)`):"none"}\n}\n`,"getStyles"),Ct={parser:x,get db(){return new Et(2)},renderer:dt,styles:xt,init:s(t=>{t.state||(t.state={}),t.state.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};export{Ct as diagram};