auto-coder-web 0.1.99__py3-none-any.whl → 0.1.101__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. auto_coder_web/version.py +1 -1
  2. auto_coder_web/web/assets/HistoryPanel-gJupyfFp.js +2 -0
  3. auto_coder_web/web/assets/_basePickBy-CCSZj2pA.js +1 -0
  4. auto_coder_web/web/assets/_baseUniq-BTllNErT.js +1 -0
  5. auto_coder_web/web/assets/arc-BXjHXofo.js +1 -0
  6. auto_coder_web/web/assets/architectureDiagram-IEHRJDOE-DmIqWpdi.js +36 -0
  7. auto_coder_web/web/assets/blockDiagram-JOT3LUYC-DtACHz1R.js +121 -0
  8. auto_coder_web/web/assets/c4Diagram-VJAJSXHY-D3eQI0f_.js +10 -0
  9. auto_coder_web/web/assets/channel-C4EINljX.js +1 -0
  10. auto_coder_web/web/assets/chunk-4BMEZGHF-Ckc43zxH.js +1 -0
  11. auto_coder_web/web/assets/chunk-A2AXSNBT-CJ57iCVC.js +164 -0
  12. auto_coder_web/web/assets/chunk-AEK57VVT-o_ViTLZT.js +220 -0
  13. auto_coder_web/web/assets/chunk-D6G4REZN-2ayrGi-2.js +1 -0
  14. auto_coder_web/web/assets/chunk-RZ5BOZE2-csKhWZPs.js +1 -0
  15. auto_coder_web/web/assets/chunk-XZIHB7SX-G4BVkcV4.js +1 -0
  16. auto_coder_web/web/assets/classDiagram-GIVACNV2-DP0khH1f.js +1 -0
  17. auto_coder_web/web/assets/classDiagram-v2-COTLJTTW-DP0khH1f.js +1 -0
  18. auto_coder_web/web/assets/clone-Bg4iLekk.js +1 -0
  19. auto_coder_web/web/assets/{cssMode-dfzmIRw_.js → cssMode-BPyr8lmu.js} +1 -1
  20. auto_coder_web/web/assets/cytoscape.esm-BY7v1xhs.js +331 -0
  21. auto_coder_web/web/assets/dagre-OKDRZEBW-CCuMXe_S.js +4 -0
  22. auto_coder_web/web/assets/diagram-SSKATNLV-Bp-uorEf.js +43 -0
  23. auto_coder_web/web/assets/diagram-VNBRO52H-CKQFD3a_.js +24 -0
  24. auto_coder_web/web/assets/erDiagram-Q7BY3M3F-9eI0zHpI.js +60 -0
  25. auto_coder_web/web/assets/flowDiagram-4HSFHLVR-3RcC2Ccp.js +161 -0
  26. auto_coder_web/web/assets/{freemarker2-CD79_SV-.js → freemarker2-BU5Z-fJI.js} +1 -1
  27. auto_coder_web/web/assets/ganttDiagram-APWFNJXF-D2cSA1Cd.js +257 -0
  28. auto_coder_web/web/assets/gitGraphDiagram-7IBYFJ6S-D_9htwjS.js +65 -0
  29. auto_coder_web/web/assets/graph-cCt1e4eU.js +1 -0
  30. auto_coder_web/web/assets/{handlebars-B_inQ7Ga.js → handlebars-mkin9J8g.js} +2 -2
  31. auto_coder_web/web/assets/{html-s8IXsV2v.js → html-DtBbZIcO.js} +1 -1
  32. auto_coder_web/web/assets/{htmlMode-BNdCO4Um.js → htmlMode-RbI6rOrZ.js} +1 -1
  33. auto_coder_web/web/assets/infoDiagram-PH2N3AL5-BYP4b-4i.js +2 -0
  34. auto_coder_web/web/assets/init-Gi6I4Gst.js +1 -0
  35. auto_coder_web/web/assets/{javascript-D_ZBRKl9.js → javascript-f2lALfl-.js} +1 -1
  36. auto_coder_web/web/assets/journeyDiagram-U35MCT3I-B89eezTp.js +138 -0
  37. auto_coder_web/web/assets/{jsonMode-lWocgRYn.js → jsonMode-D_iny90a.js} +1 -1
  38. auto_coder_web/web/assets/kanban-definition-NDS4AKOZ-DXZ3QE3M.js +88 -0
  39. auto_coder_web/web/assets/katex-ChWnQ-fc.js +261 -0
  40. auto_coder_web/web/assets/layout-DEspB-Nn.js +1 -0
  41. auto_coder_web/web/assets/linear-DvyAnBDb.js +1 -0
  42. auto_coder_web/web/assets/{liquid-CPaH0eVF.js → liquid-BLUt9KkL.js} +1 -1
  43. auto_coder_web/web/assets/main-DgQa03WG.css +32 -0
  44. auto_coder_web/web/assets/main.js +637 -426
  45. auto_coder_web/web/assets/{mdx-DRx1b0qs.js → mdx-CiikeQLk.js} +1 -1
  46. auto_coder_web/web/assets/mindmap-definition-ALO5MXBD-BK4Kd7cQ.js +95 -0
  47. auto_coder_web/web/assets/ordinal-Cboi1Yqb.js +1 -0
  48. auto_coder_web/web/assets/pieDiagram-IB7DONF6-UuIn9g8t.js +30 -0
  49. auto_coder_web/web/assets/{python-5rTPwuda.js → python-BQGAmGD2.js} +1 -1
  50. auto_coder_web/web/assets/quadrantDiagram-7GDLP6J5-DdkeEcG5.js +7 -0
  51. auto_coder_web/web/assets/radar-MK3ICKWK-Bzl6RmHe.js +128 -0
  52. auto_coder_web/web/assets/{razor-zn6WfQ9V.js → razor-CMmYJAVf.js} +1 -1
  53. auto_coder_web/web/assets/requirementDiagram-KVF5MWMF-DYvXHPCT.js +64 -0
  54. auto_coder_web/web/assets/sankeyDiagram-QLVOVGJD-C3fiDKw0.js +10 -0
  55. auto_coder_web/web/assets/sequenceDiagram-X6HHIX6F-CifpUH-p.js +122 -0
  56. auto_coder_web/web/assets/stateDiagram-DGXRK772-x-pqGGcU.js +1 -0
  57. auto_coder_web/web/assets/stateDiagram-v2-YXO3MK2T-BhO6ozG8.js +1 -0
  58. auto_coder_web/web/assets/timeline-definition-BDJGKUSR-BmbgmEKE.js +61 -0
  59. auto_coder_web/web/assets/{tsMode-CkhihvQ0.js → tsMode-LqKHR7gR.js} +4 -4
  60. auto_coder_web/web/assets/{typescript-DH2E4fY1.js → typescript-KnQ9Sglt.js} +2 -2
  61. auto_coder_web/web/assets/{xml-kipCCfsB.js → xml-G2dyiWZM.js} +2 -2
  62. auto_coder_web/web/assets/xychartDiagram-VJFVF3MP-DnV9OlaB.js +7 -0
  63. auto_coder_web/web/assets/{yaml-BI9EB_1X.js → yaml-D_70BM1U.js} +1 -1
  64. auto_coder_web/web/index.html +1 -1
  65. {auto_coder_web-0.1.99.dist-info → auto_coder_web-0.1.101.dist-info}/METADATA +2 -2
  66. {auto_coder_web-0.1.99.dist-info → auto_coder_web-0.1.101.dist-info}/RECORD +69 -25
  67. auto_coder_web/web/assets/HistoryPanel-DAeswjWO.js +0 -2
  68. auto_coder_web/web/assets/main-D2S0ggFA.css +0 -32
  69. {auto_coder_web-0.1.99.dist-info → auto_coder_web-0.1.101.dist-info}/WHEEL +0 -0
  70. {auto_coder_web-0.1.99.dist-info → auto_coder_web-0.1.101.dist-info}/entry_points.txt +0 -0
  71. {auto_coder_web-0.1.99.dist-info → auto_coder_web-0.1.101.dist-info}/top_level.txt +0 -0
