import{s as ta}from"./chunk-TU3PZOEN-CJBJzapT.js";import{m as g,z as ea,x as et,i as At,p as J,U as aa,D as ra,a as P,j as De,Y as sa,K as ia,V as oa,X as na,Z as la,A as ca,g as da,$ as ha,s as kt,e as F,aX as H,aY as Lt,r as pa,f as Ta,aP as Me,aZ as Ea,a_ as ga,a$ as Ce,o as Ut}from"./mermaid.esm.min-DGQNoR5D.js";import{g as ua,G as Jt,u as dt,x as Oa,h as Qt,E as Zt}from"./chunk-W2A4CRWB-CEpUqVuh.js";import"./app-t8Vldhgr.js";var jt=(function(){var e=g(function(ct,I,f,x){for(f=f||{},x=ct.length;x--;f[ct[x]]=I);return f},"o"),t=[1,2],s=[1,3],a=[1,4],o=[2,4],i=[1,9],n=[1,11],d=[1,12],c=[1,14],r=[1,15],T=[1,17],u=[1,18],O=[1,19],E=[1,25],R=[1,26],_=[1,27],L=[1,28],S=[1,29],w=[1,30],D=[1,31],A=[1,32],v=[1,33],$=[1,34],V=[1,35],K=[1,36],z=[1,37],U=[1,38],q=[1,39],k=[1,40],Q=[1,42],X=[1,43],Z=[1,44],at=[1,45],rt=[1,46],m=[1,47],b=[1,4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,48,49,50,51,53,54,56,61,62,63,64,73],ot=[1,74],nt=[1,80],C=[1,81],te=[1,82],ee=[1,83],ae=[1,84],re=[1,85],se=[1,86],ie=[1,87],oe=[1,88],ne=[1,89],le=[1,90],ce=[1,91],de=[1,92],he=[1,93],pe=[1,94],Te=[1,95],Ee=[1,96],ge=[1,97],ue=[1,98],Oe=[1,99],xe=[1,100],ye=[1,101],be=[1,102],_e=[1,103],me=[1,104],Ie=[1,105],Re=[2,78],Rt=[4,5,17,51,53,54],Pt=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,51,53,54,56,61,62,63,64,73],fe=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,50,51,53,54,56,61,62,63,64,73],$t=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,49,51,53,54,56,61,62,63,64,73],Le=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,48,51,53,54,56,61,62,63,64,73],Vt=[5,52],B=[70,71,72,73],st=[1,151],Wt={trace:g(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SPACE:4,NEWLINE:5,SD:6,document:7,line:8,statement:9,INVALID:10,box_section:11,box_line:12,participant_statement:13,create:14,box:15,restOfLine:16,end:17,signal:18,autonumber:19,NUM:20,off:21,activate:22,actor:23,deactivate:24,note_statement:25,links_statement:26,link_statement:27,properties_statement:28,details_statement:29,title:30,legacy_title:31,acc_title:32,acc_title_value:33,acc_descr:34,acc_descr_value:35,acc_descr_multiline_value:36,loop:37,rect:38,opt:39,alt:40,else_sections:41,par:42,par_sections:43,par_over:44,critical:45,option_sections:46,break:47,option:48,and:49,else:50,participant:51,AS:52,participant_actor:53,destroy:54,actor_with_config:55,note:56,placement:57,text2:58,over:59,actor_pair:60,links:61,link:62,properties:63,details:64,spaceList:65,",":66,left_of:67,right_of:68,signaltype:69,"+":70,"-":71,"()":72,ACTOR:73,config_object:74,CONFIG_START:75,CONFIG_CONTENT:76,CONFIG_END:77,SOLID_OPEN_ARROW:78,DOTTED_OPEN_ARROW:79,SOLID_ARROW:80,SOLID_ARROW_TOP:81,SOLID_ARROW_BOTTOM:82,STICK_ARROW_TOP:83,STICK_ARROW_BOTTOM:84,SOLID_ARROW_TOP_DOTTED:85,SOLID_ARROW_BOTTOM_DOTTED:86,STICK_ARROW_TOP_DOTTED:87,STICK_ARROW_BOTTOM_DOTTED:88,SOLID_ARROW_TOP_REVERSE:89,SOLID_ARROW_BOTTOM_REVERSE:90,STICK_ARROW_TOP_REVERSE:91,STICK_ARROW_BOTTOM_REVERSE:92,SOLID_ARROW_TOP_REVERSE_DOTTED:93,SOLID_ARROW_BOTTOM_REVERSE_DOTTED:94,STICK_ARROW_TOP_REVERSE_DOTTED:95,STICK_ARROW_BOTTOM_REVERSE_DOTTED:96,BIDIRECTIONAL_SOLID_ARROW:97,DOTTED_ARROW:98,BIDIRECTIONAL_DOTTED_ARROW:99,SOLID_CROSS:100,DOTTED_CROSS:101,SOLID_POINT:102,DOTTED_POINT:103,TXT:104,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NEWLINE",6:"SD",10:"INVALID",14:"create",15:"box",16:"restOfLine",17:"end",19:"autonumber",20:"NUM",21:"off",22:"activate",24:"deactivate",30:"title",31:"legacy_title",32:"acc_title",33:"acc_title_value",34:"acc_descr",35:"acc_descr_value",36:"acc_descr_multiline_value",37:"loop",38:"rect",39:"opt",40:"alt",42:"par",44:"par_over",45:"critical",47:"break",48:"option",49:"and",50:"else",51:"participant",52:"AS",53:"participant_actor",54:"destroy",56:"note",59:"over",61:"links",62:"link",63:"properties",64:"details",66:",",67:"left_of",68:"right_of",70:"+",71:"-",72:"()",73:"ACTOR",75:"CONFIG_START",76:"CONFIG_CONTENT",77:"CONFIG_END",78:"SOLID_OPEN_ARROW",79:"DOTTED_OPEN_ARROW",80:"SOLID_ARROW",81:"SOLID_ARROW_TOP",82:"SOLID_ARROW_BOTTOM",83:"STICK_ARROW_TOP",84:"STICK_ARROW_BOTTOM",85:"SOLID_ARROW_TOP_DOTTED",86:"SOLID_ARROW_BOTTOM_DOTTED",87:"STICK_ARROW_TOP_DOTTED",88:"STICK_ARROW_BOTTOM_DOTTED",89:"SOLID_ARROW_TOP_REVERSE",90:"SOLID_ARROW_BOTTOM_REVERSE",91:"STICK_ARROW_TOP_REVERSE",92:"STICK_ARROW_BOTTOM_REVERSE",93:"SOLID_ARROW_TOP_REVERSE_DOTTED",94:"SOLID_ARROW_BOTTOM_REVERSE_DOTTED",95:"STICK_ARROW_TOP_REVERSE_DOTTED",96:"STICK_ARROW_BOTTOM_REVERSE_DOTTED",97:"BIDIRECTIONAL_SOLID_ARROW",98:"DOTTED_ARROW",99:"BIDIRECTIONAL_DOTTED_ARROW",100:"SOLID_CROSS",101:"DOTTED_CROSS",102:"SOLID_POINT",103:"DOTTED_POINT",104:"TXT"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[8,1],[11,0],[11,2],[12,2],[12,1],[12,1],[9,1],[9,2],[9,4],[9,2],[9,4],[9,3],[9,3],[9,2],[9,3],[9,3],[9,2],[9,2],[9,2],[9,2],[9,2],[9,1],[9,1],[9,2],[9,2],[9,1],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[46,1],[46,4],[43,1],[43,4],[41,1],[41,4],[13,5],[13,3],[13,5],[13,3],[13,3],[13,5],[13,3],[13,5],[13,3],[25,4],[25,4],[26,3],[27,3],[28,3],[29,3],[65,2],[65,1],[60,3],[60,1],[57,1],[57,1],[18,5],[18,5],[18,5],[18,5],[18,6],[18,4],[55,2],[74,3],[23,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[58,1]],performAction:g(function(ct,I,f,x,M,l,G){var p=l.length-1;switch(M){case 3:return x.apply(l[p]),l[p];case 4:case 10:this.$=[];break;case 5:case 11:l[p-1].push(l[p]),this.$=l[p-1];break;case 6:case 7:case 12:case 13:this.$=l[p];break;case 8:case 9:case 14:this.$=[];break;case 16:l[p].type="createParticipant",this.$=l[p];break;case 17:l[p-1].unshift({type:"boxStart",boxData:x.parseBoxData(l[p-2])}),l[p-1].push({type:"boxEnd",boxText:l[p-2]}),this.$=l[p-1];break;case 19:this.$={type:"sequenceIndex",sequenceIndex:Number(l[p-2]),sequenceIndexStep:Number(l[p-1]),sequenceVisible:!0,signalType:x.LINETYPE.AUTONUMBER};break;case 20:this.$={type:"sequenceIndex",sequenceIndex:Number(l[p-1]),sequenceIndexStep:1,sequenceVisible:!0,signalType:x.LINETYPE.AUTONUMBER};break;case 21:this.$={type:"sequenceIndex",sequenceVisible:!1,signalType:x.LINETYPE.AUTONUMBER};break;case 22:this.$={type:"sequenceIndex",sequenceVisible:!0,signalType:x.LINETYPE.AUTONUMBER};break;case 23:this.$={type:"activeStart",signalType:x.LINETYPE.ACTIVE_START,actor:l[p-1].actor};break;case 24:this.$={type:"activeEnd",signalType:x.LINETYPE.ACTIVE_END,actor:l[p-1].actor};break;case 30:x.setDiagramTitle(l[p].substring(6)),this.$=l[p].substring(6);break;case 31:x.setDiagramTitle(l[p].substring(7)),this.$=l[p].substring(7);break;case 32:this.$=l[p].trim(),x.setAccTitle(this.$);break;case 33:case 34:this.$=l[p].trim(),x.setAccDescription(this.$);break;case 35:l[p-1].unshift({type:"loopStart",loopText:x.parseMessage(l[p-2]),signalType:x.LINETYPE.LOOP_START}),l[p-1].push({type:"loopEnd",loopText:l[p-2],signalType:x.LINETYPE.LOOP_END}),this.$=l[p-1];break;case 36:l[p-1].unshift({type:"rectStart",color:x.parseMessage(l[p-2]),signalType:x.LINETYPE.RECT_START}),l[p-1].push({type:"rectEnd",color:x.parseMessage(l[p-2]),signalType:x.LINETYPE.RECT_END}),this.$=l[p-1];break;case 37:l[p-1].unshift({type:"optStart",optText:x.parseMessage(l[p-2]),signalType:x.LINETYPE.OPT_START}),l[p-1].push({type:"optEnd",optText:x.parseMessage(l[p-2]),signalType:x.LINETYPE.OPT_END}),this.$=l[p-1];break;case 38:l[p-1].unshift({type:"altStart",altText:x.parseMessage(l[p-2]),signalType:x.LINETYPE.ALT_START}),l[p-1].push({type:"altEnd",signalType:x.LINETYPE.ALT_END}),this.$=l[p-1];break;case 39:l[p-1].unshift({type:"parStart",parText:x.parseMessage(l[p-2]),signalType:x.LINETYPE.PAR_START}),l[p-1].push({type:"parEnd",signalType:x.LINETYPE.PAR_END}),this.$=l[p-1];break;case 40:l[p-1].unshift({type:"parStart",parText:x.parseMessage(l[p-2]),signalType:x.LINETYPE.PAR_OVER_START}),l[p-1].push({type:"parEnd",signalType:x.LINETYPE.PAR_END}),this.$=l[p-1];break;case 41:l[p-1].unshift({type:"criticalStart",criticalText:x.parseMessage(l[p-2]),signalType:x.LINETYPE.CRITICAL_START}),l[p-1].push({type:"criticalEnd",signalType:x.LINETYPE.CRITICAL_END}),this.$=l[p-1];break;case 42:l[p-1].unshift({type:"breakStart",breakText:x.parseMessage(l[p-2]),signalType:x.LINETYPE.BREAK_START}),l[p-1].push({type:"breakEnd",optText:x.parseMessage(l[p-2]),signalType:x.LINETYPE.BREAK_END}),this.$=l[p-1];break;case 44:this.$=l[p-3].concat([{type:"option",optionText:x.parseMessage(l[p-1]),signalType:x.LINETYPE.CRITICAL_OPTION},l[p]]);break;case 46:this.$=l[p-3].concat([{type:"and",parText:x.parseMessage(l[p-1]),signalType:x.LINETYPE.PAR_AND},l[p]]);break;case 48:this.$=l[p-3].concat([{type:"else",altText:x.parseMessage(l[p-1]),signalType:x.LINETYPE.ALT_ELSE},l[p]]);break;case 49:l[p-3].draw="participant",l[p-3].type="addParticipant",l[p-3].description=x.parseMessage(l[p-1]),this.$=l[p-3];break;case 50:l[p-1].draw="participant",l[p-1].type="addParticipant",this.$=l[p-1];break;case 51:l[p-3].draw="actor",l[p-3].type="addParticipant",l[p-3].description=x.parseMessage(l[p-1]),this.$=l[p-3];break;case 52:case 57:l[p-1].draw="actor",l[p-1].type="addParticipant",this.$=l[p-1];break;case 53:l[p-1].type="destroyParticipant",this.$=l[p-1];break;case 54:l[p-3].draw="participant",l[p-3].type="addParticipant",l[p-3].description=x.parseMessage(l[p-1]),this.$=l[p-3];break;case 55:l[p-1].draw="participant",l[p-1].type="addParticipant",this.$=l[p-1];break;case 56:l[p-3].draw="actor",l[p-3].type="addParticipant",l[p-3].description=x.parseMessage(l[p-1]),this.$=l[p-3];break;case 58:this.$=[l[p-1],{type:"addNote",placement:l[p-2],actor:l[p-1].actor,text:l[p]}];break;case 59: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:x.PLACEMENT.OVER,actor:l[p-2].slice(0,2),text:l[p]}];break;case 60:this.$=[l[p-1],{type:"addLinks",actor:l[p-1].actor,text:l[p]}];break;case 61:this.$=[l[p-1],{type:"addALink",actor:l[p-1].actor,text:l[p]}];break;case 62:this.$=[l[p-1],{type:"addProperties",actor:l[p-1].actor,text:l[p]}];break;case 63:this.$=[l[p-1],{type:"addDetails",actor:l[p-1].actor,text:l[p]}];break;case 66:this.$=[l[p-2],l[p]];break;case 67:this.$=l[p];break;case 68:this.$=x.PLACEMENT.LEFTOF;break;case 69:this.$=x.PLACEMENT.RIGHTOF;break;case 70: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:x.LINETYPE.ACTIVE_START,actor:l[p-1].actor}];break;case 71: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:x.LINETYPE.ACTIVE_END,actor:l[p-4].actor}];break;case 72: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,centralConnection:x.LINETYPE.CENTRAL_CONNECTION},{type:"centralConnection",signalType:x.LINETYPE.CENTRAL_CONNECTION,actor:l[p-1].actor}];break;case 73:this.$=[l[p-4],l[p-1],{type:"addMessage",from:l[p-4].actor,to:l[p-1].actor,signalType:l[p-2],msg:l[p],activate:!1,centralConnection:x.LINETYPE.CENTRAL_CONNECTION_REVERSE},{type:"centralConnectionReverse",signalType:x.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:l[p-4].actor}];break;case 74:this.$=[l[p-5],l[p-1],{type:"addMessage",from:l[p-5].actor,to:l[p-1].actor,signalType:l[p-3],msg:l[p],activate:!0,centralConnection:x.LINETYPE.CENTRAL_CONNECTION_DUAL},{type:"centralConnection",signalType:x.LINETYPE.CENTRAL_CONNECTION,actor:l[p-1].actor},{type:"centralConnectionReverse",signalType:x.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:l[p-5].actor}];break;case 75: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 76:this.$={type:"addParticipant",actor:l[p-1],config:l[p]};break;case 77:this.$=l[p-1].trim();break;case 78:this.$={type:"addParticipant",actor:l[p]};break;case 79:this.$=x.LINETYPE.SOLID_OPEN;break;case 80:this.$=x.LINETYPE.DOTTED_OPEN;break;case 81:this.$=x.LINETYPE.SOLID;break;case 82:this.$=x.LINETYPE.SOLID_TOP;break;case 83:this.$=x.LINETYPE.SOLID_BOTTOM;break;case 84:this.$=x.LINETYPE.STICK_TOP;break;case 85:this.$=x.LINETYPE.STICK_BOTTOM;break;case 86:this.$=x.LINETYPE.SOLID_TOP_DOTTED;break;case 87:this.$=x.LINETYPE.SOLID_BOTTOM_DOTTED;break;case 88:this.$=x.LINETYPE.STICK_TOP_DOTTED;break;case 89:this.$=x.LINETYPE.STICK_BOTTOM_DOTTED;break;case 90:this.$=x.LINETYPE.SOLID_ARROW_TOP_REVERSE;break;case 91:this.$=x.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE;break;case 92:this.$=x.LINETYPE.STICK_ARROW_TOP_REVERSE;break;case 93:this.$=x.LINETYPE.STICK_ARROW_BOTTOM_REVERSE;break;case 94:this.$=x.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED;break;case 95:this.$=x.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED;break;case 96:this.$=x.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED;break;case 97:this.$=x.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED;break;case 98:this.$=x.LINETYPE.BIDIRECTIONAL_SOLID;break;case 99:this.$=x.LINETYPE.DOTTED;break;case 100:this.$=x.LINETYPE.BIDIRECTIONAL_DOTTED;break;case 101:this.$=x.LINETYPE.SOLID_CROSS;break;case 102:this.$=x.LINETYPE.DOTTED_CROSS;break;case 103:this.$=x.LINETYPE.SOLID_POINT;break;case 104:this.$=x.LINETYPE.DOTTED_POINT;break;case 105:this.$=x.parseMessage(l[p].trim().substring(1));break}},"anonymous"),table:[{3:1,4:t,5:s,6:a},{1:[3]},{3:5,4:t,5:s,6:a},{3:6,4:t,5:s,6:a},e([1,4,5,10,14,15,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,51,53,54,56,61,62,63,64,73],o,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:i,5:n,8:8,9:10,10:d,13:13,14:c,15:r,18:16,19:T,22:u,23:41,24:O,25:20,26:21,27:22,28:23,29:24,30:E,31:R,32:_,34:L,36:S,37:w,38:D,39:A,40:v,42:$,44:V,45:K,47:z,51:U,53:q,54:k,56:Q,61:X,62:Z,63:at,64:rt,73:m},e(b,[2,5]),{9:48,13:13,14:c,15:r,18:16,19:T,22:u,23:41,24:O,25:20,26:21,27:22,28:23,29:24,30:E,31:R,32:_,34:L,36:S,37:w,38:D,39:A,40:v,42:$,44:V,45:K,47:z,51:U,53:q,54:k,56:Q,61:X,62:Z,63:at,64:rt,73:m},e(b,[2,7]),e(b,[2,8]),e(b,[2,9]),e(b,[2,15]),{13:49,51:U,53:q,54:k},{16:[1,50]},{5:[1,51]},{5:[1,54],20:[1,52],21:[1,53]},{23:55,73:m},{23:56,73:m},{5:[1,57]},{5:[1,58]},{5:[1,59]},{5:[1,60]},{5:[1,61]},e(b,[2,30]),e(b,[2,31]),{33:[1,62]},{35:[1,63]},e(b,[2,34]),{16:[1,64]},{16:[1,65]},{16:[1,66]},{16:[1,67]},{16:[1,68]},{16:[1,69]},{16:[1,70]},{16:[1,71]},{23:72,55:73,73:ot},{23:75,55:76,73:ot},{23:77,73:m},{69:78,72:[1,79],78:nt,79:C,80:te,81:ee,82:ae,83:re,84:se,85:ie,86:oe,87:ne,88:le,89:ce,90:de,91:he,92:pe,93:Te,94:Ee,95:ge,96:ue,97:Oe,98:xe,99:ye,100:be,101:_e,102:me,103:Ie},{57:106,59:[1,107],67:[1,108],68:[1,109]},{23:110,73:m},{23:111,73:m},{23:112,73:m},{23:113,73:m},e([5,66,72,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104],Re),e(b,[2,6]),e(b,[2,16]),e(Rt,[2,10],{11:114}),e(b,[2,18]),{5:[1,116],20:[1,115]},{5:[1,117]},e(b,[2,22]),{5:[1,118]},{5:[1,119]},e(b,[2,25]),e(b,[2,26]),e(b,[2,27]),e(b,[2,28]),e(b,[2,29]),e(b,[2,32]),e(b,[2,33]),e(Pt,o,{7:120}),e(Pt,o,{7:121}),e(Pt,o,{7:122}),e(fe,o,{41:123,7:124}),e($t,o,{43:125,7:126}),e($t,o,{7:126,43:127}),e(Le,o,{46:128,7:129}),e(Pt,o,{7:130}),{5:[1,132],52:[1,131]},{5:[1,134],52:[1,133]},e(Vt,Re,{74:135,75:[1,136]}),{5:[1,138],52:[1,137]},{5:[1,140],52:[1,139]},{5:[1,141]},{23:145,70:[1,142],71:[1,143],72:[1,144],73:m},{69:146,78:nt,79:C,80:te,81:ee,82:ae,83:re,84:se,85:ie,86:oe,87:ne,88:le,89:ce,90:de,91:he,92:pe,93:Te,94:Ee,95:ge,96:ue,97:Oe,98:xe,99:ye,100:be,101:_e,102:me,103:Ie},e(B,[2,79]),e(B,[2,80]),e(B,[2,81]),e(B,[2,82]),e(B,[2,83]),e(B,[2,84]),e(B,[2,85]),e(B,[2,86]),e(B,[2,87]),e(B,[2,88]),e(B,[2,89]),e(B,[2,90]),e(B,[2,91]),e(B,[2,92]),e(B,[2,93]),e(B,[2,94]),e(B,[2,95]),e(B,[2,96]),e(B,[2,97]),e(B,[2,98]),e(B,[2,99]),e(B,[2,100]),e(B,[2,101]),e(B,[2,102]),e(B,[2,103]),e(B,[2,104]),{23:147,73:m},{23:149,60:148,73:m},{73:[2,68]},{73:[2,69]},{58:150,104:st},{58:152,104:st},{58:153,104:st},{58:154,104:st},{4:[1,157],5:[1,159],12:156,13:158,17:[1,155],51:U,53:q,54:k},{5:[1,160]},e(b,[2,20]),e(b,[2,21]),e(b,[2,23]),e(b,[2,24]),{4:i,5:n,8:8,9:10,10:d,13:13,14:c,15:r,17:[1,161],18:16,19:T,22:u,23:41,24:O,25:20,26:21,27:22,28:23,29:24,30:E,31:R,32:_,34:L,36:S,37:w,38:D,39:A,40:v,42:$,44:V,45:K,47:z,51:U,53:q,54:k,56:Q,61:X,62:Z,63:at,64:rt,73:m},{4:i,5:n,8:8,9:10,10:d,13:13,14:c,15:r,17:[1,162],18:16,19:T,22:u,23:41,24:O,25:20,26:21,27:22,28:23,29:24,30:E,31:R,32:_,34:L,36:S,37:w,38:D,39:A,40:v,42:$,44:V,45:K,47:z,51:U,53:q,54:k,56:Q,61:X,62:Z,63:at,64:rt,73:m},{4:i,5:n,8:8,9:10,10:d,13:13,14:c,15:r,17:[1,163],18:16,19:T,22:u,23:41,24:O,25:20,26:21,27:22,28:23,29:24,30:E,31:R,32:_,34:L,36:S,37:w,38:D,39:A,40:v,42:$,44:V,45:K,47:z,51:U,53:q,54:k,56:Q,61:X,62:Z,63:at,64:rt,73:m},{17:[1,164]},{4:i,5:n,8:8,9:10,10:d,13:13,14:c,15:r,17:[2,47],18:16,19:T,22:u,23:41,24:O,25:20,26:21,27:22,28:23,29:24,30:E,31:R,32:_,34:L,36:S,37:w,38:D,39:A,40:v,42:$,44:V,45:K,47:z,50:[1,165],51:U,53:q,54:k,56:Q,61:X,62:Z,63:at,64:rt,73:m},{17:[1,166]},{4:i,5:n,8:8,9:10,10:d,13:13,14:c,15:r,17:[2,45],18:16,19:T,22:u,23:41,24:O,25:20,26:21,27:22,28:23,29:24,30:E,31:R,32:_,34:L,36:S,37:w,38:D,39:A,40:v,42:$,44:V,45:K,47:z,49:[1,167],51:U,53:q,54:k,56:Q,61:X,62:Z,63:at,64:rt,73:m},{17:[1,168]},{17:[1,169]},{4:i,5:n,8:8,9:10,10:d,13:13,14:c,15:r,17:[2,43],18:16,19:T,22:u,23:41,24:O,25:20,26:21,27:22,28:23,29:24,30:E,31:R,32:_,34:L,36:S,37:w,38:D,39:A,40:v,42:$,44:V,45:K,47:z,48:[1,170],51:U,53:q,54:k,56:Q,61:X,62:Z,63:at,64:rt,73:m},{4:i,5:n,8:8,9:10,10:d,13:13,14:c,15:r,17:[1,171],18:16,19:T,22:u,23:41,24:O,25:20,26:21,27:22,28:23,29:24,30:E,31:R,32:_,34:L,36:S,37:w,38:D,39:A,40:v,42:$,44:V,45:K,47:z,51:U,53:q,54:k,56:Q,61:X,62:Z,63:at,64:rt,73:m},{16:[1,172]},e(b,[2,50]),{16:[1,173]},e(b,[2,55]),e(Vt,[2,76]),{76:[1,174]},{16:[1,175]},e(b,[2,52]),{16:[1,176]},e(b,[2,57]),e(b,[2,53]),{23:177,73:m},{23:178,73:m},{23:179,73:m},{58:180,104:st},{23:181,72:[1,182],73:m},{58:183,104:st},{58:184,104:st},{66:[1,185],104:[2,67]},{5:[2,60]},{5:[2,105]},{5:[2,61]},{5:[2,62]},{5:[2,63]},e(b,[2,17]),e(Rt,[2,11]),{13:186,51:U,53:q,54:k},e(Rt,[2,13]),e(Rt,[2,14]),e(b,[2,19]),e(b,[2,35]),e(b,[2,36]),e(b,[2,37]),e(b,[2,38]),{16:[1,187]},e(b,[2,39]),{16:[1,188]},e(b,[2,40]),e(b,[2,41]),{16:[1,189]},e(b,[2,42]),{5:[1,190]},{5:[1,191]},{77:[1,192]},{5:[1,193]},{5:[1,194]},{58:195,104:st},{58:196,104:st},{58:197,104:st},{5:[2,75]},{58:198,104:st},{23:199,73:m},{5:[2,58]},{5:[2,59]},{23:200,73:m},e(Rt,[2,12]),e(fe,o,{7:124,41:201}),e($t,o,{7:126,43:202}),e(Le,o,{7:129,46:203}),e(b,[2,49]),e(b,[2,54]),e(Vt,[2,77]),e(b,[2,51]),e(b,[2,56]),{5:[2,70]},{5:[2,71]},{5:[2,72]},{5:[2,73]},{58:204,104:st},{104:[2,66]},{17:[2,48]},{17:[2,46]},{17:[2,44]},{5:[2,74]}],defaultActions:{5:[2,1],6:[2,2],108:[2,68],109:[2,69],150:[2,60],151:[2,105],152:[2,61],153:[2,62],154:[2,63],180:[2,75],183:[2,58],184:[2,59],195:[2,70],196:[2,71],197:[2,72],198:[2,73],200:[2,66],201:[2,48],202:[2,46],203:[2,44],204:[2,74]},parseError:g(function(ct,I){if(I.recoverable)this.trace(ct);else{var f=new Error(ct);throw f.hash=I,f}},"parseError"),parse:g(function(ct){var I=this,f=[0],x=[],M=[null],l=[],G=this.table,p="",St=0,Pe=0,Xe=0,Ge=2,we=1,Je=l.slice.call(arguments,1),W=Object.create(this.lexer),gt={yy:{}};for(var Ft in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Ft)&&(gt.yy[Ft]=this.yy[Ft]);W.setInput(ct,gt.yy),gt.yy.lexer=W,gt.yy.parser=this,typeof W.yylloc>"u"&&(W.yylloc={});var Kt=W.yylloc;l.push(Kt);var Qe=W.options&&W.options.ranges;typeof gt.yy.parseError=="function"?this.parseError=gt.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Ze(tt){f.length=f.length-2*tt,M.length=M.length-tt,l.length=l.length-tt}g(Ze,"popStack");function Se(){var tt;return tt=x.pop()||W.lex()||we,typeof tt!="number"&&(tt instanceof Array&&(x=tt,tt=x.pop()),tt=I.symbols_[tt]||tt),tt}g(Se,"lex");for(var j,qt,ut,it,hr,Ht,bt={},Nt,ht,Ne,Dt;;){if(ut=f[f.length-1],this.defaultActions[ut]?it=this.defaultActions[ut]:((j===null||typeof j>"u")&&(j=Se()),it=G[ut]&&G[ut][j]),typeof it>"u"||!it.length||!it[0]){var zt="";Dt=[];for(Nt in G[ut])this.terminals_[Nt]&&Nt>Ge&&Dt.push("'"+this.terminals_[Nt]+"'");W.showPosition?zt="Parse error on line "+(St+1)+`: `+W.showPosition()+` Expecting `+Dt.join(", ")+", got '"+(this.terminals_[j]||j)+"'":zt="Parse error on line "+(St+1)+": Unexpected "+(j==we?"end of input":"'"+(this.terminals_[j]||j)+"'"),this.parseError(zt,{text:W.match,token:this.terminals_[j]||j,line:W.yylineno,loc:Kt,expected:Dt})}if(it[0]instanceof Array&&it.length>1)throw new Error("Parse Error: multiple actions possible at state: "+ut+", token: "+j);switch(it[0]){case 1:f.push(j),M.push(W.yytext),l.push(W.yylloc),f.push(it[1]),j=null,qt?(j=qt,qt=null):(Pe=W.yyleng,p=W.yytext,St=W.yylineno,Kt=W.yylloc,Xe>0);break;case 2:if(ht=this.productions_[it[1]][1],bt.$=M[M.length-ht],bt._$={first_line:l[l.length-(ht||1)].first_line,last_line:l[l.length-1].last_line,first_column:l[l.length-(ht||1)].first_column,last_column:l[l.length-1].last_column},Qe&&(bt._$.range=[l[l.length-(ht||1)].range[0],l[l.length-1].range[1]]),Ht=this.performAction.apply(bt,[p,Pe,St,gt.yy,it[1],M,l].concat(Je)),typeof Ht<"u")return Ht;ht&&(f=f.slice(0,-1*ht*2),M=M.slice(0,-1*ht),l=l.slice(0,-1*ht)),f.push(this.productions_[it[1]][0]),M.push(bt.$),l.push(bt._$),Ne=G[f[f.length-2]][f[f.length-1]],f.push(Ne);break;case 3:return!0}}return!0},"parse")},je=(function(){var ct={EOF:1,parseError:g(function(I,f){if(this.yy.parser)this.yy.parser.parseError(I,f);else throw new Error(I)},"parseError"),setInput:g(function(I,f){return this.yy=f||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:g(function(){var I=this._input[0];this.yytext+=I,this.yyleng++,this.offset++,this.match+=I,this.matched+=I;var f=I.match(/(?:\r\n?|\n).*/g);return f?(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:g(function(I){var f=I.length,x=I.split(/(?:\r\n?|\n)/g);this._input=I+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-f),this.offset-=f;var M=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),x.length-1&&(this.yylineno-=x.length-1);var l=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:x?(x.length===M.length?this.yylloc.first_column:0)+M[M.length-x.length].length-x[0].length:this.yylloc.first_column-f},this.options.ranges&&(this.yylloc.range=[l[0],l[0]+this.yyleng-f]),this.yyleng=this.yytext.length,this},"unput"),more:g(function(){return this._more=!0,this},"more"),reject:g(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). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:g(function(I){this.unput(this.match.slice(I))},"less"),pastInput:g(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:g(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:g(function(){var I=this.pastInput(),f=new Array(I.length+1).join("-");return I+this.upcomingInput()+` `+f+"^"},"showPosition"),test_match:g(function(I,f){var x,M,l;if(this.options.backtrack_lexer&&(l={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&&(l.yylloc.range=this.yylloc.range.slice(0))),M=I[0].match(/(?:\r\n?|\n).*/g),M&&(this.yylineno+=M.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:M?M[M.length-1].length-M[M.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],x=this.performAction.call(this,this.yy,this,f,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),x)return x;if(this._backtrack){for(var G in l)this[G]=l[G];return!1}return!1},"test_match"),next:g(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var I,f,x,M;this._more||(this.yytext="",this.match="");for(var l=this._currentRules(),G=0;Gf[0].length)){if(f=x,M=G,this.options.backtrack_lexer){if(I=this.test_match(x,l[G]),I!==!1)return I;if(this._backtrack){f=!1;continue}else return!1}else if(!this.options.flex)break}return f?(I=this.test_match(f,l[M]),I!==!1?I:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. `+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:g(function(){var I=this.next();return I||this.lex()},"lex"),begin:g(function(I){this.conditionStack.push(I)},"begin"),popState:g(function(){var I=this.conditionStack.length-1;return I>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:g(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:g(function(I){return I=this.conditionStack.length-1-Math.abs(I||0),I>=0?this.conditionStack[I]:"INITIAL"},"topState"),pushState:g(function(I){this.begin(I)},"pushState"),stateStackSize:g(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:g(function(I,f,x,M){switch(x){case 0:return 5;case 1:break;case 2:break;case 3:break;case 4:break;case 5:break;case 6:return 20;case 7:return this.begin("CONFIG"),75;case 8:return 76;case 9:return this.popState(),this.begin("ALIAS"),77;case 10:return this.popState(),this.popState(),77;case 11:return f.yytext=f.yytext.trim(),73;case 12:return f.yytext=f.yytext.trim(),this.begin("ALIAS"),73;case 13:return f.yytext=f.yytext.trim(),this.popState(),73;case 14:return this.popState(),10;case 15:return this.begin("LINE"),15;case 16:return this.begin("ID"),51;case 17:return this.begin("ID"),53;case 18:return 14;case 19:return this.begin("ID"),54;case 20:return this.popState(),this.popState(),this.begin("LINE"),52;case 21:return this.popState(),this.popState(),5;case 22:return this.begin("LINE"),37;case 23:return this.begin("LINE"),38;case 24:return this.begin("LINE"),39;case 25:return this.begin("LINE"),40;case 26:return this.begin("LINE"),50;case 27:return this.begin("LINE"),42;case 28:return this.begin("LINE"),44;case 29:return this.begin("LINE"),49;case 30:return this.begin("LINE"),45;case 31:return this.begin("LINE"),48;case 32:return this.begin("LINE"),47;case 33:return this.popState(),16;case 34:return 17;case 35:return 67;case 36:return 68;case 37:return 61;case 38:return 62;case 39:return 63;case 40:return 64;case 41:return 59;case 42:return 56;case 43:return this.begin("ID"),22;case 44:return this.begin("ID"),24;case 45:return 30;case 46:return 31;case 47:return this.begin("acc_title"),32;case 48:return this.popState(),"acc_title_value";case 49:return this.begin("acc_descr"),34;case 50:return this.popState(),"acc_descr_value";case 51:this.begin("acc_descr_multiline");break;case 52:this.popState();break;case 53:return"acc_descr_multiline_value";case 54:return 6;case 55:return 19;case 56:return 21;case 57:return 66;case 58:return 5;case 59:return f.yytext=f.yytext.trim(),73;case 60:return 80;case 61:return 97;case 62:return 98;case 63:return 99;case 64:return 78;case 65:return 79;case 66:return 100;case 67:return 101;case 68:return 102;case 69:return 103;case 70:return 85;case 71:return 86;case 72:return 87;case 73:return 88;case 74:return 93;case 75:return 94;case 76:return 95;case 77:return 96;case 78:return 81;case 79:return 82;case 80:return 83;case 81:return 84;case 82:return 89;case 83:return 90;case 84:return 91;case 85:return 92;case 86:return 104;case 87:return 104;case 88:return 70;case 89:return 71;case 90:return 72;case 91:return 5;case 92:return 10}},"anonymous"),rules:[/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[0-9]+(?=[ \n]+))/i,/^(?:@\{)/i,/^(?:[^\}]+)/i,/^(?:\}(?=\s+as\s))/i,/^(?:\})/i,/^(?:[^\<->\->:\n,;@\s]+(?=@\{))/i,/^(?:[^<>:\n,;@\s]+(?=\s+as\s))/i,/^(?:[^<>:\n,;@]+(?=\s*[\n;#]|$))/i,/^(?:[^<>:\n,;@]*<[^\n]*)/i,/^(?:box\b)/i,/^(?:participant\b)/i,/^(?:actor\b)/i,/^(?:create\b)/i,/^(?:destroy\b)/i,/^(?:as\b)/i,/^(?:(?:))/i,/^(?:loop\b)/i,/^(?:rect\b)/i,/^(?:opt\b)/i,/^(?:alt\b)/i,/^(?:else\b)/i,/^(?:par\b)/i,/^(?:par_over\b)/i,/^(?:and\b)/i,/^(?:critical\b)/i,/^(?:option\b)/i,/^(?:break\b)/i,/^(?:(?:[:]?(?:no)?wrap)?[^#\n;]*)/i,/^(?:end\b)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:links\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,/^(?:--\|\\)/i,/^(?:--\|\/)/i,/^(?:--\\\\)/i,/^(?:--\/\/)/i,/^(?:\/\|--)/i,/^(?:\\\|--)/i,/^(?:\/\/--)/i,/^(?:\\\\--)/i,/^(?:-\|\\)/i,/^(?:-\|\/)/i,/^(?:-\\\\)/i,/^(?:-\/\/)/i,/^(?:\/\|-)/i,/^(?:\\\|-)/i,/^(?:\/\/-)/i,/^(?:\\\\-)/i,/^(?::(?:(?:no)?wrap)?[^#\n;]*)/i,/^(?::)/i,/^(?:\+)/i,/^(?:-)/i,/^(?:\(\))/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[52,53],inclusive:!1},acc_descr:{rules:[50],inclusive:!1},acc_title:{rules:[48],inclusive:!1},ID:{rules:[2,3,7,11,12,13,14],inclusive:!1},ALIAS:{rules:[2,3,20,21],inclusive:!1},LINE:{rules:[2,3,33],inclusive:!1},CONFIG:{rules:[8,9,10],inclusive:!1},CONFIG_DATA:{rules:[],inclusive:!1},INITIAL:{rules:[0,1,3,4,5,6,15,16,17,18,19,22,23,24,25,26,27,28,29,30,31,32,34,35,36,37,38,39,40,41,42,43,44,45,46,47,49,51,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92],inclusive:!0}}};return ct})();Wt.lexer=je;function wt(){this.yy={}}return g(wt,"Parser"),wt.prototype=Wt,Wt.Parser=wt,new wt})();jt.parser=jt;var xa=jt,ya={SOLID:0,DOTTED:1,NOTE:2,SOLID_CROSS:3,DOTTED_CROSS:4,SOLID_OPEN:5,DOTTED_OPEN:6,LOOP_START:10,LOOP_END:11,ALT_START:12,ALT_ELSE:13,ALT_END:14,OPT_START:15,OPT_END:16,ACTIVE_START:17,ACTIVE_END:18,PAR_START:19,PAR_AND:20,PAR_END:21,RECT_START:22,RECT_END:23,SOLID_POINT:24,DOTTED_POINT:25,AUTONUMBER:26,CRITICAL_START:27,CRITICAL_OPTION:28,CRITICAL_END:29,BREAK_START:30,BREAK_END:31,PAR_OVER_START:32,BIDIRECTIONAL_SOLID:33,BIDIRECTIONAL_DOTTED:34,SOLID_TOP:41,SOLID_BOTTOM:42,STICK_TOP:43,STICK_BOTTOM:44,SOLID_ARROW_TOP_REVERSE:45,SOLID_ARROW_BOTTOM_REVERSE:46,STICK_ARROW_TOP_REVERSE:47,STICK_ARROW_BOTTOM_REVERSE:48,SOLID_TOP_DOTTED:51,SOLID_BOTTOM_DOTTED:52,STICK_TOP_DOTTED:53,STICK_BOTTOM_DOTTED:54,SOLID_ARROW_TOP_REVERSE_DOTTED:55,SOLID_ARROW_BOTTOM_REVERSE_DOTTED:56,STICK_ARROW_TOP_REVERSE_DOTTED:57,STICK_ARROW_BOTTOM_REVERSE_DOTTED:58,CENTRAL_CONNECTION:59,CENTRAL_CONNECTION_REVERSE:60,CENTRAL_CONNECTION_DUAL:61},ba={FILLED:0,OPEN:1},_a={LEFTOF:0,RIGHTOF:1,OVER:2},Mt={ACTOR:"actor",CONTROL:"control",DATABASE:"database",ENTITY:"entity"},mt,ma=(mt=class{constructor(){this.state=new ta(()=>({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=De,this.setAccDescription=sa,this.setDiagramTitle=ia,this.getAccTitle=oa,this.getAccDescription=na,this.getDiagramTitle=la,this.apply=this.apply.bind(this),this.parseBoxData=this.parseBoxData.bind(this),this.parseMessage=this.parseMessage.bind(this),this.clear(),this.setWrap(et().wrap),this.LINETYPE=ya,this.ARROWTYPE=ba,this.PLACEMENT=_a}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,s,a,o,i){let n=this.state.records.currentBox,d;if(i!==void 0){let r;i.includes(` `)?r=i+` `:r=`{ `+i+` }`,d=ca(r,{schema:da})}o=d?.type??o,d?.alias&&(!a||a.text===s)&&(a={text:d.alias,wrap:a?.wrap,type:o});let c=this.state.records.actors.get(t);if(c){if(this.state.records.currentBox&&c.box&&this.state.records.currentBox!==c.box)throw new Error(`A same participant should only be defined in one Box: ${c.name} can't be in '${c.box.name}' and in '${this.state.records.currentBox.name}' at the same time.`);if(n=c.box?c.box:this.state.records.currentBox,c.box=n,c&&s===c.name&&a==null)return}if(a?.text==null&&(a={text:s,type:o}),(o==null||a.text==null)&&(a={text:s,type:o}),this.state.records.actors.set(t,{box:n,name:s,description:a.text,wrap:a.wrap??this.autoWrap(),prevActor:this.state.records.prevActor,links:{},properties:{},actorCnt:null,rectData:null,type:o??"participant"}),this.state.records.prevActor){let r=this.state.records.actors.get(this.state.records.prevActor);r&&(r.nextActor=t)}this.state.records.currentBox&&this.state.records.currentBox.actorKeys.push(t),this.state.records.prevActor=t}activationCount(t){let s,a=0;if(!t)return 0;for(s=0;s>-",token:"->>-",line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:["'ACTIVE_PARTICIPANT'"]},d}return this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:t,to:s,message:a?.text??"",wrap:a?.wrap??this.autoWrap(),type:o,activate:i,centralConnection:n??0}),!0}hasAtLeastOneBox(){return this.state.records.boxes.length>0}hasAtLeastOneBoxWithTitle(){return this.state.records.boxes.some(t=>t.name)}getMessages(){return this.state.records.messages}getBoxes(){return this.state.records.boxes}getActors(){return this.state.records.actors}getCreatedActors(){return this.state.records.createdActors}getDestroyedActors(){return this.state.records.destroyedActors}getActor(t){return this.state.records.actors.get(t)}getActorKeys(){return[...this.state.records.actors.keys()]}enableSequenceNumbers(){this.state.records.sequenceNumbersEnabled=!0}disableSequenceNumbers(){this.state.records.sequenceNumbersEnabled=!1}showSequenceNumbers(){return this.state.records.sequenceNumbersEnabled}setWrap(t){this.state.records.wrapEnabled=t}extractWrap(t){if(t===void 0)return{};t=t.trim();let s=/^:?wrap:/.exec(t)!==null?!0:/^:?nowrap:/.exec(t)!==null?!1:void 0;return{cleanedText:(s===void 0?t:t.replace(/^:?(?:no)?wrap:/,"")).trim(),wrap:s}}autoWrap(){return this.state.records.wrapEnabled!==void 0?this.state.records.wrapEnabled:et().sequence?.wrap??!1}clear(){this.state.reset(),ha()}parseMessage(t){let s=t.trim(),{wrap:a,cleanedText:o}=this.extractWrap(s),i={text:o,wrap:a};return J.debug(`parseMessage: ${JSON.stringify(i)}`),i}parseBoxData(t){let s=/^((?:rgba?|hsla?)\s*\(.*\)|\w*)(.*)$/.exec(t),a=s?.[1]?s[1].trim():"transparent",o=s?.[2]?s[2].trim():void 0;if(window?.CSS)window.CSS.supports("color",a)||(a="transparent",o=t.trim());else{let d=new Option().style;d.color=a,d.color!==a&&(a="transparent",o=t.trim())}let{wrap:i,cleanedText:n}=this.extractWrap(o);return{text:n?kt(n,et()):void 0,color:a,wrap:i}}addNote(t,s,a){let o={actor:t,placement:s,message:a.text,wrap:a.wrap??this.autoWrap()},i=[].concat(t,t);this.state.records.notes.push(o),this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:i[0],to:i[1],message:a.text,wrap:a.wrap??this.autoWrap(),type:this.LINETYPE.NOTE,placement:s})}addLinks(t,s){let a=this.getActor(t);try{let o=kt(s.text,et());o=o.replace(/=/g,"="),o=o.replace(/&/g,"&");let i=JSON.parse(o);this.insertLinks(a,i)}catch(o){J.error("error while parsing actor link text",o)}}addALink(t,s){let a=this.getActor(t);try{let o={},i=kt(s.text,et()),n=i.indexOf("@");i=i.replace(/=/g,"="),i=i.replace(/&/g,"&");let d=i.slice(0,n-1).trim(),c=i.slice(n+1).trim();o[d]=c,this.insertLinks(a,o)}catch(o){J.error("error while parsing actor link text",o)}}insertLinks(t,s){if(t.links==null)t.links=s;else for(let a in s)t.links[a]=s[a]}addProperties(t,s){let a=this.getActor(t);try{let o=kt(s.text,et()),i=JSON.parse(o);this.insertProperties(a,i)}catch(o){J.error("error while parsing actor properties text",o)}}insertProperties(t,s){if(t.properties==null)t.properties=s;else for(let a in s)t.properties[a]=s[a]}boxEnd(){this.state.records.currentBox=void 0}addDetails(t,s){let a=this.getActor(t),o=document.getElementById(s.text);try{let i=o.innerHTML,n=JSON.parse(i);n.properties&&this.insertProperties(a,n.properties),n.links&&this.insertLinks(a,n.links)}catch(i){J.error("error while parsing actor details text",i)}}getActorProperty(t,s){if(t?.properties!==void 0)return t.properties[s]}apply(t){if(Array.isArray(t))t.forEach(s=>{this.apply(s)});else switch(t.type){case"sequenceIndex":this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:void 0,to:void 0,message:{start:t.sequenceIndex,step:t.sequenceIndexStep,visible:t.sequenceVisible},wrap:!1,type:t.signalType});break;case"addParticipant":this.addActor(t.actor,t.actor,t.description,t.draw,t.config);break;case"createParticipant":if(this.state.records.actors.has(t.actor))throw new Error("It is not possible to have actors with the same id, even if one is destroyed before the next is created. Use 'AS' aliases to simulate the behavior");this.state.records.lastCreated=t.actor,this.addActor(t.actor,t.actor,t.description,t.draw,t.config),this.state.records.createdActors.set(t.actor,this.state.records.messages.length);break;case"destroyParticipant":this.state.records.lastDestroyed=t.actor,this.state.records.destroyedActors.set(t.actor,this.state.records.messages.length);break;case"activeStart":this.addSignal(t.actor,void 0,void 0,t.signalType);break;case"centralConnection":this.addSignal(t.actor,void 0,void 0,t.signalType);break;case"centralConnectionReverse":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,t.centralConnection);break;case"boxStart":this.addBox(t.boxData);break;case"boxEnd":this.boxEnd();break;case"loopStart":this.addSignal(void 0,void 0,t.loopText,t.signalType);break;case"loopEnd":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":De(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 et().sequence}},g(mt,"SequenceDB"),mt),Ia=g(e=>`.actor { stroke: ${e.actorBorder}; fill: ${e.actorBkg}; } text.actor > tspan { fill: ${e.actorTextColor}; stroke: none; } .actor-line { stroke: ${e.actorLineColor}; } .innerArc { stroke-width: 1.5; stroke-dasharray: none; } .messageLine0 { stroke-width: 1.5; stroke-dasharray: none; stroke: ${e.signalColor}; } .messageLine1 { stroke-width: 1.5; stroke-dasharray: 2, 2; stroke: ${e.signalColor}; } #arrowhead path { fill: ${e.signalColor}; stroke: ${e.signalColor}; } .sequenceNumber { fill: ${e.sequenceNumberColor}; } #sequencenumber { fill: ${e.signalColor}; } #crosshead path { fill: ${e.signalColor}; stroke: ${e.signalColor}; } .messageText { fill: ${e.signalTextColor}; stroke: none; } .labelBox { stroke: ${e.labelBoxBorderColor}; fill: ${e.labelBoxBkgColor}; } .labelText, .labelText > tspan { fill: ${e.labelTextColor}; stroke: none; } .loopText, .loopText > tspan { fill: ${e.loopTextColor}; stroke: none; } .loopLine { stroke-width: 2px; stroke-dasharray: 2, 2; stroke: ${e.labelBoxBorderColor}; fill: ${e.labelBoxBorderColor}; } .note { //stroke: #decc93; stroke: ${e.noteBorderColor}; fill: ${e.noteBkgColor}; } .noteText, .noteText > tspan { fill: ${e.noteTextColor}; stroke: none; } .activation0 { fill: ${e.activationBkgColor}; stroke: ${e.activationBorderColor}; } .activation1 { fill: ${e.activationBkgColor}; stroke: ${e.activationBorderColor}; } .activation2 { fill: ${e.activationBkgColor}; stroke: ${e.activationBorderColor}; } .actorPopupMenu { position: absolute; } .actorPopupMenuPanel { position: absolute; fill: ${e.actorBkg}; box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2); filter: drop-shadow(3px 5px 2px rgb(0 0 0 / 0.4)); } .actor-man line { stroke: ${e.actorBorder}; fill: ${e.actorBkg}; } .actor-man circle, line { stroke: ${e.actorBorder}; fill: ${e.actorBkg}; stroke-width: 2px; } `,"getStyles"),Ra=Ia,ve=pa(Ta()),Ot=36,Tt="actor-top",Et="actor-bottom",vt="actor-box",xt="actor-man",ft=g(function(e,t){return Oa(e,t)},"drawRect"),fa=g(function(e,t,s,a,o){if(t.links===void 0||t.links===null||Object.keys(t.links).length===0)return{height:0,width:0};let i=t.links,n=t.actorCnt,d=t.rectData;var c="none";o&&(c="block !important");let r=e.append("g");r.attr("id","actor"+n+"_popup"),r.attr("class","actorPopupMenu"),r.attr("display",c);var T="";d.class!==void 0&&(T=" "+d.class);let u=d.width>s?d.width:s,O=r.append("rect");if(O.attr("class","actorPopupMenuPanel"+T),O.attr("x",d.x),O.attr("y",d.height),O.attr("fill",d.fill),O.attr("stroke",d.stroke),O.attr("width",u),O.attr("height",d.height),O.attr("rx",d.rx),O.attr("ry",d.ry),i!=null){var E=20;for(let L in i){var R=r.append("a"),_=(0,ve.sanitizeUrl)(i[L]);R.attr("xlink:href",_),R.attr("target","_blank"),Ua(a)(L,R,d.x+10,d.height+E,u,20,{class:"actor"},a),E+=30}}return O.attr("height",E),{height:d.height+E,width:u}},"drawPopup"),Bt=g(function(e){return"var pu = document.getElementById('"+e+"'); if (pu != null) { pu.style.display = pu.style.display == 'block' ? 'none' : 'block'; }"},"popupMenuToggle"),Ct=g(async function(e,t,s=null){let a=e.append("foreignObject"),o=await Ce(t.text,Ut()),i=a.append("xhtml:div").attr("style","width: fit-content;").attr("xmlns","http://www.w3.org/1999/xhtml").html(o).node().getBoundingClientRect();if(a.attr("height",Math.round(i.height)).attr("width",Math.round(i.width)),t.class==="noteText"){let n=e.node().firstChild;n.setAttribute("height",i.height+2*t.textMargin);let d=n.getBBox();a.attr("x",Math.round(d.x+d.width/2-i.width/2)).attr("y",Math.round(d.y+d.height/2-i.height/2))}else if(s){let{startx:n,stopx:d,starty:c}=s;if(n>d){let r=n;n=d,d=r}a.attr("x",Math.round(n+Math.abs(n-d)/2-i.width/2)),t.class==="loopText"?a.attr("y",Math.round(c)):a.attr("y",Math.round(c-i.height))}return[a]},"drawKatex"),It=g(function(e,t){let s=0,a=0,o=t.text.split(P.lineBreakRegex),[i,n]=Me(t.fontSize),d=[],c=0,r=g(()=>t.y,"yfunc");if(t.valign!==void 0&&t.textMargin!==void 0&&t.textMargin>0)switch(t.valign){case"top":case"start":r=g(()=>Math.round(t.y+t.textMargin),"yfunc");break;case"middle":case"center":r=g(()=>Math.round(t.y+(s+a+t.textMargin)/2),"yfunc");break;case"bottom":case"end":r=g(()=>Math.round(t.y+(s+a+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[T,u]of o.entries()){t.textMargin!==void 0&&t.textMargin===0&&i!==void 0&&(c=T*i);let O=e.append("text");O.attr("x",t.x),O.attr("y",r()),t.anchor!==void 0&&O.attr("text-anchor",t.anchor).attr("dominant-baseline",t.dominantBaseline).attr("alignment-baseline",t.alignmentBaseline),t.fontFamily!==void 0&&O.style("font-family",t.fontFamily),n!==void 0&&O.style("font-size",n),t.fontWeight!==void 0&&O.style("font-weight",t.fontWeight),t.fill!==void 0&&O.attr("fill",t.fill),t.class!==void 0&&O.attr("class",t.class),t.dy!==void 0?O.attr("dy",t.dy):c!==0&&O.attr("dy",c);let E=u||Ea;if(t.tspan){let R=O.append("tspan");R.attr("x",t.x),t.fill!==void 0&&R.attr("fill",t.fill),R.text(E)}else O.text(E);t.valign!==void 0&&t.textMargin!==void 0&&t.textMargin>0&&(a+=(O._groups||O)[0][0].getBBox().height,s=a),d.push(O)}return d},"drawText"),Be=g(function(e,t){function s(o,i,n,d,c){return o+","+i+" "+(o+n)+","+i+" "+(o+n)+","+(i+d-c)+" "+(o+n-c*1.2)+","+(i+d)+" "+o+","+(i+d)}g(s,"genPoints");let a=e.append("polygon");return a.attr("points",s(t.x,t.y,t.width,t.height,7)),a.attr("class","labelBox"),t.y=t.y+t.height/2,It(e,t),a},"drawLabel"),N=-1,Ye=g((e,t,s,a)=>{e.select&&s.forEach(o=>{let i=t.get(o),n=e.select("#actor"+i.actorCnt);!a.mirrorActors&&i.stopy?n.attr("y2",i.stopy+i.height/2):a.mirrorActors&&n.attr("y2",i.stopy)})},"fixLifeLineHeights"),La=g(function(e,t,s,a){let o=a?t.stopy:t.starty,i=t.x+t.width/2,n=o+t.height,d=e.append("g").lower();var c=d;a||(N++,Object.keys(t.links||{}).length&&!s.forceMenus&&c.attr("onclick",Bt(`actor${N}_popup`)).attr("cursor","pointer"),c.append("line").attr("id","actor"+N).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),c=d.append("g"),t.actorCnt=N,t.links!=null&&c.attr("id","root-"+N));let r=dt();var T="actor";t.properties?.class?T=t.properties.class:r.fill="#eaeaea",a?T+=` ${Et}`:T+=` ${Tt}`,r.x=t.x,r.y=o,r.width=t.width,r.height=t.height,r.class=T,r.rx=3,r.ry=3,r.name=t.name;let u=ft(c,r);if(t.rectData=r,t.properties?.icon){let E=t.properties.icon.trim();E.charAt(0)==="@"?Qt(c,r.x+r.width-20,r.y+10,E.substr(1)):Zt(c,r.x+r.width-20,r.y+10,E)}pt(s,H(t.description))(t.description,c,r.x,r.y,r.width,r.height,{class:`actor ${vt}`},s);let O=t.height;if(u.node){let E=u.node().getBBox();t.height=E.height,O=E.height}return O},"drawActorTypeParticipant"),Pa=g(function(e,t,s,a){let o=a?t.stopy:t.starty,i=t.x+t.width/2,n=o+t.height,d=e.append("g").lower();var c=d;a||(N++,Object.keys(t.links||{}).length&&!s.forceMenus&&c.attr("onclick",Bt(`actor${N}_popup`)).attr("cursor","pointer"),c.append("line").attr("id","actor"+N).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),c=d.append("g"),t.actorCnt=N,t.links!=null&&c.attr("id","root-"+N));let r=dt();var T="actor";t.properties?.class?T=t.properties.class:r.fill="#eaeaea",a?T+=` ${Et}`:T+=` ${Tt}`,r.x=t.x,r.y=o,r.width=t.width,r.height=t.height,r.class=T,r.name=t.name;let u=6,O={...r,x:r.x+-u,y:r.y+ +u,class:"actor"},E=ft(c,r);if(ft(c,O),t.rectData=r,t.properties?.icon){let _=t.properties.icon.trim();_.charAt(0)==="@"?Qt(c,r.x+r.width-20,r.y+10,_.substr(1)):Zt(c,r.x+r.width-20,r.y+10,_)}pt(s,H(t.description))(t.description,c,r.x-u,r.y+u,r.width,r.height,{class:`actor ${vt}`},s);let R=t.height;if(E.node){let _=E.node().getBBox();t.height=_.height,R=_.height}return R},"drawActorTypeCollections"),wa=g(function(e,t,s,a){let o=a?t.stopy:t.starty,i=t.x+t.width/2,n=o+t.height,d=e.append("g").lower(),c=d;a||(N++,Object.keys(t.links||{}).length&&!s.forceMenus&&c.attr("onclick",Bt(`actor${N}_popup`)).attr("cursor","pointer"),c.append("line").attr("id","actor"+N).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),c=d.append("g"),t.actorCnt=N,t.links!=null&&c.attr("id","root-"+N));let r=dt(),T="actor";t.properties?.class?T=t.properties.class:r.fill="#eaeaea",a?T+=` ${Et}`:T+=` ${Tt}`,r.x=t.x,r.y=o,r.width=t.width,r.height=t.height,r.class=T,r.name=t.name;let u=r.height/2,O=u/(2.5+r.height/50),E=c.append("g"),R=c.append("g");if(E.append("path").attr("d",`M ${r.x},${r.y+u} a ${O},${u} 0 0 0 0,${r.height} h ${r.width-2*O} a ${O},${u} 0 0 0 0,-${r.height} Z `).attr("class",T),R.append("path").attr("d",`M ${r.x},${r.y+u} a ${O},${u} 0 0 0 0,${r.height}`).attr("stroke","#666").attr("stroke-width","1px").attr("class",T),E.attr("transform",`translate(${O}, ${-(r.height/2)})`),R.attr("transform",`translate(${r.width-O}, ${-r.height/2})`),t.rectData=r,t.properties?.icon){let S=t.properties.icon.trim(),w=r.x+r.width-20,D=r.y+10;S.charAt(0)==="@"?Qt(c,w,D,S.substr(1)):Zt(c,w,D,S)}pt(s,H(t.description))(t.description,c,r.x,r.y,r.width,r.height,{class:`actor ${vt}`},s);let _=t.height,L=E.select("path:last-child");if(L.node()){let S=L.node().getBBox();t.height=S.height,_=S.height}return _},"drawActorTypeQueue"),Sa=g(function(e,t,s,a){let o=a?t.stopy:t.starty,i=t.x+t.width/2,n=o+75,d=e.append("g").lower();a||(N++,d.append("line").attr("id","actor"+N).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=N);let c=e.append("g"),r=xt;a?r+=` ${Et}`:r+=` ${Tt}`,c.attr("class",r),c.attr("name",t.name);let T=dt();T.x=t.x,T.y=o,T.fill="#eaeaea",T.width=t.width,T.height=t.height,T.class="actor";let u=t.x+t.width/2,O=o+32,E=22;c.append("defs").append("marker").attr("id","filled-head-control").attr("refX",11).attr("refY",5.8).attr("markerWidth",20).attr("markerHeight",28).attr("orient","172.5").append("path").attr("d","M 14.4 5.6 L 7.2 10.4 L 8.8 5.6 L 7.2 0.8 Z"),c.append("circle").attr("cx",u).attr("cy",O).attr("r",E).attr("fill","#eaeaf7").attr("stroke","#666").attr("stroke-width",1.2),c.append("line").attr("marker-end","url(#filled-head-control)").attr("transform",`translate(${u}, ${O-E})`);let R=c.node().getBBox();return t.height=R.height+2*(s?.sequence?.labelBoxHeight??0),pt(s,H(t.description))(t.description,c,T.x,T.y+E+(a?5:12),T.width,T.height,{class:`actor ${xt}`},s),t.height},"drawActorTypeControl"),Na=g(function(e,t,s,a){let o=a?t.stopy:t.starty,i=t.x+t.width/2,n=o+75,d=e.append("g").lower(),c=e.append("g"),r="actor";a?r+=` ${Et}`:r+=` ${Tt}`,c.attr("class",r),c.attr("name",t.name);let T=dt();T.x=t.x,T.y=o,T.fill="#eaeaea",T.width=t.width,T.height=t.height,T.class="actor";let u=t.x+t.width/2,O=o+(a?10:25),E=22;c.append("circle").attr("cx",u).attr("cy",O).attr("r",E).attr("width",t.width).attr("height",t.height),c.append("line").attr("x1",u-E).attr("x2",u+E).attr("y1",O+E).attr("y2",O+E).attr("stroke-width",2);let R=c.node().getBBox();return t.height=R.height+(s?.sequence?.labelBoxHeight??0),a||(N++,d.append("line").attr("id","actor"+N).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=N),pt(s,H(t.description))(t.description,c,T.x,T.y+(a?15:30),T.width,T.height,{class:`actor ${xt}`},s),a?c.attr("transform",`translate(0, ${E})`):c.attr("transform",`translate(0, ${E/2-5})`),t.height},"drawActorTypeEntity"),Da=g(function(e,t,s,a){let o=a?t.stopy:t.starty,i=t.x+t.width/2,n=o+t.height+2*s.boxTextMargin,d=e.append("g").lower(),c=d;a||(N++,Object.keys(t.links||{}).length&&!s.forceMenus&&c.attr("onclick",Bt(`actor${N}_popup`)).attr("cursor","pointer"),c.append("line").attr("id","actor"+N).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),c=d.append("g"),t.actorCnt=N,t.links!=null&&c.attr("id","root-"+N));let r=dt(),T="actor";t.properties?.class?T=t.properties.class:r.fill="#eaeaea",a?T+=` ${Et}`:T+=` ${Tt}`,r.x=t.x,r.y=o,r.width=t.width,r.height=t.height,r.class=T,r.name=t.name,r.x=t.x,r.y=o;let u=r.width/3,O=r.width/3,E=u/2,R=E/(2.5+u/50),_=c.append("g"),L=` M ${r.x},${r.y+R} a ${E},${R} 0 0 0 ${u},0 a ${E},${R} 0 0 0 -${u},0 l 0,${O-2*R} a ${E},${R} 0 0 0 ${u},0 l 0,-${O-2*R} `;_.append("path").attr("d",L).attr("fill","#eaeaea").attr("stroke","#000").attr("stroke-width",1).attr("class",T),_.attr("transform",`translate(${u}, ${R})`),t.rectData=r,pt(s,H(t.description))(t.description,c,r.x,r.y+35,r.width,r.height,{class:`actor ${vt}`},s);let S=_.select("path:last-child");if(S.node()){let w=S.node().getBBox();t.height=w.height+(s.sequence.labelBoxHeight??0)}return t.height},"drawActorTypeDatabase"),Aa=g(function(e,t,s,a){let o=a?t.stopy:t.starty,i=t.x+t.width/2,n=o+80,d=22,c=e.append("g").lower();a||(N++,c.append("line").attr("id","actor"+N).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=N);let r=e.append("g"),T=xt;a?T+=` ${Et}`:T+=` ${Tt}`,r.attr("class",T),r.attr("name",t.name);let u=dt();u.x=t.x,u.y=o,u.fill="#eaeaea",u.width=t.width,u.height=t.height,u.class="actor",r.append("line").attr("id","actor-man-torso"+N).attr("x1",t.x+t.width/2-d*2.5).attr("y1",o+12).attr("x2",t.x+t.width/2-15).attr("y2",o+12),r.append("line").attr("id","actor-man-arms"+N).attr("x1",t.x+t.width/2-d*2.5).attr("y1",o+2).attr("x2",t.x+t.width/2-d*2.5).attr("y2",o+22),r.append("circle").attr("cx",t.x+t.width/2).attr("cy",o+12).attr("r",d);let O=r.node().getBBox();return t.height=O.height+(s.sequence.labelBoxHeight??0),pt(s,H(t.description))(t.description,r,u.x,u.y+15,u.width,u.height,{class:`actor ${xt}`},s),a?r.attr("transform",`translate(0,${d/2+10})`):r.attr("transform",`translate(0,${d/2+10})`),t.height},"drawActorTypeBoundary"),ka=g(function(e,t,s,a){let o=a?t.stopy:t.starty,i=t.x+t.width/2,n=o+80,d=e.append("g").lower();a||(N++,d.append("line").attr("id","actor"+N).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=N);let c=e.append("g"),r=xt;a?r+=` ${Et}`:r+=` ${Tt}`,c.attr("class",r),c.attr("name",t.name);let T=dt();T.x=t.x,T.y=o,T.fill="#eaeaea",T.width=t.width,T.height=t.height,T.class="actor",T.rx=3,T.ry=3,c.append("line").attr("id","actor-man-torso"+N).attr("x1",i).attr("y1",o+25).attr("x2",i).attr("y2",o+45),c.append("line").attr("id","actor-man-arms"+N).attr("x1",i-Ot/2).attr("y1",o+33).attr("x2",i+Ot/2).attr("y2",o+33),c.append("line").attr("x1",i-Ot/2).attr("y1",o+60).attr("x2",i).attr("y2",o+45),c.append("line").attr("x1",i).attr("y1",o+45).attr("x2",i+Ot/2-2).attr("y2",o+60);let u=c.append("circle");u.attr("cx",t.x+t.width/2),u.attr("cy",o+10),u.attr("r",15),u.attr("width",t.width),u.attr("height",t.height);let O=c.node().getBBox();return t.height=O.height,pt(s,H(t.description))(t.description,c,T.x,T.y+35,T.width,T.height,{class:`actor ${xt}`},s),t.height},"drawActorTypeActor"),Ma=g(async function(e,t,s,a){switch(t.type){case"actor":return await ka(e,t,s,a);case"participant":return await La(e,t,s,a);case"boundary":return await Aa(e,t,s,a);case"control":return await Sa(e,t,s,a);case"entity":return await Na(e,t,s,a);case"database":return await Da(e,t,s,a);case"collections":return await Pa(e,t,s,a);case"queue":return await wa(e,t,s,a)}},"drawActor"),Ca=g(function(e,t,s){let a=e.append("g");$e(a,t),t.name&&pt(s)(t.name,a,t.x,t.y+s.boxTextMargin+(t.textMaxHeight||0)/2,t.width,0,{class:"text"},s),a.lower()},"drawBox"),va=g(function(e){return e.append("g")},"anchorElement"),Ba=g(function(e,t,s,a,o){let i=dt(),n=t.anchored;i.x=t.startx,i.y=t.starty,i.class="activation"+o%3,i.width=t.stopx-t.startx,i.height=s-t.starty,ft(n,i)},"drawActivation"),Ya=g(async function(e,t,s,a){let{boxMargin:o,boxTextMargin:i,labelBoxHeight:n,labelBoxWidth:d,messageFontFamily:c,messageFontSize:r,messageFontWeight:T}=a,u=e.append("g"),O=g(function(_,L,S,w){return u.append("line").attr("x1",_).attr("y1",L).attr("x2",S).attr("y2",w).attr("class","loopLine")},"drawLoopLine");O(t.startx,t.starty,t.stopx,t.starty),O(t.stopx,t.starty,t.stopx,t.stopy),O(t.startx,t.stopy,t.stopx,t.stopy),O(t.startx,t.starty,t.startx,t.stopy),t.sections!==void 0&&t.sections.forEach(function(_){O(t.startx,_.y,t.stopx,_.y).style("stroke-dasharray","3, 3")});let E=Jt();E.text=s,E.x=t.startx,E.y=t.starty,E.fontFamily=c,E.fontSize=r,E.fontWeight=T,E.anchor="middle",E.valign="middle",E.tspan=!1,E.width=d||50,E.height=n||20,E.textMargin=i,E.class="labelText",Be(u,E),E=Ve(),E.text=t.title,E.x=t.startx+d/2+(t.stopx-t.startx)/2,E.y=t.starty+o+i,E.anchor="middle",E.valign="middle",E.textMargin=i,E.class="loopText",E.fontFamily=c,E.fontSize=r,E.fontWeight=T,E.wrap=!0;let R=H(E.text)?await Ct(u,E,t):It(u,E);if(t.sectionTitles!==void 0){for(let[_,L]of Object.entries(t.sectionTitles))if(L.message){E.text=L.message,E.x=t.startx+(t.stopx-t.startx)/2,E.y=t.sections[_].y+o+i,E.class="loopText",E.anchor="middle",E.valign="middle",E.tspan=!1,E.fontFamily=c,E.fontSize=r,E.fontWeight=T,E.wrap=t.wrap,H(E.text)?(t.starty=t.sections[_].y,await Ct(u,E,t)):It(u,E);let S=Math.round(R.map(w=>(w._groups||w)[0][0].getBBox().height).reduce((w,D)=>w+D));t.sections[_].height+=S-(o+i)}}return t.height=Math.round(t.stopy-t.starty),u},"drawLoop"),$e=g(function(e,t){ua(e,t)},"drawBackgroundRect"),$a=g(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"),Va=g(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"),Wa=g(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"),Fa=g(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"),Ka=g(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"),qa=g(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"),Ha=g(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"),Ve=g(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"),za=g(function(){return{x:0,y:0,fill:"#EDF2AE",stroke:"#666",width:100,anchor:"start",height:100,rx:0,ry:0}},"getNoteRect"),pt=(function(){function e(i,n,d,c,r,T,u){let O=n.append("text").attr("x",d+r/2).attr("y",c+T/2+5).style("text-anchor","middle").text(i);o(O,u)}g(e,"byText");function t(i,n,d,c,r,T,u,O){let{actorFontSize:E,actorFontFamily:R,actorFontWeight:_}=O,[L,S]=Me(E),w=i.split(P.lineBreakRegex);for(let D=0;De.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:g(function(){this.actors=[],this.boxes=[],this.loops=[],this.messages=[],this.notes=[]},"clear"),addBox:g(function(e){this.boxes.push(e)},"addBox"),addActor:g(function(e){this.actors.push(e)},"addActor"),addLoop:g(function(e){this.loops.push(e)},"addLoop"),addMessage:g(function(e){this.messages.push(e)},"addMessage"),addNote:g(function(e){this.notes.push(e)},"addNote"),lastActor:g(function(){return this.actors[this.actors.length-1]},"lastActor"),lastLoop:g(function(){return this.loops[this.loops.length-1]},"lastLoop"),lastMessage:g(function(){return this.messages[this.messages.length-1]},"lastMessage"),lastNote:g(function(){return this.notes[this.notes.length-1]},"lastNote"),actors:[],boxes:[],loops:[],messages:[],notes:[]},init:g(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,Ke(et())},"init"),updateVal:g(function(e,t,s,a){e[t]===void 0?e[t]=s:e[t]=a(s,e[t])},"updateVal"),updateBounds:g(function(e,t,s,a){let o=this,i=0;function n(d){return g(function(c){i++;let r=o.sequenceItems.length-i+1;o.updateVal(c,"starty",t-r*h.boxMargin,Math.min),o.updateVal(c,"stopy",a+r*h.boxMargin,Math.max),o.updateVal(y.data,"startx",e-r*h.boxMargin,Math.min),o.updateVal(y.data,"stopx",s+r*h.boxMargin,Math.max),d!=="activation"&&(o.updateVal(c,"startx",e-r*h.boxMargin,Math.min),o.updateVal(c,"stopx",s+r*h.boxMargin,Math.max),o.updateVal(y.data,"starty",t-r*h.boxMargin,Math.min),o.updateVal(y.data,"stopy",a+r*h.boxMargin,Math.max))},"updateItemBounds")}g(n,"updateFn"),this.sequenceItems.forEach(n()),this.activations.forEach(n("activation"))},"updateBounds"),insert:g(function(e,t,s,a){let o=P.getMin(e,s),i=P.getMax(e,s),n=P.getMin(t,a),d=P.getMax(t,a);this.updateVal(y.data,"startx",o,Math.min),this.updateVal(y.data,"starty",n,Math.min),this.updateVal(y.data,"stopx",i,Math.max),this.updateVal(y.data,"stopy",d,Math.max),this.updateBounds(o,n,i,d)},"insert"),newActivation:g(function(e,t,s){let a=s.get(e.from),o=Yt(e.from).length||0,i=a.x+a.width/2+(o-1)*h.activationWidth/2;this.activations.push({startx:i,starty:this.verticalPos+2,stopx:i+h.activationWidth,stopy:void 0,actor:e.from,anchored:Y.anchorElement(t)})},"newActivation"),endActivation:g(function(e){let t=this.activations.map(function(s){return s.actor}).lastIndexOf(e.from);return this.activations.splice(t,1)[0]},"endActivation"),createLoop:g(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:g(function(e={message:void 0,wrap:!1,width:void 0},t){this.sequenceItems.push(this.createLoop(e,t))},"newLoop"),endLoop:g(function(){return this.sequenceItems.pop()},"endLoop"),isLoopOverlap:g(function(){return this.sequenceItems.length?this.sequenceItems[this.sequenceItems.length-1].overlap:!1},"isLoopOverlap"),addSectionToLoop:g(function(e){let t=this.sequenceItems.pop();t.sections=t.sections||[],t.sectionTitles=t.sectionTitles||[],t.sections.push({y:y.getVerticalPos(),height:0}),t.sectionTitles.push(e),this.sequenceItems.push(t)},"addSectionToLoop"),saveVerticalPos:g(function(){this.isLoopOverlap()&&(this.savedVerticalPos=this.verticalPos)},"saveVerticalPos"),resetVerticalPos:g(function(){this.isLoopOverlap()&&(this.verticalPos=this.savedVerticalPos)},"resetVerticalPos"),bumpVerticalPos:g(function(e){this.verticalPos=this.verticalPos+e,this.data.stopy=P.getMax(this.data.stopy,this.verticalPos)},"bumpVerticalPos"),getVerticalPos:g(function(){return this.verticalPos},"getVerticalPos"),getBounds:g(function(){return{bounds:this.data,models:this.models}},"getBounds")},Qa=g(async function(e,t){y.bumpVerticalPos(h.boxMargin),t.height=h.boxMargin,t.starty=y.getVerticalPos();let s=dt();s.x=t.startx,s.y=t.starty,s.width=t.width||h.width,s.class="note";let a=e.append("g"),o=Y.drawRect(a,s),i=Jt();i.x=t.startx,i.y=t.starty,i.width=s.width,i.dy="1em",i.text=t.message,i.class="noteText",i.fontFamily=h.noteFontFamily,i.fontSize=h.noteFontSize,i.fontWeight=h.noteFontWeight,i.anchor=h.noteAlign,i.textMargin=h.noteMargin,i.valign="center";let n=H(i.text)?await Ct(a,i):It(a,i),d=Math.round(n.map(c=>(c._groups||c)[0][0].getBBox().height).reduce((c,r)=>c+r));o.attr("height",d+2*h.noteMargin),t.height+=d+2*h.noteMargin,y.bumpVerticalPos(d+2*h.noteMargin),t.stopy=t.starty+d+2*h.noteMargin,t.stopx=t.startx+s.width,y.insert(t.startx,t.starty,t.stopx,t.stopy),y.models.addNote(t)},"drawNote"),Za=g(function(e,t,s,a,o,i,n){let d=a.db.getActors(),c=d.get(t.from),r=d.get(t.to),T=s.sequenceVisible,u=c.x+c.width/2,O=r.x+r.width/2,E=u<=O,R=Ue(t,a),_=e.append("g"),L=16.5,S=g(($,V)=>{let K=$?L:-L;return V?-K:K},"getCircleOffset"),w=g($=>{_.append("circle").attr("cx",$).attr("cy",n).attr("r",5).attr("width",10).attr("height",10)},"drawCircle"),{CENTRAL_CONNECTION:D,CENTRAL_CONNECTION_REVERSE:A,CENTRAL_CONNECTION_DUAL:v}=a.db.LINETYPE;if(T)switch(t.centralConnection){case D:R&&(O+=S(E,!0));break;case A:R||(u+=S(E,!1));break;case v:R?O+=S(E,!0):u+=S(E,!1);break}switch(t.centralConnection){case D:w(O);break;case A:w(u);break;case v:w(u),w(O);break}},"drawCentralConnection"),yt=g(e=>({fontFamily:e.messageFontFamily,fontSize:e.messageFontSize,fontWeight:e.messageFontWeight}),"messageFont"),_t=g(e=>({fontFamily:e.noteFontFamily,fontSize:e.noteFontSize,fontWeight:e.noteFontWeight}),"noteFont"),Xt=g(e=>({fontFamily:e.actorFontFamily,fontSize:e.actorFontSize,fontWeight:e.actorFontWeight}),"actorFont");async function We(e,t){y.bumpVerticalPos(10);let{startx:s,stopx:a,message:o}=t,i=P.splitBreaks(o).length,n=H(o),d=n?await Lt(o,et()):F.calculateTextDimensions(o,yt(h));if(!n){let u=d.height/i;t.height+=u,y.bumpVerticalPos(u)}let c,r=d.height-10,T=d.width;if(s===a){c=y.getVerticalPos()+r,h.rightAngles||(r+=h.boxMargin,c=y.getVerticalPos()+r),r+=30;let u=P.getMax(T/2,h.width/2);y.insert(s-u,y.getVerticalPos()-10+r,a+u,y.getVerticalPos()+30+r)}else r+=h.boxMargin,c=y.getVerticalPos()+r,y.insert(s,c-10,a,c);return y.bumpVerticalPos(r),t.height+=r,t.stopy=t.starty+t.height,y.insert(t.fromBounds,t.starty,t.toBounds,t.stopy),c}g(We,"boundMessage");var tr=g(async function(e,t,s,a,o){let{startx:i,stopx:n,starty:d,message:c,type:r,sequenceIndex:T,sequenceVisible:u}=t,O=F.calculateTextDimensions(c,yt(h)),E=Jt();E.x=i,E.y=d+10,E.width=n-i,E.class="messageText",E.dy="1em",E.text=c,E.fontFamily=h.messageFontFamily,E.fontSize=h.messageFontSize,E.fontWeight=h.messageFontWeight,E.anchor=h.messageAlign,E.valign="center",E.textMargin=h.wrapPadding,E.tspan=!1,H(E.text)?await Ct(e,E,{startx:i,stopx:n,starty:s}):It(e,E);let R=O.width,_;if(i===n){let S=u||h.showSequenceNumbers,w=Ue(o,a),D=nr(o,a),A=i+(S&&(w||D)?10:0);h.rightAngles?_=e.append("path").attr("d",`M ${A},${s} H ${i+P.getMax(h.width/2,R/2)} V ${s+25} H ${i}`):_=e.append("path").attr("d","M "+A+","+s+" C "+(A+60)+","+(s-10)+" "+(i+60)+","+(s+30)+" "+i+","+(s+20))}else _=e.append("line"),_.attr("x1",i),_.attr("y1",s),_.attr("x2",n),_.attr("y2",s),ke(o,a)&&Za(e,o,t,a,i,n,s);r===a.db.LINETYPE.DOTTED||r===a.db.LINETYPE.DOTTED_CROSS||r===a.db.LINETYPE.DOTTED_POINT||r===a.db.LINETYPE.DOTTED_OPEN||r===a.db.LINETYPE.BIDIRECTIONAL_DOTTED||r===a.db.LINETYPE.SOLID_TOP_DOTTED||r===a.db.LINETYPE.SOLID_BOTTOM_DOTTED||r===a.db.LINETYPE.STICK_TOP_DOTTED||r===a.db.LINETYPE.STICK_BOTTOM_DOTTED||r===a.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED||r===a.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED||r===a.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED||r===a.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED?(_.style("stroke-dasharray","3, 3"),_.attr("class","messageLine1")):_.attr("class","messageLine0");let L="";if(h.arrowMarkerAbsolute&&(L=ga(!0)),_.attr("stroke-width",2),_.attr("stroke","none"),_.style("fill","none"),(r===a.db.LINETYPE.SOLID_TOP||r===a.db.LINETYPE.SOLID_TOP_DOTTED)&&_.attr("marker-end","url("+L+"#solidTopArrowHead)"),(r===a.db.LINETYPE.SOLID_BOTTOM||r===a.db.LINETYPE.SOLID_BOTTOM_DOTTED)&&_.attr("marker-end","url("+L+"#solidBottomArrowHead)"),(r===a.db.LINETYPE.STICK_TOP||r===a.db.LINETYPE.STICK_TOP_DOTTED)&&_.attr("marker-end","url("+L+"#stickTopArrowHead)"),(r===a.db.LINETYPE.STICK_BOTTOM||r===a.db.LINETYPE.STICK_BOTTOM_DOTTED)&&_.attr("marker-end","url("+L+"#stickBottomArrowHead)"),(r===a.db.LINETYPE.SOLID_ARROW_TOP_REVERSE||r===a.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED)&&_.attr("marker-start","url("+L+"#solidBottomArrowHead)"),(r===a.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE||r===a.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED)&&_.attr("marker-start","url("+L+"#solidTopArrowHead)"),(r===a.db.LINETYPE.STICK_ARROW_TOP_REVERSE||r===a.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED)&&_.attr("marker-start","url("+L+"#stickBottomArrowHead)"),(r===a.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE||r===a.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED)&&_.attr("marker-start","url("+L+"#stickTopArrowHead)"),(r===a.db.LINETYPE.SOLID||r===a.db.LINETYPE.DOTTED)&&_.attr("marker-end","url("+L+"#arrowhead)"),(r===a.db.LINETYPE.BIDIRECTIONAL_SOLID||r===a.db.LINETYPE.BIDIRECTIONAL_DOTTED)&&(_.attr("marker-start","url("+L+"#arrowhead)"),_.attr("marker-end","url("+L+"#arrowhead)")),(r===a.db.LINETYPE.SOLID_POINT||r===a.db.LINETYPE.DOTTED_POINT)&&_.attr("marker-end","url("+L+"#filled-head)"),(r===a.db.LINETYPE.SOLID_CROSS||r===a.db.LINETYPE.DOTTED_CROSS)&&_.attr("marker-end","url("+L+"#crosshead)"),u||h.showSequenceNumbers){let S=r===a.db.LINETYPE.BIDIRECTIONAL_SOLID||r===a.db.LINETYPE.BIDIRECTIONAL_DOTTED,w=r===a.db.LINETYPE.SOLID_ARROW_TOP_REVERSE||r===a.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED||r===a.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE||r===a.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED||r===a.db.LINETYPE.STICK_ARROW_TOP_REVERSE||r===a.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED||r===a.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE||r===a.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,D=6,A=ke(o,a),v=i,$=n;S?(ii?$=n-2*D:($=n-D,v+=o?.centralConnection===a.db.LINETYPE.CENTRAL_CONNECTION_DUAL||o?.centralConnection===a.db.LINETYPE.CENTRAL_CONNECTION_REVERSE?-7.5:0),$+=A?15:0,_.attr("x2",$),_.attr("x1",v)):_.attr("x1",i+D);let V=0,K=i===n,z=i<=n;K?V=t.fromBounds+1:w?V=z?t.toBounds-1:t.fromBounds+1:V=z?t.fromBounds+1:t.toBounds-1,e.append("line").attr("x1",V).attr("y1",s).attr("x2",V).attr("y2",s).attr("stroke-width",0).attr("marker-start","url("+L+"#sequencenumber)"),e.append("text").attr("x",V).attr("y",s+4).attr("font-family","sans-serif").attr("font-size","12px").attr("text-anchor","middle").attr("class","sequenceNumber").text(T)}},"drawMessage"),er=g(function(e,t,s,a,o,i,n){let d=0,c=0,r,T=0;for(let u of a){let O=t.get(u),E=O.box;r&&r!=E&&(n||y.models.addBox(r),c+=h.boxMargin+r.margin),E&&E!=r&&(n||(E.x=d+c,E.y=o),c+=E.margin),O.width=O.width||h.width,O.height=P.getMax(O.height||h.height,h.height),O.margin=O.margin||h.actorMargin,T=P.getMax(T,O.height),s.get(O.name)&&(c+=O.width/2),O.x=d+c,O.starty=y.getVerticalPos(),y.insert(O.x,o,O.x+O.width,O.height),d+=O.width+c,O.box&&(O.box.width=d+E.margin-O.box.x),c=O.margin,r=O.box,y.models.addActor(O)}r&&!n&&y.models.addBox(r),y.bumpVerticalPos(T)},"addActorRenderingData"),Gt=g(async function(e,t,s,a){if(a){let o=0;y.bumpVerticalPos(h.boxMargin*2);for(let i of s){let n=t.get(i);n.stopy||(n.stopy=y.getVerticalPos());let d=await Y.drawActor(e,n,h,!0);o=P.getMax(o,d)}y.bumpVerticalPos(o+h.boxMargin)}else for(let o of s){let i=t.get(o);await Y.drawActor(e,i,h,!1)}},"drawActors"),Fe=g(function(e,t,s,a){let o=0,i=0;for(let n of s){let d=t.get(n),c=rr(d),r=Y.drawPopup(e,d,c,h,h.forceMenus,a);r.height>o&&(o=r.height),r.width+d.x>i&&(i=r.width+d.x)}return{maxHeight:o,maxWidth:i}},"drawActorsPopup"),Ke=g(function(e){ra(h,e),e.fontFamily&&(h.actorFontFamily=h.noteFontFamily=h.messageFontFamily=e.fontFamily),e.fontSize&&(h.actorFontSize=h.noteFontSize=h.messageFontSize=e.fontSize),e.fontWeight&&(h.actorFontWeight=h.noteFontWeight=h.messageFontWeight=e.fontWeight)},"setConf"),Yt=g(function(e){return y.activations.filter(function(t){return t.actor===e})},"actorActivations"),Ae=g(function(e,t){let s=t.get(e),a=Yt(e),o=a.reduce(function(n,d){return P.getMin(n,d.startx)},s.x+s.width/2-1),i=a.reduce(function(n,d){return P.getMax(n,d.stopx)},s.x+s.width/2+1);return[o,i]},"activationBounds");function lt(e,t,s,a,o){y.bumpVerticalPos(s);let i=a;if(t.id&&t.message&&e[t.id]){let n=e[t.id].width,d=yt(h);t.message=F.wrapLabel(`[${t.message}]`,n-2*h.wrapPadding,d),t.width=n,t.wrap=!0;let c=F.calculateTextDimensions(t.message,d),r=P.getMax(c.height,h.labelBoxHeight);i=a+r,J.debug(`${r} - ${t.message}`)}o(t),y.bumpVerticalPos(i)}g(lt,"adjustLoopHeightForWrap");function qe(e,t,s,a,o,i,n){function d(T,u){T.x{m.add(b.from),m.add(b.to)}),R=R.filter(b=>m.has(b))}er(r,T,u,R,0,_,!1);let A=await cr(_,T,D,a);Y.insertArrowHead(r),Y.insertArrowCrossHead(r),Y.insertArrowFilledHead(r),Y.insertSequenceNumber(r),Y.insertSolidTopArrowHead(r),Y.insertSolidBottomArrowHead(r),Y.insertStickTopArrowHead(r),Y.insertStickBottomArrowHead(r);function v(m,b){let ot=y.endActivation(m);ot.starty+18>b&&(ot.starty=b-6,b+=12),Y.drawActivation(r,ot,b,h,Yt(m.from).length),y.insert(ot.startx,b-10,ot.stopx,b)}g(v,"activeEnd");let $=1,V=1,K=[],z=[],U=0;for(let m of _){let b,ot,nt;switch(m.type){case a.db.LINETYPE.NOTE:y.resetVerticalPos(),ot=m.noteModel,await Qa(r,ot);break;case a.db.LINETYPE.ACTIVE_START:y.newActivation(m,r,T);break;case a.db.LINETYPE.CENTRAL_CONNECTION:y.newActivation(m,r,T);break;case a.db.LINETYPE.CENTRAL_CONNECTION_REVERSE:y.newActivation(m,r,T);break;case a.db.LINETYPE.ACTIVE_END:v(m,y.getVerticalPos());break;case a.db.LINETYPE.LOOP_START:lt(A,m,h.boxMargin,h.boxMargin+h.boxTextMargin,C=>y.newLoop(C));break;case a.db.LINETYPE.LOOP_END:b=y.endLoop(),await Y.drawLoop(r,b,"loop",h),y.bumpVerticalPos(b.stopy-y.getVerticalPos()),y.models.addLoop(b);break;case a.db.LINETYPE.RECT_START:lt(A,m,h.boxMargin,h.boxMargin,C=>y.newLoop(void 0,C.message));break;case a.db.LINETYPE.RECT_END:b=y.endLoop(),z.push(b),y.models.addLoop(b),y.bumpVerticalPos(b.stopy-y.getVerticalPos());break;case a.db.LINETYPE.OPT_START:lt(A,m,h.boxMargin,h.boxMargin+h.boxTextMargin,C=>y.newLoop(C));break;case a.db.LINETYPE.OPT_END:b=y.endLoop(),await Y.drawLoop(r,b,"opt",h),y.bumpVerticalPos(b.stopy-y.getVerticalPos()),y.models.addLoop(b);break;case a.db.LINETYPE.ALT_START:lt(A,m,h.boxMargin,h.boxMargin+h.boxTextMargin,C=>y.newLoop(C));break;case a.db.LINETYPE.ALT_ELSE:lt(A,m,h.boxMargin+h.boxTextMargin,h.boxMargin,C=>y.addSectionToLoop(C));break;case a.db.LINETYPE.ALT_END:b=y.endLoop(),await Y.drawLoop(r,b,"alt",h),y.bumpVerticalPos(b.stopy-y.getVerticalPos()),y.models.addLoop(b);break;case a.db.LINETYPE.PAR_START:case a.db.LINETYPE.PAR_OVER_START:lt(A,m,h.boxMargin,h.boxMargin+h.boxTextMargin,C=>y.newLoop(C)),y.saveVerticalPos();break;case a.db.LINETYPE.PAR_AND:lt(A,m,h.boxMargin+h.boxTextMargin,h.boxMargin,C=>y.addSectionToLoop(C));break;case a.db.LINETYPE.PAR_END:b=y.endLoop(),await Y.drawLoop(r,b,"par",h),y.bumpVerticalPos(b.stopy-y.getVerticalPos()),y.models.addLoop(b);break;case a.db.LINETYPE.AUTONUMBER:$=m.message.start||$,V=m.message.step||V,m.message.visible?a.db.enableSequenceNumbers():a.db.disableSequenceNumbers();break;case a.db.LINETYPE.CRITICAL_START:lt(A,m,h.boxMargin,h.boxMargin+h.boxTextMargin,C=>y.newLoop(C));break;case a.db.LINETYPE.CRITICAL_OPTION:lt(A,m,h.boxMargin+h.boxTextMargin,h.boxMargin,C=>y.addSectionToLoop(C));break;case a.db.LINETYPE.CRITICAL_END:b=y.endLoop(),await Y.drawLoop(r,b,"critical",h),y.bumpVerticalPos(b.stopy-y.getVerticalPos()),y.models.addLoop(b);break;case a.db.LINETYPE.BREAK_START:lt(A,m,h.boxMargin,h.boxMargin+h.boxTextMargin,C=>y.newLoop(C));break;case a.db.LINETYPE.BREAK_END:b=y.endLoop(),await Y.drawLoop(r,b,"break",h),y.bumpVerticalPos(b.stopy-y.getVerticalPos()),y.models.addLoop(b);break;default:try{nt=m.msgModel,nt.starty=y.getVerticalPos(),nt.sequenceIndex=$,nt.sequenceVisible=a.db.showSequenceNumbers();let C=await We(r,nt);qe(m,nt,C,U,T,u,O),K.push({messageModel:nt,lineStartY:C,msg:m}),y.models.addMessage(nt)}catch(C){J.error("error while drawing message",C)}}[a.db.LINETYPE.SOLID_OPEN,a.db.LINETYPE.DOTTED_OPEN,a.db.LINETYPE.SOLID,a.db.LINETYPE.SOLID_TOP,a.db.LINETYPE.SOLID_BOTTOM,a.db.LINETYPE.STICK_TOP,a.db.LINETYPE.STICK_BOTTOM,a.db.LINETYPE.SOLID_TOP_DOTTED,a.db.LINETYPE.SOLID_BOTTOM_DOTTED,a.db.LINETYPE.STICK_TOP_DOTTED,a.db.LINETYPE.STICK_BOTTOM_DOTTED,a.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,a.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE,a.db.LINETYPE.STICK_ARROW_TOP_REVERSE,a.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE,a.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,a.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,a.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED,a.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,a.db.LINETYPE.DOTTED,a.db.LINETYPE.SOLID_CROSS,a.db.LINETYPE.DOTTED_CROSS,a.db.LINETYPE.SOLID_POINT,a.db.LINETYPE.DOTTED_POINT,a.db.LINETYPE.BIDIRECTIONAL_SOLID,a.db.LINETYPE.BIDIRECTIONAL_DOTTED].includes(m.type)&&($=$+V),U++}J.debug("createdActors",u),J.debug("destroyedActors",O),await Gt(r,T,R,!1);for(let m of K)await tr(r,m.messageModel,m.lineStartY,a,m.msg);h.mirrorActors&&await Gt(r,T,R,!0),z.forEach(m=>Y.drawBackgroundRect(r,m)),Ye(r,T,R,h);for(let m of y.models.boxes){m.height=y.getVerticalPos()-m.y,y.insert(m.x,m.y,m.x+m.width,m.height);let b=h.boxMargin*2;m.startx=m.x-b,m.starty=m.y-b*.25,m.stopx=m.startx+m.width+2*b,m.stopy=m.starty+m.height+b*.75,m.stroke="rgb(0,0,0, 0.5)",Y.drawBox(r,m,h)}S&&y.bumpVerticalPos(h.boxMargin);let q=Fe(r,T,R,c),{bounds:k}=y.getBounds();k.startx===void 0&&(k.startx=0),k.starty===void 0&&(k.starty=0),k.stopx===void 0&&(k.stopx=0),k.stopy===void 0&&(k.stopy=0);let Q=k.stopy-k.starty;Q{let n=yt(h),d=i.actorKeys.reduce((u,O)=>u+=e.get(O).width+(e.get(O).margin||0),0),c=h.boxMargin*8;d+=c,d-=2*h.boxTextMargin,i.wrap&&(i.name=F.wrapLabel(i.name,d-2*h.wrapPadding,n));let r=F.calculateTextDimensions(i.name,n);o=P.getMax(r.height,o);let T=P.getMax(d,r.width+2*h.wrapPadding);if(i.margin=h.boxTextMargin,di.textMaxHeight=o),P.getMax(a,h.height)}g(ze,"calculateActorMargins");var sr=g(async function(e,t,s){let a=t.get(e.from),o=t.get(e.to),i=a.x,n=o.x,d=e.wrap&&e.message,c=H(e.message)?await Lt(e.message,et()):F.calculateTextDimensions(d?F.wrapLabel(e.message,h.width,_t(h)):e.message,_t(h)),r={width:d?h.width:P.getMax(h.width,c.width+2*h.noteMargin),height:0,startx:a.x,stopx:0,starty:0,stopy:0,message:e.message};return e.placement===s.db.PLACEMENT.RIGHTOF?(r.width=d?P.getMax(h.width,c.width):P.getMax(a.width/2+o.width/2,c.width+2*h.noteMargin),r.startx=i+(a.width+h.actorMargin)/2):e.placement===s.db.PLACEMENT.LEFTOF?(r.width=d?P.getMax(h.width,c.width+2*h.noteMargin):P.getMax(a.width/2+o.width/2,c.width+2*h.noteMargin),r.startx=i-r.width+(a.width-h.actorMargin)/2):e.to===e.from?(c=F.calculateTextDimensions(d?F.wrapLabel(e.message,P.getMax(h.width,a.width),_t(h)):e.message,_t(h)),r.width=d?P.getMax(h.width,a.width):P.getMax(a.width,h.width,c.width+2*h.noteMargin),r.startx=i+(a.width-r.width)/2):(r.width=Math.abs(i+a.width/2-(n+o.width/2))+h.actorMargin,r.startx=i2,u=g(_=>d?-_:_,"adjustValue");e.from===e.to?r=c:(e.activate&&!T&&(r+=u(h.activationWidth/2-1)),[s.db.LINETYPE.SOLID_OPEN,s.db.LINETYPE.DOTTED_OPEN,s.db.LINETYPE.STICK_TOP,s.db.LINETYPE.STICK_BOTTOM,s.db.LINETYPE.STICK_TOP_DOTTED,s.db.LINETYPE.STICK_BOTTOM_DOTTED,s.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,s.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,s.db.LINETYPE.STICK_ARROW_TOP_REVERSE,s.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE,s.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED,s.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,s.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,s.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE].includes(e.type)||(r+=u(3)),[s.db.LINETYPE.BIDIRECTIONAL_SOLID,s.db.LINETYPE.BIDIRECTIONAL_DOTTED,s.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,s.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,s.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,s.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE].includes(e.type)&&(c-=u(3)));let O=[a,o,i,n],E=Math.abs(c-r);e.wrap&&e.message&&(e.message=F.wrapLabel(e.message,P.getMax(E+2*h.wrapPadding,h.width),yt(h)));let R=F.calculateTextDimensions(e.message,yt(h));return{width:P.getMax(e.wrap?0:R.width+2*h.wrapPadding,E+2*h.wrapPadding,h.width),height:0,startx:c,stopx:r,starty:0,stopy:0,message:e.message,type:e.type,wrap:e.wrap,fromBounds:Math.min.apply(null,O),toBounds:Math.max.apply(null,O)}},"buildMessageModel"),cr=g(async function(e,t,s,a){let o={},i=[],n,d,c;for(let r of e){switch(r.type){case a.db.LINETYPE.LOOP_START:case a.db.LINETYPE.ALT_START:case a.db.LINETYPE.OPT_START:case a.db.LINETYPE.PAR_START:case a.db.LINETYPE.PAR_OVER_START:case a.db.LINETYPE.CRITICAL_START:case a.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 a.db.LINETYPE.ALT_ELSE:case a.db.LINETYPE.PAR_AND:case a.db.LINETYPE.CRITICAL_OPTION:r.message&&(n=i.pop(),o[n.id]=n,o[r.id]=n,i.push(n));break;case a.db.LINETYPE.LOOP_END:case a.db.LINETYPE.ALT_END:case a.db.LINETYPE.OPT_END:case a.db.LINETYPE.PAR_END:case a.db.LINETYPE.CRITICAL_END:case a.db.LINETYPE.BREAK_END:n=i.pop(),o[n.id]=n;break;case a.db.LINETYPE.ACTIVE_START:{let T=t.get(r.from?r.from:r.to.actor),u=Yt(r.from?r.from:r.to.actor).length,O=T.x+T.width/2+(u-1)*h.activationWidth/2,E={startx:O,stopx:O+h.activationWidth,actor:r.from,enabled:!0};y.activations.push(E)}break;case a.db.LINETYPE.ACTIVE_END:{let T=y.activations.map(u=>u.actor).lastIndexOf(r.from);y.activations.splice(T,1).splice(0,1)}break}r.placement!==void 0?(d=await sr(r,t,a),r.noteModel=d,i.forEach(T=>{n=T,n.from=P.getMin(n.from,d.startx),n.to=P.getMax(n.to,d.startx+d.width),n.width=P.getMax(n.width,Math.abs(n.from-n.to))-h.labelBoxWidth})):(c=lr(r,t,a),r.msgModel=c,c.startx&&c.stopx&&i.length>0&&i.forEach(T=>{if(n=T,c.startx===c.stopx){let u=t.get(r.from),O=t.get(r.to);n.from=P.getMin(u.x-c.width/2,u.x-u.width/2,n.from),n.to=P.getMax(O.x+c.width/2,O.x+u.width/2,n.to),n.width=P.getMax(n.width,Math.abs(n.to-n.from))-h.labelBoxWidth}else n.from=P.getMin(c.startx,n.from),n.to=P.getMax(c.stopx,n.to),n.width=P.getMax(n.width,c.width)-h.labelBoxWidth}))}return y.activations=[],J.debug("Loop type widths:",o),o},"calculateLoopBounds"),dr={bounds:y,drawActors:Gt,drawActorsPopup:Fe,setConf:Ke,draw:ar},ur={parser:xa,get db(){return new ma},renderer:dr,styles:Ra,init:g(e=>{e.sequence||(e.sequence={}),e.wrap&&(e.sequence.wrap=e.wrap,ea({sequence:{wrap:e.wrap}}))},"init")};export{ur as diagram};