@@ -1,4 +1,4 @@
1
- import{o as m}from"./main.js";/*!-----------------------------------------------------------------------------
1
+ import{aq as m}from"./main.js";/*!-----------------------------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
3
  * Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
4
4
  * Released under the MIT license
@@ -0,0 +1,64 @@
1
+ import{g as Ge,s as ze}from"./chunk-RZ5BOZE2-csKhWZPs.js";import{_ as f,b as Xe,a as Je,s as Ze,g as et,p as tt,q as st,c as Ne,l as qe,y as it,B as rt,o as nt,r as at,u as lt}from"./main.js";var Ae=function(){var e=f(function(P,i,r,l){for(r=r||{},l=P.length;l--;r[P[l]]=i);return r},"o"),a=[1,3],u=[1,4],o=[1,5],m=[1,6],c=[5,6,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,77,89,90],p=[1,22],R=[2,7],h=[1,26],E=[1,27],I=[1,28],k=[1,29],A=[1,33],C=[1,34],V=[1,35],v=[1,36],x=[1,37],L=[1,38],D=[1,24],O=[1,31],w=[1,32],M=[1,30],g=[1,39],_=[1,40],y=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,77,89,90],$=[1,61],X=[89,90],Ce=[5,8,9,11,13,21,22,23,24,27,29,41,42,43,44,45,46,54,61,63,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],de=[27,29],Ve=[1,70],ve=[1,71],xe=[1,72],Le=[1,73],De=[1,74],Oe=[1,75],we=[1,76],ee=[1,83],U=[1,80],te=[1,84],se=[1,85],ie=[1,86],re=[1,87],ne=[1,88],ae=[1,89],le=[1,90],ce=[1,91],oe=[1,92],pe=[5,8,9,11,13,21,22,23,24,27,41,42,43,44,45,46,54,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],Y=[63,64],Me=[1,101],Fe=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,76,77,89,90],N=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],B=[1,110],Q=[1,106],H=[1,107],K=[1,108],W=[1,109],j=[1,111],he=[1,116],ue=[1,117],fe=[1,114],me=[1,115],Se={trace:f(function(){},"trace"),yy:{},symbols_:{error:2,start:3,directive:4,NEWLINE:5,RD:6,diagram:7,EOF:8,acc_title:9,acc_title_value:10,acc_descr:11,acc_descr_value:12,acc_descr_multiline_value:13,requirementDef:14,elementDef:15,relationshipDef:16,direction:17,styleStatement:18,classDefStatement:19,classStatement:20,direction_tb:21,direction_bt:22,direction_rl:23,direction_lr:24,requirementType:25,requirementName:26,STRUCT_START:27,requirementBody:28,STYLE_SEPARATOR:29,idList:30,ID:31,COLONSEP:32,id:33,TEXT:34,text:35,RISK:36,riskLevel:37,VERIFYMTHD:38,verifyType:39,STRUCT_STOP:40,REQUIREMENT:41,FUNCTIONAL_REQUIREMENT:42,INTERFACE_REQUIREMENT:43,PERFORMANCE_REQUIREMENT:44,PHYSICAL_REQUIREMENT:45,DESIGN_CONSTRAINT:46,LOW_RISK:47,MED_RISK:48,HIGH_RISK:49,VERIFY_ANALYSIS:50,VERIFY_DEMONSTRATION:51,VERIFY_INSPECTION:52,VERIFY_TEST:53,ELEMENT:54,elementName:55,elementBody:56,TYPE:57,type:58,DOCREF:59,ref:60,END_ARROW_L:61,relationship:62,LINE:63,END_ARROW_R:64,CONTAINS:65,COPIES:66,DERIVES:67,SATISFIES:68,VERIFIES:69,REFINES:70,TRACES:71,CLASSDEF:72,stylesOpt:73,CLASS:74,ALPHA:75,COMMA:76,STYLE:77,style:78,styleComponent:79,NUM:80,COLON:81,UNIT:82,SPACE:83,BRKT:84,PCT:85,MINUS:86,LABEL:87,SEMICOLON:88,unqString:89,qString:90,$accept:0,$end:1},terminals_:{2:"error",5:"NEWLINE",6:"RD",8:"EOF",9:"acc_title",10:"acc_title_value",11:"acc_descr",12:"acc_descr_value",13:"acc_descr_multiline_value",21:"direction_tb",22:"direction_bt",23:"direction_rl",24:"direction_lr",27:"STRUCT_START",29:"STYLE_SEPARATOR",31:"ID",32:"COLONSEP",34:"TEXT",36:"RISK",38:"VERIFYMTHD",40:"STRUCT_STOP",41:"REQUIREMENT",42:"FUNCTIONAL_REQUIREMENT",43:"INTERFACE_REQUIREMENT",44:"PERFORMANCE_REQUIREMENT",45:"PHYSICAL_REQUIREMENT",46:"DESIGN_CONSTRAINT",47:"LOW_RISK",48:"MED_RISK",49:"HIGH_RISK",50:"VERIFY_ANALYSIS",51:"VERIFY_DEMONSTRATION",52:"VERIFY_INSPECTION",53:"VERIFY_TEST",54:"ELEMENT",57:"TYPE",59:"DOCREF",61:"END_ARROW_L",63:"LINE",64:"END_ARROW_R",65:"CONTAINS",66:"COPIES",67:"DERIVES",68:"SATISFIES",69:"VERIFIES",70:"REFINES",71:"TRACES",72:"CLASSDEF",74:"CLASS",75:"ALPHA",76:"COMMA",77:"STYLE",80:"NUM",81:"COLON",82:"UNIT",83:"SPACE",84:"BRKT",85:"PCT",86:"MINUS",87:"LABEL",88:"SEMICOLON",89:"unqString",90:"qString"},productions_:[0,[3,3],[3,2],[3,4],[4,2],[4,2],[4,1],[7,0],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[17,1],[17,1],[17,1],[17,1],[14,5],[14,7],[28,5],[28,5],[28,5],[28,5],[28,2],[28,1],[25,1],[25,1],[25,1],[25,1],[25,1],[25,1],[37,1],[37,1],[37,1],[39,1],[39,1],[39,1],[39,1],[15,5],[15,7],[56,5],[56,5],[56,2],[56,1],[16,5],[16,5],[62,1],[62,1],[62,1],[62,1],[62,1],[62,1],[62,1],[19,3],[20,3],[20,3],[30,1],[30,3],[30,1],[30,3],[18,3],[73,1],[73,3],[78,1],[78,2],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[26,1],[26,1],[33,1],[33,1],[35,1],[35,1],[55,1],[55,1],[58,1],[58,1],[60,1],[60,1]],performAction:f(function(i,r,l,s,d,t,Ee){var n=t.length-1;switch(d){case 4:this.$=t[n].trim(),s.setAccTitle(this.$);break;case 5:case 6:this.$=t[n].trim(),s.setAccDescription(this.$);break;case 7:this.$=[];break;case 17:s.setDirection("TB");break;case 18:s.setDirection("BT");break;case 19:s.setDirection("RL");break;case 20:s.setDirection("LR");break;case 21:s.addRequirement(t[n-3],t[n-4]);break;case 22:s.addRequirement(t[n-5],t[n-6]),s.setClass([t[n-5]],t[n-3]);break;case 23:s.setNewReqId(t[n-2]);break;case 24:s.setNewReqText(t[n-2]);break;case 25:s.setNewReqRisk(t[n-2]);break;case 26:s.setNewReqVerifyMethod(t[n-2]);break;case 29:this.$=s.RequirementType.REQUIREMENT;break;case 30:this.$=s.RequirementType.FUNCTIONAL_REQUIREMENT;break;case 31:this.$=s.RequirementType.INTERFACE_REQUIREMENT;break;case 32:this.$=s.RequirementType.PERFORMANCE_REQUIREMENT;break;case 33:this.$=s.RequirementType.PHYSICAL_REQUIREMENT;break;case 34:this.$=s.RequirementType.DESIGN_CONSTRAINT;break;case 35:this.$=s.RiskLevel.LOW_RISK;break;case 36:this.$=s.RiskLevel.MED_RISK;break;case 37:this.$=s.RiskLevel.HIGH_RISK;break;case 38:this.$=s.VerifyType.VERIFY_ANALYSIS;break;case 39:this.$=s.VerifyType.VERIFY_DEMONSTRATION;break;case 40:this.$=s.VerifyType.VERIFY_INSPECTION;break;case 41:this.$=s.VerifyType.VERIFY_TEST;break;case 42:s.addElement(t[n-3]);break;case 43:s.addElement(t[n-5]),s.setClass([t[n-5]],t[n-3]);break;case 44:s.setNewElementType(t[n-2]);break;case 45:s.setNewElementDocRef(t[n-2]);break;case 48:s.addRelationship(t[n-2],t[n],t[n-4]);break;case 49:s.addRelationship(t[n-2],t[n-4],t[n]);break;case 50:this.$=s.Relationships.CONTAINS;break;case 51:this.$=s.Relationships.COPIES;break;case 52:this.$=s.Relationships.DERIVES;break;case 53:this.$=s.Relationships.SATISFIES;break;case 54:this.$=s.Relationships.VERIFIES;break;case 55:this.$=s.Relationships.REFINES;break;case 56:this.$=s.Relationships.TRACES;break;case 57:this.$=t[n-2],s.defineClass(t[n-1],t[n]);break;case 58:s.setClass(t[n-1],t[n]);break;case 59:s.setClass([t[n-2]],t[n]);break;case 60:case 62:this.$=[t[n]];break;case 61:case 63:this.$=t[n-2].concat([t[n]]);break;case 64:this.$=t[n-2],s.setCssStyle(t[n-1],t[n]);break;case 65:this.$=[t[n]];break;case 66:t[n-2].push(t[n]),this.$=t[n-2];break;case 68:this.$=t[n-1]+t[n];break}},"anonymous"),table:[{3:1,4:2,6:a,9:u,11:o,13:m},{1:[3]},{3:8,4:2,5:[1,7],6:a,9:u,11:o,13:m},{5:[1,9]},{10:[1,10]},{12:[1,11]},e(c,[2,6]),{3:12,4:2,6:a,9:u,11:o,13:m},{1:[2,2]},{4:17,5:p,7:13,8:R,9:u,11:o,13:m,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:h,22:E,23:I,24:k,25:23,33:25,41:A,42:C,43:V,44:v,45:x,46:L,54:D,72:O,74:w,77:M,89:g,90:_},e(c,[2,4]),e(c,[2,5]),{1:[2,1]},{8:[1,41]},{4:17,5:p,7:42,8:R,9:u,11:o,13:m,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:h,22:E,23:I,24:k,25:23,33:25,41:A,42:C,43:V,44:v,45:x,46:L,54:D,72:O,74:w,77:M,89:g,90:_},{4:17,5:p,7:43,8:R,9:u,11:o,13:m,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:h,22:E,23:I,24:k,25:23,33:25,41:A,42:C,43:V,44:v,45:x,46:L,54:D,72:O,74:w,77:M,89:g,90:_},{4:17,5:p,7:44,8:R,9:u,11:o,13:m,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:h,22:E,23:I,24:k,25:23,33:25,41:A,42:C,43:V,44:v,45:x,46:L,54:D,72:O,74:w,77:M,89:g,90:_},{4:17,5:p,7:45,8:R,9:u,11:o,13:m,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:h,22:E,23:I,24:k,25:23,33:25,41:A,42:C,43:V,44:v,45:x,46:L,54:D,72:O,74:w,77:M,89:g,90:_},{4:17,5:p,7:46,8:R,9:u,11:o,13:m,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:h,22:E,23:I,24:k,25:23,33:25,41:A,42:C,43:V,44:v,45:x,46:L,54:D,72:O,74:w,77:M,89:g,90:_},{4:17,5:p,7:47,8:R,9:u,11:o,13:m,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:h,22:E,23:I,24:k,25:23,33:25,41:A,42:C,43:V,44:v,45:x,46:L,54:D,72:O,74:w,77:M,89:g,90:_},{4:17,5:p,7:48,8:R,9:u,11:o,13:m,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:h,22:E,23:I,24:k,25:23,33:25,41:A,42:C,43:V,44:v,45:x,46:L,54:D,72:O,74:w,77:M,89:g,90:_},{4:17,5:p,7:49,8:R,9:u,11:o,13:m,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:h,22:E,23:I,24:k,25:23,33:25,41:A,42:C,43:V,44:v,45:x,46:L,54:D,72:O,74:w,77:M,89:g,90:_},{4:17,5:p,7:50,8:R,9:u,11:o,13:m,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:h,22:E,23:I,24:k,25:23,33:25,41:A,42:C,43:V,44:v,45:x,46:L,54:D,72:O,74:w,77:M,89:g,90:_},{26:51,89:[1,52],90:[1,53]},{55:54,89:[1,55],90:[1,56]},{29:[1,59],61:[1,57],63:[1,58]},e(y,[2,17]),e(y,[2,18]),e(y,[2,19]),e(y,[2,20]),{30:60,33:62,75:$,89:g,90:_},{30:63,33:62,75:$,89:g,90:_},{30:64,33:62,75:$,89:g,90:_},e(X,[2,29]),e(X,[2,30]),e(X,[2,31]),e(X,[2,32]),e(X,[2,33]),e(X,[2,34]),e(Ce,[2,81]),e(Ce,[2,82]),{1:[2,3]},{8:[2,8]},{8:[2,9]},{8:[2,10]},{8:[2,11]},{8:[2,12]},{8:[2,13]},{8:[2,14]},{8:[2,15]},{8:[2,16]},{27:[1,65],29:[1,66]},e(de,[2,79]),e(de,[2,80]),{27:[1,67],29:[1,68]},e(de,[2,85]),e(de,[2,86]),{62:69,65:Ve,66:ve,67:xe,68:Le,69:De,70:Oe,71:we},{62:77,65:Ve,66:ve,67:xe,68:Le,69:De,70:Oe,71:we},{30:78,33:62,75:$,89:g,90:_},{73:79,75:ee,76:U,78:81,79:82,80:te,81:se,82:ie,83:re,84:ne,85:ae,86:le,87:ce,88:oe},e(pe,[2,60]),e(pe,[2,62]),{73:93,75:ee,76:U,78:81,79:82,80:te,81:se,82:ie,83:re,84:ne,85:ae,86:le,87:ce,88:oe},{30:94,33:62,75:$,76:U,89:g,90:_},{5:[1,95]},{30:96,33:62,75:$,89:g,90:_},{5:[1,97]},{30:98,33:62,75:$,89:g,90:_},{63:[1,99]},e(Y,[2,50]),e(Y,[2,51]),e(Y,[2,52]),e(Y,[2,53]),e(Y,[2,54]),e(Y,[2,55]),e(Y,[2,56]),{64:[1,100]},e(y,[2,59],{76:U}),e(y,[2,64],{76:Me}),{33:103,75:[1,102],89:g,90:_},e(Fe,[2,65],{79:104,75:ee,80:te,81:se,82:ie,83:re,84:ne,85:ae,86:le,87:ce,88:oe}),e(N,[2,67]),e(N,[2,69]),e(N,[2,70]),e(N,[2,71]),e(N,[2,72]),e(N,[2,73]),e(N,[2,74]),e(N,[2,75]),e(N,[2,76]),e(N,[2,77]),e(N,[2,78]),e(y,[2,57],{76:Me}),e(y,[2,58],{76:U}),{5:B,28:105,31:Q,34:H,36:K,38:W,40:j},{27:[1,112],76:U},{5:he,40:ue,56:113,57:fe,59:me},{27:[1,118],76:U},{33:119,89:g,90:_},{33:120,89:g,90:_},{75:ee,78:121,79:82,80:te,81:se,82:ie,83:re,84:ne,85:ae,86:le,87:ce,88:oe},e(pe,[2,61]),e(pe,[2,63]),e(N,[2,68]),e(y,[2,21]),{32:[1,122]},{32:[1,123]},{32:[1,124]},{32:[1,125]},{5:B,28:126,31:Q,34:H,36:K,38:W,40:j},e(y,[2,28]),{5:[1,127]},e(y,[2,42]),{32:[1,128]},{32:[1,129]},{5:he,40:ue,56:130,57:fe,59:me},e(y,[2,47]),{5:[1,131]},e(y,[2,48]),e(y,[2,49]),e(Fe,[2,66],{79:104,75:ee,80:te,81:se,82:ie,83:re,84:ne,85:ae,86:le,87:ce,88:oe}),{33:132,89:g,90:_},{35:133,89:[1,134],90:[1,135]},{37:136,47:[1,137],48:[1,138],49:[1,139]},{39:140,50:[1,141],51:[1,142],52:[1,143],53:[1,144]},e(y,[2,27]),{5:B,28:145,31:Q,34:H,36:K,38:W,40:j},{58:146,89:[1,147],90:[1,148]},{60:149,89:[1,150],90:[1,151]},e(y,[2,46]),{5:he,40:ue,56:152,57:fe,59:me},{5:[1,153]},{5:[1,154]},{5:[2,83]},{5:[2,84]},{5:[1,155]},{5:[2,35]},{5:[2,36]},{5:[2,37]},{5:[1,156]},{5:[2,38]},{5:[2,39]},{5:[2,40]},{5:[2,41]},e(y,[2,22]),{5:[1,157]},{5:[2,87]},{5:[2,88]},{5:[1,158]},{5:[2,89]},{5:[2,90]},e(y,[2,43]),{5:B,28:159,31:Q,34:H,36:K,38:W,40:j},{5:B,28:160,31:Q,34:H,36:K,38:W,40:j},{5:B,28:161,31:Q,34:H,36:K,38:W,40:j},{5:B,28:162,31:Q,34:H,36:K,38:W,40:j},{5:he,40:ue,56:163,57:fe,59:me},{5:he,40:ue,56:164,57:fe,59:me},e(y,[2,23]),e(y,[2,24]),e(y,[2,25]),e(y,[2,26]),e(y,[2,44]),e(y,[2,45])],defaultActions:{8:[2,2],12:[2,1],41:[2,3],42:[2,8],43:[2,9],44:[2,10],45:[2,11],46:[2,12],47:[2,13],48:[2,14],49:[2,15],50:[2,16],134:[2,83],135:[2,84],137:[2,35],138:[2,36],139:[2,37],141:[2,38],142:[2,39],143:[2,40],144:[2,41],147:[2,87],148:[2,88],150:[2,89],151:[2,90]},parseError:f(function(i,r){if(r.recoverable)this.trace(i);else{var l=new Error(i);throw l.hash=r,l}},"parseError"),parse:f(function(i){var r=this,l=[0],s=[],d=[null],t=[],Ee=this.table,n="",ye=0,Pe=0,He=2,$e=1,Ke=t.slice.call(arguments,1),S=Object.create(this.lexer),G={yy:{}};for(var Ie in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Ie)&&(G.yy[Ie]=this.yy[Ie]);S.setInput(i,G.yy),G.yy.lexer=S,G.yy.parser=this,typeof S.yylloc>"u"&&(S.yylloc={});var be=S.yylloc;t.push(be);var We=S.options&&S.options.ranges;typeof G.yy.parseError=="function"?this.parseError=G.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function je(T){l.length=l.length-2*T,d.length=d.length-T,t.length=t.length-T}f(je,"popStack");function Ue(){var T;return T=s.pop()||S.lex()||$e,typeof T!="number"&&(T instanceof Array&&(s=T,T=s.pop()),T=r.symbols_[T]||T),T}f(Ue,"lex");for(var b,z,q,Te,J={},ge,F,Ye,_e;;){if(z=l[l.length-1],this.defaultActions[z]?q=this.defaultActions[z]:((b===null||typeof b>"u")&&(b=Ue()),q=Ee[z]&&Ee[z][b]),typeof q>"u"||!q.length||!q[0]){var ke="";_e=[];for(ge in Ee[z])this.terminals_[ge]&&ge>He&&_e.push("'"+this.terminals_[ge]+"'");S.showPosition?ke="Parse error on line "+(ye+1)+`:
2
+ `+S.showPosition()+`
3
+ Expecting `+_e.join(", ")+", got '"+(this.terminals_[b]||b)+"'":ke="Parse error on line "+(ye+1)+": Unexpected "+(b==$e?"end of input":"'"+(this.terminals_[b]||b)+"'"),this.parseError(ke,{text:S.match,token:this.terminals_[b]||b,line:S.yylineno,loc:be,expected:_e})}if(q[0]instanceof Array&&q.length>1)throw new Error("Parse Error: multiple actions possible at state: "+z+", token: "+b);switch(q[0]){case 1:l.push(b),d.push(S.yytext),t.push(S.yylloc),l.push(q[1]),b=null,Pe=S.yyleng,n=S.yytext,ye=S.yylineno,be=S.yylloc;break;case 2:if(F=this.productions_[q[1]][1],J.$=d[d.length-F],J._$={first_line:t[t.length-(F||1)].first_line,last_line:t[t.length-1].last_line,first_column:t[t.length-(F||1)].first_column,last_column:t[t.length-1].last_column},We&&(J._$.range=[t[t.length-(F||1)].range[0],t[t.length-1].range[1]]),Te=this.performAction.apply(J,[n,Pe,ye,G.yy,q[1],d,t].concat(Ke)),typeof Te<"u")return Te;F&&(l=l.slice(0,-1*F*2),d=d.slice(0,-1*F),t=t.slice(0,-1*F)),l.push(this.productions_[q[1]][0]),d.push(J.$),t.push(J._$),Ye=Ee[l[l.length-2]][l[l.length-1]],l.push(Ye);break;case 3:return!0}}return!0},"parse")},Qe=function(){var P={EOF:1,parseError:f(function(r,l){if(this.yy.parser)this.yy.parser.parseError(r,l);else throw new Error(r)},"parseError"),setInput:f(function(i,r){return this.yy=r||this.yy||{},this._input=i,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:f(function(){var i=this._input[0];this.yytext+=i,this.yyleng++,this.offset++,this.match+=i,this.matched+=i;var r=i.match(/(?:\r\n?|\n).*/g);return r?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),i},"input"),unput:f(function(i){var r=i.length,l=i.split(/(?:\r\n?|\n)/g);this._input=i+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-r),this.offset-=r;var s=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),l.length-1&&(this.yylineno-=l.length-1);var d=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:l?(l.length===s.length?this.yylloc.first_column:0)+s[s.length-l.length].length-l[0].length:this.yylloc.first_column-r},this.options.ranges&&(this.yylloc.range=[d[0],d[0]+this.yyleng-r]),this.yyleng=this.yytext.length,this},"unput"),more:f(function(){return this._more=!0,this},"more"),reject:f(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
4
+ `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:f(function(i){this.unput(this.match.slice(i))},"less"),pastInput:f(function(){var i=this.matched.substr(0,this.matched.length-this.match.length);return(i.length>20?"...":"")+i.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:f(function(){var i=this.match;return i.length<20&&(i+=this._input.substr(0,20-i.length)),(i.substr(0,20)+(i.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:f(function(){var i=this.pastInput(),r=new Array(i.length+1).join("-");return i+this.upcomingInput()+`
5
+ `+r+"^"},"showPosition"),test_match:f(function(i,r){var l,s,d;if(this.options.backtrack_lexer&&(d={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&&(d.yylloc.range=this.yylloc.range.slice(0))),s=i[0].match(/(?:\r\n?|\n).*/g),s&&(this.yylineno+=s.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:s?s[s.length-1].length-s[s.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+i[0].length},this.yytext+=i[0],this.match+=i[0],this.matches=i,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(i[0].length),this.matched+=i[0],l=this.performAction.call(this,this.yy,this,r,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),l)return l;if(this._backtrack){for(var t in d)this[t]=d[t];return!1}return!1},"test_match"),next:f(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var i,r,l,s;this._more||(this.yytext="",this.match="");for(var d=this._currentRules(),t=0;t<d.length;t++)if(l=this._input.match(this.rules[d[t]]),l&&(!r||l[0].length>r[0].length)){if(r=l,s=t,this.options.backtrack_lexer){if(i=this.test_match(l,d[t]),i!==!1)return i;if(this._backtrack){r=!1;continue}else return!1}else if(!this.options.flex)break}return r?(i=this.test_match(r,d[s]),i!==!1?i:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
6
+ `+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:f(function(){var r=this.next();return r||this.lex()},"lex"),begin:f(function(r){this.conditionStack.push(r)},"begin"),popState:f(function(){var r=this.conditionStack.length-1;return r>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:f(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:f(function(r){return r=this.conditionStack.length-1-Math.abs(r||0),r>=0?this.conditionStack[r]:"INITIAL"},"topState"),pushState:f(function(r){this.begin(r)},"pushState"),stateStackSize:f(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:f(function(r,l,s,d){switch(s){case 0:return"title";case 1:return this.begin("acc_title"),9;case 2:return this.popState(),"acc_title_value";case 3:return this.begin("acc_descr"),11;case 4:return this.popState(),"acc_descr_value";case 5:this.begin("acc_descr_multiline");break;case 6:this.popState();break;case 7:return"acc_descr_multiline_value";case 8:return 21;case 9:return 22;case 10:return 23;case 11:return 24;case 12:return 5;case 13:break;case 14:break;case 15:break;case 16:return 8;case 17:return 6;case 18:return 27;case 19:return 40;case 20:return 29;case 21:return 32;case 22:return 31;case 23:return 34;case 24:return 36;case 25:return 38;case 26:return 41;case 27:return 42;case 28:return 43;case 29:return 44;case 30:return 45;case 31:return 46;case 32:return 47;case 33:return 48;case 34:return 49;case 35:return 50;case 36:return 51;case 37:return 52;case 38:return 53;case 39:return 54;case 40:return 65;case 41:return 66;case 42:return 67;case 43:return 68;case 44:return 69;case 45:return 70;case 46:return 71;case 47:return 57;case 48:return 59;case 49:return this.begin("style"),77;case 50:return 75;case 51:return 81;case 52:return 88;case 53:return"PERCENT";case 54:return 86;case 55:return 84;case 56:break;case 57:this.begin("string");break;case 58:this.popState();break;case 59:return this.begin("style"),72;case 60:return this.begin("style"),74;case 61:return 61;case 62:return 64;case 63:return 63;case 64:this.begin("string");break;case 65:this.popState();break;case 66:return"qString";case 67:return l.yytext=l.yytext.trim(),89;case 68:return 75;case 69:return 80;case 70:return 76}},"anonymous"),rules:[/^(?:title\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:(\r?\n)+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:%[^\n]*)/i,/^(?:$)/i,/^(?:requirementDiagram\b)/i,/^(?:\{)/i,/^(?:\})/i,/^(?::{3})/i,/^(?::)/i,/^(?:id\b)/i,/^(?:text\b)/i,/^(?:risk\b)/i,/^(?:verifyMethod\b)/i,/^(?:requirement\b)/i,/^(?:functionalRequirement\b)/i,/^(?:interfaceRequirement\b)/i,/^(?:performanceRequirement\b)/i,/^(?:physicalRequirement\b)/i,/^(?:designConstraint\b)/i,/^(?:low\b)/i,/^(?:medium\b)/i,/^(?:high\b)/i,/^(?:analysis\b)/i,/^(?:demonstration\b)/i,/^(?:inspection\b)/i,/^(?:test\b)/i,/^(?:element\b)/i,/^(?:contains\b)/i,/^(?:copies\b)/i,/^(?:derives\b)/i,/^(?:satisfies\b)/i,/^(?:verifies\b)/i,/^(?:refines\b)/i,/^(?:traces\b)/i,/^(?:type\b)/i,/^(?:docref\b)/i,/^(?:style\b)/i,/^(?:\w+)/i,/^(?::)/i,/^(?:;)/i,/^(?:%)/i,/^(?:-)/i,/^(?:#)/i,/^(?: )/i,/^(?:["])/i,/^(?:\n)/i,/^(?:classDef\b)/i,/^(?:class\b)/i,/^(?:<-)/i,/^(?:->)/i,/^(?:-)/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[\w][^:,\r\n\{\<\>\-\=]*)/i,/^(?:\w+)/i,/^(?:[0-9]+)/i,/^(?:,)/i],conditions:{acc_descr_multiline:{rules:[6,7,68,69,70],inclusive:!1},acc_descr:{rules:[4,68,69,70],inclusive:!1},acc_title:{rules:[2,68,69,70],inclusive:!1},style:{rules:[50,51,52,53,54,55,56,57,58,68,69,70],inclusive:!1},unqString:{rules:[68,69,70],inclusive:!1},token:{rules:[68,69,70],inclusive:!1},string:{rules:[65,66,68,69,70],inclusive:!1},INITIAL:{rules:[0,1,3,5,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,59,60,61,62,63,64,67,68,69,70],inclusive:!0}}};return P}();Se.lexer=Qe;function Re(){this.yy={}}return f(Re,"Parser"),Re.prototype=Se,Se.Parser=Re,new Re}();Ae.parser=Ae;var ct=Ae,Z,ot=(Z=class{constructor(){this.relations=[],this.latestRequirement=this.getInitialRequirement(),this.requirements=new Map,this.latestElement=this.getInitialElement(),this.elements=new Map,this.classes=new Map,this.direction="TB",this.RequirementType={REQUIREMENT:"Requirement",FUNCTIONAL_REQUIREMENT:"Functional Requirement",INTERFACE_REQUIREMENT:"Interface Requirement",PERFORMANCE_REQUIREMENT:"Performance Requirement",PHYSICAL_REQUIREMENT:"Physical Requirement",DESIGN_CONSTRAINT:"Design Constraint"},this.RiskLevel={LOW_RISK:"Low",MED_RISK:"Medium",HIGH_RISK:"High"},this.VerifyType={VERIFY_ANALYSIS:"Analysis",VERIFY_DEMONSTRATION:"Demonstration",VERIFY_INSPECTION:"Inspection",VERIFY_TEST:"Test"},this.Relationships={CONTAINS:"contains",COPIES:"copies",DERIVES:"derives",SATISFIES:"satisfies",VERIFIES:"verifies",REFINES:"refines",TRACES:"traces"},this.setAccTitle=Xe,this.getAccTitle=Je,this.setAccDescription=Ze,this.getAccDescription=et,this.setDiagramTitle=tt,this.getDiagramTitle=st,this.getConfig=f(()=>Ne().requirement,"getConfig"),this.clear(),this.setDirection=this.setDirection.bind(this),this.addRequirement=this.addRequirement.bind(this),this.setNewReqId=this.setNewReqId.bind(this),this.setNewReqRisk=this.setNewReqRisk.bind(this),this.setNewReqText=this.setNewReqText.bind(this),this.setNewReqVerifyMethod=this.setNewReqVerifyMethod.bind(this),this.addElement=this.addElement.bind(this),this.setNewElementType=this.setNewElementType.bind(this),this.setNewElementDocRef=this.setNewElementDocRef.bind(this),this.addRelationship=this.addRelationship.bind(this),this.setCssStyle=this.setCssStyle.bind(this),this.setClass=this.setClass.bind(this),this.defineClass=this.defineClass.bind(this),this.setAccTitle=this.setAccTitle.bind(this),this.setAccDescription=this.setAccDescription.bind(this)}getDirection(){return this.direction}setDirection(a){this.direction=a}resetLatestRequirement(){this.latestRequirement=this.getInitialRequirement()}resetLatestElement(){this.latestElement=this.getInitialElement()}getInitialRequirement(){return{requirementId:"",text:"",risk:"",verifyMethod:"",name:"",type:"",cssStyles:[],classes:["default"]}}getInitialElement(){return{name:"",type:"",docRef:"",cssStyles:[],classes:["default"]}}addRequirement(a,u){return this.requirements.has(a)||this.requirements.set(a,{name:a,type:u,requirementId:this.latestRequirement.requirementId,text:this.latestRequirement.text,risk:this.latestRequirement.risk,verifyMethod:this.latestRequirement.verifyMethod,cssStyles:[],classes:["default"]}),this.resetLatestRequirement(),this.requirements.get(a)}getRequirements(){return this.requirements}setNewReqId(a){this.latestRequirement!==void 0&&(this.latestRequirement.requirementId=a)}setNewReqText(a){this.latestRequirement!==void 0&&(this.latestRequirement.text=a)}setNewReqRisk(a){this.latestRequirement!==void 0&&(this.latestRequirement.risk=a)}setNewReqVerifyMethod(a){this.latestRequirement!==void 0&&(this.latestRequirement.verifyMethod=a)}addElement(a){return this.elements.has(a)||(this.elements.set(a,{name:a,type:this.latestElement.type,docRef:this.latestElement.docRef,cssStyles:[],classes:["default"]}),qe.info("Added new element: ",a)),this.resetLatestElement(),this.elements.get(a)}getElements(){return this.elements}setNewElementType(a){this.latestElement!==void 0&&(this.latestElement.type=a)}setNewElementDocRef(a){this.latestElement!==void 0&&(this.latestElement.docRef=a)}addRelationship(a,u,o){this.relations.push({type:a,src:u,dst:o})}getRelationships(){return this.relations}clear(){this.relations=[],this.resetLatestRequirement(),this.requirements=new Map,this.resetLatestElement(),this.elements=new Map,this.classes=new Map,it()}setCssStyle(a,u){for(const o of a){const m=this.requirements.get(o)??this.elements.get(o);if(!u||!m)return;for(const c of u)c.includes(",")?m.cssStyles.push(...c.split(",")):m.cssStyles.push(c)}}setClass(a,u){var o;for(const m of a){const c=this.requirements.get(m)??this.elements.get(m);if(c)for(const p of u){c.classes.push(p);const R=(o=this.classes.get(p))==null?void 0:o.styles;R&&c.cssStyles.push(...R)}}}defineClass(a,u){for(const o of a){let m=this.classes.get(o);m===void 0&&(m={id:o,styles:[],textStyles:[]},this.classes.set(o,m)),u&&u.forEach(function(c){if(/color/.exec(c)){const p=c.replace("fill","bgFill");m.textStyles.push(p)}m.styles.push(c)}),this.requirements.forEach(c=>{c.classes.includes(o)&&c.cssStyles.push(...u.flatMap(p=>p.split(",")))}),this.elements.forEach(c=>{c.classes.includes(o)&&c.cssStyles.push(...u.flatMap(p=>p.split(",")))})}}getClasses(){return this.classes}getData(){var m,c,p,R;const a=Ne(),u=[],o=[];for(const h of this.requirements.values()){const E=h;E.id=h.name,E.cssStyles=h.cssStyles,E.cssClasses=h.classes.join(" "),E.shape="requirementBox",E.look=a.look,u.push(E)}for(const h of this.elements.values()){const E=h;E.shape="requirementBox",E.look=a.look,E.id=h.name,E.cssStyles=h.cssStyles,E.cssClasses=h.classes.join(" "),u.push(E)}for(const h of this.relations){let E=0;const I=h.type===this.Relationships.CONTAINS,k={id:`${h.src}-${h.dst}-${E}`,start:((m=this.requirements.get(h.src))==null?void 0:m.name)??((c=this.elements.get(h.src))==null?void 0:c.name),end:((p=this.requirements.get(h.dst))==null?void 0:p.name)??((R=this.elements.get(h.dst))==null?void 0:R.name),label:`&lt;&lt;${h.type}&gt;&gt;`,classes:"relationshipLine",style:["fill:none",I?"":"stroke-dasharray: 10,7"],labelpos:"c",thickness:"normal",type:"normal",pattern:I?"normal":"dashed",arrowTypeStart:I?"requirement_contains":"",arrowTypeEnd:I?"":"requirement_arrow",look:a.look};o.push(k),E++}return{nodes:u,edges:o,other:{},config:a,direction:this.getDirection()}}},f(Z,"RequirementDB"),Z),ht=f(e=>`
7
+
8
+ marker {
9
+ fill: ${e.relationColor};
10
+ stroke: ${e.relationColor};
11
+ }
12
+
13
+ marker.cross {
14
+ stroke: ${e.lineColor};
15
+ }
16
+
17
+ svg {
18
+ font-family: ${e.fontFamily};
19
+ font-size: ${e.fontSize};
20
+ }
21
+
22
+ .reqBox {
23
+ fill: ${e.requirementBackground};
24
+ fill-opacity: 1.0;
25
+ stroke: ${e.requirementBorderColor};
26
+ stroke-width: ${e.requirementBorderSize};
27
+ }
28
+
29
+ .reqTitle, .reqLabel{
30
+ fill: ${e.requirementTextColor};
31
+ }
32
+ .reqLabelBox {
33
+ fill: ${e.relationLabelBackground};
34
+ fill-opacity: 1.0;
35
+ }
36
+
37
+ .req-title-line {
38
+ stroke: ${e.requirementBorderColor};
39
+ stroke-width: ${e.requirementBorderSize};
40
+ }
41
+ .relationshipLine {
42
+ stroke: ${e.relationColor};
43
+ stroke-width: 1;
44
+ }
45
+ .relationshipLabel {
46
+ fill: ${e.relationLabelColor};
47
+ }
48
+ .divider {
49
+ stroke: ${e.nodeBorder};
50
+ stroke-width: 1;
51
+ }
52
+ .label {
53
+ font-family: ${e.fontFamily};
54
+ color: ${e.nodeTextColor||e.textColor};
55
+ }
56
+ .label text,span {
57
+ fill: ${e.nodeTextColor||e.textColor};
58
+ color: ${e.nodeTextColor||e.textColor};
59
+ }
60
+ .labelBkg {
61
+ background-color: ${e.edgeLabelBackground};
62
+ }
63
+
64
+ `,"getStyles"),ut=ht,Be={};rt(Be,{draw:()=>ft});var ft=f(async function(e,a,u,o){qe.info("REF0:"),qe.info("Drawing requirement diagram (unified)",a);const{securityLevel:m,state:c,layout:p}=Ne(),R=o.db.getData(),h=Ge(a,m);R.type=o.type,R.layoutAlgorithm=nt(p),R.nodeSpacing=(c==null?void 0:c.nodeSpacing)??50,R.rankSpacing=(c==null?void 0:c.rankSpacing)??50,R.markers=["requirement_contains","requirement_arrow"],R.diagramId=a,await at(R,h);const E=8;lt.insertTitle(h,"requirementDiagramTitleText",(c==null?void 0:c.titleTopMargin)??25,o.db.getDiagramTitle()),ze(h,E,"requirementDiagram",(c==null?void 0:c.useMaxWidth)??!0)},"draw"),dt={parser:ct,get db(){return new ot},renderer:Be,styles:ut};export{dt as diagram};
@@ -0,0 +1,10 @@
1
+ import{_ as p,p as _t,q as xt,s as vt,g as bt,b as wt,a as St,c as lt,z as Lt,d as H,U as Et,y as At,k as Tt}from"./main.js";import{o as Mt}from"./ordinal-Cboi1Yqb.js";import"./init-Gi6I4Gst.js";function Nt(t){for(var e=t.length/6|0,i=new Array(e),a=0;a<e;)i[a]="#"+t.slice(a*6,++a*6);return i}const It=Nt("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab");function ct(t,e){let i;if(e===void 0)for(const a of t)a!=null&&(i<a||i===void 0&&a>=a)&&(i=a);else{let a=-1;for(let h of t)(h=e(h,++a,t))!=null&&(i<h||i===void 0&&h>=h)&&(i=h)}return i}function pt(t,e){let i;if(e===void 0)for(const a of t)a!=null&&(i>a||i===void 0&&a>=a)&&(i=a);else{let a=-1;for(let h of t)(h=e(h,++a,t))!=null&&(i>h||i===void 0&&h>=h)&&(i=h)}return i}function nt(t,e){let i=0;if(e===void 0)for(let a of t)(a=+a)&&(i+=a);else{let a=-1;for(let h of t)(h=+e(h,++a,t))&&(i+=h)}return i}function Pt(t){return t.target.depth}function Ct(t){return t.depth}function Ot(t,e){return e-1-t.height}function mt(t,e){return t.sourceLinks.length?t.depth:e-1}function zt(t){return t.targetLinks.length?t.depth:t.sourceLinks.length?pt(t.sourceLinks,Pt)-1:0}function X(t){return function(){return t}}function ut(t,e){return Q(t.source,e.source)||t.index-e.index}function ht(t,e){return Q(t.target,e.target)||t.index-e.index}function Q(t,e){return t.y0-e.y0}function it(t){return t.value}function Dt(t){return t.index}function $t(t){return t.nodes}function jt(t){return t.links}function ft(t,e){const i=t.get(e);if(!i)throw new Error("missing: "+e);return i}function yt({nodes:t}){for(const e of t){let i=e.y0,a=i;for(const h of e.sourceLinks)h.y0=i+h.width/2,i+=h.width;for(const h of e.targetLinks)h.y1=a+h.width/2,a+=h.width}}function Bt(){let t=0,e=0,i=1,a=1,h=24,d=8,m,_=Dt,s=mt,o,l,x=$t,v=jt,y=6;function b(){const n={nodes:x.apply(null,arguments),links:v.apply(null,arguments)};return M(n),T(n),N(n),C(n),S(n),yt(n),n}b.update=function(n){return yt(n),n},b.nodeId=function(n){return arguments.length?(_=typeof n=="function"?n:X(n),b):_},b.nodeAlign=function(n){return arguments.length?(s=typeof n=="function"?n:X(n),b):s},b.nodeSort=function(n){return arguments.length?(o=n,b):o},b.nodeWidth=function(n){return arguments.length?(h=+n,b):h},b.nodePadding=function(n){return arguments.length?(d=m=+n,b):d},b.nodes=function(n){return arguments.length?(x=typeof n=="function"?n:X(n),b):x},b.links=function(n){return arguments.length?(v=typeof n=="function"?n:X(n),b):v},b.linkSort=function(n){return arguments.length?(l=n,b):l},b.size=function(n){return arguments.length?(t=e=0,i=+n[0],a=+n[1],b):[i-t,a-e]},b.extent=function(n){return arguments.length?(t=+n[0][0],i=+n[1][0],e=+n[0][1],a=+n[1][1],b):[[t,e],[i,a]]},b.iterations=function(n){return arguments.length?(y=+n,b):y};function M({nodes:n,links:f}){for(const[c,r]of n.entries())r.index=c,r.sourceLinks=[],r.targetLinks=[];const u=new Map(n.map((c,r)=>[_(c,r,n),c]));for(const[c,r]of f.entries()){r.index=c;let{source:k,target:w}=r;typeof k!="object"&&(k=r.source=ft(u,k)),typeof w!="object"&&(w=r.target=ft(u,w)),k.sourceLinks.push(r),w.targetLinks.push(r)}if(l!=null)for(const{sourceLinks:c,targetLinks:r}of n)c.sort(l),r.sort(l)}function T({nodes:n}){for(const f of n)f.value=f.fixedValue===void 0?Math.max(nt(f.sourceLinks,it),nt(f.targetLinks,it)):f.fixedValue}function N({nodes:n}){const f=n.length;let u=new Set(n),c=new Set,r=0;for(;u.size;){for(const k of u){k.depth=r;for(const{target:w}of k.sourceLinks)c.add(w)}if(++r>f)throw new Error("circular link");u=c,c=new Set}}function C({nodes:n}){const f=n.length;let u=new Set(n),c=new Set,r=0;for(;u.size;){for(const k of u){k.height=r;for(const{source:w}of k.targetLinks)c.add(w)}if(++r>f)throw new Error("circular link");u=c,c=new Set}}function D({nodes:n}){const f=ct(n,r=>r.depth)+1,u=(i-t-h)/(f-1),c=new Array(f);for(const r of n){const k=Math.max(0,Math.min(f-1,Math.floor(s.call(null,r,f))));r.layer=k,r.x0=t+k*u,r.x1=r.x0+h,c[k]?c[k].push(r):c[k]=[r]}if(o)for(const r of c)r.sort(o);return c}function R(n){const f=pt(n,u=>(a-e-(u.length-1)*m)/nt(u,it));for(const u of n){let c=e;for(const r of u){r.y0=c,r.y1=c+r.value*f,c=r.y1+m;for(const k of r.sourceLinks)k.width=k.value*f}c=(a-c+m)/(u.length+1);for(let r=0;r<u.length;++r){const k=u[r];k.y0+=c*(r+1),k.y1+=c*(r+1)}A(u)}}function S(n){const f=D(n);m=Math.min(d,(a-e)/(ct(f,u=>u.length)-1)),R(f);for(let u=0;u<y;++u){const c=Math.pow(.99,u),r=Math.max(1-c,(u+1)/y);B(f,c,r),P(f,c,r)}}function P(n,f,u){for(let c=1,r=n.length;c<r;++c){const k=n[c];for(const w of k){let L=0,F=0;for(const{source:Y,value:et}of w.targetLinks){let q=et*(w.layer-Y.layer);L+=$(Y,w)*q,F+=q}if(!(F>0))continue;let G=(L/F-w.y0)*f;w.y0+=G,w.y1+=G,E(w)}o===void 0&&k.sort(Q),O(k,u)}}function B(n,f,u){for(let c=n.length,r=c-2;r>=0;--r){const k=n[r];for(const w of k){let L=0,F=0;for(const{target:Y,value:et}of w.sourceLinks){let q=et*(Y.layer-w.layer);L+=I(w,Y)*q,F+=q}if(!(F>0))continue;let G=(L/F-w.y0)*f;w.y0+=G,w.y1+=G,E(w)}o===void 0&&k.sort(Q),O(k,u)}}function O(n,f){const u=n.length>>1,c=n[u];g(n,c.y0-m,u-1,f),z(n,c.y1+m,u+1,f),g(n,a,n.length-1,f),z(n,e,0,f)}function z(n,f,u,c){for(;u<n.length;++u){const r=n[u],k=(f-r.y0)*c;k>1e-6&&(r.y0+=k,r.y1+=k),f=r.y1+m}}function g(n,f,u,c){for(;u>=0;--u){const r=n[u],k=(r.y1-f)*c;k>1e-6&&(r.y0-=k,r.y1-=k),f=r.y0-m}}function E({sourceLinks:n,targetLinks:f}){if(l===void 0){for(const{source:{sourceLinks:u}}of f)u.sort(ht);for(const{target:{targetLinks:u}}of n)u.sort(ut)}}function A(n){if(l===void 0)for(const{sourceLinks:f,targetLinks:u}of n)f.sort(ht),u.sort(ut)}function $(n,f){let u=n.y0-(n.sourceLinks.length-1)*m/2;for(const{target:c,width:r}of n.sourceLinks){if(c===f)break;u+=r+m}for(const{source:c,width:r}of f.targetLinks){if(c===n)break;u-=r}return u}function I(n,f){let u=f.y0-(f.targetLinks.length-1)*m/2;for(const{source:c,width:r}of f.targetLinks){if(c===n)break;u+=r+m}for(const{target:c,width:r}of n.sourceLinks){if(c===f)break;u-=r}return u}return b}var st=Math.PI,rt=2*st,V=1e-6,Rt=rt-V;function ot(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function kt(){return new ot}ot.prototype=kt.prototype={constructor:ot,moveTo:function(t,e){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)},closePath:function(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(t,e){this._+="L"+(this._x1=+t)+","+(this._y1=+e)},quadraticCurveTo:function(t,e,i,a){this._+="Q"+ +t+","+ +e+","+(this._x1=+i)+","+(this._y1=+a)},bezierCurveTo:function(t,e,i,a,h,d){this._+="C"+ +t+","+ +e+","+ +i+","+ +a+","+(this._x1=+h)+","+(this._y1=+d)},arcTo:function(t,e,i,a,h){t=+t,e=+e,i=+i,a=+a,h=+h;var d=this._x1,m=this._y1,_=i-t,s=a-e,o=d-t,l=m-e,x=o*o+l*l;if(h<0)throw new Error("negative radius: "+h);if(this._x1===null)this._+="M"+(this._x1=t)+","+(this._y1=e);else if(x>V)if(!(Math.abs(l*_-s*o)>V)||!h)this._+="L"+(this._x1=t)+","+(this._y1=e);else{var v=i-d,y=a-m,b=_*_+s*s,M=v*v+y*y,T=Math.sqrt(b),N=Math.sqrt(x),C=h*Math.tan((st-Math.acos((b+x-M)/(2*T*N)))/2),D=C/N,R=C/T;Math.abs(D-1)>V&&(this._+="L"+(t+D*o)+","+(e+D*l)),this._+="A"+h+","+h+",0,0,"+ +(l*v>o*y)+","+(this._x1=t+R*_)+","+(this._y1=e+R*s)}},arc:function(t,e,i,a,h,d){t=+t,e=+e,i=+i,d=!!d;var m=i*Math.cos(a),_=i*Math.sin(a),s=t+m,o=e+_,l=1^d,x=d?a-h:h-a;if(i<0)throw new Error("negative radius: "+i);this._x1===null?this._+="M"+s+","+o:(Math.abs(this._x1-s)>V||Math.abs(this._y1-o)>V)&&(this._+="L"+s+","+o),i&&(x<0&&(x=x%rt+rt),x>Rt?this._+="A"+i+","+i+",0,1,"+l+","+(t-m)+","+(e-_)+"A"+i+","+i+",0,1,"+l+","+(this._x1=s)+","+(this._y1=o):x>V&&(this._+="A"+i+","+i+",0,"+ +(x>=st)+","+l+","+(this._x1=t+i*Math.cos(h))+","+(this._y1=e+i*Math.sin(h))))},rect:function(t,e,i,a){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)+"h"+ +i+"v"+ +a+"h"+-i+"Z"},toString:function(){return this._}};function dt(t){return function(){return t}}function Ft(t){return t[0]}function Vt(t){return t[1]}var Wt=Array.prototype.slice;function Ut(t){return t.source}function Gt(t){return t.target}function Yt(t){var e=Ut,i=Gt,a=Ft,h=Vt,d=null;function m(){var _,s=Wt.call(arguments),o=e.apply(this,s),l=i.apply(this,s);if(d||(d=_=kt()),t(d,+a.apply(this,(s[0]=o,s)),+h.apply(this,s),+a.apply(this,(s[0]=l,s)),+h.apply(this,s)),_)return d=null,_+""||null}return m.source=function(_){return arguments.length?(e=_,m):e},m.target=function(_){return arguments.length?(i=_,m):i},m.x=function(_){return arguments.length?(a=typeof _=="function"?_:dt(+_),m):a},m.y=function(_){return arguments.length?(h=typeof _=="function"?_:dt(+_),m):h},m.context=function(_){return arguments.length?(d=_??null,m):d},m}function qt(t,e,i,a,h){t.moveTo(e,i),t.bezierCurveTo(e=(e+a)/2,i,e,h,a,h)}function Ht(){return Yt(qt)}function Xt(t){return[t.source.x1,t.y0]}function Qt(t){return[t.target.x0,t.y1]}function Kt(){return Ht().source(Xt).target(Qt)}var at=function(){var t=p(function(_,s,o,l){for(o=o||{},l=_.length;l--;o[_[l]]=s);return o},"o"),e=[1,9],i=[1,10],a=[1,5,10,12],h={trace:p(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SANKEY:4,NEWLINE:5,csv:6,opt_eof:7,record:8,csv_tail:9,EOF:10,"field[source]":11,COMMA:12,"field[target]":13,"field[value]":14,field:15,escaped:16,non_escaped:17,DQUOTE:18,ESCAPED_TEXT:19,NON_ESCAPED_TEXT:20,$accept:0,$end:1},terminals_:{2:"error",4:"SANKEY",5:"NEWLINE",10:"EOF",11:"field[source]",12:"COMMA",13:"field[target]",14:"field[value]",18:"DQUOTE",19:"ESCAPED_TEXT",20:"NON_ESCAPED_TEXT"},productions_:[0,[3,4],[6,2],[9,2],[9,0],[7,1],[7,0],[8,5],[15,1],[15,1],[16,3],[17,1]],performAction:p(function(s,o,l,x,v,y,b){var M=y.length-1;switch(v){case 7:const T=x.findOrCreateNode(y[M-4].trim().replaceAll('""','"')),N=x.findOrCreateNode(y[M-2].trim().replaceAll('""','"')),C=parseFloat(y[M].trim());x.addLink(T,N,C);break;case 8:case 9:case 11:this.$=y[M];break;case 10:this.$=y[M-1];break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},{5:[1,3]},{6:4,8:5,15:6,16:7,17:8,18:e,20:i},{1:[2,6],7:11,10:[1,12]},t(i,[2,4],{9:13,5:[1,14]}),{12:[1,15]},t(a,[2,8]),t(a,[2,9]),{19:[1,16]},t(a,[2,11]),{1:[2,1]},{1:[2,5]},t(i,[2,2]),{6:17,8:5,15:6,16:7,17:8,18:e,20:i},{15:18,16:7,17:8,18:e,20:i},{18:[1,19]},t(i,[2,3]),{12:[1,20]},t(a,[2,10]),{15:21,16:7,17:8,18:e,20:i},t([1,5,10],[2,7])],defaultActions:{11:[2,1],12:[2,5]},parseError:p(function(s,o){if(o.recoverable)this.trace(s);else{var l=new Error(s);throw l.hash=o,l}},"parseError"),parse:p(function(s){var o=this,l=[0],x=[],v=[null],y=[],b=this.table,M="",T=0,N=0,C=2,D=1,R=y.slice.call(arguments,1),S=Object.create(this.lexer),P={yy:{}};for(var B in this.yy)Object.prototype.hasOwnProperty.call(this.yy,B)&&(P.yy[B]=this.yy[B]);S.setInput(s,P.yy),P.yy.lexer=S,P.yy.parser=this,typeof S.yylloc>"u"&&(S.yylloc={});var O=S.yylloc;y.push(O);var z=S.options&&S.options.ranges;typeof P.yy.parseError=="function"?this.parseError=P.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function g(L){l.length=l.length-2*L,v.length=v.length-L,y.length=y.length-L}p(g,"popStack");function E(){var L;return L=x.pop()||S.lex()||D,typeof L!="number"&&(L instanceof Array&&(x=L,L=x.pop()),L=o.symbols_[L]||L),L}p(E,"lex");for(var A,$,I,n,f={},u,c,r,k;;){if($=l[l.length-1],this.defaultActions[$]?I=this.defaultActions[$]:((A===null||typeof A>"u")&&(A=E()),I=b[$]&&b[$][A]),typeof I>"u"||!I.length||!I[0]){var w="";k=[];for(u in b[$])this.terminals_[u]&&u>C&&k.push("'"+this.terminals_[u]+"'");S.showPosition?w="Parse error on line "+(T+1)+`:
2
+ `+S.showPosition()+`
3
+ Expecting `+k.join(", ")+", got '"+(this.terminals_[A]||A)+"'":w="Parse error on line "+(T+1)+": Unexpected "+(A==D?"end of input":"'"+(this.terminals_[A]||A)+"'"),this.parseError(w,{text:S.match,token:this.terminals_[A]||A,line:S.yylineno,loc:O,expected:k})}if(I[0]instanceof Array&&I.length>1)throw new Error("Parse Error: multiple actions possible at state: "+$+", token: "+A);switch(I[0]){case 1:l.push(A),v.push(S.yytext),y.push(S.yylloc),l.push(I[1]),A=null,N=S.yyleng,M=S.yytext,T=S.yylineno,O=S.yylloc;break;case 2:if(c=this.productions_[I[1]][1],f.$=v[v.length-c],f._$={first_line:y[y.length-(c||1)].first_line,last_line:y[y.length-1].last_line,first_column:y[y.length-(c||1)].first_column,last_column:y[y.length-1].last_column},z&&(f._$.range=[y[y.length-(c||1)].range[0],y[y.length-1].range[1]]),n=this.performAction.apply(f,[M,N,T,P.yy,I[1],v,y].concat(R)),typeof n<"u")return n;c&&(l=l.slice(0,-1*c*2),v=v.slice(0,-1*c),y=y.slice(0,-1*c)),l.push(this.productions_[I[1]][0]),v.push(f.$),y.push(f._$),r=b[l[l.length-2]][l[l.length-1]],l.push(r);break;case 3:return!0}}return!0},"parse")},d=function(){var _={EOF:1,parseError:p(function(o,l){if(this.yy.parser)this.yy.parser.parseError(o,l);else throw new Error(o)},"parseError"),setInput:p(function(s,o){return this.yy=o||this.yy||{},this._input=s,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:p(function(){var s=this._input[0];this.yytext+=s,this.yyleng++,this.offset++,this.match+=s,this.matched+=s;var o=s.match(/(?:\r\n?|\n).*/g);return o?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),s},"input"),unput:p(function(s){var o=s.length,l=s.split(/(?:\r\n?|\n)/g);this._input=s+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-o),this.offset-=o;var x=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),l.length-1&&(this.yylineno-=l.length-1);var v=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:l?(l.length===x.length?this.yylloc.first_column:0)+x[x.length-l.length].length-l[0].length:this.yylloc.first_column-o},this.options.ranges&&(this.yylloc.range=[v[0],v[0]+this.yyleng-o]),this.yyleng=this.yytext.length,this},"unput"),more:p(function(){return this._more=!0,this},"more"),reject:p(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
4
+ `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:p(function(s){this.unput(this.match.slice(s))},"less"),pastInput:p(function(){var s=this.matched.substr(0,this.matched.length-this.match.length);return(s.length>20?"...":"")+s.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:p(function(){var s=this.match;return s.length<20&&(s+=this._input.substr(0,20-s.length)),(s.substr(0,20)+(s.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:p(function(){var s=this.pastInput(),o=new Array(s.length+1).join("-");return s+this.upcomingInput()+`
5
+ `+o+"^"},"showPosition"),test_match:p(function(s,o){var l,x,v;if(this.options.backtrack_lexer&&(v={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&&(v.yylloc.range=this.yylloc.range.slice(0))),x=s[0].match(/(?:\r\n?|\n).*/g),x&&(this.yylineno+=x.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:x?x[x.length-1].length-x[x.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+s[0].length},this.yytext+=s[0],this.match+=s[0],this.matches=s,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(s[0].length),this.matched+=s[0],l=this.performAction.call(this,this.yy,this,o,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),l)return l;if(this._backtrack){for(var y in v)this[y]=v[y];return!1}return!1},"test_match"),next:p(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var s,o,l,x;this._more||(this.yytext="",this.match="");for(var v=this._currentRules(),y=0;y<v.length;y++)if(l=this._input.match(this.rules[v[y]]),l&&(!o||l[0].length>o[0].length)){if(o=l,x=y,this.options.backtrack_lexer){if(s=this.test_match(l,v[y]),s!==!1)return s;if(this._backtrack){o=!1;continue}else return!1}else if(!this.options.flex)break}return o?(s=this.test_match(o,v[x]),s!==!1?s:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
6
+ `+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:p(function(){var o=this.next();return o||this.lex()},"lex"),begin:p(function(o){this.conditionStack.push(o)},"begin"),popState:p(function(){var o=this.conditionStack.length-1;return o>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:p(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:p(function(o){return o=this.conditionStack.length-1-Math.abs(o||0),o>=0?this.conditionStack[o]:"INITIAL"},"topState"),pushState:p(function(o){this.begin(o)},"pushState"),stateStackSize:p(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:p(function(o,l,x,v){switch(x){case 0:return this.pushState("csv"),4;case 1:return 10;case 2:return 5;case 3:return 12;case 4:return this.pushState("escaped_text"),18;case 5:return 20;case 6:return this.popState("escaped_text"),18;case 7:return 19}},"anonymous"),rules:[/^(?:sankey-beta\b)/i,/^(?:$)/i,/^(?:((\u000D\u000A)|(\u000A)))/i,/^(?:(\u002C))/i,/^(?:(\u0022))/i,/^(?:([\u0020-\u0021\u0023-\u002B\u002D-\u007E])*)/i,/^(?:(\u0022)(?!(\u0022)))/i,/^(?:(([\u0020-\u0021\u0023-\u002B\u002D-\u007E])|(\u002C)|(\u000D)|(\u000A)|(\u0022)(\u0022))*)/i],conditions:{csv:{rules:[1,2,3,4,5,6,7],inclusive:!1},escaped_text:{rules:[6,7],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7],inclusive:!0}}};return _}();h.lexer=d;function m(){this.yy={}}return p(m,"Parser"),m.prototype=h,h.Parser=m,new m}();at.parser=at;var K=at,J=[],tt=[],Z=new Map,Zt=p(()=>{J=[],tt=[],Z=new Map,At()},"clear"),W,Jt=(W=class{constructor(e,i,a=0){this.source=e,this.target=i,this.value=a}},p(W,"SankeyLink"),W),te=p((t,e,i)=>{J.push(new Jt(t,e,i))},"addLink"),U,ee=(U=class{constructor(e){this.ID=e}},p(U,"SankeyNode"),U),ne=p(t=>{t=Tt.sanitizeText(t,lt());let e=Z.get(t);return e===void 0&&(e=new ee(t),Z.set(t,e),tt.push(e)),e},"findOrCreateNode"),ie=p(()=>tt,"getNodes"),se=p(()=>J,"getLinks"),re=p(()=>({nodes:tt.map(t=>({id:t.ID})),links:J.map(t=>({source:t.source.ID,target:t.target.ID,value:t.value}))}),"getGraph"),oe={nodesMap:Z,getConfig:p(()=>lt().sankey,"getConfig"),getNodes:ie,getLinks:se,getGraph:re,addLink:te,findOrCreateNode:ne,getAccTitle:St,setAccTitle:wt,getAccDescription:bt,setAccDescription:vt,getDiagramTitle:xt,setDiagramTitle:_t,clear:Zt},j,gt=(j=class{static next(e){return new j(e+ ++j.count)}constructor(e){this.id=e,this.href=`#${e}`}toString(){return"url("+this.href+")"}},p(j,"Uid"),j.count=0,j),ae={left:Ct,right:Ot,center:zt,justify:mt},le=p(function(t,e,i,a){const{securityLevel:h,sankey:d}=lt(),m=Lt.sankey;let _;h==="sandbox"&&(_=H("#i"+e));const s=h==="sandbox"?H(_.nodes()[0].contentDocument.body):H("body"),o=h==="sandbox"?s.select(`[id="${e}"]`):H(`[id="${e}"]`),l=(d==null?void 0:d.width)??m.width,x=(d==null?void 0:d.height)??m.width,v=(d==null?void 0:d.useMaxWidth)??m.useMaxWidth,y=(d==null?void 0:d.nodeAlignment)??m.nodeAlignment,b=(d==null?void 0:d.prefix)??m.prefix,M=(d==null?void 0:d.suffix)??m.suffix,T=(d==null?void 0:d.showValues)??m.showValues,N=a.db.getGraph(),C=ae[y];Bt().nodeId(g=>g.id).nodeWidth(10).nodePadding(10+(T?15:0)).nodeAlign(C).extent([[0,0],[l,x]])(N);const S=Mt(It);o.append("g").attr("class","nodes").selectAll(".node").data(N.nodes).join("g").attr("class","node").attr("id",g=>(g.uid=gt.next("node-")).id).attr("transform",function(g){return"translate("+g.x0+","+g.y0+")"}).attr("x",g=>g.x0).attr("y",g=>g.y0).append("rect").attr("height",g=>g.y1-g.y0).attr("width",g=>g.x1-g.x0).attr("fill",g=>S(g.id));const P=p(({id:g,value:E})=>T?`${g}
7
+ ${b}${Math.round(E*100)/100}${M}`:g,"getText");o.append("g").attr("class","node-labels").attr("font-size",14).selectAll("text").data(N.nodes).join("text").attr("x",g=>g.x0<l/2?g.x1+6:g.x0-6).attr("y",g=>(g.y1+g.y0)/2).attr("dy",`${T?"0":"0.35"}em`).attr("text-anchor",g=>g.x0<l/2?"start":"end").text(P);const B=o.append("g").attr("class","links").attr("fill","none").attr("stroke-opacity",.5).selectAll(".link").data(N.links).join("g").attr("class","link").style("mix-blend-mode","multiply"),O=(d==null?void 0:d.linkColor)??"gradient";if(O==="gradient"){const g=B.append("linearGradient").attr("id",E=>(E.uid=gt.next("linearGradient-")).id).attr("gradientUnits","userSpaceOnUse").attr("x1",E=>E.source.x1).attr("x2",E=>E.target.x0);g.append("stop").attr("offset","0%").attr("stop-color",E=>S(E.source.id)),g.append("stop").attr("offset","100%").attr("stop-color",E=>S(E.target.id))}let z;switch(O){case"gradient":z=p(g=>g.uid,"coloring");break;case"source":z=p(g=>S(g.source.id),"coloring");break;case"target":z=p(g=>S(g.target.id),"coloring");break;default:z=O}B.append("path").attr("d",Kt()).attr("stroke",z).attr("stroke-width",g=>Math.max(1,g.width)),Et(void 0,o,0,v)},"draw"),ce={draw:le},ue=p(t=>t.replaceAll(/^[^\S\n\r]+|[^\S\n\r]+$/g,"").replaceAll(/([\n\r])+/g,`
8
+ `).trim(),"prepareTextForParsing"),he=p(t=>`.label {
9
+ font-family: ${t.fontFamily};
10
+ }`,"getStyles"),fe=he,ye=K.parse.bind(K);K.parse=t=>ye(ue(t));var me={styles:fe,parser:K,db:oe,renderer:ce};export{me as diagram};
@@ -0,0 +1,122 @@
1
+ import{a as xe,b as Yt,g as At,d as Te,c as ye,e as Ee}from"./chunk-D6G4REZN-2ayrGi-2.js";import{I as be}from"./chunk-XZIHB7SX-G4BVkcV4.js";import{_ as u,n as me,c as $,d as Lt,l as G,j as Zt,e as we,f as ve,k as I,b as Gt,s as Ie,p as Le,a as _e,g as Pe,q as Ae,y as ke,i as _t,u as Y,L as ot,M as bt,N as Qt,Z as Ne,O as jt,E as Ct}from"./main.js";var Ot=function(){var e=u(function(ht,v,L,P){for(L=L||{},P=ht.length;P--;L[ht[P]]=v);return L},"o"),t=[1,2],c=[1,3],s=[1,4],a=[2,4],i=[1,9],n=[1,11],h=[1,13],d=[1,14],r=[1,16],f=[1,17],E=[1,18],g=[1,24],T=[1,25],m=[1,26],w=[1,27],A=[1,28],O=[1,29],S=[1,30],B=[1,31],D=[1,32],F=[1,33],q=[1,34],X=[1,35],tt=[1,36],z=[1,37],H=[1,38],W=[1,39],M=[1,41],J=[1,42],K=[1,43],Z=[1,44],et=[1,45],N=[1,46],y=[1,4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,47,48,49,50,52,53,54,59,60,61,62,70],_=[4,5,16,50,52,53],Q=[4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,50,52,53,54,59,60,61,62,70],at=[4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,49,50,52,53,54,59,60,61,62,70],k=[4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,48,50,52,53,54,59,60,61,62,70],qt=[4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,47,50,52,53,54,59,60,61,62,70],it=[68,69,70],ct=[1,122],Nt={trace:u(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SPACE:4,NEWLINE:5,SD:6,document:7,line:8,statement:9,box_section:10,box_line:11,participant_statement:12,create:13,box:14,restOfLine:15,end:16,signal:17,autonumber:18,NUM:19,off:20,activate:21,actor:22,deactivate:23,note_statement:24,links_statement:25,link_statement:26,properties_statement:27,details_statement:28,title:29,legacy_title:30,acc_title:31,acc_title_value:32,acc_descr:33,acc_descr_value:34,acc_descr_multiline_value:35,loop:36,rect:37,opt:38,alt:39,else_sections:40,par:41,par_sections:42,par_over:43,critical:44,option_sections:45,break:46,option:47,and:48,else:49,participant:50,AS:51,participant_actor:52,destroy:53,note:54,placement:55,text2:56,over:57,actor_pair:58,links:59,link:60,properties:61,details:62,spaceList:63,",":64,left_of:65,right_of:66,signaltype:67,"+":68,"-":69,ACTOR:70,SOLID_OPEN_ARROW:71,DOTTED_OPEN_ARROW:72,SOLID_ARROW:73,BIDIRECTIONAL_SOLID_ARROW:74,DOTTED_ARROW:75,BIDIRECTIONAL_DOTTED_ARROW:76,SOLID_CROSS:77,DOTTED_CROSS:78,SOLID_POINT:79,DOTTED_POINT:80,TXT:81,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NEWLINE",6:"SD",13:"create",14:"box",15:"restOfLine",16:"end",18:"autonumber",19:"NUM",20:"off",21:"activate",23:"deactivate",29:"title",30:"legacy_title",31:"acc_title",32:"acc_title_value",33:"acc_descr",34:"acc_descr_value",35:"acc_descr_multiline_value",36:"loop",37:"rect",38:"opt",39:"alt",41:"par",43:"par_over",44:"critical",46:"break",47:"option",48:"and",49:"else",50:"participant",51:"AS",52:"participant_actor",53:"destroy",54:"note",57:"over",59:"links",60:"link",61:"properties",62:"details",64:",",65:"left_of",66:"right_of",68:"+",69:"-",70:"ACTOR",71:"SOLID_OPEN_ARROW",72:"DOTTED_OPEN_ARROW",73:"SOLID_ARROW",74:"BIDIRECTIONAL_SOLID_ARROW",75:"DOTTED_ARROW",76:"BIDIRECTIONAL_DOTTED_ARROW",77:"SOLID_CROSS",78:"DOTTED_CROSS",79:"SOLID_POINT",80:"DOTTED_POINT",81:"TXT"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[10,0],[10,2],[11,2],[11,1],[11,1],[9,1],[9,2],[9,4],[9,2],[9,4],[9,3],[9,3],[9,2],[9,3],[9,3],[9,2],[9,2],[9,2],[9,2],[9,2],[9,1],[9,1],[9,2],[9,2],[9,1],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[45,1],[45,4],[42,1],[42,4],[40,1],[40,4],[12,5],[12,3],[12,5],[12,3],[12,3],[24,4],[24,4],[25,3],[26,3],[27,3],[28,3],[63,2],[63,1],[58,3],[58,1],[55,1],[55,1],[17,5],[17,5],[17,4],[22,1],[67,1],[67,1],[67,1],[67,1],[67,1],[67,1],[67,1],[67,1],[67,1],[67,1],[56,1]],performAction:u(function(v,L,P,b,R,l,Et){var p=l.length-1;switch(R){case 3:return b.apply(l[p]),l[p];case 4:case 9:this.$=[];break;case 5:case 10:l[p-1].push(l[p]),this.$=l[p-1];break;case 6:case 7:case 11:case 12:this.$=l[p];break;case 8:case 13:this.$=[];break;case 15:l[p].type="createParticipant",this.$=l[p];break;case 16:l[p-1].unshift({type:"boxStart",boxData:b.parseBoxData(l[p-2])}),l[p-1].push({type:"boxEnd",boxText:l[p-2]}),this.$=l[p-1];break;case 18:this.$={type:"sequenceIndex",sequenceIndex:Number(l[p-2]),sequenceIndexStep:Number(l[p-1]),sequenceVisible:!0,signalType:b.LINETYPE.AUTONUMBER};break;case 19:this.$={type:"sequenceIndex",sequenceIndex:Number(l[p-1]),sequenceIndexStep:1,sequenceVisible:!0,signalType:b.LINETYPE.AUTONUMBER};break;case 20:this.$={type:"sequenceIndex",sequenceVisible:!1,signalType:b.LINETYPE.AUTONUMBER};break;case 21:this.$={type:"sequenceIndex",sequenceVisible:!0,signalType:b.LINETYPE.AUTONUMBER};break;case 22:this.$={type:"activeStart",signalType:b.LINETYPE.ACTIVE_START,actor:l[p-1].actor};break;case 23:this.$={type:"activeEnd",signalType:b.LINETYPE.ACTIVE_END,actor:l[p-1].actor};break;case 29:b.setDiagramTitle(l[p].substring(6)),this.$=l[p].substring(6);break;case 30:b.setDiagramTitle(l[p].substring(7)),this.$=l[p].substring(7);break;case 31:this.$=l[p].trim(),b.setAccTitle(this.$);break;case 32:case 33:this.$=l[p].trim(),b.setAccDescription(this.$);break;case 34:l[p-1].unshift({type:"loopStart",loopText:b.parseMessage(l[p-2]),signalType:b.LINETYPE.LOOP_START}),l[p-1].push({type:"loopEnd",loopText:l[p-2],signalType:b.LINETYPE.LOOP_END}),this.$=l[p-1];break;case 35:l[p-1].unshift({type:"rectStart",color:b.parseMessage(l[p-2]),signalType:b.LINETYPE.RECT_START}),l[p-1].push({type:"rectEnd",color:b.parseMessage(l[p-2]),signalType:b.LINETYPE.RECT_END}),this.$=l[p-1];break;case 36:l[p-1].unshift({type:"optStart",optText:b.parseMessage(l[p-2]),signalType:b.LINETYPE.OPT_START}),l[p-1].push({type:"optEnd",optText:b.parseMessage(l[p-2]),signalType:b.LINETYPE.OPT_END}),this.$=l[p-1];break;case 37:l[p-1].unshift({type:"altStart",altText:b.parseMessage(l[p-2]),signalType:b.LINETYPE.ALT_START}),l[p-1].push({type:"altEnd",signalType:b.LINETYPE.ALT_END}),this.$=l[p-1];break;case 38:l[p-1].unshift({type:"parStart",parText:b.parseMessage(l[p-2]),signalType:b.LINETYPE.PAR_START}),l[p-1].push({type:"parEnd",signalType:b.LINETYPE.PAR_END}),this.$=l[p-1];break;case 39:l[p-1].unshift({type:"parStart",parText:b.parseMessage(l[p-2]),signalType:b.LINETYPE.PAR_OVER_START}),l[p-1].push({type:"parEnd",signalType:b.LINETYPE.PAR_END}),this.$=l[p-1];break;case 40:l[p-1].unshift({type:"criticalStart",criticalText:b.parseMessage(l[p-2]),signalType:b.LINETYPE.CRITICAL_START}),l[p-1].push({type:"criticalEnd",signalType:b.LINETYPE.CRITICAL_END}),this.$=l[p-1];break;case 41:l[p-1].unshift({type:"breakStart",breakText:b.parseMessage(l[p-2]),signalType:b.LINETYPE.BREAK_START}),l[p-1].push({type:"breakEnd",optText:b.parseMessage(l[p-2]),signalType:b.LINETYPE.BREAK_END}),this.$=l[p-1];break;case 43:this.$=l[p-3].concat([{type:"option",optionText:b.parseMessage(l[p-1]),signalType:b.LINETYPE.CRITICAL_OPTION},l[p]]);break;case 45:this.$=l[p-3].concat([{type:"and",parText:b.parseMessage(l[p-1]),signalType:b.LINETYPE.PAR_AND},l[p]]);break;case 47:this.$=l[p-3].concat([{type:"else",altText:b.parseMessage(l[p-1]),signalType:b.LINETYPE.ALT_ELSE},l[p]]);break;case 48:l[p-3].draw="participant",l[p-3].type="addParticipant",l[p-3].description=b.parseMessage(l[p-1]),this.$=l[p-3];break;case 49:l[p-1].draw="participant",l[p-1].type="addParticipant",this.$=l[p-1];break;case 50:l[p-3].draw="actor",l[p-3].type="addParticipant",l[p-3].description=b.parseMessage(l[p-1]),this.$=l[p-3];break;case 51:l[p-1].draw="actor",l[p-1].type="addParticipant",this.$=l[p-1];break;case 52:l[p-1].type="destroyParticipant",this.$=l[p-1];break;case 53:this.$=[l[p-1],{type:"addNote",placement:l[p-2],actor:l[p-1].actor,text:l[p]}];break;case 54:l[p-2]=[].concat(l[p-1],l[p-1]).slice(0,2),l[p-2][0]=l[p-2][0].actor,l[p-2][1]=l[p-2][1].actor,this.$=[l[p-1],{type:"addNote",placement:b.PLACEMENT.OVER,actor:l[p-2].slice(0,2),text:l[p]}];break;case 55:this.$=[l[p-1],{type:"addLinks",actor:l[p-1].actor,text:l[p]}];break;case 56:this.$=[l[p-1],{type:"addALink",actor:l[p-1].actor,text:l[p]}];break;case 57:this.$=[l[p-1],{type:"addProperties",actor:l[p-1].actor,text:l[p]}];break;case 58:this.$=[l[p-1],{type:"addDetails",actor:l[p-1].actor,text:l[p]}];break;case 61:this.$=[l[p-2],l[p]];break;case 62:this.$=l[p];break;case 63:this.$=b.PLACEMENT.LEFTOF;break;case 64:this.$=b.PLACEMENT.RIGHTOF;break;case 65:this.$=[l[p-4],l[p-1],{type:"addMessage",from:l[p-4].actor,to:l[p-1].actor,signalType:l[p-3],msg:l[p],activate:!0},{type:"activeStart",signalType:b.LINETYPE.ACTIVE_START,actor:l[p-1].actor}];break;case 66:this.$=[l[p-4],l[p-1],{type:"addMessage",from:l[p-4].actor,to:l[p-1].actor,signalType:l[p-3],msg:l[p]},{type:"activeEnd",signalType:b.LINETYPE.ACTIVE_END,actor:l[p-4].actor}];break;case 67:this.$=[l[p-3],l[p-1],{type:"addMessage",from:l[p-3].actor,to:l[p-1].actor,signalType:l[p-2],msg:l[p]}];break;case 68:this.$={type:"addParticipant",actor:l[p]};break;case 69:this.$=b.LINETYPE.SOLID_OPEN;break;case 70:this.$=b.LINETYPE.DOTTED_OPEN;break;case 71:this.$=b.LINETYPE.SOLID;break;case 72:this.$=b.LINETYPE.BIDIRECTIONAL_SOLID;break;case 73:this.$=b.LINETYPE.DOTTED;break;case 74:this.$=b.LINETYPE.BIDIRECTIONAL_DOTTED;break;case 75:this.$=b.LINETYPE.SOLID_CROSS;break;case 76:this.$=b.LINETYPE.DOTTED_CROSS;break;case 77:this.$=b.LINETYPE.SOLID_POINT;break;case 78:this.$=b.LINETYPE.DOTTED_POINT;break;case 79:this.$=b.parseMessage(l[p].trim().substring(1));break}},"anonymous"),table:[{3:1,4:t,5:c,6:s},{1:[3]},{3:5,4:t,5:c,6:s},{3:6,4:t,5:c,6:s},e([1,4,5,13,14,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,50,52,53,54,59,60,61,62,70],a,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:i,5:n,8:8,9:10,12:12,13:h,14:d,17:15,18:r,21:f,22:40,23:E,24:19,25:20,26:21,27:22,28:23,29:g,30:T,31:m,33:w,35:A,36:O,37:S,38:B,39:D,41:F,43:q,44:X,46:tt,50:z,52:H,53:W,54:M,59:J,60:K,61:Z,62:et,70:N},e(y,[2,5]),{9:47,12:12,13:h,14:d,17:15,18:r,21:f,22:40,23:E,24:19,25:20,26:21,27:22,28:23,29:g,30:T,31:m,33:w,35:A,36:O,37:S,38:B,39:D,41:F,43:q,44:X,46:tt,50:z,52:H,53:W,54:M,59:J,60:K,61:Z,62:et,70:N},e(y,[2,7]),e(y,[2,8]),e(y,[2,14]),{12:48,50:z,52:H,53:W},{15:[1,49]},{5:[1,50]},{5:[1,53],19:[1,51],20:[1,52]},{22:54,70:N},{22:55,70:N},{5:[1,56]},{5:[1,57]},{5:[1,58]},{5:[1,59]},{5:[1,60]},e(y,[2,29]),e(y,[2,30]),{32:[1,61]},{34:[1,62]},e(y,[2,33]),{15:[1,63]},{15:[1,64]},{15:[1,65]},{15:[1,66]},{15:[1,67]},{15:[1,68]},{15:[1,69]},{15:[1,70]},{22:71,70:N},{22:72,70:N},{22:73,70:N},{67:74,71:[1,75],72:[1,76],73:[1,77],74:[1,78],75:[1,79],76:[1,80],77:[1,81],78:[1,82],79:[1,83],80:[1,84]},{55:85,57:[1,86],65:[1,87],66:[1,88]},{22:89,70:N},{22:90,70:N},{22:91,70:N},{22:92,70:N},e([5,51,64,71,72,73,74,75,76,77,78,79,80,81],[2,68]),e(y,[2,6]),e(y,[2,15]),e(_,[2,9],{10:93}),e(y,[2,17]),{5:[1,95],19:[1,94]},{5:[1,96]},e(y,[2,21]),{5:[1,97]},{5:[1,98]},e(y,[2,24]),e(y,[2,25]),e(y,[2,26]),e(y,[2,27]),e(y,[2,28]),e(y,[2,31]),e(y,[2,32]),e(Q,a,{7:99}),e(Q,a,{7:100}),e(Q,a,{7:101}),e(at,a,{40:102,7:103}),e(k,a,{42:104,7:105}),e(k,a,{7:105,42:106}),e(qt,a,{45:107,7:108}),e(Q,a,{7:109}),{5:[1,111],51:[1,110]},{5:[1,113],51:[1,112]},{5:[1,114]},{22:117,68:[1,115],69:[1,116],70:N},e(it,[2,69]),e(it,[2,70]),e(it,[2,71]),e(it,[2,72]),e(it,[2,73]),e(it,[2,74]),e(it,[2,75]),e(it,[2,76]),e(it,[2,77]),e(it,[2,78]),{22:118,70:N},{22:120,58:119,70:N},{70:[2,63]},{70:[2,64]},{56:121,81:ct},{56:123,81:ct},{56:124,81:ct},{56:125,81:ct},{4:[1,128],5:[1,130],11:127,12:129,16:[1,126],50:z,52:H,53:W},{5:[1,131]},e(y,[2,19]),e(y,[2,20]),e(y,[2,22]),e(y,[2,23]),{4:i,5:n,8:8,9:10,12:12,13:h,14:d,16:[1,132],17:15,18:r,21:f,22:40,23:E,24:19,25:20,26:21,27:22,28:23,29:g,30:T,31:m,33:w,35:A,36:O,37:S,38:B,39:D,41:F,43:q,44:X,46:tt,50:z,52:H,53:W,54:M,59:J,60:K,61:Z,62:et,70:N},{4:i,5:n,8:8,9:10,12:12,13:h,14:d,16:[1,133],17:15,18:r,21:f,22:40,23:E,24:19,25:20,26:21,27:22,28:23,29:g,30:T,31:m,33:w,35:A,36:O,37:S,38:B,39:D,41:F,43:q,44:X,46:tt,50:z,52:H,53:W,54:M,59:J,60:K,61:Z,62:et,70:N},{4:i,5:n,8:8,9:10,12:12,13:h,14:d,16:[1,134],17:15,18:r,21:f,22:40,23:E,24:19,25:20,26:21,27:22,28:23,29:g,30:T,31:m,33:w,35:A,36:O,37:S,38:B,39:D,41:F,43:q,44:X,46:tt,50:z,52:H,53:W,54:M,59:J,60:K,61:Z,62:et,70:N},{16:[1,135]},{4:i,5:n,8:8,9:10,12:12,13:h,14:d,16:[2,46],17:15,18:r,21:f,22:40,23:E,24:19,25:20,26:21,27:22,28:23,29:g,30:T,31:m,33:w,35:A,36:O,37:S,38:B,39:D,41:F,43:q,44:X,46:tt,49:[1,136],50:z,52:H,53:W,54:M,59:J,60:K,61:Z,62:et,70:N},{16:[1,137]},{4:i,5:n,8:8,9:10,12:12,13:h,14:d,16:[2,44],17:15,18:r,21:f,22:40,23:E,24:19,25:20,26:21,27:22,28:23,29:g,30:T,31:m,33:w,35:A,36:O,37:S,38:B,39:D,41:F,43:q,44:X,46:tt,48:[1,138],50:z,52:H,53:W,54:M,59:J,60:K,61:Z,62:et,70:N},{16:[1,139]},{16:[1,140]},{4:i,5:n,8:8,9:10,12:12,13:h,14:d,16:[2,42],17:15,18:r,21:f,22:40,23:E,24:19,25:20,26:21,27:22,28:23,29:g,30:T,31:m,33:w,35:A,36:O,37:S,38:B,39:D,41:F,43:q,44:X,46:tt,47:[1,141],50:z,52:H,53:W,54:M,59:J,60:K,61:Z,62:et,70:N},{4:i,5:n,8:8,9:10,12:12,13:h,14:d,16:[1,142],17:15,18:r,21:f,22:40,23:E,24:19,25:20,26:21,27:22,28:23,29:g,30:T,31:m,33:w,35:A,36:O,37:S,38:B,39:D,41:F,43:q,44:X,46:tt,50:z,52:H,53:W,54:M,59:J,60:K,61:Z,62:et,70:N},{15:[1,143]},e(y,[2,49]),{15:[1,144]},e(y,[2,51]),e(y,[2,52]),{22:145,70:N},{22:146,70:N},{56:147,81:ct},{56:148,81:ct},{56:149,81:ct},{64:[1,150],81:[2,62]},{5:[2,55]},{5:[2,79]},{5:[2,56]},{5:[2,57]},{5:[2,58]},e(y,[2,16]),e(_,[2,10]),{12:151,50:z,52:H,53:W},e(_,[2,12]),e(_,[2,13]),e(y,[2,18]),e(y,[2,34]),e(y,[2,35]),e(y,[2,36]),e(y,[2,37]),{15:[1,152]},e(y,[2,38]),{15:[1,153]},e(y,[2,39]),e(y,[2,40]),{15:[1,154]},e(y,[2,41]),{5:[1,155]},{5:[1,156]},{56:157,81:ct},{56:158,81:ct},{5:[2,67]},{5:[2,53]},{5:[2,54]},{22:159,70:N},e(_,[2,11]),e(at,a,{7:103,40:160}),e(k,a,{7:105,42:161}),e(qt,a,{7:108,45:162}),e(y,[2,48]),e(y,[2,50]),{5:[2,65]},{5:[2,66]},{81:[2,61]},{16:[2,47]},{16:[2,45]},{16:[2,43]}],defaultActions:{5:[2,1],6:[2,2],87:[2,63],88:[2,64],121:[2,55],122:[2,79],123:[2,56],124:[2,57],125:[2,58],147:[2,67],148:[2,53],149:[2,54],157:[2,65],158:[2,66],159:[2,61],160:[2,47],161:[2,45],162:[2,43]},parseError:u(function(v,L){if(L.recoverable)this.trace(v);else{var P=new Error(v);throw P.hash=L,P}},"parseError"),parse:u(function(v){var L=this,P=[0],b=[],R=[null],l=[],Et=this.table,p="",wt=0,zt=0,pe=2,Ht=1,ue=l.slice.call(arguments,1),V=Object.create(this.lexer),dt={yy:{}};for(var St in this.yy)Object.prototype.hasOwnProperty.call(this.yy,St)&&(dt.yy[St]=this.yy[St]);V.setInput(v,dt.yy),dt.yy.lexer=V,dt.yy.parser=this,typeof V.yylloc>"u"&&(V.yylloc={});var Mt=V.yylloc;l.push(Mt);var ge=V.options&&V.options.ranges;typeof dt.yy.parseError=="function"?this.parseError=dt.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function fe(j){P.length=P.length-2*j,R.length=R.length-j,l.length=l.length-j}u(fe,"popStack");function Kt(){var j;return j=b.pop()||V.lex()||Ht,typeof j!="number"&&(j instanceof Array&&(b=j,j=b.pop()),j=L.symbols_[j]||j),j}u(Kt,"lex");for(var U,pt,st,Rt,ft={},vt,lt,Ut,It;;){if(pt=P[P.length-1],this.defaultActions[pt]?st=this.defaultActions[pt]:((U===null||typeof U>"u")&&(U=Kt()),st=Et[pt]&&Et[pt][U]),typeof st>"u"||!st.length||!st[0]){var Dt="";It=[];for(vt in Et[pt])this.terminals_[vt]&&vt>pe&&It.push("'"+this.terminals_[vt]+"'");V.showPosition?Dt="Parse error on line "+(wt+1)+`:
2
+ `+V.showPosition()+`
3
+ Expecting `+It.join(", ")+", got '"+(this.terminals_[U]||U)+"'":Dt="Parse error on line "+(wt+1)+": Unexpected "+(U==Ht?"end of input":"'"+(this.terminals_[U]||U)+"'"),this.parseError(Dt,{text:V.match,token:this.terminals_[U]||U,line:V.yylineno,loc:Mt,expected:It})}if(st[0]instanceof Array&&st.length>1)throw new Error("Parse Error: multiple actions possible at state: "+pt+", token: "+U);switch(st[0]){case 1:P.push(U),R.push(V.yytext),l.push(V.yylloc),P.push(st[1]),U=null,zt=V.yyleng,p=V.yytext,wt=V.yylineno,Mt=V.yylloc;break;case 2:if(lt=this.productions_[st[1]][1],ft.$=R[R.length-lt],ft._$={first_line:l[l.length-(lt||1)].first_line,last_line:l[l.length-1].last_line,first_column:l[l.length-(lt||1)].first_column,last_column:l[l.length-1].last_column},ge&&(ft._$.range=[l[l.length-(lt||1)].range[0],l[l.length-1].range[1]]),Rt=this.performAction.apply(ft,[p,zt,wt,dt.yy,st[1],R,l].concat(ue)),typeof Rt<"u")return Rt;lt&&(P=P.slice(0,-1*lt*2),R=R.slice(0,-1*lt),l=l.slice(0,-1*lt)),P.push(this.productions_[st[1]][0]),R.push(ft.$),l.push(ft._$),Ut=Et[P[P.length-2]][P[P.length-1]],P.push(Ut);break;case 3:return!0}}return!0},"parse")},de=function(){var ht={EOF:1,parseError:u(function(L,P){if(this.yy.parser)this.yy.parser.parseError(L,P);else throw new Error(L)},"parseError"),setInput:u(function(v,L){return this.yy=L||this.yy||{},this._input=v,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:u(function(){var v=this._input[0];this.yytext+=v,this.yyleng++,this.offset++,this.match+=v,this.matched+=v;var L=v.match(/(?:\r\n?|\n).*/g);return L?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),v},"input"),unput:u(function(v){var L=v.length,P=v.split(/(?:\r\n?|\n)/g);this._input=v+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-L),this.offset-=L;var b=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),P.length-1&&(this.yylineno-=P.length-1);var R=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:P?(P.length===b.length?this.yylloc.first_column:0)+b[b.length-P.length].length-P[0].length:this.yylloc.first_column-L},this.options.ranges&&(this.yylloc.range=[R[0],R[0]+this.yyleng-L]),this.yyleng=this.yytext.length,this},"unput"),more:u(function(){return this._more=!0,this},"more"),reject:u(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
4
+ `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:u(function(v){this.unput(this.match.slice(v))},"less"),pastInput:u(function(){var v=this.matched.substr(0,this.matched.length-this.match.length);return(v.length>20?"...":"")+v.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:u(function(){var v=this.match;return v.length<20&&(v+=this._input.substr(0,20-v.length)),(v.substr(0,20)+(v.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:u(function(){var v=this.pastInput(),L=new Array(v.length+1).join("-");return v+this.upcomingInput()+`
5
+ `+L+"^"},"showPosition"),test_match:u(function(v,L){var P,b,R;if(this.options.backtrack_lexer&&(R={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&&(R.yylloc.range=this.yylloc.range.slice(0))),b=v[0].match(/(?:\r\n?|\n).*/g),b&&(this.yylineno+=b.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:b?b[b.length-1].length-b[b.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+v[0].length},this.yytext+=v[0],this.match+=v[0],this.matches=v,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(v[0].length),this.matched+=v[0],P=this.performAction.call(this,this.yy,this,L,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),P)return P;if(this._backtrack){for(var l in R)this[l]=R[l];return!1}return!1},"test_match"),next:u(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var v,L,P,b;this._more||(this.yytext="",this.match="");for(var R=this._currentRules(),l=0;l<R.length;l++)if(P=this._input.match(this.rules[R[l]]),P&&(!L||P[0].length>L[0].length)){if(L=P,b=l,this.options.backtrack_lexer){if(v=this.test_match(P,R[l]),v!==!1)return v;if(this._backtrack){L=!1;continue}else return!1}else if(!this.options.flex)break}return L?(v=this.test_match(L,R[b]),v!==!1?v:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
6
+ `+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:u(function(){var L=this.next();return L||this.lex()},"lex"),begin:u(function(L){this.conditionStack.push(L)},"begin"),popState:u(function(){var L=this.conditionStack.length-1;return L>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:u(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:u(function(L){return L=this.conditionStack.length-1-Math.abs(L||0),L>=0?this.conditionStack[L]:"INITIAL"},"topState"),pushState:u(function(L){this.begin(L)},"pushState"),stateStackSize:u(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:u(function(L,P,b,R){switch(b){case 0:return 5;case 1:break;case 2:break;case 3:break;case 4:break;case 5:break;case 6:return 19;case 7:return this.begin("LINE"),14;case 8:return this.begin("ID"),50;case 9:return this.begin("ID"),52;case 10:return 13;case 11:return this.begin("ID"),53;case 12:return P.yytext=P.yytext.trim(),this.begin("ALIAS"),70;case 13:return this.popState(),this.popState(),this.begin("LINE"),51;case 14:return this.popState(),this.popState(),5;case 15:return this.begin("LINE"),36;case 16:return this.begin("LINE"),37;case 17:return this.begin("LINE"),38;case 18:return this.begin("LINE"),39;case 19:return this.begin("LINE"),49;case 20:return this.begin("LINE"),41;case 21:return this.begin("LINE"),43;case 22:return this.begin("LINE"),48;case 23:return this.begin("LINE"),44;case 24:return this.begin("LINE"),47;case 25:return this.begin("LINE"),46;case 26:return this.popState(),15;case 27:return 16;case 28:return 65;case 29:return 66;case 30:return 59;case 31:return 60;case 32:return 61;case 33:return 62;case 34:return 57;case 35:return 54;case 36:return this.begin("ID"),21;case 37:return this.begin("ID"),23;case 38:return 29;case 39:return 30;case 40:return this.begin("acc_title"),31;case 41:return this.popState(),"acc_title_value";case 42:return this.begin("acc_descr"),33;case 43:return this.popState(),"acc_descr_value";case 44:this.begin("acc_descr_multiline");break;case 45:this.popState();break;case 46:return"acc_descr_multiline_value";case 47:return 6;case 48:return 18;case 49:return 20;case 50:return 64;case 51:return 5;case 52:return P.yytext=P.yytext.trim(),70;case 53:return 73;case 54:return 74;case 55:return 75;case 56:return 76;case 57:return 71;case 58:return 72;case 59:return 77;case 60:return 78;case 61:return 79;case 62:return 80;case 63:return 81;case 64:return 68;case 65:return 69;case 66:return 5;case 67:return"INVALID"}},"anonymous"),rules:[/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[0-9]+(?=[ \n]+))/i,/^(?:box\b)/i,/^(?:participant\b)/i,/^(?:actor\b)/i,/^(?:create\b)/i,/^(?:destroy\b)/i,/^(?:[^\<->\->:\n,;]+?([\-]*[^\<->\->:\n,;]+?)*?(?=((?!\n)\s)+as(?!\n)\s|[#\n;]|$))/i,/^(?:as\b)/i,/^(?:(?:))/i,/^(?:loop\b)/i,/^(?:rect\b)/i,/^(?:opt\b)/i,/^(?:alt\b)/i,/^(?:else\b)/i,/^(?:par\b)/i,/^(?:par_over\b)/i,/^(?:and\b)/i,/^(?:critical\b)/i,/^(?:option\b)/i,/^(?:break\b)/i,/^(?:(?:[:]?(?:no)?wrap)?[^#\n;]*)/i,/^(?:end\b)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:links\b)/i,/^(?:link\b)/i,/^(?:properties\b)/i,/^(?:details\b)/i,/^(?:over\b)/i,/^(?:note\b)/i,/^(?:activate\b)/i,/^(?:deactivate\b)/i,/^(?:title\s[^#\n;]+)/i,/^(?:title:\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:sequenceDiagram\b)/i,/^(?:autonumber\b)/i,/^(?:off\b)/i,/^(?:,)/i,/^(?:;)/i,/^(?:[^\+\<->\->:\n,;]+((?!(-x|--x|-\)|--\)))[\-]*[^\+\<->\->:\n,;]+)*)/i,/^(?:->>)/i,/^(?:<<->>)/i,/^(?:-->>)/i,/^(?:<<-->>)/i,/^(?:->)/i,/^(?:-->)/i,/^(?:-[x])/i,/^(?:--[x])/i,/^(?:-[\)])/i,/^(?:--[\)])/i,/^(?::(?:(?:no)?wrap)?[^#\n;]+)/i,/^(?:\+)/i,/^(?:-)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[45,46],inclusive:!1},acc_descr:{rules:[43],inclusive:!1},acc_title:{rules:[41],inclusive:!1},ID:{rules:[2,3,12],inclusive:!1},ALIAS:{rules:[2,3,13,14],inclusive:!1},LINE:{rules:[2,3,26],inclusive:!1},INITIAL:{rules:[0,1,3,4,5,6,7,8,9,10,11,15,16,17,18,19,20,21,22,23,24,25,27,28,29,30,31,32,33,34,35,36,37,38,39,40,42,44,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67],inclusive:!0}}};return ht}();Nt.lexer=de;function mt(){this.yy={}}return u(mt,"Parser"),mt.prototype=Nt,Nt.Parser=mt,new mt}();Ot.parser=Ot;var Se=Ot,Me={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},Re={FILLED:0,OPEN:1},De={LEFTOF:0,RIGHTOF:1,OVER:2},Tt,Ce=(Tt=class{constructor(){this.state=new be(()=>({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=Gt,this.setAccDescription=Ie,this.setDiagramTitle=Le,this.getAccTitle=_e,this.getAccDescription=Pe,this.getDiagramTitle=Ae,this.apply=this.apply.bind(this),this.parseBoxData=this.parseBoxData.bind(this),this.parseMessage=this.parseMessage.bind(this),this.clear(),this.setWrap($().wrap),this.LINETYPE=Me,this.ARROWTYPE=Re,this.PLACEMENT=De}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,c,s,a){let i=this.state.records.currentBox;const n=this.state.records.actors.get(t);if(n){if(this.state.records.currentBox&&n.box&&this.state.records.currentBox!==n.box)throw new Error(`A same participant should only be defined in one Box: ${n.name} can't be in '${n.box.name}' and in '${this.state.records.currentBox.name}' at the same time.`);if(i=n.box?n.box:this.state.records.currentBox,n.box=i,n&&c===n.name&&s==null)return}if((s==null?void 0:s.text)==null&&(s={text:c,type:a}),(a==null||s.text==null)&&(s={text:c,type:a}),this.state.records.actors.set(t,{box:i,name:c,description:s.text,wrap:s.wrap??this.autoWrap(),prevActor:this.state.records.prevActor,links:{},properties:{},actorCnt:null,rectData:null,type:a??"participant"}),this.state.records.prevActor){const h=this.state.records.actors.get(this.state.records.prevActor);h&&(h.nextActor=t)}this.state.records.currentBox&&this.state.records.currentBox.actorKeys.push(t),this.state.records.prevActor=t}activationCount(t){let c,s=0;if(!t)return 0;for(c=0;c<this.state.records.messages.length;c++)this.state.records.messages[c].type===this.LINETYPE.ACTIVE_START&&this.state.records.messages[c].from===t&&s++,this.state.records.messages[c].type===this.LINETYPE.ACTIVE_END&&this.state.records.messages[c].from===t&&s--;return s}addMessage(t,c,s,a){this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:t,to:c,message:s.text,wrap:s.wrap??this.autoWrap(),answer:a})}addSignal(t,c,s,a,i=!1){if(a===this.LINETYPE.ACTIVE_END&&this.activationCount(t??"")<1){const h=new Error("Trying to inactivate an inactive participant ("+t+")");throw h.hash={text:"->>-",token:"->>-",line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:["'ACTIVE_PARTICIPANT'"]},h}return this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:t,to:c,message:(s==null?void 0:s.text)??"",wrap:(s==null?void 0:s.wrap)??this.autoWrap(),type:a,activate:i}),!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(t===void 0)return{};t=t.trim();const c=/^:?wrap:/.exec(t)!==null?!0:/^:?nowrap:/.exec(t)!==null?!1:void 0;return{cleanedText:(c===void 0?t:t.replace(/^:?(?:no)?wrap:/,"")).trim(),wrap:c}}autoWrap(){var t;return this.state.records.wrapEnabled!==void 0?this.state.records.wrapEnabled:((t=$().sequence)==null?void 0:t.wrap)??!1}clear(){this.state.reset(),ke()}parseMessage(t){const c=t.trim(),{wrap:s,cleanedText:a}=this.extractWrap(c),i={text:a,wrap:s};return G.debug(`parseMessage: ${JSON.stringify(i)}`),i}parseBoxData(t){const c=/^((?:rgba?|hsla?)\s*\(.*\)|\w*)(.*)$/.exec(t);let s=c!=null&&c[1]?c[1].trim():"transparent",a=c!=null&&c[2]?c[2].trim():void 0;if(window!=null&&window.CSS)window.CSS.supports("color",s)||(s="transparent",a=t.trim());else{const h=new Option().style;h.color=s,h.color!==s&&(s="transparent",a=t.trim())}const{wrap:i,cleanedText:n}=this.extractWrap(a);return{text:n?_t(n,$()):void 0,color:s,wrap:i}}addNote(t,c,s){const a={actor:t,placement:c,message:s.text,wrap:s.wrap??this.autoWrap()},i=[].concat(t,t);this.state.records.notes.push(a),this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:i[0],to:i[1],message:s.text,wrap:s.wrap??this.autoWrap(),type:this.LINETYPE.NOTE,placement:c})}addLinks(t,c){const s=this.getActor(t);try{let a=_t(c.text,$());a=a.replace(/&equals;/g,"="),a=a.replace(/&amp;/g,"&");const i=JSON.parse(a);this.insertLinks(s,i)}catch(a){G.error("error while parsing actor link text",a)}}addALink(t,c){const s=this.getActor(t);try{const a={};let i=_t(c.text,$());const n=i.indexOf("@");i=i.replace(/&equals;/g,"="),i=i.replace(/&amp;/g,"&");const h=i.slice(0,n-1).trim(),d=i.slice(n+1).trim();a[h]=d,this.insertLinks(s,a)}catch(a){G.error("error while parsing actor link text",a)}}insertLinks(t,c){if(t.links==null)t.links=c;else for(const s in c)t.links[s]=c[s]}addProperties(t,c){const s=this.getActor(t);try{const a=_t(c.text,$()),i=JSON.parse(a);this.insertProperties(s,i)}catch(a){G.error("error while parsing actor properties text",a)}}insertProperties(t,c){if(t.properties==null)t.properties=c;else for(const s in c)t.properties[s]=c[s]}boxEnd(){this.state.records.currentBox=void 0}addDetails(t,c){const s=this.getActor(t),a=document.getElementById(c.text);try{const i=a.innerHTML,n=JSON.parse(i);n.properties&&this.insertProperties(s,n.properties),n.links&&this.insertLinks(s,n.links)}catch(i){G.error("error while parsing actor details text",i)}}getActorProperty(t,c){if((t==null?void 0:t.properties)!==void 0)return t.properties[c]}apply(t){if(Array.isArray(t))t.forEach(c=>{this.apply(c)});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);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),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":this.addSignal(t.actor,void 0,void 0,t.signalType);break;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);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":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"rectEnd":this.addSignal(void 0,void 0,void 0,t.signalType);break;case"optStart":this.addSignal(void 0,void 0,t.optText,t.signalType);break;case"optEnd":this.addSignal(void 0,void 0,void 0,t.signalType);break;case"altStart":this.addSignal(void 0,void 0,t.altText,t.signalType);break;case"else":this.addSignal(void 0,void 0,t.altText,t.signalType);break;case"altEnd":this.addSignal(void 0,void 0,void 0,t.signalType);break;case"setAccTitle":Gt(t.text);break;case"parStart":this.addSignal(void 0,void 0,t.parText,t.signalType);break;case"and":this.addSignal(void 0,void 0,t.parText,t.signalType);break;case"parEnd":this.addSignal(void 0,void 0,void 0,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"criticalEnd":this.addSignal(void 0,void 0,void 0,t.signalType);break;case"breakStart":this.addSignal(void 0,void 0,t.breakText,t.signalType);break;case"breakEnd":this.addSignal(void 0,void 0,void 0,t.signalType);break}}getConfig(){return $().sequence}},u(Tt,"SequenceDB"),Tt),Oe=u(e=>`.actor {
7
+ stroke: ${e.actorBorder};
8
+ fill: ${e.actorBkg};
9
+ }
10
+
11
+ text.actor > tspan {
12
+ fill: ${e.actorTextColor};
13
+ stroke: none;
14
+ }
15
+
16
+ .actor-line {
17
+ stroke: ${e.actorLineColor};
18
+ }
19
+
20
+ .messageLine0 {
21
+ stroke-width: 1.5;
22
+ stroke-dasharray: none;
23
+ stroke: ${e.signalColor};
24
+ }
25
+
26
+ .messageLine1 {
27
+ stroke-width: 1.5;
28
+ stroke-dasharray: 2, 2;
29
+ stroke: ${e.signalColor};
30
+ }
31
+
32
+ #arrowhead path {
33
+ fill: ${e.signalColor};
34
+ stroke: ${e.signalColor};
35
+ }
36
+
37
+ .sequenceNumber {
38
+ fill: ${e.sequenceNumberColor};
39
+ }
40
+
41
+ #sequencenumber {
42
+ fill: ${e.signalColor};
43
+ }
44
+
45
+ #crosshead path {
46
+ fill: ${e.signalColor};
47
+ stroke: ${e.signalColor};
48
+ }
49
+
50
+ .messageText {
51
+ fill: ${e.signalTextColor};
52
+ stroke: none;
53
+ }
54
+
55
+ .labelBox {
56
+ stroke: ${e.labelBoxBorderColor};
57
+ fill: ${e.labelBoxBkgColor};
58
+ }
59
+
60
+ .labelText, .labelText > tspan {
61
+ fill: ${e.labelTextColor};
62
+ stroke: none;
63
+ }
64
+
65
+ .loopText, .loopText > tspan {
66
+ fill: ${e.loopTextColor};
67
+ stroke: none;
68
+ }
69
+
70
+ .loopLine {
71
+ stroke-width: 2px;
72
+ stroke-dasharray: 2, 2;
73
+ stroke: ${e.labelBoxBorderColor};
74
+ fill: ${e.labelBoxBorderColor};
75
+ }
76
+
77
+ .note {
78
+ //stroke: #decc93;
79
+ stroke: ${e.noteBorderColor};
80
+ fill: ${e.noteBkgColor};
81
+ }
82
+
83
+ .noteText, .noteText > tspan {
84
+ fill: ${e.noteTextColor};
85
+ stroke: none;
86
+ }
87
+
88
+ .activation0 {
89
+ fill: ${e.activationBkgColor};
90
+ stroke: ${e.activationBorderColor};
91
+ }
92
+
93
+ .activation1 {
94
+ fill: ${e.activationBkgColor};
95
+ stroke: ${e.activationBorderColor};
96
+ }
97
+
98
+ .activation2 {
99
+ fill: ${e.activationBkgColor};
100
+ stroke: ${e.activationBorderColor};
101
+ }
102
+
103
+ .actorPopupMenu {
104
+ position: absolute;
105
+ }
106
+
107
+ .actorPopupMenuPanel {
108
+ position: absolute;
109
+ fill: ${e.actorBkg};
110
+ box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
111
+ filter: drop-shadow(3px 5px 2px rgb(0 0 0 / 0.4));
112
+ }
113
+ .actor-man line {
114
+ stroke: ${e.actorBorder};
115
+ fill: ${e.actorBkg};
116
+ }
117
+ .actor-man circle, line {
118
+ stroke: ${e.actorBorder};
119
+ fill: ${e.actorBkg};
120
+ stroke-width: 2px;
121
+ }
122
+ `,"getStyles"),Be=Oe,ut=18*2,$t="actor-top",te="actor-bottom",Ve="actor-box",Xt="actor-man",Wt=u(function(e,t){return Te(e,t)},"drawRect"),Ye=u(function(e,t,c,s,a){if(t.links===void 0||t.links===null||Object.keys(t.links).length===0)return{height:0,width:0};const i=t.links,n=t.actorCnt,h=t.rectData;var d="none";a&&(d="block !important");const r=e.append("g");r.attr("id","actor"+n+"_popup"),r.attr("class","actorPopupMenu"),r.attr("display",d);var f="";h.class!==void 0&&(f=" "+h.class);let E=h.width>c?h.width:c;const g=r.append("rect");if(g.attr("class","actorPopupMenuPanel"+f),g.attr("x",h.x),g.attr("y",h.height),g.attr("fill",h.fill),g.attr("stroke",h.stroke),g.attr("width",E),g.attr("height",h.height),g.attr("rx",h.rx),g.attr("ry",h.ry),i!=null){var T=20;for(let A in i){var m=r.append("a"),w=Zt.sanitizeUrl(i[A]);m.attr("xlink:href",w),m.attr("target","_blank"),ss(s)(A,m,h.x+10,h.height+T,E,20,{class:"actor"},s),T+=30}}return g.attr("height",T),{height:h.height+T,width:E}},"drawPopup"),We=u(function(e){return"var pu = document.getElementById('"+e+"'); if (pu != null) { pu.style.display = pu.style.display == 'block' ? 'none' : 'block'; }"},"popupMenuToggle"),Pt=u(async function(e,t,c=null){let s=e.append("foreignObject");const a=await jt(t.text,Ct()),n=s.append("xhtml:div").attr("style","width: fit-content;").attr("xmlns","http://www.w3.org/1999/xhtml").html(a).node().getBoundingClientRect();if(s.attr("height",Math.round(n.height)).attr("width",Math.round(n.width)),t.class==="noteText"){const h=e.node().firstChild;h.setAttribute("height",n.height+2*t.textMargin);const d=h.getBBox();s.attr("x",Math.round(d.x+d.width/2-n.width/2)).attr("y",Math.round(d.y+d.height/2-n.height/2))}else if(c){let{startx:h,stopx:d,starty:r}=c;if(h>d){const f=h;h=d,d=f}s.attr("x",Math.round(h+Math.abs(h-d)/2-n.width/2)),t.class==="loopText"?s.attr("y",Math.round(r)):s.attr("y",Math.round(r-n.height))}return[s]},"drawKatex"),yt=u(function(e,t){let c=0,s=0;const a=t.text.split(I.lineBreakRegex),[i,n]=Qt(t.fontSize);let h=[],d=0,r=u(()=>t.y,"yfunc");if(t.valign!==void 0&&t.textMargin!==void 0&&t.textMargin>0)switch(t.valign){case"top":case"start":r=u(()=>Math.round(t.y+t.textMargin),"yfunc");break;case"middle":case"center":r=u(()=>Math.round(t.y+(c+s+t.textMargin)/2),"yfunc");break;case"bottom":case"end":r=u(()=>Math.round(t.y+(c+s+2*t.textMargin)-t.textMargin),"yfunc");break}if(t.anchor!==void 0&&t.textMargin!==void 0&&t.width!==void 0)switch(t.anchor){case"left":case"start":t.x=Math.round(t.x+t.textMargin),t.anchor="start",t.dominantBaseline="middle",t.alignmentBaseline="middle";break;case"middle":case"center":t.x=Math.round(t.x+t.width/2),t.anchor="middle",t.dominantBaseline="middle",t.alignmentBaseline="middle";break;case"right":case"end":t.x=Math.round(t.x+t.width-t.textMargin),t.anchor="end",t.dominantBaseline="middle",t.alignmentBaseline="middle";break}for(let[f,E]of a.entries()){t.textMargin!==void 0&&t.textMargin===0&&i!==void 0&&(d=f*i);const g=e.append("text");g.attr("x",t.x),g.attr("y",r()),t.anchor!==void 0&&g.attr("text-anchor",t.anchor).attr("dominant-baseline",t.dominantBaseline).attr("alignment-baseline",t.alignmentBaseline),t.fontFamily!==void 0&&g.style("font-family",t.fontFamily),n!==void 0&&g.style("font-size",n),t.fontWeight!==void 0&&g.style("font-weight",t.fontWeight),t.fill!==void 0&&g.attr("fill",t.fill),t.class!==void 0&&g.attr("class",t.class),t.dy!==void 0?g.attr("dy",t.dy):d!==0&&g.attr("dy",d);const T=E||Ne;if(t.tspan){const m=g.append("tspan");m.attr("x",t.x),t.fill!==void 0&&m.attr("fill",t.fill),m.text(T)}else g.text(T);t.valign!==void 0&&t.textMargin!==void 0&&t.textMargin>0&&(s+=(g._groups||g)[0][0].getBBox().height,c=s),h.push(g)}return h},"drawText"),ee=u(function(e,t){function c(a,i,n,h,d){return a+","+i+" "+(a+n)+","+i+" "+(a+n)+","+(i+h-d)+" "+(a+n-d*1.2)+","+(i+h)+" "+a+","+(i+h)}u(c,"genPoints");const s=e.append("polygon");return s.attr("points",c(t.x,t.y,t.width,t.height,7)),s.attr("class","labelBox"),t.y=t.y+t.height/2,yt(e,t),s},"drawLabel"),nt=-1,se=u((e,t,c,s)=>{e.select&&c.forEach(a=>{const i=t.get(a),n=e.select("#actor"+i.actorCnt);!s.mirrorActors&&i.stopy?n.attr("y2",i.stopy+i.height/2):s.mirrorActors&&n.attr("y2",i.stopy)})},"fixLifeLineHeights"),Fe=u(function(e,t,c,s){var T,m;const a=s?t.stopy:t.starty,i=t.x+t.width/2,n=a+t.height,h=e.append("g").lower();var d=h;s||(nt++,Object.keys(t.links||{}).length&&!c.forceMenus&&d.attr("onclick",We(`actor${nt}_popup`)).attr("cursor","pointer"),d.append("line").attr("id","actor"+nt).attr("x1",i).attr("y1",n).attr("x2",i).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name),d=h.append("g"),t.actorCnt=nt,t.links!=null&&d.attr("id","root-"+nt));const r=At();var f="actor";(T=t.properties)!=null&&T.class?f=t.properties.class:r.fill="#eaeaea",s?f+=` ${te}`:f+=` ${$t}`,r.x=t.x,r.y=a,r.width=t.width,r.height=t.height,r.class=f,r.rx=3,r.ry=3,r.name=t.name;const E=Wt(d,r);if(t.rectData=r,(m=t.properties)!=null&&m.icon){const w=t.properties.icon.trim();w.charAt(0)==="@"?ye(d,r.x+r.width-20,r.y+10,w.substr(1)):Ee(d,r.x+r.width-20,r.y+10,w)}Ft(c,ot(t.description))(t.description,d,r.x,r.y,r.width,r.height,{class:`actor ${Ve}`},c);let g=t.height;if(E.node){const w=E.node().getBBox();t.height=w.height,g=w.height}return g},"drawActorTypeParticipant"),qe=u(function(e,t,c,s){const a=s?t.stopy:t.starty,i=t.x+t.width/2,n=a+80,h=e.append("g").lower();s||(nt++,h.append("line").attr("id","actor"+nt).attr("x1",i).attr("y1",n).attr("x2",i).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name),t.actorCnt=nt);const d=e.append("g");let r=Xt;s?r+=` ${te}`:r+=` ${$t}`,d.attr("class",r),d.attr("name",t.name);const f=At();f.x=t.x,f.y=a,f.fill="#eaeaea",f.width=t.width,f.height=t.height,f.class="actor",f.rx=3,f.ry=3,d.append("line").attr("id","actor-man-torso"+nt).attr("x1",i).attr("y1",a+25).attr("x2",i).attr("y2",a+45),d.append("line").attr("id","actor-man-arms"+nt).attr("x1",i-ut/2).attr("y1",a+33).attr("x2",i+ut/2).attr("y2",a+33),d.append("line").attr("x1",i-ut/2).attr("y1",a+60).attr("x2",i).attr("y2",a+45),d.append("line").attr("x1",i).attr("y1",a+45).attr("x2",i+ut/2-2).attr("y2",a+60);const E=d.append("circle");E.attr("cx",t.x+t.width/2),E.attr("cy",a+10),E.attr("r",15),E.attr("width",t.width),E.attr("height",t.height);const g=d.node().getBBox();return t.height=g.height,Ft(c,ot(t.description))(t.description,d,f.x,f.y+35,f.width,f.height,{class:`actor ${Xt}`},c),t.height},"drawActorTypeActor"),ze=u(async function(e,t,c,s){switch(t.type){case"actor":return await qe(e,t,c,s);case"participant":return await Fe(e,t,c,s)}},"drawActor"),He=u(function(e,t,c){const a=e.append("g");ae(a,t),t.name&&Ft(c)(t.name,a,t.x,t.y+(t.textMaxHeight||0)/2,t.width,0,{class:"text"},c),a.lower()},"drawBox"),Ke=u(function(e){return e.append("g")},"anchorElement"),Ue=u(function(e,t,c,s,a){const i=At(),n=t.anchored;i.x=t.startx,i.y=t.starty,i.class="activation"+a%3,i.width=t.stopx-t.startx,i.height=c-t.starty,Wt(n,i)},"drawActivation"),Ge=u(async function(e,t,c,s){const{boxMargin:a,boxTextMargin:i,labelBoxHeight:n,labelBoxWidth:h,messageFontFamily:d,messageFontSize:r,messageFontWeight:f}=s,E=e.append("g"),g=u(function(w,A,O,S){return E.append("line").attr("x1",w).attr("y1",A).attr("x2",O).attr("y2",S).attr("class","loopLine")},"drawLoopLine");g(t.startx,t.starty,t.stopx,t.starty),g(t.stopx,t.starty,t.stopx,t.stopy),g(t.startx,t.stopy,t.stopx,t.stopy),g(t.startx,t.starty,t.startx,t.stopy),t.sections!==void 0&&t.sections.forEach(function(w){g(t.startx,w.y,t.stopx,w.y).style("stroke-dasharray","3, 3")});let T=Yt();T.text=c,T.x=t.startx,T.y=t.starty,T.fontFamily=d,T.fontSize=r,T.fontWeight=f,T.anchor="middle",T.valign="middle",T.tspan=!1,T.width=h||50,T.height=n||20,T.textMargin=i,T.class="labelText",ee(E,T),T=re(),T.text=t.title,T.x=t.startx+h/2+(t.stopx-t.startx)/2,T.y=t.starty+a+i,T.anchor="middle",T.valign="middle",T.textMargin=i,T.class="loopText",T.fontFamily=d,T.fontSize=r,T.fontWeight=f,T.wrap=!0;let m=ot(T.text)?await Pt(E,T,t):yt(E,T);if(t.sectionTitles!==void 0){for(const[w,A]of Object.entries(t.sectionTitles))if(A.message){T.text=A.message,T.x=t.startx+(t.stopx-t.startx)/2,T.y=t.sections[w].y+a+i,T.class="loopText",T.anchor="middle",T.valign="middle",T.tspan=!1,T.fontFamily=d,T.fontSize=r,T.fontWeight=f,T.wrap=t.wrap,ot(T.text)?(t.starty=t.sections[w].y,await Pt(E,T,t)):yt(E,T);let O=Math.round(m.map(S=>(S._groups||S)[0][0].getBBox().height).reduce((S,B)=>S+B));t.sections[w].height+=O-(a+i)}}return t.height=Math.round(t.stopy-t.starty),E},"drawLoop"),ae=u(function(e,t){xe(e,t)},"drawBackgroundRect"),Xe=u(function(e){e.append("defs").append("symbol").attr("id","database").attr("fill-rule","evenodd").attr("clip-rule","evenodd").append("path").attr("transform","scale(.5)").attr("d","M12.258.001l.256.004.255.005.253.008.251.01.249.012.247.015.246.016.242.019.241.02.239.023.236.024.233.027.231.028.229.031.225.032.223.034.22.036.217.038.214.04.211.041.208.043.205.045.201.046.198.048.194.05.191.051.187.053.183.054.18.056.175.057.172.059.168.06.163.061.16.063.155.064.15.066.074.033.073.033.071.034.07.034.069.035.068.035.067.035.066.035.064.036.064.036.062.036.06.036.06.037.058.037.058.037.055.038.055.038.053.038.052.038.051.039.05.039.048.039.047.039.045.04.044.04.043.04.041.04.04.041.039.041.037.041.036.041.034.041.033.042.032.042.03.042.029.042.027.042.026.043.024.043.023.043.021.043.02.043.018.044.017.043.015.044.013.044.012.044.011.045.009.044.007.045.006.045.004.045.002.045.001.045v17l-.001.045-.002.045-.004.045-.006.045-.007.045-.009.044-.011.045-.012.044-.013.044-.015.044-.017.043-.018.044-.02.043-.021.043-.023.043-.024.043-.026.043-.027.042-.029.042-.03.042-.032.042-.033.042-.034.041-.036.041-.037.041-.039.041-.04.041-.041.04-.043.04-.044.04-.045.04-.047.039-.048.039-.05.039-.051.039-.052.038-.053.038-.055.038-.055.038-.058.037-.058.037-.06.037-.06.036-.062.036-.064.036-.064.036-.066.035-.067.035-.068.035-.069.035-.07.034-.071.034-.073.033-.074.033-.15.066-.155.064-.16.063-.163.061-.168.06-.172.059-.175.057-.18.056-.183.054-.187.053-.191.051-.194.05-.198.048-.201.046-.205.045-.208.043-.211.041-.214.04-.217.038-.22.036-.223.034-.225.032-.229.031-.231.028-.233.027-.236.024-.239.023-.241.02-.242.019-.246.016-.247.015-.249.012-.251.01-.253.008-.255.005-.256.004-.258.001-.258-.001-.256-.004-.255-.005-.253-.008-.251-.01-.249-.012-.247-.015-.245-.016-.243-.019-.241-.02-.238-.023-.236-.024-.234-.027-.231-.028-.228-.031-.226-.032-.223-.034-.22-.036-.217-.038-.214-.04-.211-.041-.208-.043-.204-.045-.201-.046-.198-.048-.195-.05-.19-.051-.187-.053-.184-.054-.179-.056-.176-.057-.172-.059-.167-.06-.164-.061-.159-.063-.155-.064-.151-.066-.074-.033-.072-.033-.072-.034-.07-.034-.069-.035-.068-.035-.067-.035-.066-.035-.064-.036-.063-.036-.062-.036-.061-.036-.06-.037-.058-.037-.057-.037-.056-.038-.055-.038-.053-.038-.052-.038-.051-.039-.049-.039-.049-.039-.046-.039-.046-.04-.044-.04-.043-.04-.041-.04-.04-.041-.039-.041-.037-.041-.036-.041-.034-.041-.033-.042-.032-.042-.03-.042-.029-.042-.027-.042-.026-.043-.024-.043-.023-.043-.021-.043-.02-.043-.018-.044-.017-.043-.015-.044-.013-.044-.012-.044-.011-.045-.009-.044-.007-.045-.006-.045-.004-.045-.002-.045-.001-.045v-17l.001-.045.002-.045.004-.045.006-.045.007-.045.009-.044.011-.045.012-.044.013-.044.015-.044.017-.043.018-.044.02-.043.021-.043.023-.043.024-.043.026-.043.027-.042.029-.042.03-.042.032-.042.033-.042.034-.041.036-.041.037-.041.039-.041.04-.041.041-.04.043-.04.044-.04.046-.04.046-.039.049-.039.049-.039.051-.039.052-.038.053-.038.055-.038.056-.038.057-.037.058-.037.06-.037.061-.036.062-.036.063-.036.064-.036.066-.035.067-.035.068-.035.069-.035.07-.034.072-.034.072-.033.074-.033.151-.066.155-.064.159-.063.164-.061.167-.06.172-.059.176-.057.179-.056.184-.054.187-.053.19-.051.195-.05.198-.048.201-.046.204-.045.208-.043.211-.041.214-.04.217-.038.22-.036.223-.034.226-.032.228-.031.231-.028.234-.027.236-.024.238-.023.241-.02.243-.019.245-.016.247-.015.249-.012.251-.01.253-.008.255-.005.256-.004.258-.001.258.001zm-9.258 20.499v.01l.001.021.003.021.004.022.005.021.006.022.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.023.018.024.019.024.021.024.022.025.023.024.024.025.052.049.056.05.061.051.066.051.07.051.075.051.079.052.084.052.088.052.092.052.097.052.102.051.105.052.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.048.144.049.147.047.152.047.155.047.16.045.163.045.167.043.171.043.176.041.178.041.183.039.187.039.19.037.194.035.197.035.202.033.204.031.209.03.212.029.216.027.219.025.222.024.226.021.23.02.233.018.236.016.24.015.243.012.246.01.249.008.253.005.256.004.259.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.021.224-.024.22-.026.216-.027.212-.028.21-.031.205-.031.202-.034.198-.034.194-.036.191-.037.187-.039.183-.04.179-.04.175-.042.172-.043.168-.044.163-.045.16-.046.155-.046.152-.047.148-.048.143-.049.139-.049.136-.05.131-.05.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.053.083-.051.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.05.023-.024.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.023.01-.022.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.127l-.077.055-.08.053-.083.054-.085.053-.087.052-.09.052-.093.051-.095.05-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.045-.118.044-.12.043-.122.042-.124.042-.126.041-.128.04-.13.04-.132.038-.134.038-.135.037-.138.037-.139.035-.142.035-.143.034-.144.033-.147.032-.148.031-.15.03-.151.03-.153.029-.154.027-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.01-.179.008-.179.008-.181.006-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.006-.179-.008-.179-.008-.178-.01-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.027-.153-.029-.151-.03-.15-.03-.148-.031-.146-.032-.145-.033-.143-.034-.141-.035-.14-.035-.137-.037-.136-.037-.134-.038-.132-.038-.13-.04-.128-.04-.126-.041-.124-.042-.122-.042-.12-.044-.117-.043-.116-.045-.113-.045-.112-.046-.109-.047-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.05-.093-.052-.09-.051-.087-.052-.085-.053-.083-.054-.08-.054-.077-.054v4.127zm0-5.654v.011l.001.021.003.021.004.021.005.022.006.022.007.022.009.022.01.022.011.023.012.023.013.023.015.024.016.023.017.024.018.024.019.024.021.024.022.024.023.025.024.024.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.052.11.051.114.051.119.052.123.05.127.051.131.05.135.049.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.044.171.042.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.022.23.02.233.018.236.016.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.012.241-.015.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.048.139-.05.136-.049.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.051.051-.049.023-.025.023-.024.021-.025.02-.024.019-.024.018-.024.017-.024.015-.023.014-.023.013-.024.012-.022.01-.023.01-.023.008-.022.006-.022.006-.022.004-.021.004-.022.001-.021.001-.021v-4.139l-.077.054-.08.054-.083.054-.085.052-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.044-.118.044-.12.044-.122.042-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.035-.143.033-.144.033-.147.033-.148.031-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.009-.179.009-.179.007-.181.007-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.007-.179-.007-.179-.009-.178-.009-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.031-.146-.033-.145-.033-.143-.033-.141-.035-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.04-.126-.041-.124-.042-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.051-.093-.051-.09-.051-.087-.053-.085-.052-.083-.054-.08-.054-.077-.054v4.139zm0-5.666v.011l.001.02.003.022.004.021.005.022.006.021.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.024.018.023.019.024.021.025.022.024.023.024.024.025.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.051.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.043.171.043.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.021.23.02.233.018.236.017.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.013.241-.014.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.049.139-.049.136-.049.131-.051.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.049.023-.025.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.022.01-.023.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.153l-.077.054-.08.054-.083.053-.085.053-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.048-.105.048-.106.048-.109.046-.111.046-.114.046-.115.044-.118.044-.12.043-.122.043-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.034-.143.034-.144.033-.147.032-.148.032-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.024-.161.024-.162.023-.163.023-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.01-.178.01-.179.009-.179.007-.181.006-.182.006-.182.004-.184.003-.184.001-.185.001-.185-.001-.184-.001-.184-.003-.182-.004-.182-.006-.181-.006-.179-.007-.179-.009-.178-.01-.176-.01-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.023-.162-.023-.161-.024-.159-.024-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.032-.146-.032-.145-.033-.143-.034-.141-.034-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.041-.126-.041-.124-.041-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.048-.105-.048-.102-.048-.1-.05-.097-.049-.095-.051-.093-.051-.09-.052-.087-.052-.085-.053-.083-.053-.08-.054-.077-.054v4.153zm8.74-8.179l-.257.004-.254.005-.25.008-.247.011-.244.012-.241.014-.237.016-.233.018-.231.021-.226.022-.224.023-.22.026-.216.027-.212.028-.21.031-.205.032-.202.033-.198.034-.194.036-.191.038-.187.038-.183.04-.179.041-.175.042-.172.043-.168.043-.163.045-.16.046-.155.046-.152.048-.148.048-.143.048-.139.049-.136.05-.131.05-.126.051-.123.051-.118.051-.114.052-.11.052-.106.052-.101.052-.096.052-.092.052-.088.052-.083.052-.079.052-.074.051-.07.052-.065.051-.06.05-.056.05-.051.05-.023.025-.023.024-.021.024-.02.025-.019.024-.018.024-.017.023-.015.024-.014.023-.013.023-.012.023-.01.023-.01.022-.008.022-.006.023-.006.021-.004.022-.004.021-.001.021-.001.021.001.021.001.021.004.021.004.022.006.021.006.023.008.022.01.022.01.023.012.023.013.023.014.023.015.024.017.023.018.024.019.024.02.025.021.024.023.024.023.025.051.05.056.05.06.05.065.051.07.052.074.051.079.052.083.052.088.052.092.052.096.052.101.052.106.052.11.052.114.052.118.051.123.051.126.051.131.05.136.05.139.049.143.048.148.048.152.048.155.046.16.046.163.045.168.043.172.043.175.042.179.041.183.04.187.038.191.038.194.036.198.034.202.033.205.032.21.031.212.028.216.027.22.026.224.023.226.022.231.021.233.018.237.016.241.014.244.012.247.011.25.008.254.005.257.004.26.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.022.224-.023.22-.026.216-.027.212-.028.21-.031.205-.032.202-.033.198-.034.194-.036.191-.038.187-.038.183-.04.179-.041.175-.042.172-.043.168-.043.163-.045.16-.046.155-.046.152-.048.148-.048.143-.048.139-.049.136-.05.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.05.051-.05.023-.025.023-.024.021-.024.02-.025.019-.024.018-.024.017-.023.015-.024.014-.023.013-.023.012-.023.01-.023.01-.022.008-.022.006-.023.006-.021.004-.022.004-.021.001-.021.001-.021-.001-.021-.001-.021-.004-.021-.004-.022-.006-.021-.006-.023-.008-.022-.01-.022-.01-.023-.012-.023-.013-.023-.014-.023-.015-.024-.017-.023-.018-.024-.019-.024-.02-.025-.021-.024-.023-.024-.023-.025-.051-.05-.056-.05-.06-.05-.065-.051-.07-.052-.074-.051-.079-.052-.083-.052-.088-.052-.092-.052-.096-.052-.101-.052-.106-.052-.11-.052-.114-.052-.118-.051-.123-.051-.126-.051-.131-.05-.136-.05-.139-.049-.143-.048-.148-.048-.152-.048-.155-.046-.16-.046-.163-.045-.168-.043-.172-.043-.175-.042-.179-.041-.183-.04-.187-.038-.191-.038-.194-.036-.198-.034-.202-.033-.205-.032-.21-.031-.212-.028-.216-.027-.22-.026-.224-.023-.226-.022-.231-.021-.233-.018-.237-.016-.241-.014-.244-.012-.247-.011-.25-.008-.254-.005-.257-.004-.26-.001-.26.001z")},"insertDatabaseIcon"),Je=u(function(e){e.append("defs").append("symbol").attr("id","computer").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M2 2v13h20v-13h-20zm18 11h-16v-9h16v9zm-10.228 6l.466-1h3.524l.467 1h-4.457zm14.228 3h-24l2-6h2.104l-1.33 4h18.45l-1.297-4h2.073l2 6zm-5-10h-14v-7h14v7z")},"insertComputerIcon"),Ze=u(function(e){e.append("defs").append("symbol").attr("id","clock").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M12 2c5.514 0 10 4.486 10 10s-4.486 10-10 10-10-4.486-10-10 4.486-10 10-10zm0-2c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm5.848 12.459c.202.038.202.333.001.372-1.907.361-6.045 1.111-6.547 1.111-.719 0-1.301-.582-1.301-1.301 0-.512.77-5.447 1.125-7.445.034-.192.312-.181.343.014l.985 6.238 5.394 1.011z")},"insertClockIcon"),Qe=u(function(e){e.append("defs").append("marker").attr("id","arrowhead").attr("refX",7.9).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto-start-reverse").append("path").attr("d","M -1 0 L 10 5 L 0 10 z")},"insertArrowHead"),je=u(function(e){e.append("defs").append("marker").attr("id","filled-head").attr("refX",15.5).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"insertArrowFilledHead"),$e=u(function(e){e.append("defs").append("marker").attr("id","sequencenumber").attr("refX",15).attr("refY",15).attr("markerWidth",60).attr("markerHeight",40).attr("orient","auto").append("circle").attr("cx",15).attr("cy",15).attr("r",6)},"insertSequenceNumber"),ts=u(function(e){e.append("defs").append("marker").attr("id","crosshead").attr("markerWidth",15).attr("markerHeight",8).attr("orient","auto").attr("refX",4).attr("refY",4.5).append("path").attr("fill","none").attr("stroke","#000000").style("stroke-dasharray","0, 0").attr("stroke-width","1pt").attr("d","M 1,2 L 6,7 M 6,2 L 1,7")},"insertArrowCrossHead"),re=u(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"),es=u(function(){return{x:0,y:0,fill:"#EDF2AE",stroke:"#666",width:100,anchor:"start",height:100,rx:0,ry:0}},"getNoteRect"),Ft=function(){function e(i,n,h,d,r,f,E){const g=n.append("text").attr("x",h+r/2).attr("y",d+f/2+5).style("text-anchor","middle").text(i);a(g,E)}u(e,"byText");function t(i,n,h,d,r,f,E,g){const{actorFontSize:T,actorFontFamily:m,actorFontWeight:w}=g,[A,O]=Qt(T),S=i.split(I.lineBreakRegex);for(let B=0;B<S.length;B++){const D=B*A-A*(S.length-1)/2,F=n.append("text").attr("x",h+r/2).attr("y",d).style("text-anchor","middle").style("font-size",O).style("font-weight",w).style("font-family",m);F.append("tspan").attr("x",h+r/2).attr("dy",D).text(S[B]),F.attr("y",d+f/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),a(F,E)}}u(t,"byTspan");function c(i,n,h,d,r,f,E,g){const T=n.append("switch"),w=T.append("foreignObject").attr("x",h).attr("y",d).attr("width",r).attr("height",f).append("xhtml:div").style("display","table").style("height","100%").style("width","100%");w.append("div").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(i),t(i,T,h,d,r,f,E,g),a(w,E)}u(c,"byFo");async function s(i,n,h,d,r,f,E,g){const T=await bt(i,Ct()),m=n.append("switch"),A=m.append("foreignObject").attr("x",h+r/2-T.width/2).attr("y",d+f/2-T.height/2).attr("width",T.width).attr("height",T.height).append("xhtml:div").style("height","100%").style("width","100%");A.append("div").style("text-align","center").style("vertical-align","middle").html(await jt(i,Ct())),t(i,m,h,d,r,f,E,g),a(A,E)}u(s,"byKatex");function a(i,n){for(const h in n)n.hasOwnProperty(h)&&i.attr(h,n[h])}return u(a,"_setTextAttrs"),function(i,n=!1){return n?s:i.textPlacement==="fo"?c:i.textPlacement==="old"?e:t}}(),ss=function(){function e(a,i,n,h,d,r,f){const E=i.append("text").attr("x",n).attr("y",h).style("text-anchor","start").text(a);s(E,f)}u(e,"byText");function t(a,i,n,h,d,r,f,E){const{actorFontSize:g,actorFontFamily:T,actorFontWeight:m}=E,w=a.split(I.lineBreakRegex);for(let A=0;A<w.length;A++){const O=A*g-g*(w.length-1)/2,S=i.append("text").attr("x",n).attr("y",h).style("text-anchor","start").style("font-size",g).style("font-weight",m).style("font-family",T);S.append("tspan").attr("x",n).attr("dy",O).text(w[A]),S.attr("y",h+r/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),s(S,f)}}u(t,"byTspan");function c(a,i,n,h,d,r,f,E){const g=i.append("switch"),m=g.append("foreignObject").attr("x",n).attr("y",h).attr("width",d).attr("height",r).append("xhtml:div").style("display","table").style("height","100%").style("width","100%");m.append("div").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(a),t(a,g,n,h,d,r,f,E),s(m,f)}u(c,"byFo");function s(a,i){for(const n in i)i.hasOwnProperty(n)&&a.attr(n,i[n])}return u(s,"_setTextAttrs"),function(a){return a.textPlacement==="fo"?c:a.textPlacement==="old"?e:t}}(),C={drawRect:Wt,drawText:yt,drawLabel:ee,drawActor:ze,drawBox:He,drawPopup:Ye,anchorElement:Ke,drawActivation:Ue,drawLoop:Ge,drawBackgroundRect:ae,insertArrowHead:Qe,insertArrowFilledHead:je,insertSequenceNumber:$e,insertArrowCrossHead:ts,insertDatabaseIcon:Xe,insertComputerIcon:Je,insertClockIcon:Ze,getTextObj:re,getNoteRect:es,fixLifeLineHeights:se,sanitizeUrl:Zt.sanitizeUrl},o={},x={data:{startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},verticalPos:0,sequenceItems:[],activations:[],models:{getHeight:u(function(){return Math.max.apply(null,this.actors.length===0?[0]:this.actors.map(e=>e.height||0))+(this.loops.length===0?0:this.loops.map(e=>e.height||0).reduce((e,t)=>e+t))+(this.messages.length===0?0:this.messages.map(e=>e.height||0).reduce((e,t)=>e+t))+(this.notes.length===0?0:this.notes.map(e=>e.height||0).reduce((e,t)=>e+t))},"getHeight"),clear:u(function(){this.actors=[],this.boxes=[],this.loops=[],this.messages=[],this.notes=[]},"clear"),addBox:u(function(e){this.boxes.push(e)},"addBox"),addActor:u(function(e){this.actors.push(e)},"addActor"),addLoop:u(function(e){this.loops.push(e)},"addLoop"),addMessage:u(function(e){this.messages.push(e)},"addMessage"),addNote:u(function(e){this.notes.push(e)},"addNote"),lastActor:u(function(){return this.actors[this.actors.length-1]},"lastActor"),lastLoop:u(function(){return this.loops[this.loops.length-1]},"lastLoop"),lastMessage:u(function(){return this.messages[this.messages.length-1]},"lastMessage"),lastNote:u(function(){return this.notes[this.notes.length-1]},"lastNote"),actors:[],boxes:[],loops:[],messages:[],notes:[]},init:u(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,oe($())},"init"),updateVal:u(function(e,t,c,s){e[t]===void 0?e[t]=c:e[t]=s(c,e[t])},"updateVal"),updateBounds:u(function(e,t,c,s){const a=this;let i=0;function n(h){return u(function(r){i++;const f=a.sequenceItems.length-i+1;a.updateVal(r,"starty",t-f*o.boxMargin,Math.min),a.updateVal(r,"stopy",s+f*o.boxMargin,Math.max),a.updateVal(x.data,"startx",e-f*o.boxMargin,Math.min),a.updateVal(x.data,"stopx",c+f*o.boxMargin,Math.max),h!=="activation"&&(a.updateVal(r,"startx",e-f*o.boxMargin,Math.min),a.updateVal(r,"stopx",c+f*o.boxMargin,Math.max),a.updateVal(x.data,"starty",t-f*o.boxMargin,Math.min),a.updateVal(x.data,"stopy",s+f*o.boxMargin,Math.max))},"updateItemBounds")}u(n,"updateFn"),this.sequenceItems.forEach(n()),this.activations.forEach(n("activation"))},"updateBounds"),insert:u(function(e,t,c,s){const a=I.getMin(e,c),i=I.getMax(e,c),n=I.getMin(t,s),h=I.getMax(t,s);this.updateVal(x.data,"startx",a,Math.min),this.updateVal(x.data,"starty",n,Math.min),this.updateVal(x.data,"stopx",i,Math.max),this.updateVal(x.data,"stopy",h,Math.max),this.updateBounds(a,n,i,h)},"insert"),newActivation:u(function(e,t,c){const s=c.get(e.from),a=kt(e.from).length||0,i=s.x+s.width/2+(a-1)*o.activationWidth/2;this.activations.push({startx:i,starty:this.verticalPos+2,stopx:i+o.activationWidth,stopy:void 0,actor:e.from,anchored:C.anchorElement(t)})},"newActivation"),endActivation:u(function(e){const t=this.activations.map(function(c){return c.actor}).lastIndexOf(e.from);return this.activations.splice(t,1)[0]},"endActivation"),createLoop:u(function(e={message:void 0,wrap:!1,width:void 0},t){return{startx:void 0,starty:this.verticalPos,stopx:void 0,stopy:void 0,title:e.message,wrap:e.wrap,width:e.width,height:0,fill:t}},"createLoop"),newLoop:u(function(e={message:void 0,wrap:!1,width:void 0},t){this.sequenceItems.push(this.createLoop(e,t))},"newLoop"),endLoop:u(function(){return this.sequenceItems.pop()},"endLoop"),isLoopOverlap:u(function(){return this.sequenceItems.length?this.sequenceItems[this.sequenceItems.length-1].overlap:!1},"isLoopOverlap"),addSectionToLoop:u(function(e){const t=this.sequenceItems.pop();t.sections=t.sections||[],t.sectionTitles=t.sectionTitles||[],t.sections.push({y:x.getVerticalPos(),height:0}),t.sectionTitles.push(e),this.sequenceItems.push(t)},"addSectionToLoop"),saveVerticalPos:u(function(){this.isLoopOverlap()&&(this.savedVerticalPos=this.verticalPos)},"saveVerticalPos"),resetVerticalPos:u(function(){this.isLoopOverlap()&&(this.verticalPos=this.savedVerticalPos)},"resetVerticalPos"),bumpVerticalPos:u(function(e){this.verticalPos=this.verticalPos+e,this.data.stopy=I.getMax(this.data.stopy,this.verticalPos)},"bumpVerticalPos"),getVerticalPos:u(function(){return this.verticalPos},"getVerticalPos"),getBounds:u(function(){return{bounds:this.data,models:this.models}},"getBounds")},as=u(async function(e,t){x.bumpVerticalPos(o.boxMargin),t.height=o.boxMargin,t.starty=x.getVerticalPos();const c=At();c.x=t.startx,c.y=t.starty,c.width=t.width||o.width,c.class="note";const s=e.append("g"),a=C.drawRect(s,c),i=Yt();i.x=t.startx,i.y=t.starty,i.width=c.width,i.dy="1em",i.text=t.message,i.class="noteText",i.fontFamily=o.noteFontFamily,i.fontSize=o.noteFontSize,i.fontWeight=o.noteFontWeight,i.anchor=o.noteAlign,i.textMargin=o.noteMargin,i.valign="center";const n=ot(i.text)?await Pt(s,i):yt(s,i),h=Math.round(n.map(d=>(d._groups||d)[0][0].getBBox().height).reduce((d,r)=>d+r));a.attr("height",h+2*o.noteMargin),t.height+=h+2*o.noteMargin,x.bumpVerticalPos(h+2*o.noteMargin),t.stopy=t.starty+h+2*o.noteMargin,t.stopx=t.startx+c.width,x.insert(t.startx,t.starty,t.stopx,t.stopy),x.models.addNote(t)},"drawNote"),gt=u(e=>({fontFamily:e.messageFontFamily,fontSize:e.messageFontSize,fontWeight:e.messageFontWeight}),"messageFont"),xt=u(e=>({fontFamily:e.noteFontFamily,fontSize:e.noteFontSize,fontWeight:e.noteFontWeight}),"noteFont"),Bt=u(e=>({fontFamily:e.actorFontFamily,fontSize:e.actorFontSize,fontWeight:e.actorFontWeight}),"actorFont");async function ie(e,t){x.bumpVerticalPos(10);const{startx:c,stopx:s,message:a}=t,i=I.splitBreaks(a).length,n=ot(a),h=n?await bt(a,$()):Y.calculateTextDimensions(a,gt(o));if(!n){const E=h.height/i;t.height+=E,x.bumpVerticalPos(E)}let d,r=h.height-10;const f=h.width;if(c===s){d=x.getVerticalPos()+r,o.rightAngles||(r+=o.boxMargin,d=x.getVerticalPos()+r),r+=30;const E=I.getMax(f/2,o.width/2);x.insert(c-E,x.getVerticalPos()-10+r,s+E,x.getVerticalPos()+30+r)}else r+=o.boxMargin,d=x.getVerticalPos()+r,x.insert(c,d-10,s,d);return x.bumpVerticalPos(r),t.height+=r,t.stopy=t.starty+t.height,x.insert(t.fromBounds,t.starty,t.toBounds,t.stopy),d}u(ie,"boundMessage");var rs=u(async function(e,t,c,s){const{startx:a,stopx:i,starty:n,message:h,type:d,sequenceIndex:r,sequenceVisible:f}=t,E=Y.calculateTextDimensions(h,gt(o)),g=Yt();g.x=a,g.y=n+10,g.width=i-a,g.class="messageText",g.dy="1em",g.text=h,g.fontFamily=o.messageFontFamily,g.fontSize=o.messageFontSize,g.fontWeight=o.messageFontWeight,g.anchor=o.messageAlign,g.valign="center",g.textMargin=o.wrapPadding,g.tspan=!1,ot(g.text)?await Pt(e,g,{startx:a,stopx:i,starty:c}):yt(e,g);const T=E.width;let m;a===i?o.rightAngles?m=e.append("path").attr("d",`M ${a},${c} H ${a+I.getMax(o.width/2,T/2)} V ${c+25} H ${a}`):m=e.append("path").attr("d","M "+a+","+c+" C "+(a+60)+","+(c-10)+" "+(a+60)+","+(c+30)+" "+a+","+(c+20)):(m=e.append("line"),m.attr("x1",a),m.attr("y1",c),m.attr("x2",i),m.attr("y2",c)),d===s.db.LINETYPE.DOTTED||d===s.db.LINETYPE.DOTTED_CROSS||d===s.db.LINETYPE.DOTTED_POINT||d===s.db.LINETYPE.DOTTED_OPEN||d===s.db.LINETYPE.BIDIRECTIONAL_DOTTED?(m.style("stroke-dasharray","3, 3"),m.attr("class","messageLine1")):m.attr("class","messageLine0");let w="";o.arrowMarkerAbsolute&&(w=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,w=w.replace(/\(/g,"\\("),w=w.replace(/\)/g,"\\)")),m.attr("stroke-width",2),m.attr("stroke","none"),m.style("fill","none"),(d===s.db.LINETYPE.SOLID||d===s.db.LINETYPE.DOTTED)&&m.attr("marker-end","url("+w+"#arrowhead)"),(d===s.db.LINETYPE.BIDIRECTIONAL_SOLID||d===s.db.LINETYPE.BIDIRECTIONAL_DOTTED)&&(m.attr("marker-start","url("+w+"#arrowhead)"),m.attr("marker-end","url("+w+"#arrowhead)")),(d===s.db.LINETYPE.SOLID_POINT||d===s.db.LINETYPE.DOTTED_POINT)&&m.attr("marker-end","url("+w+"#filled-head)"),(d===s.db.LINETYPE.SOLID_CROSS||d===s.db.LINETYPE.DOTTED_CROSS)&&m.attr("marker-end","url("+w+"#crosshead)"),(f||o.showSequenceNumbers)&&(m.attr("marker-start","url("+w+"#sequencenumber)"),e.append("text").attr("x",a).attr("y",c+4).attr("font-family","sans-serif").attr("font-size","12px").attr("text-anchor","middle").attr("class","sequenceNumber").text(r))},"drawMessage"),is=u(function(e,t,c,s,a,i,n){let h=0,d=0,r,f=0;for(const E of s){const g=t.get(E),T=g.box;r&&r!=T&&(n||x.models.addBox(r),d+=o.boxMargin+r.margin),T&&T!=r&&(n||(T.x=h+d,T.y=a),d+=T.margin),g.width=g.width||o.width,g.height=I.getMax(g.height||o.height,o.height),g.margin=g.margin||o.actorMargin,f=I.getMax(f,g.height),c.get(g.name)&&(d+=g.width/2),g.x=h+d,g.starty=x.getVerticalPos(),x.insert(g.x,a,g.x+g.width,g.height),h+=g.width+d,g.box&&(g.box.width=h+T.margin-g.box.x),d=g.margin,r=g.box,x.models.addActor(g)}r&&!n&&x.models.addBox(r),x.bumpVerticalPos(f)},"addActorRenderingData"),Vt=u(async function(e,t,c,s){if(s){let a=0;x.bumpVerticalPos(o.boxMargin*2);for(const i of c){const n=t.get(i);n.stopy||(n.stopy=x.getVerticalPos());const h=await C.drawActor(e,n,o,!0);a=I.getMax(a,h)}x.bumpVerticalPos(a+o.boxMargin)}else for(const a of c){const i=t.get(a);await C.drawActor(e,i,o,!1)}},"drawActors"),ne=u(function(e,t,c,s){let a=0,i=0;for(const n of c){const h=t.get(n),d=os(h),r=C.drawPopup(e,h,d,o,o.forceMenus,s);r.height>a&&(a=r.height),r.width+h.x>i&&(i=r.width+h.x)}return{maxHeight:a,maxWidth:i}},"drawActorsPopup"),oe=u(function(e){ve(o,e),e.fontFamily&&(o.actorFontFamily=o.noteFontFamily=o.messageFontFamily=e.fontFamily),e.fontSize&&(o.actorFontSize=o.noteFontSize=o.messageFontSize=e.fontSize),e.fontWeight&&(o.actorFontWeight=o.noteFontWeight=o.messageFontWeight=e.fontWeight)},"setConf"),kt=u(function(e){return x.activations.filter(function(t){return t.actor===e})},"actorActivations"),Jt=u(function(e,t){const c=t.get(e),s=kt(e),a=s.reduce(function(n,h){return I.getMin(n,h.startx)},c.x+c.width/2-1),i=s.reduce(function(n,h){return I.getMax(n,h.stopx)},c.x+c.width/2+1);return[a,i]},"activationBounds");function rt(e,t,c,s,a){x.bumpVerticalPos(c);let i=s;if(t.id&&t.message&&e[t.id]){const n=e[t.id].width,h=gt(o);t.message=Y.wrapLabel(`[${t.message}]`,n-2*o.wrapPadding,h),t.width=n,t.wrap=!0;const d=Y.calculateTextDimensions(t.message,h),r=I.getMax(d.height,o.labelBoxHeight);i=s+r,G.debug(`${r} - ${t.message}`)}a(t),x.bumpVerticalPos(i)}u(rt,"adjustLoopHeightForWrap");function ce(e,t,c,s,a,i,n){function h(r,f){r.x<a.get(e.from).x?(x.insert(t.stopx-f,t.starty,t.startx,t.stopy+r.height/2+o.noteMargin),t.stopx=t.stopx+f):(x.insert(t.startx,t.starty,t.stopx+f,t.stopy+r.height/2+o.noteMargin),t.stopx=t.stopx-f)}u(h,"receiverAdjustment");function d(r,f){r.x<a.get(e.to).x?(x.insert(t.startx-f,t.starty,t.stopx,t.stopy+r.height/2+o.noteMargin),t.startx=t.startx+f):(x.insert(t.stopx,t.starty,t.startx+f,t.stopy+r.height/2+o.noteMargin),t.startx=t.startx-f)}if(u(d,"senderAdjustment"),i.get(e.to)==s){const r=a.get(e.to),f=r.type=="actor"?ut/2+3:r.width/2+3;h(r,f),r.starty=c-r.height/2,x.bumpVerticalPos(r.height/2)}else if(n.get(e.from)==s){const r=a.get(e.from);if(o.mirrorActors){const f=r.type=="actor"?ut/2:r.width/2;d(r,f)}r.stopy=c-r.height/2,x.bumpVerticalPos(r.height/2)}else if(n.get(e.to)==s){const r=a.get(e.to);if(o.mirrorActors){const f=r.type=="actor"?ut/2+3:r.width/2+3;h(r,f)}r.stopy=c-r.height/2,x.bumpVerticalPos(r.height/2)}}u(ce,"adjustCreatedDestroyedData");var ns=u(async function(e,t,c,s){const{securityLevel:a,sequence:i}=$();o=i;let n;a==="sandbox"&&(n=Lt("#i"+t));const h=a==="sandbox"?Lt(n.nodes()[0].contentDocument.body):Lt("body"),d=a==="sandbox"?n.nodes()[0].contentDocument:document;x.init(),G.debug(s.db);const r=a==="sandbox"?h.select(`[id="${t}"]`):Lt(`[id="${t}"]`),f=s.db.getActors(),E=s.db.getCreatedActors(),g=s.db.getDestroyedActors(),T=s.db.getBoxes();let m=s.db.getActorKeys();const w=s.db.getMessages(),A=s.db.getDiagramTitle(),O=s.db.hasAtLeastOneBox(),S=s.db.hasAtLeastOneBoxWithTitle(),B=await le(f,w,s);if(o.height=await he(f,B,T),C.insertComputerIcon(r),C.insertDatabaseIcon(r),C.insertClockIcon(r),O&&(x.bumpVerticalPos(o.boxMargin),S&&x.bumpVerticalPos(T[0].textMaxHeight)),o.hideUnusedParticipants===!0){const y=new Set;w.forEach(_=>{y.add(_.from),y.add(_.to)}),m=m.filter(_=>y.has(_))}is(r,f,E,m,0,w,!1);const D=await hs(w,f,B,s);C.insertArrowHead(r),C.insertArrowCrossHead(r),C.insertArrowFilledHead(r),C.insertSequenceNumber(r);function F(y,_){const Q=x.endActivation(y);Q.starty+18>_&&(Q.starty=_-6,_+=12),C.drawActivation(r,Q,_,o,kt(y.from).length),x.insert(Q.startx,_-10,Q.stopx,_)}u(F,"activeEnd");let q=1,X=1;const tt=[],z=[];let H=0;for(const y of w){let _,Q,at;switch(y.type){case s.db.LINETYPE.NOTE:x.resetVerticalPos(),Q=y.noteModel,await as(r,Q);break;case s.db.LINETYPE.ACTIVE_START:x.newActivation(y,r,f);break;case s.db.LINETYPE.ACTIVE_END:F(y,x.getVerticalPos());break;case s.db.LINETYPE.LOOP_START:rt(D,y,o.boxMargin,o.boxMargin+o.boxTextMargin,k=>x.newLoop(k));break;case s.db.LINETYPE.LOOP_END:_=x.endLoop(),await C.drawLoop(r,_,"loop",o),x.bumpVerticalPos(_.stopy-x.getVerticalPos()),x.models.addLoop(_);break;case s.db.LINETYPE.RECT_START:rt(D,y,o.boxMargin,o.boxMargin,k=>x.newLoop(void 0,k.message));break;case s.db.LINETYPE.RECT_END:_=x.endLoop(),z.push(_),x.models.addLoop(_),x.bumpVerticalPos(_.stopy-x.getVerticalPos());break;case s.db.LINETYPE.OPT_START:rt(D,y,o.boxMargin,o.boxMargin+o.boxTextMargin,k=>x.newLoop(k));break;case s.db.LINETYPE.OPT_END:_=x.endLoop(),await C.drawLoop(r,_,"opt",o),x.bumpVerticalPos(_.stopy-x.getVerticalPos()),x.models.addLoop(_);break;case s.db.LINETYPE.ALT_START:rt(D,y,o.boxMargin,o.boxMargin+o.boxTextMargin,k=>x.newLoop(k));break;case s.db.LINETYPE.ALT_ELSE:rt(D,y,o.boxMargin+o.boxTextMargin,o.boxMargin,k=>x.addSectionToLoop(k));break;case s.db.LINETYPE.ALT_END:_=x.endLoop(),await C.drawLoop(r,_,"alt",o),x.bumpVerticalPos(_.stopy-x.getVerticalPos()),x.models.addLoop(_);break;case s.db.LINETYPE.PAR_START:case s.db.LINETYPE.PAR_OVER_START:rt(D,y,o.boxMargin,o.boxMargin+o.boxTextMargin,k=>x.newLoop(k)),x.saveVerticalPos();break;case s.db.LINETYPE.PAR_AND:rt(D,y,o.boxMargin+o.boxTextMargin,o.boxMargin,k=>x.addSectionToLoop(k));break;case s.db.LINETYPE.PAR_END:_=x.endLoop(),await C.drawLoop(r,_,"par",o),x.bumpVerticalPos(_.stopy-x.getVerticalPos()),x.models.addLoop(_);break;case s.db.LINETYPE.AUTONUMBER:q=y.message.start||q,X=y.message.step||X,y.message.visible?s.db.enableSequenceNumbers():s.db.disableSequenceNumbers();break;case s.db.LINETYPE.CRITICAL_START:rt(D,y,o.boxMargin,o.boxMargin+o.boxTextMargin,k=>x.newLoop(k));break;case s.db.LINETYPE.CRITICAL_OPTION:rt(D,y,o.boxMargin+o.boxTextMargin,o.boxMargin,k=>x.addSectionToLoop(k));break;case s.db.LINETYPE.CRITICAL_END:_=x.endLoop(),await C.drawLoop(r,_,"critical",o),x.bumpVerticalPos(_.stopy-x.getVerticalPos()),x.models.addLoop(_);break;case s.db.LINETYPE.BREAK_START:rt(D,y,o.boxMargin,o.boxMargin+o.boxTextMargin,k=>x.newLoop(k));break;case s.db.LINETYPE.BREAK_END:_=x.endLoop(),await C.drawLoop(r,_,"break",o),x.bumpVerticalPos(_.stopy-x.getVerticalPos()),x.models.addLoop(_);break;default:try{at=y.msgModel,at.starty=x.getVerticalPos(),at.sequenceIndex=q,at.sequenceVisible=s.db.showSequenceNumbers();const k=await ie(r,at);ce(y,at,k,H,f,E,g),tt.push({messageModel:at,lineStartY:k}),x.models.addMessage(at)}catch(k){G.error("error while drawing message",k)}}[s.db.LINETYPE.SOLID_OPEN,s.db.LINETYPE.DOTTED_OPEN,s.db.LINETYPE.SOLID,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(y.type)&&(q=q+X),H++}G.debug("createdActors",E),G.debug("destroyedActors",g),await Vt(r,f,m,!1);for(const y of tt)await rs(r,y.messageModel,y.lineStartY,s);o.mirrorActors&&await Vt(r,f,m,!0),z.forEach(y=>C.drawBackgroundRect(r,y)),se(r,f,m,o);for(const y of x.models.boxes)y.height=x.getVerticalPos()-y.y,x.insert(y.x,y.y,y.x+y.width,y.height),y.startx=y.x,y.starty=y.y,y.stopx=y.startx+y.width,y.stopy=y.starty+y.height,y.stroke="rgb(0,0,0, 0.5)",C.drawBox(r,y,o);O&&x.bumpVerticalPos(o.boxMargin);const W=ne(r,f,m,d),{bounds:M}=x.getBounds();M.startx===void 0&&(M.startx=0),M.starty===void 0&&(M.starty=0),M.stopx===void 0&&(M.stopx=0),M.stopy===void 0&&(M.stopy=0);let J=M.stopy-M.starty;J<W.maxHeight&&(J=W.maxHeight);let K=J+2*o.diagramMarginY;o.mirrorActors&&(K=K-o.boxMargin+o.bottomMarginAdj);let Z=M.stopx-M.startx;Z<W.maxWidth&&(Z=W.maxWidth);const et=Z+2*o.diagramMarginX;A&&r.append("text").text(A).attr("x",(M.stopx-M.startx)/2-2*o.diagramMarginX).attr("y",-25),we(r,K,et,o.useMaxWidth);const N=A?40:0;r.attr("viewBox",M.startx-o.diagramMarginX+" -"+(o.diagramMarginY+N)+" "+et+" "+(K+N)),G.debug("models:",x.models)},"draw");async function le(e,t,c){const s={};for(const a of t)if(e.get(a.to)&&e.get(a.from)){const i=e.get(a.to);if(a.placement===c.db.PLACEMENT.LEFTOF&&!i.prevActor||a.placement===c.db.PLACEMENT.RIGHTOF&&!i.nextActor)continue;const n=a.placement!==void 0,h=!n,d=n?xt(o):gt(o),r=a.wrap?Y.wrapLabel(a.message,o.width-2*o.wrapPadding,d):a.message,E=(ot(r)?await bt(a.message,$()):Y.calculateTextDimensions(r,d)).width+2*o.wrapPadding;h&&a.from===i.nextActor?s[a.to]=I.getMax(s[a.to]||0,E):h&&a.from===i.prevActor?s[a.from]=I.getMax(s[a.from]||0,E):h&&a.from===a.to?(s[a.from]=I.getMax(s[a.from]||0,E/2),s[a.to]=I.getMax(s[a.to]||0,E/2)):a.placement===c.db.PLACEMENT.RIGHTOF?s[a.from]=I.getMax(s[a.from]||0,E):a.placement===c.db.PLACEMENT.LEFTOF?s[i.prevActor]=I.getMax(s[i.prevActor]||0,E):a.placement===c.db.PLACEMENT.OVER&&(i.prevActor&&(s[i.prevActor]=I.getMax(s[i.prevActor]||0,E/2)),i.nextActor&&(s[a.from]=I.getMax(s[a.from]||0,E/2)))}return G.debug("maxMessageWidthPerActor:",s),s}u(le,"getMaxMessageWidthPerActor");var os=u(function(e){let t=0;const c=Bt(o);for(const s in e.links){const i=Y.calculateTextDimensions(s,c).width+2*o.wrapPadding+2*o.boxMargin;t<i&&(t=i)}return t},"getRequiredPopupWidth");async function he(e,t,c){let s=0;for(const i of e.keys()){const n=e.get(i);n.wrap&&(n.description=Y.wrapLabel(n.description,o.width-2*o.wrapPadding,Bt(o)));const h=ot(n.description)?await bt(n.description,$()):Y.calculateTextDimensions(n.description,Bt(o));n.width=n.wrap?o.width:I.getMax(o.width,h.width+2*o.wrapPadding),n.height=n.wrap?I.getMax(h.height,o.height):o.height,s=I.getMax(s,n.height)}for(const i in t){const n=e.get(i);if(!n)continue;const h=e.get(n.nextActor);if(!h){const E=t[i]+o.actorMargin-n.width/2;n.margin=I.getMax(E,o.actorMargin);continue}const r=t[i]+o.actorMargin-n.width/2-h.width/2;n.margin=I.getMax(r,o.actorMargin)}let a=0;return c.forEach(i=>{const n=gt(o);let h=i.actorKeys.reduce((f,E)=>f+=e.get(E).width+(e.get(E).margin||0),0);h-=2*o.boxTextMargin,i.wrap&&(i.name=Y.wrapLabel(i.name,h-2*o.wrapPadding,n));const d=Y.calculateTextDimensions(i.name,n);a=I.getMax(d.height,a);const r=I.getMax(h,d.width+2*o.wrapPadding);if(i.margin=o.boxTextMargin,h<r){const f=(r-h)/2;i.margin+=f}}),c.forEach(i=>i.textMaxHeight=a),I.getMax(s,o.height)}u(he,"calculateActorMargins");var cs=u(async function(e,t,c){const s=t.get(e.from),a=t.get(e.to),i=s.x,n=a.x,h=e.wrap&&e.message;let d=ot(e.message)?await bt(e.message,$()):Y.calculateTextDimensions(h?Y.wrapLabel(e.message,o.width,xt(o)):e.message,xt(o));const r={width:h?o.width:I.getMax(o.width,d.width+2*o.noteMargin),height:0,startx:s.x,stopx:0,starty:0,stopy:0,message:e.message};return e.placement===c.db.PLACEMENT.RIGHTOF?(r.width=h?I.getMax(o.width,d.width):I.getMax(s.width/2+a.width/2,d.width+2*o.noteMargin),r.startx=i+(s.width+o.actorMargin)/2):e.placement===c.db.PLACEMENT.LEFTOF?(r.width=h?I.getMax(o.width,d.width+2*o.noteMargin):I.getMax(s.width/2+a.width/2,d.width+2*o.noteMargin),r.startx=i-r.width+(s.width-o.actorMargin)/2):e.to===e.from?(d=Y.calculateTextDimensions(h?Y.wrapLabel(e.message,I.getMax(o.width,s.width),xt(o)):e.message,xt(o)),r.width=h?I.getMax(o.width,s.width):I.getMax(s.width,o.width,d.width+2*o.noteMargin),r.startx=i+(s.width-r.width)/2):(r.width=Math.abs(i+s.width/2-(n+a.width/2))+o.actorMargin,r.startx=i<n?i+s.width/2-o.actorMargin/2:n+a.width/2-o.actorMargin/2),h&&(r.message=Y.wrapLabel(e.message,r.width-2*o.wrapPadding,xt(o))),G.debug(`NM:[${r.startx},${r.stopx},${r.starty},${r.stopy}:${r.width},${r.height}=${e.message}]`),r},"buildNoteModel"),ls=u(function(e,t,c){if(![c.db.LINETYPE.SOLID_OPEN,c.db.LINETYPE.DOTTED_OPEN,c.db.LINETYPE.SOLID,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))return{};const[s,a]=Jt(e.from,t),[i,n]=Jt(e.to,t),h=s<=i;let d=h?a:s,r=h?i:n;const f=Math.abs(i-n)>2,E=u(w=>h?-w:w,"adjustValue");e.from===e.to?r=d:(e.activate&&!f&&(r+=E(o.activationWidth/2-1)),[c.db.LINETYPE.SOLID_OPEN,c.db.LINETYPE.DOTTED_OPEN].includes(e.type)||(r+=E(3)),[c.db.LINETYPE.BIDIRECTIONAL_SOLID,c.db.LINETYPE.BIDIRECTIONAL_DOTTED].includes(e.type)&&(d-=E(3)));const g=[s,a,i,n],T=Math.abs(d-r);e.wrap&&e.message&&(e.message=Y.wrapLabel(e.message,I.getMax(T+2*o.wrapPadding,o.width),gt(o)));const m=Y.calculateTextDimensions(e.message,gt(o));return{width:I.getMax(e.wrap?0:m.width+2*o.wrapPadding,T+2*o.wrapPadding,o.width),height:0,startx:d,stopx:r,starty:0,stopy:0,message:e.message,type:e.type,wrap:e.wrap,fromBounds:Math.min.apply(null,g),toBounds:Math.max.apply(null,g)}},"buildMessageModel"),hs=u(async function(e,t,c,s){const a={},i=[];let n,h,d;for(const r of e){switch(r.type){case s.db.LINETYPE.LOOP_START:case s.db.LINETYPE.ALT_START:case s.db.LINETYPE.OPT_START:case s.db.LINETYPE.PAR_START:case s.db.LINETYPE.PAR_OVER_START:case s.db.LINETYPE.CRITICAL_START:case s.db.LINETYPE.BREAK_START:i.push({id:r.id,msg:r.message,from:Number.MAX_SAFE_INTEGER,to:Number.MIN_SAFE_INTEGER,width:0});break;case s.db.LINETYPE.ALT_ELSE:case s.db.LINETYPE.PAR_AND:case s.db.LINETYPE.CRITICAL_OPTION:r.message&&(n=i.pop(),a[n.id]=n,a[r.id]=n,i.push(n));break;case s.db.LINETYPE.LOOP_END:case s.db.LINETYPE.ALT_END:case s.db.LINETYPE.OPT_END:case s.db.LINETYPE.PAR_END:case s.db.LINETYPE.CRITICAL_END:case s.db.LINETYPE.BREAK_END:n=i.pop(),a[n.id]=n;break;case s.db.LINETYPE.ACTIVE_START:{const E=t.get(r.from?r.from:r.to.actor),g=kt(r.from?r.from:r.to.actor).length,T=E.x+E.width/2+(g-1)*o.activationWidth/2,m={startx:T,stopx:T+o.activationWidth,actor:r.from,enabled:!0};x.activations.push(m)}break;case s.db.LINETYPE.ACTIVE_END:{const E=x.activations.map(g=>g.actor).lastIndexOf(r.from);x.activations.splice(E,1).splice(0,1)}break}r.placement!==void 0?(h=await cs(r,t,s),r.noteModel=h,i.forEach(E=>{n=E,n.from=I.getMin(n.from,h.startx),n.to=I.getMax(n.to,h.startx+h.width),n.width=I.getMax(n.width,Math.abs(n.from-n.to))-o.labelBoxWidth})):(d=ls(r,t,s),r.msgModel=d,d.startx&&d.stopx&&i.length>0&&i.forEach(E=>{if(n=E,d.startx===d.stopx){const g=t.get(r.from),T=t.get(r.to);n.from=I.getMin(g.x-d.width/2,g.x-g.width/2,n.from),n.to=I.getMax(T.x+d.width/2,T.x+g.width/2,n.to),n.width=I.getMax(n.width,Math.abs(n.to-n.from))-o.labelBoxWidth}else n.from=I.getMin(d.startx,n.from),n.to=I.getMax(d.stopx,n.to),n.width=I.getMax(n.width,d.width)-o.labelBoxWidth}))}return x.activations=[],G.debug("Loop type widths:",a),a},"calculateLoopBounds"),ds={bounds:x,drawActors:Vt,drawActorsPopup:ne,setConf:oe,draw:ns},fs={parser:Se,get db(){return new Ce},renderer:ds,styles:Be,init:u(e=>{e.sequence||(e.sequence={}),e.wrap&&(e.sequence.wrap=e.wrap,me({sequence:{wrap:e.wrap}}))},"init")};export{fs as diagram};
@@ -0,0 +1 @@
1
+ import{s as W,a as P,S as N}from"./chunk-AEK57VVT-o_ViTLZT.js";import{_ as u,c as t,d as H,l as S,e as C,k as z,Q as U,R as F,u as O}from"./main.js";import{G as J}from"./graph-cCt1e4eU.js";import{l as X}from"./layout-DEspB-Nn.js";import"./chunk-RZ5BOZE2-csKhWZPs.js";import"./_baseUniq-BTllNErT.js";import"./_basePickBy-CCSZj2pA.js";var L={},D=u((e,i)=>{L[e]=i},"set"),Y=u(e=>L[e],"get"),A=u(()=>Object.keys(L),"keys"),I=u(()=>A().length,"size"),$={get:Y,set:D,keys:A,size:I},j=u(e=>e.append("circle").attr("class","start-state").attr("r",t().state.sizeUnit).attr("cx",t().state.padding+t().state.sizeUnit).attr("cy",t().state.padding+t().state.sizeUnit),"drawStartState"),q=u(e=>e.append("line").style("stroke","grey").style("stroke-dasharray","3").attr("x1",t().state.textHeight).attr("class","divider").attr("x2",t().state.textHeight*2).attr("y1",0).attr("y2",0),"drawDivider"),Q=u((e,i)=>{const d=e.append("text").attr("x",2*t().state.padding).attr("y",t().state.textHeight+2*t().state.padding).attr("font-size",t().state.fontSize).attr("class","state-title").text(i.id),o=d.node().getBBox();return e.insert("rect",":first-child").attr("x",t().state.padding).attr("y",t().state.padding).attr("width",o.width+2*t().state.padding).attr("height",o.height+2*t().state.padding).attr("rx",t().state.radius),d},"drawSimpleState"),Z=u((e,i)=>{const d=u(function(l,B,m){const k=l.append("tspan").attr("x",2*t().state.padding).text(B);m||k.attr("dy",t().state.textHeight)},"addTspan"),n=e.append("text").attr("x",2*t().state.padding).attr("y",t().state.textHeight+1.3*t().state.padding).attr("font-size",t().state.fontSize).attr("class","state-title").text(i.descriptions[0]).node().getBBox(),g=n.height,x=e.append("text").attr("x",t().state.padding).attr("y",g+t().state.padding*.4+t().state.dividerMargin+t().state.textHeight).attr("class","state-description");let a=!0,s=!0;i.descriptions.forEach(function(l){a||(d(x,l,s),s=!1),a=!1});const y=e.append("line").attr("x1",t().state.padding).attr("y1",t().state.padding+g+t().state.dividerMargin/2).attr("y2",t().state.padding+g+t().state.dividerMargin/2).attr("class","descr-divider"),p=x.node().getBBox(),c=Math.max(p.width,n.width);return y.attr("x2",c+3*t().state.padding),e.insert("rect",":first-child").attr("x",t().state.padding).attr("y",t().state.padding).attr("width",c+2*t().state.padding).attr("height",p.height+g+2*t().state.padding).attr("rx",t().state.radius),e},"drawDescrState"),K=u((e,i,d)=>{const o=t().state.padding,n=2*t().state.padding,g=e.node().getBBox(),x=g.width,a=g.x,s=e.append("text").attr("x",0).attr("y",t().state.titleShift).attr("font-size",t().state.fontSize).attr("class","state-title").text(i.id),p=s.node().getBBox().width+n;let c=Math.max(p,x);c===x&&(c=c+n);let l;const B=e.node().getBBox();i.doc,l=a-o,p>x&&(l=(x-c)/2+o),Math.abs(a-B.x)<o&&p>x&&(l=a-(p-x)/2);const m=1-t().state.textHeight;return e.insert("rect",":first-child").attr("x",l).attr("y",m).attr("class",d?"alt-composit":"composit").attr("width",c).attr("height",B.height+t().state.textHeight+t().state.titleShift+1).attr("rx","0"),s.attr("x",l+o),p<=x&&s.attr("x",a+(c-n)/2-p/2+o),e.insert("rect",":first-child").attr("x",l).attr("y",t().state.titleShift-t().state.textHeight-t().state.padding).attr("width",c).attr("height",t().state.textHeight*3).attr("rx",t().state.radius),e.insert("rect",":first-child").attr("x",l).attr("y",t().state.titleShift-t().state.textHeight-t().state.padding).attr("width",c).attr("height",B.height+3+2*t().state.textHeight).attr("rx",t().state.radius),e},"addTitleAndBox"),V=u(e=>(e.append("circle").attr("class","end-state-outer").attr("r",t().state.sizeUnit+t().state.miniPadding).attr("cx",t().state.padding+t().state.sizeUnit+t().state.miniPadding).attr("cy",t().state.padding+t().state.sizeUnit+t().state.miniPadding),e.append("circle").attr("class","end-state-inner").attr("r",t().state.sizeUnit).attr("cx",t().state.padding+t().state.sizeUnit+2).attr("cy",t().state.padding+t().state.sizeUnit+2)),"drawEndState"),tt=u((e,i)=>{let d=t().state.forkWidth,o=t().state.forkHeight;if(i.parentId){let n=d;d=o,o=n}return e.append("rect").style("stroke","black").style("fill","black").attr("width",d).attr("height",o).attr("x",t().state.padding).attr("y",t().state.padding)},"drawForkJoinState"),et=u((e,i,d,o)=>{let n=0;const g=o.append("text");g.style("text-anchor","start"),g.attr("class","noteText");let x=e.replace(/\r\n/g,"<br/>");x=x.replace(/\n/g,"<br/>");const a=x.split(z.lineBreakRegex);let s=1.25*t().state.noteMargin;for(const y of a){const p=y.trim();if(p.length>0){const c=g.append("tspan");if(c.text(p),s===0){const l=c.node().getBBox();s+=l.height}n+=s,c.attr("x",i+t().state.noteMargin),c.attr("y",d+n+1.25*t().state.noteMargin)}}return{textWidth:g.node().getBBox().width,textHeight:n}},"_drawLongText"),at=u((e,i)=>{i.attr("class","state-note");const d=i.append("rect").attr("x",0).attr("y",t().state.padding),o=i.append("g"),{textWidth:n,textHeight:g}=et(e,0,0,o);return d.attr("height",g+2*t().state.noteMargin),d.attr("width",n+t().state.noteMargin*2),d},"drawNote"),R=u(function(e,i){const d=i.id,o={id:d,label:i.id,width:0,height:0},n=e.append("g").attr("id",d).attr("class","stateGroup");i.type==="start"&&j(n),i.type==="end"&&V(n),(i.type==="fork"||i.type==="join")&&tt(n,i),i.type==="note"&&at(i.note.text,n),i.type==="divider"&&q(n),i.type==="default"&&i.descriptions.length===0&&Q(n,i),i.type==="default"&&i.descriptions.length>0&&Z(n,i);const g=n.node().getBBox();return o.width=g.width+2*t().state.padding,o.height=g.height+2*t().state.padding,$.set(d,o),o},"drawState"),_=0,it=u(function(e,i,d){const o=u(function(s){switch(s){case N.relationType.AGGREGATION:return"aggregation";case N.relationType.EXTENSION:return"extension";case N.relationType.COMPOSITION:return"composition";case N.relationType.DEPENDENCY:return"dependency"}},"getRelationType");i.points=i.points.filter(s=>!Number.isNaN(s.y));const n=i.points,g=U().x(function(s){return s.x}).y(function(s){return s.y}).curve(F),x=e.append("path").attr("d",g(n)).attr("id","edge"+_).attr("class","transition");let a="";if(t().state.arrowMarkerAbsolute&&(a=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,a=a.replace(/\(/g,"\\("),a=a.replace(/\)/g,"\\)")),x.attr("marker-end","url("+a+"#"+o(N.relationType.DEPENDENCY)+"End)"),d.title!==void 0){const s=e.append("g").attr("class","stateLabel"),{x:y,y:p}=O.calcLabelPosition(i.points),c=z.getRows(d.title);let l=0;const B=[];let m=0,k=0;for(let f=0;f<=c.length;f++){const h=s.append("text").attr("text-anchor","middle").text(c[f]).attr("x",y).attr("y",p+l),w=h.node().getBBox();m=Math.max(m,w.width),k=Math.min(k,w.x),S.info(w.x,y,p+l),l===0&&(l=h.node().getBBox().height,S.info("Title height",l,p)),B.push(h)}let E=l*c.length;if(c.length>1){const f=(c.length-1)*l*.5;B.forEach((h,w)=>h.attr("y",p+w*l-f)),E=l*c.length}const r=s.node().getBBox();s.insert("rect",":first-child").attr("class","box").attr("x",y-m/2-t().state.padding/2).attr("y",p-E/2-t().state.padding/2-3.5).attr("width",m+t().state.padding).attr("height",E+t().state.padding),S.info(r)}_++},"drawEdge"),b,T={},rt=u(function(){},"setConf"),nt=u(function(e){e.append("defs").append("marker").attr("id","dependencyEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"insertMarkers"),st=u(function(e,i,d,o){b=t().state;const n=t().securityLevel;let g;n==="sandbox"&&(g=H("#i"+i));const x=n==="sandbox"?H(g.nodes()[0].contentDocument.body):H("body"),a=n==="sandbox"?g.nodes()[0].contentDocument:document;S.debug("Rendering diagram "+e);const s=x.select(`[id='${i}']`);nt(s);const y=o.db.getRootDoc();G(y,s,void 0,!1,x,a,o);const p=b.padding,c=s.node().getBBox(),l=c.width+p*2,B=c.height+p*2,m=l*1.75;C(s,B,m,b.useMaxWidth),s.attr("viewBox",`${c.x-b.padding} ${c.y-b.padding} `+l+" "+B)},"draw"),dt=u(e=>e?e.length*b.fontSizeFactor:1,"getLabelWidth"),G=u((e,i,d,o,n,g,x)=>{const a=new J({compound:!0,multigraph:!0});let s,y=!0;for(s=0;s<e.length;s++)if(e[s].stmt==="relation"){y=!1;break}d?a.setGraph({rankdir:"LR",multigraph:!0,compound:!0,ranker:"tight-tree",ranksep:y?1:b.edgeLengthFactor,nodeSep:y?1:50,isMultiGraph:!0}):a.setGraph({rankdir:"TB",multigraph:!0,compound:!0,ranksep:y?1:b.edgeLengthFactor,nodeSep:y?1:50,ranker:"tight-tree",isMultiGraph:!0}),a.setDefaultEdgeLabel(function(){return{}});const p=x.db.getStates(),c=x.db.getRelations(),l=Object.keys(p);for(const r of l){const f=p[r];d&&(f.parentId=d);let h;if(f.doc){let w=i.append("g").attr("id",f.id).attr("class","stateGroup");h=G(f.doc,w,f.id,!o,n,g,x);{w=K(w,f,o);let v=w.node().getBBox();h.width=v.width,h.height=v.height+b.padding/2,T[f.id]={y:b.compositTitleSize}}}else h=R(i,f,a);if(f.note){const w={descriptions:[],id:f.id+"-note",note:f.note,type:"note"},v=R(i,w,a);f.note.position==="left of"?(a.setNode(h.id+"-note",v),a.setNode(h.id,h)):(a.setNode(h.id,h),a.setNode(h.id+"-note",v)),a.setParent(h.id,h.id+"-group"),a.setParent(h.id+"-note",h.id+"-group")}else a.setNode(h.id,h)}S.debug("Count=",a.nodeCount(),a);let B=0;c.forEach(function(r){B++,S.debug("Setting edge",r),a.setEdge(r.id1,r.id2,{relation:r,width:dt(r.title),height:b.labelHeight*z.getRows(r.title).length,labelpos:"c"},"id"+B)}),X(a),S.debug("Graph after layout",a.nodes());const m=i.node();a.nodes().forEach(function(r){r!==void 0&&a.node(r)!==void 0?(S.warn("Node "+r+": "+JSON.stringify(a.node(r))),n.select("#"+m.id+" #"+r).attr("transform","translate("+(a.node(r).x-a.node(r).width/2)+","+(a.node(r).y+(T[r]?T[r].y:0)-a.node(r).height/2)+" )"),n.select("#"+m.id+" #"+r).attr("data-x-shift",a.node(r).x-a.node(r).width/2),g.querySelectorAll("#"+m.id+" #"+r+" .divider").forEach(h=>{const w=h.parentElement;let v=0,M=0;w&&(w.parentElement&&(v=w.parentElement.getBBox().width),M=parseInt(w.getAttribute("data-x-shift"),10),Number.isNaN(M)&&(M=0)),h.setAttribute("x1",0-M+8),h.setAttribute("x2",v-M-8)})):S.debug("No Node "+r+": "+JSON.stringify(a.node(r)))});let k=m.getBBox();a.edges().forEach(function(r){r!==void 0&&a.edge(r)!==void 0&&(S.debug("Edge "+r.v+" -> "+r.w+": "+JSON.stringify(a.edge(r))),it(i,a.edge(r),a.edge(r).relation))}),k=m.getBBox();const E={id:d||"root",label:d||"root",width:0,height:0};return E.width=k.width+2*b.padding,E.height=k.height+2*b.padding,S.debug("Doc rendered",E,a),E},"renderDoc"),ot={setConf:rt,draw:st},ft={parser:P,get db(){return new N(1)},renderer:ot,styles:W,init:u(e=>{e.state||(e.state={}),e.state.arrowMarkerAbsolute=e.arrowMarkerAbsolute},"init")};export{ft as diagram};
@@ -0,0 +1 @@
1
+ import{s as t,b as a,a as r,S as s}from"./chunk-AEK57VVT-o_ViTLZT.js";import{_ as i}from"./main.js";import"./chunk-RZ5BOZE2-csKhWZPs.js";var _={parser:r,get db(){return new s(2)},renderer:a,styles:t,init:i(e=>{e.state||(e.state={}),e.state.arrowMarkerAbsolute=e.arrowMarkerAbsolute},"init")};export{_ as diagram};